Back to home page

LXR

 
 

    


0001 /*
0002   initramfs_data includes the compressed binary that is the
0003   filesystem used for early user space.
0004   Note: Older versions of "as" (prior to binutils 2.11.90.0.23
0005   released on 2001-07-14) dit not support .incbin.
0006   If you are forced to use older binutils than that then the
0007   following trick can be applied to create the resulting binary:
0008 
0009 
0010   ld -m elf_i386  --format binary --oformat elf32-i386 -r \
0011   -T initramfs_data.scr initramfs_data.cpio.gz -o initramfs_data.o
0012    ld -m elf_i386  -r -o built-in.o initramfs_data.o
0013 
0014   For including the .init.ramfs sections, see include/asm-generic/vmlinux.lds.
0015 
0016   The above example is for i386 - the parameters vary from architectures.
0017   Eventually look up LDFLAGS_BLOB in an older version of the
0018   arch/$(ARCH)/Makefile to see the flags used before .incbin was introduced.
0019 
0020   Using .incbin has the advantage over ld that the correct flags are set
0021   in the ELF header, as required by certain architectures.
0022 */
0023 
0024 #include <linux/stringify.h>
0025 #include <asm-generic/vmlinux.lds.h>
0026 
0027 .section .init.ramfs,"a"
0028 __irf_start:
0029 .incbin __stringify(INITRAMFS_IMAGE)
0030 __irf_end:
0031 .section .init.ramfs.info,"a"
0032 .globl VMLINUX_SYMBOL(__initramfs_size)
0033 VMLINUX_SYMBOL(__initramfs_size):
0034 #ifdef CONFIG_64BIT
0035     .quad __irf_end - __irf_start
0036 #else
0037     .long __irf_end - __irf_start
0038 #endif