summary refs log tree commit diff
diff options
context:
space:
mode:
authorRobert Günzler <r@gnzler.io>2022-11-18 18:19:51 +0100
committerRobert Günzler <r@gnzler.io>2022-11-18 18:38:23 +0100
commitd926185e405af5dcdf2d23c2d50366d68ccaa678 (patch)
tree1ca25c7dc97a4a09eef7773cb0f8bd426a859d25
parent008e5588049141ac81041589fc785f49802fd8db (diff)
bin: drop rm and qemuu
-rwxr-xr-xbin/qemuu56
-rwxr-xr-xbin/rm38
2 files changed, 0 insertions, 94 deletions
diff --git a/bin/qemuu b/bin/qemuu
deleted file mode 100755
index 3e4548c..0000000
--- a/bin/qemuu
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/bin/sh
-
-Q_ARCH='x86_64'
-Q_NAME='qemu'
-Q_SSH_PORT='2222'
-
-USAGE="usage: `basename $0` [options] [--] [qemu options...]
-Options:
-    -A ARCH     VM architecture
-    -p PORT     The port on localhost to map to the VM's sshd. [2222]
-    -d FILE     Set disk
-    -n NAME     Set name
-    -h          This ;-)
-
-A simple wrapper around qemu for running balenaOS images.
-See the qemu(1) man page for more details.
-"
-
-Q_ARGS=""
-
-while getopts ":hvd:A:n:" o; do
-    case "$o" in
-        A)
-            Q_ARCH="$OPTARG"
-            die "Found \"-$o $Q_ARCH\", not supported yet!" ;;
-        d)
-            Q_DISK="$OPTARG"
-            Q_ARGS="${Q_ARGS} -drive file="${Q_DISK}",media=disk,cache=none,format=raw" ;;
-        p)
-            Q_SSH_PORT="$OPTARG" ;;
-        n)
-            Q_NAME="$OPTARG" ;;
-        v)
-            set -x ;;
-        h|*)
-            echo "$USAGE"
-            exit ;;
-    esac
-done
-shift $(($OPTIND-1))
-
-case "${Q_ARCH}" in
-    x86_64|amd64)
-        qemu-system-x86_64 \
-            -name "$Q_NAME" \
-            -object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0 \
-            -net nic,model=virtio -net user \
-            -nic user,hostfwd=tcp::${Q_SSH_PORT}-:22222 \
-            -machine type=pc,accel=kvm -smp 4 -cpu host \
-            ${Q_ARGS} \
-            "$@"
-        ;;
-    *) die "Unsupported arch" ;;
-esac
-
-exit $?
diff --git a/bin/rm b/bin/rm
deleted file mode 100755
index b164647..0000000
--- a/bin/rm
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/bash
-
-if [ ! -t 1 ] || [ -n "$UNSAFE_RM" ]; then
-	# shellcheck disable=SC2068
-	exec /bin/rm "$@"
-fi
-
-# stop me from being stupid
-
-OPTIND=0
-for o in "$@"; do
-	OPTIND+=1
-	if [ -d "$o" ] || [ -f "$o" ]; then
-		break
-	fi
-	[ "$o" = "-r" ] && recurse=1
-	[ "$o" = "-f" ] && force=1
-	[ "$o" = "-rf" ] && force=1 && recurse=1
-done
-
-if [ -n "${force}" ] && [ -n "${recurse}" ]; then
-	tput setaf 1
-	exa --color=never -a "${!OPTIND}" >&2
-	echo "!"
-	echo "! recursive force not allowed" >&2
-	echo "!"
-	tput sgr0
-	exit 1
-fi
-
-if [ -n "${recurse}" ]; then
-	tput setaf 1
-	exa --color=never -a "${!OPTIND}" >&2
-	tput sgr0
-fi
-
-# shellcheck disable=SC2068
-exec /bin/rm -I --one-file-system "$@"