Commit Graph

50 Commits (a01204202b3014c0c761c93bc7de8bf35e6dc5ef)

Author SHA1 Message Date
Böszörményi Zoltán a01204202b Allow running on a cross-compiled rootfs
For the shell scripts, new environment variables were introduced.

dracutsysrootdir is the root directory, file existence checks use it.

DRACUT_LDCONFIG can override ldconfig with a different one that works
on the sysroot with foreign binaries.

DRACUT_LDD can override ldd with a different one that works
with foreign binaries.

DRACUT_TESTBIN can override /bin/sh. A cross-compiled sysroot
may use symlinks that are valid only when running on the target
so a real file must be provided that exist in the sysroot.

DRACUT_INSTALL now supports debugging dracut-install in itself
when run by dracut but without debugging the dracut scripts.
E.g. DRACUT_INSTALL="valgrind dracut-install or
DRACUT_INSTALL="dracut-install --debug".

DRACUT_COMPRESS_BZIP2, DRACUT_COMPRESS_LBZIP2, DRACUT_COMPRESS_LZMA,
DRACUT_COMPRESS_XZ, DRACUT_COMPRESS_GZIP, DRACUT_COMPRESS_PIGZ,
DRACUT_COMPRESS_LZOP, DRACUT_COMPRESS_ZSTD, DRACUT_COMPRESS_LZ4,
DRACUT_COMPRESS_CAT: All of the compression utilities may be
overridden, to support the native binaries in non-standard places.

DRACUT_ARCH overrides "uname -m".

SYSTEMD_VERSION overrides "systemd --version".

The dracut-install utility was overhauled to support sysroot via
a new option -r and fixes for clang-analyze. It supports
cross-compiler-ldd from
https://gist.github.com/jerome-pouiller/c403786c1394f53f44a3b61214489e6f

DRACUT_INSTALL_PATH was introduced so dracut-install can work with
a different PATH. In a cross-compiled environment (e.g. Yocto), PATH
points to natively built binaries that are not in the host's /bin,
/usr/bin, etc. dracut-install still needs plain /bin and /usr/bin
that are relative to the cross-compiled sysroot.

The hashmap pool allocate_tile/deallocate_tile code was removed
because clang-analyze showed errors in it. hashmap_copy was removed
because it wasn't used and clang-analyze showed errors in it.

DRACUT_INSTALL_LOG_TARGET and DRACUT_INSTALL_LOG_LEVEL were
introduced so dracut-install can use different settings from
DRACUT_LOG_TARGET and DRACUT_LOG_LEVEL.

Signed-off-by: Böszörményi Zoltán <zboszor@pr.hu>
2019-10-25 11:58:58 +02:00
Ville Skyttä 9430ae301e Do not use deprecated egrep/fgrep 2016-03-28 11:38:34 +03:00
Harald Hoyer 2da041d672 Check for systemd before installing systemd specific files
https://bugzilla.redhat.com/show_bug.cgi?id=1282010
2015-11-16 09:41:26 +01:00
Harald Hoyer dd8d161afe udev-rules: install 40-redhat.rules
(cherry picked from commit 0c0abf97cc)
2015-11-11 16:08:17 +01:00
Harald Hoyer c3cdd9f6e1 udev-rules: add 60-block.rules 2015-06-09 15:05:32 +02:00
Harald Hoyer c071990c2c udev-rules: optionally install /etc/udev/udev.conf
udevd runs even without this config file
2015-05-28 19:47:37 +02:00
Hannes Reinecke 15eed1e4f1 95udev-rules: Include correct sg3_utils rules
sg3_utils now provides two rules 55-scsi-sg3_id.rules and
58-scsi-sg3_symlink.rules, which need to be included instead
of the older 59-scsi-sg3_utils.rules.

