Skip to contentSkip to conversation

x86: Fix broken copy command in genimage when making isoimage

PATCH Applied Nir Lichtman 2 participants 2 messages Jan 10, 2025 – Feb 25, 2025 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: Fix broken copy command in genimage when making isoimage

Problem: Currently when running the "make isoimage" command there is an error related to wrong parameters passed to the cp command:
"cp: missing destination file operand after 'arch/x86/boot/isoimage/'" This is caused because the FDINITRDS is an empty array.

Solution: Check if FDINITRDS is empty before executing the "cp" command, similar to how it is done in the case of hdimage

---
 arch/x86/boot/genimage.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
arch/x86/boot/genimage.sh +4 -1
index c9299aeb7333..3882ead513f7 100644
@@ -22,6 +22,7 @@
 # This script requires:
 #   bash
 #   syslinux
+#   genisoimage
 #   mtools (for fdimage* and hdimage)
 #   edk2/OVMF (for hdimage)
 #
@@ -251,7 +252,9 @@ geniso() {
 	cp "$isolinux" "$ldlinux" "$tmp_dir"
 	cp "$FBZIMAGE" "$tmp_dir"/linux
 	echo default linux "$KCMDLINE" > "$tmp_dir"/isolinux.cfg
-	cp "${FDINITRDS[@]}" "$tmp_dir"/
+	if [ ${#FDINITRDS[@]} -gt 0 ]; then
+		cp "${FDINITRDS[@]}" "$tmp_dir"/
+	fi
 	genisoimage -J -r -appid 'LINUX_BOOT' -input-charset=utf-8 \
 		    -quiet -o "$FIMAGE" -b isolinux.bin \
 		    -c boot.cat -no-emul-boot -boot-load-size 4 \
Signature · 1 line
2.39.5
merge bot Applied
#1 lore raw

[tip: x86/build] x86/build: Fix broken copy command in genimage.sh when making isoimage

The following commit has been merged into the x86/build branch of tip:

The following commit has been merged into the x86/build branch of tip:

Commit-ID:     e451630226bd09dc730eedb4e32cab1cc7155ae8
Gitweb:        https://git.kernel.org/tip/e451630226bd09dc730eedb4e32cab1cc7155ae8
Author:        Nir Lichtman <[email protected]>
AuthorDate:    Fri, 10 Jan 2025 12:05:00 
Committer:     Ingo Molnar <[email protected]>
CommitterDate: Tue, 25 Feb 2025 21:13:33 +01:00

x86/build: Fix broken copy command in genimage.sh when making isoimage

Problem: Currently when running the "make isoimage" command there is an error related to wrong parameters passed to the cp command:

"cp: missing destination file operand after 'arch/x86/boot/isoimage/'"

This is caused because FDINITRDS is an empty array.

Solution: Check if FDINITRDS is empty before executing the "cp" command, similar to how it is done in the case of hdimage.

---
 arch/x86/boot/genimage.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
arch/x86/boot/genimage.sh +4 -1
index c9299ae..3882ead 100644
@@ -22,6 +22,7 @@
 # This script requires:
 #   bash
 #   syslinux
+#   genisoimage
 #   mtools (for fdimage* and hdimage)
 #   edk2/OVMF (for hdimage)
 #
@@ -251,7 +252,9 @@ geniso() {
 	cp "$isolinux" "$ldlinux" "$tmp_dir"
 	cp "$FBZIMAGE" "$tmp_dir"/linux
 	echo default linux "$KCMDLINE" > "$tmp_dir"/isolinux.cfg
-	cp "${FDINITRDS[@]}" "$tmp_dir"/
+	if [ ${#FDINITRDS[@]} -gt 0 ]; then
+		cp "${FDINITRDS[@]}" "$tmp_dir"/
+	fi
 	genisoimage -J -r -appid 'LINUX_BOOT' -input-charset=utf-8 \
 		    -quiet -o "$FIMAGE" -b isolinux.bin \
 		    -c boot.cat -no-emul-boot -boot-load-size 4 \