]> git.ipfire.org Git - thirdparty/dracut.git/blob - docs/README.cross
ci: do not run test container generation on forked repos by default
[thirdparty/dracut.git] / docs / README.cross
1 Dracut supports running against a sysroot directory that is different
2 from the actual root (/) directory of the running system. It is most
3 useful for creating/bootstrapping a new system that may or may not be
4 using the same CPU architecture as the host system, i.e. building a
5 whole Linux system with a cross-compiler framework like Yocto.
6
7 The user-visible frontend change is the introduction of a new option
8 called "-r" or "--sysroot". It expects a directory that contains the
9 complete Linux system that has all the files (kernel drivers, firmware,
10 executables, libraries and others) necessary to construct the initramfs.
11
12 E.g: dracut --sysroot /path/to/sysroot initramfs.img kernelversion
13
14 To support this, a new global variable was introduced inside dracut.
15 This variable is called "dracutsysrootdir" and all the files installed
16 into the initramfs image is searched relative to the sysroot directory.
17 This variable can also be set externally to dracut without using option
18 -r/--sysroot.
19
20 There are other details that are necessary to tweak to be able to
21 run on cross-compiled (a.k.a. foreign) binaries.
22
23 dracut uses these crucial utilities during its operation:
24
25 ldd
26 ===
27 It lists dynamic library dependencies for executables or libraries
28
29 ldconfig
30 ========
31 It creates /etc/ld.so.cache, i.e. the cached information about libraries
32 known to the system.
33
34 These utilities the way they exist on the host system only work on
35 the host system.
36
37 To support cross-compiled binaries, a different ldd variant is needed that
38 works on those binaries. One such ldd script is found at
39 https://gist.github.com/jerome-pouiller/c403786c1394f53f44a3b61214489e6f
40
41 ldconfig in GLIBC as is does support a sysroot with its -r option.
42
43 Extra environment variables needed to run dracut on the sysroot are
44 documented in the dracut(8) man page.
45
46 For the Plymouth boot splash to be added to the initramfs image,
47 this gitlab PR is needed for Plymouth:
48 https://gitlab.freedesktop.org/plymouth/plymouth/merge_requests/72