Skip to content

Commit

Permalink
initramfs: generalize initramfs_data.xxx.S variants
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: WANG Cong <[email protected]>
Acked-by: Michal Marek <[email protected]>
Acked-by: "H. Peter Anvin" <[email protected]>
Cc: Hendrik Brueckner <[email protected]>
Cc: Heiko Carstens <[email protected]>
Cc: Martin Schwidefsky <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
  • Loading branch information
hbrueckner authored and michal42 committed Sep 29, 2010
1 parent ef89487 commit 6ae64e4
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 120 deletions.
6 changes: 4 additions & 2 deletions usr/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ suffix_$(CONFIG_INITRAMFS_COMPRESSION_LZMA) = .lzma
# Lzo
suffix_$(CONFIG_INITRAMFS_COMPRESSION_LZO) = .lzo

AFLAGS_initramfs_data.o += -DINITRAMFS_IMAGE="usr/initramfs_data.cpio$(suffix_y)"

# Generate builtin.o based on initramfs_data.o
obj-$(CONFIG_BLK_DEV_INITRD) := initramfs_data$(suffix_y).o
obj-$(CONFIG_BLK_DEV_INITRD) := initramfs_data.o

# initramfs_data.o contains the compressed initramfs_data.cpio image.
# The image is included using .incbin, a dependency which is not
# tracked automatically.
$(obj)/initramfs_data$(suffix_y).o: $(obj)/initramfs_data.cpio$(suffix_y) FORCE
$(obj)/initramfs_data.o: $(obj)/initramfs_data.cpio$(suffix_y) FORCE

#####
# Generate the initramfs cpio archive
Expand Down
5 changes: 3 additions & 2 deletions usr/initramfs_data.S
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ SECTIONS
in the ELF header, as required by certain architectures.
*/

.section .init.ramfs,"a"
.incbin "usr/initramfs_data.cpio"
#include <linux/stringify.h>

.section .init.ramfs,"a"
.incbin __stringify(INITRAMFS_IMAGE)
29 changes: 0 additions & 29 deletions usr/initramfs_data.bz2.S

This file was deleted.

29 changes: 0 additions & 29 deletions usr/initramfs_data.gz.S

This file was deleted.

29 changes: 0 additions & 29 deletions usr/initramfs_data.lzma.S

This file was deleted.

29 changes: 0 additions & 29 deletions usr/initramfs_data.lzo.S

This file was deleted.

0 comments on commit 6ae64e4

Please sign in to comment.