diff options
author | Rob Landley <rob@landley.net> | 2022-04-08 02:38:02 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2022-04-08 02:38:02 -0500 |
commit | 965fabbe2c3d24972301426f9f63919ef87ffb12 (patch) | |
tree | 24b5be13735be542ee6ff20e4c836d907e7f34b7 | |
parent | f22bec1f33c5de69c20321097cb01dbad7ce5ac6 (diff) | |
download | toybox-965fabbe2c3d24972301426f9f63919ef87ffb12.tar.gz |
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.)
-rwxr-xr-x | scripts/mkroot.sh | 16 |
1 files 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 |