Skip to content

Commit 67b44ed

Browse files
nir9jfvogel
authored andcommitted
x86/build: Fix broken copy command in genimage.sh when making isoimage
[ Upstream commit e451630226bd09dc730eedb4e32cab1cc7155ae8 ] 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. Signed-off-by: Nir Lichtman <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Cc: Ard Biesheuvel <[email protected]> Cc: Masahiro Yamada <[email protected]> Cc: Michal Marek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sasha Levin <[email protected]> (cherry picked from commit 5cab1de0cea2840a8a7d061ae13413fb77ff96c0) Signed-off-by: Jack Vogel <[email protected]>
1 parent f3eab6f commit 67b44ed

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

arch/x86/boot/genimage.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
# This script requires:
2323
# bash
2424
# syslinux
25+
# genisoimage
2526
# mtools (for fdimage* and hdimage)
2627
# edk2/OVMF (for hdimage)
2728
#
@@ -251,7 +252,9 @@ geniso() {
251252
cp "$isolinux" "$ldlinux" "$tmp_dir"
252253
cp "$FBZIMAGE" "$tmp_dir"/linux
253254
echo default linux "$KCMDLINE" > "$tmp_dir"/isolinux.cfg
254-
cp "${FDINITRDS[@]}" "$tmp_dir"/
255+
if [ ${#FDINITRDS[@]} -gt 0 ]; then
256+
cp "${FDINITRDS[@]}" "$tmp_dir"/
257+
fi
255258
genisoimage -J -r -appid 'LINUX_BOOT' -input-charset=utf-8 \
256259
-quiet -o "$FIMAGE" -b isolinux.bin \
257260
-c boot.cat -no-emul-boot -boot-load-size 4 \

0 commit comments

Comments
 (0)