Browse Source

mkroot: add wget to pending build list, always rebuild .config when
$PENDING set, reset wordwrap after qemu exits (as well as in init script).

The wordwrap reset sequence was moved to the start of the init script
so command history editing wouldn't be borked in the emulated system,
but if the init script didn't run the host's command history editing
would stay borked. (QEMU's BIOS outputs something stupid that has to
be undone.)

Rob Landley 2 years ago
parent
commit
965fabbe2c
1 changed files with 9 additions and 7 deletions
  1. 9 7
      scripts/mkroot.sh

+ 9 - 7
scripts/mkroot.sh

@@ -11,7 +11,7 @@ for i in "$@"; do
   [ "${i/=/}" != "$i" ] && export "$i" || { [ "$i" != -- ] && PKG="$PKG $i"; }
 done
 
-# Set default values for directories (overrideable from command line)
+# Set default directory locations (overrideable from command line)
 : ${LOG:=${BUILD:=${TOP:=$PWD/root}/build}/log} ${AIRLOCK:=$BUILD/airlock}
 : ${CCC:=$PWD/ccc} ${PKGDIR:=$PWD/scripts/root}
 
@@ -145,8 +145,9 @@ echo -e 'root:x:0:\nguest:x:500:\nnobody:x:65534:' > "$ROOT"/etc/group || exit 1
 
 # Build static toybox with existing .config if there is one, else defconfig+sh
 announce toybox
-[ -e .config ] && [ -z "$PENDING" ] && CONF=silentoldconfig || unset CONF
-for i in $PENDING sh route; do XX="$XX"$'\n'CONFIG_${i^^?}=y; done
+[ ! -z "$PENDING" ] && rm -f .config
+[ -e .config ] && CONF=silentoldconfig || unset CONF
+for i in $PENDING sh route wget; do XX="$XX"$'\n'CONFIG_${i^^?}=y; done
 LDFLAGS=--static PREFIX="$ROOT" make clean \
   ${CONF:-defconfig KCONFIG_ALLCONFIG=<(echo "$XX")} toybox install || exit 1
 
@@ -236,10 +237,11 @@ else
   # Write the qemu launch script
   if [ -n "$QEMU" ]; then
     [ -z "$BUILTIN" ] && INITRD="-initrd ${CROSS}root.cpio.gz"
-    echo qemu-system-"$QEMU" '"$@"' $QEMU_MORE -nographic -no-reboot -m 256 \
-         -kernel $(basename $VMLINUX) $INITRD \
-         "-append \"panic=1 HOST=$TARGET console=$KARGS \$KARGS\"" \
-         ${DTB:+-dtb "$(basename "$DTB")"} > "$OUTPUT/qemu-$TARGET.sh" &&
+    { echo qemu-system-"$QEMU" '"$@"' $QEMU_MORE -nographic -no-reboot -m 256 \
+        -kernel $(basename $VMLINUX) $INITRD ${DTB:+-dtb "$(basename "$DTB")"} \
+        "-append \"panic=1 HOST=$TARGET console=$KARGS \$KARGS\"" &&
+      echo "echo -e '\\e[?7h'"
+    } > "$OUTPUT/qemu-$TARGET.sh" &&
     chmod +x "$OUTPUT/qemu-$TARGET.sh" || exit 1
   fi