Skip to content

Commit 6ae64e4

Browse files
hbruecknermichal42
authored andcommitted
initramfs: generalize initramfs_data.xxx.S variants
Remove initramfs_data.{lzo,lzma,gz,bz2}.S variants and use a common implementation in initramfs_data.S. The common implementation expects the file name of the initramfs to be defined in INITRAMFS_IMAGE. Change the Makefile to set the INITRAMFS_IMAGE define symbol according to the selected compression method. Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com> Cc: WANG Cong <xiyou.wangcong@gmail.com> Acked-by: Michal Marek <mmarek@suse.cz> Acked-by: "H. Peter Anvin" <hpa@zytor.com> Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
1 parent ef89487 commit 6ae64e4

6 files changed

Lines changed: 7 additions & 120 deletions

File tree

‎usr/Makefile‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@ suffix_$(CONFIG_INITRAMFS_COMPRESSION_LZMA) = .lzma
1818
# Lzo
1919
suffix_$(CONFIG_INITRAMFS_COMPRESSION_LZO) = .lzo
2020

21+
AFLAGS_initramfs_data.o += -DINITRAMFS_IMAGE="usr/initramfs_data.cpio$(suffix_y)"
22+
2123
# Generate builtin.o based on initramfs_data.o
22-
obj-$(CONFIG_BLK_DEV_INITRD) := initramfs_data$(suffix_y).o
24+
obj-$(CONFIG_BLK_DEV_INITRD) := initramfs_data.o
2325

2426
# initramfs_data.o contains the compressed initramfs_data.cpio image.
2527
# The image is included using .incbin, a dependency which is not
2628
# tracked automatically.
27-
$(obj)/initramfs_data$(suffix_y).o: $(obj)/initramfs_data.cpio$(suffix_y) FORCE
29+
$(obj)/initramfs_data.o: $(obj)/initramfs_data.cpio$(suffix_y) FORCE
2830

2931
#####
3032
# Generate the initramfs cpio archive

‎usr/initramfs_data.S‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ SECTIONS
2525
in the ELF header, as required by certain architectures.
2626
*/
2727

28-
.section .init.ramfs,"a"
29-
.incbin "usr/initramfs_data.cpio"
28+
#include <linux/stringify.h>
3029

30+
.section .init.ramfs,"a"
31+
.incbin __stringify(INITRAMFS_IMAGE)

‎usr/initramfs_data.bz2.S‎

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

‎usr/initramfs_data.gz.S‎

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

‎usr/initramfs_data.lzma.S‎

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

‎usr/initramfs_data.lzo.S‎

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

0 commit comments

Comments
 (0)