Skip to content

Commit

Permalink
Merge tag 'x86-build-2025-03-22' of git://git.kernel.org/pub/scm/linu…
Browse files Browse the repository at this point in the history
…x/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
  • Loading branch information
Linus Torvalds committed Mar 25, 2025
2 parents e34c380 + e471a86 commit ebfb94d
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 266 deletions.
10 changes: 0 additions & 10 deletions Documentation/arch/x86/boot.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1038,16 +1038,6 @@ Offset/size: 0x000c/4
This field contains maximal allowed type for setup_data and setup_indirect structs.


The Image Checksum
==================

From boot protocol version 2.08 onwards the CRC-32 is calculated over
the entire file using the characteristic polynomial 0x04C11DB7 and an
initial remainder of 0xffffffff. The checksum is appended to the
file; therefore the CRC of the file up to the limit specified in the
syssize field of the header is always 0.


The Kernel Command Line
=======================

Expand Down
7 changes: 2 additions & 5 deletions arch/x86/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ setup-y += video-vesa.o
setup-y += video-bios.o

targets += $(setup-y)
hostprogs := tools/build
hostprogs += mkcpustr

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

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

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

Expand Down
2 changes: 1 addition & 1 deletion arch/x86/boot/compressed/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ SECTIONS
*(.data)
*(.data.*)

/* Add 4 bytes of extra space for a CRC-32 checksum */
/* Add 4 bytes of extra space for the obsolete CRC-32 checksum */
. = ALIGN(. + 4, 0x200);
_edata = . ;
}
Expand Down
5 changes: 4 additions & 1 deletion arch/x86/boot/genimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
# This script requires:
# bash
# syslinux
# genisoimage
# mtools (for fdimage* and hdimage)
# edk2/OVMF (for hdimage)
#
Expand Down Expand Up @@ -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 \
Expand Down
2 changes: 2 additions & 0 deletions arch/x86/boot/setup.ld
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ SECTIONS

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

. = ALIGN(16);
Expand Down
2 changes: 0 additions & 2 deletions arch/x86/boot/tools/.gitignore

This file was deleted.

247 changes: 0 additions & 247 deletions arch/x86/boot/tools/build.c

This file was deleted.

0 comments on commit ebfb94d

Please sign in to comment.