android_kernel_xiaomi_sm8450/arch
Masahiro Yamada 89c2ba9ce4
BACKPORT: UPSTREAM: kbuild: rename cmd_{bzip2,lzma,lzo,lz4,xzkern,zstd22}
GZIP-compressed files end with 4 byte data that represents the size
of the original input. The decompressors (the self-extracting kernel)
exploit it to know the vmlinux size beforehand. To mimic the GZIP's
trailer, Kbuild provides cmd_{bzip2,lzma,lzo,lz4,xzkern,zstd22}.
Unfortunately these macros are used everywhere despite the appended
size data is only useful for the decompressors.

There is no guarantee that such hand-crafted trailers are safely ignored.
In fact, the kernel refuses compressed initramdfs with the garbage data.
That is why usr/Makefile overrides size_append to make it no-op.

To limit the use of such broken compressed files, this commit renames
the existing macros as follows:

  cmd_bzip2   --> cmd_bzip2_with_size
  cmd_lzma    --> cmd_lzma_with_size
  cmd_lzo     --> cmd_lzo_with_size
  cmd_lz4     --> cmd_lz4_with_size
  cmd_xzkern  --> cmd_xzkern_with_size
  cmd_zstd22  --> cmd_zstd22_with_size

To keep the decompressors working, I updated the following Makefiles
accordingly:

  arch/arm/boot/compressed/Makefile
  arch/h8300/boot/compressed/Makefile
  arch/mips/boot/compressed/Makefile
  arch/parisc/boot/compressed/Makefile
  arch/s390/boot/compressed/Makefile
  arch/sh/boot/compressed/Makefile
  arch/x86/boot/compressed/Makefile

I reused the current macro names for the normal usecases; they produce
the compressed data in the proper format.

I did not touch the following:

  arch/arc/boot/Makefile
  arch/arm64/boot/Makefile
  arch/csky/boot/Makefile
  arch/mips/boot/Makefile
  arch/riscv/boot/Makefile
  arch/sh/boot/Makefile
  kernel/Makefile

This means those Makefiles will stop appending the size data.

I dropped the 'override size_append' hack from usr/Makefile.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <n.schier@avm.de>

Bug: 135791357
(cherry picked from commit 7ce7e984ab2b218d6e92d5165629022fe2daf9ee
 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master)
Change-Id: I3524909ef3daab85f7d22afdebc2e5bbfd5e5cf3
[szuweilin: Resolved the conflict about non-existing zstd22 in arch/s390/boot/compressed/Makefile]
Signed-off-by: SzuWei Lin <szuweilin@google.com>
(cherry picked from commit dd18c291f9a958a1e285ce0e84ec6b5879fe10ab)
2024-05-08 03:00:11 +03:00
..
alpha Merge 5.10.191 into android12-5.10-lts 2023-08-28 16:37:52 +00:00
arc ARC: define ASM_NL and __ALIGN(_STR) outside #ifdef __ASSEMBLY__ guard 2023-07-27 08:44:00 +02:00
arm BACKPORT: UPSTREAM: kbuild: rename cmd_{bzip2,lzma,lzo,lz4,xzkern,zstd22} 2024-05-08 03:00:11 +03:00
arm64 UPSTREAM: kbuild: LD_VERSION redenomination 2024-05-08 03:00:08 +03:00
c6x UPSTREAM: c6x: add support for TIF_NOTIFY_SIGNAL 2023-02-16 12:00:50 +00:00
csky Merge 5.10.166 into android12-5.10-lts 2023-02-17 12:18:56 +00:00
h8300 BACKPORT: UPSTREAM: kbuild: rename cmd_{bzip2,lzma,lzo,lz4,xzkern,zstd22} 2024-05-08 03:00:11 +03:00
hexagon UPSTREAM: arch: setup PF_IO_WORKER threads like PF_KTHREAD 2023-02-16 12:00:51 +00:00
ia64 This is the 5.10.189 stable release 2023-08-23 15:12:23 +00:00
m68k This is the 5.10.195 stable release 2023-09-19 11:32:32 +00:00
microblaze Merge 5.10.166 into android12-5.10-lts 2023-02-17 12:18:56 +00:00
mips BACKPORT: UPSTREAM: kbuild: rename cmd_{bzip2,lzma,lzo,lz4,xzkern,zstd22} 2024-05-08 03:00:11 +03:00
nds32 UPSTREAM: arch: setup PF_IO_WORKER threads like PF_KTHREAD 2023-02-16 12:00:51 +00:00
nios2 nios2: dts: Fix tse_mac "max-frame-size" property 2023-06-21 15:45:37 +02:00
openrisc openrisc: Properly store r31 to pt_regs on unhandled exceptions 2023-05-17 11:48:03 +02:00
parisc BACKPORT: UPSTREAM: kbuild: rename cmd_{bzip2,lzma,lzo,lz4,xzkern,zstd22} 2024-05-08 03:00:11 +03:00
powerpc UPSTREAM: kbuild: LD_VERSION redenomination 2024-05-08 03:00:08 +03:00
riscv Merge 5.10.191 into android12-5.10-lts 2023-08-28 16:37:52 +00:00
s390 BACKPORT: UPSTREAM: kbuild: rename cmd_{bzip2,lzma,lzo,lz4,xzkern,zstd22} 2024-05-08 03:00:11 +03:00
sh BACKPORT: UPSTREAM: kbuild: rename cmd_{bzip2,lzma,lzo,lz4,xzkern,zstd22} 2024-05-08 03:00:11 +03:00
sparc This is the 5.10.189 stable release 2023-08-23 15:12:23 +00:00
um Merge keystone/android12-5.10-keystone-qcom-release.198+ (0ebfe67) into msm-5.10 2023-12-05 16:20:08 +05:30
x86 BACKPORT: UPSTREAM: kbuild: rename cmd_{bzip2,lzma,lzo,lz4,xzkern,zstd22} 2024-05-08 03:00:11 +03:00
xtensa This is the 5.10.198 stable release 2023-10-26 17:54:46 +00:00
.gitignore
Kconfig This is the 5.10.189 stable release 2023-08-23 15:12:23 +00:00