References: bnc#873151

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:35 +01:00
Harald Hoyer 967cc19ab1 remove all vim and emacs code format comments 2014-08-29 13:38:47 +02:00
Harald Hoyer 5a57582050 Add rd.hostonly kernel command line parameters
rd.hostonly=0 will remove all configuration compiled in the initramfs
from the host on which it was build
2014-06-27 13:59:44 +02:00
Harald Hoyer ba9f3d3326 udev-rules: add uaccess rules
plymouth needs the seat rules, also without systemd
2014-06-05 12:30:58 +02:00
Harald Hoyer 78c982667a udev-rules: added seat rules
plymouth needs the seat rules, also without systemd
2014-06-04 13:26:08 +02:00
Julian Wolf c96f1b1e6b udev-rules: include 59-scsi-sg3_utils.rules
Without the 59-scsi-sg3_utils.rules udev-rule a couple of devices are missing
in /dev/disk/by-id.

If the luks device is specified by-id in /etc/crypttab and rd.luks.uuid not
passed as a commandline parameter during boot, systemd tries to start its
crypto services which depend on those missing devices until it times out and
exits to dracut rescue shell.

Signed-off-by: Julian Wolf <juwolf@suse.com>
2014-05-20 11:40:43 +02:00
Alexander Tsoy cd501ff74b udev-rules: add 80-net-setup-link.rules and .link files
With systemd >= 209 these file are required for predictable network interface
names
2014-03-05 10:40:22 +01:00
Harald Hoyer 30e6e809ed Factor out all the "type -V" commands
Add new functions require_binaries() and require_any_binary() to be used
in the check() section of module-setup.sh.

These functions print a warning line telling the user, which binary is
missing for the specific dracut module.

This unifies the way of checking for binaries and makes the life of an
initramfs creator easier, if he wants to find out why a specific dracut
module is not included in the initramfs.
2014-02-06 16:45:20 +01:00
Alexander Tsoy 64fb0900cb udev-rules: add eudev rules
eudev configured with "--enable-modules --disable-libkmod" installs
80-drivers-modprobe.rules instead of 80-drivers.rules

https://bugs.gentoo.org/show_bug.cgi?id=494188
2014-01-24 12:49:16 +01:00
Harald Hoyer 8bcfd683bd */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
Harald Hoyer af11946054 dracut-functions.sh: inst_multiple == dracut_install 2013-08-07 10:33:15 +02:00
Harald Hoyer 5decf6d813 add debian udev rule files 2013-07-24 13:42:17 +02:00
Harald Hoyer 282e0583b0 udev-rules: add 75-net-description.rules
we need IMPORT{builtin}="net_id" for the persistent network names
2013-06-18 17:54:30 +02:00
Harald Hoyer 630aed8b66 udev-rules: add 80-net-name-slot.rules 2013-06-06 15:40:29 +02:00
Harald Hoyer af2578562c udev-rules/module-setup.sh: optionally install /etc/pcmcia/config.opts
https://bugzilla.redhat.com/show_bug.cgi?id=920076
2013-05-29 14:29:02 +02:00
Harald Hoyer 6c6d805765 use systemd*dir variables everywhere 2013-03-26 16:19:00 +01:00
Harald Hoyer c853dc72e9 udev-rules/module-setup.sh: do not install /run/* 2013-03-14 18:30:35 +01:00
Harald Hoyer c46cda8260 split 95udev-rules/59-persistent-storage.rules to md and dm modules 2013-03-07 15:01:47 +01:00
Harald Hoyer 4f6e293308 udev-rules: modify udev rules on initramfs creation time 2013-02-11 11:49:19 +01:00
Amadeusz Żołnowski 579238a3ac Fallback to external blkid and path_id in udev rules for <udev-176.
Starting with commit 24a38bc1cb dracut
uses udev builtins but still depends on >=udev-166 in dracut.spec.  This
patch makes dracut work with older udev again.

All credits go to Alexander Tsoy <alexander@tsoy.me>; see

  https://bugs.gentoo.org/show_bug.cgi?id=437700
2012-12-14 09:04:56 +01:00
Harald Hoyer b85f723535 udev-rules: do not install all /etc/group 2012-10-16 13:16:18 +02:00
Harald Hoyer 500d8e6002 udev-rules/module-setup.sh: add udev groups 2012-09-24 13:30:46 +02:00
Colin Guthrie f9452c94c0 udev-rules: Pre usrmove systemd installs might not find udevd.
If users had switched to systemd-183+ but have not completed
the usrmove, then the variable ${systemdutildir} will likely
refer to /usr/lib/systemd NOT /lib/systemd and thus the
systemd-udevd daemon may not be found.

So let's try a little harder and add another hard coded path
and if we don't find it, then bail out hard.
2012-08-21 18:46:20 +02:00
Harald Hoyer c072e13162 get rid of "basename" 2012-07-24 14:12:36 +02:00
Harald Hoyer 53fe81e752 modules.d/*/module-setup.sh: combine and specify type for installs
To speedup image creation, combine dracut_install calls and specify the exact type.
E.g. inst_script instead of the generic inst.
2012-06-29 12:41:27 +02:00
Harald Hoyer a0df73b493 udev-rules/module-setup.sh: ln with --force 2012-06-29 12:41:26 +02:00
Harald Hoyer d161561290 make udevdir systemdutildir systemdsystemunitdir global vars
your distribution should ship those settings in
/etc/dracut.conf.d/01-distro.conf

