1*4882a593Smuzhiyun/* SPDX-License-Identifier: GPL-2.0 */ 2*4882a593Smuzhiyun/* 3*4882a593Smuzhiyun initramfs_data includes the compressed binary that is the 4*4882a593Smuzhiyun filesystem used for early user space. 5*4882a593Smuzhiyun Note: Older versions of "as" (prior to binutils 2.11.90.0.23 6*4882a593Smuzhiyun released on 2001-07-14) dit not support .incbin. 7*4882a593Smuzhiyun If you are forced to use older binutils than that then the 8*4882a593Smuzhiyun following trick can be applied to create the resulting binary: 9*4882a593Smuzhiyun 10*4882a593Smuzhiyun 11*4882a593Smuzhiyun ld -m elf_i386 --format binary --oformat elf32-i386 -r \ 12*4882a593Smuzhiyun -T initramfs_data.scr initramfs_data.cpio.gz -o initramfs_data.o 13*4882a593Smuzhiyun ld -m elf_i386 -r -o built-in.a initramfs_data.o 14*4882a593Smuzhiyun 15*4882a593Smuzhiyun For including the .init.ramfs sections, see include/asm-generic/vmlinux.lds. 16*4882a593Smuzhiyun 17*4882a593Smuzhiyun The above example is for i386 - the parameters vary from architectures. 18*4882a593Smuzhiyun Eventually look up LDFLAGS_BLOB in an older version of the 19*4882a593Smuzhiyun arch/$(ARCH)/Makefile to see the flags used before .incbin was introduced. 20*4882a593Smuzhiyun 21*4882a593Smuzhiyun Using .incbin has the advantage over ld that the correct flags are set 22*4882a593Smuzhiyun in the ELF header, as required by certain architectures. 23*4882a593Smuzhiyun*/ 24*4882a593Smuzhiyun 25*4882a593Smuzhiyun.section .init.ramfs,"a" 26*4882a593Smuzhiyun__irf_start: 27*4882a593Smuzhiyun.incbin "usr/initramfs_inc_data" 28*4882a593Smuzhiyun__irf_end: 29*4882a593Smuzhiyun.section .init.ramfs.info,"a" 30*4882a593Smuzhiyun.globl __initramfs_size 31*4882a593Smuzhiyun__initramfs_size: 32*4882a593Smuzhiyun#ifdef CONFIG_64BIT 33*4882a593Smuzhiyun .quad __irf_end - __irf_start 34*4882a593Smuzhiyun#else 35*4882a593Smuzhiyun .long __irf_end - __irf_start 36*4882a593Smuzhiyun#endif 37