Mercurial > hg > aboriginal
changeset 570:0b384865cf0c
Make the init script care about PID rather than script name for determining qemu vs chroot invocation.
author | Rob Landley <rob@landley.net> |
---|---|
date | Wed, 07 Jan 2009 17:15:52 -0600 |
parents | 128b3b0700bf |
children | f07d714321fe |
files | sources/native/bin/qemu-setup.sh |
diffstat | 1 files changed, 9 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/sources/native/bin/qemu-setup.sh Mon Jan 05 21:23:45 2009 -0600 +++ b/sources/native/bin/qemu-setup.sh Wed Jan 07 17:15:52 2009 -0600 @@ -14,6 +14,7 @@ [ -z "$PATH" ] && PATH=/tools/bin || PATH="$PATH":/tools/bin export PATH fi +export HOME=/home # Create some temporary directories at the root level mkdir -p {proc,sys,dev,etc,tmp,home} @@ -30,7 +31,7 @@ mountpoint -q proc || mount -t proc proc proc # If we're running under qemu, do some more setup -if [ `echo $0 | sed 's@.*/@@'` == "qemu-setup.sh" ] +if [ $$ -eq 1 ] then # Note that 10.0.2.2 forwards to 127.0.0.1 on the host. @@ -51,16 +52,17 @@ then mount $HOMEDEV /home fi + + echo Type exit when done. + exec /tools/bin/oneit -c /dev/"$(dmesg | sed -n '/^Kernel command line:/s@.* console=\(/dev/\)*\([^ ]*\).*@\2@p')" /tools/bin/ash + +# If we're not PID 1, it's probably a chroot. else echo "nameserver 4.2.2.1" > /etc/resolv.conf -fi -export HOME=/home -echo Type exit when done. + # Switch to a shell with command history. -# Switch to a shell with command history. -if [ $$ -ne 1 ] -then + echo Type exit when done. /tools/bin/ash cd / umount ./dev @@ -68,6 +70,4 @@ umount ./sys umount ./proc sync -else - exec /tools/bin/oneit -c /dev/"$(dmesg | sed -n '/^Kernel command line:/s@.* console=\(/dev/\)*\([^ ]*\).*@\2@p')" /tools/bin/ash fi