Skip to content

Commit ebfb94d

Browse files
committed
Merge tag 'x86-build-2025-03-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 build updates from Ingo Molnar: - Drop CRC-32 checksum and the build tool that generates it (Ard Biesheuvel) - Fix broken copy command in genimage.sh when making isoimage (Nir Lichtman) * tag 'x86-build-2025-03-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/boot: Add back some padding for the CRC-32 checksum x86/boot: Drop CRC-32 checksum and the build tool that generates it x86/build: Fix broken copy command in genimage.sh when making isoimage
2 parents e34c380 + e471a86 commit ebfb94d

File tree

7 files changed

+9
-266
lines changed

7 files changed

+9
-266
lines changed

Documentation/arch/x86/boot.rst

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,16 +1038,6 @@ Offset/size: 0x000c/4
10381038
This field contains maximal allowed type for setup_data and setup_indirect structs.
10391039

10401040

1041-
The Image Checksum
1042-
==================
1043-
1044-
From boot protocol version 2.08 onwards the CRC-32 is calculated over
1045-
the entire file using the characteristic polynomial 0x04C11DB7 and an
1046-
initial remainder of 0xffffffff. The checksum is appended to the
1047-
file; therefore the CRC of the file up to the limit specified in the
1048-
syssize field of the header is always 0.
1049-
1050-
10511041
The Kernel Command Line
10521042
=======================
10531043

arch/x86/boot/Makefile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ setup-y += video-vesa.o
3535
setup-y += video-bios.o
3636

3737
targets += $(setup-y)
38-
hostprogs := tools/build
3938
hostprogs += mkcpustr
4039

4140
HOST_EXTRACFLAGS += -I$(srctree)/tools/include \
@@ -61,11 +60,9 @@ KBUILD_CFLAGS += $(CONFIG_CC_IMPLICIT_FALLTHROUGH)
6160
$(obj)/bzImage: asflags-y := $(SVGA_MODE)
6261

6362
quiet_cmd_image = BUILD $@
64-
silent_redirect_image = >/dev/null
65-
cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin \
66-
$(obj)/zoffset.h $@ $($(quiet)redirect_image)
63+
cmd_image = cp $< $@; truncate -s %4K $@; cat $(obj)/vmlinux.bin >>$@
6764

68-
$(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/tools/build FORCE
65+
$(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin FORCE
6966
$(call if_changed,image)
7067
@$(kecho) 'Kernel: $@ is ready' ' (#'$(or $(KBUILD_BUILD_VERSION),`cat .version`)')'
7168

arch/x86/boot/compressed/vmlinux.lds.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ SECTIONS
4848
*(.data)
4949
*(.data.*)
5050

51-
/* Add 4 bytes of extra space for a CRC-32 checksum */
51+
/* Add 4 bytes of extra space for the obsolete CRC-32 checksum */
5252
. = ALIGN(. + 4, 0x200);
5353
_edata = . ;
5454
}

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 \

arch/x86/boot/setup.ld

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ SECTIONS
4545

4646
setup_size = ALIGN(ABSOLUTE(.), 4096);
4747
setup_sects = ABSOLUTE(setup_size / 512);
48+
ASSERT(setup_sects >= 5, "The setup must be at least 5 sectors in size");
49+
ASSERT(setup_sects <= 64, "The setup must be at most 64 sectors in size");
4850
}
4951

5052
. = ALIGN(16);

arch/x86/boot/tools/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

arch/x86/boot/tools/build.c

Lines changed: 0 additions & 247 deletions
This file was deleted.

0 commit comments

Comments
 (0)