xref: /linux/usr/initramfs_data.S (revision 97eb3f24352ec6632c2127b35d8087d2a809a9b9)
11da177e4SLinus Torvalds/*
21da177e4SLinus Torvalds  initramfs_data includes the compressed binary that is the
31da177e4SLinus Torvalds  filesystem used for early user space.
41da177e4SLinus Torvalds  Note: Older versions of "as" (prior to binutils 2.11.90.0.23
51da177e4SLinus Torvalds  released on 2001-07-14) dit not support .incbin.
61da177e4SLinus Torvalds  If you are forced to use older binutils than that then the
71da177e4SLinus Torvalds  following trick can be applied to create the resulting binary:
81da177e4SLinus Torvalds
91da177e4SLinus Torvalds
101da177e4SLinus Torvalds  ld -m elf_i386  --format binary --oformat elf32-i386 -r \
111da177e4SLinus Torvalds  -T initramfs_data.scr initramfs_data.cpio.gz -o initramfs_data.o
121da177e4SLinus Torvalds   ld -m elf_i386  -r -o built-in.o initramfs_data.o
131da177e4SLinus Torvalds
14ffe8018cSHendrik Brueckner  For including the .init.ramfs sections, see include/asm-generic/vmlinux.lds.
151da177e4SLinus Torvalds
161da177e4SLinus Torvalds  The above example is for i386 - the parameters vary from architectures.
171da177e4SLinus Torvalds  Eventually look up LDFLAGS_BLOB in an older version of the
181da177e4SLinus Torvalds  arch/$(ARCH)/Makefile to see the flags used before .incbin was introduced.
191da177e4SLinus Torvalds
201da177e4SLinus Torvalds  Using .incbin has the advantage over ld that the correct flags are set
211da177e4SLinus Torvalds  in the ELF header, as required by certain architectures.
221da177e4SLinus Torvalds*/
231da177e4SLinus Torvalds
246ae64e42SHendrik Brueckner#include <linux/stringify.h>
25*1198c6d4SHendrik Brueckner#include <asm-generic/vmlinux.lds.h>
261da177e4SLinus Torvalds
276ae64e42SHendrik Brueckner.section .init.ramfs,"a"
28ffe8018cSHendrik Brueckner__irf_start:
296ae64e42SHendrik Brueckner.incbin __stringify(INITRAMFS_IMAGE)
30ffe8018cSHendrik Brueckner__irf_end:
31ffe8018cSHendrik Brueckner.section .init.ramfs.info,"a"
32*1198c6d4SHendrik Brueckner.globl VMLINUX_SYMBOL(__initramfs_size)
33*1198c6d4SHendrik BruecknerVMLINUX_SYMBOL(__initramfs_size):
3496f93593SGeert Uytterhoeven#ifdef CONFIG_64BIT
35ffe8018cSHendrik Brueckner	.quad __irf_end - __irf_start
3696f93593SGeert Uytterhoeven#else
3796f93593SGeert Uytterhoeven	.long __irf_end - __irf_start
38ffe8018cSHendrik Brueckner#endif
39