see dracut.conf.d/fedora.conf.example
2012-06-06 15:16:00 +02:00
Juan RP 2cf4f4fb74 Avoid annonying warnings when pkg-config is not installed. 2012-06-06 15:02:00 +02:00
Harald Hoyer 6042b30c58 udev-rules: check for systemd-udevd symlink already present 2012-06-04 13:11:38 +02:00
Harald Hoyer 604d1eb21a use pkg-config to determine the udev directory 2012-06-04 12:58:42 +02:00
Harald Hoyer cce69be668 removed old udev "vol_id" 2012-05-07 16:27:48 +02:00
Harald Hoyer 168952cea6 udev-rules/module-setup.sh: fixed udevd location 2012-04-25 15:58:40 +02:00
Harald Hoyer 8a1a2f6ca4 udevd moved to /lib/systemd/systemd-udevd 2012-04-19 11:59:38 +02:00
Harald Hoyer 324be70f80 udev-rules: remove 01-ignore.rules 2012-04-17 11:54:27 +02:00
Jon Ander Hernandez c9143a63fe Debian multiarch support
Another solution could be searching in directories found at
/etc/ld.so.conf.d/*.conf or adding a new parameter. Here is a patch
which adds a new --libdirs parameter, and also a new inst_libdir_file
function which will try to expand metacharacters on each lib
directory:

    inst_libdir_file "libdevmapper-event-lvm*.so"
2012-04-16 14:46:53 +02:00
Harald Hoyer 6f00044317 95udev-rules/module-setup.sh: correctly create udevd symlink 2011-10-20 13:06:34 +02:00
Harald Hoyer 450f5d6694 95udev-rules/module-setup.s: fixed symlink for udevd to initdir 2011-10-10 20:17:16 +02:00
Harald Hoyer e0f9ecc6a4 95udev-rules/module-setup.sh: also search in /lib/udev and /usr/lib/udev 2011-10-06 10:25:08 +02:00
Harald Hoyer f063d0e89f 95udev-rules: add input_id 2011-08-31 16:48:20 +02:00
Harald Hoyer e59f58f854 use inst_simple to install non-binary files 2011-08-12 13:11:30 +02:00
Harald Hoyer 29b10e65b1 dracut-functions: make local vars local and prefix with "_" 2011-05-12 11:06:47 +02:00
Harald Hoyer 3b403b32fc removed trailing whitespaces 2011-05-10 11:56:09 +02:00
Harald Hoyer df60555037 precreate /run/udev/rules.d 2011-04-11 13:02:14 +02:00
Harald Hoyer 71df3c4329 renamed module-info.sh to module-setup.sh 2011-02-02 16:35:18 +01:00