Back to home page

OSCL-LXR

 
 

    


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