Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=fvbe.git;a=commitdiff;h=d78d806cf08c66ca8aa33343f1c9330e816c4b7b
commit d78d806cf08c66ca8aa33343f1c9330e816c4b7b Author: James Buren <[email protected]> Date: Fri Nov 8 02:15:22 2013 -0600 init: trap err/exit so it shows up in the log how we came to exit qemu diff --git a/bin/init b/bin/init index 02cd3f4..0bb8a1d 100644 --- a/bin/init +++ b/bin/init @@ -1,36 +1,48 @@ #!/bin/sh -error() +bad_exit() { - echo "$1" + echo "Build has failed!" qemu-exit } +good_exit() +{ + echo "Build has finished!" + qemu-exit +} + +trap bad_exit ERR +trap good_exit EXIT + ROOT="/root" PATH="/sbin:/usr/sbin:/bin:/usr/bin" export PATH if ! test -c /dev/zero; then - mount -t devtmpfs none /dev - test "$?" -ne 0 && error "Failed to mount /dev" + mount -t devtmpfs none /dev fi if ! test -d /sys/kernel; then - mount -t sysfs none /sys - test "$?" -ne 0 && error "Failed to mount /sys" + mount -t sysfs none /sys fi if ! test -d /proc/self; then mount -t proc none /proc - test "$?" -ne 0 && error "Failed to mount /proc" fi if ! test -d "$ROOT"; then - mkdir -p -m 0755 "$ROOT" - test "$?" -ne 0 && error "Failed to create $ROOT" + mkdir -p -m 0755 "$ROOT" +fi + +if ! test -d /dev/pts; then + mkdir -p -m 0755 /dev/pts + mount -t devpts -o gid=5,mode=620 none /dev/pts fi -bash +if ! test -d /dev/shm; then + mkdir -p -m 0755 /dev/shm + mount -t tmpfs none /dev/shm +fi -qemu-exit _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
