From 10f0b1a37856288df8a64021b57b93adc3498522 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 11 Jul 2022 03:44:47 -0500 Subject: [PATCH] Normalize one more filename, move a variable assignment. --- scripts/mkroot.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/mkroot.sh b/scripts/mkroot.sh index 06c979c9..a800c5d6 100755 --- a/scripts/mkroot.sh +++ b/scripts/mkroot.sh @@ -43,13 +43,13 @@ elif [ -n "$CROSS" ]; then # CROSS=all/allnonstop/$ARCH else list known $ARCHes fi fi +# Set per-target output directory (using "host" if not cross-compiling) +: ${CROSS:=host} ${OUTPUT:=$TOP/$CROSS} + # Verify selected compiler works ${CROSS_COMPILE}cc --static -xc - -o /dev/null <<< "int main(void){return 0;}"|| die "${CROSS_COMPILE}cc can't create static binaries" -# When not cross compiling set CROSS=host. Create per-target output directory -: ${CROSS:=host} ${OUTPUT:=$TOP/$CROSS} - # ----- Create hermetic build environment if [ -z "$NOAIRLOCK"] && [ -n "$CROSS_COMPILE" ]; then @@ -244,7 +244,7 @@ else if [ -n "$QEMU" ]; then [ -z "$BUILTIN" ] && INITRD="-initrd initramfs.cpio.gz" { echo qemu-system-"$QEMU" '"$@"' $QEMU_MORE -nographic -no-reboot -m 256 \ - -kernel linux-kernel $INITRD ${DTB:+-dtb "$(basename "$DTB")"} \ + -kernel linux-kernel $INITRD ${DTB:+-dtb linux.dtb} \ "-append \"panic=1 HOST=$TARGET console=$KARGS \$KARGS\"" && echo "echo -e '\\e[?7h'" } > "$OUTPUT"/run-qemu.sh && @@ -284,7 +284,7 @@ else # Build kernel. Copy config, device tree binary, and kernel binary to output make ARCH=$KARCH CROSS_COMPILE="$CROSS_COMPILE" -j $(nproc) || exit 1 - [ -n "$DTB" ] && { cp "$DTB" "$OUTPUT" || exit 1 ;} + [ -n "$DTB" ] && { cp "$DTB" "$OUTPUT/linux.dtb" || exit 1 ;} cp "$VMLINUX" "$OUTPUT"/linux-kernel && cd .. && rm -rf linux && popd ||exit 1 fi -- 2.39.2