Commit Graph

18 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
Michal Koutný 348935e3b6 ssh-client: Include nss_ libraries
SSH uses passwd database and thus need various NSS plugin libraries,
depending upon setting in nsswitch.conf.

SSH binary fails within the dracut environment without the libraries:

    #:/ ssh
    No user exist for uid 0
2017-08-15 16:10:50 +02:00
Tong Li 32f5af2f5e 95ssh-client: attempt to copy UserKnownHostsFile to kdump's initramfs
Bug related to this issue: https://bugzilla.redhat.com/show_bug.cgi?id=1360131
Now dracut only attempts to copy GlobalKnownHostsFile while generating kdump's
initramfs. This method will cause kdump's failure if users set customized
UserKnownHostsFile in /etc/ssh/ssh_config. This patch simply attempts to copy
those files too while going through /etc/ssh/ssh_config. Note that we need to
make sure ~/foo will be copied as /root/foo in kdump's initramfs.
2016-11-30 17:05:57 +08:00
Harald Hoyer 6d58fa27a4 change "while read x" to cope with EOF without newline
while read x || [ -n "$x" ]

should do the trick
2015-04-28 11:39:15 +02:00
Harald Hoyer 4ba44e899c ssh-client: s/key/$key
GlobalKnownHostsFile was not installed, because key was not $key

Thanks Jan Stodola!
2015-01-12 14:21:33 +01:00
Harald Hoyer 8a203398ef ssh-client: handle /etc/ssh/ssh_config
- disable ProxyCommand
- install the GlobalKnownHostsFile

https://bugzilla.redhat.com/show_bug.cgi?id=1086778
2014-08-29 15:27:22 +02:00
Harald Hoyer 967cc19ab1 remove all vim and emacs code format comments 2014-08-29 13:38:47 +02: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
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
dyoung@redhat.com fc9bc6f8db ssh-client: remove ctty related check
cttyhack was removed and ctty is supported by default, so no need to
check it in ssh-client module any more.

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-10-16 09:38:17 +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
Dave Young 86de902e35 ssh-client module install fix
commit 38164332e1 try to
disallow ssh-client install for without proper options.
But ssh-client will fail installation with --sshkey for
publickey mode

Fix it by refusing to install only when both --ctty and --sshkey
are not added in options.

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-02-16 11:21:34 +01:00
Harald Hoyer 4b691cccbe 95ssh-client/module-setup.sh: add executable bit 2012-02-07 12:18:52 +01:00
Harald Hoyer 38164332e1 95ssh-client/module-setup.sh: do not install ssh-client by default
Do not install ssh-client by default and report the missing ctty in the
install section.
2012-01-25 10:02:29 +01:00
Harald Hoyer 92dc0adca2 95ssh-client/module-setup.sh: spell corrections 2012-01-25 09:59:12 +01:00
Cong Wang 7f347723d8 let some modules to respect $mount_needs
Cc: Harald Hoyer <harald@redhat.com>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
2012-01-25 09:45:54 +01:00
Dave Young cdfeb278ab Add ssh client module code
Add ssh client module which support ssh key mode and interactive mode.
with --sshkey option you can provide the ssh key to be installed

>why not call it "ssh" module?
ssh-client is better, maybe future there will be ssh-server come in.
In debian these are also two different packages.

Usage:
1. sshkey mode:
transfer your public key to remote machine with ssh-copy-id or do it mannaully
example of options:
./dracut -l -H -a ssh-client --sshkey /root/.ssh/id_rsa i.img
2. interactive mode:
need use --ctty option, ie.:
./dracut -l -H -a ssh-client --ctty i.img

[v2 changes]:
per wangcong: add patch description about module name
add help line in usage()
remove useless comment

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-01-23 09:48:35 +01:00