# HG changeset patch # User Rob Landley # Date 1226517817 21600 # Node ID eac92c5b74247f31e39bd40a083666067089fe06 # Parent 726224afbcc9b73e40aa25bc41bf9eb83f9bd60e Distinguish console setup (qemu vs chroot) based on whether we're running as pid 1, and grep for console= from kernel command line arguments in dmesg, so we don't have to pass CONSOLE= a second time on kernel command line. diff -r 726224afbcc9 -r eac92c5b7424 package-mini-native.sh --- a/package-mini-native.sh Wed Nov 12 13:18:15 2008 -0600 +++ b/package-mini-native.sh Wed Nov 12 13:23:37 2008 -0600 @@ -127,7 +127,7 @@ { echo "-nographic -no-reboot \$WITH_HDB" \ "-hda \"$1\" -kernel \"$2\"" \ - "-append \"root=/dev/$ROOT console=$CONSOLE CONSOLE=$CONSOLE" \ + "-append \"root=/dev/$ROOT console=$CONSOLE" \ "rw init=/tools/bin/qemu-setup.sh panic=1" \ 'PATH=$DISTCC_PATH_PREFIX/tools/bin $KERNEL_EXTRA"' \ diff -r 726224afbcc9 -r eac92c5b7424 sources/native/bin/qemu-setup.sh --- a/sources/native/bin/qemu-setup.sh Wed Nov 12 13:18:15 2008 -0600 +++ b/sources/native/bin/qemu-setup.sh Wed Nov 12 13:23:37 2008 -0600 @@ -59,7 +59,7 @@ echo Type exit when done. # Switch to a shell with command history. -if [ -z "$CONSOLE" ] +if [ $$ -ne 1 ] then /tools/bin/ash cd / @@ -69,5 +69,5 @@ umount ./proc sync else - exec /tools/bin/oneit -c /dev/$CONSOLE /tools/bin/ash + exec /tools/bin/oneit -c /dev/"$(dmesg | sed -n '/^Kernel command line:/s@.* console=\(/dev/\)*\([^ ]*\).*@\2@p')" /tools/bin/ash fi