From 965fabbe2c3d24972301426f9f63919ef87ffb12 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Fri, 8 Apr 2022 02:38:02 -0500 Subject: [PATCH] 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.) --- scripts/mkroot.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/scripts/mkroot.sh b/scripts/mkroot.sh index f1ddc505..fdf5b314 100755 --- a/scripts/mkroot.sh +++ b/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 -- 2.39.2