From 4761d756dde03e62de0c3f3d7f25067a4f207fa3 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Fri, 8 May 2020 03:16:38 -0500 Subject: beat the dropbear build and module support a little further into shape. --- scripts/mkroot.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'scripts/mkroot.sh') diff --git a/scripts/mkroot.sh b/scripts/mkroot.sh index 43500ef1..b6386eac 100755 --- a/scripts/mkroot.sh +++ b/scripts/mkroot.sh @@ -94,7 +94,7 @@ if [ $$ -eq 1 ]; then [ "$(date +%s)" -lt 10000000 ] && sntp -sq time.google.com # Run expansion scripts (if any) - for i in $(/etc/rc/* | sort); do [ -e "$i" ] && . $i; done + for i in $(echo /etc/rc/* | sort); do [ -e "$i" ] && . $i; done [ -z "$CONSOLE" ] && CONSOLE="$( "$ROOT"/etc/resolv.conf && cat > "$ROOT"/etc/passwd << 'EOF' && -root::0:0:root:/root:/bin/sh +root:x:0:0:root:/root:/bin/sh guest:x:500:500:guest:/home/guest:/bin/sh nobody:x:65534:65534:nobody:/proc/self:/dev/null EOF @@ -120,6 +120,9 @@ announce toybox make clean ${CONF:-defconfig KCONFIG_ALLCONFIG=<(echo $'CONFIG_SH=y\nCONFIG_ROUTE=y')} && LDFLAGS=--static PREFIX="$ROOT" make toybox install || exit 1 +# Build any modules +for i in $PKG; do announce "$i"; PATH="$PKGDIR:$PATH" source $i; done + if [ -z "$LINUX" ] || [ ! -d "$LINUX/kernel" ]; then echo 'No $LINUX directory, kernel build skipped.' else @@ -188,7 +191,7 @@ else fi # Write the qemu launch script - echo "qemu-system-$QEMU" '"$@"' -nographic -no-reboot -m 256 \ + echo qemu-system-"$QEMU" '"$@"' $QEMU_MORE -nographic -no-reboot -m 256 \ "-kernel $(basename "$VMLINUX") -initrd ${CROSS_BASE}root.cpio.gz" \ "-append \"quiet panic=1 HOST=$TARGET console=$KARGS \$KARGS\"" \ ${DTB:+-dtb "$(basename "$DTB")"} ";echo -e '\e[?7h'" \ @@ -228,8 +231,8 @@ else cp "$VMLINUX" "$OUTPUT" && cd .. && rm -rf linux && popd || exit 1 fi -# Build any modules, clean up, and package root filesystem for initramfs. -for i in $PKG; do announce "$i"; PATH="$PKGDIR:$PATH" source $i; done +# clean up and package root filesystem for initramfs. rmdir "$MYBUILD" "$BUILD" 2>/dev/null announce "${CROSS_BASE}root.cpio.gz" -(cd "$ROOT" && find .|cpio -o -H newc|gzip) > "$OUTPUT/$CROSS_BASE"root.cpio.gz +(cd "$ROOT" && find . | cpio -o -H newc --no-preserve-owner | gzip) \ + > "$OUTPUT/$CROSS_BASE"root.cpio.gz -- cgit v1.2.3