Compare commits

..

4404 Commits
0.7 ... RHEL-8

Author SHA1 Message Date
Jonathan Lebon
9e8f172dc0 01fips: trim off GRUB boot device from BOOT_IMAGE
E.g. in RHCOS, the `BOOT_IMAGE` from the cmdline is:

(hd0,gpt1)/ostree/rhcos-e493371e5ee8407889029ec979955a2b86fd7e3cae5a0591b9db1cd248d966e8/vmlinuz-4.18.0-146.el8.x86_64

Which of course is a GRUB thing, not an actual pathname we'll be able to
resolve. In fact, we can simply scrap it off from the variable. Our code
is already able to handle both cases: whether the device refers to a
separate boot partition, or just the root filesystem with a regular
`/boot` directory.
2019-10-31 11:19:02 +01:00
Jonathan Lebon
89dcbbe92f 01fips: add / in BOOT_IMAGE_HMAC filename for clarity
It's already the case the `BOOT_IMAGE_PATH` today, in the non-empty
case, includes a trailing `/`, but let's add it to the path we build
here too to make it more obvious.
2019-10-31 11:18:56 +01:00
Jonathan Lebon
14310ca42f 01fips: run sha512hmac from directory HMAC file directory
That way, the HMAC file can contain a relative path instead of an
absolute one. The issue is that right now the kernel RPM bakes the
`/boot/vmlinuz-${kver}` path into the HMAC file which poses an issue for
rpm-ostree systems (and any other system where the kernel isn't simply
in the top-level `/boot`.

For now, we're hacking around this in rpm-ostree:
https://github.com/coreos/rpm-ostree/pull/1934

Though I'd like to propose the same change in the kernel spec file.
2019-10-31 11:18:51 +01:00
Jonathan Lebon
dcbc74b01b 01fips: fix HMAC file path resolution
There is a small regression in #343: when handling the 'separate boot
partition' case, we're checking for the kernel image in the wrong
location: `BOOT_IMAGE` is the `/boot`-relative path to the kernel image,
so `/boot/${BOOT_IMAGE_PATH}/${BOOT_IMAGE}` expands to e.g.
`/boot/mysubdir1/mysubdir2/mysubdir1/mysubdir2/vmlinuz...`.

We should be using `BOOT_IMAGE_NAME` here instead (and in fact, the next
if-statement does this correctly, so it might've just been accidentally
left out of #343).
2019-10-31 11:18:47 +01:00
Lubomir Rintel
7843bc5277 [RHEL] network: default to network-legacy even in presence of nm-initrd-generator
In RHEL 8.2, NetworkManager will ship with the nm-initrd-generator, but
before the install bits fall into place we want to default to network-legacy.

This unblocks the enablement of the NetworkManager bits and is intended
to be reverted later on.
2019-10-01 09:56:15 +02:00
Frantisek Sumsal
81babdedec test-rpms.txt: add util-linux into the dependency list 2019-09-11 15:26:26 +02:00
Harald Hoyer
fe44aa1b14 test-rpms.txt: add dhcp
(cherry picked from commit a081e072d8)
2019-09-11 15:26:26 +02:00
Harald Hoyer
4ef5cdc120 test/test-rpms.txt: add gzip
(cherry picked from commit 7b4173d698)
2019-09-11 15:26:26 +02:00
Harald Hoyer
b59ae22885 test/test-rpms.txt: add list of rpms to install
(cherry picked from commit f432d367fc)
2019-09-11 15:26:26 +02:00
Benjamin Marzinski
08961eef2a modules.d: fix udev rules detection of multipath devices
Starting with the 0.7.7 release of the multipath tools, the multipath
udev rules always set a value in ENV{DM_MULTIPATH_DEVICE_PATH} for any
device that multipath scans. A value of 0 means that the device is not
claimed by multipath, and a value of 1 means that it is. Because of
this, udev rules that check ENV{DM_MULTIPATH_DEVICE_PATH}=="?*" will
always return True, and act as if every scanned device is claimed by
multipath. Checking ENV{DM_MULTIPATH_DEVICE_PATH}=="1" will work
correctly for both the old and new versions of the multipath tools.
2019-09-06 13:25:01 +02:00
Lubomir Rintel
96976e84e2 test/MULTINIC: correctly note activated devices when using network-manager
The .did-setup files are not there. What is there is the NetworkManager
connection files.

(cherry picked from commit 393fb1ac05)
2019-08-30 15:18:01 +00:00
Lubomir Rintel
15ff303dde test/BONDBRIDGETEAMVLAN: don't assert against ifcfg files
The network-manager module writes keyfiles instead of ifcfg files. Just
check whether the configuration got actually applied correctly.

(cherry picked from commit 9dfd73bcbd)
2019-08-30 15:18:01 +00:00
Lubomir Rintel
3b89c39889 test/IFCFG: make sure the network-legacy plugin is being used
If the network-manager plugin is used instead, it wouldn't write out
ifcfg files and we wouldn't have anything to check.

While at that, also enable the test.

(cherry picked from commit 2b1b3bcdcb)
2019-08-30 15:18:01 +00:00
Lubomir Rintel
4e10601254 test: copy BONDBRIDGETEAMVLAN to IFCFG
The IFCFG test will make sure the network-legacy plugin keeps writing
out correct ifcfg files.

This is a separate commit so that actual changes are visible in the
following one.

(cherry picked from commit 70787ab619)
2019-08-30 15:18:01 +00:00
Lubomir Rintel
53cece208a network: parse root=dhcp also with network-manager module
Move the logic from network-legacy to common network code.

(cherry picked from commit 35efada5ec)
2019-08-30 15:18:01 +00:00
Lubomir Rintel
68fefe6f94 network-manager: generate configuration with netroot=
If the root is on network, let nm-initrd-generator create configuration
even if none was explicitly specified on the command line.

Also do the same if /tmp/net.ifaces exists, because the anaconda plugin
creates an empty file in that location in hopes that will make us
configure the network.

(cherry picked from commit 381ab6b7cd)
2019-08-30 15:18:01 +00:00
Lubomir Rintel
94c75a2a82 network-manager: also read out next-server from NM state
(cherry picked from commit 4be95b67a7)
2019-08-30 15:18:01 +00:00
Lubomir Rintel
34011ee53e network-manager: remove useless use of basename
(cherry picked from commit 5e0f8c8a4c)
2019-08-30 15:18:01 +00:00
Lubomir Rintel
8eb08e5528 network-manager: call the online hook for connected devices
Look for "connection-uuid" instead of "managed" to determine the devices
that are actually activated with a connection and call the online hook.

This fixes the anaconda-net root mount, which utilizes the online hook.

(cherry picked from commit 79a17b0112)
2019-08-30 15:18:01 +00:00
Lubomir Rintel
d8f0e52ac7 all: remove debugging leftovers
Accidentally folded into commit e671c3a06a ('95iscsi/module-setup.sh:
do not require 'hostname' anymore').
2019-08-30 14:20:27 +00:00
Lubomir Rintel
c60f4fc027 travis: run TEST-13-ENC-RAID-LVM on Fedora 29
Systemd in Fedora 30 is broken at the moment.
Fix: https://github.com/systemd/systemd/pull/12897

(cherry picked from commit 8238f41b34)
2019-08-30 14:06:59 +00:00
Lubomir Rintel
d9bf0c38be travis: run TEST-14-IMSM on Fedora 29
Systemd in Fedora 30 is broken at the moment.
Fix: https://github.com/systemd/systemd/pull/12872/

(cherry picked from commit 7a2503ab8c)
2019-08-30 14:06:59 +00:00
Lubomir Rintel
a34b1baa6c test/{10,12,13,14,17,30,31}: increase the disk sizes
On Fedora 30 the paritition sizes turn out to be too small again:

  + mkdir -p /sysroot
  + mount /dev/dracut/root /sysroot
  + cp -a -t /sysroot /source/bin /source/dev /source/etc /source/lib /source/lib64 /source/proc /source/root /source/sbin /source/sys /source/tmp /source/usr /source/var
  cp: error writing '/sysroot/usr/lib64/libkrb5.so.3.3': No space left on device
  cp: error writing '/sysroot/usr/lib64/libkrb5support.so.0.1': No space left on device

It turns out that there has been quite some size increase in some libraries,
notably glibc, though not all -- some even shrunk, ruling out a toolchain
problem. Here's are files over 1M we install on Fedora 30:

   f29    f30
  2.7M => 6.4M /usr/lib64/{libc-2.28.so => libc-2.29.so}
  3.1M => 6.0M /usr/lib64/libcrypto.so.1.1.1c
  2.0M => 3.5M /usr/lib64/{libm-2.28.so => libm-2.29.so}
  2.9M => 2.8M /usr/lib/systemd/{libsystemd-shared-239.so => libsystemd-shared-241.so}
  1.7M => 2.5M /usr/lib64/libunistring.so.2.1.0
  2.3M => 2.4M /usr/lib64/bind9-export/libdns-export.so.1105.0.0
  1.2M => 2.1M /usr/bin/bash
  1.1M => 1.4M /usr/lib64/libkrb5.so.3.3
  1.2M => 1.4M /usr/lib64/libgcrypt.so.20.2.4
  612K => 1.1M /usr/lib64/libssl.so.1.1.1c

This increases the image sizes to accomodate for this. There's probably
little else we can do.

(cherry picked from commit e318ba30fb)
2019-08-30 14:06:59 +00:00
Lubomir Rintel
e35e43c1c2 test: tell systemd to reboot on fatal errors
Otherwise systemd would freeze execution, causing the test to time out
instead of failing fast.

(cherry picked from commit 7934c6f918)
2019-08-30 14:06:59 +00:00
Lubomir Rintel
0f0b8c8f90 test/TEST-14-IMSM: detect failure to compose the test setup root
The dracut-root-block-created line should not be created if we fail to copy
in the required files to sysroot. Let's turn on -e to trap failures and
poweroff on them, like some other tests do.

Also remove the &&. Not only it is unnecessary with -e, but defeats it.
From bash(1):

  The shell does not exit if the command that fails is [...] part of any
  command executed in a && or || list except the command following the
  final && or || [...]

(cherry picked from commit c27ed38bb2)
2019-08-30 14:06:59 +00:00
Lubomir Rintel
bf69beb6f3 test/TEST-17-LVM-THIN: fail setup if we run out of space in the thin pool
This condition is rather difficult to detect -- the writes will just remain
queued and get lost on shutdown, resulting in a corrupt filesystem.

(cherry picked from commit 91c15babdf)
2019-08-30 14:06:59 +00:00
Harald Hoyer
50192de38d test/test-functions: correctly move server.log
(cherry picked from commit 712f471ebf)
2019-08-30 14:06:59 +00:00
Harald Hoyer
e671c3a06a 95iscsi/module-setup.sh: do not require 'hostname' anymore
(cherry picked from commit ebe1821635)

[lkundrak@v3.sk: fixes TEST-30 that fails with: dracut: dracut module
'iscsi' will not be installed, because command 'hostname' could not be
found!]
2019-08-30 14:06:59 +00:00
Lubomir Rintel
e3b2b02c7f fs-lib: drop a bashism
Bash 5 apparently longer propagates variable assignments to local variables
in front of function calls when in POSIX mode:

  [lkundrak@demiurge ~]$ cat feh.sh
  print_VAR () {
          echo "$VAR";
  }

  testfunc () {
          local VAR="OLD"
          VAR=NEW print_VAR
  }

  testfunc
  [lkundrak@demiurge ~]$ bash4 --posix feh.sh
  NEW
  [lkundrak@demiurge ~]$ bash5 --posix feh.sh
  OLD
  [lkundrak@demiurge ~]$ bash5 feh.sh
  NEW
  [lkundrak@demiurge ~]$

It works the way it did in Bash 4 in non-POSIX mode, for external programs,
or for non-local variables. Don't ask me why -- it's probably some
compatibility thing for some sad old people.

However, this precisely happens when fsck_single() is calling into the
fsck_drv_com(), assigned to _drv by fsck_able(). That ruins the
TEST-70-BONDBRIDGETEAMVLAN test's server and probably more.

Let's pass the fsck driver binary via the function argument instead. It's
less messy anyway.

(cherry picked from commit 43c8c4ce04)
2019-08-30 14:06:59 +00:00
Frantisek Sumsal
d3f542cc9d travis: fetch only tags
The original `git pull` would try to pull & merge changes from the
master branch, which breaks CI runs on PRs based on non-master branches
2019-08-22 11:16:55 +02:00
Frantisek Sumsal
95bbcaa855 git2spec: avoid malforming of SHA-1 hashes
When a SHA-1 hash of a specific commit is used as a tag, the regex
shenanigans later in the script can (and will) corrupt it in certain
cases.

e.g.:
$ perl -e '
$tag="6e8cd92261577230daa1098f7e05ec198c3c4281";
$tag=~s/[^0-9]+?([0-9]+)/$1/;
print("$tag\n");
'
68cd92261577230daa1098f7e05ec198c3c4281

(Notice the missing 'e')

Let's fix this by limiting the regex's scope to a non-SHA-1 tags only.
2019-08-22 11:16:49 +02:00
Lukas Nykryn
3464297288 net-lib: fix typo $li -> $_li
(cherry picked from commit cd97d8d2c0646b95aee47efd5eee39f29d617a67)

Resolves: #1625042
2019-08-06 10:59:14 +02:00
Lukas Nykryn
9b2497dffb 90kernel-modules-extra: don't resolve symlinks before instmod
When you install a third-party driver, you will probably end in a
situation, where the module will be in a different directory and
in $depmod_module_dir you will only have symlink. If we resolve the
symlink before we pass the module path to instmod, the dracut-install
will only include the module with its original path, but not the
symlink. Hence the module can't be automatically loaded.

Dracut-install is clever enough to handle symlinks and will include both
the symlink and the module to the initrd.

(cherry picked from commit d1afff43ae)

Resolves: #1720275
2019-08-05 16:09:55 +02:00
Kairui Song
1851348709 95fcoe: load 'libfcoe' module as a fallback
The kernel may only enable 'libfcoe' module. Some modules like bnx2fc
provides FCoE but only depend on 'libfcoe'. Loading 'fcoe' module may
fail but the kernel do support FCoE.

'libfcoe' will be installed as a dependency when installing block device
drivers if it's required. So no need to install it in installkernel.

Signed-off-by: Kairui Song <kasong@redhat.com>
(cherry picked from commit 65fe1af2eca7d0ed340520577ab861fcd695b34a)

Resolves: #1719645
2019-07-30 09:43:03 +02:00
Lianbo Jiang
17cd55169c 99base: enable the initqueue in both 'dracut --add-device' and 'dracut --mount' cases.
The commit 9f3c31cd8d ("99base: enable initqueue if extra devices are added")
only covers 'dracut --add-device' case, but it did not cover 'dracut --mount'
case, which causes the kdump failure in the Amazon virtual machine.

Lets make sure that the initqueue is enabled in both cases in order to wake up
the device in time.

Reported-by: Xiao Liang <xiliang@redhat.com>
Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
(cherry picked from commit e0fc62f619ba55a96179382e22f7665e969c3d42)

Resolves: #1678094
2019-07-30 09:43:03 +02:00
Kairui Song
7ee74e539d dracut: let module handling function accept optional path option
Let the caller pass in the module path instead of try to find the module
path everytime. This helps optimize the overall runtime.

Test results (3 rounds) on Fedora 30 in KVM VM with 8 CPUs, 2G memory, HDD:

    $ time ./dracut.sh --local --quiet --hostonly --hostonly-cmdline --hostonly-i18n --hostonly-mode 'strict' -o 'plymouth dash resume ifcfg' --mount '/dev/mapper/fedora-root /sysroot xfs defaults' --no-hostonly-default-device -f initramfs.img
    Before the commit:
    real    0m11.782s  |  real    0m11.505s  |  real    0m11.958s
    user    0m9.169s   |  user    0m9.218s   |  user    0m9.327s
    sys     0m10.839s  |  sys     0m10.829s  |  sys     0m10.925s

    After this commit:
    real    0m9.866s  |  real    0m9.580s  |  real    0m9.638s
    user    0m9.048s  |  user    0m9.142s  |  user    0m9.120s
    sys     0m7.411s  |  sys     0m7.775s  |  sys     0m7.745s

Test result of building a ordinary image:

    $ time ./dracut.sh --local --quiet -f initramfs.img
    Before the commit:
    real    0m34.697s  |  real    0m34.371s  |  real    0m35.122s
    user    0m27.608s  |  user    0m27.524s  |  user    0m27.705s
    sys     0m22.341s  |  sys     0m22.032s  |  sys     0m22.246s

    After the commit:
    real    0m31.914s  |  real    0m31.006  |  real    0m31.289ss
    user    0m27.315s  |  user    0m27.324  |  user    0m27.290ss
    sys     0m19.051s  |  sys     0m18.916  |  sys     0m19.022ss

This will have an ~2s speed up.

Signed-off-by: Kairui Song <kasong@redhat.com>
(cherry picked from commit 5916d31b24)

Cherry-picked from: 5916d31b
Resolves: #1734047
2019-07-30 09:42:56 +02:00
Kairui Song
829ed8ef5c squash: also squash systemctl if switch-root is not needed
systemctl need to be accessible on switch-root, but we unmount the
squash image on switch-root, so it will fail. systemctl depends on a lot
of libraries, squash them can save more RAM. So allow modules
(eg. kdump) to tell dracut that switch-root will be intercepted,
then we don't need to take care of that.

Signed-off-by: Kairui Song <kasong@redhat.com>
(cherry picked from commit 3ee0ca5eb74be5d1fbd0e6d643f6fff06234177f)

Resolves: #1691705
2019-07-29 15:56:20 +02:00
Kairui Song
b6d52b504f squash: fix and simplify required_in_root
If required target is a symbol link, create the link then following the
link. If it's a directory, create new directory, else just move it.

Signed-off-by: Kairui Song <kasong@redhat.com>
(cherry picked from commit 11ce69e4bd9172cf54251ea62bb4a5ead1700fd6)

Resolves: #1691705
2019-07-29 15:56:09 +02:00
Kairui Song
927428e6a5 squash: squash systemd binary and udevadm
systemd binary and udevadm are not needed to be outside the squash
image. Some binaries are kept outside because they are required before
mounting the image, or after umounting the image (when switching root),
or they may block umounting the image. But we are using lazy umounting,
so actually nothing will block the umount.

Keep more binaries outside the squash image won't hurt but cost extra
memories, the idea of squash image is to save memory usage.

So, there is no reason to keep udevadm outside, that should be a debug
left over. For systemd binary, it's running when switch root happens,
But we have lazy umounted the image and overlay, once systemd process
exec the new systemd in new root, everything will be cleared by kernel.

Also tidy up the comment make it less confussing.

Signed-off-by: Kairui Song <kasong@redhat.com>
(cherry picked from commit e1e1f6e8e6747d8f32c065e267e0a57587818c9e)

Resolves: #1691705
2019-07-29 15:55:47 +02:00
Harald Hoyer
d86dfcd148 dracut.spec: add 06rngd 2019-07-25 13:24:10 +02:00
Renaud Métrich
31116110ff rngd: new module running early during boot to help generating entropy when system's default entropy sources are poor (e.g. use of SSD disks or UEFI RNG not available)
On systems with low entropy at boot, the boot can take up to several
hours, specially when NBDE is used (e.g. clevis) which makes use of
the random number generator.

Enabling rngd service at boot early, because dracut-initqueue runs,
enables to initialize the random number generator in a couple of seconds
instead of minutes or hours.

Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
(cherry picked from commit adee5b97bc)

Resolves: #1726617
2019-07-25 13:11:25 +02:00
Lukas Nykryn
4971a2c4eb 01fips: add cfb cipher
Required by FIPS standard
2019-07-16 08:49:43 +01:00
Harald Hoyer
7c35556da4 network: skip already enslaved interfaces
(cherry picked from commit f6e3b59e5e)

Resolves: #1625042
2019-07-08 13:14:24 +02:00
Kairui Song
a1435c3d53 fips: ensure fs module for /boot is installed
When using dracut with  --hostonly and --no-hostonly-default-device,
/boot will be inaccessible as dracut will most fs modules unless
specified. But FIPS require /boot to be accessible, and it will try
to mount it on boot. It will fail if corresponding fs module is missing.

For most case /boot will be a simple partition, include the fs module
will be enough for FIPS to mount it. For other cases users have to pass
extra parameters by themselves.

Suggested-by: Kenneth Dsouza <kdsouza@redhat.com>
Signed-off-by: Kairui Song <kasong@redhat.com>
2019-06-26 12:26:11 +02:00
Lukas Nykryn
9c54932f59 fips: split loading the crypto modules and checking the kernel
In e54ab383 we moved the fips script to a later pahse of boot, since
the /boot might not be available early on.

The problem is that systemd-cryptsetup* services could be run now
started before the do_fips is executed and need the crypto modules
to decrypted the devices.

So let's split the do_fips and load the module before udev does the
trigger.
2019-06-14 15:59:03 +02:00
Lukas Nykryn
81b59fbbd6 95iscsi: rd.iscsi.initiator should have priority over stored configuration
(cherry picked from commit 61afc70454)

Resolves: #1664062
2019-06-03 14:20:40 +02:00
Lukas Nykryn
c787ad30ab net-lib: strstr is not for globs
(cherry picked from commit 1a3dcc8b46c967445794e679280a3fb3b8e77ae0)

Resolves: #1712469
2019-06-03 14:18:53 +02:00
Lukas Nykryn
e44c26f0fc 95iscsi: fix a typo in a name of iscsiuio 2019-01-15 16:44:00 +01:00
Lukas Nykryn
90054e4f1f 95iscsi: decouple iscsi from sysinit.target 2019-01-15 13:17:33 +01:00
Harald Hoyer
d8386b5d8f Makefile: add srpm target 2018-10-30 09:30:22 +01:00
Lukas Nykryn
5541b0c46f dracut.install: call dracut with --force
The kernel-install is called even if you run make install.
Since we don't call dracut with -f a second make install will fail
because initrd with same version is already there.
This makes kernel developers feel miserable.

https://bugzilla.redhat.com/show_bug.cgi?id=1642402

Cherry-picked from: 48c283a2
Resolves: #1642402
2018-10-30 09:29:09 +01:00
Kairui Song
b63e0c5040 99squash: Don't clean up squahfs on isolate
The only time we need to cleanup squahfs manually is on switch root, to
release resource and memory. We've covered that by setting
"Conflicts=initrd-switch-root.target" for squash cleanup service.
On shutdown systemd will take care of squahfs mounts. But for other
isolate, files in initramfs are most likely still required, so don't
clean up squahfs. For example, kdump's emergency handler will isolate
into its own target, if squahfs is cleaned up it will fail.

Signed-off-by: Kairui Song <kasong@redhat.com>

Cherry-picked from: b9af0fcd
Resolves: #1641423
2018-10-30 09:28:44 +01:00
Kairui Song
3b9b20d237 40network: Don't include 40network by default
commit 7347391 ('network-legacy: split off from network module')
splitted network function to network-legacy and removed check() function
of 40network. This caused 40network to be included even if network is
not needed.

Signed-off-by: Kairui Song <kasong@redhat.com>

Cherry-picked from: 83cbc06ab9
Resolves: #1639088
2018-10-15 09:15:53 +02:00
Kairui Song
44c9d019d8 dracut.spec: Fix error introduced by 70291ed
70291e0 ('dracut.spec: Add dracut-squash package') introduced a new
dracut-squash package, but by accident it overrided some other package
spec and the dependency name is wrong. This patch will fix it.
2018-10-09 10:32:40 +02:00
Lukas Nykryn
2e5265c80e spec: return old provides 2018-10-09 10:31:04 +02:00
Lukas Nykryn
3cb0f01a1e Revert "use cp --reflink=auto"
This reverts commit 8cd8820547.
Resolves: #1623990
2018-10-09 10:30:56 +02:00
Harald Hoyer
225e4b94cb Fix tests with network-legacy 2018-10-08 15:38:33 +02:00
Harald Hoyer
3e676eb12f AUTHORS: update 2018-10-08 15:31:49 +02:00
Harald Hoyer
2257b800ac NEWS: update 2018-10-08 15:31:08 +02:00
Eugene Syromiatnikov
290df2e1de modules.d: Add a module for handling additional depmod kernel module directories
It parses depmod configuration and scans modules.dep for kernel modules
present in directories supplied in "overrides", "external", and "search"
depmod configuration options.  The resulting list of (absolute) kernel
module paths is then supplied to instmods.

* modules.d/90kernel-modules-extra/module-setup.sh: New file.
* dracut.spec (%files): Add
%{dracutlibdir}/modules.d/90kernel-modules-extra.

Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
2018-10-08 10:49:36 +02:00
Harald Hoyer
4be697e5c1 dracut.spec: fixed invalid spec line 2018-09-21 12:41:00 +02:00
Lubomir Rintel
08bdadbf31 network-manager: add module 2018-09-21 11:32:01 +02:00
Lubomir Rintel
734739187b network-legacy: split off from network module 2018-09-21 11:32:01 +02:00
Lubomir Rintel
1c4a51c39c network: fix an error message 2018-09-21 11:32:01 +02:00
Lubomir Rintel
0aa2e5f728 iscsi: start iscsid even w/o systemd 2018-09-21 11:32:01 +02:00
Lubomir Rintel
5e615f4eb4 iscsi: do not install all of /etc/iscsi unless hostonly
/etc/iscsi/initiatorname.iscsi would leak the host initiator name (that
is host configuration) to the initramfs. Perhaps other files too.
2018-09-21 11:32:01 +02:00
Lubomir Rintel
9e82732dd4 iscsi: do not replace the configuration in the host system
ln: failed to create symbolic link '/usr/lib/systemd/system/sockets.target.wants/iscsid.socket': Permission denied
  ln: failed to create symbolic link '/usr/lib/systemd/system/sockets.target.wants/iscsiuio.socket': Permission denied

No way. Just ensure the links are there in the initramfs image. In fact,
that is already the case for iscsiuio.socket. Add iscsid.socket too.
2018-09-21 11:32:01 +02:00
Lubomir Rintel
0454dc247a network: configure NetworkManager to use dhclient
If the network module obtained a lease using dhclient, NetworkManager
must be configured to use it too, otherwise it would obtain a different
lease (and could potentially break a connection to the network volume).
2018-09-21 10:40:55 +02:00
Kairui Song
24f3463bff dracut.spec: Add dracut-squash package
As 99squash module requires extra dependency and it introduces new
files, add a new sub package for this module.
2018-09-21 10:32:04 +02:00
Kairui Song
095e1f37c4 Add support for building a squashed initramfs
With all files stored in ramfs, and most of them are not compressed,
the initramfs will take up a lot of memory. Besides, if the file number
is large, each file will waste some memory due to page fragmetation.
This is due to ramfs' design, at least one page will be allocated for
one file however small the file is. On machine with large page size,
this will become worse and waste too many memory.

One approach to reducing the memory usage is to reduce the number of
files that got directly loaded into the root ramfs, and compress files
by put most files will into a read-only squash image and keep a minimum
set of executable and libraries outside as the loader for the squash
image. After the squash image is mounted, the real 'init' will be
executed and then everything behaves as usual.

This patch will introduce a '99squash' module which will never be
included by default. User can force add it, and if it is included,
dracut will perform some extra steps before creating the final image:

For now, "/etc" and "/usr" will be moved into the squashfs image.
"/init" will be renamed to "/init.stock" and replaced by "/init.squash".
Files and folders need to be accessible before mounting the image will
be still avaliable at their original place. And due to squashfs is
readonly, an overlayfs layer will be created on top of squashfs mount
point, as many dracut module require readwrite access to "/etc" and
"/usr", "init.squash" will ultimately call "/init.stock".

An extra systemd service will be installed. This service will umount all
squashfs related mount points right before switch-root to release
resources properly. This service will not actually do anything if
switch-root is not used.

This is very helpful when mem resource is very limited, like Kdump.
According to my tests, this squash module can help save about 35MB of
memory with 64K page size, or about 15MB with 4K page size on an
ordinary kdump capture routine. This module could also help reduce
memory usage for normal boot up process.

Won't change any behavior if squash module is not enabled.

Signed-off-by: Kairui Song <kasong@redhat.com>
2018-09-21 10:32:04 +02:00
Alexander Tsoy
f4334e9bdf base/dracut-lib.sh: use "command -v" in pidof()
"type -P" doesn't work in dash
2018-09-10 09:45:50 +02:00
Alexander Tsoy
838f22259a install: avoid non-portable __WORDSIZE
Lets not unnecessarily rely on __WORDSIZE, which is not clearly specified
by any spec. Use explicit size comparisons if we're not interested in the
WORDSIZE, anyway.

Patch ported from systemd.
(commit 8507eb20b64010b26f23822cbf442bb0bf96511c)

Original-patch-by: Emil Renner Berthing <systemd@esmil.dk>
Bug: https://bugs.gentoo.org/602122
2018-09-10 09:45:22 +02:00
Alexander Tsoy
b3480d31b0 Prevent environment leaking into initrd-release
On my system the following initrd-release is generated:
...
VERSION="4 dracut-048 dracut-048"
...

VERSION is not defined in /etc/os-release, so the variable is
concatenated with its previous value:

* "4" comes from the kernel build system since dracut is called from the
  kernel install hook ("4" is a major kernel version);
* first "dracut-048" comes from the "systemd-initrd" module;
* second "dracut-048" comes from the "base" module.
2018-09-10 09:42:36 +02:00
Frederick Grose
8dd7bb48fc dmsquash-live/apply-live-updates: Test proper file link.
Update flag link to /dev/root as required by commit
789668deb3.
2018-09-06 11:46:24 +02:00
Frederick Grose
44d1688164 dmsquash-live-root: Manage absent overlayfs module better.
die when required; systemctl reload otherwise.
2018-09-06 11:46:24 +02:00
Frederick Grose
a7d8fc280c dmsquash-live: Avoid grep and sed in this module.
strstr and variable string manipulations suffice.
2018-09-06 11:46:24 +02:00
Daniel Molkentin
e9a84e0a21 98dracut-systemd: Start systemd-vconsole-setup before dracut-cmdline-ask
This is what happened before this patch (edited for brevity):

  dracut-cmdline-ask.service in modules.d/98dracut-systemd, which invokes
  dracut-cmdline-ask.sh. This script and systemd-vconsole-setup are
  started in parallel for the same console (tty1).

  Then dracut-cmdline-ask quits immediately without doing anything (unless
  rd.cmdline=ask is given). As this is a bash script and it gets tty as
  stdin as specified in its *.service, this triggers the hangup of tty1 at
  its exit.

  Meanwhile systemd-vconsole-setup continues and tries some ioctls after
  that, but they fail because of the hung up tty1.

The usual culprit for starting systemd-vconsole-setup early on is
plymouth-start.service, even if plymouth.enable=0 is set.

A popular (and annoying) symptom of this as reported by users was
the inability use their configured keyboard layout in plymouth when
unlocking their crypted block devices.

Reference: boo#1055834
2018-09-05 13:20:36 +02:00
Tobias Klauser
d09218823c Fix misspellings in man pages and usage
Also remove some trailing whitespaces from the same files.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2018-08-30 13:12:00 +02:00
Tony Asleson
ae9bc0d72f stratis: Add additional binaries
Include all binaries that could be called by the daemon.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2018-08-24 08:46:13 +02:00
Kairui Song
09ba1b289f kernel-modules: add nfit
To support pmem devices, nfit module is required
2018-08-21 13:03:36 +02:00
Kairui Song
9f3c31cd8d 99base: enable initqueue if extra devices are added
When extra devices are added, initqueue should be enabled to make sure
those devices are present, so following services and routines could
use those devices.

See PR #442 for more detail.
2018-08-21 13:03:20 +02:00
Frederick Grose
eb18a1fe29 dmsquash-live, livenet: Simplify OverlayFS read-only overlay setup.
Use multiple lower layer directories in a single OverlayFS mount with
  a transient overlay directory.
Tolerate a command line with rd.live.overlay.readonly and NO persistent
  overlay by reconfiguring the OverlayFS mount options.
Use more compatible shell syntax for testing symlinks, and use printf
  instead of echo -e.
2018-08-21 10:52:34 +02:00
Frederick Grose
789668deb3 dmsquash-live: Support a flattened squashfs.img
A simplified root filesystem structure may be provided for OverlayFS
overlays by squashing the root filesystem directly instead of squashing
an embedded image file at /LiveOS/rootfs.img.  Detect and configure
such a squashed root filesystem for live booting.

For OverlayFS boots, avoid the read-only Device-mapper linear device
  at /dev/mapper/live-base.
Create a consistent device link at /dev/live-base for the read-only
  base loop device for all overlayed live root filesystems.
Consistently provide a link at /dev/root for wait_for_dev.

Update documentation.
2018-08-21 10:52:34 +02:00
Frederick Grose
e791d753be livenet: Enable OverlayFS overlay in sysroot.mount generator.
Adjust sysroot.mount configuration for rd.live.overlay.overlayfs option.
Use link at /dev/root as a consistent flag for wait_for_dev.
Adjust documentation.
2018-08-20 10:08:43 +02:00
Harald Hoyer
e0e6d96d69 travis: re-enable test 14
https://bugzilla.redhat.com/show_bug.cgi?id=1615271
2018-08-20 10:05:41 +02:00
Harald Hoyer
ee18dd2b88 ifcfg/write-ifcfg.sh: aggregate resolv.conf
The old code used /tmp/net.$netif.resolv.conf with $netif being randomly
chosen.

As it is not known which nameserver have which priority, just sort them
and deduplicate.
2018-08-17 15:52:36 +02:00
Harald Hoyer
09132c732a test/test-functions: fixed V=1 logic 2018-08-17 15:38:03 +02:00
Harald Hoyer
f19063ac71 travis: one last job reshuffle 2018-08-16 15:34:49 +02:00
Harald Hoyer
a17440713a travis: reshuffle tests
long running tests first
2018-08-16 14:48:21 +02:00
Harald Hoyer
bd03d374b7 travis: modprobe amd nested=1
GREAT!

$ modinfo kvm-intel kvm-amd| fgrep nested
parm:           nested:bool
parm:           nested:int
2018-08-16 14:28:54 +02:00
Harald Hoyer
06e12e4ba8 travis: rebalance tests 2018-08-16 14:25:23 +02:00
Harald Hoyer
f059ce7682 travis: reshuffle tests 2018-08-16 13:56:19 +02:00
Harald Hoyer
286685cb72 TEST-99-RPM: use releasever of the host system 2018-08-16 13:20:40 +02:00
Harald Hoyer
7c62555bcf TEST-15-BTRFSRAID: use seperate disk image for boot result 2018-08-16 13:20:35 +02:00
Harald Hoyer
2699d8ff7e TEST-99-RPM: removed --releasever 2018-08-16 12:03:40 +02:00
Harald Hoyer
5a8f1aef55 TEST-15-BTRFSRAID: sync in test-init
strange failure
2018-08-16 12:01:40 +02:00
Harald Hoyer
9c034dc326 travis: no rpm check for all matrix tests 2018-08-16 11:57:30 +02:00
Harald Hoyer
f8cad00948 test: for V=2 tail only the last MB of logs 2018-08-16 11:47:21 +02:00
Harald Hoyer
c128b969bb travis: combine more tests 2018-08-16 11:18:33 +02:00
Harald Hoyer
f59664a01f logtee: reduce output 2018-08-16 11:14:11 +02:00
Harald Hoyer
67f43d2124 test: fixed test.log name 2018-08-16 11:13:55 +02:00
Harald Hoyer
0ae5848245 travis: git pull more depth 2018-08-16 10:46:57 +02:00
Harald Hoyer
9f02b291ac travis: git pull --tags 2018-08-16 10:39:49 +02:00
Harald Hoyer
2b77ba0b75 travis: fight with yaml 2018-08-16 10:36:17 +02:00
Harald Hoyer
6f90be2971 travis: fixup 2018-08-16 10:33:06 +02:00
Harald Hoyer
110063c585 travis: git check 2018-08-16 10:29:16 +02:00
Harald Hoyer
51d0a54555 travis: use own logtee.c to reduce log output 2018-08-16 10:17:48 +02:00
Harald Hoyer
c31a80c9ed TEST-01: remove memdebug 2018-08-16 09:50:52 +02:00
Harald Hoyer
79afb279c2 travis: fedora-test.sh send dnf output to dev/null 2018-08-16 09:48:02 +02:00
Harald Hoyer
3c8d3a6565 travis: don't run TEST-40-NBD 2018-08-16 09:35:33 +02:00
Harald Hoyer
01f9d0d9bf travis: combine more tests 2018-08-16 09:26:35 +02:00
Harald Hoyer
3111988680 dracut.sh: remove bogus dir removal for --rebuild 2018-08-16 09:19:52 +02:00
Harald Hoyer
1ebbe2eb7b travis: combine jobs 2018-08-16 09:10:29 +02:00
Harald Hoyer
65d16d1914 travis: extend matrix 2018-08-16 08:50:11 +02:00
Harald Hoyer
da5a44cfb7 .travis.yml: add gitter notifications 2018-08-14 17:06:58 +02:00
Harald Hoyer
75b8b144a1 fedora-test.sh: don't parallelize travis tests 2018-08-14 17:02:43 +02:00
Harald Hoyer
1363167d65 Update README.md 2018-08-14 16:58:52 +02:00
Harald Hoyer
d15c15c8f5 test/test-functions: be verbose for any $V not empty 2018-08-14 16:54:27 +02:00
Harald Hoyer
9288d21b9f TEST-50-MULTINIC: removed bogus qemu compat server call 2018-08-14 16:37:01 +02:00
Harald Hoyer
cafe6675c2 test/run-qemu: move -cpu host to kvm args 2018-08-14 16:31:22 +02:00
Harald Hoyer
fba4d28433 TEST-50-MULTINIC: fixed server.log 2018-08-14 16:30:42 +02:00
Harald Hoyer
b7774da97c might even run without kvm 2018-08-14 16:18:53 +02:00
Harald Hoyer
3c1a083e5c add travis build job 2018-08-14 16:01:39 +02:00
Harald Hoyer
0f294d90b2 TEST-31-ISCSI-MULTI: increase verbose level 2018-08-14 15:54:42 +02:00
Harald Hoyer
a2dbecfcd6 test: add TEST_RUN_ID 2018-08-14 15:54:31 +02:00
Harald Hoyer
604c09b1da TEST-31-ISCSI-MULTI/test.sh: fixed test description 2018-08-14 15:28:56 +02:00
Harald Hoyer
f9c8b3112a TEST-50-MULTINIC/test.sh: fixed server startup 2018-08-14 14:12:54 +02:00
Harald Hoyer
bb75d16521 kernel-network-modules: add vlan kernel modules 2018-08-14 14:07:12 +02:00
Harald Hoyer
ca8f1c1ba3 test: fixed KVERSION and qemu backwards compatiblity 2018-08-14 14:03:55 +02:00
Harald Hoyer
94cc856cb8 TEST-70-BONDBRIDGETEAMVLAN: load vlan kernel modules 2018-08-14 13:57:15 +02:00
Harald Hoyer
827a5b1a80 test: also output server.log on failure 2018-08-14 11:37:57 +02:00
Harald Hoyer
393da0c370 TEST-50-MULTINIC: s/--device/-device 2018-08-14 11:35:26 +02:00
Harald Hoyer
82fe4ea0a5 enable parallel test suite
$ time sudo make -j SKIP=14 V=2 check
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-13-ENC-RAID-LVM'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-40-NBD'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-04-FULL-SYSTEMD'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-12-RAID-DEG'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-15-BTRFSRAID'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-16-DMSQUASH'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-17-LVM-THIN'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-11-LVM'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-31-ISCSI-MULTI'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-20-NFS'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-99-RPM'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-02-SYSTEMD'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-30-ISCSI'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-01-BASIC'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-03-USR-MOUNT'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-70-BONDBRIDGETEAMVLAN'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-50-MULTINIC'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-10-RAID'
make[1]: Entering directory '/home/harald/git/dracut/test/TEST-18-LVM-ENC-LV'
TEST: root filesystem on an encrypted LVM PV on a degraded RAID-5 [STARTED]
TEST: root filesystem on NBD [STARTED]
TEST: root filesystem on NBD [SKIPPED]
TEST: Full systemd serialization/deserialization test with /usr mount [STARTED]
TEST: root filesystem on multiple device btrfs [STARTED]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-40-NBD'
TEST: root filesystem on a LiveCD dmsquash filesystem [STARTED]
TEST: root filesystem on a LiveCD dmsquash filesystem [SKIPPED]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-16-DMSQUASH'
TEST: root filesystem on LVM on encrypted partitions of a RAID-5 [STARTED]
TEST: root filesystem on LVM PV [STARTED]
TEST: rpm integrity after dracut and kernel install [STARTED]
TEST: root filesystem on NFS [STARTED]
TEST: root filesystem over iSCSI [STARTED]
TEST: root filesystem on LVM PV with thin pool [STARTED]
TEST: root filesystem over iSCSI [STARTED]
TEST: root filesystem on a ext3 filesystem [STARTED]
TEST: root filesystem on a ext3 filesystem [STARTED]
TEST: root filesystem on a btrfs filesystem with /usr subvolume [STARTED]
TEST: root filesystem on NFS with bridging/bonding/vlan [STARTED]
TEST: root filesystem on NFS with multiple nics [STARTED]
TEST: root filesystem on an encrypted LVM PV on a RAID-5 [STARTED]
TEST: root filesystem on LVM on encrypted partitions of a RAID-5 [STARTED]
TEST: root filesystem on LVM PV [OK]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-11-LVM'
TEST: root filesystem on multiple device btrfs [OK]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-15-BTRFSRAID'
TEST: root filesystem on LVM PV with thin pool [OK]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-17-LVM-THIN'
TEST: root filesystem on a ext3 filesystem [OK]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-02-SYSTEMD'
TEST: root filesystem on a btrfs filesystem with /usr subvolume [OK]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-03-USR-MOUNT'
TEST: root filesystem on LVM on encrypted partitions of a RAID-5 [OK]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-18-LVM-ENC-LV'
TEST: Full systemd serialization/deserialization test with /usr mount [OK]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-04-FULL-SYSTEMD'
TEST: root filesystem on an encrypted LVM PV on a RAID-5 [OK]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-10-RAID'
TEST: root filesystem on LVM on encrypted partitions of a RAID-5 [OK]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-13-ENC-RAID-LVM'
TEST: root filesystem over iSCSI [OK]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-30-ISCSI'
TEST: root filesystem on a ext3 filesystem [OK]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-01-BASIC'
TEST: root filesystem over iSCSI [OK]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-31-ISCSI-MULTI'
TEST: rpm integrity after dracut and kernel install [OK]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-99-RPM'
TEST: root filesystem on NFS [OK]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-20-NFS'
TEST: root filesystem on NFS with bridging/bonding/vlan [OK]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-70-BONDBRIDGETEAMVLAN'
TEST: root filesystem on an encrypted LVM PV on a degraded RAID-5 [OK]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-12-RAID-DEG'
TEST: root filesystem on NFS with multiple nics [OK]
make[1]: Leaving directory '/home/harald/git/dracut/test/TEST-50-MULTINIC'

real	9m3,969s
user	22m50,323s
sys	5m24,411s
2018-08-14 11:04:50 +02:00
Harald Hoyer
ffbd37d784 TEST-31-ISCSI-MULTI: use different port than TEST-30 2018-08-14 11:03:48 +02:00
Harald Hoyer
ab94a204e0 load modules earlier for iscsi via dhcp root-path 2018-08-14 11:03:11 +02:00
Harald Hoyer
6058b06b86 test/{TEST-50-MULTINIC,TEST-70-BONDBRIDGETEAMVLAN}: use qemu-3.0 syntax
use qemu-3.0 syntax for network devices
2018-08-13 16:30:25 +02:00
Harald Hoyer
26aea0299a multipath-shutdown: fix shell syntax
seems like a misplaced $()
2018-08-13 16:30:25 +02:00
Harald Hoyer
0a80cda0ea dracut.spec: remove warpclock from z-series, not the other way round 2018-08-13 16:30:25 +02:00
Harald Hoyer
6f0500ed4a iscsi: remove $() where it does not fit
also simplify iscsiadm command to one call
2018-08-13 16:30:25 +02:00
Harald Hoyer
746135dd1e mdraid: better handling of various UUID formats 2018-08-13 16:30:25 +02:00
Lukas Nykryn
a762dedb60 dracut-functions: fix the word splitting 2018-08-09 13:13:52 +02:00
Nicolas Chauvet
a0c915b1e4 Add gpio and pinctrl drivers for arm*/aarch64
This is needed since few gpio/pinctrl can be built as modules and are
useful on early boot.

One example is jetson-tx1 where sata and external mmc can work only
after loading pinctrl-max77620 and gpio-max77620 modules.

Having theses kind of drivers bundled into the initramfs will also
avoid some deferred probes.

V2: add pinctrl for all arches

Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
2018-08-06 09:46:08 +02:00
Harald Hoyer
99df3d22be mdraid/parse-md.sh: also accept rd.md.uuid with ":"
convert rd.md.uuid=32ef2172:f056:6fa7:66a8:2f7fc8b1798
to udev rules in the correct UUID format 32ef2172-f056-6fa7-66a8-2f7fcf8b1798
2018-08-02 16:32:41 +02:00
Yu Watanabe
be98291caf spec: sort modules
Also drops remaining %defattr.
2018-07-30 10:43:21 +02:00
Yu Watanabe
33782aebbf spec: warpclock is not available on s390 or s390x 2018-07-30 10:43:21 +02:00
Harald Hoyer
55a12055c5 dracut.spec: Remove needless use of %defattr 2018-07-26 13:04:20 +02:00
Harald Hoyer
25111d717e dracut.spec: add 00warpclock dracut module 2018-07-26 13:01:14 +02:00
Harald Hoyer
819ea38651 Bring back 51-dracut-rescue-postinst.sh
can only be obsoleted after F30
2018-07-26 12:58:21 +02:00
Kairui Song
143420bc05 lsinitrd: update help message and man page
Signed-off-by: Kairui Song <kasong@redhat.com>
2018-07-26 09:57:55 +02:00
Kairui Song
986b12d391 lsinitrd: optimize performance when handling multiple files
Currently, when trying to unpack or print the content of multiple
files, lsinitrd will decompress the image and pipe the decompressed
content to cpio to retrive each file if the image is compressed.
Which mean if we want to extract 10 files the image will be decompressed
10 times, which is a waste of time.

This patch will let lsinitrd decompress the image file to a temp file
first if multiple file names are given, then cpio will read from the
decompressed temp file, which will speed up a lot.

Time consumption test for command:
`lsinitrd initramfs-4.16.15-300.fc28.x86_64.img \
    usr/lib/dracut/build-parameter.txt \
    usr/lib/dracut/modules.txt \
    etc/machine-id \
    etc/hostname \
    usr/lib/udev/rules.d/99-systemd.rules`

Before the patch:
2.37user 0.33system 0:02.12elapsed

After the patch:
0.50user 0.42system 0:00.72elapsed

There would be a more significant time difference if we try to
extract more files.
2018-07-26 09:57:55 +02:00
Kairui Song
f81c864eed lsinitrd: allow to only unpack certain files
Before this patch, "--unpack" will always unpack the whole image.
Make "--unpack" be able to unpack only certain files, it will be
easier to retrieve files from initramfs image.

Signed-off-by: Kairui Song <kasong@redhat.com>
2018-07-26 09:57:55 +02:00
Harald Hoyer
aac3a0652a NEWS: forgot to update the latest version 2018-07-26 09:54:13 +02:00
Hannes Reinecke
a0eadcdc64 00warpclock: Set correct timezone
Add module for setting correct timezone.

References: bnc#830060

For now, this module will not be included automatically due to different
expectations (see e.g.  https://bugzilla.redhat.com/show_bug.cgi?id=981617)

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Daniel Molkentin <daniel.molkentin@suse.com>
2018-07-24 07:08:11 +02:00
Harald Hoyer
e331e06a39 dracut-install: skip modules with empty path
if kmod_module_get_path(module) returns NULL, skip the module
2018-07-18 12:42:02 +02:00
Kairui Song
7047294617 Record loaded kernel modules when hostonly mode is enabled
A hostonly image will not include every possibly required kernel module,
so if any hardware or configuration changed, the image may fail to boot.

One way to know if there are any hardware change or configuration change
that will require an image rebuild or not is to check the loaded kernel
module list. If the loaded kernel module list differs from last build
time, then the image may require to be rebuilt.

This commit will let dracut record the loaded kernel module list when
the image is being built, so other tools or services can compare this
list with currently loaded kernel modules to decide if dracut should be
called to rebuild the image.

To retrieve the loaded kernel modules list when an image is built, use
lsinitrd command:

lsinitrd $image -f */lib/dracut/loaded-kernel-modules.txt
2018-07-18 11:50:18 +02:00
Harald Hoyer
1caaeaae1e modules.d/95fcoe/cleanup-fcoe.sh: chmod +x 2018-07-12 15:19:17 +02:00
Harald Hoyer
d63a4e285e TEST-40-NBD: disable for now
nbd is always broken
2018-07-12 15:18:48 +02:00
Harald Hoyer
9a9c67d61b TEST-30-ISCSI: readd multiple target test 2018-07-06 11:56:23 +02:00
Harald Hoyer
bc01f822de NEWS and AUTHORS update 2018-07-06 10:37:51 +02:00
Harald Hoyer
f265cb67dc mdraid: fix case if rd.md.uuid is in ID_FS_UUID format
if rd.md.uuid is in ID_FS_UUID format with dashes
e40a0234-7e52-5f10-f267-658d8ec463fa
convert it for the /dev/disk/by-id/md-uuid-${uuid} format
e40a0234:7e525f10:f267658d:8ec463fa
2018-07-06 09:25:03 +02:00
Harald Hoyer
f98d3066d9 rdsosreport.sh: best effort to strip out passwords
Modified version of:
https://github.com/dracutdevs/dracut/pull/96

Thanks to Zhiguo Deng <bjzgdeng@linux.vnet.ibm.com>
2018-07-05 14:49:23 +02:00
Mike Gilbert
9d1b81c0d1 dracut.sh: improve udevdir and systemdutildir fallback logic
Check for a common binary in systemdutildir. This resolves an issue on
split-usr systems, where it is common to have both /lib/systemd[/system]
and /usr/lib/systemd[/user] present.

Check for systemd-udevd specifically, since some distros (Gentoo) allow
udev to be installed without the rest of the systemd stack.

Similar logic is applied to udevdir simply for consistency.
2018-07-05 13:57:43 +02:00
Harald Hoyer
e3fb645821 TEST-99-RPM: use Fedora 29 2018-07-05 13:39:46 +02:00
Harald Hoyer
8f77326479 dracut-init.sh: fix instmods with zero input
instmods < /dev/null

should not error
2018-07-05 13:39:46 +02:00
Harald Hoyer
ca77afdeb3 dracut.spec: remove 90multipath-hostonly 2018-07-05 13:39:46 +02:00
Kairui Song
35e86ac117 Merge 90-multipath-hostonly and 90-multipath
This commit basically reverts 5ce7cc73

90-multipath-hostonly module was added in 5ce7cc73, because if hostonly
mode is enabled, multipath module will always hardcode wwids which
causes problems when the initramfs is cloned to another system with same
hardware.

Now with tri-state hostonly mode, the two modules could be merged and only
hardcode wwids when "strict" hostonly mode is enabled.
2018-07-05 13:17:19 +02:00
Harald Hoyer
058ff2f06d dracut.spec: add 95qeth_rules 2018-07-05 12:03:34 +02:00
Harald Hoyer
efecf0a95e network: iface_has_carrier(): fixed logic 2018-07-05 09:37:10 +02:00
Hiroaki Mizuguchi
c574c3f565 ifup.sh: don't wait linkup when set static ip explicitly
iface_has_carrier is skipped when set $dev. Fail curl fetch for root=live:<url>.
2018-07-05 09:37:01 +02:00
Daniel Molkentin
61ac90fefa 95qeth_rules: Add new module to copy qeth rules
Only pick rules for interfaces which have a carrier in the running
system. Those interfaces will be assembled by udev to allow booting
from those devices (i.e. iSCSI).

Reference: FATE#323440
2018-07-05 09:15:08 +02:00
Kairui Song
432647c278 90kernel-modules: Don't install extra modules when hostonly mode is set to strict 2018-07-05 09:14:02 +02:00
Kairui Song
a695250ec7 Introduce tri-state hostonly mode
Add a new option --hostonly-mode which accept an <mode> parameter, so we have a tri-state hostonly mode:

    * generic: by passing "--no-hostonly" or not passing anything.
               "--hostonly-mode" has no effect in such case.
    * sloppy: by passing "--hostonly --hostonly-mode sloppy". This
              is also the default mode when only "--hostonly" is given.
    * strict: by passing "--hostonly --hostonly-mode strict".

Sloppy mode is the original hostonly mode, the new introduced strict
mode will allow modules to ignore more drivers or do some extra job to
save memory and disk space, while making the image less portable.

Also introduced a helper function "optional_hostonly" to make it
easier for modules to leverage new hostonly mode.

To force install modules only in sloppy hostonly mode, use the form:

hostonly="$(optional_hostonly)" instmods <modules>

Signed-off-by: Kairui Song <kasong@redhat.com>
2018-07-05 09:14:02 +02:00
Harald Hoyer
6ccb58a5b6 iscsi: s/rd.iscsilogin.retries/rd.iscsi.login_retry_max 2018-07-05 09:02:55 +02:00
Harald Hoyer
7d0848957c iscsi: do discovery for every network change 2018-07-04 13:05:56 +02:00
Daniel Molkentin
6b7ffedf0d Fix syncheck complaints 2018-07-04 13:05:56 +02:00
Daniel Molkentin
b31f3fe0d1 95iscsi: Replace iscsistart with iscsid
This allows to setup multiple paths to targets, which is
required for iscsi multipath.
2018-07-04 13:05:56 +02:00
Nicolas Porcel
c1688560ad Add timeout option to crypt module 2018-07-04 09:16:50 +02:00
Jeremy Linton
4cdee66c8e dracut-install: Support modules.softdep
Dracut uses the module deps to determine module dependencies
but that only works for modules with hard symbolic dependencies.
Some modules have dependencies created via callback API's or other
methods which aren't reflected in the modules.dep but rather in
modules.softdep through the use of "pre:" and "post:" commands
created in the kernel with MODULE_SOFTDEP().

Since in dracut we are only concerned about early boot, this patch
only looks at the pre: section of modules which are already being
inserted in the initrd under the assumption that the pre: section
lists dependencies required for the functionality of the module being
installed in the initrd.

Signed-off-by: Jeremy Linton <lintonrjeremy@gmail.com>
2018-07-03 13:36:26 +02:00
Sullivan (CTR), Austin
e0ec6f10d4 Fixed issue #420 2018-07-02 12:42:32 +02:00
Javier Martinez Canillas
f4947f8793 51-dracut-rescue.install: Don't install BLS fragment in /boot/efi on EFI
For EFI systems, the BLS fragments were stored in the EFI System Partition
(ESP) while in non-EFI systems it was stored in /boot.

For consistency, it's better to always store the BLS fragments in the same
path regardless of the firmware interface used.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2018-07-02 12:28:04 +02:00
Adam Williamson
ba26c59523 Include virtio DRM drivers in hostonly initramfs
The code in 50drm which tries to include all DRM drivers for
hardware attached to the system did not look for virtio devices.
So if the system is a VM using the 'virtio' graphics adapter,
the 'virtio-gpu' module which should be included is not. This
extends the code to also look for virtio devices.

https://bugzilla.redhat.com/show_bug.cgi?id=1593028

Signed-off-by: Adam Williamson <awilliam@redhat.com>
2018-07-02 11:56:15 +02:00
Ondrej Mosnacek
cec0d04112 fips: only install FIPS-compliant crypto modules
Since the kernel doesn't allow using any non-FIPS-compliant crypto
algorithms, it doesn't make sense to install them. Even if they are
installed, tcrypt will not test them anyway.

Tested on Fedora 28 x86_64 by booting with fips=1 (with hand-patched
module-setup.sh).
2018-07-02 11:42:04 +02:00
Ondrej Mosnacek
f4d34357c0 fips: cleanup FIPS crypto module list
This patch cleans up the default list of kernel modules in the 01fips
dracut module. All the algorithms that are tested in tcrypt are listed
by their algorithm name so that all the generic implementations and
drivers are picked up automatically based on the module alias.

This drops several unneeded modules and even a bogus one (rot13 -- this
one was obviously copy-pasted from tcrypt.c where it was listed as an
easter egg :).

The patch adds also some algorithms that weren't included in the
original set. It turns out in FIPS mode we only need those algorithms
that are marked as FIPS-allowed in testmgr.c (failure to find a non-FIPS
algorithm is ignored). The non-FIPS algorithms are further removed in a
subsequent patch.
2018-07-02 11:42:04 +02:00
Ondrej Mosnacek
eed91294f8 fips: add crypto_user module for new hmaccalc
In Fedora 28+, hmaccalc (sha512hmac) is provided by libkcapi-hmaccalc,
which needs the crypto_user module for its functionality.
2018-07-02 11:42:04 +02:00
Hui Wang
a73ba9a8ef dracut: scan and install external kernel modules
since kmod-25 keyword "external" was implemented in order to avoid
additional actions(like weak-modules) when kernel was updated, which
makes it more simple while kernels' kabi were compatible.

but if move some special modules such as megaraid_sas, mpt3sas and
so on, to a external path like /opt/modules, these modules will not
be install to initramfs by default, which make the initramfs can't
be used to boot for disk detection failure.

according to kmod's document, you must specify a absolute path with
"external" keyword, so scan the lines in modules.dep that begin with
"/" and install them, to make sure necessary modules in external path
can be installed to initramfs too.

Signed-off-by: Hui Wang <john.wanghui@huawei.com>
2018-07-02 11:40:42 +02:00
Javier Martinez Canillas
4f55387829 51-dracut-rescue.install: fix exit status code
After the $COMMAND case statement, the exit status of the last executed
command is added to the $ret variable.

But for the "add" pattern, this last executed command is an arithmetic
expression that also adds the exit status $? to the $ret variable. If
both $? and $ret are 0, then the arithmetic expression evaluates to 0
so is considered false and has an exit status of 1.

This makes the script to wrongly exit with an status code of 1 when it
should had been 0.

  case "$COMMAND" in
      add)
      ...
          ((ret+=$?))
	  # $ret is 0 here
          ;;
  ...
  esac

  ((ret+=$?))
  # $ ret is 1 here

  exit $ret

Since $ret is set in the case statement, just exit with that status code
and remove the last arithmetic expression that wrongly sets $ret to 1.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2018-07-02 11:33:41 +02:00
Ondrej Mosnacek
bca1967c90 fips: Drop obsolete dependencies
Explicitly require libkcapi-hmaccalc and stop installing NSS/prelink
dependencies that are no longer needed.
2018-06-14 13:07:07 +02:00
Daniel Molkentin
d00cfc2a7b Remove obsolete prelinking functionality 2018-06-14 12:58:59 +02:00
Ondrej Mosnacek
e0758c8168 fips: Drop the 02fips-aesni module
The main 01fips module should always load all optimized/driver modules
of all relevant crypto algorithms (based on their aliases), so we can
drop this useless module.
2018-06-14 12:56:51 +02:00
B. Wilson
1b72c97cc5 crypt: Implement cmdline rd.luks.partuuid
Commit bf5c53a implements support for mounting LUKS devices with
detached headers; however, it assumes that the LUKS device sits on an
unpartitioned disk.

Mirroring the `rd.luks.serial` option, this commit implements the
`rd.luks.partuuid` cmdline option, supporting headless LUKS devices on
drive partitions.
2018-06-13 10:59:28 +02:00
Renaud Métrich
c1c78f8a91 Harden dracut against BASH_ENV environment variable
When dracut silently produces a broken initramfs, then the system will
likely not boot and this can be very problematic. Typical use case is
after the kernel has been updated.

It appears that dracut is not protected against the BASH_ENV variable,
causing various scripts called by dracut to possibly fail or provide
wrong output (e.g. "ldd" is one of these).
Having a broken output for "ldd" makes the generated initramfs be not
usable, typically because vital binaries will be missing (e.g.
"awk", "udevadm", ...).

Note: because the shebang line cannot contain more than one argument,
the '--norc' option had to be removed. IMHO, it was useless anyway.

Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
2018-06-08 10:48:45 +02:00
Ondrej Mosnacek
935dd5746a fips: add sha3_generic and sm3_generic modules
SHA-3 and SM3 have been added to the tcrypt module recently, so without
them the 'modprobe tcrypt' step causes a kernel panic.
2018-06-07 17:18:29 +02:00
Pingfan Liu
67354eebbc 40network: introduce ip=either6 option
In kdump, if dump-target is ssh on ipv6, we need to sync until ipv6 addr
is ready. Currently ip=auto6/dhcp6 provides such function. But in 1st kernel,
it is hard to know whether the ipv6 addr is got by dhcpv6 or SLAAC.
E.g ifcfg-eth* contains DHCPV6C=yes direction, but there is no dhcpv6
server in the network, and then after the system is up, the user
echo 1 > /proc/sys/net/ipv6/conf/eth0/autoconf && accept_ra by manual
to obtain a ipv6 addr. Or vice.
So this patch suggests to make dhcpv6 as auto6 fallback

Signed-off-by: Pingfan Liu <piliu@redhat.com>
2018-05-29 10:07:19 +02:00
Harald Hoyer
f6e777ec4b cleanup empty ldconfig_paths directories
https://bugzilla.redhat.com/show_bug.cgi?id=1324746
2018-05-22 09:51:12 +02:00
Harald Hoyer
df6bb5e959 shutdown: sleep a little, if a process was killed
If a process (maybe plymouth) was still pinning /oldroot, then shutdown
would
- kill -9 $pid
- umount_a
- umount_a
in a very short timeframe. A small sleep hopefully lets the scheduler free
up /oldroot in the mean time.
2018-05-15 13:37:53 +02:00
Harald Hoyer
08e11e30e3 dracut.spec: do not recommend grubby 2018-05-07 15:27:22 +02:00
Harald Hoyer
731b37e929 dracut-install.c: untabify 2018-05-07 15:23:04 +02:00
Harald Hoyer
8ad3215590 don't error out, if no modules were installed
dracut-install … -m -s drm_crtc_init =drivers/staging
should not return an error, if no module was found in =drivers/staging

https://bugzilla.redhat.com/show_bug.cgi?id=1575527
2018-05-07 15:21:35 +02:00
Harald Hoyer
b2a024991f 80lvmmerge/README.md: remove executable bits 2018-05-07 10:40:32 +02:00
Harald Hoyer
bfa4e45fa7 s/find_btrfs_devs/btrfs_devs 2018-05-07 10:26:45 +02:00
Daniel Molkentin
c9b5165daa 10i18n: Fix possible infinite recursion 2018-05-03 15:15:16 +02:00
Colin Walters
740e41b843 Suppress sync/fsfreeze if not running on a live system
It's possible for e.g. `kernel` to be installed as an RPM BuildRequires or equivalent,
and there's no reason to sync, and *definitely* no reason to fsfreeze.

Another case where this happens is rpm-ostree, which performs its own sync/fsfreeze
globally.  See e.g. 8642ef5ab3
2018-05-02 17:44:45 +02:00
Michael McCracken
3161dea8e1 Update dracut.modules.7.asc
Update manpage to reflect code behavior for `inst` with >2 args.

Signed-off-by: Michael McCracken <michael.mccracken@gmail.com>
2018-04-30 21:48:34 +02:00
Yu Watanabe
cae0004dbe spec: add stratis module
Follow-up for c4f8329cc2.
2018-04-30 21:48:11 +02:00
Hendrik Brueckner
3c8a69677b crypt: correct s390 arch to include arch-specific crypto modules
Convert the s390x into s390 to also include s390-specific crypto
modules, for example, aes_s390 into the initramfs.

Signed-off-by: Hendrik Brueckner <brueckner@linux.ibm.com>
2018-04-26 13:34:53 +02:00
Tony Asleson
c4f8329cc2 Initial Stratis support
Ref. https://github.com/stratis-storage

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2018-04-26 13:28:36 +02:00
tpgxyz
654484b82b fix zstd magic header 2018-04-19 06:31:23 +02:00
Marcos Mello
ccaf52901f fs-lib: install crc32 in no-hostonly
It is needed by f2fs.
2018-04-17 12:02:00 +02:00
Marcos Mello
384eeedd2d fs-lib: install crc32c for ext4
EXT4 filesystems created with metadata_csum (enabled by default in mke2fs 1.44+) or ea_inode need crc32c.

https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/commit/?id=d0b9e0a6aa7d6805338a43b4e372623352d8df09
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/tree/fs/ext4/super.c?h=v4.15.15#n3491
2018-04-09 08:19:51 +02:00
Marcos Mello
65cfabf7a6 fs-lib: remove redundancy 2018-04-09 08:19:51 +02:00
Enno Boland
2b5192c18d make failing installation of drm modules nonfatal 2018-04-01 16:02:24 +02:00
Alexander Tsoy
fe6c7e0f06 plymouth: fix detection of plymouth directory
Some distros have both /usr/lib/plymouth and /usr/libexec/plymouth
directorirs, so we should check the existance of plymouth-populate-initrd
script.

Fixes: 421b46f8ae
2018-03-23 11:31:43 +01:00
Lukas Nykryn
3c3b2cf093 spec: add missing obsoletes and provides for removed fips subpackages 2018-03-22 16:34:16 +01:00
Lukas Nykryn
1f50d5b86d spec: merge fips subpackages to main package 2018-03-22 10:17:52 +01:00
Lukas Nykryn
0bb9a683d4 spec: drop support for legacy distributions
rhel <= 7 has its own branch and there is no point in supporting the old
fedora
2018-03-22 10:17:52 +01:00
Daniel Molkentin
d23f32dd4b 90kernel-modules: Include Intel Volume Management Device support
Reference: bsc#1079924
2018-03-16 15:37:25 +01:00
Harald Hoyer
ebfd53e1d9 lsinitrd.sh: fixed zstd file signature 2018-03-15 09:56:56 +01:00
Javier Martinez Canillas
f8c24964cd 51-dracut-rescue.install: fix initramfs not generated in /boot case
Commit 5e574046e76e ("5?-dracut*.install: Allow scripts to install
the initramfs in /boot dir") added support to generate initramfs
images in the /boot directory and copy the respective BLS files.

Unfortunately, it broke the rescue initramfs generation when it's
not installed on /boot due not checking for the correct condition.

It checks for the 0-rescue sub-dir to exist, but this is created so
instead if the parent sub-dir exists has to be checked. Also, check
if the destination directory is /boot or not, instead if it exists.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2018-03-12 09:05:40 +01:00
Harald Hoyer
f8e0c7cc62 kernel-modules: add mmc/core for arm 2018-03-05 09:56:25 +01:00
Lukas Nykryn
3aa37cafde all: fix issues found by shellcheck
Error: SHELLCHECK_WARNING:
/usr/lib/dracut/dracut-init.sh:939:20: error: Argument to implicit -n is always true due to literal strings. [SC2157]
  937|   dracut_kernel_post() {
  938|       for _f in modules.builtin.bin modules.builtin modules.order; do
  939|->         [[ $srcmods/$_f ]] && inst_simple "$srcmods/$_f" "/lib/modules/$kernel/$_f"
  940|       done
  941|

Error: SHELLCHECK_WARNING:
/usr/lib/dracut/modules.d/98syslog/parse-syslog-opts.sh:18:12: error: This expression is constant. Did you forget a $ somewhere? [SC2078]
   16|       elif [ -e /sbin/syslogd ]; then
   17|           syslogtype="syslogd"
   18|->     elif [ /sbin/syslog-ng ]; then
   19|           syslogtype="syslog-ng"
   20|       else

Error: SHELLCHECK_WARNING:
/usr/lib/dracut/modules.d/90crypt/crypt-lib.sh:15:29: error: Since you double quoted this, it will not word split, and the loop will only run once. [SC2066]
   13|               strstr "$d" "${luks##luks-}" && return 0
   14|               if [ -n "$dev" ]; then
   15|->                 for _dev in "$(devnames $d)"; do
   16|                       [ "$dev" -ef "$_dev" ] && return 0
   17|                   done
2018-03-02 13:41:43 +01:00
Javier Martinez Canillas
b39b8452d2 5?-dracut*.install: Allow scripts to install the initramfs in /boot dir
The GRUB 2 bootloaders expect the initrd to be installed in /boot instead
of /boot/$MACHINE_ID/$KERNEL_VERSION/{linux,initrd}, so if that directory
doesn't exists, install the initramfs images on the /boot directory.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2018-03-01 14:50:30 +01:00
Daniel Molkentin
48723f28aa 90kernel-modules: Ensure PCI host modules are included
The includes modules like the Intel Volume Management Device driver,
which is required to boot from disk on some systems.

Reference: boo#1079924
2018-03-01 12:51:49 +01:00
Harald Hoyer
3ed33db54a Update %description a bit 2018-02-26 11:22:55 +01:00
Harald Hoyer
0a68b6a518 dracut.spec: remove BuildRoot 2018-02-19 10:17:36 +01:00
Harald Hoyer
7b3f374a82 dracut.spec: remove clean section 2018-02-19 10:16:30 +01:00
Harald Hoyer
8ae8652edd version 047 2018-02-19 10:00:33 +01:00
Harald Hoyer
5283544cc7 dracut.spec: add BuildRequires gcc 2018-02-19 09:10:12 +01:00
Harald Hoyer
e64dafd1f2 dracut-function.sh:check_block_and_slaves() check for block devices
Some nvme have char parents, so check if the "slave" is a block dev.

Fixes https://github.com/dracutdevs/dracut/issues/373
2018-02-19 09:05:01 +01:00
Harald Hoyer
1779aee72c dm:dm-shutdown.sh: silence all disassembly until the last try 2018-02-19 09:05:01 +01:00
Ignaz Forster
94f61235d7 Avoid executing emergency hooks twice 2018-02-08 16:30:05 +01:00
Alexander Tsoy
643be55570 crypt: actually put block_uuid.map into initramfs
Also change path to /etc/block_uuid.map.

Fixes: c3b6970394
2018-02-02 11:40:29 +01:00
Pawel Wieczorkiewicz
f0094476fd 40network: Fix race condition when wait for networks
If no network related params are specific, but rd.neednet=1 is set,
the default initqueue action is to wait until one of the network
interfaces is marked as setup properly.

This also help with initqueue's race condition when the network interface
shows up late

References: bnc#866771

Signed-off-by: Hannes Reinecke <hare@suse.de>
2018-01-30 10:18:37 +01:00
Daniel Molkentin
ed2cc8c9b9 90plymouth: logo file is optional and may not exist 2018-01-30 10:14:22 +01:00
Daniel Molkentin
421b46f8ae 50plymouth: improve distro compatibility
The existence of dpkg-achitecture is not indicative of a debian
installation. It may well be installed on systems of people who
package for both distros. The previous code path did not take
that into account.

We now traverse all known plymouth directories, locking on the first
valid one, and try to work with it.

At the same time, we do not include the module if the plymouth directory
could not be found.
2018-01-30 10:14:22 +01:00
Matthew Thode
c88c3215e8 support kernels with built-in modules
Don't fail if modprobe fails to load a module, the kernel could have it
statically compiled in.

Signed-off-by: Matthew Thode <mthode@mthode.org>
2018-01-30 09:19:16 +01:00
Matthias Gerstner
f48fb6f4ce 98integrity: support X.509-only EVM configuration
Previously if no symmetric key was configured for EVM, then the
initialization process was aborted. It can be a valid use case, however,
to only use EVM digital signatures. In this case only X.509 certificates
need to be loaded.

With this change EVM initialization will continue if any of the
symmetric or X.509 keys could be loaded.
2018-01-25 12:15:36 +01:00
Matthias Gerstner
cb02ff635c 98integrity: support loading x509 into the trusted/builtin .evm keyring
This implements logic analogous to the one already implemented in
ima-keys-load.sh, only for the .evm/_evm keyrings.

If the kernel was built with CONFIG_IMA_TRUSTED_KEYRING then the kernel
initially creates and configures .ima and .evm keyrings. These keyrings
only accept x509 certificates that have been signed by a local CA which
belongs to the kernel builtin trusted keyring.

Thus if such a keyring is already present then additional evm keys
should be loaded into them. If this is not the case then the _evm
keyring needs to be created in userspace and keys will be loaded into
it instead.

Before this change dracut always created the _evm keyring and loaded
keys into it without considering an existing .evm keyring. In case of
CONFIG_IMA_TRUSTED_KEYRING being enabled, the _evm keyring will not be
used by the kernel, however, and EVM digital signatures will not work as
expected.
2018-01-25 12:15:36 +01:00
Matthias Gerstner
a1c1be4f3e 98integrity: fix inconsistent whitespace 2018-01-25 12:15:36 +01:00
Harald Hoyer
6c7776e344 dracut-install: strdup() kmod_module_get_name() string
otherwise it can't be used later on after freeing the context.

Should resolve https://bugzilla.redhat.com/show_bug.cgi?id=1536609
2018-01-23 14:09:31 +01:00
Harald Hoyer
d7e3bf7abd Merge pull request #365 from Conan-Kudo/early-microcode-by-default
Enable 'early_microcode' by default
2018-01-18 15:20:51 +01:00
Thomas Backlund
b25ef46f93 Enable 'early_microcode' by default
We initially enabled it for Haswell TSX bug (mga#16657)

Now there is also Meltdown and Spectre security issues,
and more microcode issues will most likely show up...

So the sane default for 'early_microcode' to have it enabled,
as theese changes must be done early in boot process to take
effect as intended.

Update documentation accordingly.

Reference: https://bugs.mageia.org/show_bug.cgi?id=16657

Signed-off-by: Thomas Backlund <tmb@mageia.org>
Signed-off-by: Neal Gompa <ngompa13@gmail.com>
2018-01-18 05:30:28 -05:00
Harald Hoyer
cbb9a4e955 Merge pull request #362 from danimo/persistance_policy
Give --persistent_policy precedence over /dev/mapper names
2018-01-18 10:35:02 +01:00
Harald Hoyer
dfbd8f74fd Merge pull request #317 from dracut-mailing-devs/20171212142718.11451-1-carlo@caione.org
drm: Look for DRM drivers in the staging directory
2018-01-18 10:24:41 +01:00
Harald Hoyer
8379784a0e lsinitrd.sh: quote filename in extract_files() 2018-01-18 10:17:42 +01:00
Harald Hoyer
a54206722d dracut.cmdline.7.asc: document rd.ccw and rd.znet
rd.znet should be used instead of rd.ccw.

Add more info about rd.znet.

Fixes github issue 364
2018-01-18 08:57:00 +01:00
Harald Hoyer
83b19de168 Merge pull request #363 from danimo/dracut_dmraid_use_udev
0202-dracut_dmraid_use_udev
2018-01-17 18:32:52 +01:00
Hannes Reinecke
9d651355a1 Use udev rules to create dmraid /dev/mapper/ devices
https://bugzilla.opensuse.org/show_bug.cgi?id=905746
2018-01-17 17:51:42 +01:00
Martin Wilck
b6054b5de6 Give --persistent_policy precedence over /dev/mapper names
There is currently no way to override dracut's preference for
/dev/mapper device names. But using these is problematic in
different scenarios: For example, if a user has a multipath-
enabled system but wants to disable multipath, or if the
names of multipath maps change because of configuration changes
(e.g. toggling user_friendly_names in /etc/multipath.conf).

This patch makes dracut prefer the user-specified
--persistent_policy names over /dev/mapper names.

It might be worthwhile to discuss why dracut prefers /dev/mapper
of /dev/disk/by-uuid at all. This preference was introduced
in 9037b63e with the argument "dm devices maintain /dev/mapper/* as
persistent names", but that's wrong for the scenarios mentioned
above, and is not a compelling reason for preferring /dev/mapper
over /dev/disk/by-uuid.

References: bsc#908143

Signed-off-by: Martin Wilck <mwilck@suse.de>
2018-01-17 12:05:44 +01:00
Harald Hoyer
308c4066fe Merge pull request #359 from yuwata/kmod-version
configure, kmod: bump kmod version to >= 23
2018-01-17 09:51:54 +01:00
Harald Hoyer
bff3ee1936 Merge pull request #361 from danimo/dm_multipath
90multipath: load dm_multipath module during startup
2018-01-17 09:50:54 +01:00
Hannes Reinecke
d842d5cf9e 90multipath: load dm_multipath module during startup
As the 'multipath' program will be triggered directly from
udev events it will be called before the multipath service
unit has started up. Which means we cannot rely on the
service unit to load the module for us, but we rather
have to do it early before udev is started.

References: bsc#986734

Signed-off-by: Hannes Reinecke <hare@suse.com>
2018-01-16 16:30:53 +01:00
Yu Watanabe
7bb8083562 configure, kmod: bump kmod version to >= 23
Follow-up for 2a0da60ed1.
2018-01-16 23:10:21 +09:00
Harald Hoyer
2a0da60ed1 configure: bump kmod version to >= 23
for issue #357
2018-01-16 14:17:16 +01:00
Harald Hoyer
bce6823a19 lsinitrd: no more cat: write error: Broken pipe
silence the cat
2018-01-16 13:57:34 +01:00
Harald Hoyer
33b560fcc2 Merge pull request #356 from yuwata/spec-s390-2
spec: remove 81cio_ignore module from non-s390 arch
2018-01-16 10:15:38 +01:00
Yu Watanabe
885b4a17d4 update AUTHORS 2018-01-16 01:05:14 +09:00
Yu Watanabe
a07b1bb6bb spec: remove 81cio_ignore module from non-s390 arch
Follow-up for b925f7f5d9.
2018-01-16 01:03:31 +09:00
Harald Hoyer
9ed6eb741f dracut-functions.sh:check_vol_slaves() speedup LV -> VG name
Instead of trying all /dev/mapper/* devices to match the maj:min, and
get the VG name with "lvm lvs", use the dm/name from /sys and dmsetup
splitname.

This should speedup execution with lots of LVs.
2018-01-15 15:47:17 +01:00
Harald Hoyer
b925f7f5d9 Merge pull request #347 from danimo/81cio_ignore
81cio_ignore: handle cio_ignore commandline
2018-01-15 09:04:12 +01:00
Hannes Reinecke
637fb76291 0056-81cio_ignore-handle-cio_ignore-commandline
81cio_ignore: handle cio_ignore commandline

References: bnc#874902

Incorporates following on-top patches/fixes:
----------------------------
Subject: 81cio_ignore: skip module if cio_ignore is not active

When cio_ignore is not active we should skip the entire module
during boot; otherwise it'll lead to adverse effects.

References: bnc#882685
----------------------------
Subject: 81cio_ignore: rewrite module

Rewrite cio_ignore module to rely on the dracut commandline
parameter 'rd.cio_accept', which takes a comma-separated list
of CCW IDs. Each of those IDs are being removed from the
list of devices from cio_ignore.

The default values for rd.cio_accept are taken from
/boot/zipl/active_devices.txt.

References: bnc#882685
-----------------------------
Subject: More empty cmdline fixes

This fixes up some more modules which might print out empty
commandline files.
-----------------------------
Subject: Mark scripts as executable

All scripts need to be marked as executable, otherwise dracut
won't be running them.

References: bnc#887010

Signed-off-by: Thomas Renninger <trenn@suse.de>
2018-01-12 15:35:24 +01:00
Harald Hoyer
8b4b7dc5b2 iscsi: remove last iscsid code snippet 2018-01-12 13:45:20 +01:00
Harald Hoyer
cc3808184c README.md: add test 31 2018-01-12 13:34:57 +01:00
Harald Hoyer
d888e21b5d test/ci-matrix.txt: add file specifying which tests to run 2018-01-12 13:04:34 +01:00
Harald Hoyer
5cc17c25c2 TEST-14-IMSM: fail early, if setup failed 2018-01-12 11:34:45 +01:00
Harald Hoyer
2bb4881b82 dracut.spec: fixed typo
introduced with commit 52d19cb161
2018-01-12 11:33:53 +01:00
Harald Hoyer
28a68f1f3c iSCSI: no more iscsid
According to Cathy Zhou <Cathy.Zhou@Oracle.COM>:

"iscsistart is not designed to be working together with iscsid. When an
interface gets the dhcp offer successfully, the iscsiroot script is run
which starts the iscsistart service to establish the iSCSI session. With
the existence of iscsid, the iscsistart service's attempt to setup its
own mgmt ipc fails. Instead, the request to login to the iscsi target
is handled by the mgmt ipc of iscsid. After iscsistart finishes its
login attempt, it eventually sends a stop_event_loop request to stop
the mgmt process. As the result, it terminates iscsid."

So, iscsid is kicked out again.

Additionally iscsistart-flocked is used to make sure iscsistart is not
run in parallel.
2018-01-12 10:38:20 +01:00
Harald Hoyer
b7a7ab1943 Merge pull request #354 from yuwata/spec-s390x
spec: do not package s390 specific modules
2018-01-12 10:36:56 +01:00
Yu Watanabe
52d19cb161 spec: sort modules 2018-01-12 18:24:52 +09:00
Yu Watanabe
4c3688d355 spec: do not package s390 specific modules 2018-01-12 18:24:31 +09:00
Harald Hoyer
8e7d0856d0 Merge pull request #351 from danimo/91zipl
Add 91zipl, which adds support for indirect booting on s390.
2018-01-12 09:34:08 +01:00
Harald Hoyer
6ccb77e19a dracut-systemd/dracut-pre-udev.service: also run for /etc/cmdline
Fixes #117
2018-01-12 09:32:45 +01:00
Harald Hoyer
47f83419a7 Merge pull request #353 from lnykryn/ntfs_3
90dmsquash-live: we don't have find_binary inside initramdisk
2018-01-11 15:33:45 +01:00
Lukas Nykryn
c42c387cca 90dmsquash-live: we don't have find_binary inside initramdisk 2018-01-11 13:31:43 +01:00
Harald Hoyer
b8b341a07f Merge pull request #352 from lnykryn/ntfs
90dmsquash-live-ntfs: fix depends()
2018-01-11 13:18:14 +01:00
Lukas Nykryn
f3e09bf1cb 90dmsquash-live-ntfs: fix depends()
Dependencies should not include module number.
2018-01-11 13:16:17 +01:00
Harald Hoyer
3a6a8d5c83 Merge pull request #346 from danimo/95dcssblk
95dcssblk: Add new module for DCSS block devices
2018-01-11 12:34:40 +01:00
Harald Hoyer
cd83391c72 Merge pull request #350 from yuwata/fsfreeze
dracut.sh: do not invoke fsfreeze on EFI System Partition
2018-01-11 12:30:01 +01:00
Harald Hoyer
0f6d93eb9d crypt: escape backslashes for systemd unit names b/c udev/initqueue/bash
otherwise
luks\x2d25e41d19\x2d1580\x2d4e7c\x2d8875\x2d134045008f33
turns to
luksx2d25e41d19x2d1580x2d4e7cx2d8875x2d134045008f33
2018-01-11 11:42:22 +01:00
Thomas Renninger
33260dac6e Add /boot/zipl to host devs if it is a mount point
bnc#892187

Signed-off-by: Thomas Renninger <trenn@suse.de>
2018-01-11 11:40:06 +01:00
Thomas Blume
8bae047a4e 91zipl: Update active_devices.txt from /boot/zipl device
References: bsc#939101

Signed-off-by: Thomas Blume <thomas.blume@suse.com>
2018-01-11 11:12:39 +01:00
Hannes Reinecke
d118e9d940 91zipl: Install script as executable
initqueue will only work with executable scripts, so we need to
mark it as such.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2018-01-11 11:12:39 +01:00
Hannes Reinecke
403f2c3e1d 91zipl: Translate 'ext2/3' into ext4
91zipl tries to read the filesystem for the /boot/zipl device.
On SLE12, however, the ext2 and ext3 filesystems are handled
by the ext4 module.
And due to bug#886839 no error is registered and booting fails.
So implement a band-aid to translate it into ext4.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2018-01-11 11:12:39 +01:00
Hannes Reinecke
73f89bbadb 91zipl: Store commandline correctly
The 'rd.zipl' command was only printed and never stored in the
initramfs itself.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2018-01-11 11:12:39 +01:00
Hannes Reinecke
ea7ffef13e 91zipl: Add new module to update s390x configuration
Add new module to update the dracut commandline values
during booting with the values found in the file
dracut-cmdline.conf on the device specified by
rd.zipl.

Signed-off-by: Hannes Reinecke <hare@suse.de>

Contrary to the original patch, this one has been modified
to check for /boot/zipl, the location of the first stage kernel
in indirect boot, in order not to install on systems
booting directly via zipl.

Signed-off-by: Daniel Molkentin <daniel.molkentin@suse.com>
2018-01-11 11:12:39 +01:00
Yu Watanabe
7bc681fd88 dracut.sh: do not invoke fsfreeze on EFI System Partition
When the system boots with EFI, then initrd image is stored
on EFI System Partition. Thus dracut always warn about the
failure to invoke fsfreeze on the partition.
This prevents to run fsfreeze on ESP and suppress the warning.
2018-01-11 13:55:14 +09:00
Thomas Renninger
d43cccf588 95dcssblk: Add new module for DCSS block devices
Add s390 dcssblk driver and introduce rd.dcssblk= to pass mounts
that should get activated at initrd stage.

References: FATE#308263

Signed-off-by: Hannes Reinecke <hare@suse.de>
2018-01-10 13:18:24 +01:00
Harald Hoyer
5a8efed021 TEST-3[01]-ISCSI*: increase disk size 2018-01-10 09:13:31 +01:00
Harald Hoyer
17414dd01b Merge pull request #344 from yuwata/spec-cleanup
spec: use if-undefined instead of empty if-defined block
2018-01-09 13:24:46 +01:00
Yu Watanabe
965cacd43a spec: use if-undefined instead of empty if-defined block
Follow-up for 68cbbae33a.
2018-01-09 17:47:03 +09:00
Harald Hoyer
ba2cfcab1e Merge pull request #338 from danimo/fshelp
dracut-emergency: optionally print fs help
2018-01-08 15:05:28 +01:00
Mark Fasheh
1f8a7ae799 dracut-emergency: optionally print fs help
Allow filesystem modules to install a fs-specific text file with
instructions on what to do when mount fails. This is printed when we go into
an emergency shell.

Signed-off-by: Mark Fasheh <mfasheh@suse.de>
2018-01-08 14:14:05 +01:00
Harald Hoyer
577f109243 Merge pull request #339 from danimo/fix_include_parsing
Fix parsing of "-i" and "--include"
2018-01-08 13:31:55 +01:00
Fabian Vogt
dcacd2b072 Fix parsing of "-i" and "--include"
- dracut replaced every instance of "-i" in the cmdline,
  even if it was part of a kernel image name, e.g. "vmlinuz-i"
- Fixes boo#908452

Signed-off-by: Fabian Vogt <fvogt@suse.com>

Adjusted to not support "dracut -ifoo bar", as this breaks expected
upstream behavior.
2018-01-08 10:43:46 +01:00
Harald Hoyer
d300160e70 Revert "mdraid: call mdadm with "--wait-clean" instead of "-W""
This reverts commit bc4ce61efc.

Read wrong man page section. Got confused by
https://github.com/dracutdevs/dracut/issues/342
2018-01-05 11:02:12 +01:00
Harald Hoyer
c9d207467c dracut.spec: add lunmask dracut module 2018-01-05 10:42:22 +01:00
Harald Hoyer
68cbbae33a dracut.spec: remove systemd-bootchart 2018-01-05 10:39:44 +01:00
Harald Hoyer
03214e51ae Merge pull request #343 from lnykryn/boot_image_once_more
01fips: Properly creating path to .hmac of kernel based on BOOT_IMAGE
2018-01-02 15:01:15 +01:00
Harald Hoyer
bc4ce61efc mdraid: call mdadm with "--wait-clean" instead of "-W"
seems like -W changed meanings over the years :-/
2018-01-02 14:58:14 +01:00
Lukas Nykryn
d818986db4 01fips: Properly fix creating path to .hmac of kernel based on BOOT_IMAGE
8f5c5 broke the case where BOOT_IMAGE is not set at all.
This code should handle following:
1) BOOT_IMAGE not set
2) BOOT_IMAGE set to something unrelated (s390)
3) BOOT_IMAGE=vmlinuz-4.14.7-300.fc27.x86_64
4) BOOT_IMAGE=/vmlinuz-4.14.7-300.fc27.x86_64
5) BOOT_IMAGE=/boot/vmlinuz-4.14.7-300.fc27.x86_64
6) BOOT_IMAGE=subdir/vmlinuz-4.14.7-300.fc27.x86_64
7) BOOT_IMAGE=/subdir/vmlinuz-4.14.7-300.fc27.x86_64
8) BOOT_IMAGE=/boot/subdir/vmlinuz-4.14.7-300.fc27.x86_64

https://bugzilla.redhat.com/show_bug.cgi?id=1415032
2017-12-28 09:59:48 +01:00
Harald Hoyer
8134db6c33 Merge pull request #321 from danimo/multipath-fixes
SUSE fixes for 90multipath
2017-12-19 15:43:58 +01:00
Harald Hoyer
8c3e65d1ce Merge pull request #318 from danimo/fcoe-fixes
All FCOE-related SUSE patches, rebased on top of master
2017-12-19 15:43:13 +01:00
Harald Hoyer
51d2436c22 Merge pull request #340 from danimo/mkinitrd_suse_A
mkinitrd-suse.sh: Implement functionality of -A option
2017-12-19 15:41:33 +01:00
Harald Hoyer
29a9e92999 Merge pull request #331 from fcami/master-fsfreeze
call fsfreeze(8) on /boot to flush initramfs data & metadata to media
2017-12-19 15:35:18 +01:00
François Cami
de576db3c2 call fsfreeze(8) on /boot to flush initramfs data & metadata to media 2017-12-19 14:47:11 +01:00
Harald Hoyer
a187bc3ca5 Merge pull request #337 from danimo/lunmask
95lunmask: Add module to handle LUN masking
2017-12-19 14:39:07 +01:00
Harald Hoyer
598660bbe6 Merge pull request #336 from danimo/add_drivers
Fix possible hang in dracut
2017-12-19 14:36:45 +01:00
Fabian Vogt
39ee4fdfbd mkinitrd-suse.sh: Implement functionality of -A option
- Without this patch, -A sets host_only=0,
    but host_only wasn't used
- Translates into --no-host-only now
2017-12-19 13:23:08 +01:00
Hannes Reinecke
10f06425a5 95lunmask: Add module to handle LUN masking
Using the module option 'scsi_mod.scan=manual'
this implements LUN masking by selectively enable only those
devices required for booting.

References: bsc#954600,FATE#319786

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-12-19 00:34:45 +01:00
Fabian Vogt
d53bb5c017 Fix possible hang in dracut
- Caused by add_drivers+=" " in dracut.conf (bsc#923116)

Signed-off-by: Fabian Vogt <fvogt@suse.com>
2017-12-19 00:04:35 +01:00
Hannes Reinecke
164760f4b0 95fcoe: use interface names instead of MAC addresses
Now that we are using persistent network names we can switch
to using the interface names when specifying the fcoe configuration.
With that we can print the fcoe configuration only once.

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-18 21:48:07 +01:00
Hannes Reinecke
fd13d5d4d5 95fcoe: add timeout initqueue entries
Occasionally the FCoE connection might be reset after fipvlan was
called, causing the FCoE connection to be dropped and boot to fail.
For these cases we should be adding a timeout entry for the
initqueue to have a failsave mechanism to re-run fipvlan in
these cases.

References: bsc#1052840

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-18 21:48:07 +01:00
Hannes Reinecke
36a8b2e305 95fcoe: Switch back to using fipvlan for bnx2fc
bnx2fc doesn't _actually_ need fcoemon, so fipvlan is sufficient
to start the FCoE connection.
And, in fact, fcoemon is started for every interface, causing
subsequent invocations to fail with

fcoemon[1157]: error 98 address already in use

and fcoemon tearing down the connection.

References: bsc#1052840

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-18 21:48:07 +01:00
Hannes Reinecke
4e3eb1e9d1 95fcoe: fixup fcoe-genrules.sh for VN2VN mode
The 'mode' argument was never referenced in the printf format, causing
invalid rules to be written.

References: bsc#1036323

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-18 21:48:07 +01:00
Hannes Reinecke
a3f91db476 95fcoe: Add shutdown script
We should be disabling the FCoE connection (which triggers sending
a LOGO internally) to logout from the target; this resets the target
and will avoid hitting a busy condition during reboots.

References: bsc#994860

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-18 21:48:07 +01:00
Hannes Reinecke
2aac319410 95fcoe: always set AUTO_VLAN for fcoemon
fcoemon is well capable of figuring out whether a vlan should
be used, so there's no need to disable the AUTO_VLAN feature.

References: bsc#995019

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-18 21:48:05 +01:00
Harald Hoyer
43634c2469 Merge pull request #335 from lnykryn/BOOT_IMAGE-to-HMAC
01fips: Fix creating path to .hmac of kernel based on BOOT_IMAGE
2017-12-18 15:26:31 +01:00
Lukas Nykryn
8f5c564cb3 01fips: Fix creating path to .hmac of kernel based on BOOT_IMAGE
Old code did not work for two most common use-cases.
On most machines BOOT_IMAGE is set to something like
/vmlinuz-4.11.3-202.fc25.x86_64. So if we just add prefix "/boot/."
it won't work. Also on machines without /boot on separate partition
BOOT_IMAGE already has the /boot/ prefix (/boot/vmlinuz-3.10.0-799.el7.x86_64).
So let's strip it in such case.

https://bugzilla.redhat.com/show_bug.cgi?id=1415032
2017-12-18 14:48:59 +01:00
Harald Hoyer
07e413bd0f Merge pull request #334 from FloGa/master
Use pattern matching function
2017-12-18 11:29:17 +01:00
Florian Gamböck
63755f4db8 Use pattern matching function
The needle argument in this specific case is a pattern, which cannot be
matched by the "literal" string matcher strstr.

This can result in fsck calls like:

    e2fsck -a -y /dev/sda1

Which will then exit with an error like:

    e2fsck: Only one of the options -p/-a, -n or -y may be specified.

Hence, it is necessary to use the strglobin function to correctly match
the pattern.
2017-12-18 11:04:05 +01:00
Harald Hoyer
2d3273f96f Merge pull request #325 from danimo/dasd_cio_free
95dasd_mod: do not set module parameters if dasd_cio_free is not present
2017-12-18 10:01:33 +01:00
Harald Hoyer
a45651c193 Merge pull request #328 from danimo/nfs_bonddevices
Do not pass ifname for bonding devices (bsc#995812)
2017-12-18 09:44:24 +01:00
Harald Hoyer
12930f30a1 Merge pull request #324 from danimo/mdraid-no-delete-part
90dmraid: do not delete partitions
2017-12-18 09:43:57 +01:00
Harald Hoyer
1619e731f7 Merge pull request #330 from danimo/task_max_emergency
Set TaskMax=inifinite for the emergency shell
2017-12-18 09:14:21 +01:00
Harald Hoyer
84912dde41 Merge pull request #327 from danimo/nfs_host_robustness
Rebustness fixes for NFS hostnames
2017-12-18 09:13:29 +01:00
Harald Hoyer
dfbbb0baf5 Merge pull request #326 from danimo/no_efi_fcoe_default
fcoe-uefi: Add check for usage
2017-12-18 09:11:54 +01:00
Harald Hoyer
c0f2b6bebc Merge pull request #323 from danimo/dm-fixes
Two SUSE fixes for 90dm
2017-12-18 09:06:54 +01:00
Harald Hoyer
8f4f40cb3c Merge pull request #322 from danimo/font_maps
10i18n: Add correct fontmaps
2017-12-18 09:05:49 +01:00
Harald Hoyer
fa54381b4e Merge pull request #320 from danimo/ifname-bond
Do not pass ifname for bonding devices (bsc#995812)
2017-12-18 09:02:39 +01:00
Harald Hoyer
ffbe0373e2 Merge pull request #319 from danimo/modules-load.d-hostonly
Fix loading of modules in modules-load.d
2017-12-18 09:01:21 +01:00
Daniel Molkentin
649619f6a5 Set TaskMax=inifinite for the emergency shell
Certain rescue/recovery operations, e.g. xfs_repair need
that liberty (bsc#1019938).
2017-12-15 22:00:41 +01:00
Daniel Molkentin
72f5a098e9 Do not pass ifname for bonding devices (bsc#995812)
Patch-By: Thomas Renninger <trenn@suse.de>
2017-12-15 21:55:41 +01:00
Fabian Vogt
8602e59867 NFS: Support host being a DNS ALIAS
The "host" command may also print something else than
"asdf.local.lan has address 1.2.3.4", like:
"rootserver.local.net is an alias for rainbow.local.net.".
So "head -n1" is not enough.

Fixes boo#955592
2017-12-15 21:52:59 +01:00
Thomas Renninger
f5c10673de 95nfs: Fix mount if IPv4 address is used in /etc/fstab
Signed-off-by: Thomas Renninger <trenn@suse.com>
2017-12-15 21:52:28 +01:00
Fabian Vogt
22836a0921 fcoe-uefi: Add check for usage
References: boo#965477

fcoe-uefi gets included by default on EFI systems,
as it does not do the same check that fcoe does,
therefore needlessly pulling in network modules.
This patch copies the check from fcoe to fcoe-uefi.
2017-12-15 21:19:30 +01:00
Hannes Reinecke
6f1b5c0dab 95dasd_mod: do not set module parameters if dasd_cio_free is not present
We're now parsing the 'rd.dasd' parameter from 95dasd_rules, so
setting the 'dasd_mod' module parameter should be dropped here.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-12-15 21:14:51 +01:00
Hannes Reinecke
871378aad4 90dmraid: do not delete partitions
There is no point trying to delete partitions; dmraid works
happily even with them. On the contrary trying to delete partitions
can even be harmful when eg dmraid should _not_ be started.

References: bsc#998860

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-15 20:58:41 +01:00
Hannes Reinecke
870591acec 90dm: fixup dependency cycle between MD and DM shutdown
DM devices might be located on top of MD devices, so we need to
call the DM shutdown script before MD shutdown. The exception
here are multipath devices, which are below MD devices.
So skip removing multipath devices here to avoid spurious errors.

References: bsc#994860

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-15 20:55:37 +01:00
Hannes Reinecke
07e6357483 90dm: Fixup shutdown script
When calling the shutdown script we need to take care of traversing
the device-mapper tables, otherwise we might end up trying to remove
a device-mapper device which still has another one stacked on top
and the removal will fail.

References: bsc#994860

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-15 20:55:23 +01:00
Fabian Vogt
251afd36b2 10i18n: Add correct fontmaps
References: bsc#943312, bsc#932981

Signed-off-by: Fabian Vogt <fvogt@suse.com>
2017-12-15 20:50:10 +01:00
Martin Wilck
8008d47faf 90multipath: start before local-fs-pre.target
local-fs-pre.target serves as a separator between the code for
detecting block devices and systemd's fsck/mount logic. This
patch ensures that multipathd is started before local-fs-pre.target
in the initrd. By adding a "Wants=" line for local-fs-pre.target,
it makes sure that this target is started at all.

References: bsc#1006118
Signed-off-by: Martin Wilck <mwilck@suse.de>

===================================================================
2017-12-15 20:42:53 +01:00
Hannes Reinecke
af99264a36 90multipath: parse kernel commandline option 'multipath=off'
SLES11 provided a kernel commandline option 'multipath=off',
so dracut should be parsing the option, too.

References: bsc#1001691

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-15 20:42:24 +01:00
Hannes Reinecke
239e8ba2ac 90multipath: add shutdown script
As the device-mapper module is removing all device-mapper tables
during shutdown we need to make sure to disable queuing on the
multipath devices; otherwise there might still be I/O pending
and the removal will fail.

References: bsc#994860

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-15 20:42:15 +01:00
Hannes Reinecke
8d20322f11 90multipath: Start daemon after udev settle
We need to wait until udev has processed all events, otherwise we'll
risk of misdetecting devices. This might cause a temporary interruption
during which multipath removes a device-mapper device, which then
causes a booting failure.

References: bsc#986734

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-15 20:41:59 +01:00
Hannes Reinecke
d12ce1da85 90multipath: do not fail startup on missing configuration
References: bsc#930019

If rootfs is on multipath, but platform does not have an /etc/multipath.conf
file which is not urgently needed, they system will not boot, due to:

multipathd is not started and rootfs and swap are not found:
systemctl status multipathd.service
* multipathd.service - Device-Mapper Multipath Device Controller
   Loaded: loaded (/usr/lib/systemd/system/multipathd.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
Condition: start condition failed at Thu 2015-05-07 11:49:11 CEST; 7min ago
           ConditionPathExists=/etc/multipath.conf was not met

and exit to dracut shell.
2017-12-15 20:41:36 +01:00
Daniel Molkentin
51f4ab300d Do not pass ifname for bonding devices (bsc#995812)
Patch-By: Thomas Renninger <trenn@suse.de>
2017-12-15 20:35:29 +01:00
Fabian Vogt
9fd3e045d5 Fix loading of modules in modules-load.d
With hostonly enabled, only modules that are currently
loaded are included in the initrd. Modules which are
explicitly listed in modules-load.d do not need to
be filtered that way. Fix for boo#962224.
2017-12-15 20:19:52 +01:00
Hannes Reinecke
c75196e11e 95fcoe: Allow to specify the FCoE mode via the fcoe= parameter
FCoE can run in Fabric (ie FCF) or VN2VN mode, so we should allowing
to set this parameter from the commandline, too.

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-15 18:51:49 +01:00
Daniel Molkentin
d71c9ee286 95fcoe: silence lldpad warnings
When lldpad is not running, any calls to 'dcbtool' will be printing
out a warning. As it perfectly legit to have FCoE running without
DCB we should not be printing out the error.

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-15 18:51:49 +01:00
Hannes Reinecke
d066fcc3fb 95fcoe: Do not overwrite FCoE configuration
If the installation already has a FCoE configuration we should
not attempt to overwrite it but rather use the pre-defined
configuration.

References: bsc#993861

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-12-15 18:51:49 +01:00
Johannes Thumshirn
6b96b50d2c 95fcoe: Reorder initialisation for bnx2x
Check first if we're running off an bnx2x device and start FCoE on it
via fipvlan, then go the normal/Intel way of starting DCB.

Also the SUSE version of fcoemon needs the yes parameter for the
--syslog option

References: bsc#982588

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.com>
2017-12-15 18:51:42 +01:00
Harald Hoyer
611b8ae0d7 Merge pull request #316 from danimo/btrfs-crc32-accel
Include crc32c-intel module when using btrfs
2017-12-14 15:38:12 +01:00
Harald Hoyer
fb9970ba2d Merge pull request #315 from danimo/emergency-task-limit
Fix task limit in emergency.service (the same change as in dracut-emergency.service) (bsc#1019938)
2017-12-14 15:37:40 +01:00
Harald Hoyer
6b7dca1631 Merge pull request #314 from danimo/simplify-amd-ucode
Simplify microcode lookup for for AMD CPUs
2017-12-14 15:36:54 +01:00
Daniel Molkentin
9f2916cce1 Include crc32c-intel module when using btrfs
Reference: bsc#1011554
2017-12-14 13:41:37 +01:00
Lidong Zhong
df96cccc8f Fix task limit in emergency.service (the same change as in dracut-emergency.service) (bsc#1019938) 2017-12-14 13:37:44 +01:00
Daniel Molkentin
19453dc874 Simplify microcode lookup for for AMD CPUs
Suggested by Tom Lendacky <thomas.lendacky@amd.com>
2017-12-14 12:25:50 +01:00
Harald Hoyer
3dbf1f0783 Merge pull request #313 from danimo/amd-family0x17
Support Microcode Updates for AMD CPU Family 0x17
2017-12-13 08:51:12 +01:00
Daniel Molkentin
215fe58324 Support Microcode Updates for AMD CPU Family 0x17
Original-Patch-By: Tom Lendacky <thomas.lendacky@amd.com>
2017-12-13 01:42:52 +01:00
Carlo Caione
94d09135a7 drm: Look for DRM drivers in the staging directory
The recently upstreamed virtualbox video driver (vboxvideo) is shipped
in the staging directory. We need to probe it before Xorg is loaded to
avoid a corrupted X.

In general it is a good practice to look also in the staging directory
for DRM drivers.

Signed-off-by: Carlo Caione <carlo@endlessm.com>
2017-12-12 16:04:24 +01:00
Harald Hoyer
cd0305cee0 Merge pull request #312 from jnbr/network
40network: install grep
2017-12-12 10:22:41 +01:00
johannes
69acd20d4e 40network: install grep
since version 046 40network/net-lib.sh uses grep but the module does not install grep
2017-12-11 17:52:03 +01:00
Harald Hoyer
825730780a Merge pull request #310 from danimo/remove-systemd-bootchart
Remove 00systemd-bootchart
2017-12-06 14:58:36 +01:00
Harald Hoyer
2bdce3d461 Merge pull request #311 from dracut-mailing-devs/1512379451-17727-1-git-send-email-piliu@redhat.com
dracut.sh: for_each_host_xx() function should indicate the empty case
2017-12-06 14:49:42 +01:00
Daniel Molkentin
b36d322bd2 Remove 00systemd-bootchart
This was removed from systemd almost two years ago in
c550f7a9b89d017215af084288bc44f736f774fe, so dracut should drop support
as well.

Reference: bsc#1067279
2017-12-04 16:01:46 +01:00
Pingfan Liu
e6199960d9 dracut.sh: for_each_host_xx() function should indicate the empty case
The caller of "for_each_host_xx func" needs to tell three cases:
func success/ fail / not be called.
E.g, in kdump case, host_devs can be empty, and we want to know it.

Signed-off-by: Pingfan Liu <piliu@redhat.com>
2017-12-04 11:04:53 +01:00
Robert Scheck
84fe3c1a20 Add fuse/ntfs-3g run-time dependencies for -live subpackage 2017-12-01 14:18:55 +01:00
Harald Hoyer
96d69bbf34 Merge pull request #309 from danimo/multipath_bin_error
Fix warning about multipath if not needed
2017-12-01 09:13:53 +01:00
Fabian Vogt
ee6b44342b Fix warning about multipath if not needed
Although no device uses multipath, the module checks
for presence of the multipath binary first, printing a
warning if not present. This patch fixes the wrong ordering.
2017-11-30 16:51:15 +01:00
Harald Hoyer
a13e97e511 dracut-install: remove double "//" in path names
makes relative symlinks shorter
2017-11-30 15:07:48 +01:00
Harald Hoyer
1ec2e34adc Merge pull request #300 from danimo/pick_all_matching_keymaps
10i18n: Load all keymaps for a given locale
2017-11-06 09:56:13 +01:00
Harald Hoyer
11b3d60f5c Merge pull request #303 from FGrose/bootmsg
dmsquash-live-root: Replace incompatible shell syntax.
2017-11-06 09:55:54 +01:00
Frederick Grose
b1e1b6cba3 dmsquash-live-root: Replace incompatible shell syntax.
Fix issue #279  supercede PR #299
Fix bug https://issues.openmandriva.org/show_bug.cgi?id=2219
Replace Bashisms in the boot message for a missing overlay.
Verify presence of plymouth before calling it.
(Rework of commit f1b65e92af5e3f9df79f99e55d5aa936c9bca940.)
2017-11-05 02:19:10 -05:00
Harald Hoyer
18a5011ff2 Revert "lsinitrd.sh: dismiss "cat" error messages"
This reverts commit e190224345.
2017-11-03 09:16:45 +01:00
Harald Hoyer
f9042fd839 Merge pull request #302 from keszybz/yet-another-timeout-fix
dmsquash-generator.sh: properly escape backslash in path
2017-11-03 09:15:02 +01:00
Zbigniew Jędrzejewski-Szmek
38ff9dfbe5 dmsquash-generator.sh: properly escape backslash in path
We need an actual bashslash in the filename on disk.

https://bugzilla.redhat.com/show_bug.cgi?id=1508794
2017-11-02 17:07:09 +01:00
Daniel Molkentin
28aea41829 10i18n: Load all keymaps for a given locale
Previously, dracut would only copy the first one found. However,
with legacy maps for some locales around, there is a chance we
pick the wrong one. Pick all matching keymaps instead

Reference: boo#1065058
2017-11-01 11:33:24 +01:00
Harald Hoyer
d976e19325 Merge pull request #298 from derekhiggins/master
Skip iscsi attachment if no info
2017-10-27 09:10:22 +02:00
Derek Higgins
9408a2ac33 Skip iscsi attachment if no info
If no iscsi session information can be retrieved from the firmware
then skip the iscsi attachment and allow the boot process to continue.
Ensure the timeout scripts don't hit their timeout waiting for
/tmp/iscsistarted-firmware to be created.
This will allow a common image to be used for servers with both a
local and iscsi root with rd.iscsi.firmware set.
2017-10-26 16:27:45 +01:00
Harald Hoyer
ed9281d6d1 dracut.sh: after doing the lazy resolve always install dependencies
Exit the lazy resolving mode after doing the lazy resolve, because there
won't be any lazy resolving anymore after this step.

Fixes https://github.com/dracutdevs/dracut/issues/152
Obsoletes https://github.com/dracutdevs/dracut/pull/225
2017-10-26 09:31:27 +02:00
Harald Hoyer
e190224345 lsinitrd.sh: dismiss "cat" error messages
nobody wants to see "cat: broken pipe"
2017-10-26 09:08:28 +02:00
Harald Hoyer
21789cbb0a make qemu and qemu-net a default module in non-hostonly mode 2017-10-25 13:00:39 +02:00
Harald Hoyer
1751bacda1 Merge pull request #296 from dracut-mailing-devs/20170303132146.4968-1-crrodriguez@opensuse.org
systemd 233 requires sha256, hmac and algif_hash modules
2017-10-23 10:23:42 +02:00
Harald Hoyer
4b758ebe22 Merge pull request #294 from nullr0ute/arm-fixes
Add rpmsg, hwspinlock and usb/misc for ARM
2017-10-12 13:32:00 +02:00
Peter Robinson
82651e9ef3 Add rpmsg, hwspinlock and usb/misc for ARM
Some of the more complex devices now need rpmsg and hwspinlock in the early boot
process to start, and these to the initrd, and pull in usb/misc because
apparently non standard usb hubs are a thing.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2017-10-12 12:17:41 +01:00
Harald Hoyer
6bc8fbda61 Merge pull request #223 from bmr-cymru/bmr-ignore-activation-skip
lvm_scan.sh: use -K when calling lvchange
2017-10-12 11:23:38 +02:00
Harald Hoyer
faabcb2360 dracut.sh: quote sync file argument 2017-10-11 15:28:20 +02:00
Harald Hoyer
1df4538662 Merge pull request #293 from dracut-mailing-devs/1502088233-10139-1-git-send-email-ankit@linux.vnet.ibm.com
Sync initramfs after creation
2017-10-11 15:10:26 +02:00
Harald Hoyer
2c9bcac113 dracut-install: char* -> const char* 2017-10-10 13:39:17 +02:00
Harald Hoyer
04fa949877 Merge pull request #284 from sm00th/kmoddir
dracut-install: fix relative paths in --kerneldir
2017-10-10 13:29:41 +02:00
Harald Hoyer
791d801689 dracut.sh: if /boot/vmlinuz-$version exists use /boot/ as output dir
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1475565
2017-10-10 10:30:44 +02:00
Harald Hoyer
8c2aa6161a git2spec.pl: handle empty merge commits 2017-10-09 17:40:04 +02:00
Martin Wilck
4c2d98c75b emergency.service: use Type=idle
Type=oneshot, as currently set in dracut's emergency service file,
causes an awkward situation if emergency mode is entered e.g. because
of a root device timeout, and the root device appears later because it
just has taken longer than the timeout. In that situation, my
expectation (backed by past positive experience) is that the user should
be able to simply exit the emergency shell and resume normal boot.

:/# systemctl status sysroot.mount
● sysroot.mount - /sysroot
   Loaded: loaded (/proc/cmdline; bad; vendor preset: enabled)
   Active: active (mounted) since Mon 2017-10-09 14:32:15 CEST; 16s ago
    Where: /sysroot
     What: /dev/mapper/3600601600a30200024fbbaf3f500e411-part5
     Docs: man:fstab(5)
           man:systemd-fstab-generator(8)
  Process: 1873 ExecMount=/usr/bin/mount /dev/disk/by-uuid/63751805-6abc-46a3-a66f-427920dece4d /sysroot -o ro (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 512)

:/# systemctl list-jobs
JOB UNIT              TYPE  STATE
 56 emergency.target  start waiting
 57 emergency.service start running

2 jobs listed.
:/# exit
logout
Failed to start default.target: Transaction is destructive.

(system keeps idling from this point on, user has no chance to
do anything).

This results from the combination of two effects:
1) initrd-root-fs.target sets "OnFailureJobMode=replace-irreversibly",
2) emergency.service's Type=oneshot causes the start jobs for both
emergency.service and emergency.target to persist while the user is in
the emergency shell.

When the shell is exited, systemd tries to isolate "initrd.target"
again, but this fails with "the transaction is destructive" error
because of the still pending jobs.

This patch fixes this by changing the Type of "emergency.service" from
"oneshot" to "idle".
2017-10-09 14:51:45 +02:00
Harald Hoyer
b69ce65bf4 Merge pull request #286 from rldleblanc/bonding_mtu_fix
Fix MTU on bond interface.
2017-10-09 12:59:59 +02:00
Harald Hoyer
4e3833f6a2 Merge pull request #285 from rldleblanc/fix-typos
Fix a couple of typos.
2017-10-09 12:59:29 +02:00
Harald Hoyer
0d947530b2 TEST-70: sort interfaces for validation 2017-10-09 12:53:40 +02:00
Harald Hoyer
bf5c53a33f Merge pull request #290 from privb0x23/luks-detached
Add basic LUKS detached header support
2017-10-09 12:51:29 +02:00
Harald Hoyer
bada26263c Merge pull request #287 from xlpang/master
fcoe: handle CNAs with DCB firmware support
2017-10-09 11:47:08 +02:00
Harald Hoyer
7c9e64272e Merge pull request #280 from tpgxyz/zstd
add support for Zstandard
2017-10-09 11:39:10 +02:00
Harald Hoyer
32618b456e Merge pull request #277 from imran1008/bond-master-mtu
Set MTU on bond master as opposed to a bond slave
2017-10-09 09:38:37 +02:00
Michal Sekletar
28401778c4 systemd: fix setting of timeouts for device units
JobRunningTimeoutSec now affects how long can start jobs for device
units stay in the "running" state. Disabling default job timeout via
JobTimeoutSec=0 doesn't disable running state timeout. We need to set
running state timeout as well.

Note that doing this the other way around has effect on generic timeout,
i.e. disabling running state timeout disables generic timeout. But doing
it this way we would create implicit dependency on fairly new
systemd-234. However, by setting both options we don't create dependency
on specific systemd version.
2017-10-06 10:05:25 +02:00
privb0x23
b7058d0ce5 Add basic LUKS detached header support
A LUKS root volume with a detached header on a device without partitioning will not have a UUID and will not have an attribute ENV{ID_FS_TYPE}=="crypto_LUKS".
Therefore, several areas need to be addressed: identification of the LUKS device, inclusion of entries within crypttab, and provision of the detached header file.
- Added support for an option (4th column: "force") in /etc/crypttab to force the inclusion of the entry in the initramfs version (avoiding the fs type test).
- Added support for an option (4th column: "header=/path/to/file") in /etc/crypttab to provide a path to a detached header file embedded within the initramfs.
- Added ID and PARTUUID support to the device (2nd column) in /etc/crypttab (complementing the existing UUID functionality).
- Added cmdline support to indicate LUKS device ("rd.luks.serial=") that refers to the attribute ENV{ID_SERIAL_SHORT}.
Tested successfully on Void Linux (x86_64 musl) (no systemd) with a LUKS root volume accessed with a keyfile and using a detached header.
Not tested on systemd, or on a LUKS root volume with a passphrase rather than a keyfile.
2017-10-03 23:37:55 +01:00
Xunlei Pang
795256bbb1 fcoe: handle CNAs with DCB firmware support
Some Combined Network Adapters(CNAs) implement DCB protocol
in firmware, it is recommended that do not run software-based
DCB or LLDP on CNAs that implement DCB, but we have to start
the lldpad service anyway(there might be other software DCB).

If the network interface provides hardware DCB/DCBX capabilities,
the field DCB_REQUIRED in "/etc/fcoe/cfg-xxx" is expected to
be set to "no".

We met an issue on "QLogic BCM57810" with DCB firmware support,
and found dracut still generated "fcoe=<mac>:dcb" which caused
kdump boot failure when using that fcoe dump target.

This patch parses /etc/fcoe/cfg-xxx to detect DCB_REQUIRED="no",
and force "nodcb" if it is the case.

Also improved some coding style in passing.

Signed-off-by: Xunlei Pang <xlpang@redhat.com>
2017-09-27 10:36:44 +08:00
Robert LeBlanc
d0eabcab43 Fix MTU on bond interface.
The MTU is only being set on the slave devices and the MTU of the
bonding master is not being updated. This updates the bonding master and
also changes the MTU on the slaves as expected.

Signed-Off-By: Robert LeBlanc <robert@leblancnet.us>
2017-09-21 14:33:59 -06:00
Robert LeBlanc
4d60324757 Fix a couple of typos.
Signed-Off-By: Robert LeBlanc <robert@leblancnet.us>
2017-09-21 13:39:52 -06:00
Artem Savkov
ef84ce2521 dracut-install: fix relative paths in --kerneldir
kerneldirlen is used to modify absolute path returned by
kmod_module_get_path() while it is calculated on user-supplied
--kerneldir argument which can be a relative path.

Use kmod_get_dirname() to convert user-supplied path to the same format
as used by kmod_module_get_path().

This also allows to get rid of now useless strcmp checks that seem to
imply that /lib and /usr/lib are linked which is not always true.
2017-09-21 11:27:23 +02:00
tpgxyz
da97807ccc fix typo 2017-09-05 01:26:31 +02:00
tpgxyz
7dbadcc749 add support for Zstandard 2017-09-05 01:23:38 +02:00
Imran Haider
79926486a0 Set MTU on bond master as opposed to a bond slave
Prior to this commit, the MTU setting was applied to a bond slave
interface.  In older versions of the Linux kernel, this setting
propagated to the bond master and the other bond slaves associated with
the master.  In recent versions of the kernel (observed in Linux 4.12),
increasing the MTU of a slave does not automatically increase the MTU of
the master.  This allows for more flexibility but requires the MTU of
the master to be changed manually.

Ideally, the MTU setting should be applied to the bond master and the
setting will propagate to the bond slaves, since the slaves are required
to have a MTU that is greater than or equal to the bond master.
2017-09-03 00:15:37 -04:00
Harald Hoyer
424c065cd9 Merge pull request #276 from danimo/copy_multipath_confd
95multipath: Pickup files in /etc/multipath/conf.d
2017-08-30 11:51:12 +02:00
Harald Hoyer
1499719d25 Merge pull request #274 from danimo/system_allow_coredump
Enable core dumps with systemd from initrd
2017-08-30 11:39:06 +02:00
Daniel Molkentin
d000b9a2c7 95multipath: Pickup files in /etc/multipath/conf.d
Reference: boo#1048551
2017-08-30 09:05:19 +02:00
Daniel Molkentin
afe4e2844f Enable core dumps with systemd from initrd
systemd sets /proc/sys/kernel/core_pattern to use systemd-coredump.
However, systemd-coredump is missing from initrd, making dumping
the core in initrd impossible by default.

Reference: bsc#1054809
2017-08-29 08:53:35 +02:00
Harald Hoyer
15d00459c3 Merge pull request #272 from yzygitzh/no-lsinitrd-if-quiet
dracut.sh: disable lsinitrd logging when quiet
2017-08-23 09:31:53 +02:00
Ziyue Yang
bd93e9287d dracut.sh: disable lsinitrd logging when quiet
Currently in Fedora/RedHat dracut installs its fedora.conf.example
as the default config file, in which sysloglvl is set 5. This leads
to maxloglvl=5 in dracut calls, making unnecessary lsinitrd calls
during initramfs builds by kdump.

This patch disables lsinitrd logging when --quiet option is given,
which is controlled by maxloglvl only before. This will speed up
dracut image building as the following if --quiet is used in kdump:

1) Before this patch
$ kdumpctl stop; touch /etc/kdump.conf; time kdumpctl start
kexec: unloaded kdump kernel
Stopping kdump: [OK]
Detected change(s) in the following file(s):
  /etc/kdump.conf
Rebuilding /boot/initramfs-4.13.0-0.rc1.git4.1.fc27.x86_64kdump.img
kexec: loaded kdump kernel
Starting kdump: [OK]
real    0m26.824s
user    0m9.958s
sys     0m15.106s

2) After this patch
$ kdumpctl stop; touch /etc/kdump.conf; time kdumpctl start
kexec: unloaded kdump kernel
Stopping kdump: [OK]
Detected change(s) in the following file(s):
  /etc/kdump.conf
Rebuilding /boot/initramfs-4.13.0-0.rc1.git4.1.fc27.x86_64kdump.img
kexec: loaded kdump kernel
Starting kdump: [OK]
real    0m20.420s
user    0m8.385s
sys     0m10.468s

Signed-off-by: Ziyue Yang <ziyang@redhat.com>
2017-08-23 11:23:34 +08:00
Harald Hoyer
721bec3f14 Merge pull request #269 from xlpang/master
introduce new "--no-hostonly-default-device"  argument
2017-08-18 09:33:10 +02:00
Xunlei Pang
5634a31156 rootfs-block/module-setup.sh: check root_devs in cmdline_rootfs()
In case of "--no-hostonly-default-device", we do not need
the root device, thus add this check.

Also fixed the stale "root_dev" export.

Signed-off-by: Xunlei Pang <xlpang@redhat.com>
2017-08-18 14:44:19 +08:00
Xunlei Pang
37f2fe55d1 dracut.sh: introduce "--no-hostonly-default-device" argument
Kdump doesn't need default host devices like root, swap, fstab, etc,
we only care about the dump target which can be added via "--mount"
or "--add-device". We met several issues that kdump kernel failed
due to one of those host devices added by dracut, additionally, the
needless devices(e.g. LVM) consume some appreciable amount of memory
which is more likely to cause OOM under memory-limited kdump.

So this patch introduced "--no-hostonly-default-device" to avoid
adding those default devices as host_devs.

Signed-off-by: Xunlei Pang <xlpang@redhat.com>
2017-08-18 09:58:08 +08:00
Harald Hoyer
e5d6018783 Merge pull request #268 from danimo/ssh_include_nss
ssh-client: Include nss_ libraries
2017-08-16 10:16:55 +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
Harald Hoyer
3bd3ef5819 kernel-modules: don't call instmods with empty arguments
otherwise it will try to read from stdin and stall
2017-08-14 14:58:47 +02:00
Harald Hoyer
00f3525a30 lvmmerge: depend on systemd
Fixes https://github.com/dracutdevs/dracut/issues/267
2017-08-14 09:47:22 +02:00
Harald Hoyer
0344c2be13 dracut.spec: add support for builds without dist-tag
In the module-build-service, we have pieces of dracut provided by different
modules ("base-runtime" provides most functionality, but we need
dracut-network in "installer". Since these two modules build with separate
dist-tags, we need to reduce this strict requirement to ignore the dist-tag.
2017-08-11 14:13:02 +02:00
Harald Hoyer
a0799ffb55 NEWS: update 2017-08-11 13:44:06 +02:00
Harald Hoyer
65f78f3d74 crypt: handle rd.luks.name
systemd supports renaming of dm devices with rd.luks.name.

Honor the kernel command line parameter.
2017-08-11 13:23:10 +02:00
Harald Hoyer
2b909b9a4b dracut-install: fixed hostonly modules hashmap_put 2017-08-10 09:20:35 +02:00
Harald Hoyer
ed25fb0e91 dracut-install: fixed typo 2017-08-10 09:20:35 +02:00
Harald Hoyer
c2408eed7f Merge pull request #266 from martinezjavier/master
network: Only bring up wired network interfaces
2017-08-10 08:49:14 +02:00
Javier Martinez Canillas
1792759721 network: Only bring up wired network interfaces
The dracut network module is only supposed to be used for wired interfaces
but if driver modules for wireless devices are wrongly copied, these will
be loaded and the available interfaces brought up.

If the rd.neednet=1 command line parameter is used, dhclient will attempt
to request an IP address for the interfaces and these requests will fail.

But other dracut modules that depend on the network to be settled, will
have to wait for the DHCP requests to timeout. Which can be a lot of time
since the dhclient default timeout value is 60 seconds.

Instead of trying to blacklist all possible kernel modules for wireless
devices, only bring up network interfaces if these are for wired devices.

Suggested-by: Harald Hoyer <harald@redhat.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2017-08-09 19:10:42 +02:00
Ankit Kumar
e316ae0e43 Sync initramfs after creation
If we trigger crash just after creating initramfs, sometimes it is
observed that initramfs is not written to disk causing the subsequent
boot to fail. A sync should resolve this.

Signed-off-by: Ankit Kumar <ankit@linux.vnet.ibm.com>
2017-08-09 12:04:16 +02:00
Harald Hoyer
5abd692fe4 network/ifup: don't arping for point-to-point connections
https://bugzilla.redhat.com/show_bug.cgi?id=1477339
2017-08-07 15:09:36 +02:00
Harald Hoyer
1279a9e1a0 fcoe: install hba.conf and libhbalinux only if hba.conf exists 2017-08-07 14:45:55 +02:00
Harald Hoyer
0baf5a3e99 Merge pull request #265 from nullr0ute/arm-fixes
A few ARM fixes for a number of newer devices which have some wider deps
2017-08-07 13:10:55 +02:00
Harald Hoyer
bdf0f9ce32 Merge pull request #257 from sbrudenell/loop-keys-in-initrd
Support crypto loop keys in initrd.
2017-08-07 11:41:11 +02:00
Harald Hoyer
ae989390a1 dracut.sh: --nofscks does not take parameters
fixes: https://github.com/dracutdevs/dracut/issues/264
2017-08-07 11:39:45 +02:00
Ankit Kumar
81269979e6 Sync initramfs after creation
If we trigger crash just after creating initramfs, sometimes it is
observed that initramfs is not written to disk causing the subsequent
boot to fail. A sync should resolve this.

Signed-off-by: Ankit Kumar <ankit@linux.vnet.ibm.com>
2017-08-07 09:03:46 +02:00
Peter Robinson
39018c93c2 arm: add soc/extcon/mfd as they're often needed for USB and core memory/soc drivers
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2017-08-04 19:51:25 +01:00
Peter Robinson
f496af50b7 add options to pickup dw_mmc submodules to blockfuncs
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2017-08-04 18:43:26 +01:00
Steven Brudenell
c427603cd1 Include both and in luks key name. 2017-08-03 21:47:06 -04:00
Steven Brudenell
e2b877a18b Change mntp->keydev in loopback key luks name. 2017-08-03 21:47:06 -04:00
Steven Brudenell
690b24f02f Support crypto loop keys in initrd. 2017-08-03 21:47:05 -04:00
Harald Hoyer
98663fcaac Merge pull request #261 from jonathan-teh/amd-family-16h
Add early microcode support for AMD family 16h
2017-08-02 11:31:19 +02:00
Harald Hoyer
8523ec50c2 Merge pull request #260 from haraldh/crypto-cleanup
crypt-loop: cleanup cleanup procedures
2017-08-02 11:28:47 +02:00
jonathan-teh
af6eee79e3 Add early microcode support for AMD family 16h 2017-07-29 00:19:19 +01:00
Harald Hoyer
9fd0461b7d nbd: use systemd-run to start nbd-client 2017-07-28 15:15:02 +02:00
Harald Hoyer
66a3d4053b testsuite: increase disk image size 2017-07-28 15:15:02 +02:00
Harald Hoyer
b1ae591945 dracut-systemd: add back missing dependencies
otherwise TEST-20-NFS fails
2017-07-28 11:57:07 +02:00
Harald Hoyer
017978f868 network: redirect stderr for arping test 2017-07-28 11:54:27 +02:00
Harald Hoyer
2187b3d097 crypt-loop: cleanup cleanup procedures
Using initqueue --finished to cleanup stuff is not what the
initqueue/finished hook was meant for.

Move stuff to the real cleanup hook.
2017-07-28 10:43:39 +02:00
Harald Hoyer
c75ce02775 TEST-02-systemd: add systemd-analyze verify 2017-07-28 10:19:26 +02:00
Harald Hoyer
f24d205537 dracut-systemd: fixed dependencies
try to break an ordering cycle.

https://github.com/dracutdevs/dracut/issues/259
2017-07-28 10:19:26 +02:00
Harald Hoyer
85ed04e0cf dracut-systemd/*.service: fix copyright message and comment 2017-07-28 10:17:06 +02:00
Harald Hoyer
c0371761fb add systemd-analyze to debug and TEST-02-SYSTEMD 2017-07-28 10:17:06 +02:00
Harald Hoyer
2ceb910a73 git2spec.pl: handle github merges
found a nice strategy to produce patchset from merges
2017-07-27 16:34:25 +02:00
Harald Hoyer
72c084918a Merge pull request #253 from yuwata/spec
spec: add missing modules
2017-07-26 09:28:49 +02:00
Yu Watanabe
ad3b209d40 spec: add missing modules 2017-07-25 10:31:55 +09:00
Harald Hoyer
1a95f1f4fc dracut.spec: add 80lvmmerge 2017-07-24 16:11:41 +02:00
Harald Hoyer
ef025dcbbe Update README.md 2017-07-24 15:59:12 +02:00
Harald Hoyer
d23b0efc1a 80lvmmerge: remove unused file 2017-07-24 15:54:16 +02:00
Harald Hoyer
1bfa75b015 80lvmmerge: README.md update 2017-07-24 15:53:50 +02:00
Harald Hoyer
dd75a946db Update README.md 2017-07-24 15:51:54 +02:00
Harald Hoyer
e95a3c36ed add lvmmerge dracut module 2017-07-24 15:48:54 +02:00
Harald Hoyer
400a85ffaf install arping V2 as arping2 2017-07-24 10:03:42 +02:00
Harald Hoyer
9388d99361 simplify TEST-30-ISCSI for CI 2017-07-21 16:01:04 +02:00
Harald Hoyer
5a532aa83f Update README.md 2017-07-21 15:47:37 +02:00
Harald Hoyer
9cd4edb445 TEST-12: increase retry and loglevel 2017-07-21 15:04:57 +02:00
Harald Hoyer
a1d92d8ace TEST-12: sleep to get log messages 2017-07-21 14:44:20 +02:00
Harald Hoyer
fac3e9d975 TEST-12: settle before doing sfdisk 2017-07-21 14:07:30 +02:00
Harald Hoyer
9b8e6e40a9 increased qemu memory 2017-07-21 11:43:08 +02:00
Harald Hoyer
a430c3f7a6 Merge pull request #252 from landgraf/dhcp_option_21
dhclient: send client-identifier matching hardware address
2017-07-19 14:32:41 +02:00
Harald Hoyer
e7b343138f Merge pull request #233 from yuwata/kernel-install
kernel-install: Skip to create initrd if /etc/machine-id is missing or empty
2017-07-19 09:53:40 +02:00
Pavel Zhukov
4011b48c42 dhclient: send client-identifier matching hardware address
Forcing dhclient to use hardware address instead of DUID to make it
predictable and allows system installation in whitelist based networks.
2017-07-17 17:58:28 +02:00
Harald Hoyer
295194ee42 Merge pull request #251 from danimo/fix_hostonly_cmdline
Do generate error when hostonly_cmdline is set to "no"
2017-07-17 17:08:29 +02:00
Daniel Molkentin
76dd870bfd Do generate error when hostonly_cmdline is set to "no"
Reference: bsc#1048748
2017-07-17 17:01:07 +02:00
Harald Hoyer
3e7498ea03 Merge pull request #250 from lnykryn/classless-static-routes
40network/dhclient.conf: rename classless-routes to classless-static-…
2017-07-14 08:36:16 +02:00
Lukas Nykryn
62b7920ed1 40network/dhclient.conf: rename classless-routes to classless-static-routes
We tell dhclient to name 121 option "classless-routes",
but in dhclient-script we parse classless_static_routes.
So either have to change the configuration or the script.

And since dhclient uses by default classless_static_routes,
let's change the configuration
2017-07-13 16:46:19 +02:00
Harald Hoyer
5ce7cc7337 add 90multipath-hostonly module
hardcoding the wwid of the drives in the initramfs causes problems
when the drives are cloned to a system with the same hardware, but
different disk wwid's

https://bugzilla.redhat.com/show_bug.cgi?id=1457311
2017-07-10 13:28:40 +02:00
Harald Hoyer
d84f4687c3 dracut-init.sh: check for file $DRACUT_KERNEL_MODALIASES
and not for the directory
2017-07-07 15:59:31 +02:00
Harald Hoyer
db17ef6c4f dracut-init.sh: add the kernel directory to the --modalias generation 2017-07-07 15:58:02 +02:00
Harald Hoyer
3ad12c7be8 Check all modalias files in /sys/devices for modules
and add the corresponding kernel modules to the host module list

https://bugzilla.redhat.com/show_bug.cgi?id=1467427
2017-07-07 15:55:55 +02:00
Harald Hoyer
26264af7f5 Merge pull request #191 from robert-scheck/master
Add NTFS support to 90dmsquash-live module
2017-07-06 09:26:51 +02:00
Robert Scheck
37437cac8a Add NTFS support to 90dmsquash-live module (#191)
Support booting from USB media with NTFS filesystem (optionally),
which removes the FAT32 related 4 GB file size limit for LiveOS/
squashfs.img (and any other file on the same USB media).
2017-06-30 00:15:57 +02:00
Harald Hoyer
106255afd4 bail out if module directory does not exist
this basically reverts commit 05214a0bed

if people want to build the initramfs without kernel modules,
then --no-kernel should be specified
2017-06-29 17:09:50 +02:00
Harald Hoyer
c1699b59c6 kernel-modules: add serial line drivers 2017-06-29 12:18:26 +02:00
Harald Hoyer
add1ea88d2 mark these as needing bash 2017-06-29 12:18:26 +02:00
Harald Hoyer
3d875f77f3 Try BOOT_IMAGE and fallback to vmlinuz-${KERNEL}
On s390 BOOT_IMAGE only denotes the number of the boot record that
was selected in the bootloader and not the path to the kernel image.

Also only bail out, if the kernel hmac checking relies on that path.
2017-06-29 10:40:29 +02:00
Harald Hoyer
44302d6f28 dracut.spec: use Recommends for rhel > 7 2017-06-29 10:40:29 +02:00
Harald Hoyer
38e9d6249a Merge pull request #246 from lnykryn/authenc
01fips: add authenec module
2017-06-28 18:09:54 +02:00
Lukas Nykryn
0a50111ab3 01fips: add authenec module
Resolves: #1465946
2017-06-28 17:46:04 +02:00
Harald Hoyer
937cc53ecb Merge pull request #241 from danimo/zfcp_rules_dasd_rules_updates
s390 changes that never went upstream
2017-06-28 11:57:33 +02:00
Harald Hoyer
343c74311b Merge pull request #244 from danimo/crypt_with_uuid
90crypt: Fixed crypttab_contains() to also work with device path in /etc/crypttab
2017-06-28 09:26:03 +02:00
Julian Wolf
c3b6970394 90crypt: Fixed crypttab_contains() to also work with device path in /etc/crypttab
blkid is not available when this function is called, so block_uuid.map is put into
the initrd, mapping block devices from /etc/crypttab to UUIDs.

This fixes a bug where udev rules were created by mistake as crypttab_contains()
returned false for devices specified by path in /etc/crypttab which resulted in
error messages during boot.

Signed-off-by: Julian Wolf <juwolf@suse.de>
2017-06-27 16:43:47 +02:00
Harald Hoyer
9bf5f989ee Merge pull request #242 from lnykryn/classless
network/dhclient-script: also parse dot separated $new_classless_static_routes
2017-06-27 13:27:41 +02:00
Harald Hoyer
940169e8d8 check for CONFIG_ACPI_TABLE_UPGRADE
additionally as for CONFIG_ACPI_INITRD_TABLE_OVERRIDE
config parameter got renamed
2017-06-27 12:29:07 +02:00
Lukas Nykryn
337a55eb2d network/dhclient-script: also parse dot separated $new_classless_static_routes
Previously our dhclient-script expected that $new_classless_static_routes
will have all values separated by a whitespace. But at least on F25
dhclient will put there the destination descriptor in the same format
as it is used by ISC dhcp-server.
For example:
new_classless_static_routes=32.10.198.122.47 192.168.78.4
while our current code expects
new_classless_static_routes=32 10 198 122 47 192 168 78 4

So let's just accept both of these formats by adding "." to IFS.

For details plesse see https://tools.ietf.org/html/rfc3442
"Classless Route Option Format"
2017-06-26 10:12:46 +02:00
Hannes Reinecke
c8aa1d949a 95zfcp_rules: simplified rd.zfcp commandline for NPIV
When NPIV is enabled and the allow_lun_scan parameter is set to 'Y'
the HBA will initiate a LUN scan automatically, so there is no need
to specify the WWPN and LUN number manually.

References: bsc#964456

Signed-off-by: Hannes Reinecke <hare@suse.com>
2017-06-23 21:27:48 +02:00
Hannes Reinecke
5f923256e3 95zfcp_rules: fix typo in module_setup
module_setup.sh has a typo preventing it from saving the correct
dracut commandline.

References: bnc#887582

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-06-23 21:27:44 +02:00
Hannes Reinecke
5e7bbe43a3 95zfcp_rules: Enable the device before checking device type
For creating dynamic udev rules parse-dasd.sh look for the device
type in sysfs, which of course does not exist if cio_ignore is
active. So first enable the device before checking.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-06-23 21:27:41 +02:00
Hannes Reinecke
3a8ba44026 95zfcp_rules: Store all devices in commandline
'for_each_host_dev_and_slaves' would stop at the first found
device, so the cmdline() call would never list all required
devices. Use 'for_each_host_dev_and_slaves_all' instead and
filter out duplicates.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-06-23 21:27:38 +02:00
Hannes Reinecke
e0c3b0793f Fix DASD with SSID greater than 0
bsc#989313

Signed-off-by: Thomas Renninger <trenn@suse.com>
2017-06-23 21:27:07 +02:00
Hannes Reinecke
8b0791fa01 Reset IFS variable
Setting and unsetting the IFS variable is tricky. To be on the
safe side we should always reset the IFS variable to its original
value after parsing.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-06-23 21:27:02 +02:00
Thomas Renninger
e5bf1cecd6 95dasd_rules: Install 'collect' udev helper binary
Install the 'collect' udev helper binary for s390-specific rules.

References: bsc#938867

Signed-off-by: Thomas Renninger <trenn@suse.com>
2017-06-23 21:26:57 +02:00
Hannes Reinecke
cf9c8c5fe3 95dasd_rules: Enable the device before checking device type
For creating dynamic udev rules parse-dasd.sh look for the device
type in sysfs, which of course does not exist if cio_ignore is
active. So first enable the device before checking.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-06-23 21:26:53 +02:00
Hannes Reinecke
05bf320972 95dasd_rules: Store all devices in commandline
'for_each_host_dev_and_slaves' would stop at the first found
device, so the cmdline() call would never list all required
devices. Use 'for_each_host_dev_and_slaves_all' instead and
filter out duplicates.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-06-23 21:26:49 +02:00
Hannes Reinecke
2600b54c18 Fixup typo 'firmare' instead of 'firmware'
Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-06-23 21:26:46 +02:00
Hannes Reinecke
bd355f8643 95dasd_rules: Auto-generate udev rule for ipl device
We should be generating a udev rule for the ipl device; it'll
be enabled anyway.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-06-23 21:26:42 +02:00
Hannes Reinecke
1362641310 95dasd_rules: print out 'rd.dasd' commandline
When a DASD is found to be required for the rootfs we should
be printing out a 'rd.dasd' commandline parameter. This not
only enables us to correctly enable the device with cio_ignore,
we can also inspect the resulting initrd to figure out which
devices are required to mount the rootfs.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-06-23 21:26:39 +02:00
Hannes Reinecke
e5d21b80c0 95dasd_rules: fixup rd.dasd parsing
There were some errors when rd.dasd parsing, resulting in the
device never to be activated. And we should check for
cio_ignore even if a udev rules has been found.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-06-23 21:26:36 +02:00
Hannes Reinecke
5d1ea2d726 Correctly set cio_ignore for dynamic s390 rules
When converting 'rd.zfcp' and 'rd.dasd' into udev rules we
need to make sure the enable those device ids via cio_ignore,
otherwise the rules might never be called.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-06-23 21:26:33 +02:00
Hannes Reinecke
856d039ba4 95dasd_rules: enable parsing of rd.dasd= commandline parameter
Dracut documents the 'rd.dasd=' parameter, so we should be
enabling the usage of this parameter, too.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-06-23 21:26:30 +02:00
Hannes Reinecke
55c763b1ff Add new s390x-specific rule files
With the new s390x configuration tool the naming of the udev
rules files have changed. So add these to the existing ones
to be compatible with existing and new installations.

References: bnc#856585

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-06-23 21:26:27 +02:00
Hannes Reinecke
c8e531239b 95zfcp_rules: Auto-generate udev rule for ipl device
We should auto-generate an udev rule for the ipl device; it'll be
enabled anyway.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-06-23 21:06:05 +02:00
Hannes Reinecke
624f173cbd 95zfcp_rules: print out rd.zfcp commandline parameter
When called with '--hostonly-cmdline' the module should print
out the configuration.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-06-23 21:06:02 +02:00
Hannes Reinecke
9be4be7aa7 95zfcp_rules: Fixup rd.zfcp parsing
There were some errors when parsing rd.zfcp, causing the device
never to be activated.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-06-23 21:05:59 +02:00
Hannes Reinecke
bbca3891ed Correctly set cio_ignore for dynamic s390 rules
When converting 'rd.zfcp' and 'rd.dasd' into udev rules we
need to make sure the enable those device ids via cio_ignore,
otherwise the rules might never be called.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2017-06-23 21:05:55 +02:00
Harald Hoyer
a0d129e33e Merge pull request #239 from lnykryn/cmdline
dracut-lib: put together CMDLINE even if /proc/cmdline does not exist
2017-06-21 16:34:09 +02:00
Lukas Nykryn
0c4c9792c8 dracut-lib: put together CMDLINE even if /proc/cmdline does not exist 2017-06-21 14:14:06 +02:00
Harald Hoyer
6ed9975c5a Merge pull request #238 from danimo/systemd_fix_force_drivers
98dracut-systemd: Fix module force loading with systemd
2017-06-19 13:43:42 +02:00
Harald Hoyer
73e30ea106 Merge pull request #180 from danimo/tests_find_kvm_on_suse
Tests: find qemu on (open)SUSE systems
2017-06-19 13:42:30 +02:00
Daniel Molkentin
e3189ab123 98dracut-systemd: Fix module force loading with systemd
This used to work only when specified via the command line
or if systemd was not being used. However, the exisistence of
20_force_driver.conf also requires dracut-pre-udev.service
to be run.

Reference: bsc#986216
2017-06-16 16:58:12 +02:00
Harald Hoyer
cf9a4e0c73 network: fix dhcp classless_static_routes
removed copy&paste artifact "modify_routes add"

there is no modify_routes() function, and we simply want the output
of the parse function.

(cherry picked from commit 33710dfbfc)
2017-06-14 15:22:18 +02:00
Harald Hoyer
08e51654bf Merge pull request #237 from lnykryn/fips-cmac
fips: add cmac kernel module
2017-06-14 14:40:08 +02:00
Lukas Nykryn
63c7b358f5 fips: add cmac kernel module
cmac is now marked as fips_allowed

Resolves: rhbz#1460865
2017-06-13 10:29:54 +02:00
Harald Hoyer
70ce5ea256 Merge pull request #235 from lnykryn/tmpfiles
systemd: include systemd-tmpfiles-setup.service
2017-06-09 14:08:48 +02:00
Lukas Nykryn
a0e3794b2a systemd: include systemd-tmpfiles-setup.service
... because otherwise nothing will actually
apply configuration from tmpfiles snippets
2017-06-08 15:06:34 +02:00
Prarit Bhargava
fd24c90c36 module-setup.sh: Add ARM specific driver to initramfs image
If a hisi_sas storage device is used as / during system install, the
resulting installation will not boot because the hisi_sas driver is not
included in the initramfs.

The Hisilicon storage driver needs to be added to the initramfs image for
aarch64 kernels.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Cc: dzickus@redhat.com
Cc: dmarlin@redhat.com
Cc: wefu@redhat.com
Cc: harald@redhat.com
2017-06-06 13:39:43 +02:00
Harald Hoyer
1856ae95c8 handle rpcbind /run/rpcbind directory 2017-06-06 13:38:29 +02:00
Yu Watanabe
b71d162a7a kernel-install: Skip to create initrd if /etc/machine-id is missing or empty
From systemd-234, kernel-install plugins are called even if /etc/machine-id
is missing or empty, and in that case BOOT_DIR_ABS is a fake directory.
So, let's skip to create initrd in that case.
2017-06-02 18:07:25 +09:00
Harald Hoyer
3cea065819 mdraid: wait for rd.md.uuid specified devices to be assembled
This patch uses wait_for_dev "/dev/disk/by-id/md-uuid-${uuid}" for the
specified uuids.

On timeout only md devices are force started which are specified by
uuid, or all, if rd.auto was specified.

Fixes https://github.com/dracutdevs/dracut/issues/227
2017-05-16 11:37:27 +02:00
Harald Hoyer
87ddd4d9af Merge pull request #213 from danimo/elfutils
Make binutils optional when elfutils are available
2017-05-15 14:53:35 +02:00
Harald Hoyer
1e00295a15 Merge pull request #229 from jwrdegoede/master
drm: Install pwm modules on all architectures
2017-05-15 11:37:45 +02:00
Harald Hoyer
b40585e6c7 Merge pull request #226 from AdamWill/curl-nssckbi
Handle curl using libnssckbi for TLS (RHBZ #1447777)
2017-05-15 11:28:10 +02:00
Hans de Goede
feaaee4278 drm: Install pwm modules on all architectures
At least on x86 on Bay and Cherry Trail devices the pmw-lpss modules must
be in the initrd too, otherwise the i915 driver will still load, but
it will report the following error:

[drm:pwm_setup_backlight [i915]] *ERROR* Failed to own the pwm chip

And not register /sys/class/backlight/intel_backlight and users will
not be able to control their backlight.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2017-05-14 23:24:46 +02:00
Adam Williamson
892b1fe6b7 Handle curl using libnssckbi for TLS (RHBZ #1447777)
curl in Fedora recently changed its default CA trust store. The
Fedora package no longer specifies an OpenSSL-format bundle file
during build, and curl itself has been patched to use an NSS
plugin called libnssckbi.so when no bundle file or directory is
specified. There are (at present) two possible providers of the
libnssckbi.so module: the original NSS implementation, which
uses a trust bundle built in at build time, and a compatible
implementation from the p11-kit project, which reads a trust
bundle at run time. So if we find a string in libcurl.so that
suggests libnssckbi might be in use, we must both install it and
make an effort to install any trust bundle files it may use.

The p11-kit libnssckbi implementation does include a string that
lists the top-level trust directories it will use, so we try to
find that string, though the best effort I can come up with will
also find many false positives too. To weed out the false
positives, we check whether the matches actually exist as dirs,
and if so, whether they contain some specific subdirectories we
know p11-kit trust dirs must have (thanks, @kaie). For the NSS
libnssckbi implementation, we will likely wind up not finding any
dirs that match the requirements, so we will simply install the
libnssckbi.so file itself, which is the correct action.

This fixes TLS transactions in the initramfs environment when
using a curl that's built this new way; it's significant for
use of kickstarts and update images with the Fedora / RHEL
installer, as these are retrieved in the initramfs environment,
and are frequently retrieved via HTTPS.
2017-05-11 10:13:22 -07:00
Harald Hoyer
2e1861fde2 Merge pull request #224 from jasondana/integrity-fix
Check the proper variable for a custom IMA keys directory
2017-04-27 14:08:47 +02:00
Jason Dana
ab66ef2d4a Check the proper variable for a custom IMA keys directory 2017-04-27 07:55:58 -04:00
Bryn M. Reeves
cc4e507322 lvm_scan.sh: use -K when calling lvchange
The --ignoreactivationskip/-K switch was added to LVM2 in 2.02.99
(July 2013) and is used to control the activation of volumes with
the activation skip flag set: without -K these volumes will be
ignored when 'lvchange -ay $LV' is issued.

This prevents an LVM2 thin-privisioned snapshot from being used
as the root device when booting with rd.lvm.lv=vg/lv since the
activation skip flag is set for these snapshots by default (the
legacy non-thinp snapshots do not set this flag and can already
be activated and used as a root device by specifying appropriate
values for rd.lvm.lv).

This is only used in the rd.lvm.lv case since in that situation
we are activating one or more named LVs specified by the user:
the flag is not given when calling 'vgchange' since this may
cause many unwanted volumes to be activated during early user
space. Users wishing to use a specific snapshot volume should
specify it with 'rd.lvm.lv'.
2017-04-26 14:15:15 +01:00
Harald Hoyer
29fd71b23d TEST-50-MULTINIC: fix bridge test
Bridge with nics on a different vlan, otherwise we will see:

[  117.750825] bridge0: received packet on ens5 with own address as source address
2017-04-26 09:39:20 +02:00
Harald Hoyer
bc6f06a795 Merge pull request #222 from danimo/fix_subnet_calc
mkinitrd-suse.sh: Fix prefix calculation
2017-04-26 09:22:19 +02:00
Daniel Molkentin
7cf2c21798 mkinitrd-suse.sh: Fix prefix calculation
The previous algorithm was incorrect and would return
incorrect results e.g. for a /20 mask. Also gets rid
of an undocumented depencency on bc(1).

Reference: bsc#1035743
2017-04-25 15:30:13 +02:00
Harald Hoyer
11947da13f Merge pull request #219 from tpgxyz/master
fix build with KMOD
2017-04-25 10:51:39 +02:00
Tomasz Paweł Gajc
f59548aeab fix build with KMOD 2017-04-24 21:37:56 +02:00
Harald Hoyer
fafb4c0182 Merge pull request #210 from Calrama/gpg-smartcard
crypt-gpg: For GnuPG >= 2.1 support gpg keyfile decryption via a OpenPGP smartcard in a CCID reader
2017-04-19 09:09:14 +02:00
Harald Hoyer
0096157e14 Merge pull request #214 from pallotron/master
Look for IPv6 RA in wait_for_ipv6_dad, wait_for_ipv6_dad_link and wait_for_ipv6_auto
2017-04-11 13:40:27 +02:00
Harald Hoyer
9998940493 Merge pull request #217 from FGrose/overlayfs
dmsquash-live-root: Avoid mount source conflict on $BASE_LOOPDEV.
2017-04-11 13:39:27 +02:00
Harald Hoyer
538ff0fd80 add .mailmap 2017-04-10 14:50:21 +02:00
Daniel Molkentin
8b6d136e62 Make binutils optional when elfutils are available
This is intended for minimum host OSes where 36 MB used by binutils
are deemed too expensive. We only need "strip", which exists as eu-strip
in elfutils, which in turn is < 1 MB in size.

Note that the tests (TEST-04-FULL-SYSTEMD/test.sh) still depend on
strip from binutils. It could use sstrip in the future.
2017-04-10 11:28:04 +02:00
Frederick Grose
ea765c0ee1 dmsquash-live-root: Avoid mount source conflict on $BASE_LOOPDEV.
The newer mount utilities are more strict about directly shared
devices. For OverlayFS boots, which mount $BASE_LOOPDEV directly,
avoid a mount error by indirectly sharing the read-only base
filesystem through a second, over-attached $BASE_LOOPDEV for
the DM live-base target.
2017-04-09 11:23:12 -04:00
pallotron
e190073b21 Merge remote-tracking branch 'upstream/master' 2017-04-05 11:59:36 -07:00
Daniel Molkentin
ce999bff98 Tests: find qemu on (open)SUSE systems 2017-04-05 16:42:22 +02:00
pallotron
031e2f7bb8 more ipv6 improvements 2017-04-05 00:23:36 -07:00
pallotron
a0545765e8 remove prints 2017-04-05 00:16:16 -07:00
pallotron
96b708e178 more ipv6 improvements 2017-04-05 00:15:16 -07:00
pallotron
4c3d99f966 enabling some ipv6 config before running wait_for_ipv6_dad 2017-04-04 12:59:45 -07:00
pallotron
c603419030 wait for IPv6 RA if using none/static IPv6 assignment 2017-04-04 08:31:21 -07:00
Harald Hoyer
39c9b67f86 NEWS and AUTHORS update 2017-04-03 10:26:25 +02:00
Harald Hoyer
685d8619d0 Merge pull request #212 from pallotron/master
remove $$arch() from rpm target in Makefile
2017-03-31 14:22:13 +02:00
pallotron
15d103f911 better fix from @haraldh 2017-03-31 04:43:08 -07:00
Harald Hoyer
a63cc421a5 Merge pull request #211 from Calrama/embedded-keyfile
crypt: Support keyfiles embedded in the initramfs
2017-03-31 11:41:19 +02:00
Moritz Maxeiner
b4cf58f038 crypt: Fix indentation for embedded keyfile 2017-03-30 15:06:01 +02:00
Moritz Maxeiner
0e1b686b83 crypt-gpg: Include module if CCID smartcard support requested 2017-03-30 14:54:26 +02:00
pallotron
a99bbe8fa8 remove $$arch() from rpm target in Makefile 2017-03-30 05:53:36 -07:00
Moritz Maxeiner
0982fcb2e5 crypt-gpg: Rework setup for CCID smartcard support 2017-03-30 14:17:05 +02:00
Harald Hoyer
f0bfada399 dracut.sh: strip NUL bytes in stream before push in string
seems like bash-4.4 does not like NUL bytes in variables
2017-03-30 12:52:11 +02:00
Harald Hoyer
041e49ee2a network: enhance team support
Install ifcfg-* files with team configuration in the initramfs.

Improve the slave configuration of the team interface, by looking up
ifcfg files in the initramfs.

Create a default loadbalance team config, if none present in the
initramfs.

forward port of
4c88c2859e
2017-03-30 11:50:35 +02:00
Harald Hoyer
811a070d6c network: differ between ipv6 local and global tentative
For dhcpv6, only a non-tentative scope local address is needed.

(cherry picked from commit 42dd8928a8)
2017-03-30 11:34:51 +02:00
Harald Hoyer
5401d1f86f network:wait_for_ipv6_auto() wait for all tentative addresses
(cherry picked from commit 13264563a9)
2017-03-30 11:34:51 +02:00
Harald Hoyer
e8dc8c4d89 network/net-lib.sh: auto6 wait for route ra
Wait for a router advertised route

(cherry picked from commit 6d22a6860e)
2017-03-30 11:34:51 +02:00
Harald Hoyer
65960fda7e dracut.cmdline.7.asc: document bond mtu option 2017-03-30 11:14:46 +02:00
Harald Hoyer
25895a7769 Merge pull request #129 from imran1008/bond-mtu
add 'mtu' parameter for bond options
2017-03-30 11:03:04 +02:00
Harald Hoyer
144a3d85d0 Merge pull request #162 from dracut-mailing-devs/20160607094008.21012-1-colin@mageia.org
systemd: add more groups to deal with tmpfiles handling.
2017-03-30 11:01:55 +02:00
Harald Hoyer
e6390b5a70 Merge pull request #163 from dracut-mailing-devs/1711921.0d4JtWs6XN@linux-lm3i.site
Fix wrong keymap inclusion
2017-03-30 11:01:22 +02:00
Harald Hoyer
c1cec35469 Merge pull request #164 from dracut-mailing-devs/1467648310-27834-1-git-send-email-pbrobinson@gmail.com
modules: kernel: add phy and power modules to generic initrd
2017-03-30 11:00:36 +02:00
Harald Hoyer
8078a9c8ea Merge pull request #165 from dracut-mailing-devs/1476286367-30606-1-git-send-email-chad.dupuis@cavium.com
fcoe: Allow more time for the bnx2x link negotiation before brining u…
2017-03-30 11:00:00 +02:00
Harald Hoyer
2931eaa800 Merge pull request #176 from danimo/pinctrl-cherryview
Always try to add pinctrl-cherryview
2017-03-30 10:59:18 +02:00
Harald Hoyer
1f1aa43573 Merge branch 'FGrose-overlayfs' 2017-03-30 10:55:17 +02:00
Harald Hoyer
1dd68c2f23 Merge branch 'overlayfs' of https://github.com/FGrose/dracut into FGrose-overlayfs 2017-03-30 10:53:22 +02:00
Harald Hoyer
1d75490767 Merge pull request #177 from danimo/mkinitrd-suse_fixes
mkinitrd-suse.sh: Resolve symbolic links for -i and -k parameters (bsc#902375)
2017-03-30 10:50:41 +02:00
Harald Hoyer
ca6be905f0 Merge pull request #178 from danimo/cifs_ntlm_auth
Add md4 and arc4 modules for ntlm
2017-03-30 10:50:16 +02:00
Harald Hoyer
67ae4f20b8 Merge pull request #185 from ldzhong/bsc1012656
man: make the -k option clear using mkinitrd
2017-03-30 10:46:07 +02:00
Harald Hoyer
b2f751db04 Merge pull request #198 from danimo/degraded_md_raid
Allow booting from degraded MD RAID arrays
2017-03-30 10:30:19 +02:00
Harald Hoyer
6eb80b3278 Merge branch 'master' of github.com:dracutdevs/dracut 2017-03-30 10:15:22 +02:00
Harald Hoyer
a1ba30cf4f Merge branch 'danimo-remove-test-dependencies' 2017-03-30 10:14:08 +02:00
Harald Hoyer
0042f2568d Merge branch 'remove-test-dependencies' of https://github.com/danimo/dracut into danimo-remove-test-dependencies 2017-03-30 09:21:50 +02:00
Harald Hoyer
b0d6254dad TEST: redirect server output to server.log if $SERIAL empty 2017-03-30 09:04:02 +02:00
Harald Hoyer
f3f37f3cce TEST: new rpcbind needs /run/rpcbind 2017-03-30 09:03:31 +02:00
Harald Hoyer
9ae7ed1a1d Merge pull request #209 from nullr0ute/aarch64-fixes
Aarch64 fixes
2017-03-30 08:56:19 +02:00
Harald Hoyer
e1171941c2 TEST-70-BONDBRIDGETEAMVLAN: remove qemu -kernel parameter
'run-qemu' takes care of finding the kernel image
2017-03-30 08:34:57 +02:00
Moritz Maxeiner
98047e08d0 crypt-gpg: Add README describing the procedure of moving from
password-only gpg keyfile to password/smartcard gpg keyfile
2017-03-30 02:18:39 +02:00
Moritz Maxeiner
2a1723ed83 crypt-gpg: For GnuPG >= 2.1 support OpenPGP smartcards 2017-03-30 02:18:39 +02:00
Moritz Maxeiner
1fc68b989d crypt: Support keyfiles embedded in the initrd
For rd.luks.key=keypath:keydev:luksdev, keydev being '/' will
assume the initrd contains the keyfile.
2017-03-30 02:14:31 +02:00
Peter Robinson
917e1b6b5b Add check for aarch64 to the arm kernel module list
This adds the same list of drivers we use for arm platforms for
aarch64 too, also add the DMA drivers there too as they can add
sigficant performance for some storage/usb and often need to be
present when the storage drivers load.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2017-03-23 14:59:15 +00:00
Peter Robinson
eec49634d4 Add aarch64 to drm modules along side ARM
Add aarch64 to modules, also update the drivers checked for latest
kernel changes.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2017-03-23 14:51:48 +00:00
Harald Hoyer
bd4aa25741 Merge pull request #199 from lnykryn/bz1416958
ifup: don't ifup team master indefinitely
2017-03-21 13:33:41 +01:00
Harald Hoyer
7a44fea98c Merge pull request #201 from lnykryn/bz1415004
network/ifup: write override file before dhcp_do
2017-03-21 13:33:20 +01:00
Harald Hoyer
53475faa81 Correct path for UEFI stub
respect any $prefix given to the systemd installation

https://github.com/dracutdevs/dracut/pull/196
2017-03-20 11:43:04 +01:00
Harald Hoyer
6a6c09e33c Merge pull request #204 from lnykryn/mtu
write-ifcfg: do't write MTU twice for regular eth devices
2017-03-15 10:46:35 +01:00
Harald Hoyer
4efe015bfb Merge pull request #206 from mwilck/master
dracut-init.sh: fix typo
2017-03-15 10:45:38 +01:00
Frederick Grose
3c6337f68e dmsquash-live-root: Extend rd.live.overlay.readonly support
Support the rd.live.overlay.readonly option for writable images,
such as rd.live.overlay=none and rd.writable.fsimg.
2017-03-11 19:14:26 -05:00
Frederick Grose
f1b65e92af dmsquash-live-root: Provide enhanced feedback on missing overlay.
Provide a more prominent alert to the user if an overlay is
missing or the overlay module is not available and a temporary
overlay will be provided.  This, to avoid losing data intended to
persist.
2017-03-11 00:43:05 -05:00
Frederick Grose
ea28824027 Enable the use of the OverlayFS for the LiveOS root filesystem.
Integrate the option to use an OverlayFS as the root filesystem
into the 90dmsquash-live module for testing purposes.

The rd.live.overlay.overlayfs option allows one to request an
OverlayFS overlay.  If a persistent overlay is detected at the
standard LiveOS path, the overlay & type detected will be used.

Tested primarily with transient, in-RAM overlay boots on vfat-
formatted Live USB devices, with persistent overlay directories
on ext4-formatted Live USB devices, and with embedded, persistent
overlay directories on vfat-formatted devices. (Persistent overlay
directories on a vfat-formatted device must be in an embedded
filesystem that supports the creation of trusted.* extended
attributes, and must provide valid d_type in readdir responses.)

The rd.live.overlay.readonly option, which allows a persistent
overlayfs to be mounted read only through a higher level transient
overlay directory, has been implemented through the multiple lower
layers feature of OverlayFS.

The default transient DM overlay size has been adjusted up to 32 GiB.
This change supports comparison of transient Device-mapper vs.
transient OverlayFS overlay performance.  A transient DM overlay
is a sparse file in memory, so this setting does not consume more
RAM for legacy applications.  It does permit a user to use all of
the available root filesystem storage, and fails gently when it is
consumed, as the available free root filesystem storage on a typical
LiveOS build is only a few GiB.  Thus, when booted on other-
than-small RAM systems, the transient DM overlay should not overflow.

OverlayFS offers the potential to use all of the available free RAM
or all of the available free disc storage (on non-vfat-devices)
in its overlay, even beyond the root filesystem available space,
because the OverlayFS root filesystem is a union of directories on
two different partitions.

This patch also cleans up some message spew at shutdown, shortens
the execution path in a couple of places, and uses persistent
DM targets where required.

Documentation is updated for these changes.
2017-03-11 00:42:19 -05:00
Martin Wilck
d13071d7a6 dracut-init.sh: fix typo 2017-03-09 21:57:27 +01:00
Cristian Rodriguez
ccf948f2ab systemd 233 requires sha256, hmac and algif_hash modules 2017-03-03 15:01:56 +01:00
Lukas Nykryn
196bb03477 write-ifcfg: do't write MTU twice for regular eth devices
If MTU is specified, we write it for every type of device in the
beginning. There is not point writing it again for Type=ethernet
devices.
2017-03-01 14:46:12 +01:00
Daniel Molkentin
285495814b Drop dependency on bridge-utils 2017-02-14 14:10:24 +01:00
Daniel Molkentin
fd79054610 net-tools are not required anymore
Also bridge-utils was listed twice in README.testsuite.
2017-02-13 18:32:18 +01:00
Lukas Nykryn
73fb5e769b network/ifup: write override file before dhcp_do
Commit cf376023e6 moved writing .resolv.conf and .override
after dhcp_do, because dhcp_do was overwriting .resolv.conf. But .override does not have
such problem and on the contrary dhcp_do reads .override file if it is present. So let\'s
move it back.

https://bugzilla.redhat.com/show_bug.cgi?id=1415004
2017-02-07 17:09:41 +01:00
Harald Hoyer
37a2343509 Merge pull request #200 from nullr0ute/modules-generic-fixes
Some fixes for ARM hardware generic host initrd generation
2017-02-07 12:20:11 +01:00
Peter Robinson
0c5e5f271b modules: kernel: add more usb controller modules
There's a number of usb controllers that are common yet aren't
contained in the host directory. Include these for generic host.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2017-02-07 10:06:53 +00:00
Peter Robinson
e752d42de9 modules: kernel: add phy and power modules to generic initrd
The phy and power modules are needed by some of the recent ARM
devices that have appeared like CHIP and some exynos devices.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2017-02-03 10:24:30 +00:00
Lukas Nykryn
6ed73e37f2 ifup: don't ifup team master indefinitely
https://bugzilla.redhat.com/show_bug.cgi?id=1416958
Thanks to martin.moore@hpe.com for the patch
2017-02-02 13:02:10 +01:00
Daniel Molkentin
f1c790495b Allow booting from degraded MD RAID arrays
bnc#1017695
2017-01-30 11:29:08 +01:00
Harald Hoyer
4693daa5fa fips: honor $BOOT_IMAGE variable for HMAC check of the kernel
https://bugzilla.redhat.com/show_bug.cgi?id=1415032
2017-01-30 09:25:41 +01:00
Harald Hoyer
7c29d205f4 fips: use /lib/modules/$(uname -r)/modules.fips
if /lib/modules/$(uname -r)/modules.fips exists, use that list instead
of the hardcoded dracut module list.
2017-01-25 16:39:09 +01:00
Harald Hoyer
35bf607087 Merge pull request #197 from danimo/update-gitignore
Ignore more generated files
2017-01-25 14:55:08 +01:00
Daniel Molkentin
d8a01fea33 Ignore more generated files
Also fixes ignores after systemd module split
2017-01-25 13:27:05 +01:00
Harald Hoyer
a9f04fcc4a NEWS: update for 045 2017-01-19 13:52:33 +01:00
Harald Hoyer
4e669086a3 test: add TEST-70-BONDBRIDGETEAMVLAN 2017-01-18 16:26:58 +01:00
Harald Hoyer
bdd626059c test/run-qemu: make "-cpu host" the default 2017-01-18 16:26:30 +01:00
Harald Hoyer
043d8f401b ifcfg/write-ifcfg.sh: write DEVICE=$netif for VLAN
VLAN interface configuration is not bound by HWADDR but by DEVICE
2017-01-18 16:23:45 +01:00
Harald Hoyer
05c2080e51 base/dracut-lib.sh: fixup trim()
no "--"
2017-01-18 16:22:26 +01:00
Harald Hoyer
e7838a8312 network: fixup VLAN handling 2017-01-18 15:16:01 +01:00
Harald Hoyer
dec4b2cdd4 base/dracut-lib.sh:trim() replace 'echo -n' 2017-01-18 15:15:23 +01:00
Harald Hoyer
2bd8b227de nfs: add chmod 2017-01-18 15:15:06 +01:00
Harald Hoyer
2949dcba29 base/dracut-lib.sh: add trim()
trim() to remove leading and trailing whitespace

(cherry picked from commit ac422d577c)
2017-01-18 13:29:32 +01:00
Harald Hoyer
0cf826a11a network: fix vlan handling 2017-01-18 13:28:47 +01:00
Harald Hoyer
a1595cf5f9 network: parse multiple vlan parameters 2017-01-18 13:15:18 +01:00
Harald Hoyer
6aec6a7e2f network/net-genrules.sh: generate rules for all interfaces
previously, if "rd.neednet" and bond was specified, only the bond
interface was configured.

https://bugzilla.redhat.com/show_bug.cgi?id=1282680
(cherry picked from commit e6ae0c6128)
2017-01-18 13:15:18 +01:00
Harald Hoyer
647b521fc7 dracut: check for EUID instead of UID 2017-01-18 11:04:36 +01:00
Harald Hoyer
076fcd1652 dracut: only copy xattr, if root
otherwise cp complains a lot about not being able to copy xattrs
2017-01-18 10:38:00 +01:00
Harald Hoyer
83a6d6f928 dracut.sh: add /dev/random and /dev/urandom to static device nodes
otherwise libgcrypt might complain

https://bugzilla.redhat.com/show_bug.cgi?id=1401444
2017-01-18 10:37:10 +01:00
Harald Hoyer
8a32bf6107 dracut: unset LC_* after setting LANG and LC_ALL
otherwise bash/glibc might complain verbosely about not finding locales
2017-01-18 10:35:41 +01:00
Harald Hoyer
1d832b4bf4 fips: precreate /dev/random /dev/urandom
otherwise libgcrypt might be unhappy, if used before devtmpfs is mounted

https://bugzilla.redhat.com/show_bug.cgi?id=1401444
2017-01-18 10:34:00 +01:00
Harald Hoyer
5ebf48d2ba nfs: dynamically chown /var/lib/rpcbind 2017-01-18 10:33:09 +01:00
Harald Hoyer
be5025bf55 dracut-install: install kernel modules to /lib/modules/$kernelversion
Specifying a different kernel module directory with --kmoddir would
result in the same directory being the destination directory.

Strip everything before the "/lib/modules" for the destination dir.

https://github.com/dracutdevs/dracut/issues/194
2017-01-16 14:27:39 +01:00
Harald Hoyer
7e51a94f5b Do not "cp" the selinux context
replace "cp -a" with $DRACUT_CP, so in case the selinux policy disallows
root to set the selinux context in /var/tmp, dracut does not fail.
2017-01-16 14:27:39 +01:00
Harald Hoyer
73b9eaab1d crypt: with systemd cryptsetup is not needed 2017-01-16 14:27:39 +01:00
Harald Hoyer
f13278eac2 TEST-99-RPM: fix installation loop 2017-01-16 14:27:39 +01:00
Harald Hoyer
5c57209ba5 dracut.sh: add default path for --uefi
The default output filename for --uefi is
<EFI>/EFI/Linux/linux-$kernel$-<MACHINE_ID>-<BUILD_ID>.efi.
<EFI> might be /efi, /boot or /boot/efi depending on where the ESP partition
is mounted. The <BUILD_ID> is taken from BUILD_ID in /usr/lib/os-release or
if it exists /etc/os-release and is left out, if BUILD_ID is non-existant or
empty.

Also a new option --no-machineid was added, which affects the default output
filename of --uefi and will discard the <MACHINE_ID> part.
2017-01-16 14:27:39 +01:00
Harald Hoyer
2870b7d243 .dir-locals.el: changed to sane style 2017-01-16 14:27:39 +01:00
Harald Hoyer
33a5586cae test/Makefile: proper return code for "make check"
(cherry picked from commit aa40b82145)
2017-01-16 14:27:39 +01:00
Harald Hoyer
ffc2ca202b TEST-99-RPM: retry dnf 5 times in case http fails 2017-01-16 14:27:39 +01:00
Harald Hoyer
a6229a8f9a Merge pull request #193 from dsilakov/master
Support multiple default gateways from DHCP server (rhbz#1408249)
2017-01-16 14:12:36 +01:00
Denis Silakov
727e2a1d9d Make gateway processing POSIX-compliant 2017-01-13 18:44:40 +03:00
Harald Hoyer
0676c1e0d0 Merge pull request #192 from dkg/doc-fixup
Doc fixup
2017-01-09 11:58:32 +01:00
Denis Silakov
b2f6409a22 Support multiple default gateways from DHCP server (rhbz#1408249) 2017-01-09 12:55:10 +03:00
Harald Hoyer
39c725dc4e Merge pull request #157 from ddiss/fix_relative_tmpdir
dracut.sh: support --tmpdir as a relative path
2017-01-09 10:42:40 +01:00
Daniel Kahn Gillmor
85c8217db0 docs: override is not the same as overwrite!
Some docs claimed that values in certain config files would be
overwritten, when they would actually be overridden.

Override: a file is not modified but its contents are superseded by
          something else.  (configurations set in
          /etc/dracut.conf.d/*.conf override configurations set in
          /etc/dracut.conf)

Overwrite: a file is modified or its contents replaced by an action
           (use dracut --force to overwrite the existing initramfs)
2017-01-03 10:08:18 -05:00
Daniel Kahn Gillmor
f2c423651b dracut.modules.7.asc: correct filename parse-instmodpost.sh in documentation 2017-01-03 10:06:38 -05:00
Harald Hoyer
a35fab2cf1 Merge pull request #186 from xlpang/workspace
Introduce "rd.memdebug=4" to test kernel module memory consumption
2016-12-05 09:29:57 +01:00
Lidong Zhong
4a739be99c man: make the -k option clear using mkinitrd
For example under x86, someone maybe missunderstand that the vmlinuz
is the link /boot/vmlinuz points to a specific kernel image and use
the following command directly.

    mkinitrd -k vmlinuz
2016-12-02 14:32:09 +08:00
Harald Hoyer
d4793cdbdb Merge pull request #184 from jesa7955/fix_ssh_issue
95ssh-client: attempt to copy UserKnownHostsFile to kdump's initramfs
2016-11-30 13:28:36 +01: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
Xunlei Pang
01030beda2 testsuite: add "rd.memdebug=4" in TEST-01-BASIC to test rd.memdebug
"rd.memdebug=4" includes all the test level, so add it to test
rd.memdebug function.

Signed-off-by: Xunlei Pang <xlpang@redhat.com>
2016-11-27 12:21:02 +08:00
Xunlei Pang
7a5949ffcd dracut.cmdline.7.asc: update document for rd.memdebug=4
"rd.memdebug=4" is for kernel module memory consumption debugging.

Signed-off-by: Xunlei Pang <xlpang@redhat.com>
2016-11-27 12:09:10 +08:00
Xunlei Pang
52c295c161 99base: apply kernel module memory debug support
Extend "rd.memdebug" to "4", and "make_trace_mem" to "4+:komem".
Add new "cleanup_trace_mem" to cleanup the trace if active.

Signed-off-by: Xunlei Pang <xlpang@redhat.com>
2016-11-27 12:09:10 +08:00
Xunlei Pang
34986d538a 99base: add memtrace-ko.sh to debug kernel module large memory consumption
The current method for memory debug is to use "rd.memdebug=[0-3]",
it is not enough for debugging kernel modules. For example, when we
want to find out which kernel module consumes a large amount of memory,
"rd.memdebug=[0-3]" won't help too much.

A better way is needed to achieve this requirement, this is useful for
kdump OOM debugging.

The principle of this patch is to use kernel trace to track slab and
buddy allocation calls during kernel module loading(module_init), thus
we can analyze all the trace data and get the total memory consumption.
As for large slab allocation, it will probably fall into buddy allocation,
thus tracing "mm_page_alloc" alone should be enough for the purpose(this
saves quite some trace buffer memory, also large free is quite unlikey
during module loading, we neglect those memory free events).

The trace events include memory calls under "tracing/events/":
  kmem/mm_page_alloc

We also inpect the following events to detect the module loading:
  module/module_load
  module/module_put

Since we use filters to trace events, the final trace data size won't
be too big. Users can adjust the trace buffer size via "trace_buf_size"
kernel boot command line as needed.

We can get the module name and task pid from "module_load" event which
also mark the beginning of the loading, and module_put called by the
same task pid implies the end of the loading. So the memory events
recorded in between by the same task pid are consumed by this module
during loading(i.e. modprobe or module_init()).

With these information, we can record the rough total memory(the larger,
the more precise the result will be) consumption involved by each kernel
module loading.

Thus we introduce this shell script to find out which kernel module
consumes a large amount of memory during loading. Use "rd.memdebug=4"
as the tigger.

After applying this patch and specifying "rd.memdebug=4", during booting
it will print out something extra like below:
0 pages consumed by "pata_acpi"
0 pages consumed by "ata_generic"
1 pages consumed by "drm"
0 pages consumed by "ttm"
0 pages consumed by "drm_kms_helper"
835 pages consumed by "qxl"
0 pages consumed by "mii"
6 pages consumed by "8139cp"
0 pages consumed by "virtio"
0 pages consumed by "virtio_ring"
9 pages consumed by "virtio_pci"
1 pages consumed by "8139too"
0 pages consumed by "serio_raw"
0 pages consumed by "crc32c_intel"
199 pages consumed by "virtio_console"
0 pages consumed by "libcrc32c"
9 pages consumed by "xfs"

From the print, we see clearly that "qxl" consumed the most memory.

This file will be installed as a separate executable named "tracekomem"
in the following patch.

Signed-off-by: Xunlei Pang <xlpang@redhat.com>
2016-11-27 12:09:10 +08:00
Daniel Molkentin
e69da98de1 Add md4 and arc4 modules for ntlm
Some crashkernel targets still use legacy NTLM auth, which
require those (bsc#869496). This patch enumerates all dependent
hash algorithems, because even though most of them are probably
compiled in, older ones (e.g. md4 and arc4) usually aren't.
2016-11-17 16:56:53 +01:00
Daniel Molkentin
7957bd01b0 Resolve symbolic links for -i and -k parameters (bsc#902375) 2016-11-17 16:34:20 +01:00
Daniel Molkentin
9ffab3f3a5 Always try to add pinctrl-cherryview
Contrary to previous intel pinctrl drivers, the cherryview driver can be
and usually is built as a module. However, it sets up the SDIO pinout
so sdhci can make use of the SD card reader, which may subsequently
hold a root file system on a card  (bsc#998440).
2016-11-15 11:59:05 +01:00
Harald Hoyer
cc81672cef Merge pull request #161 from dracut-mailing-devs/1477422589-21327-1-git-send-email-stefanb@linux.vnet.ibm.com
dracut-install: preserve extended attributes when copying files
2016-11-15 10:41:31 +01:00
Harald Hoyer
aa6885fbaf Merge pull request #174 from haraldh/master
testsuite: add "-cpu host" to kvm call
2016-11-14 16:35:13 +01:00
Harald Hoyer
beaddf6881 Merge pull request #173 from danimo/xennet
network: Try to load xennet
2016-11-14 16:34:30 +01:00
Harald Hoyer
dfb3db3dad testsuite: add "-cpu host" to kvm call 2016-11-14 16:21:06 +01:00
Harald Hoyer
43adba3a71 README.md: change centosci badge 2016-11-14 13:51:59 +01:00
Harald Hoyer
e63ac4433a test/test-rhel-7.2.rpms: remove file 2016-11-14 12:30:52 +01:00
Harald Hoyer
d941f0e015 Revert "TEST-99-RPM: use --best and install all rpms"
This reverts commit f81806db20.
2016-11-14 12:29:12 +01:00
Harald Hoyer
f81806db20 TEST-99-RPM: use --best and install all rpms 2016-11-14 12:27:33 +01:00
Harald Hoyer
f0c9ae4d36 README.md: add CentOS badge 2016-11-14 12:27:11 +01:00
Harald Hoyer
e35d1451f5 test/TEST-99-RPM: dnf does not like any dracut subpackage 2016-11-11 16:34:42 +01:00
Harald Hoyer
eac751f1e0 test/TEST-99-RPM: speedup test 2016-11-11 16:04:31 +01:00
Harald Hoyer
e80ac43710 dracut.spec: add systemd-udev requirement 2016-11-11 16:04:09 +01:00
Thomas Renninger
b1a39dbcc2 network: Try to load xennet
This makes dracut boot from NFS in a xen instance.

bnc#896464, bnc#896259

Signed-off-by: Thomas Renninger <trenn@suse.de>
2016-11-10 16:05:58 +01:00
Harald Hoyer
0eb7a7c479 README.testsuite: add dmraid 2016-11-10 10:56:06 +01:00
Harald Hoyer
924a669a1b TEST-99-RPM: append "/" to DESTDIR 2016-11-07 17:52:52 +01:00
Harald Hoyer
6ee83a0bd1 Makefile: fixed DESTDIR in rpm target 2016-11-07 17:52:09 +01:00
Harald Hoyer
93d7b95ad4 TEST-30-ISCSI: give server more time for the head start 2016-11-07 17:22:08 +01:00
Harald Hoyer
caa6d12fd7 README.testsuite: add more requirements 2016-11-07 17:20:43 +01:00
Harald Hoyer
ffcbde7fe2 TEST-99-RPM: set release version and disable update-testing repo 2016-11-07 17:20:18 +01:00
Harald Hoyer
44766d1f1f TEST-99-RPM: actually use the generated rpms with dnf 2016-11-07 17:05:28 +01:00
Harald Hoyer
86f0904004 TEST-30-ISCSI: fixed dhcpd.conf and disabled nowait 2016-11-07 13:23:39 +01:00
Harald Hoyer
e22e04ae15 TEST-99-RPM: add test_check() for rpm,dnf,yum 2016-11-07 13:20:35 +01:00
Harald Hoyer
2811e4ed22 TEST-99-RPM: create dracut rpms to install first
create rpms in TESTDIR first
2016-11-07 13:15:56 +01:00
Harald Hoyer
5d274f9365 Makefile: create rpms in DESTDIR for target rpm 2016-11-07 13:14:49 +01:00
Zbigniew Jędrzejewski-Szmek
4dbb4dc5bc Use versioned Obsoletes
Also change <= N to < N+1. For example, dracut-029-1 > dracut-029, so would not
get obsoleted properly. This all applies to old versions, so doesn't make much
difference in practice, so just fix it to avoid c&p duplication of the bad
pattern in the future.
2016-11-07 11:10:12 +01:00
Harald Hoyer
597b159248 NEWS: update for 045 2016-11-07 11:01:36 +01:00
Andreas Stieger
0db98910a1 dracut.sh: create the initramfs non-world readable also if early cpio is used
Fixes: 5f2c30d9bc
Previously fixed CVE-2012-4453: e1b48995c2

Signed-off-by: Andreas Stieger <astieger@suse.com>
2016-11-07 10:41:38 +01:00
Harald Hoyer
a5b2d8fe74 Merge pull request #169 from floppym/50-dracut.install-bashism
50-dracut.install: use /bin/bash shebang
2016-11-07 10:20:06 +01:00
Mike Gilbert
69395a528a 50-dracut.install: use /bin/bash shebang
This script utilizes several bash-specific constructs.
2016-11-04 13:09:28 -04:00
Harald Hoyer
ca31a7e368 TODO: remove some items 2016-11-03 15:05:36 +01:00
Harald Hoyer
e7f52635d9 README: update
remove "new" and reword the first paragraphs

remove sourceforge repo links
2016-11-03 14:54:45 +01:00
Harald Hoyer
2afd60baa6 README.md: remove CI badge 2016-11-03 14:48:31 +01:00
Harald Hoyer
bd98b88447 dracut.8: document INITRD_COMPRESS environment variable
https://bugzilla.redhat.com/show_bug.cgi?id=1389775
2016-11-02 13:49:17 +01:00
Harald Hoyer
ec44ed1d9d README: correct github URLs 2016-10-26 13:41:21 +02:00
Stefan Berger
61c761bc2c dracut-install: preserve extended attributes when copying files
Preserve extended attributes when copying files using dracut-install.

The copying of extended attributes avoids file execution denials when
the Linux Integrity Measurement's Appraisal mode is active. In that mode
executables need their file signatures copied. In particular, this patch
solves the problem that dependent libaries are not included in the
initramfs since the copied programs could not be executed due to missing
signatures. The following audit record shows the type of failure that
is now prevented:

type=INTEGRITY_DATA msg=audit(1477409025.492:30065): pid=922 uid=0
 auid=4294967295 ses=4294967295
 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
 op="appraise_data" cause="IMA-signature-required"
 comm="ld-linux-x86-64"
 name="/var/tmp/dracut.R6ySa4/initramfs/usr/bin/journalctl"
 dev="dm-0" ino=37136 res=0

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-10-25 22:05:55 +02:00
Harald Hoyer
b8278a99ab README.md: update 2016-10-20 15:35:08 +02:00
Harald Hoyer
7e8f8ddbf8 README.md: update 2016-10-20 14:53:25 +02:00
Harald Hoyer
4a7b55ee7e add README.md 2016-10-20 14:46:40 +02:00
Harald Hoyer
ddfcfdf199 test/test-rhel-7.2.rpms
list of rpms to install to run the testsuite on rhel-7.2
2016-10-20 13:58:53 +02:00
Harald Hoyer
fc44fdb5ac integrity/ima-policy-load.sh: s/echo -n/printf 2016-10-20 13:58:25 +02:00
Harald Hoyer
b08ad7f7d8 Merge pull request #160 from yuwata/fix-rescue-install
rescue: use proper path for 0-rescue.conf
2016-10-19 09:35:46 +02:00
Yu Watanabe
b29901c083 rescue: use proper path for 0-rescue.conf 2016-10-19 12:22:54 +09:00
Harald Hoyer
a69d137338 Merge pull request #158 from dracut-mailing-devs/1476391783-27231-1-git-send-email-stefanb@linux.vnet.ibm.com
98integrity: support validating the IMA policy file signature
2016-10-14 11:34:39 +02:00
Stefan Berger
479b5cd94f 98integrity: support validating the IMA policy file signature
IMA validates file signatures based on the security.ima xattr. As of
Linux-4.7, instead of cat'ing the IMA policy into the securityfs policy,
the IMA policy pathname can be written, allowing the IMA policy file
signature to be validated.

This patch first attempts to write the pathname, but on failure falls
back to cat'ing the IMA policy contents .

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
2016-10-13 23:02:40 +02:00
Harald Hoyer
de7ab164dd dmsquash-live/dmsquash-live-root: det_img_fs() redirect udevadm output to stderr
Otherwise the output is taken as input for modprobe.
2016-10-13 09:20:33 +02:00
Harald Hoyer
bb47ec5499 dracut-install: fallback to non-hostonly mode if lsmod fails
if libkmod fails to get the list of loaded modules, fallback
to non-hostonly mode, to at least try to assemble a working initrd.
2016-10-13 09:19:29 +02:00
Chad Dupuis
3966a1e1ee fcoe: Allow more time for the bnx2x link negotiation before brining up fcoe interfaces.
bnx2x can take no longer than 3 seconds to initialize the link in some setups
which can cause fipvlan to fail and thus the fcoe interface(s) won't be
created.

Add another 10 seconds to give the link enough time to initialize.

Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
2016-10-12 19:02:39 +02:00
Harald Hoyer
d8c75b5f38 Merge pull request #131 from bcg62/syslog-fixes
syslog module fixes
2016-10-11 15:06:31 +02:00
Brendan Germain
a1ea214a87 add imjournal.so to read systemd journal 2016-10-11 08:51:13 -04:00
Brendan Germain
1d9d43713d subshell and set -f to prevent expansion 2016-10-11 08:50:37 -04:00
Brendan Germain
b37b141ecc fixup No such file or directory errors when module is not configured 2016-10-11 08:43:20 -04:00
Brendan Germain
223547feab move start from udev to initqueue/online 2016-10-11 08:43:20 -04:00
Brendan Germain
3568d947db source dracut-lib for warn() 2016-10-11 08:43:20 -04:00
Brendan Germain
ff6077789e correctly install rsyslog.conf template 2016-10-11 08:43:20 -04:00
David Disseldorp
bafc82e732 dracut.sh: support --tmpdir as a relative path
Dracut changes working directory before attempting to output files under
$DRACUT_TMPDIR , resulting in an IO failure if $DRACUT_TMPDIR is a path
relative to the working directory when dracut was started.

Fixes: https://github.com/dracutdevs/dracut/issues/156

Signed-off-by: David Disseldorp <ddiss@suse.de>
2016-10-10 16:27:47 +02:00
Harald Hoyer
8205c25ef9 Merge pull request #150 from dm0-/master
qemu: include the qemu_fw_cfg kernel module
2016-10-10 11:28:09 +02:00
Harald Hoyer
fea9be7ac1 Merge pull request #154 from honza801/patch-1
Update nfs-lib.sh
2016-09-02 10:07:21 +02:00
Harald Hoyer
c85034c91f caps: make it a non default module 2016-09-02 07:51:55 +02:00
Harald Hoyer
d7c9ad504e TEST-30-ISCSI: add message, that all tests passed 2016-09-02 07:51:55 +02:00
Harald Hoyer
00ca15abbf network: arping2 use 0.0.0.0 as source address 2016-09-02 07:51:55 +02:00
Harald Hoyer
dba974844e test/TEST-30-ISCSI: depend on tgtd and tgtadm
the testsuite now needs tgtd and tgtadm and not iscsi-target
2016-09-02 07:51:55 +02:00
Harald Hoyer
a84c391b87 kernel-modules: add nvme kernel module 2016-09-02 07:51:55 +02:00
Harald Hoyer
86eb0b1b83 dracut-systemd/dracut-mount.service: add DefaultDependencies=no 2016-09-02 07:51:55 +02:00
honza801
69c6435acd Update nfs-lib.sh
anaconda_nfsv6_to_var(): fix options parsing. $1 contains  : at the end, this is done by previous functions.
2016-09-01 15:37:58 +02:00
Harald Hoyer
b05cd20695 Merge pull request #153 from fuhry/livenet-generator-nfs
livenet: support nfs:// urls in livenet-generator
2016-08-26 08:20:25 +02:00
Dan Fuhry
1090a8826a livenet: support nfs:// urls in livenet-generator
This is a further improvement on PR #105 which re-adds support for nfs:// urls to root=live:nfs://... Symptoms prior to applying this patch are that sysroot.mount times out when following the nfs:// syntax for the path to the live image. An additional case is added to livenet-generator to support the nfs protocol.
2016-08-25 17:13:52 -04:00
Harald Hoyer
1a7b71bb14 network:ibft put IPv6 IP in brackets
ip=2620:0052:0000:2220:0226:b9ff:fe81:cde4::[2620:0052:0000:2220:0000:0000:0000:03fe]:64::ibft0:none

should be

ip=[2620:0052:0000:2220:0226:b9ff:fe81:cde4]::[2620:0052:0000:2220:0000:0000:0000:03fe]:64::ibft0:none

https://bugzilla.redhat.com/show_bug.cgi?id=1322592#c19
(cherry picked from commit b8e6c051c6)
2016-08-19 15:49:33 +02:00
Harald Hoyer
5db79ae414 dracut.cmdline.7.asc: document rd.shell=0 for rd.emergency
(cherry picked from commit 1d267fb82c)
2016-08-19 15:49:33 +02:00
Harald Hoyer
f367b73852 dracut.sh: document --hostonly-i18n and --no-hostonly-i18n
show description in --help

https://bugzilla.redhat.com/show_bug.cgi?id=1266448
(cherry picked from commit 91896ab68e)
2016-08-19 15:49:33 +02:00
Harald Hoyer
f47090f918 url-lib: ca-bundle.crt changed to a symlink
use inst() instead of inst_simple()

/etc/pki/tls/certs/ca-bundle.crt is a symlink to
../../ca-trust/extracted/pem/tls-ca-bundle.pem

with inst() we install the original file also.

https://bugzilla.redhat.com/show_bug.cgi?id=1341280
(cherry picked from commit 1b23c6c65c)
2016-08-19 15:49:33 +02:00
Harald Hoyer
e168eeef67 systemd/dracut-cmdline.sh: unset "UNSET" $root
https://bugzilla.redhat.com/show_bug.cgi?id=1365667
caused by commit 9aa224cc

(cherry picked from commit fc77aca7dd)
2016-08-19 15:49:33 +02:00
Harald Hoyer
c7c8c4981a dracut-functions.sh: catch all lvm slaves
add check_vol_slaves_all to be used in check_block_and_slaves_all

otherwise only the first lvm VG member would be processed

(cherry picked from commit 7a7b8c1740)
2016-08-19 15:49:33 +02:00
Harald Hoyer
1de836c763 TEST-20-NFS: remove stale pid file 2016-08-19 15:33:59 +02:00
Xunlei Pang
242c03d6fb network: use require_any_binary instead of require_any_binaries 2016-08-19 13:39:37 +02:00
Harald Hoyer
88f9d6140d nfs: install all nfs modules non-hostonly
If nfs is used, we should include all nfs modules, in the case, where
$host_fs_types contains nfs.

(cherry picked from commit b077d18963)
2016-08-18 12:00:43 +02:00
Harald Hoyer
740c46c022 network: support macaddr in brackets []
ip=ens3:dhcp:1000
ip=ens3:dhcp::54:52:00:ab💿ef
ip=ens3:dhcp::[54:52:00🆎cd:ef]
ip=ens3:dhcp:1000:54:52:00:ab💿ef
ip=ens3:dhcp:1000:[54:52:00🆎cd:ef]

ip=192.168.122.20::192.168.122.1:24:test:ens3:none:1000
ip=192.168.122.20::192.168.122.1:24:test:ens3:none::54:52:00:ab💿ef
ip=192.168.122.20::192.168.122.1:24:test:ens3:none::[54:52:00🆎cd:ef]
ip=192.168.122.20::192.168.122.1:24:test:ens3:none:1000:54:52:00🆎cd:ef
ip=192.168.122.20::192.168.122.1:24:test:ens3:none:1000:[54:52:00🆎cd:ef]

ip=::::test:ens3:dhcp:1000
ip=::::test:ens3:dhcp::54:52:00:ab💿ef
ip=::::test:ens3:dhcp::[54:52:00🆎cd:ef]
ip=::::test:ens3:dhcp:1000:54:52:00:ab💿ef
ip=::::test:ens3:dhcp:1000:[54:52:00🆎cd:ef]

(cherry picked from commit 53e4ab7174)
2016-08-18 11:29:29 +02:00
David Michael
73db316ef2 qemu: include the qemu_fw_cfg kernel module
This adds support for /sys/firmware/qemu_fw_cfg on QEMU guests
started with the -fw_cfg option.
2016-08-16 13:43:18 -07:00
Harald Hoyer
38b9558333 Merge pull request #148 from lnykryn/fips-space
fips-module: add missing space
2016-08-08 14:42:05 +02:00
Lukas Nykryn
1c132d39a6 fips-module: add missing space 2016-07-28 12:33:03 +02:00
Harald Hoyer
c45e856a65 add rd.emergency=[reboot|poweroff|halt]
specifies what action to execute in case of a critical failure
2016-07-22 14:51:03 +02:00
Harald Hoyer
9264b0cba6 Merge pull request #145 from yuwata/dracut-conf
dracut.conf.5.asc: remove duplicate i18n_install_all option
2016-07-20 11:45:37 +02:00
Yu Watanabe
aaaf035aed dracut.conf.5.asc: remove duplicate i18n_install_all option 2016-07-20 18:24:39 +09:00
Harald Hoyer
9853791d37 network: use arping2, if available
fixes https://github.com/dracutdevs/dracut/issues/135
2016-07-14 14:36:04 +02:00
Harald Hoyer
5a3773dbe6 fcoe: check if needed for hostonly
(cherry picked from commit f45726652f)
2016-07-14 13:57:21 +02:00
Harald Hoyer
24113c3a11 dracut-install.c: really add a "/" inbetween destdir and target
using dracut-install with

find . -print0 | xargs dracut-install -D /tmp/test -a

resulted in /tmp/test./.... files
2016-07-14 13:54:04 +02:00
Harald Hoyer
34a42f9f49 fs-lib: f2fs needs crc32 not crc32c
*sigh*
2016-07-08 10:01:52 +02:00
Harald Hoyer
5d4aaaa2a3 Merge pull request #143 from scop/master
dracut.png: Optimize with zopflipng -m
2016-07-07 14:58:28 +02:00
Ville Skyttä
828257dd82 dracut.png: Optimize with zopflipng -m 2016-07-07 13:54:47 +03:00
Harald Hoyer
f8ff380bd5 fs-lib: add crc32c kernel module for f2fs 2016-07-07 09:43:48 +02:00
Harald Hoyer
b1ec9d737f Merge pull request #142 from falbrechtskirchinger/master
systemd: install missing drop-in configs
2016-07-06 09:15:20 +02:00
Florian Albrechtskirchinger
5d013e5e3c systemd: install missing drop-in configs
In host-only mode, install missing drop-in configuration files for
/etc/systemd/{journal.conf,system.conf}.
2016-07-06 07:27:37 +02:00
Peter Robinson
88d8ad663f modules: kernel: add phy and power modules to generic initrd
The phy and power modules are needed by some of the recent ARM
devices that have appeared like CHIP and some exynos devices.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2016-07-04 19:05:01 +02:00
Harald Hoyer
4af4fe4a69 Merge pull request #140 from tpgxyz/f2fs
add support to F2FS filesystem (fsck)
2016-07-04 11:51:14 +02:00
tpg
9f521f76a0 add support to F2FS filesystem (fsck) 2016-06-30 21:26:42 +02:00
Harald Hoyer
3889234f71 dracut.sh: make tmp dirs after the trap function is installed
otherwise a good timed ctrl-c will leave the tmp dir around
2016-06-29 17:32:31 +02:00
Hannes Reinecke
c98d1756f7 40network: Update iBFT scanning code to handle IPv6
IPv6 addresses should be specified in brackets so that the
ip= scanning code doesn't get confused.

References: bnc#887542

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.com>
2016-06-29 17:31:46 +02:00
Harald Hoyer
b039b20ec2 test: correct cmdline reading functions 2016-06-27 12:05:37 +02:00
Harald Hoyer
f8242a6a60 fcoe/cleanup-fcoe.sh: don't copy shm files to state
with systemd version 230, this is not necessary anymore
systemd commit cacf980ed44a28e276a6cc7f8fc41f991e2ab354
because /dev/shm is selinux relabled.
2016-06-27 12:03:55 +02:00
Harald Hoyer
f6fa9ef101 TEST-20-NFS: skip root=/dev/nfs tests with systemd v230 2016-06-23 16:38:17 +02:00
Harald Hoyer
7e51abc81f network/dhclient.conf: add missing commata
options need to be seperated by ,
2016-06-23 16:38:17 +02:00
Harald Hoyer
c000a21c25 dracut-systemd/*.service: conflict with shutdown target
make reboot/poweroff/halt work

also conflict with emergency.target
2016-06-23 16:37:53 +02:00
Harald Hoyer
8261d2367e systemd: add missing -.slice unit 2016-06-22 18:11:28 +02:00
Fabian Vogt
18729719a7 Fix wrong keymap inclusion
For MAP=lt, dracut would choose lt.std.map instead of lt.map.

Signed-off-by: Fabian Vogt <fvogt@suse.com>
2016-06-17 15:03:28 +02:00
Harald Hoyer
36867f1abf test: handle kernel panic in testsuite
- reboot kernel on panic
- qemu don't reboot
2016-06-10 08:53:01 +02:00
Harald Hoyer
0092942531 test/TEST-99-RPM: fixed test suite
- cope with dnf vs yum
- fixed find arguments
- make script fail, if command fails
2016-06-09 18:15:48 +02:00
Harald Hoyer
781f1971c3 cope with "rd.shell=0" in the testsuite
If emergency and shutdown-emergency hooks are called, the systemd should
poweroff the testsuite, therefore "rd.shell=0" is given on the test
suite kernel command lines.

"rd.shell=0" has to be parsed correctly by the test suite real root init
also.
2016-06-08 16:48:07 +02:00
Harald Hoyer
3847bd450d systemd: add udev.hwdb and udev.conf 2016-06-08 16:47:41 +02:00
Harald Hoyer
8fce2c4d5e dracut-systemd/dracut-emergency.sh: call shutdown-emergency hooks
if no rd.shell is given
2016-06-07 14:47:27 +02:00
Harald Hoyer
9e19c0512d Revert "network: remove awk call and replace it with a shell function"
This reverts commit 71867b665c.

network needs posix shell
2016-06-07 14:27:35 +02:00
Harald Hoyer
4e882b8090 use shutdown-emergency hook in testsuite to poweroff the machine 2016-06-07 14:27:03 +02:00
Harald Hoyer
8e01095755 dracut-init.sh: set default firmware path, if not specified 2016-06-07 14:27:03 +02:00
Colin Guthrie
99b70a787c systemd: add more groups to deal with tmpfiles handling.
Both 'utmp' and 'root' groups are mentioned in tmpfiles.d/systemd.conf
and as such should be included.

It's probably better to have something equiv to inst_rule_group_owner()
for udev rules which parses out users and groups and adds them to the
passwd/group db respectively.

Could also rely on sysusers but as the initramfs is static in this
sense, it's more efficient to pre-define the users IMO.
2016-06-07 12:04:13 +02:00
Harald Hoyer
71867b665c network: remove awk call and replace it with a shell function
changes commit 4fa5c235a7
2016-06-07 11:15:07 +02:00
Harald Hoyer
f3355208f9 Merge pull request #137 from dracut-mailing-devs/1461665111-7385-2-git-send-email-xlpang@redhat.com
1461665111 7385 2 git send email xlpang@redhat.com
2016-06-07 11:08:12 +02:00
Nicolas Chauvet
2602a74edf dracut: Add drivers/clk by default on arm
This will bundle clock drivers into the initramfs on arm

Tested on ti dm8148-t410 where adpll is needed on 4.6+ kernel
This will avoid to rely on (maybe broken) bootloader clocks.

Theses modules are also usually loaded early. Having them bundled into
the initramfs will avoid lot of deferred probes and others delay.

Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>
2016-06-07 10:48:49 +02:00
Colin Guthrie
55b99a0e4c dracut.sh: fix $tmpfilesdir fallback when systemd-devel is not installed.
Bug introduced in 3a04bddeed in Dec 2014.
2016-06-07 10:48:49 +02:00
Harald Hoyer
d4efc0aeee systemd-initrd: add initrd-root-device.target 2016-05-25 15:07:08 +02:00
Harald Hoyer
1901500187 move ln_r() to dracut-init.sh 2016-05-25 15:07:08 +02:00
Imran Haider
292548be6e add 'mtu' parameter for bond options
Signed-off-by: Imran Haider <imran1008@gmail.com>
2016-05-16 00:16:47 -04:00
Harald Hoyer
d6145ece6d Merge pull request #128 from AlexanderKurtz/master
dracut-systemd/dracut-cmdline.sh: Don't error out if there is no root…
2016-05-11 09:23:05 +02:00
Alexander Kurtz
016613c774 dracut-systemd/dracut-cmdline.sh: Don't error out if there is no root= argument.
Thanks to systemd's gpt-auto-generator [0] (which implements the Discoverable
Partitions Specification [1]), it is no longer necessary to always specify the
root= argument.

However, dracut would still refuse to boot if there was no root= argument (or
if it was set to the special value "gpt-auto" [2]). This commit stops dracut
from aborting the boot process in these cases and simply lets systemd do its
magic.

[0] https://github.com/systemd/systemd/blob/v229/src/gpt-auto-generator
[1] https://www.freedesktop.org/wiki/Specifications/DiscoverablePartitionsSpec/
[2] https://github.com/systemd/systemd/blob/v229/src/gpt-auto-generator/gpt-auto-generator.c#L928
2016-05-06 17:53:36 +02:00
Harald Hoyer
a365b67db0 Merge pull request #127 from Keruspe/master
configure: don't hardcode pkg-config
2016-05-04 11:13:54 +02:00
Marc-Antoine Perennou
699414f5a5 configure: don't hardcode pkg-config
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2016-05-04 10:18:54 +02:00
Harald Hoyer
ab4cccf2a7 Merge pull request #126 from AnchorCat/volatile-journal
systemd: ensure journal is volatile
2016-05-04 09:25:37 +02:00
Michael Chapman
5dea430e08 systemd: ensure journal is volatile
If journald.conf already contains Storage=persistent, journald will
write to /var/log/journal/, which ends up at /run/initramfs/log/journal/
after switching root. We want to make sure early boot logs are written
to /run/log/journal/ so they can be flushed to /var/log/journal/ after
switching root.
2016-05-04 10:49:56 +10:00
Harald Hoyer
e4749a35e5 Merge pull request #125 from rubenk/patch-1
Fix small typo in dracut.cmdline(7)
2016-04-29 15:52:17 +02:00
Ruben Kerkhof
ae753baec0 Fix small typo in dracut.cmdline(7) 2016-04-29 15:34:47 +02:00
Harald Hoyer
7b79d63fa4 Merge pull request #124 from glensc/os-release-dir
ensure parent dir for /usr/lib/initrd-release exists
2016-04-27 13:04:43 +02:00
Elan Ruusamäe
bb44294b62 ensure parent dir for /usr/lib/initrd-release exists 2016-04-27 13:08:42 +03:00
Xunlei Pang
4fa5c235a7 network/net-lib.sh: delete duplicated DNS items from "/etc/resolv.conf"
Users can pass the DNS information throught "nameserver=" cmdline,
there maybe duplicated inputs.

"/etc/resolv.conf" have some restrictions on the number of DNS items
effective, so make sure that this file contains no duplicated items.

We achieve this by simply making the file have no duplicated lines.

Signed-off-by: Xunlei Pang <xlpang@redhat.com>
2016-04-26 13:03:30 +02:00
Xunlei Pang
cf376023e6 network: dhcp before parsing specified dns through cmdline
I met a problem when passing kdump dns to dracut via "nameserver=x.x.x.x",
the dns I provided didn't appear in the "/etc/resolv.conf".

After some debugging, found that when setup dhcp DNS, in setup_interface()
and setup_interface6(), it has:
    echo "search $search $domain" > /tmp/net.$netif.resolv.conf

So if "$search $domain" isn't NULL(this is ture in my kdump environment),
the dns contents(that is, dns1, dns2, nameserver) in "ifup" before dhcp
will be discarded.

This patch addresses it by handling dhcp first. In fact this is also the
way the NetworkManager in 1st kernel works.

Signed-off-by: Xunlei Pang <xlpang@redhat.com>
2016-04-26 13:03:30 +02:00
Guido Trentalancia
5f91ed0b53 dracut: 10i18n: support default loadkeys/setfont data paths using symbolic links
Avoid keymap/font not found error when loadkeys/setfont
are compiled with the default data directory path.

Signed-off-by: Guido Trentalancia <guido@trentalancia.net>
2016-04-21 14:14:31 +02:00
Harald Hoyer
bf75218e45 watchdog: start traversing the device tree from the right directory
start with the device subtree, not with the parent of it
2016-04-18 15:50:42 +02:00
Harald Hoyer
fe83231e30 watchdog: clean return of installkernel()
return 0, otherwise if _alldrivers is empty, the return code is fail
2016-04-18 15:50:33 +02:00
Harald Hoyer
3f60444ec1 removed obsolete kernel module functions and host_modules variable
module_is_host_only()
find_kernel_modules_by_path()
find_kernel_modules()
2016-04-15 16:48:13 +02:00
Harald Hoyer
eab32bda80 dracut-install: make use of _cleanup_ macros and improve hostonly check
If a module is renamed or another module takes care of the old one,
all of the alias strings have to be checked against the current set of
loaded modules.

This is still incomplete, because to be absolutely correct, all the
/sys/*...*/modalias files would have to be checked, if they match the
modules alias strings.
2016-04-15 16:48:13 +02:00
Harald Hoyer
fa295f0bcd dracut_install: honor --silent flag 2016-04-15 15:25:27 +02:00
Harald Hoyer
0297fdcb3e Merge pull request #123 from dracut-mailing-devs/40374262.eB5p3XdtTH@linux-lm3i.site
Correctly handle module aliases
2016-04-15 12:05:44 +02:00
Harald Hoyer
9d74747f92 drop to shell on die() if rd.shell=1 is set explicitly 2016-04-15 12:03:03 +02:00
Harald Hoyer
74e2d1e69f watchdog/module-setup.sh: rewrite
- use local variables with _
- use associative array for the kernel modules
- install emergency hook even in the systemd case
- follow device path until /sys is reached
- set kernel version for modprobe checking
2016-04-15 11:47:59 +02:00
Harald Hoyer
ad438af207 Merge pull request #121 from dracut-mailing-devs/2751555c29f26f69a63888745513edeceb39d416.1458099200.git.panand@redhat.com
Install kernel module for active watchdog
2016-04-15 10:56:31 +02:00
Guido Trentalancia
f3f019d947 95resume: avoid possible symbolic link creation error on bootup
Avoid symbolic link creation error.
2016-04-15 10:38:04 +02:00
Harald Hoyer
2db14045c1 kate config 2016-04-15 10:27:48 +02:00
Harald Hoyer
db7d61cff7 base/init.sh: don't mount /run with noexec, if the initramfs lives there
If the initramfs was built with prefix=/run/... /run can't be mounted
with noexec, otherwise no binary can be run.

Guard against it by looking where /bin/sh is really located.
2016-04-14 14:58:34 +02:00
Harald Hoyer
b99e72427b Revert "fcoe: no need to copy lldpad state"
This reverts commit e93ff1cf9a.

seems like the file has to be copied back in the real root.

https://bugzilla.redhat.com/show_bug.cgi?id=1246217
2016-04-14 13:38:24 +02:00
Harald Hoyer
6fcd5c8e3b NEWS: update for 045 2016-04-14 11:53:14 +02:00
Harald Hoyer
b14b039e90 dracut-install: add --help documentation 2016-04-14 11:51:36 +02:00
Harald Hoyer
7ef36aef28 plymouth/plymouth-pretrigger.sh: also trigger acpi subsystem
Trigger the acpi subsystem. This will ensure hv_vmbus gets loaded before
plymouth is started, which will make the graphics device become
available before plymouth is started too (and the keyboard ! which might
also be important for plymouth in some setups).

https://bugzilla.redhat.com/show_bug.cgi?id=1218130
(cherry picked from commit d2846fdcce)
2016-04-13 14:11:17 +02:00
Harald Hoyer
9bb030c5d8 dracut-init.sh: beautify instmods() 2016-04-13 14:00:26 +02:00
Harald Hoyer
fe6e0c23ad dracut-install: simplify error logic
error out early, if "--optional" is not set
2016-04-13 13:56:52 +02:00
Harald Hoyer
8d9ab2755d Fix regressions with dracut-install with kernel modules
Make sure, the same modules are installed as before.
2016-04-13 11:47:20 +02:00
Harald Hoyer
607fec3e79 Use pkg-config for libkmod CFLAGS and LIBS 2016-04-13 11:13:32 +02:00
Harald Hoyer
794b2d2c75 Use dracut-install to install kernel modules
dracut-install can now install kernel modules and their corresponding
firmware files.
2016-04-11 16:32:10 +02:00
Harald Hoyer
ff8f702689 dracut-init.sh: mark error messages with FAILED 2016-04-11 15:25:11 +02:00
Harald Hoyer
98fd06934c lsinitrd.sh: fixed unpack and skipcpio search 2016-04-11 15:24:01 +02:00
Harald Hoyer
374ef3ed2b dracut-init.sh: Add file argument to sed's
fixup for 06a1d07690
2016-04-11 13:37:17 +02:00
Harald Hoyer
f7f5b82b43 dracut.sh: call dracut-install with "-f" in FIPS mode
in fips mode, dracut-install was called with "-H" instead of "-f" in
FIPS mode

missed conversion of commit 26cd262a6a
2016-04-11 11:57:30 +02:00
Harald Hoyer
c395993eaf Merge pull request #122 from scop/fixes
Various shell script improvements
2016-03-29 11:19:58 +02:00
Ville Skyttä
06a1d07690 dracut-init.sh: Simplify udev rule grepping 2016-03-28 12:09:06 +03:00
Ville Skyttä
bcabe0fe25 Clean up some bashisms from /bin/sh scripts 2016-03-28 11:52:14 +03:00
Ville Skyttä
dec3dfa4b3 nfs/module-setup.sh: Use colon instead of dot for chown user/group separator 2016-03-28 11:39:36 +03:00
Ville Skyttä
9430ae301e Do not use deprecated egrep/fgrep 2016-03-28 11:38:34 +03:00
Harald Hoyer
97bbba6938 lsinitrd: add "--unpack" to lsinitrd
also "--unpackearly" and "--verbose"
2016-03-17 14:45:24 +01:00
Pratyush Anand
e343c85763 watchdog: ensure that module is loaded as early as possible
It is expected that a watchdog module will disable an active watchdog when
its probe is called ie, when it is loaded. So an early load of the module
will help to disable it earlier.
This can be helpful in some corner cases where kdump and watchdog daemon
both are active.

Testing:
    -- When watchdog kernel modules were added
	# dracut --no-hostonly initramfs-test.img -a watchdog
	# lsinitrd initramfs-test.img -f etc/cmdline.d/00-watchdog.conf
 	rd.driver.pre=iTCO_wdt,lpc_ich,

Signed-off-by: Pratyush Anand <panand@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Harald Hoyer <harald@redhat.com>
2016-03-16 05:05:51 +01:00
Pratyush Anand
3aac682744 watchdog: install module for active watchdog
Recently following patches have been added in upstream Linux kernel, which
(1) fixes parent of watchdog_device so that
/sys/class/watchdog/watchdogn/device is populated. (2) adds some sysfs
device attributes so that different watchdog status can be read.

http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=6551881c86c791237a3bebf11eb3bd70b60ea782
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=906d7a5cfeda508e7361f021605579a00cd82815
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=33b711269ade3f6bc9d9d15e4343e6fa922d999b

With the above support, now we can find out whether a watchdog is active or
not. We can also find out the driver/module responsible for that watchdog
device.

Proposed patch uses above support and then adds module of active watchdog
in initramfs generated by dracut for hostonly mode. Kernel module for
inactive watchdog will be added as well for none hostonly mode.

When an user does not want to add kernel module, then one should exclude
complete dracut watchdog module with --omit.

Testing:
-- When watchdog is active watchdog modules were added
	# cat /sys/class/watchdog/watchdog0/identity
	iTCO_wdt
	# cat /sys/class/watchdog/watchdog0/state
	active
	# dracut --hostonly initramfs-test.img -a watchdog
	# lsinitrd initramfs-test.img | grep iTCO
	-rw-r--r--   1 root     root         9100 Feb 24 09:19 usr/lib/modules/.../kernel/drivers/watchdog/iTCO_vendor_support.ko
	-rw-r--r--   1 root     root        19252 Feb 24 09:19 usr/lib/modules/.../kernel/drivers/watchdog/iTCO_wdt.ko

-- When watchdog is inactive then watchdog modules were not added
	# cat /sys/class/watchdog/watchdog0/state
	inactive
	# dracut --hostonly initramfs-test.img -a watchdog
	# lsinitrd initramfs-test.img | grep iTCO

-- When watchdog is inactive, but no hostonly mode, watchdog modules were added
	# cat /sys/class/watchdog/watchdog0/state
	inactive
	# dracut --no-hostonly initramfs-test.img -a watchdog
	# lsinitrd initramfs-test.img | grep iTCO
	-rw-r--r--   1 root     root         9100 Feb 24 09:19 usr/lib/modules/.../kernel/drivers/watchdog/iTCO_vendor_support.ko
	-rw-r--r--   1 root     root        19252 Feb 24 09:19 usr/lib/modules/.../kernel/drivers/watchdog/iTCO_wdt.ko

Signed-off-by: Pratyush Anand <panand@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Harald Hoyer <harald@redhat.com>
2016-03-16 05:05:51 +01:00
Pratyush Anand
89da227de9 watchdog: Do not add hooks if systemd module is included
When systemd is present, let it manage watchdog feed.

Signed-off-by: Pratyush Anand <panand@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Harald Hoyer <harald@redhat.com>
2016-03-16 05:05:51 +01:00
Harald Hoyer
472928ec3d dracut.conf.5.asc: fix bold 2016-03-14 14:16:12 +01:00
Harald Hoyer
b127294def dracut-install: catch ldd message "cannot execute binary file" 2016-03-14 10:59:29 +01:00
Harald Hoyer
556ff7c76a dracut-systemd/dracut-pre-pivot.sh: Break at switch_root only for bare rd.break
similar to commit ddfea6b54c

Previously, any rd.break=breakpoint would cause a break at the
given breakpoint and also at switch_root.
2016-03-07 12:38:23 +01:00
Harald Hoyer
cb6d49bc9d Merge branch 'master' of github.com:haraldh/dracut 2016-02-29 15:07:41 +01:00
Harald Hoyer
caf12d6717 network/dhclient-script.sh: add classless-static-routes support
https://bugzilla.redhat.com/show_bug.cgi?id=1260955
(cherry picked from commit a48ea27deb)
2016-02-29 15:01:50 +01:00
Harald Hoyer
fe6455a6e8 documentation: "--hostonly-i18n" "--no-hostonly-i18n" "i18n_install_all" 2016-02-29 13:12:02 +01:00
Harald Hoyer
4d3e54e01a Merge pull request #116 from evverx/fix-ask-cmdline-hostonly=0
base/init.sh: don't remove 99-cmdline-ask on 'hostonly' cleanup
2016-02-16 15:16:04 +01:00
Harald Hoyer
6a97d2fc89 Merge pull request #115 from evverx/fix-dracut-cmdline-ask-service
dracut-systemd/dracut-cmdline-ask: fix dracut --kernel-cmdline=rd.cmdline=ask
2016-02-16 09:52:27 +01:00
Evgeny Vereshchagin
4ab6447c2a base/init.sh: don't remove 99-cmdline-ask on 'hostonly' cleanup
How to reproduce:
host# ./dracut.sh -o 'dracut-systemd systemd systemd-initrd' --local -f ./initramfs.img

host# qemu-system-x86_64 -initrd ./initramfs.img \
    -append 'root=/dev/sda1 rd.cmdline=ask rd.hostonly=0' \
    ...

Enter additional kernel command line parameter (end with ctrl-d or .)
> rd.break
> .
...
There is no "Break before switch_root"
...

Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2016-02-15 13:57:27 +00:00
Evgeny Vereshchagin
eddca3c9c2 dracut-systemd/dracut-cmdline-ask: fix dracut --kernel-cmdline=rd.cmdline=ask
How to reproduce:

host# dracut --kernel-cmdline='rd.cmdline=ask' initramfs.img
host# qemu-system-x86_64 -initrd initramfs.img ... -append root=/dev/sda1 ...
...

qemu-host# journalctl -b | grep dracut-cmdline-ask
...
Feb 15 08:45:36 localhost systemd[1]: dracut-cmdline-ask.service: Installed new job dracut-cmdline-ask.service/start as 42
Feb 15 08:45:36 localhost systemd[1]: dracut-cmdline-ask.service: ConditionKernelCommandLine=rd.cmdline=ask failed.
Feb 15 08:45:36 localhost systemd[1]: dracut-cmdline-ask.service: Starting requested but condition failed. Not starting unit.
Feb 15 08:45:36 localhost systemd[1]: dracut-cmdline-ask.service: Job dracut-cmdline-ask.service/start finished, result=done
...

Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2016-02-15 08:47:47 +00:00
Harald Hoyer
6bc2096cf5 kernel-modules: join instmods and install all usb/storage 2016-01-26 14:59:28 +01:00
Harald Hoyer
b4dd861a0b kernel-modules: add usb-storage
To save the rdsosreport.txt to a USB stick, the usb-storage module is
needed
2016-01-26 14:56:05 +01:00
Harald Hoyer
f4f8fb5c10 network: if rd.neednet=0 we don't need a bootdev
otherwise dracut would wait for the bootdev interface to appear and be
setup
2016-01-26 12:26:03 +01:00
Fabian Vogt
43819af68c Correctly handle module aliases
Handle module aliases correctly to not generate unbootable
initrds with different kernel versions when modules were renamed
or replaced.

Signed-off-by: Fabian Vogt <fvogt@suse.com>
2016-01-21 18:02:40 +01:00
Harald Hoyer
9542f2fee4 network: add mtu to list of variables to store in override 2016-01-19 15:12:39 +01:00
Harald Hoyer
bb1b924792 TEST-30-ISCSI: some tests have unknown return code
by design
2016-01-19 14:43:43 +01:00
Harald Hoyer
24a78b2697 Fixed vlan, bonding, bridging, team logic
Call ifup for the slaves and assemble afterwards.
2016-01-19 11:35:23 +01:00
Harald Hoyer
918fbfcf6b Merge pull request #111 from wyrmiyu/multipath_fix
multipath: fix majmin_to_mpath_dev()
2016-01-19 10:16:13 +01:00
Pekka Wallendahl
28058a2e37 multipath: fix majmin_to_mpath_dev()
* Multipath device names only start with the mpath-prefix if the option
  use_userfriendly_names is set true in /etc/multipath.conf and if user
  has not set any aliases in the said file. Thus the for-loop should go
  through all files in /dev/mapper/, not just ones starting with 'mpath'

* Bash is perfectly capable to extend `/dev/mapper/*` notation without a
  need to pass it to an external ls

* Changed the function to use a local variable $_dev instead of the
  global $dev, which seemed to be the original intention as the local
  _dev was defined but not used
2016-01-18 20:28:22 +02:00
Harald Hoyer
2fd8588da5 dracut-functions.sh:fix check_vol_slaves() volume group name stripping
commit 466a59984a removed whitespace
stripping from lvm volume group names.
2016-01-18 17:01:15 +01:00
Harald Hoyer
efbc47b8e4 network/net-lib.sh: correctly set mac address for ip=...:<mtu>:<mac>
if ip=...:<mtu>:<mac> was specified, macadress was not set
2016-01-13 13:43:38 +01:00
Harald Hoyer
b019952f6d dracut.sh: fail hard, if we find modules and modules.dep is missing
If modules are present in /lib/modules/<kernelversion> and modules.dep
is empty, depmod was not run most likely.
2016-01-13 09:32:24 +01:00
Harald Hoyer
0a7d7f6310 dracut.cmdline: remove extra ":" from ip= doc 2016-01-13 09:17:40 +01:00
Harald Hoyer
60928f36b6 dracut.sh: restorecon final image file
Instead of "mv" use "cp --reflink=auto" and restorecon the final image
2016-01-08 11:37:25 +01:00
Harald Hoyer
e93ff1cf9a fcoe: no need to copy lldpad state
/dev/shm should be available later on by the normal switch root bind mount.
2016-01-07 10:44:31 +01:00
Harald Hoyer
3f5e60bfc9 Merge pull request #109 from puleglot/fix_dev_unit_name
base/dracut-lib.sh:dev_unit_name() guard against $dev beginning with "-"
2016-01-07 10:13:45 +01:00
Harald Hoyer
07149fe6be nbd: add missing generator 2016-01-07 09:56:36 +01:00
Alexander Tsoy
c41df7e1db base/dracut-lib.sh:dev_unit_name() guard against $dev beginning with "-"
crypt/parse-crypt.sh generate initqueue job which always call
dev_unit_name() with an argument beginning with "-". This results
in the following error:

dracut-initqueue[307]: + systemd-escape -p -cfb4aa43-2f02-4c6b-a313-60ea99288087
dracut-initqueue[307]: systemd-escape: invalid option -- 'c'
2016-01-05 22:59:52 +03:00
Harald Hoyer
b8bccd398a test/TEST-04-FULL-SYSTEMD: optionally install machine-info and *-id 2015-12-14 15:19:53 +01:00
Harald Hoyer
b830a31331 TEST-16-DMSQUASH: do not use "--" with ldconfig -r 2015-12-14 15:19:53 +01:00
Harald Hoyer
b070c1d360 nbd: add systemd generator and use nbd export names instead of port numbers
Add a systemd generator for root=nbd:.. so that systemd has a correct
sysroot.mount unit.

Use export names instead of port numbers, because port number based
exports are deprecated and were removed.
2015-12-14 15:19:53 +01:00
Harald Hoyer
df95b1003c network: fix carrier detection
rename iface_has_link() to iface_has_carrier() to clarify usage

Only assign static "wildcard interface" settings, if the interface has a
carrier.

If the interface name was specified with a name, do not do carrier
checking for static configurations.
2015-12-14 15:19:53 +01:00
Harald Hoyer
efd3a6db74 livenet/module-setup.sh: only include systemd generator if systemd included 2015-12-14 15:19:53 +01:00
Harald Hoyer
4bcd41389c systemd: include machine-info 2015-12-14 15:19:53 +01:00
Harald Hoyer
8d26b5661e kernel-modules: include all HID driver in hostonly mode
If a kernel is updated in the undocked state and later on docked, some
keyboard modules can be missing.

Thus include all HID drivers.
2015-12-09 14:14:46 +01:00
Harald Hoyer
ce9a398771 dmsquash-live/dmsquash-live-root.sh: SQUASHED can be set earlier
8b5ee88ff6 removed the check for SQUASHED,
assuming, that the if clause above was the only place, where SQUASHED is
set.

This patch reverts to the old logic, because SQUASHED can be set
earlier.
2015-12-01 08:52:00 +01:00
Harald Hoyer
54e09dfb72 shutdown: guard against read-only /run
remount the switch rooted /run writeable again.
2015-11-30 11:27:03 +01:00
Harald Hoyer
88ba9372be livenet/livenet-generator.sh: mode 0755 2015-11-27 09:44:24 +01:00
Harald Hoyer
5d8d0ac814 dmraid/61-dmraid-imsm.rules: add nowatch option for udev
udev rereads partitions, if watch is set for disks
2015-11-26 17:46:03 +01:00
Harald Hoyer
6ed1d9fd07 dmsquash-live/dmsquash-live-root.sh: fixed typo 2015-11-26 15:50:39 +01:00
Harald Hoyer
6612ae0d36 NEWS: update for version 044 2015-11-25 14:22:28 +01:00
Harald Hoyer
616fdae3cf AUTHORS: update 2015-11-25 14:22:28 +01:00
Harald Hoyer
eb242ada05 dmraid/61-dmraid-imsm.rules: remove double "," 2015-11-25 14:21:33 +01:00
Harald Hoyer
4916bf1a58 lvm: silence errors from "lvm dumpconfig"
if the config option does not exist, we ignore the error anyway
2015-11-25 14:21:33 +01:00
Harald Hoyer
319867faa8 man: clarify add_dracutmodules vs dracutmodules 2015-11-25 14:21:33 +01:00
Harald Hoyer
87e90d7f4a For rd.hostonly=0 remove all initqueue/finished files also
This helps booting systems with changed configuration
2015-11-25 14:21:33 +01:00
Harald Hoyer
2249e7312e Makefile: add efi target
make an UEFI bootable image
2015-11-25 14:21:33 +01:00
Harald Hoyer
62c00a8896 dracut.sh: only create one TMPDIR
use DRACUT_TMPDIR subdirs for everything
2015-11-25 14:21:33 +01:00
Harald Hoyer
1a2290ea79 Revert "systemd: if kdbus is available, include the kernel module"
This reverts commit 90ff5ad67e.

There will be no kdbus anymore :-/
2015-11-23 11:08:06 +01:00
Harald Hoyer
03de49609c Merge pull request #97 from FGrose/dmsquash-live-root
dmsquash-live-root:  Persistence without overlay for uncompressed live installations
2015-11-23 11:07:43 +01:00
Harald Hoyer
e330912be5 Merge pull request #106 from FGrose/dracut.cmdline
dracut.cmdline:  Update Booting live images section
2015-11-23 10:05:51 +01:00
Frederick Grose
33a4198e17 dracut.cmdline: Update Booting live images section
Add descriptions for the rd.live.overlay.readonly,
rd.live.overlay.size, rd.live.overlay.reset,
rd.live.squashimg, and rd.live.overlay=none options.
Mention the Invalid mark on exhausted overlays.
Clarify the rd.writable.fsimg option.
Repunctuate the rd.live.overlay.thin option description.
2015-11-22 15:02:55 -05:00
Frederick Grose
8b5ee88ff6 dmsquash-live-root: Avoid an overlay for persistent, uncompressed, read-write live installations.
Persistent, uncompressed live installations can avoid overlays with a new rd.live.overlay=none flag.
Non-persistent rd.live.ram boots can also take advantage of persistent home.img filesystems.
2015-11-20 23:38:12 -05:00
Harald Hoyer
2bcf4ffe5f Merge pull request #105 from antonym/master
livenet: add livenet-generator
2015-11-19 16:35:29 +01:00
Antony Messerli
a455ad1c27 livenet: add livenet-generator
Resolves issues where systemd attempts to boot a live URL as an NFS mount.

This patch uses systemd's generator arg[2] to generate an early sysroot.mount
that preempts systemd-fstab-generator.

See https://bugzilla.redhat.com/show_bug.cgi?id=1280103
2015-11-19 08:10:03 -06:00
Harald Hoyer
c44d2252bb dracut.sh: for microcode generation, skip gpg files
skip all ".asc" files for the AMD microcode generation
2015-11-18 10:58:54 +01:00
Harald Hoyer
90ac2d2429 TEST-16-DMSQUASH: add code for IO throtteling in qemu
To test the mediacheck feature, I added commented out code with qemu IO
throtteling.
2015-11-18 10:17:04 +01:00
Harald Hoyer
27d7936f0e dracut.sh: save systemdutildir env
even, if no systemd is used, we need that variable for systemd-udevd
2015-11-17 09:45:29 +01: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
63a44c8dc3 dracut.sh: add back host_modules part
host_modules was removed accidently while remove host_modaliases
2015-11-16 09:26:51 +01:00
Harald Hoyer
602dce9ff2 iscsi/parse-iscsiroot.sh: reload udev rules
in the DHCP case udev is already running, so reload the rules before
continuing.
2015-11-13 16:37:48 +01:00
Harald Hoyer
456f299ab8 dracut-init.sh: libdir paths need dracut-function.sh 2015-11-13 14:20:54 +01:00
Zhiguo Deng
7527b90c88 Check rd.zfcp= format in dracut hook:cmdline process stage
When using rd.zfcp= parameter in generic.prm file, wrong format
parameters will prevent the zfcp driver to add the correct SCSI
disk. dracut should die when a wrong rd.zfcp= parameter supplied.

Signed-off-by: Zhiguo Deng <bjzgdeng@linux.vnet.ibm.com>
2015-11-13 14:02:19 +01:00
Harald Hoyer
07a081f352 dracut.sh: remove the concept of host_modalias
We can never gather enough information about compiled in modules, so
don't pretend to know and do smart decisions.
2015-11-13 13:40:38 +01:00
dyoung@redhat.com
6870007674 Revert "Let user specify the action after fail"
This reverts commit 9d787df196

action_on_fail is useless thus remove the commits for it one by one.

Signed-off-by: Dave Young <dyoung@redhat.com>
2015-11-13 13:22:34 +01:00
dyoung@redhat.com
d6dfde7830 Revert "99fs-lib/fs-lib.sh: Let user specify the action after fail for fsck"
This reverts commit 679fa7ed3c.

action_on_fail is useless thus remove the commits for it one by one.

Signed-off-by: Dave Young <dyoung@redhat.com>
2015-11-13 13:22:34 +01:00
dyoung@redhat.com
946722e465 Revert "dracut-emergency.service: do not start for "action_on_fail=continue""
This reverts commit b78e6ac2c3.

action_on_fail is useless thus remove the commits for it one by one.

Signed-off-by: Dave Young <dyoung@redhat.com>
2015-11-13 13:22:34 +01:00
dyoung@redhat.com
a95a727fdc Revert "systemd/emergency.service: do not run for action_on_fail=continue"
This reverts commit dcae873414.

action_on_fail is useless thus remove the commits for it one by one.

Signed-off-by: Dave Young <dyoung@redhat.com>
2015-11-13 13:22:34 +01:00
dyoung@redhat.com
927d1e28c9 Revert "rename kernel command line param action_on_fail to rd.action_on_fail"
This reverts commit 391d605790.

action_on_fail is useless thus remove the commits for it one by one.

Signed-off-by: Dave Young <dyoung@redhat.com>
2015-11-13 13:22:34 +01:00
dyoung@redhat.com
74c9fb947b Revert "Change the implementation of action_on_fail"
This reverts commit d2765b5175.

action_on_fail is useless thus remove the commits for it one by one.

Signed-off-by: Dave Young <dyoung@redhat.com>
2015-11-13 13:22:34 +01:00
Fabian
edbd9ca058 dracut.sh: Support --mount with just mountpoint as parameter
Right now the --mount parameter of dracut expects a rather long fstab-like
line. This makes it possible to invoke dracut with e.g. --mount /boot.
2015-11-13 13:21:43 +01:00
Mei Liu
dcc2a4344b Add awk and getopt as dependencies of znetconf
znetconf command is part of s390utils-base package. It depends on
awk and getopt.

This patch is used to fix the following error:

dracut:/#
znetconf -c

/usr/sbin/znetconf: line 70: awk: command not found
/usr/sbin/znetconf: line 1138: getopt: command not found

Signed-off-by: Mei Liu <liumbj@linux.vnet.ibm.com>
2015-11-13 13:18:11 +01:00
Harald Hoyer
ed92ecaa3c iscsi: only systemctl try-restart iscsid, if systemd is used 2015-11-13 13:16:10 +01:00
Harald Hoyer
98e9db2755 iscsi/iscsiroot.sh: put variables in quotes
best practice
2015-11-13 13:15:05 +01:00
Harald Hoyer
4a6c14f987 repro squash 2015-11-13 13:14:05 +01:00
Harald Hoyer
561eb42f39 reduce dracut-functions.sh and add to dracut-init.sh
move all dracut specific functions to dracut-init.sh
2015-11-13 13:06:01 +01:00
Harald Hoyer
10f8df1bdf add --no-reproducible to turn off reproducible mode
Also warn about cpio not supporting it and turn it on by default for
fedora.
2015-11-13 11:53:36 +01:00
Harald Hoyer
35a666d02a dracut-systemd/rootfs-generator.sh: s/RequiresOverridable/Requires
RequiresOverridable will be deprecated
2015-11-13 10:13:08 +01:00
Harald Hoyer
5b43377d74 network/ifup.sh: skip empty nameserver values
(cherry picked from commit e658251173)
2015-11-11 16:49:47 +01:00
Harald Hoyer
ecdee70c48 base/dracut-lib.sh:getargs() don't return 1 for empty values
getargs() is only used with real values and not booleans.

So, return the values only.

(cherry picked from commit d1f7f2ac04)
2015-11-11 16:49:09 +01:00
Harald Hoyer
b44156c6fc dracut.sh: fixed typo in microcode generation
(cherry picked from commit a594b4e357)
2015-11-11 16:47:48 +01:00
Harald Hoyer
a49c1f049b network:wait_for_ifup() handle "NO-CARRIER" output
if "NO-CARRIER" is one of the flags, we surely have no link yet.

(cherry picked from commit f059985b14)
2015-11-11 16:47:09 +01:00
Harald Hoyer
efba549a26 dracut.sh: no microcode, if get_ucode_file returns empty file
check, if get_ucode_file() returned an empty string.

(cherry picked from commit 327d765512)
2015-11-11 16:47:03 +01:00
Harald Hoyer
79cb273dc0 iscsi/parse-iscsiroot.sh: correct handling if netroot isn't set
corrects bfe65f913a

(cherry picked from commit 7fd112f20e)
2015-11-11 16:46:54 +01:00
Harald Hoyer
583fb23199 dracut.sh: do not create microcode, if no firmware is available
(cherry picked from commit 13b5c1d09e)
2015-11-11 16:46:16 +01:00
Harald Hoyer
b73e00aff7 dracut.sh: add command line option for install_i18_all
--no-hostonly-i18n -> install_i18n_all=yes
--hostonly-i18n -> install_i18n_all=no

(cherry picked from commit 34b551a1c4)
2015-11-11 16:45:48 +01:00
Harald Hoyer
b5363e834a iscsi/iscsiroot.sh: handle iscsi_firmware in online and timeout queue
The return code of iscsi_firmware is broken, so set the marker
unconditionally.

(cherry picked from commit fd3eddf069)
2015-11-11 16:44:36 +01:00
Harald Hoyer
19b0065cac network/netroot.sh: better handling of $netroot and dhcp
if $netroot is emtpy, get it from cmdline

check cmdline directly for root=dhcp(6) and netroot=dhcp(6)

(cherry picked from commit 17cee31b11)
2015-11-11 16:44:29 +01:00
Harald Hoyer
df087c45d8 iscsi/iscsiroot.sh: use all_ifaces_setup()
we want the route and gateway setup

(cherry picked from commit 7cddfbbadb)
2015-11-11 16:44:20 +01:00
Harald Hoyer
5d90ba4fca network: add all_ifaces_setup()
all_ifaces_up() is true, if all interfaces are up.

all_ifaces_setup() is true, if all interfaces are up and the gateways
and nameserver are setup.

(cherry picked from commit 63e75dc4cd)
2015-11-11 16:44:13 +01:00
Harald Hoyer
e847a78bb6 network/dhclient-script.sh: fix RENEW
Remove check, if interface is already up. It is for RENEW.

new_prefix is apparently new_subnet_mask

(cherry picked from commit 52845b168d)
2015-11-11 16:44:01 +01:00
Harald Hoyer
73833796b4 network: move "ip=ibft" handling to network module
(cherry picked from commit b334c83e4a)
2015-11-11 16:38:49 +01:00
Harald Hoyer
e803d076f8 iscsi/parse-iscsiroot.sh: only set initiator-name, if not empty
(cherry picked from commit eb87dc91d0)
2015-11-11 16:36:25 +01:00
Harald Hoyer
7d47178e0d livenet/livenetroot.sh: fixed error condition
copy&paste error

(cherry picked from commit b813b1b306)
2015-11-11 16:19:56 +01:00
Harald Hoyer
6cfdb5aa1f network/ifup: do DHCP for BOOTDEV
(cherry picked from commit 7316d68353)
2015-11-11 16:19:43 +01:00
Harald Hoyer
29b885b46e network/net-lib.sh: fix IPv6 route parsing
(cherry picked from commit a4c47ce0dd)
2015-11-11 16:19:36 +01:00
Harald Hoyer
42b4fc90f2 network/net-lib.sh: fix wait_for_if_up()
wait for <*UP*> and not "state UP"

state can be UNKNOWN

(cherry picked from commit d8572e0bf4)
2015-11-11 16:19:25 +01:00
Harald Hoyer
b519ae7008 network/ifup: fix warning about not bringing interface up
(cherry picked from commit 70f3c07846)
2015-11-11 16:19:18 +01:00
Harald Hoyer
195b5d0725 cms/cmsifup.sh: do not use ifup -m
we don't want to bring the interface up several times

(cherry picked from commit 0852c38b7a)
2015-11-11 16:19:09 +01:00
Harald Hoyer
686f9675df network/ifup.sh: only use dhcp on unknown interfaces for ip=dhcp
(cherry picked from commit 7c24815034)
2015-11-11 16:18:04 +01:00
Harald Hoyer
26fbe97bbe network: also mark interfaces up with their MAC
(cherry picked from commit 53537f4d23)
2015-11-11 16:17:57 +01:00
Harald Hoyer
744c65939b network/ifup.sh: save return value of ifup
(cherry picked from commit b4006781e8)
2015-11-11 16:17:49 +01:00
Harald Hoyer
3632be079b iscsi/parse-iscsiroot.sh: restart iscsid with try-restart
(cherry picked from commit a6befb52eb)
2015-11-11 16:17:42 +01:00
Harald Hoyer
782e909eef iscsi/parse-iscsiroot.sh: handle firmware in online queue
(cherry picked from commit 7f59cbd318)
2015-11-11 16:17:33 +01:00
Harald Hoyer
27a5aecf56 network/ifup.sh:do_static(): error out, if IP is already assigned
(cherry picked from commit 32770ca79a)
2015-11-11 16:16:09 +01:00
Harald Hoyer
5193198dc9 network/ifup.sh:do_static(): error out, if interface could not be brought up
(cherry picked from commit 77f46adf5e)
2015-11-11 16:15:57 +01:00
Harald Hoyer
c606be49d7 TEST-15-BTRFS: load btrfs module
(cherry picked from commit d9b5a98532)
2015-11-11 16:15:50 +01:00
Harald Hoyer
f939cffdac test/TEST-04-FULL-SYSTEMD/create-root.sh: modprobe btrfs
why so ever... it used to load automatically

(cherry picked from commit 65977ef1d1)
2015-11-11 16:15:41 +01:00
Harald Hoyer
a283636b83 dmraid: only scan once because of one device
(cherry picked from commit 80153acc0f)
2015-11-11 16:15:22 +01:00
Harald Hoyer
4483fff87c network/dhclient: exit arping immediatly, if we get an answer
(cherry picked from commit d6bfa7052a)
2015-11-11 16:15:07 +01:00
Harald Hoyer
c04a321b92 network/net-lib.sh:ibft unset gateway or dns, if set to 0.0.0.0
(cherry picked from commit 942d60d8af)
2015-11-11 16:15:00 +01:00
Harald Hoyer
4a88aaff10 fcoe: cleanup lldpad
Resolves: rhbz#1246217
(cherry picked from commit 69c437dd1c)
2015-11-11 16:14:51 +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
0c004c8e64 network/parse-ip-opts.sh: bind enx* interface to the MAC
do it automatically for the persistent naming scheme

(cherry picked from commit 2eb3b00133)
2015-11-11 15:58:12 +01:00
Harald Hoyer
9ab5ddf16a network/ifup.sh: arping for static IPv4 addresses
(cherry picked from commit 38180271c5)
2015-11-11 15:58:04 +01:00
Harald Hoyer
93b9885a65 network/ifup.sh: let dhcp client run in the background
we need to renew the lease

(cherry picked from commit fb2d643a38)
2015-11-11 15:57:53 +01:00
Harald Hoyer
db7d739818 systemd/dracut-cmdline.sh: print out cmdline in one line
(cherry picked from commit 93a5a3d3ca)
2015-11-11 15:57:36 +01:00
Harald Hoyer
bcbcacb5d6 iscsi: handle timeout case better
(cherry picked from commit bfe65f913a)
2015-11-11 15:56:27 +01:00
Harald Hoyer
0a10d7fc51 TEST-30-ISCSI: fix test to run with new iscsi
(cherry picked from commit 836ca3f47e)
2015-11-11 15:53:48 +01:00
Harald Hoyer
f5753e1861 iscsi/module-setup.sh: iscsid need /var/lib/iscsi
(cherry picked from commit f74b0a9f38)
2015-11-11 15:52:44 +01:00
Harald Hoyer
9af753c468 crypt: install drbg unconditionally in hostonly mode
older kernels had the drbg kernel module and didn't need it

(cherry picked from commit 89948e58fd)
2015-11-11 15:51:46 +01:00
Harald Hoyer
20486a16e9 man page: changed grub.conf to grub2.cfg
(cherry picked from commit 77c0b30825)
2015-11-11 15:47:46 +01:00
Harald Hoyer
848edf22f0 multipath: install all multipath path selector kernel modules
By default, dracut only builds in dm-service-time into the initramfs as
that is the default multipath.conf path selector. If the user changes
the path selector to "round robin" on the fly and runs dracut, multipath
does not find any paths on boot and the user will be dropped into a
shell.

Apparently, in RHEL7 dracut defaults to "hostonly" mode, i.e. modules
not currently in use at the time dracut runs do not get built into
initramfs. This is definitely one case where this doesn't work. A change
to reconfigure multipath probably should not render the system
unbootable.

https://bugzilla.redhat.com/show_bug.cgi?id=1195392
(cherry picked from commit f11d7a81e2)
2015-11-11 15:46:39 +01:00
Harald Hoyer
3913d061c4 livenet: don't attempt to download the image for every interface
https://bugzilla.redhat.com/show_bug.cgi?id=1152485
(cherry picked from commit e5f4bbd804)
2015-11-11 15:45:41 +01:00
Harald Hoyer
cca313fa75 fcoe/fcoe-edd.sh: cleanup the script
- check if modprobe was successful
- add a timeout for /sys/firmware/edd
- only remove the module, if it was loaded by the script

(cherry picked from commit 34203d03c0)
2015-11-11 15:45:14 +01:00
Chris Leech
9a5bd6804a fcoe: EDD parsing patch for i40e
(cherry picked from commit 4031a2fa64)
2015-11-11 15:45:10 +01:00
Chris Leech
4891d9a2ce fcoe: start with fcoemon instead of fipvlan
(cherry picked from commit d02f522089)
2015-11-11 15:33:13 +01:00
Harald Hoyer
2448fbf17b network: add options to tweak timeouts
rd.net.dhcp.retry=<cnt>
     If this option is set, dracut will try to connect via dhcp
     <cnt> times before failing. Default is 1.

 rd.net.timeout.dhcp=<arg>
     If this option is set, dhclient is called with "-timeout <arg>".

 rd.net.timeout.iflink=<seconds>
     Wait <seconds> until link shows up. Default is 60 seconds.

 rd.net.timeout.ifup=<seconds>
     Wait <seconds> until link has state "UP". Default is 20 seconds.

 rd.net.timeout.route=<seconds>
     Wait <seconds> until route shows up. Default is 20 seconds.

 rd.net.timeout.ipv6dad=<seconds>
     Wait <seconds> until IPv6 DAD is finished. Default is 50 seconds.

 rd.net.timeout.ipv6auto=<seconds>
     Wait <seconds> until IPv6 automatic addresses are assigned.
     Default is 40 seconds.

 rd.net.timeout.carrier=<seconds>
     Wait <seconds> until carrier is recognized. Default is 5 seconds.

(cherry picked from commit d8ad687e1a)
2015-11-11 15:26:29 +01:00
Harald Hoyer
6138a45dd2 iscsi/parse-iscsiroot.sh: do not modify netroot
(cherry picked from commit 197e4c90b9)
2015-11-11 15:21:27 +01:00
Harald Hoyer
7391fef29a iscsi/iscsiroot.sh: handle firmware in online queue
otherwise it does not get called, if no netroot is set

(cherry picked from commit 3bd3bbec31)
2015-11-11 15:21:19 +01:00
Harald Hoyer
01430d27d4 dracut.spec: raise systemd requirement to >= 219
needs systemd-escape

(cherry picked from commit 35f40b75e4)
2015-11-11 15:21:03 +01:00
Harald Hoyer
ab57132aa5 initqueue: add online queue
(cherry picked from commit d3f61fb5cd)
2015-11-11 15:20:36 +01:00
Harald Hoyer
6251f82c6f TEST-30-ISCSI: add rd.scsi.firmware
(cherry picked from commit 310574f7ea)
2015-11-11 15:12:05 +01:00
Harald Hoyer
3e1c531b4e Makefile: remove output file before creating it 2015-11-11 12:33:07 +01:00
Harald Hoyer
64c34f3459 dracut-systemd/module-setup.sh: remove duplicate vconsole wants
Adding the dependency on vconsole is already done in the 00systemd
module and the rescue.service has this already in the unit file.
2015-11-11 12:16:13 +01:00
Harald Hoyer
2cc5e92e21 dracut.sh: quote $outfile on error removal 2015-11-11 11:49:34 +01:00
Harald Hoyer
875426f2fc dracut.sh: remove "_EARLY" from CONFIG_MICROCODE_* checks
EARLY is merged in the main driver
2015-11-11 11:48:32 +01:00
Harald Hoyer
53a7384653 lvm: remove all quirk arguments
https://bugzilla.redhat.com/show_bug.cgi?id=742564

Once lvm2 starts using /run (bug 742554), it should be no longer
necessary to disable file-based locking in the vgchange call in
fedora-storage-init.
Removing '--sysinit' will make it safe to call LVM operations
concurrently from other units.

The --sysinit is a compound option consisting of:

  -> --ignorelockingfailure - not needed anymore, the /run/lock/lvm is
available rw soon in boot process

  -> --ignoremonitoring - not needed since /run is available, this would
require the dm-event.service to be run before
fedora-storage-init.service (and new lvm2-activation.service when
deployed). But that's a one line change - I'll have a look whether it
plays well with other services and if yes, I'll commit the change. N.B.:
This has a consequence that all volumes activated on vgchange -ay will
be monitored at the same time they're activated (which is a plus I
think). The lvm2-monitor will just grab all the other volumes not
activated at the time of the boot's vgchange -ay call. But that's not an
issue (for already monitored volumes, calling vgchange --monitor y will
just be a NOOP).

 -> --poll n - not needed, we can run the polldaemon as the /run is
available and rw (in case there's unfinished merge or mirror sync from
previous system run, the poll-daemon will be triggered at boot now).
Actually, the polldaemon should be triggered as a service like dmeventd
is, not forked off from the LVM command itself, like from vgchange in
this case - we still need to change this - there's a bug open for this
request already (bug #814857). However, we don't have this feature ready
yet so I need to check whether this is OK with the early boot process
with the current state.
2015-11-11 11:48:32 +01:00
Harald Hoyer
c97209fe69 fips: add authenc and authencesn kernel modules
https://bugzilla.redhat.com/show_bug.cgi?id=1115112#c5
2015-11-11 11:48:32 +01:00
Harald Hoyer
9befacf0c5 dracut.spec: omit pkg-config from dependencies 2015-11-11 11:48:32 +01:00
Harald Hoyer
8019e0eef3 Makefile: fix VERSION and GITVERSION 2015-11-11 11:48:32 +01:00
Harald Hoyer
3177d12d2b Merge pull request #91 from dracut-mailing-devs/1437470322-992-1-git-send-email-cfan@redhat.com
remove the incomplete .img file
2015-11-11 11:48:21 +01:00
Harald Hoyer
fac92cfbad Merge pull request #100 from d-hatayama/suppress_broken_pipe
lsinitrd: Suppress "cat: write error: Broken pipe"
2015-11-11 11:43:50 +01:00
Harald Hoyer
5593ee7172 Merge pull request #101 from silvio/sfr/pkgfile
Sfr/pkgfile
2015-11-11 11:42:29 +01:00
Harald Hoyer
fc146519f9 Merge pull request #103 from FGrose/metadata
dmsquash-live-root: Use non-persistent metadata snapshots.
2015-11-11 11:36:47 +01:00
Harald Hoyer
87894441c7 Merge pull request #102 from FGrose/Overflow
dmsquash-live-root: Request overflow support for persistent snapshot.
2015-11-11 10:33:33 +01:00
Frederick Grose
49c9d8174f dmsquash-live-root: Use non-persistent metadata snapshots.
Transient snapshots can take advantage of smaller,
   non-persistent metadata structures.
Make the --readonly option explicit rather than inferred
   for the readonly_overlay target.
Assure that the live-base target is on the BASE_LOOPDEV.
2015-11-09 10:46:27 -08:00
Frederick Grose
97be933592 dmsquash-live-root: Request overflow support for persistent snapshot. 2015-11-09 09:45:07 -08:00
Harald Hoyer
8e1c4b354c dracut-logger: prefix stderr output with "dracut: "
dnf updates of the kernel execute dracut in %post.
For the user it is not possible to distinguish the dracut output from
other error messages.
2015-11-09 15:35:53 +01:00
Silvio Fricke
0d5c02d3ab PKGFILE: prevent out of tree builds
With makepkg is it possible to build sources away from the PKGFILE. The
previous behavior was crash on build if this was setup. With this
patch we prevent this possibility.

Signed-off-by: Silvio Fricke <silvio.fricke@gmail.com>
2015-11-08 12:57:33 +01:00
Silvio Fricke
4cca17eeec PKGFILE: version is now completely constructed from git
`pkgver` and `pkgrel` now hard coded to 1. The PKGFILE will getting
changed on a `makepkg`-run.

To prevent some version crashes no commit with changes to `pkgver` and
`pkgrel` should be accepted.

Signed-off-by: Silvio Fricke <silvio.fricke@gmail.com>
2015-11-08 12:56:47 +01:00
Silvio Fricke
eb150a4fee PKGFILE: update to latest makepkg
makepkg needs now a package-section.

Signed-off-by: Silvio Fricke <silvio.fricke@gmail.com>
2015-11-08 12:56:36 +01:00
HATAYAMA Daisuke
3ce142861d lsinitrd: Suppress "cat: write error: Broken pipe"
On systemd, SIGPIPE is ignored by default; see man 5 systemd.exec for
IgnoreSIGPIPE=. As a result, lsinitrd.sh under a systemd service
outputs "cat: write error: Broken pipe" in the processing of
determining a compression format of a given initramfs file using cat
command in the write part of a pipeline processing.

For example, this is a log message of kdump.service in RHEL7.1,

    -- Logs begin at Wed 2015-11-04 09:57:33 JST, end at Wed 2015-11-04 09:58:28 JST. --
    Nov 04 09:57:33 localhost systemd[1]: Stopping Crash recovery kernel arming...
    Nov 04 09:57:33 localhost kdumpctl[22545]: kexec: unloaded kdump kernel
    Nov 04 09:57:33 localhost kdumpctl[22545]: Stopping kdump: [OK]
    Nov 04 09:57:33 localhost systemd[1]: Starting Crash recovery kernel arming...
    Nov 04 09:57:36 localhost kdumpctl[22553]: Detected change(s) in the following file(s):
    Nov 04 09:57:36 localhost kdumpctl[22553]: /etc/kdump.conf
    Nov 04 09:57:36 localhost kdumpctl[22553]: Rebuilding /boot/initramfs-3.10.0-229.el7.x86_64kdump.img
    Nov 04 09:57:40 localhost dracut[24914]: Executing: /usr/sbin/dracut --hostonly --hostonly-cmdline -o "plymouth dash resume" -f /boot/initramfs-3.10.0-229.el7.x86_64kdump.img 3.10.0-229.el7.x86_64
    ...<cut>...
    Nov 04 09:58:12 localhost dracut[24914]: *** Creating image file done ***
    Nov 04 09:58:12 localhost dracut[24914]: Image: /boot/initramfs-3.10.0-229.el7.x86_64kdump.img: 18M
    Nov 04 09:58:12 localhost kdumpctl[22553]: cat: write error: Broken pipe
    Nov 04 09:58:12 localhost dracut[24914]: ========================================================================
    Nov 04 09:58:12 localhost dracut[24914]: Version: dracut-033-240.el7
    Nov 04 09:58:12 localhost dracut[24914]:
    Nov 04 09:58:12 localhost dracut[24914]: Arguments: --hostonly --hostonly-cmdline -o 'plymouth dash resume' -f
    Nov 04 09:58:13 localhost dracut[24914]:
    Nov 04 09:58:13 localhost dracut[24914]: dracut modules:
    Nov 04 09:58:13 localhost dracut[24914]: bash

kdump.service builds and loads an initramfs for kdump kernel using
kdumpctl command which uses dracut command and so lsinitrd command,
too.

Although there's no actual harm except for the error message, there
has been several inquiries from customers about this message so
far. We should suppress this message to reduce needless
communications.

To suppress the message, this commit cleans up the processing of
reading the first 6 bytes of a given initramfs file without cat
command.
2015-11-05 09:53:58 +09:00
Frederick Grose
0ea86cb727 dmsquash-live-root: Use non-persistent metadata snapshots for transient overlays.
Temporary snapshots can take advantage of smaller, non-persistent metadata structures.
Make the --readonly option explicit rather than inferred for the readonly_overlay target.
Assure that the live-base target is on the BASE_LOOPDEV.
2015-10-09 16:23:58 -04:00
Harald Hoyer
9d2a3f80cf Merge pull request #95 from cgwalters/emacs-setq
dir-locals: Avoid use of setq which triggers Emacs warning
2015-09-17 17:54:36 +02:00
Colin Walters
10d03bbfbc dir-locals: Avoid use of setq which triggers Emacs warning
Emacs has a whitelist of "safe" variables, using `setq` overrides
that and causes it to warn when opening any file by default.

Dropping the `setq` makes Emacs do the right thing.
2015-09-17 11:33:40 -04:00
Harald Hoyer
820f81016a dracut.8.asc: mention lsinitrd(1) in see also 2015-09-09 11:30:52 +02:00
Harald Hoyer
eed08b6988 Merge branch 'master' of github.com:haraldh/dracut 2015-09-07 15:13:04 +02:00
Harald Hoyer
a9caf07fb3 Merge pull request #94 from yuwata/master
Fix typos in error module messages and usage of install blob.
2015-09-07 15:12:49 +02:00
yuwata
fc212358da install blob: fix typos in usage. 2015-09-07 18:00:16 +09:00
yuwata
0888cf51ab systemd-networkd: fix typo in error message 2015-09-07 17:58:40 +09:00
yuwata
5cb1e0efea systemd-initrd: fix typo in error message. 2015-09-07 17:58:00 +09:00
Harald Hoyer
ea877ac6cc dracut-functions.sh: fixed dracutbasedir, when sourced directly 2015-09-03 12:31:34 +02:00
Harald Hoyer
5816375273 Merge pull request #87 from dracut-mailing-devs/E1ZK3hi-0000SN-Lt@puleglot.ru
dracut-initramfs-restore: make mount error nonfatal
2015-09-02 12:54:43 +02:00
Harald Hoyer
419105df27 Merge pull request #90 from ldzhong/fix
dracut.sh: remove duplicate call of push_host_devs
2015-08-25 12:03:16 +02:00
Lidong Zhong
aa169b3bd3 dracut.sh: remove duplicate call of push_host_devs
There is no way exit between the two places that call push_host_devs
2015-08-24 18:27:54 +08:00
Harald Hoyer
378ed5ecc1 Merge pull request #89 from ldzhong/fix
dracut-functions.sh: remove duplicate declaratio of local variable
2015-08-24 12:11:39 +02:00
Lidong Zhong
9918afd244 dracut-functions.sh: remove duplicate declaratio of local variable 2015-08-24 18:03:02 +08:00
Harald Hoyer
e0a5dec4a4 Merge pull request #88 from shoop/staticroutegw
The default gateway might need a static route
2015-08-24 11:53:01 +02:00
Stijn Hoop
110858025a The default gateway might need a static route
Some hosting providers need a static route set in order to be
able to reach the default gateway. Be sure to retry adding
the default gateway after setting the static routes.
2015-08-23 14:45:53 +02:00
Harald Hoyer
0a66b74b51 TEST-30-ISCSI: test more and set static initiator name 2015-08-13 11:54:24 +02:00
Harald Hoyer
6802cf2349 iscsi/iscsiroot.sh: handle timeout with all interfaces up
restart iscsid, because it may disbehaved
2015-08-13 11:53:21 +02:00
Harald Hoyer
feb8dc685d iscsi/parse-iscsiroot.sh: use iBFT initiator name 2015-08-12 15:17:33 +02:00
Harald Hoyer
69171aa8fa dracut.cmdline.7.asc: document rd.iscsi.waitnet and rd.iscsi.testroute 2015-08-12 15:11:17 +02:00
Harald Hoyer
c22c43f81a TEST-30-ISCSI: switch to scsi-target-utils
netbsd-iscsi is not available on RHEL

Beef up the testsuite to use the two targets over different
interfaces.

Test the new iSCSI parameters rd.iscsi.waitnet and rd.iscsi.testroute.
2015-08-12 14:48:19 +02:00
Harald Hoyer
52b91b6698 TEST-30-ISCSI/dhcpd.conf: set the LUN
set the LUN, so the udev rule to mount the disk matches
2015-08-12 14:40:42 +02:00
Harald Hoyer
d94050ddae iscsi: integrate with systemd and improve robustness
parse-cmdline sets up an initial initiator-name to let iscsid start.

iscsid is started before doing any iscsistart business.

iscsistart is done with systemd-run asynchrone to do things in
paralllel. Also restarted for every new interface which shows up.

If rd.iscsi.waitnet (default) is set, iscsistart is done only
after all interfaces are up.

If not all interfaces are up and rd.iscsi.testroute (default) is set,
the route to a iscsi target IP is checked and skipped, if there is none.

If all things fail, we issue a "dummy" interface iscsiroot to retry
everything in the initqueue/timeout.
2015-08-12 14:33:49 +02:00
Harald Hoyer
f41720c311 base/dracut-lib.sh: forget about the idea of output redirection
It's just not working :-/
2015-08-12 14:28:45 +02:00
Harald Hoyer
8ba684be1c dracut-systemd/dracut-initqueue.sh: be verbose about timeout
Issue a warning, if timeout scripts are executed
2015-08-12 14:27:39 +02:00
Harald Hoyer
50e86bf02b nfs/parse-nfsroot.sh: silence useless warning if netroot is not nfs 2015-08-12 14:27:01 +02:00
Harald Hoyer
4e9ba952bf network/parse-ip-opts.sh: assume rd.neednet for multiple ip options
set rd.neednet on the kernel cmdline to disable this behaviour
2015-08-12 14:25:23 +02:00
Harald Hoyer
b1b704bd67 systemd: add systemd-run and systemd-escape 2015-08-12 14:24:45 +02:00
Harald Hoyer
01b23b6900 network/net-lib.sh: add is_ip()
add function to test if string is a valid IP
2015-08-12 14:24:05 +02:00
Harald Hoyer
3c00189988 dracut.sh: remove quotes from install_items and install_optional_items
Unfortunately these are lists with whitespaces.
2015-08-10 14:05:15 +02:00
Harald Hoyer
e6a2555c7d base/dracut-lib.sh: Dup stdout and stderr
Dup stdout and stderr, so that subshell redirection does not affect
logging.

Also gets rid of systemd printing info() to the console on "quiet".
2015-08-10 13:40:43 +02:00
Mimi Zohar
4f50a9bfb1 Revert securitfs change
Commit 5e60145 use findmnt with "--source" or "--target" broke
mounting securityfs.  This patch reverts only the securityfs
portion of the patch.
2015-08-03 12:36:05 +02:00
Mimi Zohar
41ac16b26f Define new script to load keys on the IMA keyring (update)
This patch supports loading keys either on the _ima keyring or, as of
Linux 3.17, on the trusted .ima keyring.  Only certificates signed by
a key on the system keyring can be loaded onto the trusted .ima keyring.

Changelog:
- Update 98integrity/README
2015-08-03 12:36:05 +02:00
Mimi Zohar
396d3cc7ff Extend evm-enable.sh to load the EVM public key
Create the _evm keyring and load the EVM public key on it.
2015-08-03 12:36:05 +02:00
Mimi Zohar
b05ad85b0c Remove 98integrity's dependency on selinux
Loading the EVM key(s) is not dependent on selinux.  Remove
the dependency.
2015-08-03 12:36:05 +02:00
Harald Hoyer
4135eea634 90qemu: fixed systemd-detect-virt output parsing
redirecting systemd-detect-virt to /dev/null doesn't help with parsing
the output :-/

Also, add "Red Hat" as a vendor.
2015-07-31 09:05:51 +02:00
Harald Hoyer
96d694c0b5 dracut.sh: simplify modalias reading 2015-07-30 12:11:42 +02:00
Alexander Tsoy
da5304aabc dracut-initramfs-restore: make mount error nonfatal
Script enables errexit option (set -e). So if /boot is not a mount point
or is already mounted, then script dies after unsuccessful mount
command. Fix this by always returning successful result.
2015-07-28 15:04:56 +02:00
Harald Hoyer
cce34acace qemu: add spapr-vscsi kernel module 2015-07-28 11:55:04 +02:00
Harald Hoyer
607ff8204b Merge pull request #85 from Quarky9/master
40network/net-lib.sh: get_ip() Add missing echo to output the result
2015-07-27 13:40:53 +02:00
Harald Hoyer
2082cdf230 crypt: s/allow-discards/discard for crypttab
actually the option in crypttab is named "discard" and not
"allow-discards"

https://bugzilla.suse.com/show_bug.cgi?id=932972
2015-07-27 13:30:22 +02:00
Stefan Reimer
c1c96f2c47 Add missing echo to output the result.
Only place this function is currently called seems from line 28 in modules.d/95nfs/nfs-lib.sh. Bug fix.
2015-07-25 01:17:04 +00:00
Harald Hoyer
693b7a3283 Cleanup compressor handling
If no compressor is specified, try to find a suitable one.

Check if kernel modules can be uncompressed.
2015-07-22 11:35:28 +02:00
Chao Fan
7eeaa4ab14 remove the incomplete .img file
If the directory where the .img file is saved has no enough space, or in
other wrong conditions, dracut will get an incomplete file xxx.img. But
sometimes this .img file will be loaded when rebooting the system. And then
some bugs will happen because this .img file is wrong.

So I think dracut should remove the incomplete file because this .img file
with problems was made by dracut. And then the wrong file will not be loaded
anymore.

Signed-off-by: Chao Fan <cfan@redhat.com>
2015-07-21 12:05:42 +02:00
Harald Hoyer
f4d64d55ea dmsquash-generator.sh: increase timeout for checkisomd5
if the checkisomd5 takes longer than 3 minutes, the device timeout for
/dev/mapper/live-rw cancels the boot process.
2015-07-18 13:02:25 +02:00
Harald Hoyer
ff55a8939c Merge pull request #81 from floppym/printf2
Replace echo -n with printf in code with a /bin/sh shebang
2015-07-16 12:02:48 +02:00
Harald Hoyer
e50f91e600 use mktemp "-p" instead of "--tmpdir" for busybox 2015-07-15 11:47:43 +02:00
Harald Hoyer
7f2ea02b4a dracut.spec: add dracut-init.sh 2015-07-15 11:47:43 +02:00
Mike Gilbert
24f32511fc syncheck: Look for 'echo -n' usage in modules 2015-07-14 22:24:27 -04:00
Mike Gilbert
5899f2f516 Replace echo -n with printf in code with a /bin/sh shebang
POSIX does not mandate that echo support the -n parameter.
printf has more well-defined behavior.
2015-07-14 22:22:14 -04:00
Harald Hoyer
e47907cc6b dracut-systemd/dracut-initqueue: only start service if really needed
Only start the dracut-initqueue.service, if the dracut_need_initqueue
command was issued on creation or later on set.
2015-07-13 10:51:47 +02:00
Harald Hoyer
968280e370 crypt: skip crypttab entries with the same device
It was only checked, if the name of the crypttab entry matched.
This patch adds checking, if the device matches.
2015-07-13 10:44:27 +02:00
Harald Hoyer
8c7dc032f8 TODO: update 2015-07-13 10:38:16 +02:00
Harald Hoyer
df0bdd5ae9 network: add rd.peerdns=0 parameter
Add rd.peerdns=0 parameter to disable DHCP nameserver setting
2015-07-13 10:14:15 +02:00
Harald Hoyer
ee44f62972 dracut.sh: early check for bash version 2015-07-09 19:44:30 +02:00
Harald Hoyer
e8f19bcf26 dracut.sh: remember $0 for --regenerate-all 2015-07-09 18:22:15 +02:00
Harald Hoyer
cb0913db0d dracut.sh: reduce code 2015-07-09 18:06:55 +02:00
Harald Hoyer
32de4eb5d3 dracut-functions.sh: simplify some for loops
continue early, if condition is not met
2015-07-09 15:36:25 +02:00
Harald Hoyer
3721635b2c guard ${arrays[@]} with "" 2015-07-09 15:36:25 +02:00
Harald Hoyer
694725abf0 dracut.sh: remove pop() 2015-07-09 15:36:25 +02:00
Harald Hoyer
e833e26137 dracut.conf: remove example parameters 2015-07-09 15:36:25 +02:00
Harald Hoyer
5a66d51102 dracut.sh: remove push()
can be done with var+=(val)
2015-07-09 15:36:25 +02:00
Harald Hoyer
1cadc26fd4 Add all btrfs devices
We have to find them with "btrfs usage", which is cumbersome.
2015-07-09 15:36:25 +02:00
Harald Hoyer
78362bc5fe network/dhclient-script.sh: remove bashism 2015-07-08 08:49:02 +02:00
Harald Hoyer
7ecb36aef4 TEST-50-MULTINIC/test.sh: correctly call ldconfig 2015-07-07 15:34:30 +02:00
Harald Hoyer
3fa31c3a47 TEST-14-IMSM: remove "rd.auto"
otherwise rd.auto auto assembles the device
2015-07-07 14:31:16 +02:00
Harald Hoyer
9ee2f1e235 TEST-04-FULL-SYSTEMD: fixup loadkeys keymap loading 2015-07-07 14:31:06 +02:00
Harald Hoyer
e860ef0e30 dracut-pre-mount.service should run before systemd-fsck-root.service 2015-07-07 13:45:19 +02:00
Andrei Borzenkov
6c9484f614 ensure pre-mount (and resume) run before root fsck
References:
https://bugzilla.suse.com/show_bug.cgi?id=906592
Signed-off-by: Thomas Renninger <trenn@suse.de>
2015-07-07 13:44:24 +02:00
Thomas Renninger
162daf0c97 Use the uncompressed kernel file on arm and aarch to detect kernel version
This is due to file cannot read out the kernel version on these.

Many thanks to Alexander Graf finding this in old SUSE mkinitrd code.
Converted by Thomas Renninger.

Signed-off-by: Thomas Renninger <trenn@suse.de>

https://bugzilla.suse.com/show_bug.cgi?id=908454
Signed-off-by: Thomas Renninger <trenn@suse.de>
2015-07-07 13:44:24 +02:00
Thomas Renninger
01e60ca4f6 mkinitrd-suse.sh: Bail out with exit 1 if initrd cannot be generated
Signed-off-by: Thomas Renninger <trenn@suse.de>
2015-07-07 13:44:24 +02:00
Hannes Reinecke
b8efaa0017 Reset IFS variable
Setting and unsetting the IFS variable is tricky. To be on the
safe side we should always reset the IFS variable to its original
value after parsing.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2015-07-07 13:44:24 +02:00
Harald Hoyer
6318baa45f skipcpio/skipcpio.c: linux kernel only accepts "070701" signature
don't bother with other signatures
2015-07-07 13:44:13 +02:00
Harald Hoyer
3d579309cd dmsquash-live/dmsquash-live-root.sh: fixup checkisomd5 for systemd
systemd does not like a leading "-" for unit template filenames anymore.
2015-07-07 13:44:13 +02:00
Harald Hoyer
f621aeba65 Merge pull request #78 from dracut-mailing-devs/20150706073126.GC22559@dhcp-128-51.nay.redhat.com
90multipath: add hostonly multipath.conf in case hostonly mode
2015-07-07 13:16:27 +02:00
Harald Hoyer
59815841e9 Merge pull request #77 from dracut-mailing-devs/1435792513-2222-1-git-send-email-crrodriguez@opensuse.org
systemd: if kdbus is available, include the kernel module
2015-07-07 13:15:34 +02:00
Dave Young
77403e0032 90multipath: add hostonly multipath.conf in case hostonly mode
For large machine, suppose there's a lot of multipath devices, multipath layer
will use a lot of memory. For kdump kernel memory is very limited thus it causes
oom. To avoid oom, we only add necessary multipath devices in kdump kernel
multipath.conf.

This is done by use mpathconf --allow, a new option which is like whitelist.

Signed-off-by: Dave Young <dyoung@redhat.com>
2015-07-06 10:06:04 +02:00
Harald Hoyer
8d09f493a6 network/dhclient-script.sh: fixup lease time 2015-07-02 19:48:25 +02:00
Harald Hoyer
777f2db037 splitup dracut-init.sh from dracut-functions.sh
other tools want to source dracut-functions.sh without any mkdir side
effects.
2015-07-02 16:04:05 +02:00
Harald Hoyer
ba665de454 nfs/nfs-lib.sh: add anaconda_nfsv6_to_var()
add "nfs:[[2001:0db8:85a3:08d3:1319:8a2e:0370:7344]]/path" style parsing

https://bugzilla.redhat.com/show_bug.cgi?id=1190098
2015-07-02 15:24:03 +02:00
Harald Hoyer
57fb6e67de dracut-lib.sh:info() output info to stderr
otherwise it might collide with stdout redirection
2015-07-02 15:02:31 +02:00
Harald Hoyer
916559e073 dracut.sh: add devices with x-initrd.mount in /etc/fstab to host_devs
otherwise dracut might not even be able to mount those.
2015-07-02 14:55:31 +02:00
Harald Hoyer
3639fe543c lower the log level for dfatal 2015-07-02 11:36:33 +02:00
Harald Hoyer
7cca5efdce network: don't use "ifup -m"
"ifup -m" was thought to be used by humans in the emergency shell.
Using it programatically shows some other flaw in the execution logic.

Also, "ifup -m" was configuring the interface multiple times on "add"
and "change" uevent, because the "$netif.did-setup" test was not
executed.
2015-07-02 11:36:33 +02:00
Harald Hoyer
0f89ec314b network/dhclient-script.sh: make IPv4 DHCP lease time optionally
If bootp is used, no lease time is provided in the packet from the bootp
server.
2015-07-02 11:36:33 +02:00
Harald Hoyer
cf627b20d0 network/dhclient-script.sh: add RENEW/REBIND 2015-07-02 11:36:33 +02:00
Cristian Rodríguez
90ff5ad67e systemd: if kdbus is available, include the kernel module 2015-07-02 02:02:51 +02:00
Harald Hoyer
08eca6756f Merge pull request #76 from fabiand/activationskip
Revert "lvm: Don't activate LVs with activationskip set"
2015-06-25 12:20:13 +02:00
Fabian Deutsch
d4b93a092d Revert "lvm: Don't activate LVs with activationskip set"
This reverts commit cfa365a32d.

The logic in commit cfa365a was added to prevent (odl) lvms from
activating snapshots which should not be activated.
Newer lvms however do this automatically (not enabling an LV if the
the 'k' attribute set), thus we can revert the previous commit.
2015-06-25 12:11:15 +02:00
Harald Hoyer
c42064a684 dracut.spec: turn requires in recommends 2015-06-23 15:29:44 +02:00
Harald Hoyer
47ff68e78b dracut.spec: Recommends grubby 2015-06-23 15:29:43 +02:00
Harald Hoyer
ac13778f60 dracut.spec: move dmsquash and livnet to subpackage
dmsquash and livenet need img-lib, which needs tar, which is normally
not needed.
2015-06-23 15:29:43 +02:00
Harald Hoyer
aca93e3364 uefi-lib: remove bogus comment 2015-06-23 15:29:43 +02:00
Harald Hoyer
231b3dd432 rootfs-generator: check for rootok, before doing any action 2015-06-23 15:29:43 +02:00
Harald Hoyer
70de22e63b Merge pull request #74 from xnox/master
Fix default udev & systemd dir detection, in usr-merge configurations.
2015-06-23 14:12:40 +02:00
Dimitri John Ledkov
80dab03a7d Fix default udev & systemd dir detection, in usr-merge configurations.
Test that /lib is not a symlink, before using split-usr paths.
2015-06-22 11:56:28 +01:00
Harald Hoyer
eab03540cd NEWS: version 043 2015-06-15 12:27:21 +02:00
Harald Hoyer
a97787c7b5 Merge pull request #73 from dracut-mailing-devs/1434358579-11674-1-git-send-email-lzhong@suse.com
dracut-lib.sh: typo fix
2015-06-15 11:31:53 +02:00
Harald Hoyer
2c66c3bccf dmsquash-live: add dmsquash-generator 2015-06-15 11:31:10 +02:00
Harald Hoyer
e4e7801d29 Merge pull request #71 from jsynacek/doc-fix
doc: fix formatting
2015-06-15 11:28:33 +02:00
Lidong Zhong
e51e7978a8 dracut-lib.sh: typo fix
Signed-off-by: Lidong Zhong <lzhong@suse.com>
2015-06-15 11:05:18 +02:00
Jan Synacek
ca96509c97 doc: fix formatting 2015-06-15 09:58:28 +02:00
Harald Hoyer
04bf862d97 NEWS & AUTHORS update - 042 2015-06-11 17:39:47 +02:00
Harald Hoyer
3f979ee495 TODO: update 2015-06-11 17:39:47 +02:00
Harald Hoyer
3944c4b136 TEST-16-DMSQUASH: add more debug parms 2015-06-11 17:39:47 +02:00
Harald Hoyer
97ff396a97 run-qemu: default kernel to "/lib/modules/${KVERSION}/vmlinuz"
newer Fedora kernel install the kernel to /lib/modules
2015-06-11 17:39:47 +02:00
Harald Hoyer
8ff624df9f dmsquash-live: install a sysroot.mount generator for systemd
otherwise systemd uses its own sysroot.mount line
2015-06-11 17:39:31 +02:00
Harald Hoyer
5711f54312 crypt: check for crypttab before reading 2015-06-09 15:05:32 +02:00
Harald Hoyer
c3cdd9f6e1 udev-rules: add 60-block.rules 2015-06-09 15:05:32 +02:00
Harald Hoyer
1339095dba dracut-functions.sh: only honor the first [0-9]+<module> dir
If multiple directories with different numbers exist, only honor the
first one.
2015-06-09 15:05:32 +02:00
Harald Hoyer
4358ace43c fixup test suite
- qemu wants to have "format=raw"
- "-kernel" is obsolete, because run-qemu picks the right path
2015-06-09 13:36:46 +02:00
Harald Hoyer
8b52e96f09 dracut.conf.5.asc: document "compress" 2015-06-09 12:30:14 +02:00
Harald Hoyer
0ad2471c3a dracut.conf.5.asc: add missing "=" 2015-06-05 12:59:58 +02:00
Christian Rodrigues
b52cfbeaa5 Correct paths for openSUSE
openSUSE has things stored in different places, so fixup the
paths here.

Signed-off-by: Christian Rodrigues <crrodriguez@opensuse.org>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2015-06-02 12:24:59 +02:00
Hannes Reinecke
6755c20855 95fcoe-uefi: Test for EFI firmware
The fcoe-uefi module should test for EFI firmware when called
in 'hostonly' mode; of no EFI firmware is found then the module
doesn't need to be included.

References: bnc#882412

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2015-06-02 12:24:58 +02:00
Cristian Rodríguez
7c433a0b43 systemd: include systemd-random-seed.service
In current systemd releases there is no random-seed-load service
only systemd-random-seed.service
2015-06-02 12:06:49 +02:00
Jan Synacek
d5e5855b74 doc: fix typo 2015-06-02 12:05:21 +02:00
Harald Hoyer
3b1d78880f Merge pull request #58 from dracut-mailing-devs/20150326044148.10121.15286.stgit@notabene.brown
mdraid fixes
2015-06-02 12:04:51 +02:00
NeilBrown
4d9d767da2 crypt/parse-crypt.sh: hide encrypted devices from systemd timeout warnings.
When systemd's crypttab generator parsed crypttab, it tells
systemd about several devices which may not appear until later
in the boot sequence, and which are not needed while dract is running.

This can particularly happen when an md array is encrypted,
and the array is newly degraded so that it doesn't appear until
dracut runs mdraid_start.sh.

This can result in systemd printing warning messages which are
inappropriate.

So tell systemd that the timeout for each of these is zero.

This is involves splitting some functionality out of wait_for_dev()

That function does two things:
 - creates 'finished' hooks so that dracut will wait for the device,
   and
 - sets the systemd timeout for the device to zero, so systemd doesn't
   wait.

We only want the second of these for most encrypted devices.
So split that out into a new function set_systemd_timeout_for_dev(),
and call it from parse-crypt.sh

Signed-off-by: NeilBrown <neilb@suse.de>

--
This version fixes the missing redirect from /etc/crypttab
NeilBrown
2015-06-02 12:03:43 +02:00
Harald Hoyer
b562bc55a8 Merge pull request #67 from dracut-mailing-devs/1432116434-18050-1-git-send-email-cfan@redhat.com
Change the fs_passno of nfs to 0
2015-06-02 11:57:58 +02:00
Harald Hoyer
dfec3c2d8b Merge pull request #68 from dracut-mailing-devs/1431698021-16626-3-git-send-email-colin@mageia.org
dracut: Make host only mode more resilient to missing swaps.
This patch set allows swap devices to disappear without cocking up a
host-only initramfs boot.
2015-06-02 11:54:07 +02:00
Harald Hoyer
8c5d18c2cb Merge pull request #44 from MrStaticVoid/fix-crypt-loop-info-log-level
crypt-loop: Fix decrypt when running at info log level
2015-06-02 11:49:25 +02:00
Harald Hoyer
d6e23c46c2 Merge pull request #45 from MrStaticVoid/fix-crypt-loop-hostonly-kernel-module
crypt-loop: Always include 'loop' kernel module
2015-06-02 11:47:58 +02:00
Harald Hoyer
4f0c7fc917 dracut-initramfs-restore.sh: try to mount /boot
This is very useful when /boot has the "noauto" option.

Thanks to Igor Filakhtov
2015-06-02 11:47:04 +02:00
Nikoli
c4184b5cf1 Mount /dev, /dev/shm and /run noexec 2015-06-02 11:46:59 +02:00
Harald Hoyer
1a61d85ef2 Merge pull request #51 from dracut-mailing-devs/13711492.8HAMuGhYIN@thunder
Add support for ethernet point-to-point connections configured via DHCP
2015-06-02 11:44:39 +02:00
Harald Hoyer
514aeec5b4 Merge pull request #53 from dracut-mailing-devs/E1YQLG5-00009v-BS@puleglot.ru
base/dracut-lib.sh: remove bashism
2015-06-02 11:20:10 +02:00
xtraeme
6964169368 Portability fixes:
- Use uid_t not __uid_t.
- Define _GNU_SOURCE for cpu_set_t and others.
- Include string.h for strncmp().
- Detect musl's ldd error message.
2015-06-02 11:17:13 +02:00
Harald Hoyer
acf82efd52 Merge pull request #64 from fabiand/lvm-activationskip
Respect LVM activationskip
2015-06-02 11:11:40 +02:00
Harald Hoyer
e409c9e8f8 Merge pull request #65 from scop/comment
Fix stale comment about required bash version
2015-06-02 11:10:59 +02:00
Harald Hoyer
0e5c01f8b8 Merge pull request #66 from scop/lbzip2
Use lbzip2 instead of bzip2 if available
2015-06-02 11:10:29 +02:00
Harald Hoyer
311aee1bff dracut.spec: use the autosetup macro to apply the patches 2015-05-28 19:49:08 +02:00
Harald Hoyer
0b7bfacfea network: setup gateway after setting up resolv.conf
If a daemon listens for route changes and wants to use the interface
afterwards, it should be able to resolve DNS
2015-05-28 19:47:37 +02:00
Harald Hoyer
3ac9cdb1c5 dracut.sh: fall back to /usr/lib/os-release, if /etc/os-release missing 2015-05-28 19:47:37 +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
Ville Skyttä
ee84640963 Use lbzip2 instead of bzip2 if available 2015-05-24 22:29:20 +03:00
Ville Skyttä
f8139a8b28 Fix stale comment about required bash version 2015-05-24 22:26:20 +03:00
Fabian Deutsch
cfa365a32d lvm: Don't activate LVs with activationskip set
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1186854
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
2015-05-21 12:38:05 +02:00
Fabian Deutsch
a1b4efe6a7 doc: Add a minimal rd.live.overlay documentation
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
2015-05-21 12:37:38 +02:00
Chao Fan
3586a7aa77 Change the fs_passno of nfs to 0
There is a bug that kdump-initrd contains entry requesting nfs dump
filesystem to get filesystemchecked. And there is an erro message said
that nfs need be checked. But there's no fsck for nfs utility, e.g
fsck.nfs like other file system. Whatever fs_passno 0 or 2 are passed,
no fsck is executed at all for nfs mount.But in dracut, set it to be 2
always, so the erro message appear and it should be set to 0.

In the fstab,the sixth variable fs_passno stands for that the device need
checked or not,and dracut set it to "2".To fix this issue, it should
be "0" when the device is nfs.The third variable stands for the type of
the filesystem and we can use it to judge whether the device is nfs.
So when the third variable of fstab contains "nfs", the sixth variable
fs_passno should be set to "0".

Signed-off-by: Chao Fan <cfan@redhat.com>
2015-05-20 12:07:57 +02:00
Harald Hoyer
81b67232dc 50drm: add hyperv_fb kernel module
https://bugzilla.redhat.com/show_bug.cgi?id=1192035
2015-05-18 13:43:26 +02:00
Harald Hoyer
27c9d1f20f Merge remote-tracking branch 'github/master' 2015-05-18 13:28:00 +02:00
Harald Hoyer
10e59202c7 51-dracut-rescue.install: fix kernel cmdline parsing
filter out any "initrd=" option
2015-05-18 13:27:16 +02:00
Colin Guthrie
7b56b90582 resume: Ensure we actually wait for the /dev/resume 'device'
Although various bits are in place to cancel waiting for the /dev/resume
device (actually a symlink), we don't actually ever wait for it.

Also as the udev rule may create the symlink, silence any errors from
our manual ln -s call from the settled job.
2015-05-15 16:01:41 +02:00
Colin Guthrie
3e3ed34f03 base: Don't wait for swap devices in host-only mode.
The only reason we add swap devices to host-only mode (added in
dd5875499e) is to allow us to process
resume= arguments passed on the kernel command line when the swap
partition lives on something slightly more complex than a normal
partion (e.g. in an LVM or RAID setup).

By adding the device to host_devs, the necessary LVM and RAID hooks
are added and thus the underlying storage will be initialised OK, and
the 95resume module handles the waiting for the device (via udev rules
creating the /dev/resume symlink).

So ultimately, we do not need to hard-code the waiting for the swap
devices into the initramfs at build time as the waiting part can be
dynamic.

This makes things more resiliant to swap partitions disappearing and
being reformatted etc.

Inspired by a patch by Martin Whitaker on Mageia bug:
https://bugs.mageia.org/show_bug.cgi?id=12305
2015-05-15 16:01:41 +02:00
Harald Hoyer
50f8ae457c dmraid/dmraid.sh: call udevsettle after activating all raids
otherwise a uevent loop will happen and the initqueue main loop counter
will not be incremented
2015-05-13 12:31:07 +02:00
Harald Hoyer
a601870064 5?-dracut*.install: better parsing of /proc/cmdline
"read -r -d '' -a" does, what we want.
2015-05-13 12:02:14 +02:00
Harald Hoyer
8cd8820547 use cp --reflink=auto
saves some space, if the destination is on the same filesystem on some
filesystems
2015-05-13 12:02:10 +02:00
Harald Hoyer
471439f564 add dracut.pc pkg-config file 2015-05-13 11:47:23 +02:00
Harald Hoyer
e668f3bc36 .dir-locals.el: correct syntax 2015-05-13 11:44:00 +02:00
Harald Hoyer
351de47882 README.testsuite: add bridge-utils to list of rpms 2015-05-07 18:15:57 +02:00
Harald Hoyer
07d9319d54 network/net-lib.sh:iface_has_link() wait 5s for the carrier to appear
https://bugzilla.redhat.com/show_bug.cgi?id=1088808
2015-05-07 14:49:06 +02:00
Harald Hoyer
7c5ec0f5be network:dhcp:wait_for_ipv6_dad() in PREINIT6 2015-05-07 14:43:26 +02:00
Harald Hoyer
79bc77d2f4 Merge pull request #61 from cmorty/pull/plymouth
Add plymouth-set-default-theme to the plymouth dependencies
2015-04-30 11:28:49 +02:00
Moritz 'Morty' Strübe
874b013573 Add plymouth-set-default-theme to the plymouth dependencies
plymouth-set-default-theme is not shipped with ubuntu and therefore
causes errors.
2015-04-30 11:20:27 +02:00
Harald Hoyer
ffa0ee5d16 Merge pull request #59 from lnykryn/master
dracut-functions: use [[ ]] with -n and no quotes
2015-04-30 09:29:06 +02:00
Harald Hoyer
a742c80778 Merge pull request #60 from rustybird/master
Fix ask_for_password bug breaking bash without plymouth
2015-04-30 09:28:50 +02:00
Rusty Bird
04ba461045 Fix ask_for_password bug breaking bash without plymouth
If crypt-lib.sh is sourced from any #!/bin/sh script, a POSIX shell
quirk is in effect that causes variable assignments to "special
builtins" (such as "shift") to leak to their context. So the buggy
code works even despite the missing semicolons.

But if it is sourced by "bash acting under its own name", i.e. from
any #!/bin/bash script, the quirk is disabled, tty_cmd/tty_prompt are
undefined, and ask_for_password doesn't do anything if plymouth is not
present.
2015-04-30 03:25:14 +00: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
822a7ae504 fips: add some s390 kernel modules 2015-04-28 10:46:33 +02:00
Lukas Nykryn
b0b60c8e05 dracut-functions: use [[ ]] with -n and no quotes 2015-04-27 11:40:54 +02:00
Harald Hoyer
4851deca54 dmsquash-live/apply-live-updates.sh: needs 'find'
also add /run/initramfs/live/updates as a directory, where to pull
the updates from

https://bugzilla.redhat.com/show_bug.cgi?id=1213736
2015-04-24 12:18:53 +02:00
Harald Hoyer
437dad70e9 Defer modprobe of HW modules, until udev is running
Also honor blacklisting
2015-04-24 11:59:37 +02:00
Harald Hoyer
a3e464ca43 drm/module-setup.sh: radeon needs amdkfd
AMD's HSA Linux kernel driver (amdkfd) has been merged into the mainline
kernel since kernel 3.19.

However, for the driver to work, it needs to be included in the default
initramfs image, together with the amd_iommu_v2 driver.

The radeon driver (AMD's kernel graphic driver) calls amdkfd during its
initialization and probing stages. Because radeon is included in the
initramfs image, it tries to initialize amdkfd during the early boot
stages. However, as amdkfd is not present there, it fails.

That doesn't harm radeon operation. However, it disables the HSA
abilities in the machine.

Because of the current design, if you later try to "modprobe amdkfd",
you won't be able to run HSA applications, even though the driver will
be loaded.

https://bugzilla.redhat.com/show_bug.cgi?id=1205222
2015-04-23 16:11:53 +02:00
Harald Hoyer
be82884d35 Makefile: turn off hostonly excplicitely for testimage target 2015-04-23 16:11:26 +02:00
Harald Hoyer
180e9d7851 kernel-modules: install all HID drivers
Instead of hardcoding a list of useful drivers, which has to be curated
all the time, just include all HID drivers.
2015-04-23 13:46:52 +02:00
Harald Hoyer
d3d52b20e9 dracut-systemd/rootfs-generator.sh: use strstr rather than grep
grep on /proc/cmdline is overkill and would add a requirement for grep
2015-04-21 16:35:34 +02:00
Harald Hoyer
23446ef1e0 ifcfg/write-ifcfg.sh: unset vlan
clear the vlan flag, if a previous interface in the loop
was a vlan interface
2015-04-21 15:10:49 +02:00
Harald Hoyer
ec06c5d3b5 Merge pull request #55 from dracut-mailing-devs/1427202794-18834-1-git-send-email-aidecoe@aidecoe.name
Take into account lib64 dirs when detecting version, modules and params
2015-03-26 18:34:49 +01:00
Amadeusz Żołnowski
d3be9275c7 Take into account lib64 dirs when detecting version, modules and params 2015-03-26 16:38:42 +01:00
Alexander Tsoy
13efce5d1b base/dracut-lib.sh: remove bashism 2015-03-26 16:38:38 +01:00
NeilBrown
f53ede36fb dracut-systemd/rootfs-generator.sh: always create generated files.
When 'systemctl daemon-reload' is run, systemd will clean out
/run/systemd/generator and re-run all the generators.
So it is important that the generators always create the required
files.

rootfs-generator.sh currently does *not* create the desired files
if $hookdir/initqueue/finished/devexists-${_name}.sh
exists.

This is not removed by "systectl daemon-reload" so the first time this
generator is run it will do the right thing.  Subsequent times it
won't.

This results in incorrect timeouts after "daemon-reload" is run.

So let the existence of each file only guard the creation that file.

Signed-off-by: NeilBrown <neilb@suse.de>
2015-03-26 16:38:36 +01:00
NeilBrown
97cb17c792 systemd/dracut-iniqueue - continue waiting if any timeout script makes progress
A number of timeout scripts can be registered.  If any one of them
makes progress - e.g. assembles a degraded md array - then
the main loop should wait a bit longer rather than pressing forward.

This is particularly important is resume-from-hibernate requires a
degraded md array.  Both the script to forcibly assemble the md array
and the script to abort hibernation if the device doesn't appear
are 'timeout' scripts.  There needs to be a reasonable delay between
these running.

So: if any script has indicated that progress was made, break of out
the loop and go back to normal waiting.

Signed-off-by: NeilBrown <neilb@suse.de>
2015-03-26 16:38:36 +01:00
NeilBrown
3b82ac1696 mdraid/mdraid_start.sh: tell mainloop if we make progress.
mdraid_start is a number of scripts which run after a timeout.
If it makes progress, it should tell the main loop so that it
knows that it is worth waiting a bit longer.

So in that case, create the initqueue/work file which the main loop
checks for.

Signed-off-by: NeilBrown <neilb@suse.de>
2015-03-26 16:38:36 +01:00
Gerd von Egidy
99ccbc30df Add support for ethernet point-to-point connections configured via DHCP
When current dracut receives an ip with netmask of 255.255.255.255 via DHCP,
setting the also supplied default gateway fails (because it is obviously not
within the netmask).

The setup with a netmask of /32 is quite common in colocation datacenters
where you don't want the machines of two different customers to directly talk
to each other. At least two of the biggest colocation providers in Germany
(1&1 and Strato) do it that way. NetworkManager supports this kind of setup
and the dhclient-scripts of several distributions too.

In this patch I have implemented a simple approach very similar to what is
found in Debian. The dhclient-script from Fedora uses a more sophisticated
approach, but that relies on the ipcalc utility which would introduce a
dependency on Fedora-initscripts for dracut.

Signed-off-by: Gerd von Egidy <gerd.von.egidy@intra2net.com>
2015-03-26 16:38:33 +01:00
Harald Hoyer
e93d0bea38 test: include kernel-network-modules for network tests 2015-03-26 10:57:58 +01:00
James Lee
833e0f9e83 crypt-loop: Always include 'loop' kernel module
When the 'loop' kernel module isn't loaded in a running system, it gets
excluded from the hostonly initrd.  Given that the crypt-loop dracut
module has to be loaded explicitly anyway, it makes sense to always
include the requisite loop kernel module.
2015-03-26 02:17:34 -04:00
James Lee
c902aba0d4 crypt-loop: Fix decrypt when running at info log level
When booting with 'rd.info', the 'info' statements in the crypt-loop
module's 'loop_decrypt' function are output to stdout along with the key
that gets piped into the 'cryptsetup' command, which causes the crypt
device unlocking to fail.

There are two possible simple solutions to this problem:

1. Redirect the info messages to stderr (just add '>&2' at the end of
the info statements).

or

2. Remove the info statements altogether.

I have tested both and they both work, but this commit implements #2.
The existing info messages are long (they overflow 80 characters
easily) and redundant (the password prompt clearly indicates what is
happening), and just generally not useful.  Given that no one has
reported or fixed this bug in the three years that this module has
existed, no one will miss these info messages.

The commit also changes an error message in the same function to be more
descriptive.
2015-03-25 23:31:24 -04:00
Harald Hoyer
2bc5054a64 Merge pull request #35 from enovance/fix_include_variables_name
dracut: Ajusting variables name for --include
2015-03-24 20:46:06 +01:00
Harald Hoyer
b67d810785 dracut.spec: add new modules 2015-03-24 16:10:45 +01:00
Harald Hoyer
bbbdba2ec3 fcoe/lldpad.sh: add executable flags 2015-03-24 16:03:47 +01:00
Harald Hoyer
863e18b4cd crypt-loop/module-setup.sh: make module-setup.sh executable 2015-03-24 16:03:47 +01:00
Harald Hoyer
a18d5494eb dracut-systemd/module-setup.sh: make module-setup.sh executable 2015-03-24 16:03:47 +01:00
Harald Hoyer
cbb4b50e02 systemd-networkd: add experimental systemd-networkd support 2015-03-24 16:03:47 +01:00
Harald Hoyer
ae43adb70d network: split out kernel-network-modules 2015-03-24 16:03:47 +01:00
Harald Hoyer
ddfefd05fc debug: add more tools to the dracut debug module 2015-03-24 16:03:47 +01:00
Harald Hoyer
25e08a0973 systemd-initrd: add /etc/initrd-release 2015-03-24 16:03:22 +01:00
Harald Hoyer
6f92423c89 dracut.sh: create /var/tmp 2015-03-24 16:03:11 +01:00
Harald Hoyer
5641b0974b systemd: add more targets and tools
also set the multi-user.target as the default target
2015-03-24 16:02:09 +01:00
Harald Hoyer
5c44f43e69 dracut.spec: removed compat /sbin symlink to dracut binary 2015-03-23 12:19:41 +01:00
Harald Hoyer
3c20ac5377 TEST-30-ISCSI/test.sh: add all dracut modules
add all dracut modules to catch netroot conflicts and side effects like

afcc697cb8
2015-03-20 16:13:30 +01:00
Harald Hoyer
afcc697cb8 nfs/parse-nfsroot.sh: don't unset netroot, if not nfs 2015-03-20 15:48:15 +01:00
Harald Hoyer
636d2d46a5 dracut.sh: add support for creating a UEFI boot executable
With an EFI stub, the kernel, the initramfs and a kernel cmdline can be
glued together to a single UEFI executable, which can be booted by a
UEFI BIOS.
2015-03-20 14:31:23 +01:00
Harald Hoyer
21a209735a dracut.sh: only print cmdline from modules, which would be included 2015-03-20 14:31:22 +01:00
Harald Hoyer
bee086532f dracut.sh: simplify module install loop 2015-03-20 14:31:22 +01:00
Harald Hoyer
df1e8127da rootfs-block/module-setup.sh: find root btrfs subvolumes
If root is a btrfs subvolume, find it, if fstab is not used
2015-03-20 14:31:22 +01:00
Harald Hoyer
481ee9e6fc test: ping watchdog in dhcp servers 2015-03-20 14:28:42 +01:00
Harald Hoyer
9f0878540b base/dracut-lib.sh: read /proc/cmdline with multiple lines
also parse cmdline files without an ending newline
2015-03-19 16:40:38 +01:00
Harald Hoyer
9119059723 dracut.sh: factor out do_print_cmdline() 2015-03-19 11:04:02 +01:00
Harald Hoyer
28eae10b70 Split the systemd dracut module up
Basic systemd functionality is in 00systemd now.
Switching root and the initrd.target is in 00systemd-initrd.
Dracut additions to the systemd initrd are in 98dracut-systemd.
2015-03-19 10:07:37 +01:00
Harald Hoyer
363469d757 base/module-setup.sh: merge systemd conditional 2015-03-19 10:00:48 +01:00
Harald Hoyer
dea0634544 lvm: add files needed for LVM system id support
The LVM system id support is recent addition to LVM. See
https://git.fedorahosted.org/cgit/lvm2.git/tree/man/lvmsystemid.7.in for
more information (since lvm v2.02.117, currently the configuration is
ignored, but we will enable it soon in next release).

https://bugzilla.redhat.com/show_bug.cgi?id=1199918
2015-03-16 11:55:13 +01:00
Harald Hoyer
1bcb63f97c systemd: add "adm" and "wheel" to passwd and group 2015-02-26 09:39:32 +01:00
Fabian Deutsch
b0472eac11 dmsquash: Add squashfs support to rd.live.fsimg
Previously rd.live.fsimg only supported filesystems residing in
(compressed) archives.
Now rd.live.fsimg can also be used when a squashfs image is used.
This is achieved by extracting the rootfs image from the squashfs and
then continue with the default routines for rd.live.fsimg.
In addition some code duplication got removed and some documentation
got added.

Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
2015-02-19 10:59:54 +01:00
Fabian Deutsch
d6e34d362a dmsquash: Add rd.live.overlay.thin
This option changes the underlying mechanism for the overlay in the
dmsquash module.
Instead of a plain dm snapshot a dm thin snapshot is used. The advantage
of the thin snapshot is, that the TRIM command is recognized, which
means that at runtime, only the occupied blocks will be claimed from
memory, and freed blocks will really be freed in ram.

Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
2015-02-19 10:59:54 +01:00
Jonas Jonsson
7075a402d7 99base: Properly remove files with rd.hostonly=0
Dracut will generate systemd units for additional devices that should be
brought up during boot, e.g. swap devices. These unit files are broken
symlinks with \ in the filename, e.g.
/etc/systemd/system/initrd.target.wants/dev-disk-by\x2duuid-e6a54f99\x2da4fd\x2d4931\x2da956\x2d1c642bcfee5e.device.

Both the backslash and the broken symlink causes problems for shell
scripts, [ -e "$file" ] isn't enough and read requires the additional -r
argument to not react on the \.
2015-02-19 10:58:18 +01:00
Lukas Wunner
5729ae8029 90dm/dm-shutdown.sh: dmsetup remove_all -> dmsetup remove
The function 99shutdown/shutdown.sh:_check_shutdown() assumes that
shutdown scripts report success or failure via their return value.
However, "dmsetup remove_all" always reports success, even if some
of the device mappings could not be removed.

I submitted a patch for dmsetup but the lvm2 folks rejected it,
asserting that its behaviour is correct, that "remove_all" should
only be used by developers and that the proper solution would be
to invoke "dmsetup remove" on each device. This does report success
or failure via the return value.

Apart from fixing that issue, this commit also adds the dmsetup
option "--noudevsync". Without it, dmsetup would hang after removal
of a device while trying to communicate with systemd-udevd, which
is no longer running at this shutdown stage.

[harald: replaces backticks with $() ]
2015-02-19 10:57:08 +01:00
Dimitri John Ledkov
a7d3ad67c7 Support /usr/lib/kernel/cmdline fallback path for /etc/kernel/cmdline. 2015-02-19 10:50:58 +01:00
Harald Hoyer
7e9341434f fips: add drbg kernel module 2015-02-19 10:45:35 +01:00
Harald Hoyer
6ac2c83570 dracut.sh: call bash with --norc
We don't want any user aliases or functions to be defined in dracut.
2015-02-19 09:55:12 +01:00
Jan Synacek
05b879ed2a doc: fix typo 2015-02-10 12:22:16 +01:00
Harald Hoyer
38e217704a fedora.conf: do not store cmdline in image by default 2015-02-10 12:22:16 +01:00
Harald Hoyer
e97ed33775 NEWS & AUTHORS update 2015-01-31 12:54:52 +01:00
Harald Hoyer
04942c4569 test/*NFS* : add dhcpd debug flag 2015-01-31 12:24:02 +01:00
Harald Hoyer
296d013f1a TEST-30-ISCSI: turn off iscsi_firmware
Having iscsi_firmware on the kernel cmdline stalls until firmware is
found. qemu does not have this.
2015-01-31 12:22:45 +01:00
Harald Hoyer
64a69cb49f README.testsuite: reformat package list for easy copy&paste 2015-01-31 12:21:56 +01:00
Harald Hoyer
70598ac292 lvm: add cache tools for dm-cache usage 2015-01-28 13:33:09 +00:00
Harald Hoyer
2a12e97475 network: do not destroy the team interface on teamd shutdown
when doing switch-root teamd gets killed, which tears down the team
interface, if teamd is not started with "-N".
2015-01-26 15:12:08 +00:00
Harald Hoyer
8a430ab25b test: use the new sfdisk syntax without disk geometry 2015-01-22 16:02:54 +01:00
Harald Hoyer
2a5a7fb662 test/TEST-04-FULL-SYSTEMD/test.sh: fix the find -perm
"find -perm +111" should be "find -perm /0111" as it is deprecated since
a long time
2015-01-22 16:00:50 +01:00
Harald Hoyer
f182cb9599 dracut.sh: simplify the "find" for files with the x bit
'(' -perm -0100 -or -perm -0010 -or -perm -0001 ')'
is the same as
-perm /0111
2015-01-22 15:58:20 +01:00
Harald Hoyer
9dc0c244b8 dmraid: don't include MD rules in DM 2015-01-22 15:57:53 +01:00
Marko Myllynen
b4fb539c9b Change Fedora default console font to eurlatgr
See https://fedoraproject.org/wiki/Changes/NewDefaultConsoleFont
2015-01-22 15:51:03 +01:00
Radek Vykydal
18423f7951 Add rd.live.overlay.size option 2015-01-21 14:10:27 +01:00
Daniel Drake
6dcc5e1158 kernel-modules: increase SDHCI driver inclusion
The sdhci-pci module is currently not being included in the initramfs,
even though other sdhci modules are. This breaks boot on systems that
rely on this driver to access the root filesystem.

Instead of looking for modules that use sdhci_pltfm_init, look for
sdhci_add_host. I checked 3.18 kernel sources, and this change
does not remove any of the previously-matched SDHCI drivers.
It should result in the addition of sdhci-pci, sdhci-s3c, sdhci-spear
and sdhci-acpi.
2015-01-21 14:10:26 +01:00
Harald Hoyer
e3e1f406bb test: turn off hostonly-cmdline and hostonly 2015-01-21 09:33:39 +01:00
Harald Hoyer
496e3d962d dracut.sh: handle empty $initrd/etc/cmdline.d 2015-01-21 09:32:20 +01:00
Harald Hoyer
7cddd7b838 network/net-lib.sh:parse_iscsi_root(): fix c&p bug
fix iscsi_target_name for eui.* and naa.* target names
2015-01-15 10:33:50 +01:00
Harald Hoyer
93342718cd network: add support for comma separated autoconf options
ip=eth0:auto6,dhcp

might work now
2015-01-14 11:41:48 +01: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
36e8ce4fb0 net-lib.sh:parse_iscsi_root() fix target parsing
For targets with colons in the iSCSI target name:
  "iqn.2000-09.com.foo:storage-system.e2000:00000001cm1p1"

the parser was confused with the optional iscsi_iface_name and
iscsi_netdev_name.

This patch reintroduces the old IQN, EUI and NAA parsing and enhances
the fallback parser by checking the LUN for a numerical value.
2015-01-12 14:06:10 +01:00
Harald Hoyer
4089949033 fips: remove c&p "and" 2015-01-09 14:53:42 +01:00
Thomas Backlund
eb8f202ed0 90kernel-modules: update for xhci module split in kernel 3.18
As reported in https://bugs.mageia.org/show_bug.cgi?id=14799

the xhci module got splitted up in upstream linux merged during
3.18 release cycle:

>From 29e409f0f7613f9fd2235e41f0fa33e48e94544e Mon Sep 17 00:00:00 2001
From: Andrew Bresticker <abrestic@chromium.org>
Date: Fri, 3 Oct 2014 11:35:29 +0300
Subject: xhci: Allow xHCI drivers to be built as separate modules

so we need to adjust 90kernel-modules accordingly.

Signed-off-by: Thomas Backlund <tmb@mageia.org>
2015-01-08 15:34:03 +01:00
Lubomir Rintel
c59779cf93 dracut-functions.sh: avoid tokenizing ldconfig output with 'read'
The space does not separate the elements reliably, spaces can be
embedded in parenthesized expressions too:

  libgmpxx.so.4 (libc6, hwcap: 0x0000000004000000) => /lib/sse2/libgmpxx.so.4
  libgmp.so.10 (libc6, hwcap: 0x0000000004000000) => /lib/sse2/libgmp.so.10

This results in dracut creating '0x0000000004000000' and '=>'
directories in the initramfs image.
2015-01-08 15:34:03 +01:00
Harald Hoyer
1dc360790d Makefile: add -Wformat to CFLAGS
-Werror=format-security seems to be ignored without -Wformat

Thanks @ Christoph Brill
2015-01-08 14:56:07 +01:00
Harald Hoyer
e0dc6cd4f6 AUTHORS and .mailmap update 2015-01-08 13:26:52 +01:00
Harald Hoyer
ebc82d38b7 qemu: add virtio_rng kernel module 2015-01-08 13:19:43 +01:00
Erwan Velu
c9364f6ea2 dracut: Ajusting variables name for --include
When reading the --include part of the script, we had the following
issues to make the code easy to read:
- src & tgt were extract for the original options
- i variable was a file or a directory from src
- s variable was the directory name in case $i was a directory

"s" sounds very close to "src" while "s" is on the "tgt" side. Very
confusing.

"s" was defined before the "if it's a directory" statement while it's
only used inside the "if".

"i" was commit from the "src" but wasn't really explicit.

Having some lines mixing "i" and "s" takes a little time to get read
properly.

This patch offer the following changes:
- "i" is renamed to "objectname" as we don't know if its a file or a
  directory

- "s" is renamed to "object_destdir" as the object name becomes a
  directory on the destdir

- "object_destdir" (former "s") is moved inside the "if" statement as it's
  only used here

- tgt is finally renamed to "target" to be more explicit. We are not all
  native english ;o)

My 2 (semantic) cents,
2014-12-19 14:49:00 +01:00
Erwan Velu
332ecaa900 dracut: Don't fail at copying files when including directories
When including a directory, the files were considered in the directory
name which lead to messages like :

cp: failed to access '/var/tmp/initramfs.L9s2zO///init-func': No such file or directory

This patch does make the destdir more explicit and copy files into the
destination directory instead of destdir/filename/
2014-12-19 13:42:57 +01:00
Harald Hoyer
3e7a05f2a5 systemd: add systemd-journald-audit.socket 2014-12-19 13:17:02 +01:00
Harald Hoyer
733c71ce9e resume: make use of systemd-hibernate-resume, if existant
In systemd mode, and if systemd-hibernate-resume exists, use it
exclusively.
2014-12-17 12:08:37 +01:00
Harald Hoyer
a17d5cf494 Revert "95rootfs-block: Correctly terminate commandline parameter"
This reverts commit 4b6b46bb2a.

$ ./dracut.sh -l --print-cmdline
root=UUID=d5e53483-30bc-4119-8c0c-841d47a2f76brootflags=rw,noatime,compress=lzo,ssd,discard,space_cache,autodefrag,inode_cacherootfstype=btrfs

instead of:

$ ./dracut.sh -l --print-cmdline
 root=UUID=d5e53483-30bc-4119-8c0c-841d47a2f76b
rootflags=rw,noatime,compress=lzo,ssd,discard,space_cache,autodefrag,inode_cache
rootfstype=btrfs

and also

$ make testimage
…
 *** Store current command line parameters ***
Stored kernel commandline:
root=UUID=d5e53483-30bc-4119-8c0c-841d47a2f76brootflags=rw,noatime,compress=lzo,ssd,discard,space_cache,autodefrag,inode_cacherootfstype=btrfs
…
2014-12-17 11:44:18 +01:00
Harald Hoyer
bea41b898a dracut-functions.sh: for module handling, strip all ".ko*"
Just strip anything after ".ko" including ".ko", otherwise compressed
modules are not stripped, if they end on e.g. ".ko.gz"
2014-12-17 11:22:46 +01:00
Thomas Renninger
e683985d10 dracut: nbd: Only complain of missing binary in hostonly mode if
rootfs is on nbd

In not hostonly mode, require_binaries will still complain.
If in hostonly mode and the module is explicitly added via -a nbd, then
install() section will still complain later:
dracut-install: ERROR: installing 'nbd-client'

Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:37 +01:00
Hannes Reinecke
4b6b46bb2a 95rootfs-block: Correctly terminate commandline parameter
95rootfs-block would not terminate the commandline parameter with
a space or newline, instead it'll rely on the main routine from
dracut.sh to do this.
Which will cause unexpected problems for any modules called
after this.

So terminate the commandline parameters correctly here and remove
the newline from dracut.sh.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:37 +01:00
Thorsten Behrens
fe116c1670 Don't create lots of empty cmdline files for hostonly-cmdline case
This aligns other places piping cmdline() output to cmdline.d files
with the earlier fix for 95rootfs-block.

Signed-off-by: Thorsten Behrens <tbehrens@suse.com>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:37 +01:00
Thorsten Behrens
7700b3df4c Also export root= boot param for hostonly-cmdline case.
If there's a root fallback, at least attempt to have it falling
back to the last root filesystem this system ran off of.

Signed-off-by: Thorsten Behrens <tbehrens@suse.com>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:37 +01:00
Thorsten Behrens
486030575d Fix non-export of journal dev boot options.
cmdline_journal does not contain linefeeds anymore, so read
silently skipped it altogether.

Signed-off-by: Thorsten Behrens <tbehrens@suse.com>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:37 +01:00
Hannes Reinecke
ce8f354dbd 90kernel-modules: install scsi_dh_alua
Install the missing scsi_dh_alua module, too.

References: bnc#871617

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:37 +01:00
Hannes Reinecke
a262ad91e8 99base: Add chown binary
nvidia driver needs this via modprobe script.
Needs to do change the group after a device node got created.
Add chown instead of chgrp which can also change the owner of a file.

Ask Stefand Dirsch <sndirsch@suse.de> for details.

Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:37 +01:00
Hannes Reinecke
681462eca8 40network: add missing _arch variable declaration
The module_setup.sh script was missing an '_arch' declaration,
causing network not to be installed on s390.

Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:37 +01:00
Thomas Renninger
9492008435 Enhance suse.conf and debug module example with SUSE-specific settings
SUSE is using specific settings for dracut, so add them
to the suse.conf.example file.

Add vi and find to the debug module add some help text to the suse.conf
file when and how to use it.

Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:37 +01:00
Hannes Reinecke
22e837b645 95fcoe: start lldpad separately
lldpad is a system-wide process, which must be started only once.
So we should be separate it from fcoe-up, as it might be called
several times.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke
0a68a26cff 95fcoe: skip VLAN devices in fcoe-up
DCB & fipvlan can only be called on real devices, not VLAN
ones. So skip any VLAN devices which might been added to the
list of network interfaces.

References: bnc#878583

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke
8b257fcc86 95fcoe: Store current configuration in dracut cmdline
When running with --hostonly-cmdline we should be storing
the current configuration in /etc/cmdline.d so that dracut
will be configure the system automatically.

References: bnc#877288

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke
c64a94caa9 95fcoe: update fcoe interface check
The 'create' sysfs entry has been removed for newer fcoe modules,
so just check if the module directory exists.

References: bnc#877288

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Thomas Renninger
8d40852e8c dracut: Do not stop installing drivers if one fails
--add-drivers and --filesystems kernel drivers are added via:
instmods -c
The check option makes the function return if one driver could not get
installed without trying to install further drivers which is bad.

The user is still informed ($_silent is by default no), but all modules
passed to instmods are tried to be loaded, even if one fails.

Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke
cd72830807 95iscsi: parse output from iscsiadm correctly
Due to some obsure reason the IFS parameter is not set correctly
when evaluating get_ibft_mod(). So change the parsing to not rely
on IFS altogether.

References: bnc#886199

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Thomas Renninger
206345ce9b nfs: Add ip=... and root=nfs... parameters to internal dracut
cmdline

If the rootfs is an nfs mount, also know as nfsroot, add the correct
parameter to the dracut cmdline.

Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Thomas Renninger
4d25892179 dracut.usage.asc: Remove distro specific help from manpage
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Thomas Renninger
6df523517f dracut.sh: Fix UUID= fstab parsing in case --mount option is passed
Dracut parses /etc/fstab when --mount is option is passed (e.g. kdump).

In host_devs variable the real block device must be stored, not UUID=
There are other /etc/fstab syntax possibilities we now warn that they
are not correctly parsed. This will be fixed by another patch
when there is time to test this properly.

Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Thomas Renninger
118ca9ecfc dracut.sh: Avoid duplicate devices in host_devs
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
jloeser
3838dc47c3 Check for logfile (--logfile option) and create it if necessary
If a logfile is passed to dracut via --logfile option and doesn't
exist, dracut doesn't create it and logs nothing. Instead, dracut
should try to touch the file and print a warning if creating fails.

References: bnc#892191
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Thomas Renninger
5c84d51b3f 90lvm: Install dm-snapshot module
bnc#888530

Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Thomas Renninger
517d27a75f 99base: Increase initqueue timeout in non systemd case
In case of systemd is used the timeout already is set to 180s, compare
with file: modules.d/98systemd/dracut-initqueue.sh

Do the same if systemd is not used, e.g. in kdump case.

Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke
3ae60e559f Handle module alias properly
Some modules (like ext4) provide aliases by which the modules
can be accessed, too. But when using aliases directly dracut
fails to include the correct module. So translate the alias
into the correct module name before checking the module.

References: bnc#886839

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke
7c2311660f 99base: warn on invalid command for initqueue
When 'initqueue' is called with an invalid command it'll generate
invalid job scripts. This will lead to confusing error messages
later on.
So abort in these cases and print out a warning.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Thorsten Behrens
bd44831b82 Generate fallback mount unit for root filesystem
If kernel cmdline has no root= provided, *and* the initrd carries
a default value, create a systemd mount unit to have it available
in /sysroot

References: bnc#855258

Signed-off-by: Thorsten Behrens <tbehrens@suse.com>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Thorsten Behrens
e3eec4b8a2 Align dev_unit_name() with systemd's function.
Add more corner cases from systemd's
unit_name_from_path_instance() C function.

Signed-off-by: Thorsten Behrens <tbehrens@suse.com>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke
fe273e3901 Print stored dracut commandline during initramfs build
When generating the initramfs we should be printing out the
generated dracut commandline used for booting.
This will simplify debugging.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke
3244bf5981 Do not call 'lvm' for non-LVM device-mapper devices
If a device-mapper device is not created by LVM it's pointless
to call any 'lvm' programs got extract details; they'll be
failing anyway. So check the UUID before calling 'lvm'.
This speeds up initrd creation and avoids I/O errors on
multipath devices.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke
56663e7e32 Implement 'rd.timeout' to modify the device timeout
When generating units for devices the administrator might
want to use a different timeout than the default.
So implement a new parameter 'rd.timeout' for this.

References: bnc#878770

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Thomas Renninger
f34a2ef14d iscsi: iscsi.initiator and others can and must only show up once
Make sure duplicates of iscsi.initiator vanish.
Only get one rd.iscsi.* paramter value. If getargs is used and several
parameters are parsed, one gets two values separated by whitespace in a
variable which breaks later code and is not suppported.

Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke
c4d8793c67 95iscsi: generate commandline for software iscsi
When installing on an software iscsi root we need to generate
the correct commandline, otherwise the system cannot boot.

References: bnc#880108
Patch: 0093

When using software iscsi we should be using the existing
configuration from the system for the time being.

References: bnc#884768
Patch: 0095

Avoid bad ip route call on empty address
Patch: 0143

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke
54e28d79b9 95iscsi: More empty cmdline fixes
This fixes up some 95iscsi/module-setup.sh which might print out empty
commandline files.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke
2e34f38095 95iscsi: Fixup bnx2i offload booting
bnx2i is using a separate iSCSI offload engine with a separate
MAC address. As a result, the iBFT information is displaying
a MAC address which does not relate to any MAC address from
the network interfaces.
In addition, the iSCSI offload engine works independently on
the NIC, so we do not need to enable the NIC for iSCSI offload
to work.
This patch modifies the automatic iBFT detection to not set
the 'ip=ibft' flag when bnx2i offload is detected.

References: bnc#855747

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke
9ebf4a5d3c 95iscsi: strip one set of quotes when calling initqueue
The bad initqueue parameter passing is already addressed by git commit:
commit bb8c16d121
and
commit 486a8f33e2

However this appraoch is slightly different:
"$netroot" instead of "'$netroot'", etc.

initqueue will process the arguments, assuming the first non-option
argument to be the program to be executed. Putting the entire
commandline into this argument confuses both, initqueue and the
program in question.

References: bnc#879038

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:36 +01:00
Hannes Reinecke
a3a2266046 95iscsi: Set correct iscsi_started value for iSCSI firmware
When iSCSI firmware booting is selected we should not rely on
'netroot' or 'iscsiroot' variables to be set.

References: bnc#873448

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:35 +01:00
Hannes Reinecke
4aad3438f7 95iscsi: Install libgcc_s library
iscsiuio is using pthread, which requires libgcc_s for
pthread_cancel to work.
Without this library iscsiuio will crash with SIGABRT.

References: bnc#881692

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:35 +01:00
Hannes Reinecke
442abd16d2 95iscsi: Autodetect iSCSI firmware
Some iSCSI initiator present firmware information in
/sys/firmware/ibft or /sys/firmware/iscsi_bootX

Whenever we detect one of those directories we should assume
that the iSCSI devices should be activated.

Also incorporates SUSE patches:
0049:
95iscsi: Use 'ip=ibft' for ibft autoconfiguration

For iBFT autoconfiguration we should be setting 'ip=ibft'
instead of rd.neednet. This should instruct dracut to only
enable the iBFT interfaces and leave the rest alone.

References: bnc#879038

0054:
95iscsi: update commandline printing

dracut has a separate callout 'cmdline' which should be used
for printing out the generated commandline.

Signed-off-by: Pavel Wieczorkiewicz <pwieczorkiewicz@suse.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:35 +01:00
Hannes Reinecke
8f4ee8c71b 90multipath: install correct multipath rules
The multipath and kpartx rules have different numbers in SUSE.

The 11-dm-mpath.rules file had been missing, causing
blacklisting to not work properly.

References: bnc#873151, bnc#872662, bnc#883149

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:35 +01: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
NeilBrown
36894743e3 Fixup mdraid setup
This sed script to edit 64-md-raid-assemble.rules needs to
be adjusted for latest mdadm

References: bnc#866660

Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:35 +01:00
Thomas Renninger
ae8e6ed5af systemd always tries to load autofs4
During boot systemd tries to load autofs4, but dracut will only
add it if it's loaded by the time dracut is run.
Modify dracut to always load autofs4.

References: bnc#869411

Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:35 +01:00
Thomas Renninger
552c37e156 mkinitrd-suse: Update to sles12 SUSE state
Incorporates these patches:
- 0013 mkinitrd-suse: do not update bootloader if no kernel was found
  bnc#858268
- 0018 mkinitrd-suse: Fix whitespaces when adding drivers
- 0032 mkinitrd-suse.sh: Use '--hostonly' and '--hostonly-cmdline' correctly
  bnc#874000,bnc#874905,bnc#874363
- 0039 Remove --force parameter from mkinitrd
- 0041 mkinitd-suse: remove --hostonly and --hostonly-cmdline
  Should be set via configuration files, not in the script itself.
- 0051 mkinitrd-suse: add 'update bootloader' message
- 0120 mkinitrd-suse.sh: Bail out with exit 1 if initrd cannot be generated
  bnc#886630

Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-12-16 13:29:35 +01:00
Harald Hoyer
1f8abe81a9 dmsquash-live: setup the images in /run/initramfs
We want to cleanup / after switch_root. Placing the loop files in /
works, but it is more sane to put them in /run/initramfs
2014-12-16 12:53:18 +01:00
Harald Hoyer
25b987fed6 Fixed the dracut-shutdown.service
Make the service a oneshot service, which remains after exit. This
ensures, that the ExecStop is executed later on, if a shutdown occurs.
2014-12-08 11:32:26 +01:00
Harald Hoyer
414dc51ca2 dracut.conf.d/fedora.conf.example: turn on early_microcode 2014-12-04 11:54:47 +01:00
Tom Gundersen
ca4108b78e initrd-release: move from /etc to /usr/lib
This mimicks the similar move of os-release which was done in systemd. These
files are not configuration, but part of the OS.

Still symlinks are in place for compatibility, but those should probably be
dropped eventually.
2014-12-01 17:02:16 +01:00
Minfei Huang
c440d302f1 40network: Fix the syntax to correct the judgment sentence
In the judgment sentence, it will print the following warning message,
becasuse of lacking the blank on the left of ']'.

/lib/net-lib.sh: line 110: [: missing `]'

Signed-off-by: Minfei Huang <mhuang@redhat.com>
2014-12-01 17:02:15 +01:00
Harald Hoyer
3ae03005b8 cms/cms-write-ifcfg.sh: turn SUBCHANNELS into lowercase 2014-12-01 15:04:53 +01:00
Harald Hoyer
99d4fd6bb7 do not symlink /var/log to /run/log
some programs e.g. systemd-journald expect a directory in /var/log as
the marker to do some actions. Here journald tries to flush
/run/log/journal to /var/log/journal, if the directory is seen.

/var/log is now a symlink to /run/initramfs/log.
2014-12-01 12:36:20 +01:00
Harald Hoyer
3a04bddeed dracut.sh: add $tmpfilesdir to install files to /usr/lib/tmpfiles.d 2014-12-01 12:34:54 +01:00
Harald Hoyer
fa45d0d9c9 base/init.sh: ignore exclamation mark for kmod static-nodes
newer versions add an exclamation mark for the type, to mark it to be
created on boot only.
2014-12-01 11:50:00 +01:00
Harald Hoyer
3659d64df3 fips: add libfreeblpriv3.so and libfreeblpriv3.chk 2014-11-28 15:32:17 +01:00
Harald Hoyer
370035d561 dmsquash-live: do not abort, if user pressed ESC on checkisomd5
If the user pressed ESC while checkisomd5 runs the media check, it will
exit with "2". Previously that would mean, that the media check was not
successful.
2014-11-25 13:44:54 +01:00
Harald Hoyer
2b2033e561 multipath/multipathd.service: add more Conditions
Do not start multipathd on rd.multipath=0 rd_NO_MULTIPATH and if there
is no multipath.conf.
2014-11-25 13:23:21 +01:00
Hannes Reinecke
78a78e4239 90multipath: install dracut-specific service file
The multipathd package might install a service and a socket
file. Using the original service file from the installed
system without the socket file triggers a bug in systemd,
causing systemd to crash.

As we don't actually need to socket file in the initrd we
should be installing our own service file which does not
reference the socket file at all.

References: bnc#871610

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-11-25 13:21:03 +01:00
Hannes Reinecke
856f8265aa 90multipath: Load device_handler modules early during boot
The device handler modules need to be loaded early during boot
to avoid I/O errors being printed to the system log.

References: bnc#871617

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-11-25 13:21:03 +01:00
Hannes Reinecke
cf864c1b80 90multipath: Install libgcc_s library
multipathd is using pthreads, which require libgcc_s for
pthread_cancel to work. Without it multipathd might crash
with SIGABRT.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-11-25 13:21:02 +01:00
Harald Hoyer
26d14fb3d3 dracut-functions.sh: check if dinfo is a function
If "dinfo" is an executable, dracut-logger.sh would never be sourced.

See: https://bugzilla.redhat.com/show_bug.cgi?id=1167082
2014-11-24 15:17:45 +01:00
Harald Hoyer
e1e4ee9d7c TODO: update 2014-11-20 16:22:51 +01:00
Harald Hoyer
778b354360 multipath: add "rd.multipath=0" option 2014-11-20 11:27:40 +01:00
Colin Guthrie
af67d62151 base: Set udevd log level via environment var to cover early startup.
udevd will these days default to 'info' logging and thus will
often print out the 'starting version nnn' message (which is
logged at level 'info'), thus spamming the console, even on
'quiet' boots.

We generally expect a udev log level of err (the old default
from pre-October 2013) so we should set that explicilty before
launching udevd in order to suppress the spurious 'info' message.

As we are using the environment variable approach anyway, we
may as well use this method rather than setting the log level
later via udevadm control commands when rd.udev.info/debug are
given on the kernel command line.

The enviroment variable has been around since udev 6b493a20e1
around 2005 so should be safe to use in all cases without version
checks.
2014-11-12 13:25:27 +01:00
Harald Hoyer
027565d023 systemd: add 90-vconsole.rules
run systemd-vconsole-setup if fbcon device shows up
2014-11-06 10:44:33 +01:00
Harald Hoyer
66fd7e4329 dracut.sh: don't check gzip for --rsyncable, if pigz is available 2014-10-29 14:18:34 +01:00
Minfei Huang
56d2aed1c8 40network: Copy the customize dhcp config
It is not available to valid the customize dhcp config
/etc/dhclient.conf in the initram environment.

Dracut uses the default follow config to construct the initramfs.

request subnet-mask, broadcast-address, time-offset, routers,
        domain-name, domain-name-servers, domain-search, host-name,
        root-path, interface-mtu;

Copy the customize config to make the config availably in the
initram environment.

Signed-off-by: Minfei Huang <mhuang@redhat.com>
2014-10-29 14:13:50 +01:00
Peter Robinson
27dcc3a583 kernel-modules: Drop explicit modules that are found with block_module_filter
The usb_storage, nvme and sdhci_acpi modules are discovered with the
block_module_filter so there's no need to explicitly list them here.

Signed-off-by: <pbrobinson@gmail.com>
2014-10-29 14:13:49 +01:00
Harald Hoyer
5cac9e14ec shutdown.sh: correct return code of _check_shutdown()
fix commit b09faad877, which reversed the return code
2014-10-29 13:56:55 +01:00
Harald Hoyer
d9935e4664 Merge pull request #30 from vtolstov/master
fix gzip compress then it not supports rsyncable option
2014-10-29 13:53:40 +01:00
Vasiliy Tolstov
f95b78f3eb Merge branch 'master' of github.com:haraldh/dracut 2014-10-29 15:56:00 +03:00
Harald Hoyer
84125ddae1 Merge pull request #28 from l1k/master
shutdown/shutdown.sh: loop over shutdown hooks until all succeed
2014-10-29 13:42:25 +01:00
Harald Hoyer
2f0f1b0bbc dracut-functions.sh: fixup for 34a1ec6 for non-local mode 2014-10-29 13:39:28 +01:00
Harald Hoyer
34a1ec6a36 Merge pull request #29 from Quarky9/master
Fix location of dracut-install for local mode
2014-10-29 13:37:15 +01:00
Stefan Reimer
972d6b44ba Fix location of dracut-install for local mode 2014-10-28 17:58:56 -07:00
Harald Hoyer
3947f07d93 ifcfg/write-ifcfg: only write DEVICE for non-kernel names
Rename an interface to the kernel namespace is not allowed, so don't add
DEVICE="<iface>", if HWADDR is given.
2014-10-28 15:13:35 +01:00
Vasiliy Tolstov
3c90cc2f48 fix gzip compress then it not supports rsyncable option
dracut fail to create initramfs when compressor gzip and
it not have rsyncable option

Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
2014-10-27 13:43:13 +03:00
Harald Hoyer
1c08ad507b NEWS: add 040 entry 2014-10-24 14:41:29 +02:00
Harald Hoyer
ab2f95e45e dracut: fixed module dependency handling
Fail for "--modules" and "--force-add" dracut modules, if they or their
dependencies cannot be included.
2014-10-24 13:19:58 +02:00
Harald Hoyer
eda73c0ad2 test: add "fs-lib" to dracut module list 2014-10-24 13:19:34 +02:00
Harald Hoyer
f44b084660 TEST-99-RPM: ignore more files 2014-10-24 13:18:35 +02:00
Harald Hoyer
cfd51d2be2 TEST-30-ISCSI: udev does not export path_id for iscsi
therefore root=iscsi.... does not work anymore :-/

disabled for now
2014-10-24 13:17:30 +02:00
Harald Hoyer
d829e7fce2 dmsquash-live: addresss the device via it's symlink
Otherwise multipath parts might be passed, before it's assembled.

https://bugzilla.redhat.com/show_bug.cgi?id=1152948
2014-10-24 11:16:26 +02:00
Harald Hoyer
246d285561 Makefile: removed dangling space 2014-10-24 09:37:19 +02:00
Harald Hoyer
192990ce85 NEWS: update 2014-10-24 09:37:03 +02:00
Vaughan Cao
7a3e1a0e4a Add hyperv-keyboard kernel module for Hyper-V Gen2 VM
The synthetic keyboard of a Gen2 Linux VM doesn't work before the
hyperv_keyboard module is loaded. Without it, we can't cancel the media check
phase if boot with rd.live.check option.
Gen1 Linux VM doesn't have the same issue because the host emulates the legacy
i8042 keyboard for Gen1 VM.

Signed-off-by: Vaughan Cao <vaughan.cao@oracle.com>
2014-10-24 09:10:14 +02:00
Harald Hoyer
3507635bc6 TODO: update 2014-10-24 09:00:56 +02:00
Harald Hoyer
b4692d07ee mdraid: also accept ID_FS_UUID for rd.md.uuid
As blkid also reports MD_UUID as ID_FS_UUID, although in slightly
different format, accept it also.
2014-10-23 14:37:02 +02:00
Harald Hoyer
05065741f0 network/net-lib.sh:is_persistent_ethernet_name() eth* is not
eth* is _not_ a persistent ethernet name... tsk, tsk, tsk
2014-10-23 14:34:33 +02:00
Lukas Wunner
b09faad877 shutdown/shutdown.sh: loop over shutdown hooks until all succeed
Up until now, _check_shutdown() returns true if at least one of
the shutdown hooks succeeded. Change this to only return true if
*all* succeeded. To prevent an infinite loop, introduce an upper
bound of 40 iterations.
2014-10-06 13:43:58 +02:00
Will Woods
7e50abfdb8 do 'ip route replace default' instead of 'add'
When you define the gateway for an interface, dracut sets it up with:

  ip route add default via $gw dev $netif

If a default route is already set (e.g. if you have multiple NICs), this
will fail with the message "RTNETLINK answers: File exists".

So, if your first NIC isn't usable as a default route

Using "ip route replace default" instead allows ifup/dhclient-script to
correctly change the default route to the new interface.
2014-09-12 10:22:21 +02:00
Harald Hoyer
a49cac2e65 dracut-functions.sh: exit for missing --force-add or --add dracut modules
Better exit with fail early, so there is no surprise on reboot.
2014-09-12 10:19:28 +02:00
Harald Hoyer
5058ae2d29 qemu: install virtio_console kernel module
https://bugzilla.redhat.com/show_bug.cgi?id=1097999
2014-09-12 10:03:59 +02:00
Harald Hoyer
2f954621cc cms/cmssetup.sh: understand DASD="none"
Treat DASD="none" as unset.

https://bugzilla.redhat.com/show_bug.cgi?id=1096979
2014-09-12 09:59:03 +02:00
Harald Hoyer
d681635512 cms/cmssetup.sh: fixed indention 2014-09-12 09:58:14 +02:00
Harald Hoyer
80043e21c1 ifcfg/write-ifcfg.sh: bind bond and bridge interfaces to HW
either by s390 SUBCHANNELS or HWADDR, if the interface name is not
persistent.

Previously, this was bound unconditionally with HWADDR.
2014-09-12 09:49:58 +02:00
Harald Hoyer
37383f7123 add "--loginstall <DIR>" and loginstall="<DIR>" options
loginstall specifies a directory, in which dracut-install records all
files, which were installed from the host system to the initramfs.

Use case is e.g. to create a list of packages to watch for updates, to
maybe trigger a recreation of the initramfs.
2014-09-11 16:42:36 +02:00
Brian C. Lane
7e692cfd43 Support spaces in mount_nfs (#1109933)
nfs paths may contain spaces, make sure they are preserved when passed
to nfs_to_var and mount.

Related: rhbz#1109933
2014-09-10 11:07:44 +02:00
Harald Hoyer
e3250e2055 replaced ip=auto with ip=dhcp in the documentation
https://bugzilla.redhat.com/show_bug.cgi?id=1086931
2014-09-09 13:35:44 +02:00
Harald Hoyer
29763cb72d network/net-lib.sh: do not enforce iscsi target name policy
also untabified
2014-09-09 13:31:10 +02:00
Harald Hoyer
d4ce0e5e09 dracut.cmdline.7: add iso-scan/filename docs 2014-09-08 16:18:06 +02:00
Harald Hoyer
23ad117c49 kernel-modules: added hid-lcpower 2014-09-08 13:25:53 +02:00
Thomas Renninger
cea907f6bf dracut: Introduce --force-drivers parameter and force_drivers=+ config option
Which will not only add listed drivers, but also enforce that they are
tried to be loaded at early boot time.

This is needed if drivers which are not autoloaded (e.g. loop and a lot
others) shall get loaded via initramfs.
2014-09-08 12:37:52 +02:00
Harald Hoyer
5f2baf7dc6 dracut.sh: change the PATH we search for our binaries
/sbin /bin versions should be used over /usr/sbin and /usr/bin versions,
because non-usr is meant for early boot.

See also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=755271
2014-09-05 16:42:59 +02: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
6770af96d4 add kate and emacs per directory config files 2014-08-29 13:38:47 +02:00
Harald Hoyer
e7ba1392e1 install: add more error handling
also limit local variable scopes
and remove bogus checks to negativity of unsigned vars
2014-08-29 13:37:40 +02:00
Harald Hoyer
c23d6ce6ea skipcpio: limit the local var scope 2014-08-29 13:26:32 +02:00
Harald Hoyer
e81836f328 Makefile: add more warnings to CFLAGS 2014-08-29 13:25:54 +02:00
Harald Hoyer
4f03054e54 dracut-shutdown now executes the unpacking on ExecStop
To ensure that unpacking happens before any boot.automount is stopped,
let dracut-shutdown start as a sysinit.target service and unpack on
ExecStop.
2014-08-21 18:45:52 +02:00
Harald Hoyer
85752f0f5f dracut-lib.sh:dev_unit_name(): use systemd-escape, if available 2014-08-21 16:45:12 +02:00
Harald Hoyer
7c752ffaef dracut-lib.sh:cancel_wait_for_dev() fixed double escape 2014-08-21 16:38:35 +02:00
Harald Hoyer
e27ecc9ae8 dracut.sh: source dracut-version.sh earlier than dracut-functions.sh
Otherwise dracut-logger.sh outputs an empty version on journal testing.

Aug 20 10:15:49 lenovo dracut[11144]: dracut-
Aug 20 10:15:49 lenovo dracut[11148]: Executing: /sbin/dracut
2014-08-20 10:21:43 +02:00
Harald Hoyer
8e3f653749 Check kernel config for early microcode and ACPI override
Disable early microcode and ACPI override, if the kernel does not
support it.
2014-08-20 10:13:55 +02:00
Harald Hoyer
e84af01462 url-lib: check for ctorrent binary before adding the url handler 2014-08-15 17:35:11 +02:00
Antony Messerli
338bad6393 Adds bittorrent support for live images
This patch adds bittorrent support to 45url-lib for those that might want
to retrieve the same live image for multiple systems at once without
saturating the network.

This patch requires ctorrent to be installed into initramfs.

Torrent kernel command line format:
root=live:torrent://example.com/liveboot.img.torrent

Start a tracker:
bttrack --bind <tracker_ip> --port 6969 --dfile dstate --reannounce_interval 60

Create the torrent:
ctorrent -t live_image -u http://<tracker_ip>:6969/announce -s live_image.torrent

Seed the initial torrent:
ctorrent live_image.torrent

Boot the live image.
2014-08-15 17:29:33 +02:00
Major Hayden
504c0a8fec Adding support for read/write filesystem images
A user can provide a filesystem image (rootfs.img) inside a compressed
tarball and that filesystem image will be mounted read/write.  This provides
some benefits over a device mapper snapshot overlay, especially when the
live system becomes full.  The boot command line simple needs
"rd.writable.fsimg" added to utilize this feature.

Additional documentation for this option as well as other live boot
options is included.

Signed-off-by: Major Hayden <major@mhtx.net>
2014-08-15 16:05:19 +02:00
Harald Hoyer
bc140a0b29 50-dracut.install: install pregenerated initrd
If there is an already pregenerated initrd at the same location as the
kernel install that and do not generate a new one.
2014-08-15 14:58:34 +02:00
Harald Hoyer
ccb8ce0403 50-dracut.install: fixed /proc/cmdline reading
and beautified the code a bit
2014-08-15 14:58:02 +02:00
Harald Hoyer
95957248a1 51-dracut-rescue.install: fixed /proc/cmdline read 2014-08-15 14:56:59 +02:00
Harald Hoyer
99128f2b64 Makefile:rpm: wget the lgpl license for Source1 2014-08-15 14:03:39 +02:00
Harald Hoyer
80626ded3e Generate reproducible initramfs images
With the same source of files, it should be possible to generate the
same image file with every dracut run.

To accomplish this, we modify the timestamps of the files we generate at
runtime, call gzip with "-n" and cpio with "--reproducible".

The cpio --reproducible option is not yet upstream though, so if you
feel like it should be then please nag at the cpio mailing list.
http://lists.gnu.org/archive/html/bug-cpio/2014-08/msg00000.html
2014-08-15 13:52:02 +02:00
Harald Hoyer
9efb74a32d dracut-functions.sh:get_persistent_dev(): use printf, instead of echo 2014-08-15 12:36:04 +02:00
Nicolas Chauvet
49fe860b22 Introduce ARM specific modules needed by drm 2014-08-15 12:35:01 +02:00
Nicolas Chauvet
b96ea1e196 Categorize needed modules on ARM 2014-08-15 12:35:01 +02:00
Nicolas Chauvet
4a3f3ba68c Test soc path for modalias needed by drm
On ARM, both pci and soc path can be tested for drm.

With this patchset, that was missing in recent kernel,
the tegra_drm case is not needed anymore:
http://patchwork.ozlabs.org/patch/361765/
http://www.spinics.net/lists/linux-tegra/msg17948.html
2014-08-15 12:35:01 +02:00
WANG Chao
a628b7caf5 dracut-functions: get_persistent_dev() fall back to the original name
In case of raw disk/partition, ex. /dev/vda1, which doesn't contain any
filesystem on it. get_persistent_dev() would return empty. Now fix it to
return its original name, /dev/vda1 in above case. So that we don't have
to check its return string every time.

Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-08-15 12:35:01 +02:00
Harald Hoyer
11b5db88c2 dracut.usage.asc: also add a link for RHEL-7 storage admin guide 2014-08-15 11:50:31 +02:00
Harald Hoyer
e02a29e7a2 dracut.usage.asc: extend parameters for shutdown debug procedure 2014-08-15 11:44:26 +02:00
Harald Hoyer
ae488efa5e i18n: check for $i18n_install_all == "yes" rather than being set
i18n_install_all="no" does not have the expected effect without this
patch
2014-08-14 12:56:53 +02:00
Alex Harpin
32125a976b bridging: update the ifcfg files generated for bridge slaves
Update the ifcfg files generated for bridge slaves so they reference
the bridge they are part of.  Related to early patch submitted as a
fix for Bug #1123552.

Bug #1123552 https://bugzilla.redhat.com/show_bug.cgi?id=1123552
2014-08-11 20:16:06 +02:00
Harald Hoyer
068531232b test: make testsuite work with the new systemd minimal root req
systemd needs more directories to switch root
2014-08-08 13:34:04 +02:00
Harald Hoyer
2db6d71118 fixed bridge setup
renamed "ethnames" in bridge.info to "bridgeslaves"

fixed ifcfg generation
2014-08-01 13:16:29 +02:00
Harald Hoyer
4e1f8d0c5f TEST-20-NFS: add more commands and fix client root dirs 2014-08-01 13:15:44 +02:00
Harald Hoyer
28d03673f9 TEST-20-NFS:client-init.sh: add shell on rd.shell 2014-08-01 13:15:05 +02:00
Harald Hoyer
ba7dab6dba NEWS: update 2014-07-29 11:04:09 +02:00
Harald Hoyer
caa72f8290 dracut.spec: fixed license file packaging 2014-07-24 14:47:14 +02:00
Harald Hoyer
eab9b75c8a dracut.sh: add DRACUT_PATH
DRACUT_PATH can now be used to specify the PATH used by dracut
to search for binaries instead of the default
/usr/sbin:/sbin:/usr/bin:/bin

This should be set in the distribution config file
/usr/lib/dracut/dracut.conf.d/01-dist.conf
2014-07-22 15:09:02 +02:00
Harald Hoyer
ece72160ce test/TEST-30-ISCSI: add rd.shell to client root 2014-07-22 14:22:21 +02:00
Harald Hoyer
54b68829b6 add "--install-optional" and install_optional_items 2014-07-22 14:09:06 +02:00
Harald Hoyer
7b46244bb9 network: add rd.route parameter 2014-07-22 11:52:52 +02:00
Harald Hoyer
ad8638e04e base/dracut-lib:pidof() turn off debugging 2014-07-22 11:51:40 +02:00
Peter Robinson
611c895772 ARM: update modules for ARM host only options 2014-07-22 09:03:33 +02:00
Harald Hoyer
4ef45f13f4 dracut-functions.sh: fix inst*() functions for "-H" handling
because some inst*() functions check the existance of the source files
and do not know about the "-H" option, some failed to install the
hostonly files.
2014-07-21 16:59:49 +02:00
Praveen_Paladugu@Dell.com
f4eb0d9804 Installing an OS with VLAN enabled to an ISCSI LUN (from ibft)
When installing OS to a VLAN enabled iscsi LUN (extracted from iBFT), "/tmp/net.{xyz}.has_ibft_config" is not being set properly.

Then anaconda installer requires 'BOOTPROTO="ibft"' populated in ifcfg of the vlan interface (ex: ibft0.20), for it to properly populate the kernel parameters post installation. The setting 'BOOTPROTO="ibft"' is populated by write-ifcfg.sh script only if the corresponding interface has a file /tmp/net.{xyz}.has_inft_config

To get around this issue, in ibft_to_cmdline() function in net-lib.sh file, I made the following changes to populate the has_ibft_config file for the vlan interface(ex: ibft0.20):
2014-07-17 16:36:39 +02:00
Harald Hoyer
5ea0be0a8c dracut-functions.sh: speed up ldconfig_paths() 2014-07-08 12:54:21 +02:00
Harald Hoyer
4adeefc4ab plymouth: also find the pkglibdir on debian 2014-07-08 11:50:51 +02:00
Harald Hoyer
6cd7001b35 dracut.sh: always copy prelink files in FIPS mode
regardless of the the prelink={yes|no} switch
2014-07-08 11:50:04 +02:00
Harald Hoyer
fecc1d69e5 lvm:module-setup.sh: check for existance of 69-dm-lvm-metad.rules
fixup for 12819a5799
2014-07-03 15:04:17 +02:00
Alexander Tsoy
8ca5e8c319 modsign: do not hardcode path to keyctl
https://bugs.gentoo.org/show_bug.cgi?id=506094
2014-07-03 09:22:48 +02:00
Harald Hoyer
267a109a81 NEWS: update for version 038 2014-06-30 12:03:12 +02:00
Harald Hoyer
44537b7bf8 TEST-15-BTRFSRAID: install /etc/os-release
makes systemd switch-root happy
2014-06-30 12:03:12 +02:00
Harald Hoyer
e54d961160 test: add udev settle after sfdisk 2014-06-30 12:03:12 +02:00
Harald Hoyer
f1a38e5294 ifcfg: depends on network 2014-06-30 12:03:12 +02:00
Harald Hoyer
6525182bfc base/init.sh: use loop counter with unique varname
$i can be polluted too easily
2014-06-30 12:03:12 +02:00
Harald Hoyer
1ea5879085 resume: only install hostonly files, if in hostonly mode 2014-06-30 12:03:12 +02:00
Harald Hoyer
f232f6623d Add "rd.cmdline=ask" kernel command line parameter
prompts the user for additional kernel command line parameters
2014-06-30 12:03:12 +02:00
Harald Hoyer
30f6c80d7a default to hostonly_cmdline=yes, if hostonly
if hostonly_cmdline is not yet set, set it to "yes", if in hostonly
mode.
2014-06-30 12:03:12 +02:00
Harald Hoyer
54483dd773 kernel-modules: add tegra arm modules 2014-06-30 12:03:11 +02:00
Harald Hoyer
b0d844fa74 TEST-04-FULL-SYSTEMD/test.sh: removed debug comments 2014-06-30 12:03:11 +02:00
Harald Hoyer
fbc4620f05 print out, what kernel command line parameters are used 2014-06-30 12:03:11 +02:00
Harald Hoyer
7e59d55042 usable_root(): only check for ld-*.so
current systemd allows booting with only /usr on the root partition

see, if we can find an elf loader
2014-06-30 12:03:11 +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
899f5962ac Makefile: add debugtestimage and debughostimage targets 2014-06-25 11:43:44 +02:00
Harald Hoyer
26cd262a6a install: add -H flag for install
inst* functions and dracut-install now accept the "-H" flag, which
logs all installed files to /lib/dracut/hostonly-files. This is used
to remove those files, if rd.hostonly is given on the kernel command line.
2014-06-25 11:42:53 +02:00
Hari Bathini
05d2a14526 lsinird: Adding option "-m|--mod" to list dracut modules in the image
This patch adds option "-m|--mod" to lsinitrd to list dracut
modules in the image  because sometimes  having an option to
only list the dracut modules in the image could be handy.

Sample output:
--------------

[hbathini@localhost dracut]$ sudo ./lsinitrd.sh initramfs-3.11.10-100.fc18.x86_64.img -m
Image: initramfs-3.11.10-100.fc18.x86_64.img: 33M
========================================================================
Version: dracut-029-1.fc18.2

dracut modules:
i18n
network
ifcfg
drm
plymouth
btrfs
crypt
dm
dmraid
kernel-modules
lvm
mdraid
cifs
iscsi
nfs
resume
rootfs-block
terminfo
udev-rules
biosdevname
systemd
usrmount
base
fs-lib
shutdown
========================================================================

Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
2014-06-20 14:34:30 +02:00
Tobias Geerinckx
773d6a7ded lsinitrd.sh: don't choke on LZO-compressed images
lsinitrd (and hence dracut) currently fail to list the contents of any
LZO-compressed image, and merely spit out misleading xzcat errors.

I guess no-one actually uses them.
2014-06-20 14:34:29 +02:00
Daniel Schaal
7eb0bc7bc4 98systemd: also install systemd-journald-dev-log.socket
The /dev/log socket was moved to /run on systemd 214, install the
newly added socket unit.
2014-06-20 14:34:28 +02:00
Cristian Rodríguez
f46c2fff71 systemd: Optionally, include efivarsfs module
It is, however not an error if this module can't be found.
2014-06-20 14:34:27 +02:00
Harald Hoyer
5580e4c176 deprecate "ip=ibft" kernel command line parameter
rd.iscsi.ibft[=1] should be used instead.

Thing is, 'ip=ibft' is not really an ip setting, but rather a marker
that iBFT should be evaluated.

Also removed the trigger of the warning:
"Warning: Please supply bootdev argument for multiple ip= lines"
2014-06-20 14:27:09 +02:00
Harald Hoyer
8dcc483053 dracut.sh: add libgcc_s, if libpthread is installed
workaround the fact, that pthread_cancel() wants to
dlopen libgcc_s.so.1
2014-06-20 11:19:49 +02:00
Harald Hoyer
bb8c16d121 iscsi: correctly install the settled iscsiroot dummy call
initqueue parses $1 as the executable command
2014-06-11 14:58:55 +02:00
Harald Hoyer
486a8f33e2 iscsi: correctly install the timeout iscsiroot dummy call
initqueue parses $1 as the executable command
2014-06-11 14:55:11 +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
Vasiliy Tolstov
28f3f537c4 network/ifup.sh: Don't try to modprobe ipv6, if already available
Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>

[Edited-by: Harald Hoyer]
Simplified logic.
2014-06-03 12:49:56 +02:00
Alex Harpin
83c9ff7dbb bonding: use hwaddr of the slave rather than the master
When a bonded interface is brought up, any slaves included in the bond
have their hardware address set to that of the bond master.  Although
this allows an interface to be brought up on start up, when the
configuration file is imported into the booted system it prevents
the bonded interface being successfully restarted.

The fix involves obtaining the hardware address of the slaves before
they are added to the bond and then using this value in the
configuration file.
2014-06-03 12:26:01 +02:00
Peter Robinson
827ec27a9c kernel-modules: Fix storage module selection for sdhci/mmc/ahci
Currently the block driver detection for generic initrd doesn't include
the SD/MMC drivers so we fail to boot generic images on any device using
those platforms as boot devices when using a generic initrd. Add logic
to detect those modules. This primarily fixes embedded ARM devices but
also likely intel tablets/dev boards and enterprise hypervisors that
have the ability to boot from SD.

Also the ahci_init_controller misses a number of drivers that use the
libahci_platform module for the init so this fixes some missing achi
moduless too.

Finally it cleans up the ARM storage module hacks that the above now
deals with in a more generic manner.

Signed-off-by: <pbrobinson@gmail.com>
2014-05-23 15:44:00 +02:00
Harald Hoyer
0fa5dbedc5 dracut-functions.sh:require_binaries() clarify message
The info message written by require_binaries() was a bit frighten to
users. So just be a little bit more verbose.

If you have ideas on how to improve the message for these "soft"
dependency modules, please submit patches.
2014-05-20 13:23:43 +02:00
WANG Chao
ce7f408dfd dracut-pre-pivot pulls in remote-fs.target
It turns out that commit f30b74e (dracut-initqueue service runs before
remote-fs-pre.target) is partial fix for remote fs mounts. Because no
one pulls in remote-fs.target, we can never start remote fs mounts.
Now pull in remote-fs.target in dracut-pre-pivot.

Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-05-20 11:40:44 +02:00
Alexander Tsoy
c4b529f503 resume/module-setup.sh: filter out empty resume= options in cmdline()
cmdline() prints empty "resume=" options for non-persistent swap
devices, for example zram. Add a check for that.

This patch also fixes printf formatting and removes unused variables.
2014-05-20 11:40:43 +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
Hannes Reinecke
ed2005fa5b 98systemd: fixup rootfs-generator installation path
The rootfs-generator was installed in the wrong path
in the initrd, cause it never to be run.

References: bnc#878714

Signed-off-by: Hannes Reinecke <hare@suse.de>
2014-05-20 11:40:42 +02:00
Harald Hoyer
7a94a4326f dracut-functions.sh:print_vars() fix for values with spaces
for a variable with spaces, e.g.:
EXT_KEYMAPS='backspace keypad euro2'

The following would occur:
print_vars: eval printf -v _value %s '$EXT_KEYMAPS'
print_vars: printf -v _value %s backspace keypad euro2
print_vars: [[ -n backspacekeypadeuro2 ]]
print_vars: printf '%s=\"%s\"\n' EXT_KEYMAPS backspacekeypadeuro2

Thanks to Sebastian Köln for the fix!
2014-05-20 11:31:16 +02:00
Harald Hoyer
1427102692 fcoe-uefi/parse-uefifcoe.sh: fixed parameter generation from UEFI
"fcoe=" was missing for the parameter specifying the interface
2014-05-20 11:22:26 +02:00
Harald Hoyer
056a3f2427 nbd/nbdroot.sh: call nbd-client with "--systemd-mark"
otherwise nbd-client will get killed by systemd
2014-05-16 13:33:33 +02:00
Harald Hoyer
8fa1afb65c ifcfg/write-ifcfg.sh: include net-lib.sh
otherwise is_persistent_ethernet_name() is missing
2014-05-16 13:33:17 +02:00
Harald Hoyer
19bb14c346 mdraid/module-setup.sh: fixed print-cmdline for empty UUID
fixes

/usr/lib/dracut/modules.d/90mdraid/module-setup.sh: line 60:
_activated["${UUID}"]: bad array subscript

Thanks to Jan ONDREJ for spotting this!
2014-05-14 16:38:49 +02:00
Harald Hoyer
56d57a70ec cms/cmssetup.sh: convert SUBCHANNELS to lowercase
In udev rules, the channels need to be expressed in lower case.
2014-05-12 14:37:27 +02:00
Harald Hoyer
1230f3bcff ifcfg/write-ifcfg.sh: "IPV6INIT=yes" check also for non-dhcp 2014-05-12 13:53:38 +02:00
Harald Hoyer
636cc1ef63 resume/parse-resume.sh: correctly write timeout hook 2014-05-07 15:30:01 +02:00
Harald Hoyer
535f61ca4a Do not log to kmsg/syslog and files for "--print-cmdline" 2014-05-07 14:59:13 +02:00
Harald Hoyer
4e58a1ffc7 dracut-lib.sh: fixed return value of pidof()
pidof always returned with 0, so any "while pidof" loop would not
terminate.

Thanks "Consus" for the hint!
2014-05-07 13:34:31 +02:00
Harald Hoyer
48b7ab1b35 i18n/parse-i18n.sh: fixed typo s/$key/$_key
Thanks xtraeme!
2014-04-28 12:47:45 +02:00
Chapman Flack
9cf339ada3 Correct strstr/strglobin in test suite.
Previous commit included versions of strstr/strglobin in the test
suite files that did not match those in dracut-lib.sh.
2014-04-07 10:49:07 +02:00
Chapman Flack
2c19a5fa78 Specify strstr tightly, add strglob/strglobin.
By convention, strstr should be a literal string match. Previously, it
would match as a glob pattern. Some code used that, so add new
functions strglob and strglobin to do what that code expects, and
specify them tightly too. strglob tests whether the glob pattern
matches the entire string (the name strglob is also used in the yorick
language, and that's what it does there), while strglobin tests whether
the glob pattern matches anywhere in the string.

Also tightens str_starts, str_ends, and str_replace to deal with
literal strings only. In a quick grep I did not find code that depended
on these functions matching globs.

Changes the call sites where strstr was used with glob patterns to use
strglobin or strglob as the intention seemed to be (or, in one case,
strstr with the * removed as it did not affect the result anyway).
2014-04-07 10:49:07 +02:00
Harald Hoyer
2e094b20a6 ifcfg: only bind to HWADDR, if addr_assign_type == 0
/sys/class/net/$netif/addr_assign_type is != 0 for random MAC address
interfaces
2014-04-04 12:52:39 +02:00
Harald Hoyer
fb0e5184a6 ifcfg: do not bind persistent interface names to HWADDR 2014-04-04 12:48:32 +02:00
Harald Hoyer
100d575ec9 fs-lib: always install fsck.$fs, if present 2014-04-04 11:34:10 +02:00
WANG Chao
b31250e7e6 dracut-initqueue service runs before remote-fs-pre.target
With the following commit, dracut doesn't mount anything from /etc/fstab

commit e920bfb
Author: WANG Chao <chaowang@redhat.com>
Date:   Tue Apr 1 15:20:49 2014 +0800

    fstab: do not mount and fsck from fstab if using systemd

But systemd doesn't mount nfs at all, because no unit is pulling in
remote-fs.target.

dracut must pull in these remote fs mount and all these remote mounts
should start only after network is up (ie. after dracut-initqueue).

Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-04-03 09:51:43 +02:00
Chapman Flack
ddfea6b54c Break at switch_root only for bare rd.break
Previously, any rd.break=breakpoint would cause a break at the
given breakpoint and also at switch_root.
2014-04-03 08:56:52 +02:00
Harald Hoyer
12819a5799 lvm:module-setup.sh: check for existance of 69-dm-lvm-metad.rules
Before modifying 69-dm-lvm-metad.rules, we should check for the
existance first. Otherwise this results in error messages on
distributions (debian), which do not ship these rules.
2014-04-03 08:54:27 +02:00
Harald Hoyer
d4dd3521bb ifcfg/write-ifcfg.sh: turn on IPV6INIT, if any inet6 address is found
If "ip -6 addr" finds any inet6 address, assume IPV6INIT=yes for the
ifcfg file.
2014-04-03 08:53:09 +02:00
WANG Chao
e920bfb1e8 fstab: do not mount and fsck from fstab if using systemd
If using systemd in initramfs, we could run into a race condition when
dracut and systemd both are trying to mount and run fsck for the same
filesystem, and mount or fsck could be a failure.

To fix such failure, we should use systemd to mount/fsck from /etc/fstab
only.

v2: check $DRACUT_SYSTEMD suggested by Alexander Tsoy

Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-04-02 09:58:52 +02:00
Harald Hoyer
3c530fc528 fcoe: workaround fcoe timing issues 2014-04-02 09:58:12 +02:00
Harald Hoyer
37502d2733 dm: add dm-cache modules
https://bugzilla.redhat.com/show_bug.cgi?id=1081435
2014-04-02 09:58:11 +02:00
Harald Hoyer
ebe7411691 network: DCHPv6: set valid_lft and preferred_lft
https://bugzilla.redhat.com/show_bug.cgi?id=1064365
2014-04-02 09:58:11 +02:00
Harald Hoyer
fd9f902477 lsinitrd.sh: prevent < <$() construct
Running dracut in a chroot environment, which has /dev not correctly
setup will result in errors like:

/usr/bin/lsinitrd: line 164: /dev/fd/62: No such file or directory
cpio: Malformed number �5�OK��
cpio: Malformed number 5�OK��
cpio: Malformed number �OK��

This is because bash wants /dev/fd/<num> for constructs like:
foo < <$(bar)
2014-04-01 08:21:49 +02:00
Harald Hoyer
2c7f7a337a network: handle "ip=dhcp6" for all interfaces
https://bugzilla.redhat.com/show_bug.cgi?id=1064365
2014-03-25 16:06:53 +01:00
Harald Hoyer
3aaf6ccc83 fcoe: wait for lldpad to be ready 2014-03-25 15:31:00 +01:00
Harald Hoyer
a9f4b9cdb0 systemd: add systemd-gpt-auto-generator 2014-03-20 13:42:08 +01:00
Harald Hoyer
0626cbe923 dracut-initramfs-restore: fix unpacking with early microcode 2014-03-20 13:18:13 +01:00
Harald Hoyer
96087189e6 NEWS: update for 037 2014-03-19 17:16:08 +01:00
Harald Hoyer
51160a47b1 systemd/dracut-shutdown.service: make failure non-fatal 2014-03-18 13:33:55 +01:00
Harald Hoyer
68dc90c6e9 shutdown: if kexec failed, do a simple reboot 2014-03-18 13:21:22 +01:00
Harald Hoyer
a9d30a4066 network:dhclient-script do PREINIT6 for DHCP6 2014-03-17 13:00:17 +01:00
Harald Hoyer
0cb42c27f9 lvm:lvm_scan.sh handle one LV at a time with lvchange 2014-03-11 12:16:14 +01:00
Harald Hoyer
2bdf760fe0 NEWS: update for dracut-037 2014-03-06 09:55:19 +01:00
Harald Hoyer
ce4167060c AUTHORS: update 2014-03-06 09:55:19 +01:00
Harald Hoyer
ee4b74fb9c Do not wait_for_dev if hostonly_cmdline not set 2014-03-06 09:55:19 +01:00
Harald Hoyer
f60b7d8655 fcoe-up: remove initlog logic 2014-03-05 13:21:25 +01:00
Harald Hoyer
99edb47e85 default conf: set hostonly_cmdline == "no" 2014-03-05 12:33:40 +01:00
Harald Hoyer
8ee1825364 dracut: don't let devices timeout
https://bugzilla.redhat.com/show_bug.cgi?id=949697
2014-03-05 12:32:10 +01:00
Harald Hoyer
83a3cba777 dracut-functions.sh: degrade info about missing binaries to info 2014-03-05 12:23:49 +01: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
WANG Chao
646e0506f6 Add -[-no]-hostonly-cmdline option handling for getopt
commit ab9457e introduce such new options but it missed to add these
options to getopt arguments.

Signed-off-by: WANG Chao <chaowang@redhat.com>
2014-03-03 12:41:28 +01:00
Harald Hoyer
3a62030116 test/TEST-50-MULTINIC/client-init.sh: skip MAC marker files 2014-02-28 13:26:13 +01:00
Harald Hoyer
be1c0381e5 test/Makefile: add SKIP env to skip certain tests 2014-02-28 13:25:39 +01:00
Harald Hoyer
6fe0abbf12 test: add missing Makefile.testdir 2014-02-28 12:57:57 +01:00
Dave Young
5f6a495bf4 add default values in fstab_lines
It's useful for passing a full fstab line including like fs_passno so fsck
can take effect.

Previously it's assumed that there's no fs_freq and fs_passno in fstab lines
so original code just append "0 0" at the end of each fstab lines.

Improve this issue by assign default value in case they are not passed in.
Three field are handled here:
fs_mntops: default to "defaults"
fs_freq: default to "0"
fs_passno: default to "2"

Signed-off-by: Dave Young <dyoung@redhat.com>
2014-02-28 12:10:47 +01:00
Harald Hoyer
1f680ccc9b systemd: add systemd-sysctl service
https://bugzilla.redhat.com/show_bug.cgi?id=1070086
2014-02-28 12:10:45 +01:00
Harald Hoyer
43a85a7365 network: merge setup_net_$netif.ok and net.$netif.did-setup
one marker per interface is enough
2014-02-28 12:10:41 +01:00
Harald Hoyer
61b4afb424 network: IPv6 status, wait for tentative flag to be cleared
also do not arping the IPv6 address.
2014-02-27 12:13:18 +01:00
Harald Hoyer
2ac599dc75 network/dhclient-script.sh:DHCP IPv6 interface setup
configure IPv6 interface for DHCP6

https://bugzilla.redhat.com/show_bug.cgi?id=1064365
2014-02-26 15:02:51 +01:00
Harald Hoyer
7f70f81153 network/net-lib.sh:wait_for_ipv6_auto() also wait for the tentative flag
Wait until the tentative flag is cleared.

https://bugzilla.redhat.com/show_bug.cgi?id=1069263
2014-02-26 15:02:48 +01:00
Harald Hoyer
79b3c8bfa1 ifcfg/write-ifcfg.sh: do not bind s390 to MAC if SUBCHANNELS set
If SUBCHANNELS are set, do not specify HWADDR, because the SUBCHANNELS
are the identifier for the interface.

https://bugzilla.redhat.com/show_bug.cgi?id=1056438
2014-02-26 15:02:46 +01:00
Harald Hoyer
fa795f29e2 systemd/rootfs-generator.sh: generate units in /run/systemd/generator
Generate the units in /run/systemd/generator, so they are picked up by
systemd.

https://bugzilla.redhat.com/show_bug.cgi?id=1069133
https://bugzilla.redhat.com/show_bug.cgi?id=949697
2014-02-26 15:02:42 +01:00
Harald Hoyer
ab9457efd7 Add flag to toggle hostonly cmdline storing in the initramfs
--hostonly-cmdline:
    Store kernel command line arguments needed in the initramfs

--no-hostonly-cmdline:
    Do not store kernel command line arguments needed in the initramfs
2014-02-26 15:01:55 +01:00
Harald Hoyer
103c5e1ecb systemd: add 70-uaccess.rules 2014-02-26 14:56:28 +01:00
Amadeusz Żołnowski
4eec1a2276 Added missing quotes
See bug report at https://bugs.gentoo.org/show_bug.cgi?id=502064
2014-02-26 14:55:54 +01:00
Alexander Tsoy
8a2db478de Add legacy flag (-l) to lz4 and update magic number
Linux kernel does not support the new default lz4 format.

https://bugs.gentoo.org/show_bug.cgi?id=502102
2014-02-26 14:55:54 +01:00
sfalken@opensuse.org
6e53596cec Patch for Manpage
Patch corrects grub paths in the manpage for both GRUB legacy and GRUB2
2014-02-26 14:55:54 +01:00
Harald Hoyer
dc4c1ee39d dracut.sh: write directly to the output file
Because we already remove the output file before writing to it, we don't
have to play games and write to a temporary file first.
2014-02-19 15:22:39 +01:00
Harald Hoyer
d1c4e5c521 fcoe-uefi: try all FcoeBootDevice-* variables for a DevicePath
try to read the DevicePath from all FcoeBootDevice-* UEFI variables
until one has a MAC.
2014-02-19 15:20:34 +01:00
Harald Hoyer
a324c2111e iscsi: for iBFT read the initiator-name from the correct file
/sys/firmware/ibft/initiator-name should be
/sys/firmware/ibft/initiator/initiator-name

https://github.com/haraldh/dracut/issues/12
2014-02-19 11:49:34 +01:00
Harald Hoyer
e8a7c9bc93 dracut-functions.sh:find_kernel_modules_by_path() fixed updates search
"updates/*" path does not start with "/"
2014-02-17 13:29:42 +01:00
Harald Hoyer
cb802bfbc7 iscsiroot: touch the right marker file 2014-02-12 18:26:36 +01:00
Harald Hoyer
a0b2c69441 kernel-modules: add sdhci_acpi to the static list of kernel modules
Thanks Adam Williamson!

https://bugzilla.redhat.com/show_bug.cgi?id=1063556
2014-02-12 11:23:38 +01:00
Till Maas
9835859f21 Cryptroot-ask.sh: Remove duplicate code
Remove duplicate code introduced with commit
9b5e2e8574.
2014-02-10 11:02:32 +01:00
Till Maas
9b5e2e8574 Cryptroot-ask.sh: Use variables consistently
- Always use $luksname instead of sometimes $2
- define $asked_file instead of using the same path twice
2014-02-09 14:12:44 +01:00
Colin Guthrie
8da51857f0 dracut.sh: Fix variable name typo.
This caused the root_dev variable not to be set which in turn meant that
the root device was not whitelisted in 99base/module-setup.sh when injecting
compile-time devexists hooks in hostonly initrds. This ties the generated
initrd to the root fs device (typically the UUID) rather than relying solely
only the root= kernel command line.

While it is hostonly, not hardcoding e.g. UUIDs is still desirable. Any
swap partition on the host device is still added however.
2014-02-07 18:05:48 +01:00
Brian C. Lane
460cddffa1 new_dhcp_next_server is really new_next_server
The variable that dhclient sets doesn't have dhcp in the name. This
could cause problems with setups where the server is not the same as the
dhcp server.
2014-02-07 18:05:48 +01:00
Harald Hoyer
fac3275a43 network:fix dns parsing in ip= parameter 2014-02-07 15:41:50 +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
Harald Hoyer
8d21728942 systemd: add sys-kernel-config.mount 2014-02-05 13:58:33 +01:00
Harald Hoyer
352d557d4d Do not reload systemd with wait_for_dev 2014-02-05 13:12:29 +01:00
Harald Hoyer
751c7de98a systemd/dracut-pre-pivot: run for /dev/{nfs,root} and cleanup /dev/nfs
dracut-pre-pivot was not cleaning up /dev/nfs and did not run to clean
up /dev/root.
2014-02-05 13:08:54 +01:00
Harald Hoyer
81aed4f28e nfs/nfsroot: symlink /dev/null to /dev/nfs, as a marker for root=/dev/nfs 2014-02-05 13:06:29 +01:00
Harald Hoyer
c84618d7ac network/ifup: do not run dhclient twice on the same interface 2014-02-04 12:02:34 +01:00
Harald Hoyer
d61a423f7c network/ifup: do not ifup an already setup network interface 2014-02-04 12:02:05 +01:00
Harald Hoyer
f52759131b test: include the same Makefile.testdir 2014-02-04 12:01:11 +01:00
Harald Hoyer
c860837303 base/rdsosreport.sh: add dracut version to rdsosreport 2014-01-31 15:33:41 +01:00
Harald Hoyer
1982098e00 network/ifup.sh: handle $dns1 and $dns2 from "ip=" settings 2014-01-30 17:38:27 +01:00
Harald Hoyer
e95e48c6ee network/net-lib.sh: parse ibft nameserver settings 2014-01-30 17:38:27 +01:00
Harald Hoyer
f57850d7e8 dracut-functions.sh: also search in the updates directory 2014-01-30 17:38:27 +01:00
Harald Hoyer
c8a9a6b4a7 dracut.sh: only set the owner of files to 0:0, if generated as non-root
If the root user generates the initramfs image, preserve the ownership
of the files. This of course cannot be done for non-root users
generating an initramfs image.
2014-01-30 16:18:04 +01:00
Harald Hoyer
66bfe863f5 network: understand ip=.....:<dns1>:<dns2> 2014-01-30 13:50:02 +01:00
Harald Hoyer
d50a99c5ce NEWS: update for version 036 2014-01-29 08:37:43 +01:00
Harald Hoyer
a7316ae4f7 skipcpio: fixed signatured check 2014-01-29 08:35:47 +01:00
Cristian Rodríguez
6b449e8a6d skipcpio: return something at end of program
Otherwise the compiler emits a warning and the return vale is
in theory undefined.
2014-01-29 08:32:17 +01:00
Harald Hoyer
ba9368fa4f dmsquash-live/dmsquash-liveiso-genrules.sh: s/loop0/loop-control/
If loop is a kernel module, /dev/loop0 will never show up as a udev
event, if the loop module is not manually loaded somewhere.
2014-01-28 18:33:36 +01:00
Stig Telfer
1f28dfb2e4 url-lib: extend to enable TFTP support
Libcurl has wider capabilities than those assigned to it by Dracut.
In this patch to url-lib I've added registration for TFTP URLs,
which I've found to be useful.

Enjoy,
Stig Telfer
2014-01-28 15:43:40 +01:00
Harald Hoyer
41351164f8 NEWS: dracut-035 2014-01-28 15:33:29 +01:00
Harald Hoyer
855a549660 Makefile: make dracut.html.sign depend on dracut.html 2014-01-28 15:07:21 +01:00
Harald Hoyer
5c5350b30b dracut.spec: add skipcpio 2014-01-28 12:21:33 +01:00
Stig Telfer
6cc8f694b5 dracut-lib.sh: bugfix for pidof function
In follow-up, the patch requires a second mod: kernel tasks have a /proc/.../exe that links to nothing and derails the for loop:
2014-01-28 12:19:27 +01:00
Stig Telfer
abdf191b64 dracut-lib.sh: bugfix for pidof function
It appears there is a simple substitution error in the pidof shell function which causes it to fail to find processes.  In my case, processes started by 95nfs are not terminated in the cleanup hook.  This causes knock-on effects disturbing the root filesystem service dependencies.

Enjoy,
Stig Telfer
2014-01-28 12:19:26 +01:00
Harald Hoyer
b5b31c9589 iscsi/iscsiroot.sh: beautify warning 2014-01-28 12:14:07 +01:00
Harald Hoyer
247d6d4270 network/dhclient-script.sh: set lease time
The dracut dhclient-script.sh should set address lifetimes to the DHCP
lease time, so that other stuff (like NetworkManager!) knows that the
address is temporary and was created by DHCP.

https://bugzilla.redhat.com/show_bug.cgi?id=1058519
2014-01-28 12:12:43 +01:00
Harald Hoyer
93f44f28a2 dracut-install.c: "make indent" 2014-01-24 15:31:26 +01:00
Harald Hoyer
b208aad51c lsinitrd.sh: make use of the skipcpio utility
With the skipcpio utility, the whole contents of an initramfs with an
early cpio image can be displayed.
2014-01-24 15:30:22 +01:00
Harald Hoyer
b9909e3341 dracut.sh: add early_cpio marker file to the early cpio 2014-01-24 15:29:24 +01:00
Harald Hoyer
9ea68421f6 add skipcpio utility
skipcpio skips a cpio archive at the beginning of a file.

It is used for skipping an early cpio archive for lsinitrd.
2014-01-24 15:27:51 +01:00
Harald Hoyer
8e5db363e8 dracut.sh: set file owners of early cpio files to 0:0 2014-01-24 15:27:15 +01:00
Harald Hoyer
cd08059f49 dracut.sh: create early cpio dir for acpi tables 2014-01-24 15:26:43 +01:00
Harald Hoyer
dade93b4eb Revert "dmraid: let dmraid setup the partitions"
This reverts commit fbf717086e.

dmraid seems to use "p" as a seperator by default.

Reverting to kpartx, until this is fixed.
2014-01-24 12:49:17 +01:00
Harald Hoyer
f49ec88a3f dracut.sh: s#\"#'# for error messages 2014-01-24 12:49:17 +01:00
Harald Hoyer
ae01bd1808 lsinitrd.sh: also print out the arguments used to create the initramfs 2014-01-24 12:49:17 +01:00
Hari Bathini
659dc319d9 Dracut: Add a new argument "--rebuild"
Add "rebuild" option to dracut to  append the current  arguments
to those with  which the input initramfs image was  built.  This
option helps in incrementally building initramfs for testing.

    Usage: dracut [output_file] --rebuild input_file

If optional output file  is not provided, input file provided to
rebuild will be used as output file.

This patch alters  the creation of the initramfs image by adding
the file "/tmp/params.txt" to the image. Command line parameters
excluding "--rebuild",  input  &  output image names and "kernel
version" are stored in this file.  In case "--rebuild" parameter
is specified, "/tmp/params.txt" file, if present in input image,
is read and its contents "prepend"ed to the current command line
parameters, that is if such a file is already present. Also,  it
stores the  cumulative parameters to the file "/tmp/params.txt",
in the  new image. This patch  has been tested successfully on a
PowerBox with f19. It does not alter the behaviour of any of the
existing  options.

Signed-off-by: Manik Bajpai <manibajp@linux.vnet.ibm.com>
Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>

[Edited-by: Harald Hoyer]
Simplified the cpio extraction process by using 'lsinitrd'.
2014-01-24 12:49:17 +01:00
Colin Guthrie
e3469d76c7 crypt: Prevent asking for password multiple times if non-default crypt name is used.
If a non-default device mapper name is used for an encrypted partion is
used, (i.e. not luks-$UUID) due to parsing of /etc/crypttab, then the
short-circuits put in place to prevent asking the password twice do not
work.

This would not normally be an issue as the settled job itself should be
removed after it has run and thus cannot be run again. Sadly, due to
the corresponding udev rule using ACTION="add|changed", and the fact
that trying to unlock the device (whether successful or not) seems to
trigger a changed event, it means the settled job is recreated with
each itteration thus causing the whole loop to run again.

It is this situation that the short-circuit exits would normally come
into play but sadly do not work when non-standard names are used.

By the time the /tmp/cryptroot-asked-$2 file is written near the end of
the script, the value of $2 has already been lost due to the argument
parsing code's use of 'shift'. So while on systems where the default
name is used are protected by checking /dev/mapper/xxxx, the
/tmp/cryptroot-asked-$2 file didn't help on systems where this was not
used due to this bug.

So this commit shuffles things around somewhat such that:

 1. The /dev/mapper/xxxx device is checked *after* resolving $2 (which
    contains the default name) to whatever /etc/crypttab specifies.
 2. The cryptroot-asked-xxxx file also uses the translated name both
    for the initial check and to flag when it's written.

As a separate fix, it might make sense to change the udev rule to only
act on add events rather than add|change events, but I'm not sure of the
ramifications of such a change and there may be cases where the add
event is missed and thus the change event needs to be included.
2014-01-24 12:49:17 +01:00
Koen Kooi
149965bd13 dracut-initramfs-restore,lsinitrd: add LZ4 support
Dracut claims to have LZ4 support, but trying to use it will result in an xzcat failure at the end due to missing CAT support.

The lz4 command chokes on '--', so abstract that out into the CAT select.

Something similar will need to be done for LZO.

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
2014-01-24 12:49:16 +01:00
Koen Kooi
a76a22b779 Use builtin xz/lzma option to use all cores for multihreaded compression
This removes the dependency on 'getconf' as well, which is not installed by default on my embedded systems.

Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
2014-01-24 12:49:16 +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
Cristian Rodríguez
314929920f systemd: ensure autofs4 and ipv6 are included
Systemd tries to load this modules very early.
Even though they are not strictly required it it is a good
thing to have them around.

[Edited-by: Harald Hoyer: moved to installkernel() ]
2014-01-24 12:48:08 +01:00
Harald Hoyer
c7e15f0891 iscsi: more iscsiroot fixes
handle iscsiroot with firmware more gracefully
2014-01-22 17:40:10 +01:00
Harald Hoyer
856d659016 dracut-logger.sh: systemd-cat only understands prio 0-7 2014-01-22 11:48:45 +01:00
Harald Hoyer
80525318b7 TODO: update 2014-01-22 11:27:09 +01:00
Harald Hoyer
e2ecc2d8c6 base/dracut-lib.sh: "halt" the machine in systemd mode for die()
and only go in emergency shell if "rd.debug" is specified

https://bugzilla.redhat.com/show_bug.cgi?id=1053655
2014-01-22 11:18:47 +01:00
Harald Hoyer
b40e38db98 dracut.spec: add --without doc feature 2014-01-17 14:52:11 +01:00
Harald Hoyer
21a3aab720 iscsi: call "iscsistart -b" until it succeeds 2014-01-17 14:52:01 +01:00
Harald Hoyer
ee9938572e network: add rd.bootif=0 to ignore BOOTIF
https://bugzilla.redhat.com/show_bug.cgi?id=1044623
2014-01-17 14:52:01 +01:00
Harald Hoyer
256c91f837 systemd/module-setup.sh: make use of "ln_r" 2014-01-17 14:52:01 +01:00
Harald Hoyer
8229d06b05 systemd: add seat udev rules and mask loginctl 2014-01-17 14:52:01 +01:00
Harald Hoyer
a0cab31ab8 systemd: add 71-seat.rules 73-seat-late.rules
otherwise plymouth does not work
2014-01-17 14:52:01 +01:00
Harald Hoyer
d0d61e44be systemd/rootfs-generator.sh: ignore legacy root=/dev/nfs 2014-01-17 14:52:01 +01:00
Harald Hoyer
75e4cbb7be systemd/rootfs-generator.sh: exit 0 2014-01-17 14:52:01 +01:00
Harald Hoyer
45404a2ad8 dracut-install,dracut: fix ldd output parsing
dracut-install could not handle output like:
	/lib/$LIB/liblsp.so => /lib/lib64/liblsp.so (0x00007faf00727000)

also unset LD_PRELOAD, so we get a clean environment
2014-01-17 14:52:01 +01:00
Harald Hoyer
7e916ae4e0 network: include all ethernet drivers 2014-01-15 14:40:12 +01:00
Harald Hoyer
ef9ddb915b documentation: line wrap 2014-01-13 09:51:04 +01:00
Harald Hoyer
a956a464ef dracut.sh: add /boot/efi to device paths
Add /boot/efi to device paths, so the filesystem driver is included
and it can be repaired in the initramfs.
2014-01-13 09:51:04 +01:00
Harald Hoyer
87483405a0 dracut.sh: add missing piece for option --add-device 2014-01-13 09:51:04 +01:00
Harald Hoyer
8c828f329b iscsi/iscsiroot.sh: do not trust iscsistart return value 2014-01-13 09:51:04 +01:00
Harald Hoyer
9a3676a88f systemd/dracut-initqueue.sh: fstab is not a directory 2014-01-13 09:51:04 +01:00
Harald Hoyer
53cf50e00f fcoe-uefi: do not include, if fcoe utils not installed 2014-01-13 09:51:04 +01:00
Harald Hoyer
53c1e4834f TODO: update 2014-01-13 09:51:04 +01:00
Harald Hoyer
df6e79bfd2 resume/parse-resume.sh: fixed printf formatting
https://bugzilla.redhat.com/show_bug.cgi?id=1045704
2014-01-13 09:51:03 +01:00
Harald Hoyer
5db9c5c1d9 change dracut tarball compression to xz 2014-01-07 12:21:39 +01:00
Harald Hoyer
bb1ba3a1ca resume: fixed udev rule for /dev/resume instead of /dev/dev/resume
https://bugzilla.redhat.com/show_bug.cgi?id=1045116
2013-12-19 17:09:55 +01:00
Harald Hoyer
3ad42552ca network: include usbnet drivers 2013-12-19 17:06:48 +01:00
Harald Hoyer
2f461da2a0 install: install all PATH binaries found
This should fix the issues with symlinks in /bin pointing to /usr/bin on
some distributions.
2013-12-19 17:00:18 +01:00
Harald Hoyer
3aa35b727f kernel-modules: add more block driver
e.g. nvme
2013-12-19 12:37:47 +01:00
Harald Hoyer
ac5bff2b6f dracut-lib/wait_for_dev(): prevent systemd daemon-reload
prevent a systemd daemon-reload, if it is not necessary to do.
2013-12-18 15:22:27 +01:00
Harald Hoyer
ab6f4a825e iscsi: do iscsi_firmware regardless of network
Do the iscsi_firmware iscsistart at least once, even if the network is
not up, to activate offload HBA iSCSI.

https://bugzilla.redhat.com/show_bug.cgi?id=1031160
2013-12-18 15:22:24 +01:00
Harald Hoyer
859e3a77d0 test/TEST-17-LVM-THIN: remove .testdir 2013-12-17 13:36:55 +01:00
Harald Hoyer
61a02caca4 test/TEST-17-LVM-THIN: add test case for lvm thin pools 2013-12-16 13:15:48 +01:00
Harald Hoyer
08f06c9341 dracut.spec: add 95fcoe-uefi and 99uefi-lib 2013-12-16 12:30:43 +01:00
Harald Hoyer
831625d29e lvm: fixed lvm thin check 2013-12-13 11:13:40 +01:00
Harald Hoyer
89031be373 move uefi-lib to a seperate module 2013-12-12 09:49:06 +01:00
Harald Hoyer
ab173bb4c1 fcoe: move uefi parsing to fcoe-uefi module 2013-12-12 09:21:44 +01:00
Alexander Tsoy
ded4c82ace usrmount: always install
/usr should be mounted by initramfs even if /sbin/init lives in /
2013-12-11 14:38:28 +01:00
Harald Hoyer
f11712ea21 base/rdsosreport.sh: add "ip a" output 2013-12-10 12:58:37 +01:00
Harald Hoyer
3934ca8e6c systemd/dracut-initqueue.sh: fixed waiting in the loop if PW asked
continue the main loop instead of the for loop, if a password is
currently asked
2013-12-05 18:38:35 +01:00
Harald Hoyer
ce052202f0 TODO: update 2013-12-05 18:38:23 +01:00
Harald Hoyer
11ee2ca8d4 dracut.spec: remove suse man pages 2013-12-05 17:32:07 +01:00
Harald Hoyer
57575f3c9c dracut.spec: add new modules 2013-12-05 17:27:57 +01:00
Harald Hoyer
45845cb6a5 i18n: introduce i18n_install_all, to install everything
if i18n_install_all is set to "yes", then install all keyboard layouts
and fonts regardless of the hostonly setting.

This way, people can switch keyboard layouts, without having to recreate
the initramfs.
2013-12-05 16:42:05 +01:00
Harald Hoyer
c21c4dc2b4 lvm: install thin tools, only when needed in hostonly 2013-12-05 15:57:42 +01:00
Hannes Reinecke
336bd09d2c Remove shebang from shell-completion files
Shell-completion files are meant to be sourced, not executed.
So they shouldn't have a shebang at the start.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2013-12-05 15:13:29 +01:00
Hannes Reinecke
1c89fd148d Fixup script permissions
Scripts with a shebang should be marked as executable.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2013-12-05 15:13:29 +01:00
Hannes Reinecke
1d3496b4c1 Fixup keymap setting for openSUSE
openSUSE is using compressed keymaps.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2013-12-05 15:13:29 +01:00
Hannes Reinecke
463e13fe81 mkinitrd-suse.8.asc: Add manpage for SUSE compat mkinitrd
Signed-off-by: Hannes Reinecke <hare@suse.de>
2013-12-05 15:13:29 +01:00
Hannes Reinecke
2b3e22d602 mkinitrd-suse: Add SUSE compability wrapper for dracut
SUSE has its own mkinitrd system. As the arguments clash
with the dracut-provided mkinitrd script I've added a new
mkinitrd-suse.sh wrapper.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2013-12-05 15:13:29 +01:00
Hannes Reinecke
ee54b8404c Make logfile configurable
Add '--logfile' option to make the log file configurable during
runtime.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2013-12-05 15:13:29 +01:00
Hannes Reinecke
d6f0467edf Add zfcp scripts for SUSE
SuSE is storing the zfcp configuration in udev files, so we should
be including these.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2013-12-05 15:13:29 +01:00
Hannes Reinecke
bfa1db78cd Add DASD configuration for SuSE
On SuSE the DASD configuration is kept in udev rules, one rule
file per device. So add a new module for copying and creating
these rules during boot.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2013-12-05 15:13:29 +01:00
Hannes Reinecke
dda7ae7dcd 95znet: Make installation optional
znet_cio_free is a RedHat-specific tool, so do not install this
module on systems where the program is missing.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2013-12-05 15:13:29 +01:00
Hannes Reinecke
61c0665dad 95zfcp: Make installation optional
zfcp_cio_free is a RedHat-specific tool, so do not install this
module if the program isn't present.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2013-12-05 15:13:29 +01:00
Hannes Reinecke
8b2b77e460 95dasd_mod: make dasd_cio_free optional
dasd_cio_free is a RedHat-specific tool, so make it optional.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2013-12-05 15:13:29 +01:00
Hannes Reinecke
07cacb2455 95dasd: Only install module if normalize_dasd_arg is present
normalize_dasd_arg is a RedHat specific script, so no point
installing this module if the script isn't present.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2013-12-05 15:13:29 +01:00
Hannes Reinecke
690905cea0 95dasd: Install kernel modules only once
Move kernel module selection to 95dasd_mod and make 95dasd depend
on that module.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2013-12-05 15:13:29 +01:00
Harald Hoyer
443fb52487 10i18n/parse-i18n.sh: fixed vconsole.conf/locale.conf generation 2013-12-05 15:13:29 +01:00
Harald Hoyer
b29cb51654 dracut-functions.sh: do not force require modules.builtin* 2013-12-05 15:13:29 +01:00
Harald Hoyer
64ae4e07a4 dracut.sh: skip crypt swaps with password files 2013-12-03 16:21:04 +01:00
Harald Hoyer
8064f68d60 resume: no more autoresume 2013-12-03 16:21:04 +01:00
Harald Hoyer
40da1e5a31 resume: autoconf resume 2013-12-03 16:21:04 +01:00
Harald Hoyer
b92896ece4 base/dracut-lib.sh:wait_for_dev() relax requirement
Do not "require" the devices, but "want" them. This might boot more
systems, where:
- the UUID changed
- swap devices do not show up
2013-12-03 16:21:04 +01:00
Harald Hoyer
271cd19dbe network/ifup.sh: before doing dhcp, check, if the link has a carrier 2013-12-03 16:21:04 +01:00
Harald Hoyer
7c8da72c11 network/net-lib.sh:iface_has_link() fixup
Just echo'ing the flags IFF_UP|IFF_RUNNING does _not_ reflect the
carrier state immediately. So wait for it to really show up.
2013-12-03 16:21:04 +01:00
Harald Hoyer
56ee31ccfe network/net-lib.sh:wait_for_if_up() wait for "state UP"
really wait for "state UP", otherwise it returns earlier than we want
2013-12-03 16:21:04 +01:00
Harald Hoyer
e41f3f9025 dracut.sh:_get_fs_type() if block device exists return early
even, if no ID_FS_TYPE was found, return if the block device exists
2013-12-03 16:21:04 +01:00
Harald Hoyer
e38e73d5a6 dracut.cmdline.7.asc: document "server-ip" of "ip=" parameter 2013-12-03 16:21:04 +01:00
Harald Hoyer
928da57447 fips: fix RHEV vmlinuz check 2013-12-03 16:21:04 +01:00
Peter Rajnoha
297b8edc05 lvm: do not run pvscan for lvmetad update
The lvmetad daemon is not yet running in initramfs so there's no
need to run pvscan (or instantiate any lvm2-pvscan systemd service).
If pvscan was called in this case (either directly or via systemd
instantiated service), it would fail because there's no lvmetad
daemon to update. This could cause confusion, especially in systemd
instantiated service which is run only once!
2013-12-03 16:20:25 +01:00
Harald Hoyer
28609baf6e kernel-modules: add ohci-pci to the list of forced module installs 2013-11-14 10:07:04 +01:00
Vratislav Podzimek
a3bfaa1919 Run 'xz' and 'lzma' with multiple threads
This speeds up compression a lot on multicore systems.

https://bugzilla.redhat.com/show_bug.cgi?id=1029786

[Edited-by: Harald Hoyer: use getconf for cpu_count]
2013-11-13 13:20:39 +01:00
Harald Hoyer
7e4f74f504 systemd: do not exit the initqueue, if systemd asks a password
this prevents bailing out the initqueue, while passwords are still to be
asked
2013-11-12 17:02:44 +01:00
Harald Hoyer
c2ab990938 iscsi,nbd: do not fail in hostonly mode 2013-11-11 16:57:09 +01:00
Colin Guthrie
1d50dfe602 dracut-functions.sh: Avoid loading unnecessary 32-bit libraries for 64-bit initrds
Due to the 'inst_libdir_file "libnss_files*"' in the udev-rules module
this caues the /usr/lib/libnss_files-2.18.so* to be included. This is a
32-bit library and pulls in a 32-bit version of glibc also even on a
64-bit system.

This is due to the fact that ldconfig -pN will print [/usr]/lib paths
from the cache as well as [/usr]/lib64. As we handle these paths
specifically we should ignore these results from the cache.

Also there was a missing space when appending the ldconfig paths
onto our list meaning the last builtin and first ldconfig path
were unusable.
2013-11-07 15:23:24 +01:00
Harald Hoyer
185e940e27 fips: also install /etc/system-fips in the initramfs 2013-11-04 17:32:22 +01:00
Harald Hoyer
095fa15591 dracut.modules.7.asc: removed empty section 2013-11-02 13:20:32 +01:00
Harald Hoyer
cf3fd99e72 dracut.sh: fixed PATH shortener 2013-11-02 13:14:40 +01:00
Harald Hoyer
06d418abd1 dracut.spec: move /sbin/dracut to /usr/sbin/dracut 2013-10-30 19:50:53 +01:00
Harald Hoyer
fa9384b1c0 iscsi/nbd: do not try to mount the whole disk, if root= is missing
only mount the whole disk for root=dhcp
2013-10-30 17:38:43 +01:00
Kyle McMartin
0a8e91bb24 fips: include crct10dif_generic
Resolves: rhbz#1024455
2013-10-30 12:35:27 +01:00
Harald Hoyer
4d7c18c7c0 Handle crypto modules with and without modaliases
If new kernels have modules split out, handle the case, where modules
have to modalias and just install them.

Also add the crypto drivers and names to host_modalias.
2013-10-30 12:24:37 +01:00
Alexander Tsoy
0106da599a usrmount/module-setup.sh: fixed typo 2013-10-25 17:06:44 +02:00
Harald Hoyer
5d623b1775 lvm: always install thin utils for lvm 2013-10-21 09:09:26 +02:00
Harald Hoyer
76a4478264 kernel-modules(ARM): add mmc_block usb_storage to statis list of kernel mods 2013-10-18 14:56:51 +02:00
Marian Csontos
96c6f6f3d1 dracut-functions.sh:check_block_and_slaves*() skip LVM internal devs
Not every device in /dev/mapper should be examined.
If it is an LVM device, touch only devices which have /dev/VG/LV symlink.
2013-10-18 14:40:40 +02:00
Harald Hoyer
56903458d7 mkdir basic dirs in /run
for systemd initramfs, /run is also mounted
for non-systemd the contents of /run is copied over, when mounting /run
2013-10-16 11:49:57 +02:00
Harald Hoyer
8795467533 network/fcoe: only redirect output to loginit.pipe, if exists 2013-10-16 11:39:34 +02:00
Harald Hoyer
8d89fc6bb1 dracut.sh: no need to make subdirs in run 2013-10-16 11:39:17 +02:00
Harald Hoyer
68b736b50f dracut.sh: also mkdir /run/lock, which is copied to 2013-10-16 11:31:54 +02:00
Harald Hoyer
aabea6f7b9 lvm: fix thin recognition
The global var setting was happening in a pipe and did not have an
effect.

Use <<<$() instead.

< <() cannot be used, because dracut is called in chroot's environments,
where /dev/fd does not point to /proc/self/fd, but bash wants
/dev/fd/<num> for this construct.
2013-10-16 11:30:08 +02:00
P J P
871c8e40d1 Add lzo, lz4 compression and read INITRD_COMPRESS
This patch adds support for lzop(1) & lz4(1) compression
algorithms to compress iniramfs image file. Both are supported
by the Linux kernel.

Linux kernel exports user's choice of initramfs compression
algorithm as a shell environment variable: INITRD_COMPRESS.
This patch adds support to read this variable and duly compress
the initramfs image file.

Environment variable INITRD_COMPRESS has less precedence than the
command line options --gzip, etc. Ie. command line options could
override the compression algorithm defined by $INITRD_COMPRESS.

Signed-off-by: P J P <ppandit@redhat.com>

[Edited-by: Harald Hoyer: add documentation about lzo and lz4]
2013-10-14 09:38:06 +02:00
Alexander Tsoy
1aedbb7886 resume: remove resume-genrules.sh
parse-resume.sh already contains all the code from resume-genrules.sh.
Also parse-resume.sh is executed before resume-genrules.sh, so there is
no point to keep the latter.

This fixes the following error messages:
dracut-initqueue: ln: failed to create symbolic link '/dev/resume': File exists
dracut-initqueue: rm: cannot remove '/lib/dracut/hooks/initqueue/settled/resume.sh': No such file or directory
dracut-initqueue: rm: cannot remove '/lib/dracut/hooks/initqueue/timeout/resume.sh': No such file or directory
2013-10-09 16:21:50 +02:00
Alexander Tsoy
cfdec163f9 resume: fix swap detection in hostonly
Check for other possible fs types. This fixes swap detection when using
TuxOnIce kernel.

Note that parse-resume.sh generate udev rules with support for
ID_FS_TYPE=suspend, but we do not include it here, because it is
libvolume_id thing and host_fs_types is populated using blkid.
2013-10-09 16:21:50 +02:00
Harald Hoyer
ab2676d291 base/init.sh: also mkdir /run/lock 2013-10-09 08:20:39 +02:00
Brian C. Lane
3622d6d7b0 dmsquash-live: add /dev/mapper/live-base
This is similar to the reason for adding the
/run/initramfs/live-baseloop symlink -- access to the original live
image without overlays.

livemedia-creator does not create a osmin.img, so there is no mountable
device for it to use when rsyncing the live image to the target. It
needs a device that points to the original live image without overlays.

Note that lmc won't be creating osmin.img, since really isn't needed any
longer. Its purpose was to provide a minimal image that could be dd'd to
the target. Now that we use rsync this is no longer necessary.

The included patch adds a /dev/mapper/live-base device that Anaconda can
use whether or not there is an osmin present.
2013-10-08 15:13:44 +02:00
Harald Hoyer
b6c8976811 Doc: cleanup, extend and split and reuse 2013-10-08 15:13:12 +02:00
Harald Hoyer
05214a0bed dracut.sh: do not bail out, if kernel modules dir is missing
and only print a warning message
2013-10-08 15:05:21 +02:00
Harald Hoyer
6c8fc6e377 10i18n/parse-i18n.sh: parse rd.vconsole and rd.locale
and removed systemd part, because parse-i18n.sh is not even installed in
systemd driven initramfs images.
2013-10-08 15:05:21 +02:00
Harald Hoyer
8bcfd683bd */module-setup.sh: add comments for dracut called functions 2013-10-08 10:37:56 +02:00
Harald Hoyer
a3c0cef9a7 lvm: install thin utils for non-hostonly 2013-10-08 10:30:00 +02:00
Harald Hoyer
2f6ed29d04 prepare 034 release 2013-10-08 09:55:26 +02:00
Harald Hoyer
a3044aba53 mkinitrd-dracut.sh: removed trailing space in comment 2013-10-07 17:25:58 +02:00
Harald Hoyer
50f5bbbbaf btrfs: use inst_hook to install the timeout hook 2013-10-07 17:25:58 +02:00
Harald Hoyer
c4c1c4f456 rootfs-block: add support for the rootfallback= kernel cmdline option 2013-10-07 17:25:58 +02:00
Harald Hoyer
46cc29261f fcoe: add FCoE UEFI boot device support 2013-10-07 15:18:38 +02:00
Harald Hoyer
7f5701eb8d dracut.spec: remove bcache module 2013-10-07 11:18:11 +02:00
Harald Hoyer
b7d1b6f904 mkinitrd-dracut.sh: do not "--keep" files for --verbose 2013-10-04 13:57:15 +02:00
Thomas Renninger
58ef91ff50 mkinitrd-dracut.sh: Build host images for default_kernel_images and -i/-k paths
default_kernel_images and -i/-k paths are new (SuSE) code paths and
would have resulted in usage errors before.

There we want to build host only images for faster building and
smaller images.
Also force creation (overriding) of initrd images in these code paths.

Signed-off-by: Thomas Renninger <trenn@suse.de>
2013-10-04 13:56:41 +02:00
Thomas Renninger
fbf338ff98 mkinitrd-dracut.sh: Also allow -d to specify the root_fs and -s dummy
-d is the SUSE mkinitrd version option to pass the rootfs.
-s is to enable splash which may not be needed, but some callers rely on it,
not to return an error.

Make this wrapper compatible to it.

Signed-off-by: Thomas Renninger <trenn@suse.de>
2013-10-04 13:56:41 +02:00
Thomas Renninger
40db1daf00 mkinitrd-dracut.sh: Allow mkinitrd call without passing any parameters
Before this gave a "usage" error.
Now boot_dir (by default /boot) is scanned for available kernels and sane
initrd default targets get defined and the corresponding initramfs files
are generated.

Signed-off-by: Thomas Renninger <trenn@suse.de>
2013-10-04 13:56:41 +02:00
Thomas Renninger
cbd1b385a2 mkinitrd-dracut.sh: Implement --quiet|-q option
Dracut is rather verbose. This optional parameter is to limit the output
to the essential: For each generated initrd show the kernel, target and
possibly additional options passed to dracut.

Signed-off-by: Thomas Renninger <trenn@suse.de>
2013-10-04 13:56:41 +02:00
Thomas Renninger
6470e0a12b mkinitrd-dracut.sh: Enhance param parsing: Allow multiple arguments per param
Currently --with parameter had to be passed as: --with="mod1 mod2".
Now one can pass: --with "mod1 mod2" or even --with mod1 mod2.

Signed-off-by: Thomas Renninger <trenn@suse.de>
2013-10-04 13:56:41 +02:00
Thomas Renninger
da5ef1737e mkinitrd-dracut.sh: Introduce -i -k parameters
In SUSE, one can pass a list of kernel files via -k parameter.
For each an initrd is generated as passed via -i parameters.

Make the dracut mkinitrd wrapper compatible to those.
For now only one kernel file and initrd target can be specified.
This will get enhanced with a follow-up patch.

Signed-off-by: Thomas Renninger <trenn@suse.de>
2013-10-04 13:56:41 +02:00
Alexander Tsoy
ecc13ef17e mdraid/module-setup.sh: fixes for mdadm-3.2.6+
mdadm-3.2.6+:
Incremental assembly rule contains "--offroot" arg. Update
regexp to catch this variant.

mdadm-3.3+:
Rules was splitted into two files: 63-md-raid-arrays.rules
and 64-md-raid-assembly.rules. Install them both and edit
the latter.
2013-10-04 13:56:41 +02:00
Alexander Tsoy
5bcf262d59 mdraid/module-setup.sh: install configs from /etc/mdadm.conf.d
/etc/mdadm.conf.d directory is supported since mdadm-3.3
2013-10-04 13:56:41 +02:00
Harald Hoyer
d97eb42593 dracut.spec: conflict with old bcache-tools 2013-10-04 13:36:36 +02:00
Harald Hoyer
63330a89fc dracut-functions.sh:inst_rules() do not install rules in CWD 2013-10-04 13:36:25 +02:00
Harald Hoyer
49268028b9 bcache: removed, it's in the upstream bcache-tools package 2013-10-04 10:43:02 +02:00
Peter Rajnoha
b874d4b5be lvm/mdraid: Fix LVM on MD activation
The 69-dm-lvm-metad.rules set some udev env. variables that makes it
possible to detect the right time to activate LVM on MD. The MD is very
similar to DM during activation - it's usable only after proper device
activation - the CHANGE event. We need to make a difference between a
CHANGE event that comes from this activation and CHANGE event that is
the outcome of the WATCH udev rule (otherwise we'd end up with LVM
activation done on each CHANGE event - which is wrong).

So we need the udev databse to be persistent during pivot to root fs
even for MD devices.
2013-10-04 10:41:24 +02:00
Harald Hoyer
283d385fbd dracut-logger.sh: do not log to syslog/kmsg/journal for UID != 0
Don't clutter the system log with user actions.

Also check, if systemd-cat works, before using it.
2013-10-02 12:48:57 +02:00
Harald Hoyer
96cf7270da dracut.sh: bail out early, if destination dir is not writeable 2013-10-02 12:48:11 +02:00
Harald Hoyer
b19bdcbea7 dracut-bash-completion.sh: add --prelink --noprelink 2013-10-02 12:47:34 +02:00
Thomas Renninger
4e93c3f707 dracut.conf.5.asc: Add ACPI table override and uncompressed cpio doc
Signed-off-by: Thomas Renninger <trenn@suse.de>
2013-10-02 12:47:11 +02:00
Thomas Renninger
f3b14c2b6a dracut: Implement ACPI table overriding
An example config file for this feature could be:

/etc/dracut.conf.d/03-acpi-override.conf

with this content:
acpi_override="yes"
acpi_table_dir="/etc/dracut.conf.d/acpi_tables"

Then all files ending with *.aml will be put into the early cpio
(kernel/firmware/acpi) and will be used to replace the BIOS provided tables
if the kernel supports this feature.

Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2013-10-02 12:47:11 +02:00
Thomas Renninger
d8b04dc184 dracut: Do not create early_cpio if no suitable microcode exist in hostonly case
Intel microcodes only exist for very specific family/model/stepping CPUs.
If no microcode gets added, there is no need to create an empty
(only directories) cpio later that gets glued to the initrd.

This also fixes:

*** Constructing GenuineIntel.bin ****
cat: /lib/firmware/intel-ucode/06-3c-03: No such file or directory

in hostonly mode if there is no suitable microcode for the CPU.

Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2013-10-02 12:47:11 +02:00
Thomas Renninger
b5b608e44a dracut: Generlize microcode early cpio usage
ACPI early table override also may need to place files into an early cpio.
Reflect this in variable and file names.
This change is renaming only and does not introduce any real change.

Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Thomas Renninger <trenn@suse.de>
2013-10-02 12:47:11 +02:00
Harald Hoyer
78d5cf7cb4 add /etc/system-fips for dracut-fips subpackage 2013-10-02 12:36:25 +02:00
Harald Hoyer
f4a942783a Add option to turn on/off prelinking
--prelink, --noprelink

do_prelink=[yes|no]
2013-09-17 12:25:29 -05:00
Harald Hoyer
3b9aaaab42 dracut.sh: we don't need to read the modalias files
udev does only parse the uevent MODALIAS line, so whatever is in the
modalias files would not trigger any module load.
2013-09-13 18:05:48 +02:00
Harald Hoyer
fc68c87afa dracut.sh: also search uevent's for MODALIAS 2013-09-13 17:34:18 +02:00
WANG Chao
63f3bcd852 ifup: do not dhcp on network interface of secondary stack
Configure cmdline to:
 ip=br0:dhcp bridge=br0:bond0 bond=bond0:eth0

By default ifup bond0 will run dhcp on bond0, which is wrong. bond0
isn't the top interface. we should really run dhcp on br0.

So if we ifup an network interface on secondary stack, we should not
dhcp. Fix this issue with this patch.
2013-09-13 17:04:16 +02:00
Harald Hoyer
57f90974f9 dracut.sh: harden host_modalias reading
Some weird PPC driver make their modulias unreadable

$ cat /sys/devices/vio/4000/modalias
cat: /sys/devices/vio/4000/modalias: No such device
2013-09-13 16:33:01 +02:00
Harald Hoyer
d8cc8c0499 version 033 2013-09-12 14:52:20 +02:00
Colin Walters
36b2e5e2c2 dracut.sh: Fixup previous commit to only read /sys and /proc in hostonly mode
The gnome-ostree build system generates dracut initramfs images on the
build server, therefore not in hostonly mode.  The build system at the
moment doesn't mount /sys, and the previous commit caused a hard
failure due to lack of /sys/devices.

Because we only want /sys/devices in hostonly mode, just move those
bits inside the hostonly conditional above.
2013-09-11 22:50:22 +02:00
Harald Hoyer
3c4315fa13 dracut-functions.sh: extend module_is_host_only()
If the currently running kernel is not present in the installer root,
fall back to modalias checking.
2013-09-11 12:53:50 +02:00
Harald Hoyer
d97d130da9 Makefile: create hostonly test image without debug 2013-09-11 09:57:25 +02:00
Harald Hoyer
e0aa98a1df network: correctly name iBFT vlan devices 2013-09-11 09:56:57 +02:00
Harald Hoyer
84bc192946 TEST-50-MULTINIC: improve interface test 2013-09-10 10:51:04 +02:00
Harald Hoyer
e684eab878 nfs/nfsroot-cleanup.sh: silently try to umount rpc_pipefs 2013-09-10 10:50:23 +02:00
Harald Hoyer
debf483d4d network/ifup.sh: ifup with dhcp, if no ip= params specified 2013-09-10 10:49:51 +02:00
Harald Hoyer
d681df8e5f network/net-genrules.sh: react also on NAME
Recent systemd-udevd network renaming rules work on NAME.
Also enqueue only one unique initqueue job.
2013-09-10 10:48:18 +02:00
Harald Hoyer
540a5169b9 dracut.sh: reorder things to let "--print-cmdline" work 2013-09-09 16:52:19 +02:00
Harald Hoyer
12beb05a73 bcache: newer util-linux supports bcache with blkid
and probe-bcache should not be needed in that case
2013-09-09 16:51:44 +02:00
Harald Hoyer
e6aafacb23 dmsquash-live/iso-scan: do the iso scan regardless of /dev/loop0
The loop driver could be a module and would never be loaded, so the
iso-scan never takes place.

To let the iso-scan happen, it is now placed into the initqueue/settled
unconditionally.
2013-09-09 16:49:45 +02:00
Harald Hoyer
8d3d72a68c no more global $CMDLINE
Do not use the global variable CMDLINE anymore. Use
CMDLINE=$(getcmdline)
2013-09-05 09:57:48 +02:00
WANG Chao
b2fab575dc dracut-lib: do not use cached CMDLINE in _getcmdline
Cached CMDLINE doesn't work 100%. For example the following case,

1. dracut starts to run dracut-cmdline.sh. CMDLINE is cached when calling
   getarg 'rd.break=cmdline'.
2. In 92-parse-ibft.sh, ibft_to_cmdline() calls $(set_ifname ibft xx:xx..)
   multiple times in each subshell.
3. In 1st call, set_ifname() will check $(getargs ifname) and write out
   ifname=xxxx accordingly.
4. In 2nd call, set_ifname() will check $(getargs ifname) and it's wrong here.
   Because in step 3, we introduce a new cmdline arg ifname=xxx, but CMDLINE
   isn't updated. Thus we fail to get the new ifname arg.

It's doable to unset CMDLINE every time after a new cmdline arg is in. But
unset should be done in the parent process, because unset CMDLINE in a
subshell won't unset CMDLINE in its parent or sibling process. And also it's
painful to unset CMDLINE every time. In the future, functions and code
snippet could probably separate or move to other file, the unset CMDLINE could
malfunction again like this time.

So I'm thinking not to cache CMDLINE. It's doesn't hurt to re-read all the
cmdline args everytime. Because it's in initramfs, a non cached _getcmdline()
should be fast enough.

Please consider!

Thanks
WANG Chao
2013-09-05 08:45:39 +02:00
Harald Hoyer
de74e1ef41 Rewrite "rootok" and "netroot" logic
Previously if "$rootok" = 1, parsing of netroot command line arguments
was skipped. For multiple netroot arguments, all parse scripts have to
run.

Previously only the first netroot argument was taken into account for
the parsing scripts. Now every netroot argument is processed.
2013-09-04 09:49:19 +02:00
WANG Chao
f2cbd4cbd6 net-lib: ibft_to_cmdline() fixes
Fix 3 issues in ibft_to_cmdline():
- unset local variables at the beginning of each loop
- only write vlan.conf when we write out ip=xxx
- when vlan id is 0, don't write out vlan.conf. Because 0 means untagged
  and we don't actually need vlan interface.
2013-09-04 08:04:20 +02:00
Harald Hoyer
5ecc117a25 iscsi: parse iscsi parameter, even if rootok=1 2013-09-03 15:23:28 +02:00
Harald Hoyer
00ed3ccfd9 dracut-functions.sh:for_each_module_dir() skip empty modules
skip modules, which have no module-setup.sh, install or installkernel

https://bugzilla.redhat.com/show_bug.cgi?id=1003153
2013-09-02 10:28:36 +02:00
Harald Hoyer
6a877a79c4 dracut-logger.sh: check is journald.socket is active
before using systemd-cat, make sure someone is listening
2013-08-28 20:01:54 +02:00
Harald Hoyer
cb73315dd6 resume: debian's resume is in /usr/lib/uswsusp
Hurray! Everybody reinvents the wheel!
2013-08-28 10:57:23 +02:00
Harald Hoyer
8552a3270c dracut-functions.sh:get_devpath_block() make local vars local 2013-08-27 11:34:39 +02:00
Harald Hoyer
281327f72c dmraid/mdraid: improve hostonly recognition
Factor out get_devpath_block(), which also fixes a dmraid hostonly bug.

Also only include dmraid and mdraid, if they are actually in use.
2013-08-26 14:04:56 +02:00
Harald Hoyer
da119ab18c dmraid/parse-dm.sh: if rd.md=0, use dmraid for imsm and ddf 2013-08-26 12:46:51 +02:00
Harald Hoyer
87bd8907a6 i18n: check for setfont and loadkeys binaries 2013-08-26 10:19:49 +02:00
Harald Hoyer
a242ef13e0 network: move ibft parsing before all other network cmdline parser
otherwise the config produced by ibft will not get processed
2013-08-26 10:18:47 +02:00
Harald Hoyer
2b9d8f65a6 dracut-functions.sh:get_persistent_dev() do not check non-existent dirs 2013-08-23 19:04:12 +02:00
Harald Hoyer
ffc68f357e use ${var:+val} rather than ${var+val}
${var:+val} also catches var=""
2013-08-22 11:24:01 +02:00
Harald Hoyer
ace51ef520 dracut-functions.sh:inst_rules() do not install from /etc in generic mode
In generic mode, local configuration should not be part of the image.

Also handle symlinks for rule files.
2013-08-22 10:53:43 +02:00
Harald Hoyer
93b02f502e dracut-functions.sh: use builtin bash functions rather than tr
convert uppercase to lowercase using bash syntax
2013-08-22 10:53:25 +02:00
Harald Hoyer
49c062821a removed freenode.txt 2013-08-22 10:24:15 +02:00
Harald Hoyer
c504d8b435 freenode IRC #dracut verification 2013-08-22 10:14:24 +02:00
Harald Hoyer
39fe00ef60 dracut.asc: document debugging dracut on shutdown 2013-08-22 09:39:38 +02:00
Harald Hoyer
bae44febb5 add dracut.css for dracut.html 2013-08-21 13:15:08 +02:00
Harald Hoyer
5c274467d6 url-lib.sh: handle 0-size files with curl
https://bugzilla.redhat.com/show_bug.cgi?id=989133#c9
2013-08-20 16:15:17 +02:00
Harald Hoyer
c82a11334d dracut-functions.sh: add expand_persistent_dev()
also fixes missing '{' for LABEL=... swaps
2013-08-20 16:03:17 +02:00
Harald Hoyer
f34e1d6b0e network: do not depend on ifcfg
rather let ifcfg return 0 if /etc/sysconfig/network-scripts exists
2013-08-20 15:09:33 +02:00
Harald Hoyer
a073aa5a26 dracut-032 2013-08-20 13:08:52 +02:00
Harald Hoyer
575733aa25 add newline to cmdline config files 2013-08-20 13:08:52 +02:00
Harald Hoyer
546d5dacf5 dracut.sh: recognize swap entries in fstab with mountpoint "none" 2013-08-20 12:01:17 +02:00
Harald Hoyer
3411ad661a add persistent_policy configuration option 2013-08-20 10:28:14 +02:00
Harald Hoyer
a2b64e30b8 dracut.conf.5.asc: correct ro_mnt documentation 2013-08-20 10:27:29 +02:00
Harald Hoyer
50411d30d5 dracut-functions.sh:dracut_module_included() check with spaces
check also for surrounding spaces in the module strings
2013-08-20 09:04:20 +02:00
Harald Hoyer
88c86ac7f0 dracut.sh: fixed checking for FIPS mode 2013-08-20 09:02:48 +02:00
WANG Chao
55c912ae40 systemd: pre-pivot hooks runs after /sysroot is mounted
If rootflags=nofail, sysroot.mount won't strictly run "Before"
initrd-root-fs.target. So we need to order dracut-pre-pivot after
sysroot.mount.
2013-08-19 15:50:57 +02:00
Daniel Schaal
b7c770e186 dracut.sh: Fix [no-]early-microcode parameter and add documentation.
[no-]early-microcode was missing from getopt argument list.

Let arguments passed by command line override config files.
2013-08-19 11:13:04 +02:00
Harald Hoyer
324ea606da dracut.sh: add --persistent-policy option
--persistent-policy <policy>:
    Use <policy> to address disks and partitions.
    <policy> can be any directory name found in /dev/disk.
    E.g. "by-uuid", "by-label"
2013-08-16 11:52:07 +02:00
Harald Hoyer
df478eee75 base/dracut-lib.sh: move warn() definition before usage 2013-08-16 11:00:45 +02:00
Harald Hoyer
8f53670cc5 dracut.spec: correct License string 2013-08-16 11:00:21 +02:00
Harald Hoyer
f071d5574c dracut.spec: add bash module 2013-08-15 16:24:13 +02:00
Harald Hoyer
1743473b2b add parameter --print-cmdline
This prints the kernel command line parameters for the current disk
layout.

$ dracut --print-cmdline
rd.luks.uuid=luks-e68c8906-6542-4a26-83c4-91b4dd9f0471
rd.lvm.lv=debian/root rd.lvm.lv=debian/usr root=/dev/mapper/debian-root
rootflags=rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=ordered
rootfstype=ext4
2013-08-15 16:06:37 +02:00
Harald Hoyer
0d6d85b494 resurrect TEST-14-IMSM 2013-08-15 16:05:35 +02:00
Harald Hoyer
bbc9bfe16e dracut-functions.sh: add find_mp_fsopts 2013-08-15 12:23:04 +02:00
Harald Hoyer
466a59984a dracut-functions.sh: no more 'echo' 2013-08-15 12:22:55 +02:00
Harald Hoyer
8df0b654dc rootfs-block: search all host_devs for a journal device 2013-08-15 11:14:47 +02:00
Harald Hoyer
97af51db9d dracut-functions.sh: add find_dev_fsopts() 2013-08-15 11:14:46 +02:00
Harald Hoyer
69f7ed9610 Create initramfs without using udevadm
This enables building a hostonly image, without the udev database
populated.
2013-08-15 10:44:20 +02:00
Harald Hoyer
67b4a9ea17 testsuite: fixed network interface names 2013-08-15 10:25:19 +02:00
Harald Hoyer
dc63e65419 dracut.spec: dracut-network requires dhclient 2013-08-15 08:32:38 +02:00
Harald Hoyer
62cdced342 TEST-12-RAID-DEG: enter UUID in crypttab rather than md0 2013-08-14 15:04:05 +02:00
Harald Hoyer
919a7c4d6e Makefile: do syncheck before creating the archive or rpm 2013-08-14 15:04:05 +02:00
Harald Hoyer
f06c2b5852 dracut-functions.sh: fixed vercmp() 2013-08-14 15:04:05 +02:00
WANG Chao
613ed5cd76 network: also wait for ethernet interfaces to setup
We only wait for master interfaces for bridge/bonding/team/vlan case.
If none of these complex network is configured, we should wait for
ethernet interface (bootdev) instead.
2013-08-14 15:04:05 +02:00
Harald Hoyer
3605b48508 shutdown: fixed killall_proc_mountpoint() 2013-08-14 15:04:05 +02:00
Harald Hoyer
4fe1bdd406 dracut-functions.sh: if no libdirs are set, take the ld.so.cache paths 2013-08-14 15:04:05 +02:00
Harald Hoyer
a13bf117d5 crypt: only manually activate systemd-cryptsetup, if not in crypttab
Only additional rd.luks.UUID have to be manually activated.
2013-08-13 10:26:29 +02:00
Harald Hoyer
730b9b8b77 crypt/crypt-run-generator: also skip if UUID match in crypttab 2013-08-13 01:20:06 +02:00
Harald Hoyer
5e264a5d3e add bash module 2013-08-13 00:39:10 +02:00
Harald Hoyer
4baac4b291 crypt/module-setup.sh: use crypttab in hostonly and don't install cmdline 2013-08-13 00:35:10 +02:00
Harald Hoyer
1f4f8fb9e3 fs-lib/module-setup.sh: install fsck and fsck.ext* 2013-08-13 00:19:05 +02:00
Harald Hoyer
af75a298c1 dracut.sh: always assemble /usr in the initramfs 2013-08-12 23:55:50 +02:00
Harald Hoyer
9fc144451d dracut.sh: always assemble /usr device in initramfs 2013-08-12 23:50:30 +02:00
Harald Hoyer
861d9430c0 lsinitrd.sh: fixed modules.txt path 2013-08-12 23:50:07 +02:00
Harald Hoyer
e8b9702c0a systemd/dracut-initqueue.sh: added missing "then" 2013-08-12 13:08:17 +02:00
Harald Hoyer
109283a883 base: don't install switch_root, if systemd is used 2013-08-12 12:57:41 +02:00
Harald Hoyer
e95b672376 dracut.sh: fixed typo 2013-08-12 12:46:35 +02:00
Harald Hoyer
dadd2b698e dracut.sh: use local lsinitrd.sh for "-l" 2013-08-12 12:46:03 +02:00
Harald Hoyer
3e70a25bcf dracut-logger.sh: saveguard logger with -- 2013-08-12 12:44:10 +02:00
Harald Hoyer
3e6c9011d0 dracut-logger.sh: do not unset logging messages if sysloglvl is set 2013-08-09 15:47:30 +02:00
Harald Hoyer
d93fe0fa35 lsinitrd.sh: fixed case 2013-08-09 15:35:20 +02:00
dyoung@redhat.com
beb26a0847 omit drivers fix
Because omit_drivers list use underline always, so when maching with it
the _mod need to be converted as well or sometimes omit-drivers will fail
silently.

Fix this by replace '-' with '_' in instmods function.

Signed-off-by: Dave Young <dyoung@redhat.com>
2013-08-09 14:13:30 +02:00
Harald Hoyer
e84d115b93 multipath: need_shutdown if multipath devices exist
https://bugzilla.redhat.com/show_bug.cgi?id=994913
2013-08-09 10:44:34 +02:00
Harald Hoyer
7929ec198f iscsi/module-setup.sh: install some modules regardless of hostonly 2013-08-09 10:33:27 +02:00
Harald Hoyer
0b11ea7199 network/net-lib.sh: fix ibft interface configuration
also skip ibft$num names, which have been already given

https://bugzilla.redhat.com/show_bug.cgi?id=989944
2013-08-07 16:05:59 +02:00
James Lee
7deba0428a crypt: Fix typo--/etc/crypttab not /etc/cryptab
1ae8b8a breaks the crypt module for those who use keyfiles due to a
typo leading to the exclusion of /etc/crypttab from the initrd.
2013-08-07 10:33:15 +02:00
Harald Hoyer
aacdba2bdb dracut.sh: check the value of --kver
https://bugzilla.redhat.com/show_bug.cgi?id=993327
2013-08-07 10:33:15 +02:00
Harald Hoyer
5ae33613ab dracut.sh: do not strip in FIPS mode 2013-08-07 10:33:15 +02:00
Harald Hoyer
8652d5493d 51-dracut-rescue.install: fixed rescue image creation 2013-08-07 10:33:15 +02:00
Harald Hoyer
af11946054 dracut-functions.sh: inst_multiple == dracut_install 2013-08-07 10:33:15 +02:00
Harald Hoyer
55a0b3abc7 dracut-functions.sh: removed non dracut-install shell functions 2013-08-07 10:33:15 +02:00
Harald Hoyer
a4f7b50471 dracut.sh/dracut-functions.sh: handle root on non-block device 2013-08-07 10:33:14 +02:00
Harald Hoyer
226e3710b4 systemd/dracut-initqueue.sh: continue to boot if finished failed
but /sysroot/etc/fstab exists.
2013-08-07 10:33:14 +02:00
Harald Hoyer
89f7217954 dracut.asc: small corrections 2013-08-07 10:33:14 +02:00
Harald Hoyer
283c34fc2b dracut.sh: call find with -print0 and cpio with --null 2013-08-07 10:33:14 +02:00
Harald Hoyer
1cb6524918 lsinitrd.sh: add old cpio signature 2013-08-05 11:14:24 +02:00
WANG Chao
ff66b6dad3 95terminfo: install vt102
systemd uses vt102 as default term for tty:

commit acda6a0
Author: Lennart Poettering <lennart@poettering.net>
Date:   Sun Apr 22 02:45:39 2012 +0200

    default to v102 everywhere, instead of vt100, to synchronize with agetty

Signed-off-by: WANG Chao <chaowang@redhat.com>
2013-08-01 12:55:55 +02:00
Harald Hoyer
64a7eace88 cms/cmssetup.sh: correct port for zfcp.conf 2013-07-31 17:29:12 +02:00
Harald Hoyer
051de5aadc lvm: add "--yes" to lvm lvchange 2013-07-31 17:17:37 +02:00
Baoquan He
d2765b5175 Change the implementation of action_on_fail
Currently when action_on_fail is enabled, the emergency_shell won't be called.
In kdump even though user specify the default action as emergency_shell,
dracut skip it. Now change the implementation of action_on_fail to depend
on a file which is created by kdump when making kdump initrd, then remove it
at the beginning of kdump. This can solve the explicit emergency_shell problem.

And action_on_fail won't need paramenters, remove the relevant description in
dracut man page.

Signed-off-by: Baoquan He <bhe@redhat.com>
2013-07-31 16:23:39 +02:00
Harald Hoyer
d27cd4dfdd Revert "base: setup correct system time and time zone in initrd"
This reverts commit 77364fd6bb.

Too many problems with adjtime in the initramfs

https://bugzilla.redhat.com/show_bug.cgi?id=981617
2013-07-31 15:55:22 +02:00
Radek Vykydal
030b00b8a5 Generate correct ifcfg file for vlan= option. 2013-07-31 15:47:33 +02:00
Harald Hoyer
de50e9c002 dracut-031 2013-07-31 14:24:25 +02:00
Harald Hoyer
868f935e23 kernel-modules/module-setup.sh: silently omit some filesystem drivers 2013-07-31 13:56:03 +02:00
Harald Hoyer
4ba662ff90 dracut.conf.d/fedora.conf.example: don't omit drivers 2013-07-31 13:56:03 +02:00
Harald Hoyer
dc7085ceeb systemd: use systemd in the initramfs, if installed on the system
and systemd version is >= 198
2013-07-31 13:56:03 +02:00
Harald Hoyer
9444bf6161 network: add vlan support for iBFT 2013-07-31 13:17:24 +02:00
Harald Hoyer
06ca27cdf5 dracut-logger.sh: do not use systemd-cat, if no /run/systemd/journal 2013-07-31 13:12:41 +02:00
Harald Hoyer
dd82da4e27 network/net-lib.sh: safeguard against incomplete iBFT settings 2013-07-31 12:00:53 +02:00
Harald Hoyer
190047f161 fips: handle checksum checks for RHEV kernels
https://bugzilla.redhat.com/show_bug.cgi?id=947729
2013-07-31 11:31:13 +02:00
Harald Hoyer
748867d177 fips: cope with module aliases, when checking modules
Also do not fail, if module aliases try to load CPU specific modules
like crc32c_intel.
2013-07-31 11:26:46 +02:00
Harald Hoyer
b806625d41 TEST-30-ISCSI: eth0 -> ens3 2013-07-31 11:23:51 +02:00
Harald Hoyer
dba2055979 remove "< <(" syntax
bash seems to want /dev/fd in that case. dracut is sometimes called in
environments, where /proc and /dev are not mounted.
2013-07-31 11:00:29 +02:00
Harald Hoyer
aa23dcd8ae TEST-50-MULTINIC: change interface names to ens* 2013-07-31 10:59:25 +02:00
Harald Hoyer
5bbbfeaf19 TEST-10: double disk space 2013-07-31 09:57:57 +02:00
Harald Hoyer
9b6c5fd7c7 dracut.spec: add bcache and modsign module 2013-07-30 16:21:59 +02:00
Harald Hoyer
904a76376f base/init.sh: create static device nodes with kmod 2013-07-30 16:20:05 +02:00
Harald Hoyer
52814c0ee3 systemd/dracut-pre-trigger.service: run after systemd-tmpfiles-setup-dev 2013-07-30 16:18:51 +02:00
Harald Hoyer
d124904f2b systemd: include systemd-tempfiles 2013-07-30 16:18:03 +02:00
Harald Hoyer
7fd850d58e dracut.sh: check for file existance before trying to read from it 2013-07-30 15:33:10 +02:00
Harald Hoyer
71bb2ecd79 base: hard depend on systemd, if system was started by systemd 2013-07-30 15:28:47 +02:00
James Lee
6e0348f33b crypt: Wait for udev to settle before unlocking disk
To eliminate a race condition that occurs when unlocking one device
depends on the result of unlocking a device before it, the crypt
module must wait for udev to settle between each unlock attempt.

Example

/etc/crypttab:

  keyfile /dev/md1 none luks
  sda4_crypt /dev/sda4 /dev/mapper/keyfile luks
  sdb4_crypt /dev/sdb4 /dev/mapper/keyfile luks

Without this patch, sometimes /dev/sda4 fails to unlock because udev
doesn't have time to create /dev/mapper/keyfile before it's needed.
2013-07-30 15:28:47 +02:00
Harald Hoyer
27458b10ff url-lib/module-setup.sh: fixed grepping libcurl 2013-07-30 15:28:46 +02:00
Harald Hoyer
bf27e473cb mdraid/mdmon-pre-shutdown.sh: removed unneeded code 2013-07-30 15:28:46 +02:00
Harald Hoyer
549442cc2a base/dracut-lib.sh: check for /proc/cmdline existance 2013-07-30 15:28:46 +02:00
Harald Hoyer
98836432c1 dracut.spec: fix typo 2013-07-30 15:28:46 +02:00
Harald Hoyer
d988dc30df systemd: add support for kmod static devnodes 2013-07-30 11:58:33 +02:00
Harald Hoyer
c5f8b69ad7 network:ifup handle bootif style interfaces
e.g. ip=77-77-6f-6f-64-73:dhcp
2013-07-29 16:06:28 +02:00
Amadeusz Żołnowski
2beee35d5e LatArCyrHeb-16 as a default i18n font for Gentoo 2013-07-26 08:03:16 +02:00
Amadeusz Żołnowski
1ae8b8aa02 crypt: Skip /etc/crypttab if not present
Prevents following error message:

I: *** Including module: crypt ***
/usr/lib/dracut/modules.d/90crypt/module-setup.sh: line 31: /etc/crypttab: No such file or directory
2013-07-26 08:03:15 +02:00
Harald Hoyer
8f092d0dda bcache: add support for bcache 2013-07-24 14:35:19 +02:00
Harald Hoyer
d624f60682 dracut.sh: check for /sbin /bin /lib
use readlink to detect, if /usr has to be mounted
2013-07-24 13:43:32 +02:00
Harald Hoyer
5decf6d813 add debian udev rule files 2013-07-24 13:42:17 +02:00
Harald Hoyer
1a1c80febe usrmount: do not install, if /sbin/init does not live in /usr 2013-07-24 13:41:57 +02:00
Harald Hoyer
7b3ff4e055 dracut-functions.sh:get_fs_env() fallback to blkid for ID_FS_TYPE not found 2013-07-24 13:38:57 +02:00
Harald Hoyer
56b58c0a94 modsign: do not install, if no keys present
also fixed inst_hook
2013-07-24 10:34:19 +02:00
Kyle McMartin
ad2565c8ff dracut: 90kernel-modules/module-setup.sh: add ehci-tegra.ko on arm
kernel-tegra is now part of the base kernel package, so bits and pieces
ended up modular, and as a result, if you boot off the internal USB, you
drop to a dracut shell with no way of getting to root.
2013-07-24 10:23:10 +02:00
Peter Jones
9f3d191fce Load kernel module signing keys before we start doing any real work.
This loads kernel module signing keys, so that we can verify signed
modules in secure boot mode.

Signed-off-by: Peter Jones <pjones@redhat.com>
2013-07-24 10:23:09 +02:00
Brandon Philips
f17c5fa573 95rootfs-block: fix PARTUUID parsing
In the kernel comments PARTUUID is shown using uppercase A-F:
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/init/do_mounts.c?id=HEAD#n183

However, dracut tries to use the value of PARTUUID directly in
/dev/disks/by-partuuid/ which expects the hex to be lowercase. This will
cause root to never be found, oops!

Fix dracut so it can, like the Kernel, accept either casing.

Untested but I added a hack on my local system that was similar.
2013-07-24 10:23:09 +02:00
Colin Walters
99369bea1c systemd: Replace prefdm.service with display-manager.service
The former is dead, the latter is the new name.  See:

http://cgit.freedesktop.org/systemd/systemd/commit/?id=b2c9cbafb8b1a2742978e1faf37fbb3cf4fb5d44
https://fedoraproject.org/wiki/Features/DisplayManagerRework
2013-07-24 10:23:08 +02:00
Harald Hoyer
45ef8eb723 base: provide pidof() shell function 2013-07-23 12:56:20 +02:00
Harald Hoyer
bc6eae15ab init.sh: don't check for systemd-udevd in lower version branch 2013-07-23 12:26:06 +02:00
Harald Hoyer
475f3a8128 dracut.spec: require procps-ng for ps 2013-07-23 12:25:38 +02:00
Harald Hoyer
6b1e7a6ca4 dracut: use sysloglvl for systemd-cat logging 2013-07-19 09:46:00 +02:00
Harald Hoyer
bbaa0d5917 Use systemd-cat for logging on systemd systems, if logfile is empty 2013-07-19 09:34:45 +02:00
Harald Hoyer
3c4bfd685a dracut-functions.sh: only wait for the last pid spawned 2013-07-19 09:34:04 +02:00
Harald Hoyer
9dde7a66b5 dracut-functions.sh: don't warn twice about omitted modules 2013-07-19 09:33:45 +02:00
Harald Hoyer
34b56de12a resume: do not include in hostonly, if no swap is present 2013-07-18 14:41:31 +02:00
Harald Hoyer
951cedf8cb Revert "systemd: add systemd-fsck-root.service"
This reverts commit 35857f556c.
2013-07-17 15:05:30 +02:00
Harald Hoyer
0baf97618d AUTHORS: update 2013-07-17 14:58:44 +02:00
Harald Hoyer
8642792c3e NEWS: update 2013-07-17 14:58:35 +02:00
Harald Hoyer
5bbfd48475 dracut: do not enable early microcode inclusion by default 2013-07-17 14:36:34 +02:00
Harald Hoyer
c33488feb1 rename sosreport to rdsosreport
Renamed sosreport to rdsosreport to differ from the sosreport tool on
the real root.
2013-07-17 14:31:59 +02:00
Harald Hoyer
18e61d3d41 rename dracut-nohostonly and dracut-norescue rpm subpackages
dracut-nohostonly -> dracut-config-generic
dracut-norescue   -> dracut
                  -> dracut-config-rescue
2013-07-17 13:02:58 +02:00
Harald Hoyer
fbf717086e dmraid: let dmraid setup the partitions 2013-07-17 12:07:19 +02:00
Harald Hoyer
5a6a98f875 do not wait_for_dev for the root device
it's specified on the kernel command line
2013-07-17 12:03:01 +02:00
Harald Hoyer
35857f556c systemd: add systemd-fsck-root.service 2013-07-17 12:00:04 +02:00
Harald Hoyer
a6865e6897 rootfs-block: do not touch root-fsck
in systemd environments, we use systemd in the initramfs
2013-07-17 11:58:55 +02:00
Harald Hoyer
55068924f7 i18n: do not moan about missing kbd directory 2013-07-17 11:58:17 +02:00
Harald Hoyer
16addb86fc base: remove RD_TIMESTAMP 2013-07-17 11:26:55 +02:00
Konrad Rzeszutek Wilk
5f2c30d9bc dracut.sh: Support early microcode loading.
On Wed, Jul 10, 2013 at 10:58:15AM -0400, Konrad Rzeszutek Wilk wrote:
> On Wed, Jul 10, 2013 at 09:37:11AM +0200, Harald Hoyer wrote:
> > On 07/10/2013 02:29 AM, Yu, Fenghua wrote:
> > >> From: Konrad Rzeszutek Wilk [mailto:konrad.wilk@oracle.com]
> > >> Sent: Tuesday, July 09, 2013 12:24 PM
> > >> Implement it per Linux kernel Documentation/x86/early-microcode.txt
> > >> (from v3.11-rc0):
> > [...]
> > > This patch works fine with one microcode blob in binary format. There are situations that the microcode is not delivered in one blob in binary format:
> > >
> > > First, each microcode patch is one file instead all microcode patches are in one big blob. Secondly, old delivered microcode file is in ascii format.
> > >
> > > To handle those formats, additional code needs to convert the formats into one big binary microcode blob. I'm not sure if we should consider the code and if we should put the code in dracut.
> > >
> > > Thanks.
> > >
> > > -Fenghua
> > >
> >
> >
> > $ ls /lib/firmware/amd-ucode
> > microcode_amd.bin  microcode_amd_fam15h.bin  microcode_amd_solaris.bin
>
> Right, so all of those blobs (for AMD) get stuck in AuthenticAMD.bin.
>
> > $ ls /lib/firmware/intel-ucode
> > 06-03-02  06-06-00  06-07-02  06-08-0a  06-0b-04  06-0f-06  06-16-01  06-1c-02
> > 06-25-02  06-2d-07  0f-01-02  0f-02-09  0f-04-03  0f-04-0a
> > 06-05-00  06-06-05  06-07-03  06-09-05  06-0d-06  06-0f-07  06-17-06  06-1c-0a
> > 06-25-05  06-2f-02  0f-02-04  0f-03-02  0f-04-04  0f-06-02
> > 06-05-01  06-06-0a  06-08-01  06-0a-00  06-0e-08  06-0f-0a  06-17-07  06-1d-01
> > 06-26-01  06-3a-09  0f-02-05  0f-03-03  0f-04-07  0f-06-04
> > 06-05-02  06-06-0d  06-08-03  06-0a-01  06-0e-0c  06-0f-0b  06-17-0a  06-1e-04
> > 06-2a-07  0f-00-07  0f-02-06  0f-03-04  0f-04-08  0f-06-05
> > 06-05-03  06-07-01  06-08-06  06-0b-01  06-0f-02  06-0f-0d  06-1a-04  06-1e-05
> > 06-2d-06  0f-00-0a  0f-02-07  0f-04-01  0f-04-09  0f-06-08
>
> And all of those get catted in GenuineIntel.bin.
>
> >
> > Also, for [[ $hostonly ]], we only want to add the current running CPU microcode.
>
> <nods> Will do that. Are you OK with me adding some of this CPU detection logic
> in dracut-functions.sh?

This is still RFC, as I had not done the --no-compress logic (or tested it).
Please see if this is OK:

>From 5f853d2ececd4cadff648e22cb9c9287a01a9783 Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Tue, 9 Jul 2013 13:57:01 -0400
Subject: [PATCH] dracut.sh: Support early microcode loading.

Implement it per Linux kernel Documentation/x86/early-microcode.txt
(from v3.11-rc0):

<start>
Early load microcode
====================
By Fenghua Yu <fenghua.yu@intel.com>

Kernel can update microcode in early phase of boot time. Loading microcode early
can fix CPU issues before they are observed during kernel boot time.

Microcode is stored in an initrd file. The microcode is read from the initrd
file and loaded to CPUs during boot time.

The format of the combined initrd image is microcode in cpio format followed by
the initrd image (maybe compressed). Kernel parses the combined initrd image
during boot time. The microcode file in cpio name space is:
on Intel: kernel/x86/microcode/GenuineIntel.bin
on AMD  : kernel/x86/microcode/AuthenticAMD.bin

During BSP boot (before SMP starts), if the kernel finds the microcode file in
the initrd file, it parses the microcode and saves matching microcode in memory.
If matching microcode is found, it will be uploaded in BSP and later on in all
APs.

The cached microcode patch is applied when CPUs resume from a sleep state.

There are two legacy user space interfaces to load microcode, either through
/dev/cpu/microcode or through /sys/devices/system/cpu/microcode/reload file
in sysfs.

In addition to these two legacy methods, the early loading method described
here is the third method with which microcode can be uploaded to a system's
CPUs.

The following example script shows how to generate a new combined initrd file in
/boot/initrd-3.5.0.ucode.img with original microcode microcode.bin and
original initrd image /boot/initrd-3.5.0.img.

mkdir initrd
cd initrd
mkdir -p kernel/x86/microcode
cp ../microcode.bin kernel/x86/microcode/GenuineIntel.bin (or AuthenticAMD.bin)
find . | cpio -o -H newc >../ucode.cpio
cd ..
cat ucode.cpio /boot/initrd-3.5.0.img >/boot/initrd-3.5.0.ucode.img
<end>

That is what we do in the patch. Furthermoere there is also
an off-switch: "no-early-microcode" to disable it.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
[v1: Support --host-only parameter]
2013-07-15 14:06:40 +02:00
Harald Hoyer
c00f8e05a6 dracut.sh: correct dropindirs_sort 2013-07-12 10:35:49 +02:00
Harald Hoyer
85231e1ff3 base/module-setup.sh: do not add devs to initqueue/finished
when need-initqueue is not set in systemd mode
2013-07-12 10:15:10 +02:00
Harald Hoyer
88396c383c base/module-setup.sh: do not include systemd-timestamp
when using systemd in the initramfs
2013-07-12 10:14:15 +02:00
Harald Hoyer
df03141dbc dracut-cmdline.service: remove Before: systemd-vconsole-setup.service 2013-07-12 09:47:24 +02:00
Harald Hoyer
bf9cdc472c systemd/module-setup.sh: create emtpy /etc/machine-id
Even in hostonly mode, if none was found on the system.
2013-07-11 12:15:17 +02:00
Harald Hoyer
02b5c8e3a3 dracut.sh: unset all LC_* and LANG
saves 10% of time :-)
2013-07-05 16:27:34 +02:00
Harald Hoyer
f734347ae7 modules.d/10i18n/module-setup.sh: handle empty vconsole.conf
if /etc/vconsole.conf exists and is empty, then do not install anything.
2013-07-05 15:48:40 +02:00
Harald Hoyer
4aca0017e8 terminfo: only install l/linux v/vt100 and v/vt220 2013-07-05 15:32:58 +02:00
Harald Hoyer
1e057b352a add PARTLABEL and PARTUUID 2013-07-05 15:32:38 +02:00
Harald Hoyer
431b86c8e9 masterkey/module-setup.sh:check() check for $hostonly rather than "-h" 2013-07-04 12:31:31 +02:00
Harald Hoyer
b093aa2dc7 beautified shell code
checked with shellcheck http://www.shellcheck.net/about.html
2013-07-04 12:31:15 +02:00
Harald Hoyer
32bd2fbb4c use "rm --" to guard against filenames beginning with "-" 2013-06-28 10:31:18 +02:00
Harald Hoyer
1d84d6940e TEST-04-FULL-SYSTEMD/test.sh: dlfgjlkdfjgldfj 2013-06-28 10:22:27 +02:00
Harald Hoyer
87ae968810 test/run-qemu: specify the kernel 2013-06-28 10:21:42 +02:00
Harald Hoyer
f13deabd22 systemd/module-setup.sh: add slices.target 2013-06-28 09:58:03 +02:00
Harald Hoyer
0d59a84b53 TEST-04-FULL-SYSTEMD: call xargs with "-r" 2013-06-26 09:16:04 +02:00
Harald Hoyer
68cb510f18 systemd: add system.slice unit 2013-06-26 09:15:34 +02:00
Harald Hoyer
5e60145449 use findmnt with "--source" or "--target"
This avoids hanging on stale NFS mounts, which are not part of the boot
process.

https://bugzilla.redhat.com/show_bug.cgi?id=975401
2013-06-24 12:47:53 +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
WANG Chao
32d115f385 selinux: umount $NEWROOT/dev and its submounts
$NEWROOT/dev and its submounts should be umounted after we use it.
Otherwise it fails other scripts that umount /sysroot only.

Signed-off-by: WANG Chao <chaowang@redhat.com>
2013-06-18 08:56:11 +02:00
Harald Hoyer
416d3d6390 NEWS: update 2013-06-14 15:31:28 +02:00
Baoquan He
8a9a5838f3 90lvm/module-setup.sh: redirect error message of lvs to /dev/null
Signed-off-by: Baoquan He <bhe@redhat.com>
2013-06-13 15:49:20 +02:00
Harald Hoyer
a94cd56d6f test/TEST-50-MULTINIC: fix interface test 2013-06-13 15:15:55 +02:00
Harald Hoyer
b819f519cb network: refix BOOTIF logic 2013-06-13 15:15:19 +02:00
Harald Hoyer
44d832c5ad test/TEST-50-MULTINIC: fixed debug output 2013-06-13 14:44:47 +02:00
Harald Hoyer
4961910fe3 systemd/module-setup.sh: mkdir /etc/systemd 2013-06-13 14:44:13 +02:00
Will Woods
3d0da653f0 net-lib: fix set_ifname()
/sys/class/$name$num isn't ever going to work; /sys/class/net/$name$num
(e.g. /sys/class/net/ibft0) should work right.
2013-06-13 14:07:17 +02:00
Will Woods
4ef0e2d92a net-lib: add configured_ifaces()
configured_ifaces is a function that returns the names of each interface
that the user wanted configured.

Currently, this is accomplished by reading the list from
/tmp/net.ifaces. But if we want to allow the user to specify an
interface by its MAC address or IP or something, we need a function that
will read the cache and convert the MACs etc. to names.

(Obviously this conversion only works once udev starts, so it will warn
you if you try it too early.)
2013-06-13 14:07:17 +02:00
Will Woods
bd0f2c034a net-lib: add find_iface_with_link()
Add a function to look at the system network interfaces and return the
first one it finds with an active link (if any.)
2013-06-13 14:07:17 +02:00
Will Woods
d8a698713e Don't explode when mixing BOOTIF and ip=
Now that we can use a MAC as a device identifier, we can just bring up
the device specified by BOOTIF as a normal interface.

So instead of ignoring everything but BOOTIF, we'll put BOOTIF in the
IFACES list and bring it up as normal, defaulting to DHCP if nothing
else is specified.

We can also handle anaconda-style 'ksdevice=bootif' this way.
2013-06-13 14:07:17 +02:00
Will Woods
57f2579281 net-genrules: accept MAC address for $iface, cleanups
A MAC address is a unique identifier for a particular network interface.

We can use the MAC to generate udev rules to bring up that interface,
like we currently do with BOOTIF.

This patch allows interfaces to be specified as a MAC address, either
in the usual colon-separated form or the PXE-style dash-separated form.

(The latter is more useful on the commandline, since it allows for
arguments like: "ip=77-77-6f-6f-64-73:dhcp")

This is useful since it's common for a user who is booting a new OS for
the first time to know the MAC of the device, but not know what the
kernel name will be.
2013-06-13 14:07:17 +02:00
Will Woods
215ff169db move fix_bootif to net-lib
This might be useful to other parts of dracut; move it to net-lib.sh.
2013-06-13 13:54:16 +02:00
Harald Hoyer
85b458d90d Makefile: source dracut-version.sh and correct dist tarball 2013-06-13 12:55:26 +02:00
Harald Hoyer
268ae2841b Makefile: pipe git describe errors to /dev/null 2013-06-13 12:55:26 +02:00
Harald Hoyer
638cad7c97 add dracut-shutdown.service.8.asc manpage 2013-06-13 12:55:26 +02:00
Harald Hoyer
0fbb79d54f move dracut-shutdown.service to modules.d/98systemd 2013-06-13 11:42:26 +02:00
Harald Hoyer
36c34f4e71 Don't use do syncheck for target all and refine syncheck
instead of "dash -n" we now use "bash --posix -n"
we also check for "[[ " in posix shell files
2013-06-13 11:19:26 +02:00
Harald Hoyer
373efa4427 systemd: make unit files symlinks 2013-06-13 11:08:03 +02:00
Harald Hoyer
cee4599131 systemd/dracut-pre-pivot.service: also execute for cleanup hooks or rd.break 2013-06-13 10:37:45 +02:00
Harald Hoyer
c6011f2add i18n: make the default font configurable
To set the default font for your distribution, add
i18n_default_font="latarcyrheb-sun16"
to your /lib/dracut/dracut.conf.d/01-dist.conf distribution config.
2013-06-13 09:29:17 +02:00
Harald Hoyer
f8b958dc62 network: wait 40 seconds for IPv6 auto configuration
https://bugzilla.redhat.com/show_bug.cgi?id=973719
2013-06-12 17:42:35 +02:00
Harald Hoyer
036712546b NEWS: update 2013-06-12 13:29:39 +02:00
Harald Hoyer
391d605790 rename kernel command line param action_on_fail to rd.action_on_fail 2013-06-12 13:16:33 +02:00
Harald Hoyer
aef0f55791 dmsquash-live/iso-scan: wait until the iso-scan/filename is found
Do not only run once, but wait until all devices are found.
2013-06-12 12:49:03 +02:00
Harald Hoyer
66ed711ccf systemd/dracut-initqueue.service: specify all initqueues 2013-06-07 13:56:16 +02:00
Harald Hoyer
960b1e48e8 TODO: update 2013-06-07 12:39:46 +02:00
WANG Chao
437a56dc6b dracut-initqueue.service: Fix systemd start condition
Scripts in dracut initqueue hooks are placed under
/usr/lib/dracut/hooks/initqueue/*/ directory.

And also start initqueue service when kernel cmdline has
rd.break=initqueue

Signed-off-by: WANG Chao <chaowang@redhat.com>
2013-06-07 12:38:36 +02:00
Harald Hoyer
630aed8b66 udev-rules: add 80-net-name-slot.rules 2013-06-06 15:40:29 +02:00
Harald Hoyer
af6292f0fc cms/cmssetup.sh: untabify 2013-06-06 14:13:36 +02:00
Harald Hoyer
b710520a3d cms/cmssetup.sh: reload udev rules after adding them 2013-06-06 14:13:01 +02:00
Harald Hoyer
66e092bb53 cms/cmssetup.sh: fix LAYER2 ccw.conf setup 2013-06-06 12:32:36 +02:00
Harald Hoyer
fdc1037b19 cms/cmsifup.sh: correctly set MACADDR and MTU for the ip line
https://bugzilla.redhat.com/show_bug.cgi?id=971025
2013-06-06 12:28:34 +02:00
Harald Hoyer
76df206685 cms/cmssetup.sh: do not echo newlines for ccw.conf
https://bugzilla.redhat.com/show_bug.cgi?id=970982
2013-06-06 12:27:19 +02:00
WANG Chao
77364fd6bb base: setup correct system time and time zone in initrd
Currently in initrd, hardware clock is always considered to use UTC time
format and system time zone is also UTC. Thus system time isn't correct
if hw clock is localtime or we're using other time zone in real root.

To fix this, install /etc/adjtime and /etc/localtime to initrd. If not
using systemd, install /usr/sbin/hwclock for dracut init to setup system
time.

[harald: combined the two hostonly if's]

Signed-off-by: WANG Chao <chaowang@redhat.com>
Signed-off-by: Harald Hoyer <harald@redhat.com>
2013-06-06 12:10:50 +02:00
Harald Hoyer
41b0e41a09 Makefile: report syntax check files for V=1 2013-06-06 11:31:07 +02:00
Harald Hoyer
791532b0ce dracut-install: install libs also from one dir above
some HW has different flavors of basic libs

$ ldconfig -p|fgrep libc.so
libc.so.6 (libc6,64bit, hwcap: 0x0000001000000000, OS ABI: Linux 2.6.32) => /lib64/power6/libc.so.6
libc.so.6 (libc6,64bit, hwcap: 0x0000000000000200, OS ABI: Linux 2.6.32) => /lib64/power6x/libc.so.6
libc.so.6 (libc6,64bit, OS ABI: Linux 2.6.32) => /lib64/libc.so.6

because setting LD_HWCAP_MASK=0 does not work, we have to workaround
this.

$ LD_TRACE_LOADED_OBJECTS=1  LD_HWCAP_MASK=0 /lib64/ld64.so.1 /bin/sh | fgrep libc.so
libc.so.6 => /lib64/power6/libc.so.6 (0x000000804e260000)

Now we try to install the same library from one directory above the one
we installed also.
2013-06-06 11:06:55 +02:00
Harald Hoyer
ad45024416 lvm: fixed "thin" recognition 2013-06-06 09:40:26 +02:00
Dennis Gilmore
3ae5ac28af include panel-tfp410 module on arm systems in the initramfs needed for framebuffer on omap systems 2013-06-06 09:38:44 +02:00
Harald Hoyer
fd28794bbc TEST-99-RPM: generate rpms and exclude /boot loader entries 2013-05-31 10:00:07 +02:00
Harald Hoyer
d18fd0235b dmsquash-live/dmsquash-live-root.sh: fixup 32214acb3a 2013-05-31 09:04:55 +02:00
Harald Hoyer
15c5c072f4 dracut-functions.sh:get_persistent_dev() fix case for multipath
/dev/mapper/mpath* is not a persistent device path

https://bugzilla.redhat.com/show_bug.cgi?id=969068
2013-05-31 07:47:01 +02:00
Harald Hoyer
caf207afa7 ifcfg/write-ifcfg.sh: fixed logic
seems like nobody tested this with recent dracut versions.
2013-05-30 14:37:41 +02:00
Harald Hoyer
57937cf480 lvm: add tools for thin provisioning
https://bugzilla.redhat.com/show_bug.cgi?id=921235
2013-05-30 12:02:59 +02:00
Harald Hoyer
feaf30ffaa network: wait for all required interfaces if "rd.neednet=1"
also set bootdev to the first configured interface, if missing

https://bugzilla.redhat.com/show_bug.cgi?id=801829
2013-05-30 11:38:23 +02:00
Harald Hoyer
dcae873414 systemd/emergency.service: do not run for action_on_fail=continue
same as for dracut-emergency.service
2013-05-30 11:14:39 +02:00
Harald Hoyer
32214acb3a dmsquash-live/dmsquash-live-root.sh: add parameter rd.live.squashimg
rd.live.squashimg names the squash image in the rd.live.dir
and defaults to squashfs.img

https://bugzilla.redhat.com/show_bug.cgi?id=789036
https://bugzilla.redhat.com/show_bug.cgi?id=782108
2013-05-30 09:27:54 +02:00
Harald Hoyer
e64bcf5a99 kernel-modules/module-setup.sh: add hid-hyperv and hv-vmbus 2013-05-30 08:38:40 +02:00
Harald Hoyer
62cb52f431 base/dracut-lib.sh: export DRACUT_SYSTEMD and NEWROOT 2013-05-30 08:32:18 +02:00
dyoung@redhat.com
cf8b1b7853 selinux: load_policy script fix
chroot load_policy will use selinuxfs which should be mounted
in $NEWROOT/sys/fs/selinux for Fedora 19, but because there's
no $NEWROOT/sys/fs, so later process will fail.

Fixing this by bind mount /sys to $NEWROOT/sys.

Signed-off-by: Dave Young <dyoung@redhat.com>
2013-05-30 08:28:11 +02:00
Dan Horák
bc97e005fa use system provides udev rule and initialization script 2013-05-30 08:28:10 +02:00
Baoquan He
679fa7ed3c 99fs-lib/fs-lib.sh: Let user specify the action after fail for fsck
The fsck is ignored when replace emergency_shell with action_on_fail,
now add it.

Signed-off-by: Baoquan He <bhe@redhat.com>
2013-05-30 08:28:08 +02:00
Harald Hoyer
4f084f3ab5 fs-lib/module-setup.sh: add xfs_metadump 2013-05-29 17:51:57 +02:00
Harald Hoyer
af2716626a kernel-modules/module-setup.sh: add nvme kernel module
apparently not caught by the block driver regexp

https://bugzilla.redhat.com/show_bug.cgi?id=910734
2013-05-29 14:48:13 +02:00
Harald Hoyer
6625c085ae ifcfg/write-ifcfg.sh:
- fix ONBOOT for slaves
- set TYPE=Bond for bonding

https://bugzilla.redhat.com/show_bug.cgi?id=919001
2013-05-29 14:38:52 +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
8099e7b1ba crypt-loop/module-setup.sh: install loop kernel module 2013-05-29 13:31:54 +02:00
Harald Hoyer
0a3e348225 i18n/module-setup.sh: install default font latarcyrheb-sun16 2013-05-29 13:27:03 +02:00
Harald Hoyer
b78e6ac2c3 dracut-emergency.service: do not start for "action_on_fail=continue" 2013-05-29 11:33:25 +02:00
Dennis Schridde
cbfe65c2fe [40network] Provide a hostname fallback function, in case there is no executable of this name 2013-05-29 11:32:57 +02:00
Harald Hoyer
284d62da81 ifcfg/write-ifcfg.sh: proper NAME the interfaces
https://bugzilla.redhat.com/show_bug.cgi?id=965842
2013-05-28 16:56:40 +02:00
Harald Hoyer
c6df70fb48 btrfs: include btrfs-zero-log in the initramfs
https://bugzilla.redhat.com/show_bug.cgi?id=963257
2013-05-28 16:34:56 +02:00
Harald Hoyer
1b8616adee url-lib/url-lib.sh: turn off curl globbing
https://bugzilla.redhat.com/show_bug.cgi?id=907497
2013-05-28 16:16:26 +02:00
Harald Hoyer
639bd4873b dracut.spec: put selinux for kdump crash file contexts 2013-05-28 15:40:45 +02:00
Kamil Rytarowski
e0904b27ff Fix memory leak 2013-05-28 14:36:37 +02:00
Kamil Rytarowski
d9eff33ce2 Always check the return number of asprintf
asprintf prints to an allocated string. When  successful,  the
functions return the number of bytes printed. If memory allocation
wasn't possible, or some other error occurs, the function will return
-1.

Don't check strp as a result of asprintf, it's content may be undefined.

man 3 asprintf
2013-05-28 14:35:54 +02:00
Kamil Rytarowski
8974102f6b Use consistiently termination code macros
Operate in install_all and install_one consequently on EXIT_SUCCESS
and EXIT_FAILURE termination code macros as they are meant to be
returned from these functions.
2013-05-28 14:34:44 +02:00
Kamil Rytarowski
599182b108 Introduce stricter type correctness 2013-05-28 14:34:29 +02:00
Kamil Rytarowski
6a736cc129 Fix parsing command line arguments
Adjust correctly the *optstring argument of getopt_long. Add support
for a missing option -v|--verbose and drop unknown options -D, -I and -L.
2013-05-28 14:33:02 +02:00
Baoquan He
15b93069bb 01fips/module-setup.sh: add libssl.so.10 to make kdump work with fips mode
FIPS can work well in 1st kernel, but failed in kdump kernel. the
libssl.so.10 and related hmac file are needed. Now add it and it
works.

Signed-off-by: Baoquan He <bhe@redhat.com>
2013-05-28 14:26:31 +02:00
Harald Hoyer
19b5c10963 dracut-functions.sh: clarify instmods() error message 2013-05-28 14:25:49 +02:00
Harald Hoyer
bcfbddefe1 don't add volatile swap partitions to host_devs 2013-05-28 13:36:37 +02:00
Harald Hoyer
780cb33741 systemd: set environment vars DRACUT_SYSTEMD, NEWROOT in service file 2013-05-28 12:50:57 +02:00
Adam Williamson
8d7c07f191 don't specify "p" as a separator for dmraid arrays (RHBZ #966162)
As per RHBZ #966162, parted stopped unconditionally using "p" as a
separator for dmraid device names in version 3.1, so other things need
to fall in line with that convention now.
2013-05-27 10:08:53 +02:00
Harald Hoyer
fefd3f66f9 dracut.sh: degrade message about missing tools for stripping
warning -> info

https://bugzilla.redhat.com/show_bug.cgi?id=958519
2013-05-06 14:20:16 +02:00
Colin Guthrie
d57b8833c4 usrmount: Fix miss-detection of btrfs subvolumes.
This causes the root FS options to be incorrectly applied to to /usr
In some cases this can cause boot failure e.g. due to and XFS /usr
not supporting the 'acl' option from the ext4 root FS.

https://bugs.mageia.org/show_bug.cgi?id=9884
2013-05-06 14:06:07 +02:00
Harald Hoyer
9584c6ae90 zfcp: match udev rule against KERNEL=="zfcp"
zfcp_cfdc will go away in the future

	tt
2013-04-30 18:56:15 +02:00
Harald Hoyer
021b2fddff test: use grep option "-F" and install /etc/os-release 2013-04-30 18:54:33 +02:00
WANG Chao
b6f2e05819 _emergency_shell: Show current working directory correctly in shell.
When dropped to emergency shell, for example, use rd.break=pre-pivot,
the PS1 won't correctly show current directory we're in:

pre-pivot:/# cd /sysroot/
pre-pivot:/#
(still shows "/")

Let's take a look at PS1 variable:

(I'm adding prefix/suffix 'x' to make it clear):
pre-pivot:/# echo x${PS1}x
xpre-pivot:/# x
(PS1 isn't dynamic)

Regarding the current dracut code, it should be:

pre-pivot:/# cd /sysroot/etc
pre-pivot:/sysroot/etc#

With this patch:

pre-pivot:/# echo x${PS1}x
xpre-pivot:${PWD}# x
(Now PS1 is dynamic, it will show the directory correctly)

I tested for both normal boot and kdump boot.

Signed-off-by: WANG Chao <chaowang@redhat.com>
2013-04-30 12:13:56 +02:00
Harald Hoyer
3ed08d1e4d dracut-install: make use of _cleanup_* macros 2013-04-29 11:35:23 +02:00
Harald Hoyer
26a077fc7e fips: do not fail immediatly after loading the crypto modules
Fail only if tcrypt insmod failed.
2013-04-29 11:34:26 +02:00
Harald Hoyer
8461734ee4 dracut.sh: do not preunlink for fips mode
just install prelink and the cache files
2013-04-25 21:16:03 +02:00
Harald Hoyer
6f4c2dada4 fixed fips mode
- preserve timestamps
- copy /lib*/hmaccalc files
- run sha512hmac after kernel module loading
- add more fips kernel modules
2013-04-25 19:44:01 +02:00
Harald Hoyer
ab42fe38fd fixup 3be5d63c2f
either test or []
2013-04-19 15:08:16 +02:00
Harald Hoyer
3be5d63c2f shutdown: redirect output to /dev/console only if it exists 2013-04-19 15:00:20 +02:00
Harald Hoyer
b4dc22cab7 dracut-install: error out, if ldd reports no execution permission
This turns off lazy resolving on noexec mounted tmp directories.

https://bugzilla.redhat.com/show_bug.cgi?id=953426
2013-04-18 12:54:55 +02:00
Harald Hoyer
2b125c69cc base/dracut-lib.sh: do not setdebug, if not in initramfs 2013-04-18 12:54:30 +02:00
Harald Hoyer
9268366cad Makefile: remove dracut-version.sh on clean 2013-04-16 13:41:19 +02:00
Harald Hoyer
d0eedc4a5f .gitignore: ignore more files 2013-04-16 13:38:16 +02:00
Harald Hoyer
4460416abc lsinitrd.sh: do not output filename for a single file 2013-04-16 13:36:04 +02:00
Harald Hoyer
884e1cda7c lsinitrd: drop use of "file" 2013-04-16 13:04:21 +02:00
Harald Hoyer
46a885bf9f dracut-bash-completion.sh: file filename completion 2013-04-16 11:32:32 +02:00
Harald Hoyer
7dbca9be86 lsinitrd: add bash completion 2013-04-16 11:32:31 +02:00
Harald Hoyer
7d9bb76ac7 lsinitrd: switch to getopt and add "-f" and "-k" parameter 2013-04-16 11:32:31 +02:00
Harald Hoyer
26ab7b07a6 Makefile: fixup tarball Makefile 2013-04-15 11:53:03 +02:00
Harald Hoyer
14499534ba dmsquash-live: add support for "iso-scan/filename" kernel parameter
now you can write grub entries like

  set isofile="/Fedora-live.iso"
  loopback loop $isofile
  linux loop)/isolinux/vmlinuz iso-scan/filename=$isofile root=live:CDLABEL=Fedora-...
  initrd (loop)/isolinux/initrd0.img
2013-04-15 11:39:32 +02:00
Harald Hoyer
1540df0e79 url-lib/module-setup.sh: install ca-bundle.crt by libcurl.so
https://bugzilla.redhat.com/show_bug.cgi?id=950770

curl seems to look for /etc/pki/tls/certs/ca-bundle.crt

extract the correct path by disecting libcurl.so
2013-04-12 15:27:27 +02:00
Harald Hoyer
5d68c80b16 systemd: include the systemd-random-seed-load.service
The systemd cryptsetup-generator wants systemd-random-seed-load.service
in case /dev/urandom is the device.
2013-04-12 15:27:27 +02:00
Harald Hoyer
5f8cd1a4be Makefile,git2spec.pl: use "git describe" 2013-04-12 15:27:27 +02:00
Harald Hoyer
14201d23e7 AUTHORS: update 2013-04-12 15:27:27 +02:00
Harald Hoyer
a229b17434 plymouth/plymouth-pretrigger.sh: fixup of ca2c6936 2013-04-12 15:25:44 +02:00
Harald Hoyer
ca2c693679 Do not call plymouth with full path 2013-04-11 16:08:26 +02:00
Harald Hoyer
cdcb27a4fe crypt/module-setup.sh: also handle UUID= while filtering crypttab
The crypttab filter for host-only did not handle UUID= entries.
https://bugzilla.redhat.com/show_bug.cgi?id=919752
2013-04-10 10:16:49 +02:00
WANG Chao
0c5ccb35c7 ifup.sh: Add support for bridge over a vlan tagged interface
This patch add support for bridge a vlan tagged interface, like
br0 -> bond0.7 -> bond0 -> eth0

Signed-off-by: WANG Chao <chaowang@redhat.com>
2013-04-09 13:39:32 +02:00
Baoquan He
9d787df196 Let user specify the action after fail
Currently the default action is emergency_shell when failure happened
during system boot. In kdump, this default may not be expected. E.g,
if dump target is not rootfs, it does not matter if mount root failed.
Adding an action which allow dracut always go ahead though failure
happens is needed by kdump.

So here add a function action_on_fail() and cmdline parameter
action_on_fail=<shell | continue>. Use action_to_fail() to replace
emergency_shell which was called after failure. By $(getarg action_on_fail=),
decide to drop into shell, or to leave away the failure and go ahead.

v3->v4:
add handling of selinux policy loaded failure, and change code format to
be consitent

Signed-off-by: Baoquan He <bhe@redhat.com>

[Edited by harald@redhat.com]
2013-04-09 11:14:08 +02:00
Baoquan He
0290e98271 Wait for logical interface to be up
If bootdev is logical interface like bond, bridge or vlan, we need
wait them up.

Signed-off-by: Baoquan He <bhe@redhat.com>
2013-04-09 10:53:08 +02:00
Harald Hoyer
d136ca4eeb network: support multiple bonding interfaces
Currently dracut only support 1 bond, namyly bond0 by default. However multiple
bonds configuration may be needed. For example in kdump, in 1st kernel, more
than one bonds may be configured, and bondX other than bond0 is used as output
interface to remote host which will store dump core. This patch can solve this
problem, to write real bond information to initramfs, 2nd kdump kernel will
use it to create the relevant bondX interface.

Tested-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Baoquan He <bhe@redhat.com>
2013-04-09 10:52:22 +02:00
WANG Chao
a55f910cf6 ifup.sh: Add support for bridge over team and vlan tagged team
Team is the same network stack as bonding. Therefore give ifup the ability to
handle bridge over team and vlan tagged team as bonding too.

Signed-off-by: WANG Chao <chaowang@redhat.com>
2013-04-09 10:52:22 +02:00
Harald Hoyer
96efbc51ac crypt/module-setup.sh: filter /etc/crypttab in host-only mode
only take those /etc/crypttab entries, which we need to boot the system
2013-04-09 10:48:26 +02:00
Harald Hoyer
9d36d4fb1d dracut-functions.sh: make use of findmnt 2013-04-09 10:47:39 +02:00
Harald Hoyer
41bfa5dad1 nfs/module-setup.sh: combine egreps for /etc/passwd and /etc/group 2013-04-05 16:34:36 +02:00
Harald Hoyer
db9fbaf9b8 TEST-99-RPM: ignore rescue images 2013-04-05 11:52:33 +02:00
Harald Hoyer
56fb5c4dbf TESTSUITE: s/i6300esbwdt/i6300esb ib700wdt/g 2013-04-05 11:07:55 +02:00
Harald Hoyer
a8986425a4 TEST-50-MULTINIC: fixup test suite
qemu of the day doesn't like multicast anymore
2013-04-05 11:07:40 +02:00
Harald Hoyer
ea3c4e8273 Add missing options to manpage and --help output
https://bugzilla.redhat.com/show_bug.cgi?id=948510
2013-04-05 09:01:48 +02:00
Harald Hoyer
6db8c5a5fe base/dracut-lib.sh:wait_for_dev()/cancel_wait_for_dev() set systemd timeouts
Set systemd unit timeouts for the devices we wait for. The systemd
default is 90 seconds, which is way too low for complicated setups.
2013-04-05 08:32:17 +02:00
Harald Hoyer
ab9b04f55b crypt/parse-crypt.sh: create udev rule for systemd
Start the systemd-cryptsetup@luks-*.service for the detected crypto_LUKS
device in the initqueue, so we block in the initqueue and wait for the
password entry.
2013-04-04 12:54:59 +02:00
Harald Hoyer
c4b572b5ca base/dracut-lib.sh: add dev_unit_name()
add helper function to convert device path to systemd unit names
2013-04-04 12:52:53 +02:00
Harald Hoyer
cc6f0925df base/init.sh: fix version output 2013-04-02 13:29:24 +02:00
Harald Hoyer
d50cf62d62 dracut.spec: Require systemd >= 199 2013-03-26 17:04:43 +01:00
Harald Hoyer
75369f8ba0 version 027 2013-03-26 16:55:03 +01:00
Harald Hoyer
8e2bcb4b42 dracut.spec: don't BuildRequire bash-completion for rhel 2013-03-26 16:54:34 +01:00
Harald Hoyer
bfac40665b systemd: add new timers.target and paths.target 2013-03-26 16:19:27 +01:00
Harald Hoyer
6c6d805765 use systemd*dir variables everywhere 2013-03-26 16:19:00 +01:00
Harald Hoyer
44f870be42 test: change qemu param -nographic to -display none for -daemonize
qemu does not like -nographic in combination with -daemonize
2013-03-26 16:17:24 +01:00
Harald Hoyer
b37398dc1c x-initrd-rootfs.mount -> x-initrd.mount 2013-03-26 15:38:50 +01:00
Harald Hoyer
1b0a362d83 multipath: install native systemd service 2013-03-25 07:58:45 +01:00
Harald Hoyer
bb425d20a1 systemd: add dracut.bootup(7) reference to service man pages 2013-03-25 07:56:12 +01:00
Harald Hoyer
cbd69dc6ff install dracut-*.service units 2013-03-25 07:56:12 +01:00
Harald Hoyer
cb8def95c4 dracut.sh: export systemdsystemconfdir 2013-03-22 09:09:10 +01:00
Harald Hoyer
78d1d4f86d dracut.sh: turn off hostonly mode, if udev database is not found 2013-03-20 10:25:23 +01:00
Harald Hoyer
5bfa3b363a dracut.sh: turn off host-only mode, if essential system filesystems not mounted 2013-03-20 10:22:41 +01:00
Harald Hoyer
1d4b337543 dracut.spec: use configure 2013-03-20 08:01:29 +01:00
Harald Hoyer
8c67d395d4 dracut.spec: use pkg-config for bashcompletiondir 2013-03-20 07:15:04 +01:00
Harald Hoyer
02566acdd7 dracut.sh: remove temporary cpio output in trap 2013-03-20 07:08:29 +01:00
Harald Hoyer
478aa7dac1 51-dracut-rescue-postinst.sh,51-dracut-rescue.install: use systemd-machine-id-setup
if /etc/machine-id is empty, use systemd-machine-id-setup
2013-03-20 07:08:29 +01:00
Harald Hoyer
967db70090 51-dracut-rescue-postinst.sh: Rename image and grub entry
grub2-mkconfig ordered the rescue entries higher than the normal ones.

https://bugzilla.redhat.com/show_bug.cgi?id=923439
2013-03-20 07:08:29 +01:00
Harald Hoyer
619c1bb334 51-dracut-rescue-postinst.sh: add extra checks 2013-03-19 16:56:56 +01:00
Harald Hoyer
57aa1e9140 TEST-40-NBD/test.sh: kill_server() after test_run() 2013-03-19 14:53:17 +01:00
Harald Hoyer
af2fcbafe8 network/netroot.sh: do not unset root 2013-03-19 14:53:09 +01:00
Harald Hoyer
7b6bdc3f94 nbd/nbdroot.sh: fix root != blockdev case 2013-03-19 12:26:06 +01:00
Harald Hoyer
db43f56d94 fs-lib/fs-lib.sh:write_fs_tab() start initrd-root-fs.target 2013-03-19 12:26:06 +01:00
Harald Hoyer
a1ebd77179 add dracut.bootup.7 man page 2013-03-19 12:26:06 +01:00
Harald Hoyer
e26d76dca1 systemd: add more ordering 2013-03-19 12:22:33 +01:00
Harald Hoyer
d59732004d drm/module-setup.sh: redirect grep to /dev/null
on some architectures, no pci devices exist
2013-03-18 14:17:19 +01:00
Harald Hoyer
a3a8f58d73 Makefile: use -D_FILE_OFFSET_BITS=64 to build dracut-install 2013-03-18 10:58:25 +01:00
Harald Hoyer
c9e5b75308 kernel-modules/module-setup.sh: don't fail hard on a missing module 2013-03-18 09:29:08 +01:00
Harald Hoyer
fd191a7b41 kernel-modules/module-setup.sh: install all host filesystem drivers
https://bugzilla.redhat.com/show_bug.cgi?id=922565
2013-03-18 08:43:23 +01:00
Harald Hoyer
e42c7a980c sosreport: mkdir /run/initramfs, if it does not exist yet 2013-03-16 10:34:20 +01:00
Harald Hoyer
85804a9197 dmsquash-live: force load squashfs kernel module
https://bugzilla.redhat.com/show_bug.cgi?id=922248
2013-03-16 10:31:37 +01:00
Harald Hoyer
ee2321c91e dracut.conf.5.asc: remove duplicated install_items 2013-03-15 16:54:38 +01:00
Harald Hoyer
11fbde4454 TEST-16-DMSQUASH: use current releasever 2013-03-15 14:41:11 +01:00
Harald Hoyer
fb05f9876a dracut-bash-completion.sh: add --kver kernel version completion 2013-03-15 10:42:18 +01:00
Harald Hoyer
7e9bfdde14 sosreport.sh: use -o short-monotonic for the journal output 2013-03-15 10:41:41 +01:00
Harald Hoyer
7e9fc37db8 dracut.spec: bump systemd version requirement 2013-03-15 07:11:17 +01:00
Harald Hoyer
bb278147cf fixed testsuite 2013-03-15 07:10:20 +01:00
Will Woods
81b676a675 fix typo in dracut.conf.5.asc
It's /etc/dracut.conf.d, not /etc/dracut/conf.d
2013-03-15 07:10:20 +01:00
Harald Hoyer
6b46e7baa0 systemd: do not use "systemd --version" until fixed 2013-03-15 07:10:20 +01:00
Harald Hoyer
85c85f07e2 systemd: switch to new initrd.target
(normal startup)
                                    :
                                    :
                                    v
                              basic.target
                                    |
             ______________________/|
            /                       |
            |                  sysroot.mount
            |                       |
            |                       v
            |             initrd-root-fs.target
            |                       |
            |                       v
            |            initrd-parse-etc.service
(custom initrd services)            |
            |                       v
            |            (sysroot-usr.mount and
            |             various mounts marked
            |               with fstab option
            |                x-initrd.mount)
            |                       |
            |                       v
            |                initrd-fs.target
            |                       |
            \______________________ |
                                   \|
                                    v
                               initrd.target
                                    |
                                    v
                          initrd-cleanup.service
                               isolates to
                         initrd-switch-root.target
                                    |
                                    v
             ______________________/|
            /                       |
            |        initrd-udevadm-cleanup-db.service
            |                       |
(custom initrd services)            |
            |                       |
            \______________________ |
                                   \|
                                    v
                        initrd-switch-root.target
                                    |
                                    v
                        initrd-switch-root.service
                                    |
                                    v
                               switch-root
2013-03-15 07:10:20 +01:00
Harald Hoyer
c853dc72e9 udev-rules/module-setup.sh: do not install /run/* 2013-03-14 18:30:35 +01:00
Harald Hoyer
18d0c9b858 nfs/nfsroot.sh: only cat /etc/fstab, if existant 2013-03-14 18:30:35 +01:00
Harald Hoyer
0a5fd0dcec iscsi/iscsiroot.sh: do not mount manually in systemd mode 2013-03-14 18:30:35 +01:00
Harald Hoyer
e0e99c59a5 ifcfg/write-ifcfg.sh: fixed typo 2013-03-14 18:30:35 +01:00
Harald Hoyer
d46394ad33 dracut.spec: fix requirements 2013-03-14 18:30:35 +01:00
Harald Hoyer
87dc81a1f6 dracut-install: handle more ldd errors 2013-03-14 18:30:35 +01:00
Harald Hoyer
ce92ca0527 51-dracut-rescue-postinst.sh: fixed new-kernel-pkg call 2013-03-14 18:30:35 +01:00
Harald Hoyer
c390590fac TODO: remove completed items 2013-03-14 18:30:35 +01:00
Radek Vykydal
fd8e4aef90 Write BOOTPROTO=ibft for ip=ibft to ifcfg files 2013-03-14 10:54:28 +01:00
Radek Vykydal
c5a742a3bf Don't write DHCPV6C=yes for each dhcp (ipv4) configuration.
Caused probably by commit 32ec0a762d
2013-03-14 10:54:28 +01:00
Harald Hoyer
fc4e10a859 shutdown/shutdown.sh: mount --move all basic mounts out of /oldroot
After mount moving /dev away, apps like plymouth can do reexec with fd
passing of devices, which they want to keep open until the very end.
2013-03-13 17:45:37 +01:00
Harald Hoyer
83bb0893ed dracut.sh: Add --noimageifnotneeded parameter
Do not create an image in host-only mode, if no kernel driver is needed
and no $initdir/etc/cmdline/*.conf is generated.
2013-03-13 14:49:20 +01:00
Harald Hoyer
8fdcc1a9b1 kernel-modules: move usb-storage out of fixed drivers 2013-03-13 14:46:39 +01:00
Harald Hoyer
a23b368c92 systemd: remove upstream renamed old service files 2013-03-13 14:45:55 +01:00
dyoung@redhat.com
bbfff3e58b Add memdebug at different points in 99base/init.sh
Previously I added several trace point to the begin of several
init hooks of systemd, old init script also need this debug info.

Doing same here as what's added in the systemd service scripts:
At cmdline hooks adding trace of "1+:mem 1+:iomem 3+:slab"
For other hooks adding trace of "1:shortmem 2+:mem 3+:slab"

Signed-off-by: Dave Young <dyoung@redhat.com>
2013-03-13 13:12:57 +01:00
dyoung@redhat.com
9c322b2f3b Improve documentation of rd.memdebug
Explain more about rd.memdebug verbose level in dracut.cmdline.7.asc.

Signed-off-by: Dave Young <dyoung@redhat.com>
2013-03-13 13:12:57 +01:00
dyoung@redhat.com
dff9a66c44 print memdebug to stderr
memory usage tracing outputs are debug info, so it should be moved to
stderr instead of stdout.

Signed-off-by: Dave Young <dyoung@redhat.com>
2013-03-13 13:12:57 +01:00
Harald Hoyer
449b0e0707 dracut-initramfs-restore.sh: also look for image in boot loader spec dir 2013-03-13 13:09:13 +01:00
Harald Hoyer
4a5a9c6d89 dracut.spec: fix requirements 2013-03-13 13:01:33 +01:00
Harald Hoyer
917f3e4d25 add dracut-bash-completion.sh 2013-03-13 13:01:33 +01:00
Harald Hoyer
7d848c55a6 dracut.sh: add --regenerate-all 2013-03-13 13:01:33 +01:00
Harald Hoyer
7d17d6c976 plymouth: do not install hooks in systemd mode 2013-03-13 13:01:20 +01:00
Harald Hoyer
b8060ef781 systemd: add sysctl.d and sysctl.conf 2013-03-13 11:37:05 +01:00
Harald Hoyer
727543c1e6 systemd: add modules-load.d modules to the initramfs 2013-03-13 11:37:05 +01:00
Harald Hoyer
c85cda9e2f systemd: local-fs.target is now root-fs.target and initrd-fs.target
Also rename dracut.target to initrd.target

see also systemd commit 700e07f
http://cgit.freedesktop.org/systemd/systemd/commit/?id=700e07f
2013-03-13 09:34:47 +01:00
Harald Hoyer
c0c6c74d99 51-dracut-rescue.install: create directory, if it does not exist 2013-03-13 09:32:14 +01:00
Harald Hoyer
d26bd6ca55 lsinitrd.sh: simplify check for boot loader spec dirs 2013-03-13 09:32:14 +01:00
Harald Hoyer
e22eb857be dracut.spec: add nohostonly and norescue subpackages
we need rpm subpackages, to be able to pull them in the installation
transaction for the initial %posttrans initramfs image creation.
2013-03-12 13:52:57 +01:00
Harald Hoyer
2fa6fd3aaa add 51-dracut-rescue-postinst.sh
also fixup 51-dracut-rescue.install to read in dracut conf
2013-03-11 18:58:32 +01:00
Harald Hoyer
dd5875499e dracut.sh: add swap partitions to host-only setup 2013-03-11 18:58:32 +01:00
Harald Hoyer
d351541ee6 make host_fs_types a hashmap
This requires bash >= 4, but hash maps are so much more comfortable
2013-03-11 18:58:32 +01:00
Harald Hoyer
d928724c3c lsinitrd.sh: removed trailing "}" 2013-03-11 15:46:37 +01:00
Harald Hoyer
727e68d0b5 lsinitrd.sh: fix for default initrd not found, but image given 2013-03-11 15:13:02 +01:00
Harald Hoyer
8d28614e4f 51-dracut-rescue.install: do not unset installonly on remove 2013-03-11 15:12:49 +01:00
Harald Hoyer
fba5fbbdad dracut.spec: add rescue module 2013-03-09 15:32:32 +01:00
Harald Hoyer
d008b6b89f dracut.sh: move cleanup trap, just after mktemp 2013-03-09 15:31:09 +01:00
Harald Hoyer
aede120c92 add rescue dracut module 2013-03-09 15:17:26 +01:00
Harald Hoyer
cc2303001e dracut.sh: add new default path to initramfs according to bootloader spec
see kernel-install(8) and
http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec
2013-03-09 15:17:26 +01:00
Harald Hoyer
54e7d7c32d dracut.sh: remove (default) marker in --help 2013-03-09 15:17:26 +01:00
Harald Hoyer
bcd352dfa1 fedora.conf.example: make hostonly default for fedora 2013-03-09 15:17:26 +01:00
Harald Hoyer
d837ac3984 add /lib/kernel/install.d/51-dracut-rescue.install
Upon installation of a kernel, check if a rescue image is already
available and if not, create a non-hostonly generic initramfs image with
the rescue module added.
2013-03-09 15:16:31 +01:00
Harald Hoyer
900e15da34 systemd/module-setup.sh: call systemd in private dir for version 2013-03-08 11:50:03 +01:00
Harald Hoyer
19d69051a3 NEWS: dracut-026 2013-03-08 07:07:48 +01:00
Harald Hoyer
31737a05e1 systemd: add version check in install() 2013-03-08 07:07:01 +01:00
Harald Hoyer
1161f03777 fips: add lzo module 2013-03-08 07:05:55 +01:00
Harald Hoyer
cf24ac8c19 crypt, dmraid, mdraid: use for_each_host_dev_and_slaves_all()
To catch _all_ UUIDs and not only the first one, use
for_each_host_dev_and_slaves_all
2013-03-07 16:00:00 +01:00
Harald Hoyer
af3ef92a6b dmsquash-live: add iso9660 kernel module 2013-03-07 15:49:24 +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
34bd2be23f dracut-functions.sh: fix inst_rule_programs()
Logic for the $env{.*} check was reversed and env was missing.

Thanks Colin Guthrie!
2013-03-07 15:01:47 +01:00
Harald Hoyer
c3dd68fcf1 iscsi: run iscsiroot even if no network configured
Also inject finished hooks for every iscsiroot netroot
2013-03-07 14:17:49 +01:00
Harald Hoyer
3e35441f18 kernel-modules: better match for arm architecure 2013-03-07 14:17:33 +01:00
Harald Hoyer
dde2db3da9 lsinitrd: use /boot/<machine-id>/<kernel-version>/initrd as the default image
if /boot/<machine-id> exists; then
use /boot/<machine-id>/<kernel-version>/initrd as the default image;
else fallback to /boot/initramfs-<kernel-version>.img
2013-03-07 13:03:24 +01:00
Harald Hoyer
cbc21754e5 kernel-modules: move some kernel modules out of unconditional install 2013-03-07 12:10:53 +01:00
Harald Hoyer
eb2dc8c34b systemd: add missing dracut-mount.service dracut-pre-mount.service 2013-03-07 11:47:00 +01:00
Harald Hoyer
c4e098a514 document /usr/lib/dracut/dracut.conf.d 2013-03-07 11:44:44 +01:00
Harald Hoyer
72875215a3 dracut.conf: move default settings to distro example 2013-03-07 11:44:16 +01:00
Harald Hoyer
335bc217b3 dracut.sh: rename source_dirs_prio() to dropindirs_sort() 2013-03-07 11:43:52 +01:00
Harald Hoyer
510aecdbd8 systemd: add missing dracut-mount.sh dracut-pre-mount.sh dracut.target 2013-03-07 10:35:06 +01:00
Harald Hoyer
9dd9d81fc6 add 50-dracut.install 2013-03-07 10:08:35 +01:00
Harald Hoyer
a5b48ce798 add systemd-bootchart module 2013-03-07 09:56:30 +01:00
Harald Hoyer
59afbd8e73 add missing systemd service man pages 2013-03-07 09:42:00 +01:00
Harald Hoyer
348baca3e4 dracut.conf.d/fedora.conf.example: turn off rd.auto
realinitpath is not needed anymore for systemd >= 198
2013-03-06 17:29:12 +01:00
Harald Hoyer
83691c413f testsuite fixup 2013-03-06 17:29:12 +01:00
Harald Hoyer
ca36b9b8f8 base: save host_devs which we need bring up and process them with wait_for_dev 2013-03-06 17:29:12 +01:00
Harald Hoyer
a9c7dc74c4 base: in systemd mode parse-root-opts.sh is in the services 2013-03-06 17:29:12 +01:00
Harald Hoyer
ce862de624 base/dracut-lib.sh: reset /etc/profile 2013-03-06 17:29:12 +01:00
Harald Hoyer
500861cd05 base/init.sh: reset main loop counter, if work is in initqueue 2013-03-06 17:29:12 +01:00
Harald Hoyer
44d26d9209 base/dracut-lib.sh: extend wait_for_dev() for systemd 2013-03-06 17:29:12 +01:00
Harald Hoyer
35270e34d0 rootfs-block/parse-block.sh: wait_for_dev 2013-03-06 17:29:12 +01:00
Harald Hoyer
fe654ff0aa usrmount: in systemd mode, functionality is in systemd 2013-03-06 17:29:12 +01:00
Harald Hoyer
5e1e1ec060 iscsi, nbd: call write_fs_tab() and write /etc/fstab 2013-03-06 17:29:12 +01:00
Harald Hoyer
2673ff1932 rootfs-block: in systemd mode, functionality is in the dracut services 2013-03-06 17:29:11 +01:00
Harald Hoyer
e8f7ea6794 resume: generate rules already in parse-resume.sh 2013-03-06 17:29:11 +01:00
Harald Hoyer
3899211bfc resume: in systemd mode move functionality in the dracut services 2013-03-06 17:29:11 +01:00
Harald Hoyer
6e0c1c448d nfs/nfsroot.sh: trigger nfs mount with cat'ing /etc/fstab
otherwise the whole nfs communication can take too long for the
systemd-fstab-generator
2013-03-06 17:29:11 +01:00
Harald Hoyer
6ae68b4674 kernel-modules: handle rd.driver.* in systemd mode in dracut-pre-udev 2013-03-06 17:29:11 +01:00
Harald Hoyer
41eba87b32 dracut_need_initqueue 2013-03-06 17:29:11 +01:00
Harald Hoyer
a1084c02fd fs-lib/fs-lib.sh: add write_fs_tab() 2013-03-06 17:29:11 +01:00
Harald Hoyer
5ac8420abc crypt/parse-crypt.sh: don't generate luks rules in systemd mode 2013-03-06 17:29:11 +01:00
Harald Hoyer
24d009507f btrfs: no need for btrfs_timeout in systemd mode 2013-03-06 17:29:11 +01:00
Harald Hoyer
e9020221a7 crypt: do not cleanup in systemd mode 2013-03-06 17:29:11 +01:00
Harald Hoyer
b59e9e5724 network/netroot.sh: remove the dhcp finished hook, if we have a handler 2013-03-06 17:22:09 +01:00
Harald Hoyer
b5859d6359 i18n: no manual setup needed if systemd is in the game 2013-03-06 17:22:09 +01:00
Harald Hoyer
dbfaae0e34 systemd: changes for new initrd services
Requires systemd >= 198
2013-03-06 17:21:47 +01:00
Harald Hoyer
8d85429a44 dracut-functions.sh: add dracut_need_initqueue() dracut_module_included()
for all rules files, which reference initqueue also call
dracut_need_initqueue()
2013-03-06 16:04:03 +01:00
Harald Hoyer
3e4ab73cd4 test: make testsuite work with systemd 2013-03-02 13:27:08 +01:00
Harald Hoyer
4e32b2e916 test: removed unused cryptroot-ask.sh scripts 2013-03-02 13:22:29 +01:00
Harald Hoyer
356333b331 test: add finished-false.sh for create-root.sh initqueue job 2013-03-02 13:20:59 +01:00
Harald Hoyer
f62f3a2191 reset initqueue loop counter only if new uevents exist 2013-03-02 13:19:20 +01:00
Harald Hoyer
389333396a resume: move resume hook from mount to pre-mount 2013-03-02 13:11:38 +01:00
Harald Hoyer
cfb7410cd0 mdraid/mdraid_start.sh: remove mdmon workaround 2013-03-02 13:10:57 +01:00
Harald Hoyer
f672b1c399 btrfs/btrfs_timeout.sh: do not "exit 0" 2013-03-02 13:10:04 +01:00
Harald Hoyer
f12f694355 btrfs: Use upstream 64-btrfs.rules 2013-02-22 11:14:04 +01:00
Lars R. Damerow
9a9c6e1256 dracut: write initramfs to temp file then move into place
We've been finding cases where multiple instances of dracut can be launched
simultaneously, resulting in a corrupted initramfs file. This patch makes
dracut write the initramfs to a new file, then move it into place atomically.
2013-02-22 11:05:29 +01:00
Harald Hoyer
9c65c125a9 systemd: change path of switch-root.conf
we do not have to clean it up for /etc/switch-root.conf
2013-02-21 12:18:21 +01:00
Harald Hoyer
7d4d3f8da6 lvm/module-setup.sh: use for_each_host_dev_and_slaves_all
Use for_each_host_dev_and_slaves_all to get all lvm setups for the
host-only case.

Thanks to Olivier Thauvin
2013-02-21 12:13:56 +01:00
Harald Hoyer
569ffe77bf systemd: add systemd-modules-load.service and hook dirs 2013-02-21 12:13:09 +01:00
Harald Hoyer
a42b2b8133 introduce /usr/lib/dracut/dracut.conf.d/ drop-in directory
/usr/lib/dracut/dracut.conf.d/*.conf can be overwritten by the same
filenames in /etc/dracut.conf.d.

Packages should use /usr/lib/dracut/dracut.conf.d rather than
/etc/dracut.conf.d. /etc/dracut.conf.d belongs to the system
administrator.
2013-02-19 17:46:24 +01:00
Harald Hoyer
31ba4de21d url-lib/url-lib.sh: remove bashism
remove the forgotten bashism "+="
2013-02-19 16:13:49 +01:00
Stefan Reimer
a005c47763 base/init.sh: create /run/log
If the systemd module is not used /run/log is not created which results
in dangeling softlink from /var/log which causes stuff to fail.
2013-02-18 12:05:23 +01:00
Harald Hoyer
5db6ca5a4b dracut: enable initramfs building without kernel modules 2013-02-18 12:03:02 +01:00
Harald Hoyer
1a6fdf2417 btrfs: use "btrfs device ready" 2013-02-18 11:58:11 +01:00
Harald Hoyer
27a2c3a406 systemd: services got renamed 2013-02-14 12:32:12 +01:00
Harald Hoyer
b347edfa23 dracut-emergency.service: wants systemd-vconsole-setup.service 2013-02-14 12:32:04 +01:00
Colin Guthrie
3ed09d970e resume: Ensure we remove the timout job when we find the resume device 2013-02-13 17:46:24 +01:00
Thomas Backlund
a28e2aeefe kernel-modules: Add ehci support for kernel 3.8+
Kernel 3.8 split ehci-hcd into ehci-hcd, ehci-pci and ehci-platform,
so adapt the list to cope with this change.
2013-02-13 17:42:32 +01:00
Wim Muskee
c6a71c7b8a make nbd port check more robust
The following change makes the check for the nbd port or named export
more robust.
I wasn't sure whether to include sed in the dracut_install() of
module-setup.sh since net already does that (and nbd depends on that).
2013-02-11 15:44:11 +01:00
Harald Hoyer
6ecb9a2d68 url-lib/url-lib.sh: add proxy support for curl 2013-02-11 13:56:04 +01:00
Harald Hoyer
918a6874df url-lib/url-lib.sh: remove bashisms 2013-02-11 13:55:44 +01:00
Harald Hoyer
2663232a01 systemd/dracut-initqueue.sh: call udevadm settle directly 2013-02-11 11:49:19 +01:00
Harald Hoyer
cebab07e68 systemd/dracut-initqueue: run after cryptsetup.target 2013-02-11 11:49:19 +01:00
Harald Hoyer
a04f3077cd systemd/dracut-pre-pivot.sh: remove /dev/root symlink after shell 2013-02-11 11:49:19 +01:00
Harald Hoyer
04b873598b systemd: set udev debug/info via config file and report obsolete options 2013-02-11 11:49:19 +01:00
Harald Hoyer
22137f9cac systemd/dracut-pre-trigger.sh: enable rd.break=pre-trigger debug shell 2013-02-11 11:49:19 +01:00
Harald Hoyer
54665349ec systemd/dracut-cmdline.sh: create /run/log subdir 2013-02-11 11:49:19 +01:00
Harald Hoyer
f251a89772 systemd/dracut-pre-trigger.service: load service on demand 2013-02-11 11:49:19 +01:00
Harald Hoyer
fbdfa57746 systemd/dracut-pre-udev.service: load service on demand 2013-02-11 11:49:19 +01:00
Harald Hoyer
6b095274fb systemd: trigger systemd-vconsole-setup.service only on demand 2013-02-11 11:49:19 +01:00
Harald Hoyer
11174408e8 systemd/dracut-initqueue.sh: replace $UDEV_QUEUE_EMPTY
for systemd-udevd the version of udevd is high enough
2013-02-11 11:49:19 +01:00
Harald Hoyer
c2117747fd virtfs: add virtio_pci kernel module 2013-02-11 11:49:19 +01:00
Harald Hoyer
4f6e293308 udev-rules: modify udev rules on initramfs creation time 2013-02-11 11:49:19 +01:00
Harald Hoyer
d9076cac19 btrfs/btrfs_finished.sh: use btrfs device ready for probing 2013-02-08 16:52:38 +01:00
Harald Hoyer
ff52ca1b57 btrfs/80-btrfs.rules: remove modprobe of btrfs module
this should be automatically modprobed by the kernel on demand
2013-02-08 16:52:38 +01:00
Harald Hoyer
8a3c4957fc drm/module-setup.sh: make drm module only install on dependency 2013-02-08 16:52:38 +01:00
Harald Hoyer
3f54a83ca8 dracut.sh: make /var/log a symlink to /run/log 2013-02-08 16:52:38 +01:00
Harald Hoyer
7fa3b9e376 url-lib/url-lib.sh: turn off curl globbing
https://bugzilla.redhat.com/show_bug.cgi?id=907497
2013-02-08 16:52:38 +01:00
Harald Hoyer
39135af155 network/ifup.sh: echo in get_vid() instead of using the return value
The return value is module 256, so VLAN ids > 255 could not be returned.
2013-02-08 16:52:38 +01:00
Dan Horák
02640e8e65 set peer for point-to-point connections
network/net-lib.sh: only set net vars, if they have a value
2013-02-08 16:52:30 +01:00
Frederick Grose
579f385384 Provide devices to enable booting with rd.live.overlay.readonly=1 2013-02-06 13:52:30 +01:00
Kevin Yung
56d60c4b2d network/ifup.sh: enable bridged vlan interfaces
To use vlan for net boot, you need to specify vlan and ip kernel options
for the boot interface. For example,

 vlan=eth1.1:eth1 bootdev=eth1.1
 ip=1.2.3.4:1.2.3.4::255.255.255.0:my-hostname:eth1:none

To use bridge for net boot, you need to specify bridge and ip kernel
option for the boot interface. For example

 bridge=br1:eth1 bootdev=br1
 ip=1.2.3.4:1.2.3.4::255.255.255.0:my-hostname:eth1:none

In my environment, I needs to boot machines from network within
a vlan or on a bridged network.	I found curent dracut release
if-up.sh script in 40network module bypass ip setting for both
bridge and vlan interface.
2013-02-06 13:52:30 +01:00
Dan Horák
62fd2b3644 fix CTC example in rd.znet
The CTC interface uses 2 channels.
2013-02-06 13:52:30 +01:00
Colin Guthrie
cd9072d342 Mount /proc before including dracut-lib.sh.
When dracut-lib.sh is sourced it checks the command line (when not using systemd)
as part of the check_quiet() call.

Therefore mount /proc earlier in init.

Avoids the error:

init: 77: /lib/dracut-lib.sh: /proc/cmdline: No such file or directory
2013-02-06 13:52:30 +01:00
Harald Hoyer
19bab59c48 dracut.sh: reverting return value change
reverting _get_fs_type() return values of patch
c8d685c9d3
2013-02-05 16:45:42 +01:00
Harald Hoyer
d8b627b9dc shutdown: call "losetup -D" on shutdown 2013-02-05 11:04:02 +01:00
Harald Hoyer
6320d072a1 mdmon: renamed mdmon-offroot@.service to mdmon@.service 2013-02-05 10:58:06 +01:00
Harald Hoyer
7abeb49878 TODO: updated 2013-02-05 10:58:05 +01:00
Harald Hoyer
14fcfbec3e network/net-genrules.sh: remove some bashisms 2013-01-30 17:22:25 +01:00
Joe Lawrence
fa9f15e3be Support out-of-tree and updated drivers in initramfs creation
The find_kernel_modules_by_path function shouldn't filter out modules not
located underneath the /lib/modules/ver/kernel directory as out-of-tree
drivers may reside in /lib/modules/ver/extra and updated drivers in
/lib/modules/ver/updates.

Signed-off-by: Joe Lawrence <joe.lawrence@stratus.com>
2013-01-25 13:07:59 +01:00
Harald Hoyer
ae4758ce0d rootfs-block/mount-root.sh: fixup for 8b6bf0ef5
not only fix the warning message, but the real mount arguments, too
2013-01-23 16:24:33 +01:00
Harald Hoyer
66f01450a8 NEWS: update for version 025 2013-01-23 16:12:18 +01:00
Harald Hoyer
e5786ed1b7 version 025 2013-01-23 15:38:48 +01:00
Harald Hoyer
b47517140b dracut.spec: add drm module 2013-01-23 15:38:48 +01:00
Colin Guthrie
3de6001e1e Include crc32c module for xfs.
Just like btrfs, xfs now requires CRC module that cannot be resolved via
normal module resolving.

Move this hack into fs-lib and remove it from btrfs module.

https://bugs.mageia.org/show_bug.cgi?id=8676
2013-01-23 15:24:27 +01:00
Harald Hoyer
c8d685c9d3 dracut-functions.sh: cope with optional field #7 in mountinfo
also handle fstab entries with LABEL=, UUID= and PARTUUID=
2013-01-23 15:24:27 +01:00
Harald Hoyer
d6d3173916 network/dhclient-script.sh: also touch "/tmp/setup_net_<mac>.ok" 2013-01-23 15:24:27 +01:00
Harald Hoyer
8b6bf0ef57 romount fix 2013-01-23 15:24:27 +01:00
Dave Young
7bd8f23303 Add memory usage trace to diffrent hook points
Hi, Here is an update of this patch, fixed the local variable issue.
2013-01-23 15:24:27 +01:00
dyoung@redhat.com
a08ea34aba add function getargnum
For cmdline argument with numeric value, add a new function getargnum
It will get proper value with default value as $1, min value as $2,
max value as $3, and param name as $4. valid result will be echo to stdout.
for nul or value not valid it will just echo the default value.
Note: The values should be >=0

[v1->v2]: add arg <minval>
[v2->v3]: do not use bash string match =~

Signed-off-by: Dave Young <dyoung@redhat.com>
2013-01-23 15:24:27 +01:00
Dave Young
6cb77ea91f use linkup in dhclient-script.sh
linkup is a wrapper function for waiting interface ready and up.
change to use linkup as what we do in ifup script.

Signed-off-by: Dave Young <dyoung@redhat.com>
2013-01-23 15:24:27 +01:00
Colin Guthrie
c586b033a7 Extend 52f1b041 to allow devices to be specified in config files as well as cmdline.
This also changes the command line switch to be --add-device and the
config directive is set to add_device. This was chosen as device= in the
config file seems too generic and not quite as consistent with other
directives (i.e. drivers/add_drivers)

The --device command line is still supported but it should be considered
deprecated in favour of --add-device.
2013-01-23 15:24:27 +01:00
Jiri Pirko
a9f634f815 fix teamd exec in case config does not include devname
In case that configuration file did not include name of team device,
teamd would not start. Fix this by adding "-t" parameter.

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
2013-01-23 15:24:27 +01:00
Harald Hoyer
551c2dd71f shutdown: kill all processes and report remaining ones 2013-01-22 15:31:45 +01:00
Harald Hoyer
ffc4f173b6 mdraid: add mdmon-offroot@.service and takeover mdmon in shutdown 2013-01-22 15:31:41 +01:00
Harald Hoyer
ebd1d65a1b shutdown: source pre-shutdown hook and force quit plymouth before umount 2013-01-22 15:31:22 +01:00
Harald Hoyer
5b68300899 dracut-lib.sh: force hide plymouth in shutdown emergency shell 2013-01-22 15:31:19 +01:00
Harald Hoyer
2b6dd6a1fc dracut-functions.sh: add pre-shutdown hook 2013-01-22 15:31:16 +01:00
Harald Hoyer
1d22c670b0 dracut.asc: document shutdown procedure 2013-01-18 10:13:14 +01:00
Harald Hoyer
0ae480dcbf dracut.asc: s/rd.ip/ip/g 2013-01-07 18:00:06 +01:00
Harald Hoyer
256cba18c3 dracut-functions.sh: fixed inst_rules search path 2013-01-03 09:29:05 +01:00
Harald Hoyer
e6fcec9173 usrmount/mount-usr.sh: filter "subvol=" from root rflags
https://bugzilla.redhat.com/show_bug.cgi?id=890577
2013-01-02 14:06:44 +01:00
Harald Hoyer
1db3d2615d kernel-modules: create /etc/modprobe.d if it does not yet exist
https://bugzilla.redhat.com/show_bug.cgi?id=873220
2013-01-02 13:57:40 +01:00
Harald Hoyer
5204d1d36d dmsquash-live: fixed checkisomd5 service call 2013-01-02 13:56:27 +01:00
dyoung@redhat.com
3fa59d171d Wait for interface up at the early stage
In case long delay of network driver initqueue will exit before net dev is
ready. We have no chance to setup it then.
For dhcp, when we finish the setup there will be a setup_net_<dev>.ok. Doing
same for static ip case. Also add a check to initqueue when we generate udev
rules to ensure it's early enough.

[v1->v2]: only wait for bootdev or it's possible to cause boot fail for
waiting for non-bootdev. For example bond0->eth0, set bond0 as bootdev and
dhcp, we only need to wait bond0 setup ok.

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-12-14 09:09:00 +01:00
dyoung@redhat.com
d7264a3cc0 Get ifaces for udev rule use
In case BOOTIF is not set and IFACES are not set in bonding/vlan/bridge code,
net-genrule.sh will fall to bring up all net interfaces.

Here add a failsafe option to read IFACES from /tmp/net.ifaces

[v1->v2]: move IFACES reading from net.ifaces after bonding/vlan/bridge info
code chunks.
[v2->v3]: [ -n "$IFACES" ] should be  [ -z "$IFACES" ]

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-12-14 09:08:59 +01:00
dyoung@redhat.com
9078167927 Wait for link ready before use the interface
Some network driver will take long time to initialize. We have an example
in a HP machine which take about one minute for this. The callback such as
"ip link set <dev> up" will fail, afterwards setup for network will also
fail.

Fix this by add a new function wait_for_if_link, wait the link ready before
use it.

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-12-14 09:08:59 +01:00
dyoung@redhat.com
3bd7fba7af Change to use linkup function in network scripts
Update ifup.sh and fcoe-up.sh, use linkup function instead of directly
call ip command.

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-12-14 09:08:59 +01:00
dyoung@redhat.com
b455451f49 Add function linkup
set link up usually include two steps, ip link set <dev> up and
wait_for_if_up <dev>. Now do these two steps in one function linkup.
Later patch will add other code into it.

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-12-14 09:08:59 +01:00
dyoung@redhat.com
efa5eb424d Move wait for if functions to net lib
net-lib.sh are created for net related functions, move the wait_for_if* to
net-lib.sh naturally.

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-12-14 09:08:59 +01:00
Cong Wang
3baa150bd4 dracut: add team device support
V2: merge patch 2/2
    fix active-backup mode by adding slaves one by one
    sync with the latest teamd
    improve the comments
    wait for team ports to come up
    install /etc/libnl/classid too

This patch adds the initial support for team device [1].
A new cmdline team= is introduced for it.

Note, currently we don't support stacked devices
on/under team, it is tricky and can be added on request.

1. http://www.libteam.org/

Cc: Harald Hoyer <harald@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: Cong Wang <amwang@redhat.com>
2012-12-14 09:06:51 +01:00
Harald Hoyer
43cc4d84bc change for "udevadm control": s/--reload-rules/--reload/g 2012-12-14 09:04:56 +01:00
Harald Hoyer
6b84015e67 iscsi/iscsiroot.sh: reload rules after adding 99-iscsi-root.rules 2012-12-14 09:04:56 +01:00
Harald Hoyer
60bbb8fcc9 cms/cms-write-ifcfg.sh: also fill in /etc/hostname 2012-12-14 09:04:56 +01:00
Harald Hoyer
16c84f2873 udev-rules/udev-rules-prepare.sh: get UDEVVERSION, if unset 2012-12-14 09:04:56 +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
2b5cd3dbf8 nfs/nfsroot-cleanup.sh: mount --bind instead of --move 2012-12-14 09:04:55 +01:00
Harald Hoyer
3d8a164d0e dracut.spec: add iputils and iproute requirement for dracut-network 2012-12-14 09:04:55 +01:00
Nicolas Chauvet
00ae54f00a Fix rd.blacklist.driver when no /etc/modprobe.d exists
This bug was reported as http://bugzilla.redhat.com/873220#c2

As the /etc/modprobe.d isn't created in the boot process
nor bundled within the initramfs, the initramfsblacklist.conf
cannot be created.

Instead, the /usr/lib/modprobe.d directory is available and using it
will restore the blacklist behavior.
2012-12-14 09:04:55 +01:00
Will Woods
488d55c546 add 'swapoff' to initramfs to fix shutdown/reboot
systemd shutdown/reboot won't work unless 'swapoff' is available.
2012-12-14 09:04:55 +01:00
Will Woods
9d6165f235 drop NEWROOT from module-setup.sh
This was almost certainly copy-pasted from mount-root.sh, but it's not
valid here - dracut doesn't use NEWROOT outside of the initramfs.
2012-12-14 09:04:55 +01:00
Dave Young
2258f00e91 split plymouth module
Kdump module will need the drm and kms kernel modules so user can see the
emergency shell at least.

Fix this by split 50plymouth module to 50drm and 50plymouth. Moving the
installkernel part to 50drm so user can use drm directly without adding
extra plymouth utils.

Signed-off-by: Dave Young <dyoung@redhat.com>
Tested-by: Chao Wang <chaowang@redhat.com>
2012-12-14 09:04:55 +01:00
Harald Hoyer
2bac2d6d76 systemd/dracut-cmdline.service: run before systemd-vconsole-setup
cmdline does generate vconsole.conf, which is needed by vconsole-setup
2012-12-14 09:04:55 +01:00
Harald Hoyer
b6b895bab5 systemd/service-to-run.sh: silence "cp" errors 2012-12-14 09:04:55 +01:00
Harald Hoyer
fdeae2a3ac crypt/crypt-run-generator.sh: do not timeout for LUKS passwords with systemd 2012-12-14 09:04:55 +01:00
Harald Hoyer
040f388331 dmsquash-live: add systemd checkisomd5 service 2012-12-14 09:04:55 +01:00
Harald Hoyer
7990578443 network: fixed MAC address assignment 2012-11-26 13:49:38 +01:00
Harald Hoyer
528ae4f46c systemd/module-setup.sh: turn off RateLimit for the journal 2012-11-26 13:49:19 +01:00
Harald Hoyer
0fb7b847c5 cms/cmssetup.sh: sync udev rules names with network/net-genrules.sh
https://bugzilla.redhat.com/show_bug.cgi?id=825199
2012-11-22 12:32:19 +01:00
Harald Hoyer
a67a6f957d nfs/nfs-start-rpc.sh: prevent mount error, if sunrpc kernel module is not in the initramfs
https://bugzilla.redhat.com/show_bug.cgi?id=870632
2012-11-22 12:29:43 +01:00
Harald Hoyer
965edeb63b i18n/parse-i18n.sh: fix locale.conf caused by 4dbc1d1bb3
https://bugzilla.redhat.com/show_bug.cgi?id=870632
2012-11-22 11:59:10 +01:00
Harald Hoyer
329bbd797f crypt/crypt-run-generator.sh: fixup last commit 065fc56ab2 2012-11-21 16:36:37 +01:00
Robert Buchholz
065fc56ab2 Make short uuid specification for allow-discards work
1) strstr " $discarduuids " did not remove the optional
'luks-' prefix from the argument as the documentation says.

2) The lookup seems backwards. $luksdev ($luks in the other code copy)
is the full uuid and thus one should check whether the user-supplied
argument (short form) is contained therein, not the other way around.

Before this commit, the only way to trigger allow-discards was to
specify the full uuid without the 'luks-' prefix.
2012-11-21 16:01:45 +01:00
Harald Hoyer
64d144aece Add sosreport script and generate /run/initramfs/sosreport.txt 2012-11-21 14:17:43 +01:00
Harald Hoyer
2d9b156e9e dracut.sh: do not strip signed kernel modules
https://bugzilla.redhat.com/show_bug.cgi?id=873796
2012-11-21 14:07:32 +01:00
Harald Hoyer
2b9be6f707 [nfs|cifs]root.sh: make "/dev/root" a symlink, so it gets cleaned up later on 2012-11-19 17:03:55 +01:00
Harald Hoyer
b26897fb60 dracut.sh: only 'warn' not 'error', if we don't strip 2012-10-19 11:20:30 +02:00
WANG Chao
8bf25df640 40network/ifup.sh: do_static() and do_ipv6auto return 0 if no errors.
Commit a0be1ed removes some lines from do_static() and do_ipv6auto().

When $hostname is empty, do_static() and do_ipv6auto() will return 1
and fails to run setup_net at the last of ifup.sh

Signed-off-by: WANG Chao <chaowang@redhat.com>
2012-10-19 11:10:52 +02:00
Harald Hoyer
e743cfdd4b dracut.conf.d/fedora.conf.example: s/kernelcmdline/kernel_cmdline 2012-10-19 11:10:03 +02:00
Harald Hoyer
636e5cd2d5 dracut.sh: only save $kernel_cmdline, if set 2012-10-19 11:09:38 +02:00
Harald Hoyer
f046336c44 version 024 2012-10-16 16:31:06 +02:00
Harald Hoyer
665b7e58ba TEST-04-FULL-SYSTEMD: fixed poweroff 2012-10-16 16:20:33 +02:00
Harald Hoyer
1391a06d80 AUTHORS: update 2012-10-16 16:19:51 +02:00
Harald Hoyer
404815eaf0 prelink and preunlink (for FIPS) in the initramfs
also hardlink before strip
2012-10-16 14:57:09 +02:00
Harald Hoyer
6c128565b1 strip initramfs binaries by default (not all for FIPS) 2012-10-16 14:55:45 +02:00
Harald Hoyer
e1cb85802b Makefile: cleanup xml files 2012-10-16 14:51:42 +02:00
Radek Vykydal
cbd60fcaaf Do not overwrite ifcfg files generated by Anaconda kickstart (#865192) 2012-10-16 14:43:13 +02:00
Harald Hoyer
28a88b6886 fcoe/fcoe-up: sleep for 3s to allow dcb negotiation
https://bugzilla.redhat.com/show_bug.cgi?id=813057
2012-10-16 13:25:10 +02:00
Harald Hoyer
7081e99735 network/parse-ip-opts.sh: relax bootdev handling 2012-10-16 13:21:14 +02:00
Harald Hoyer
dc67eda6bf combine some instmods 2012-10-16 13:16:53 +02:00
Harald Hoyer
b85f723535 udev-rules: do not install all /etc/group 2012-10-16 13:16:18 +02:00
Harald Hoyer
9ff9dde8d7 virtfs: only install by default, if virt environment detected 2012-10-16 13:15:40 +02:00
Harald Hoyer
8714280104 only install /etc/modprobe.d for hostonly 2012-10-16 13:15:21 +02:00
Harald Hoyer
6d70aa7836 lsinitrd.sh: sort by filename 2012-10-16 10:25:10 +02:00
Harald Hoyer
14986b9d58 dracut.cmdline.7.asc: document rd.ctty 2012-10-16 09:40:32 +02:00
Canek Peláez Valdés
e5c9bc1198 Don't install FONT if it's the same as DEFAULT_FONT.
If the user defines FONT in /etc/vconsole.conf as the same font
defined in DEFAULT_FONT, when creating her initd she will get a
message similar to this one:

gzip: /var/tmp/initramfs.wzl9Qt/usr/share/consolefonts/LatArCyrHeb-16.psfu
already exists; do you wish to overwrite (y or n)?

Signed-off-by: Canek Peláez <canek@ciencias.unam.mx>
2012-10-16 09:38:17 +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
c62b94614d dracut-functions.sh: don't ask question on gzip uncompress 2012-10-16 09:37:49 +02:00
Harald Hoyer
833685ded5 dracut.cmdline.7.asc: add warning about passwords on the kernel cmdline 2012-10-10 15:56:21 +02:00
Harald Hoyer
3cff5fb56f dracut*.asc: add documentation about /etc/cmdline.d/*.conf 2012-10-10 15:25:48 +02:00
Harald Hoyer
3e6dad37c4 Makefile: use fedora css for documentation 2012-10-10 14:32:18 +02:00
Harald Hoyer
600c876968 consistently lowercase "dracut" 2012-10-10 14:15:11 +02:00
Harald Hoyer
cc68f78d92 TEST-04-FULL-SYSTEMD/test.sh: fixed $kernel var 2012-10-10 14:14:31 +02:00
Harald Hoyer
48ca487621 install virtio* modules in the generic case
https://bugzilla.redhat.com/show_bug.cgi?id=864012
2012-10-09 17:44:29 +02:00
Brian C. Lane
13cb578a37 Add rd.noverifyssl argument (#852229)
This adds --insecure to the curl args so that self-signed certificates
will be accepted.
2012-10-09 17:37:29 +02:00
Harald Hoyer
df2afa9ff4 test: disable systemd for encryption 2012-10-09 16:46:46 +02:00
Harald Hoyer
76d5c79e9c dracut-functions.sh: inst_rules_program() skip udev vars ${} 2012-10-08 15:39:23 +02:00
Harald Hoyer
fdf2b152e5 i18n/parse-i18n.sh: correctly populate /etc/vconsole.conf 2012-10-08 15:38:41 +02:00
Harald Hoyer
178c189b0b shutdown/shutdown.sh: failsafe shutdown for kexec
copy kexec from the real root, if it is not found in the unpacked
initramfs for shutdown.

Also drop to an emergency shell, if we can't do the ACTION
2012-10-08 15:37:04 +02:00
Harald Hoyer
14be3b16cd TEST-20-NFS/test.sh: reformat 2012-10-08 15:36:41 +02:00
Harald Hoyer
2e111dd57a TEST-50-MULTINIC/test.sh: fix multinic issues 2012-10-08 15:35:57 +02:00
Dave Young
06e9f8870a return proper value in function dracut_install
dracut_install should return the real return value, so module install function
can detect the install failure.

Such as below in 99base:
dracut_install switch_root || dfatal "Failed to install switch_root"

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-10-08 06:17:28 -04:00
Amadeusz Żołnowski
7e0d508002 dracut-functions.sh: find_binary: path starting with variable
Credits go to Alexander Tsoy <bugs+gentoo@puleglot.ru> who provided the
patch with following explanation:

  I get messages "Skipping program $env{DM_SBIN_PATH}/..." when
  generating initramfs. This happens because some udev rules contains
  variables in path to command:

  $ egrep -r 'IMPORT\{program\}=\"\$' /lib64/udev/rules.d/
  /lib64/udev/rules.d/10-dm.rules:ENV{DM_COOKIE}=="?*", IMPORT{program}="$env{DM_SBIN_PATH}/dmsetup udevflags $env{DM_COOKIE}"

  [...]

  $ sudo dracut -f "" 3.5.4-hardened-r1
  I: *** Including module: dm ***
  I: Skipping program $env{DM_SBIN_PATH}/dmsetup using in udev rule 10-dm.rules as it cannot be found
2012-10-08 03:46:19 -04:00
Amadeusz Żołnowski
585b3b37c0 90crypt: call systemd commands only if systemd binaries are there 2012-10-08 03:28:43 -04:00
Harald Hoyer
167a320e5f s/libnss*.so/libnss_*.so so that we don't install libnss3.so 2012-10-04 14:38:25 -04:00
Harald Hoyer
2242cd92ee systemd: rename emergency.service to dracut-emergency.service for rd.shell 2012-10-04 13:24:07 -04:00
Harald Hoyer
d20fb951fa add "--kernel-cmdline" and kernel_cmdline options for default parameters 2012-10-04 13:23:19 -04:00
Harald Hoyer
e0a393361d dracut-functions: add inst_rule_group_owner()
add inst_rule_group_owner() to install GROUP and OWNER of udev rules
2012-10-04 13:04:36 -04:00
Harald Hoyer
da9c518116 dracut-functions.sh:inst_rules_program() also recognize RUN+= 2012-10-04 12:15:36 -04:00
Harald Hoyer
4d51eff05f dracut-functions.sh: move the i2o_scsi to the omit_drivers variable 2012-10-03 16:40:36 -04:00
Harald Hoyer
a6c718ce8e systemd: improve the emergency shell 2012-10-03 16:39:27 -04:00
Harald Hoyer
43a050e542 install/dracut-install.c: do not ldd directories 2012-10-03 16:39:27 -04:00
Harald Hoyer
25787f8071 systemd/module-setup.sh: move some services to sysinit 2012-10-03 16:35:13 -04:00
Harald Hoyer
ecfa02bdc8 dracut-functions.sh: do not check all modules for filesystems 2012-10-03 16:33:50 -04:00
Harald Hoyer
080d1b718d dracut-functions.sh: make hostonly case more failsafe for new modules
If new modules are introduced, or modules get renamed, or modules change
from builtin to real modules, we want to include them in the host-only
image, just to be safe.
2012-10-03 16:32:07 -04:00
Harald Hoyer
8ea8d6de80 base/dracut-lib.sh: better error message for deprecated cmdline options 2012-09-28 15:29:53 +02:00
Harald Hoyer
4dbc1d1bb3 i18n/parse-i18n.sh: corrected the right option to use for the cmdline 2012-09-28 15:29:53 +02:00
Harald Hoyer
3b9669cff4 Makefile: fix css style for dracut.html 2012-09-28 15:29:53 +02:00
Harald Hoyer
a6332e6980 dracut.cmdline.7.asc: extend rd.auto doc 2012-09-28 15:29:53 +02:00
Harald Hoyer
9037b63eb2 dracut-functions.sh:get_persistent_dev() exception for multipath devices
An exception is multipath devices, child and top layer device may have
same uuid. As dm devices maintain /dev/mapper/* as persistent names,
just do not doing converting for them.
2012-09-28 15:29:47 +02:00
Harald Hoyer
308015bc4d Makefile: revert documentation logic 2012-09-27 17:04:37 +02:00
Colin Walters
2692a42231 build: Add --disable-documentation option
Some operating system builders may not want to build documention, for
example during a bootstrapping process.
2012-09-27 16:50:25 +02:00
Harald Hoyer
e064127729 add "rd.auto" parameter and switch off automatic assembly
No automatic assembly is done anymore by default. You will have to
specify exactly what devices to assemble
("rd.md.uuid=" "rd.luks.uuid" ...)
or use "rd.auto=1" or "rd.auto" on the kernel command line.

For big servers with thousands of disks we don't want to assemble
everything by default (error prone, slow).
2012-09-27 14:05:50 +02:00
Colin Walters
103281f3b6 Support GNOME Build API
For dracut:

See people.gnome.org/~walters/docs/build-api.txt

We have a new stub configure script that writes out a Makefile.inc.
2012-09-27 12:59:57 +02:00
Harald Hoyer
69ba546721 TODO: update 2012-09-27 12:28:46 +02:00
Harald Hoyer
d65638dacb shutdown/shutdown.sh: reboot, if no argument was given 2012-09-27 12:10:14 +02:00
Harald Hoyer
a0be1eddcf network/ifup.sh: setup nameserver for every interface
even for dhcp

https://bugzilla.redhat.com/show_bug.cgi?id=840769
2012-09-27 11:52:27 +02:00
Harald Hoyer
e1b48995c2 dracut.sh: create the initramfs non-world readable 2012-09-27 10:18:29 +02:00
Harald Hoyer
194e074764 dm/module-setup.sh: instmods dm_mod 2012-09-26 15:05:34 +02:00
Harald Hoyer
7f1d77d9fb TEST-16-DMSQUASH: reenable test 2012-09-26 11:58:51 +02:00
Harald Hoyer
3722020071 crypt/crypt-run-generator.sh: add allow-discards to options in crypttab 2012-09-26 11:49:28 +02:00
Harald Hoyer
f7235c223d dracut.cmdline.7.asc: fixed rd.luks.allow-discards format 2012-09-26 11:49:03 +02:00
Harald Hoyer
868eba13f2 install/dracut-install.c: support find_binary for <src> <dst>
also factor out find_binary()
2012-09-26 11:34:38 +02:00
Harald Hoyer
2cae00be9e busybox/module-setup.sh: generate nice relative symlinks with ln_r 2012-09-26 11:34:00 +02:00
Daniel Drake
69eba8c40a busybox: fix installation from /sbin/busybox
"inst busybox" no longer seems to work when busybox is at
/sbin/busybox. Reproduced on Fedora 18 (dracut-023-39.git20120910).

Use type -P to find the full path to busybox to solve this problem.
2012-09-26 11:30:15 +02:00
Harald Hoyer
17b01c5b13 url-lib/module-setup.sh: also install libs for https 2012-09-26 10:52:33 +02:00
Harald Hoyer
a0508937fc i18n/10-console.rules: do the console init only one time 2012-09-24 15:12:20 +02:00
Harald Hoyer
bc07024624 TEST-10-RAID/test.sh: add "rd.auto=1" 2012-09-24 13:59:03 +02:00
Harald Hoyer
907f75447b TEST-03-USR-MOUNT/create-root.sh: load btrfs module manually 2012-09-24 13:56:21 +02:00
Harald Hoyer
500d8e6002 udev-rules/module-setup.sh: add udev groups 2012-09-24 13:30:46 +02:00
Harald Hoyer
3d12d7a2cc crypt: install /etc/crypttab only in host-only mode 2012-09-24 13:15:08 +02:00
Harald Hoyer
886b9afcc5 systemd/initrd-switch-root.target: run switch-root.target after cryptsetup
Ensure, that all crypto devices have been queried.
2012-09-24 13:12:42 +02:00
Dave Young
f3f9777497 use by-uuid firstly in get_persistent_dev
For devices with filesystem, udev /dev/disk/by-uuid/* links are always
reliable. So improve the get_persistent_dev() by using by-uuid/* firstly,
and fallback to use by-id/*

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-09-24 13:12:26 +02:00
Harald Hoyer
5596b70bd0 dracut-logger.sh: don't check for *lvl==0 in dlog_init() 2012-09-24 13:05:44 +02:00
Harald Hoyer
4211605000 fallback to old ismounted, if findmnt is not installed 2012-09-20 10:36:13 +02:00
Harald Hoyer
aa09b74a41 dash compat: use "2>&1" rather than "&>" 2012-09-20 10:26:14 +02:00
Dave Young
d9a7ea5b43 ismounted fix
ismounted handles both find-by-dev and find-by-mnt, but there's two issues:
1. for find-by-dev, it use readlink to get the canonical dev name, but
   lvm is different with other devices, the canonical name for lvm devices
   are symlinks like /dev/mapper/vg-lv00
2. for nfs mounting, just use [ -b $dev ] is not enough, it need being handled
   seperately.

Per Karel Zak's suggestion, findmnt util is suitable for this purpose, it
handles these cases well, so just use findmnt instead of implement all the
logic by ourselves. Thanks, Karel.

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-09-19 18:37:07 +02:00
Harald Hoyer
914f531f39 45url-lib/url-lib.sh: give info what URL curl failed to download
https://bugzilla.redhat.com/show_bug.cgi?id=857836

Also allow self signed Certs and use "--insecure".

https://bugzilla.redhat.com/show_bug.cgi?id=852229
2012-09-18 16:31:24 +02:00
Harald Hoyer
0fc0dcff60 bye bye iscsi_wait_scan ... officially gone for kernel 3.6 2012-09-18 13:39:54 +02:00
Harald Hoyer
0e32ce3219 resume/resume.sh: prevent "resume: not found"
Problem lies in modules.d/95resume:

[ -x $(command -v resume) ] && command resume $a_splash "$resume"

``command -v resume'' prints nothing and ``test -x'' returns 0.

Thanks to Consus!
2012-09-18 13:37:35 +02:00
Dave Young
ff0636635a move get_persistent_dev to dracut-functions.sh
kdump module also need to convert dev name to udev symlinks.
So better to move function get_persistent_dev() to dracut-functions.sh

Also in this patch improvement and fix the original function:
a) use udevadm info --query=name to get the kernel name.
   This will fix the issue caused by passing symbolic link of a device.
b) fix a bug to compare $_tmp instead of $i with $_dev. Really sorry,
   should have tested more carefully.

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-09-10 15:50:36 +02:00
Harald Hoyer
ba111df2b9 nfs: install all nfs submodules 2012-09-10 15:49:58 +02:00
Harald Hoyer
dff1671f8f iscsi/parse-iscsiroot.sh: delay loading of iscsi modules 2012-09-10 15:49:37 +02:00
Will Woods
44f77ac1b0 apply-live-updates.sh: handle updates for /run
/run will get mounted at $NEWROOT/run after switch_root, but it's not
there yet. bind-mount it in place so updates for /run actually land in
/run.

(also: remove a redundant check for existing directories. mkdir -p
doesn't do anything if the directory already exists.)
2012-09-07 14:09:42 +02:00
Harald Hoyer
641a8558f4 mdraid/parse-md.sh: fixed commit cc4037d120
my fault, sorry.
2012-09-06 16:16:31 +02:00
Will Woods
3bff70ef15 hide 'setsid --help' output in emergency_shell()
When emergency_shell() happens, it does 'setsid --help' to figure out if
the setsid binary supports the '-c' flag (to set the controlling tty).

This output shows up in the logs (and on-screen if you're using
rd.debug), which keeps confusing people looking for other problems.

Using "case" instead of "strstr" lets us avoid this.
2012-09-06 12:18:06 +02:00
Chris Leech
d672bf167c network: fix ip=ibft regression
It looks like ip=ibft has been busted since
  25aa3c5 network: refactor stuff from netroot/parse-ip-opts to net-lib
which moved ibft parsing code out to the ibft_to_cmdline function.

The use of ifname_mac was partially replaced by a local mac, but not
completely, causing ibft_to_cmdline to abort without generating network
configuration options.

Signed-off-by: Chris Leech <cleech@redhat.com>
2012-09-06 12:18:06 +02:00
Harald Hoyer
ea62729238 kernel-modules/module-setup.sh: add yenta_socket to the initramfs
https://bugzilla.redhat.com/show_bug.cgi?id=853787
2012-09-06 11:51:31 +02:00
Harald Hoyer
32ec0a762d ifcfg/write-ifcfg.sh: add "IPV6INIT=yes" for IPv6
https://bugzilla.redhat.com/show_bug.cgi?id=852808
2012-09-06 11:38:48 +02:00
Wim Muskee
ca121b1a5c unquote nbd port
Name based connects fail because of the quotes around the $nbdport.
For name based connects, the -N option also gets included. For
instance nbd-client 192.168.0.1 '-N ltsp' /dev/nbd0.
I believe the quotes are not necessary for actual port numbers.
2012-09-06 10:50:05 +02:00
Frederick Grose
0db77f5a2b dmsquash-live/dmsquash-live-root.sh: Physically write overlay reset at time of request 2012-09-06 10:48:37 +02:00
Vivek Goyal
cc4037d120 dracut: Override rd.md settings if rd.md.uuid is provided
Currently anaconda provides rd.md=0 on kernel's command line as a boot
time optimization if root is not on md device. But this leads to kdump
failure. We copy the command line from first kernel and if dump target
is on md device, it fails as we never try to assemble md devices as
rd.md=0.

We have already set rd.md.uuid though in /etc/cmdlind.d/ dir providing
dracut the info about what md devices to assemble. So this patch overrides
rd.md settings if rd.md.uuid is provided.

This is a stop gap measure to get kdump working on software raid
devices. Harald seems to have bigger cleanup plans for rd.md. Once
that happens, this patch will not be needed and things should
automatically be fixed.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2012-09-06 10:45:24 +02:00
Dave Young
a999414eaf use check_block_and_slaves in for_each_host_dev_and_slaves
for_each_host_dev_and_slaves currently is used in some module check()
functions and it's not necessary iterate all slaves. So use
check_block_and_slaves instead of check_block_and_slaves_all is fine.

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-09-06 10:39:59 +02:00
Milan Broz
00083a0909 FIPS workaround for fipscheck dir
Also patch old install path... (used in Fedora 17)

Signed-off-by: Milan Broz <mbroz@redhat.com>
2012-09-06 10:39:59 +02:00
Harald Hoyer
8a7f561ee5 crypt: do not run systemd crypt generator
"systemctl daemon-reload" does it already for us
2012-09-04 09:49:45 +02:00
Will Woods
32b2fb8a27 make splitsep preserve backslashes (RHBZ#851295)
splitsep() would drop escapes from its inputs. For example:

  splitsep ':' 'first:middle:\e\s\c\a\p\e\d' a b c

gave a='first', b='middle', c='escaped'. Even worse:

  splitsep ':' '\e\s\c\a\p\e\d:middle:last' a b c

gave a='escaped', b='escaped', c='escaped:middle:last'.

This fixes the quoting so both calls return the values you'd expect
(e.g. 'first', 'middle', '\e\s\c\a\p\e\d').
2012-08-24 09:29:31 +02:00
Milan Broz
104727ad6e Require fipscheck and libssl in FIPS module
To properly perform verification in FIPS mode,
we need to install fipscheck and libssl explicitly.

(cryptsetup seems to be the first user of this verification in ramdisk...)

Signed-off-by: Milan Broz <mbroz@redhat.com>
2012-08-24 09:26:59 +02:00
Milan Broz
cce471c9ce dracut-install: FIPS workaround for fipscheck dir
In recent Fedora distro are all hmac files located in /lib
(to avoid multiarch conflict).

When installing hmac file, also install files from these locations.

Signed-off-by: Milan Broz <mbroz@redhat.com>
2012-08-24 09:26:59 +02:00
Harald Hoyer
353e7a7ec3 install/dracut-install.c: correct usage() for hmac 2012-08-23 15:02:37 +02:00
Harald Hoyer
73088e46f7 moved the /etc/host_devs write out to 99base
also removed some left-over debugging code
2012-08-23 12:13:02 +02:00
dyoung@redhat.com
52f1b04183 Add a dracut option --device to bring up a device in initramfs
Kdump support dump to raw device which could be on top of complex storage
such as multipath and iscsi which are standalone dracut modules.

Add a --device option to dracut which will add the device to host_devs so
dracut can add the dependent modules automaticlly and enable them in initramfs.

--device will accept device node name as the param.

Signed-off-by: Dave Young <dyoung@redhat.com>
Tested-by: Chao Wang <chaowang@redhat.com>
2012-08-23 10:15:09 +02:00
dyoung@redhat.com
83e0dc7a3d Add for_each_host_dev_and_slaves for device only checking
For lvm, multipath, iscsi modules they do not care about the filesystem,
Also there could be devcie in host_devs but it does not get formated.

For these kind of modules, use for_each_host_dev_and_slaves will be better than use
for_each_host_dev_fs, here add a new function to iterate the host_devs and
their slave devices.

In original for_each_host_dev_fs, it will call check_block_and_slaves which
will return once helper function return 0, but this is not enough for kdump
iscsi setup. For kdump iscsi case, it need setup each slave devices so that
the iscsi target can be properly setuped in initramfs.

Thus, this patch also add new functions check_block_and_slaves_all and
for_each_host_dev_and_slaves_all.

Signed-off-by: Dave Young <dyoung@redhat.com>
Tested-by: WANG Chao <chaowang@redhat.com>
2012-08-23 10:15:09 +02:00
dyoung@redhat.com
c4bb88715c wait host devs in base module
each dev in host_devs[] should be waited in initqueue to make sure they
are oneline before initqueue finish.

Add a new wait_host_devs.sh in base module to make this a generic thing.
Because all the devs in fstab lines are also added to host_devs, so no need
do same wait in fstab-sys module anymore.

[v2->v3]: do not add slave devices to host_devs
          wait for persistent dev name in initramfs

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-08-23 10:15:09 +02:00
Harald Hoyer
54c7ace145 network: add ping and ping6
better for a quick debug
2012-08-22 17:28:06 +02:00
Harald Hoyer
c1b8934faa znet: add some more kernel drivers 2012-08-22 13:16:23 +02:00
Harald Hoyer
5746f04994 mdraid: catch nested md raids
Thanks to Ian Dall!
2012-08-22 13:01:53 +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
Colin Guthrie
68c49db952 install/dracut-install.c: No need to compare the NULL byte each time. 2012-08-21 18:46:20 +02:00
Colin Guthrie
f9c7788ba5 install/dracut-install.c: Deal gracefully with paths containing double /'s
While such paths should not be included internally, we cannot
guarantee that external scripts with shebangs will not do this.

Some older versions of plymouth also resulted in double /'s
in some paths, so best deal with this gracefully.
2012-08-21 18:46:20 +02:00
Colin Guthrie
68318328f1 install/dracut-install.c: Ensure deps are resolved when handling scripts
If we are doing lazy dep solving and happen to process a script with a
shebang on e.g. /bin/bash before we encounter the actual binary itself
we effectively ignore the fact that we've been asked to resolve the deps
and put the item in the 'seen' hashmap. Thus when we later really do try
and resolve deps, we short circuit and don't do anything.

Example test case:

$ cd
$ mkdir -p foo/bin
$ cp /bin/bash foo/bin
$ echo '#!/bin/bash' >foo/bin/script
$ dracut-install -D $HOME/foo -R $HOME/foo/bin/script $HOME/foo/bin/bash
2012-08-21 18:46:20 +02:00
Harald Hoyer
c9a9968dfc fips: set /boot as symlink to /sysroot/boot if no boot= parameter
otherwise sha512hmac will error out with:

sha512hmac -c /sysroot/boot/.vmlinuz-2.6.32-220.el6.x86_64.hmac
Error opening "/boot/vmlinuz-2.6.32-220.el6.x86_64": No such file or directory.
2012-08-21 18:46:20 +02:00
Harald Hoyer
48dba7f9ac network: reintroduce rd.neednet
rd.neednet is used by anaconda and the network interfaces cannot
be known in advance.
2012-08-21 18:46:20 +02:00
Harald Hoyer
bdf1f472b4 add back scsi_wait_scan 2012-08-17 09:22:12 +02:00
Harald Hoyer
e4297a66b1 mdraid: always create need_shutdown, if we have assembled a raid 2012-08-14 17:44:46 +02:00
Dennis Gilmore
ec6d8eab69 include the omap_hsmmc module on arm 2012-08-02 12:18:48 +02:00
Harald Hoyer
dece5ee1f5 dracut.conf.5.asc: s#dracut/conf.d#dracut.conf.d#g 2012-08-01 16:35:46 +02:00
Amadeusz Żołnowski
a41dc8f969 dracut.conf.d/gentoo.conf.example: fix header 2012-08-01 16:24:40 +02:00
Harald Hoyer
aa11b710ce COPYING: updated to recent version of http://www.gnu.org/licenses/gpl-2.0.txt 2012-08-01 15:53:25 +02:00
Harald Hoyer
6af5a4accf version 023 2012-08-01 15:30:30 +02:00
Frederic Crozat
ec8974914f ensure af_packet module is loaded (if not built-in) 2012-08-01 14:40:43 +02:00
Frederic Crozat
b9775297cd add package name for openSUSE 2012-08-01 14:40:28 +02:00
Harald Hoyer
4a6b33f1ee plymouth/plymouth-pretrigger.sh: s/! -n/-z/ 2012-08-01 14:36:58 +02:00
Harald Hoyer
7dd7ff0f33 base/dracut-lib.sh: make use of DRACUT_SYSTEMD 2012-08-01 14:36:38 +02:00
Dave Young
126732bcc1 split emergency_shell function
Kdump dracut hooks need to enter emergency shell, currently it directly call
"sh -i -l", with recent dracut this does not work anymore without proper ctty.

It will be convinient to seperate a standalone function _emergency_shell for
dracut modules to call.
2012-08-01 14:29:15 +02:00
Harald Hoyer
23d6dcd125 test: s/ib700wdt/i6300esbwdt/g 2012-08-01 12:53:39 +02:00
Harald Hoyer
9fd9e96130 test/Makefile: fixed TESTS parsing 2012-08-01 12:50:54 +02:00
Harald Hoyer
f0a7fc5b43 watchdog: set watchdog timeout with wdctl, if available
"wdctl -s" does not yet exist upstream. I patched
util-linux/sys-utils/wdctl.c to set the timeout.
2012-08-01 12:49:45 +02:00
Chao Wang
d82e0d7dd8 Revert "dracut-functions: $_x should exist, no need to test."
This reverts commit b2d225a669.

When there's no /sys/dev/block/$2/slaves/*/dev/ exists, $_x will
be assigned with '/sys/dev/block/$2/slaves/*/dev/', this is invalid.
That commit will lead to some warn msg like:
cat: /sys/dev/block/8:16/slaves/*/dev: No such file or directory
cat: /sys/dev/block/8:32/slaves/*/dev: No such file or directory
2012-08-01 09:24:12 +02:00
Harald Hoyer
5545fc3046 base/dracut-lib.sh:ismounted() check for block device rather than pathname 2012-07-31 14:44:50 +02:00
Harald Hoyer
a638056838 base/dracut-lib.sh: fixed ismounted() for "/dev" 2012-07-31 14:43:05 +02:00
Harald Hoyer
1f524c4544 Prevent testsuite runs from non-root users. 2012-07-31 13:49:04 +02:00
Harald Hoyer
47b8f66ced rootfs-block/mount-root.sh: corrected check for journaldev 2012-07-31 13:28:45 +02:00
Harald Hoyer
52da8a514a dracut.cmdline.7.asc: corrected rd.retry section 2012-07-31 13:28:07 +02:00
Harald Hoyer
5cd7c104bd document rd.retry and change the default value to 30s
Also start the timeout scripts after 2/3 of the time.
2012-07-31 12:37:35 +02:00
Amadeusz Żołnowski
173edca09e dracut.cmdline.7: add NOTE about how dracut pipes key to cryptsetup 2012-07-31 12:28:55 +02:00
Harald Hoyer
506b219237 dracut.sh: create relative symlinks for /var/lock and /var/run 2012-07-31 11:48:03 +02:00
Harald Hoyer
6c83d7d5bf dracut.sh: do not copy /var/run and /var/lock from the system
https://bugs.gentoo.org/show_bug.cgi?id=428142

If /var/run and /var/lock are real directories, we would end up with:
var/lock/lock -> /run/lock
var/run/run -> /run
2012-07-31 11:44:40 +02:00
Stefan Reimer
a059f72b09 i18n/module-setup.sh: fixed include parsing
Due to bug in module-setup.sh in the i18n module includes from the main
keymap are not working and not added to the initrd image.

Only one quotation per line is removed. Needs to remove all.
2012-07-31 11:36:17 +02:00
Amadeusz Żołnowski
afcebd136f 99shutdown: remove --no-wall argument for reboot, halt, etc...
In some distros (Gentoo, for example) these commands don't honor
--no-wall argument.
2012-07-31 10:55:17 +02:00
Harald Hoyer
3d3c192621 crypt/crypt-run-generator.sh: check if crypttab exists 2012-07-30 22:29:47 +02:00
Harald Hoyer
92b3ee855f removed finished-ask-password.sh 2012-07-30 22:29:42 +02:00
Harald Hoyer
650ab3b077 TEST-10-RAID/test.sh: comment debug options 2012-07-30 21:07:14 +02:00
Harald Hoyer
474cca1e9d TODO: update 2012-07-30 21:07:03 +02:00
Harald Hoyer
c0cae7f702 dmraid,mdraid,lvm,udev: don't process DM_MULTIPATH_DEVICE_PATH devs 2012-07-30 20:41:16 +02:00
Harald Hoyer
3f7e5358e5 crypt/crypt-run-generator.sh: do not add already existing luks 2012-07-30 20:41:16 +02:00
Harald Hoyer
3d352f5228 crypt: add systemd crypt support 2012-07-30 17:08:52 +02:00
Harald Hoyer
540eca9d9d plymouth/plymouth-pretrigger.sh: don't "exit 0" for a sourced script 2012-07-30 17:08:52 +02:00
Harald Hoyer
19cd47fd26 plymouth/plymouth-newroot.sh: don't "exit 0" for sourced scripts 2012-07-30 17:08:52 +02:00
Harald Hoyer
cf62cc435f virtfs/mount-virtfs.sh: don't exit != 0 2012-07-30 17:08:52 +02:00
Harald Hoyer
8b6bdafc39 systemd/module-setup.sh: install systemd udev rules 2012-07-30 17:08:52 +02:00
Harald Hoyer
27790828d1 base/dracut-lib.sh: fixed ismounted(<mountpoint>) 2012-07-30 17:08:52 +02:00
Harald Hoyer
d782ffb822 i18n/parse-i18n.sh: remove udev rules 2012-07-30 17:08:52 +02:00
Harald Hoyer
5a84ac3fe3 dracut-functions.sh: inst_hook() with [0-9]-<name> 2012-07-30 17:08:51 +02:00
Harald Hoyer
343b7d7488 kernel-modules/module-setup.sh: add missing "fi" 2012-07-30 17:08:51 +02:00
Harald Hoyer
aefea76cf8 set DRACUT_SYSTEMD for systemd mode in the initramfs 2012-07-30 17:08:51 +02:00
Harald Hoyer
4976edb1a6 dracut.spec: add Requires: kbd kbd-misc 2012-07-30 13:58:58 +02:00
Harald Hoyer
171ba532bc plymouth/plymouth-newroot.sh: fixed pre-pivot hook 2012-07-30 13:39:37 +02:00
Harald Hoyer
bfd2e8c25f dracut.sh: test if we can lazy resolve with ldd 2012-07-30 13:02:41 +02:00
Chao Wang
b2d225a669 dracut-functions: $_x should exist, no need to test.
Signed-off-by: Chao Wang <chaowang@redhat.com>
2012-07-30 12:23:32 +02:00
Will Woods
a5f01bbfb5 dracut-lib: add find_mount, use it to implement ismounted
find_mount is really the same thing as ismounted with two additions:

  1) uses "readlink" so "ismounted /dev/disk/by-label/LABEL" works
  2) returns the mountpoint of the device

And ismounted is now just "find_mount $dev >/dev/null".
2012-07-30 12:23:32 +02:00
Will Woods
7e2285a48a add comment for getargbool()
I always forget how getargbool works. Add a comment documenting it.
2012-07-30 12:23:32 +02:00
Harald Hoyer
3e964eeb96 dracut.sh: put $drivers and $filesystems back in export 2012-07-27 16:06:36 +02:00
Harald Hoyer
aec9f902f0 kernel-modules/module-setup.sh: move "$drivers" "$filesystems" and "$add_drivers" to dracut.sh 2012-07-27 16:03:42 +02:00
Harald Hoyer
764eb40cc9 TODO: update 2012-07-27 16:03:25 +02:00
Harald Hoyer
95a5b23a38 i18n,terminfo/module-setup.sh: fixed "cp -t" calls 2012-07-27 15:34:54 +02:00
Harald Hoyer
5d833a9f5b add "af_packet" kernel module to network testsuite tests 2012-07-27 15:11:01 +02:00
Harald Hoyer
3e51b2f6fc fixed i18n and plymouth for systemd 2012-07-27 14:15:48 +02:00
Harald Hoyer
852105dc44 i18n/console_init.sh: skip, if we use systemd and use systemd-vconsole-init 2012-07-27 14:11:22 +02:00
Harald Hoyer
a7473ef379 cifs/parse-cifsroot.sh: fixed more root/netroot parsing 2012-07-27 12:40:55 +02:00
Harald Hoyer
f7f3792390 iscsi/iscsiroot.sh: force link initiatorname 2012-07-27 12:18:08 +02:00
Harald Hoyer
2d674a9336 README.testsuite: add instructions on how to run the testsuite 2012-07-27 12:14:04 +02:00
Harald Hoyer
24a38bc1cb fixed install locations for udev rules and change to IMPORT{builtin} 2012-07-27 11:55:31 +02:00
Harald Hoyer
82b1739dce cifs/parse-cifsroot.sh: do not unset netroot, we need it 2012-07-27 11:54:24 +02:00
Amadeusz Żołnowski
fc6b272f41 gitignore install/dracut-install 2012-07-27 09:55:06 +02:00
Amadeusz Żołnowski
c9baff669d Makefile: add dependencies for dracut-install (generated with gcc -MM) 2012-07-27 09:54:49 +02:00
Harald Hoyer
72ee74b9be dracut.spec: add cifs module 2012-07-27 06:26:26 +02:00
Harald Hoyer
cc21808764 dracut-functions.sh:inst_rule_programs() fix error messages 2012-07-26 19:35:12 +02:00
Harald Hoyer
78021eace1 install/dracut-install.c: convert destrootdir to realpath
otherwise we get strange errors if it ends with a slash and does not
exist.
2012-07-26 19:35:00 +02:00
Harald Hoyer
65d1a8a4ae dracut-functions.sh:inst_rule_programs() fixed IMPORT{program} 2012-07-26 19:12:40 +02:00
Amadeusz Żołnowski
187a8e08d5 gentoo.conf: enable ro_mnt 2012-07-26 19:07:28 +02:00
Harald Hoyer
c9a81c1f91 plymouth: do not start plymouth via dracut for systemd in the initramfs 2012-07-26 19:00:04 +02:00
Mike Gorse
d580636e97 Added cifs 2012-07-26 18:51:45 +02:00
Harald Hoyer
6ca264a151 nfs/module-setup.sh: check for "rpc.rpc" before running chown 2012-07-26 18:12:05 +02:00
Amadeusz Żołnowski
aa505d588f parse-root-opts: first check for ro, later for rw
This order is already in 98usrmount.
2012-07-26 17:35:59 +02:00
Harald Hoyer
96c6fa9202 base/module-setup.sh: removed mount-hook 2012-07-26 17:35:25 +02:00
Harald Hoyer
25706eafac README.testsuite updated with requirements for TEST-04-SYSTEMD 2012-07-26 17:26:31 +02:00
Harald Hoyer
8aa9926839 mv rootfs-block/module-setup.sh:search_option() in dracut-functions.sh
new function fs_get_option()
2012-07-26 17:24:01 +02:00
Amadeusz Żołnowski
ff3953efe1 ro_mnt - option at build time to force ro mount of / and /usr 2012-07-26 17:16:56 +02:00
Harald Hoyer
ec5e5ae27a dracut-functions.sh: corrected usage comment of find_mp_fstype() 2012-07-26 17:05:24 +02:00
Harald Hoyer
3cc4c8ba9b rootfs-block/module-setup.sh: add support for xfs / reiserfs separate journal device
xfs and reiserfs (among other) supports storing journal data to a
separate device. Unfortunately, XFS requires this information to boot
properly (reiserfs can embed the information in its metadata but you
might want to override it).

Frederic Crozat <fcrozat@suse.com>
2012-07-26 17:00:47 +02:00
Harald Hoyer
81672479af dracut-functions.sh: add find_mp_fstype() 2012-07-26 17:00:07 +02:00
Frederic Crozat
6a5170a15f PATCH: add support for xfs / reiserfs separate journal device
xfs and reiserfs (among other) supports storing journal data to a
separate device. Unfortunately, XFS requires this information to boot
properly (reiserfs can embed the information in its metadata but you
might want to override it).

Attached patch ensure host information are stored in initramfs and also
allows to give data over kernel commandline.

--
Frederic Crozat <fcrozat@suse.com>
SUSE

>From a7c592b9bb7de0d7874ae51d02944a7eee2ec75b Mon Sep 17 00:00:00 2001
From: Frederic Crozat <fcrozat@suse.com>
Date: Tue, 24 Jul 2012 18:52:17 +0200
Subject: [PATCH] Add support for separate journal on reiserfs and xfs
2012-07-26 16:38:14 +02:00
Amadeusz Żołnowski
1f4aaaeb5e modules.d/99base/mount-hook.sh is not used - removed 2012-07-26 16:35:13 +02:00
Amadeusz Żołnowski
79148c2945 apply "ro" and "rw" options from cmdline to / mount
rflags is no longer guaranteed to be non empty.  / is mounted according
to rootflags parameter but forced ro at first.  Later it is remounted
according to /etc/fstab + rootflags parameter and "ro"/"rw".  If
parameters are still the same as for first mount, / isn't remounted.

Conflicts:

    modules.d/95rootfs-block/mount-root.sh
    modules.d/99base/parse-root-opts.sh
2012-07-26 16:35:13 +02:00
Amadeusz Żołnowski
5767201eaf dracut-lib: new functions: listlist and are_lists_eq
listlist is like strstr for lists with specified separator and
are_lists_eq uses listlist to check equality of specified lists.
2012-07-26 16:35:13 +02:00
Amadeusz Żołnowski
221c342d50 98usrmount: [ "x$_usr_found" != "x" ] - removed redundant 'x' 2012-07-26 16:35:13 +02:00
Amadeusz Żołnowski
b56e174322 98usrmount: print mount options 2012-07-26 16:35:13 +02:00
Amadeusz Żołnowski
5afa957915 98usrmount: use rw and ro options instead of rd.usrmount.ro
In result /usr is forced to be mounted ro or rw along with /.
2012-07-26 16:35:13 +02:00
Amadeusz Żołnowski
af3b67b213 95rootfs-block: fix left fsck rel. checks 2012-07-26 16:35:13 +02:00
Harald Hoyer
93d7b823b4 systemd/dracut-cmdline.sh: output dracut version 2012-07-26 14:23:31 +02:00
Harald Hoyer
4a1255bc38 Makefile: use symlink for topsrcdir/dracut-install 2012-07-26 13:04:45 +02:00
Harald Hoyer
15976a0670 multipath/module-setup.sh: add dm dependency 2012-07-26 12:55:53 +02:00
Harald Hoyer
24ba78cb77 Makefile: fixed dracut-install make target 2012-07-26 12:15:16 +02:00
Amadeusz Żołnowski
15f0b1f624 90multipath: added kpartx.rules; multipath.rules - different prefix 2012-07-26 11:40:37 +02:00
Cong Wang
823311ea3b 90kernel-modules: remove unused variables in install()
The local variables in install() are unused, can be removed.

Cc: Harald Hoyer <harald@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
2012-07-26 10:10:04 +02:00
Amadeusz Żołnowski
f67a1f7f64 gentoo.conf: set udevdir 2012-07-26 10:10:04 +02:00
Amadeusz Żołnowski
e625eea4f9 Config file for systemd on Gentoo. 2012-07-26 10:10:04 +02:00
Amadeusz Żołnowski
f6297ebe73 Remove obsolete gentoo conf file. 2012-07-26 10:10:04 +02:00
Harald Hoyer
372c9b9647 dmsquash-live: do not eject medium for live_ram 2012-07-26 09:25:28 +02:00
Chao Wang
63c65b984a 90multipath: check() - Regexp fix to match multipath partition.
A multipath partition's uuid will be presented like:
 # cat /sys/dev/block/$_dev/dm/uuid
 part1-mpath-360060e801047103004f2c4b300000008

So in this case, change the match regexp from '^mpath-' to 'mpath-'.

Signed-off-by: Chao Wang <chaowang@redhat.com>
2012-07-26 08:35:02 +02:00
Chao Wang
06c6ea654f 95fstab-sys: Skip mounted filesystem.
Signed-off-by: Chao Wang <chaowang@redhat.com>
2012-07-26 08:35:02 +02:00
Amadeusz Żołnowski
ab8bfca794 Makefile: use implicit rules for install/dracut-install
Don't fail on install rule if install/dracut-install is not build - just
skip it.  $(strip) is not used by install rule, because it is nowhere
set.
2012-07-26 08:35:02 +02:00
Amadeusz Żołnowski
386579a45a Remove object file from repo: install/hashmap.o 2012-07-26 08:35:02 +02:00
Harald Hoyer
f1040fc470 qemu*/module-setup.sh: provide alternative for systemd-detect-virt 2012-07-25 16:03:49 +02:00
Harald Hoyer
585fd00624 TODO: update 2012-07-25 15:20:37 +02:00
Harald Hoyer
e045e1f386 Makefile: honor CFLAGS 2012-07-25 15:20:22 +02:00
Harald Hoyer
bf7883ebca network/module-setup.sh: instmods af_packet 2012-07-25 14:56:29 +02:00
Harald Hoyer
a844fb1552 dracut.asc: add doc about journalctl 2012-07-25 14:53:23 +02:00
Harald Hoyer
35022f987c iscsiroot.sh: do not source /etc/conf.d
this should have been done already.
2012-07-25 14:52:25 +02:00
Harald Hoyer
8a240aca9e require kpartx and partx for some modules 2012-07-25 13:00:08 +02:00
Harald Hoyer
68e7661ca7 deprecate old command line options 2012-07-25 10:32:42 +02:00
Leho Kraav
e88e3b2797 91crypt-loop: replace basename calls with string matching 2012-07-25 10:31:43 +02:00
Leho Kraav
df68781fca 91crypt-loop: use initqueue for cleanup strategy 2012-07-25 10:31:43 +02:00
Leho Kraav
f855f9daaf 91crypt-loop: open root device with a key inside encrypted loop container 2012-07-25 10:31:43 +02:00
Leho Kraav
c5758f2090 90crypt: enhance crypt-lib keydev mounting
Combining $keydev and $keypath should result in a unique, re-usable keydev
mountpoint. mkuniqdir doesn't seem to have any an advantage here and lacks
reusability. Is there ever a use case where these are true:

 * there are more than one rd.luks.key=$keypath:$keydev
 * one is actually different from the other
2012-07-25 10:31:43 +02:00
Leho Kraav
3e9b4330a9 90crypt: recognize .img as loop key container 2012-07-25 10:31:43 +02:00
Harald Hoyer
c072e13162 get rid of "basename" 2012-07-24 14:12:36 +02:00
Harald Hoyer
f2271428d4 dracut-functions.sh: small error print correction 2012-07-24 14:08:32 +02:00
Harald Hoyer
cef379bb03 i18n/10-console.rules: move console_init to the initqueue 2012-07-24 11:52:28 +02:00
Harald Hoyer
3e624cd9dc kernel-modules/module-setup.sh: just optionally install all modprobe.d 2012-07-23 15:40:20 +02:00
Harald Hoyer
5297d4f5b2 lvm/lvm_scan.sh: udevadm settle after lvm scan 2012-07-23 15:36:58 +02:00
Harald Hoyer
b7c8f59fef kernel-modules/module-setup.sh: fix modprobe.d install
if /lib/modprobe.d does not exist, it errors with:
find: `/lib/modprobe.d/': No such file or directory
2012-07-23 11:38:36 +02:00
Harald Hoyer
13f77e9fd5 add documentation for systemd services in the initramfs 2012-07-23 11:29:20 +02:00
Harald Hoyer
472189da15 dracut.sh: add -N option for --no-hostonly 2012-07-21 13:03:56 +02:00
Harald Hoyer
e5ec81a354 AUTHORS: update 2012-07-21 12:55:23 +02:00
Harald Hoyer
4c3be42cdf dracut.8: add more description about calling dracut 2012-07-21 12:52:01 +02:00
Harald Hoyer
24450a5ab7 resume: move resume in the initqueue/finished hook
this ensures, that resume is called as soon as possible
2012-07-20 14:47:41 +02:00
Harald Hoyer
df7be11b38 Version 022 2012-07-20 13:11:21 +02:00
Harald Hoyer
52f74c8010 dracut-functions.sh: fixed host-only kernel module bug 2012-07-20 13:10:58 +02:00
Harald Hoyer
ddf818dad5 Version 021 2012-07-20 11:46:48 +02:00
Harald Hoyer
e65caf3696 dracut: add option --kver=<kernel-version> 2012-07-20 11:37:55 +02:00
Harald Hoyer
a0af318a8d testsuite: fixups and color 2012-07-20 11:20:12 +02:00
Harald Hoyer
c008b0ce10 Turn on systemd again and Conflict < systemd-187 2012-07-20 09:12:37 +02:00
Harald Hoyer
258de82819 dracut-functions.sh: set LC_MESSAGES=C not LC_ALL 2012-07-19 13:35:50 +02:00
Harald Hoyer
c243105e6b Makefile: set LC_MESSAGES=C ... not LANG 2012-07-19 13:35:31 +02:00
Harald Hoyer
3bb4700f98 systemd/module-setup.sh: removed initctl services 2012-07-18 15:54:08 +02:00
Harald Hoyer
6bd4ca5644 systemd/module-setup.sh: removed shutdownd
we don't need timed shutdowns in the initramfs
2012-07-18 14:08:50 +02:00
Harald Hoyer
a01cf5d782 test/TEST-04-FULL-SYSTEMD: add systemd to modules 2012-07-17 18:05:39 +02:00
Harald Hoyer
7292a59593 systemd: stop udevd correctly 2012-07-17 18:04:44 +02:00
Harald Hoyer
765d8408e9 Revert "systemd/dracut-pre-pivot.service: force clean stop of udevd and cleanup-db"
This reverts commit a43f97c4e3.
2012-07-17 13:05:11 +02:00
Harald Hoyer
6da9cb4ba7 dracut.conf.d/fedora.conf.example: disable systemd for now 2012-07-17 11:14:40 +02:00
Harald Hoyer
3780d7e449 systemd/initrd-switch-root.service: call switch-root with --no-block 2012-07-17 11:09:17 +02:00
Harald Hoyer
a43f97c4e3 systemd/dracut-pre-pivot.service: force clean stop of udevd and cleanup-db 2012-07-17 11:08:58 +02:00
Milan Broz
4ee59ab3ed Fix fips module list.
If dracut is build only with fips/fips-aesni (no crypto module),
FIPS mode fails because of missing GCM modules.

Just add proper modules to list (kernel have both maker as FIPS compliant already).

Signed-off-by: Milan Broz <mbroz@redhat.com>
2012-07-16 16:58:51 +02:00
Harald Hoyer
0f283709c9 dracut-functions.sh: output more info, if dependency modules are omitted 2012-07-16 12:21:56 +02:00
Harald Hoyer
7a1f355fb5 dracut.spec: add suse version ifdefs 2012-07-16 10:36:59 +02:00
Harald Hoyer
030ade7590 Fixes for systemd-187, which does the right thing for switch-root 2012-07-16 10:13:53 +02:00
Harald Hoyer
1ddc789f5a kernel-modules/module-setup.sh: add hid_generic to kernel modules 2012-07-12 10:20:28 +02:00
Harald Hoyer
3d115217e4 test/TEST-04-FULL-SYSTEMD: default to basic.target and output more debug 2012-07-12 08:59:43 +02:00
Harald Hoyer
f31049c17f systemd/service-to-run.sh: do not copy the target subdirs 2012-07-12 08:56:36 +02:00
Harald Hoyer
e6bec9b793 systemd/initrd-switch-root.service: add some more dependencies 2012-07-12 08:56:17 +02:00
Harald Hoyer
982032fd26 watchdog/watchdog-stop.sh: forgot to add script 2012-07-12 07:01:27 +02:00
Harald Hoyer
2499c305f9 systemd/initrd-switch-root.service: add back "--force" to switch-root
otherwise systemd does umount /run et.al.
2012-07-11 16:36:05 +02:00
Harald Hoyer
f6c2faebfa install/dracut-install.c: check for empty or "/" destdir 2012-07-11 15:47:10 +02:00
Harald Hoyer
98eb6d57df dracut.sh: for --include copy also the symbolic links 2012-07-11 15:25:49 +02:00
Harald Hoyer
f60cd2593f systemd: fixed initrd-switch-root.service 2012-07-11 15:25:30 +02:00
Harald Hoyer
2723ebba9a test: silence "make all" 2012-07-11 15:23:21 +02:00
Harald Hoyer
badda27f61 test/TEST-04-FULL-SYSTEMD: full test with systemd and /usr mount 2012-07-11 15:18:32 +02:00
Harald Hoyer
0d57270395 dracut-shutdown.service: s/reboot.service/systemd-reboot.service/ 2012-07-11 10:00:10 +02:00
Harald Hoyer
3e1d48fd12 test: add support for: make V=1 TESTS="01 20 40" check
$ sudo make V=1 clean check
now runs the testsuite in verbose mode

$ sudo make TESTS="01 20 40" clean check
now only runs the 01, 20 and 40 tests.
2012-07-11 09:33:32 +02:00
Dave Young
83a420674b nfs: install modprobe config file
install nfs modprobe config file

For nfs4, in case nfs.ko is not loaded mount.nfs4 will try to load
nfs4.ko instead of nfs.ko. Fedora nfs-utils creates a lib/modprobe.d/nfs.conf
in which there's below alias:
alias nfs4 nfs

Dracut also need this file to auto load nfs kernel module.

Tested booting to a fedora 17 nfsroot share.

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-07-11 08:45:34 +02:00
Harald Hoyer
9f5c98a76a kernel-modules/module-setup.sh: also install /lib/modprobe.d/*.conf
In theory we should only install /lib/modprobe.d/*.conf and only for
host-only the /etc/modprobe.d.
2012-07-11 08:42:21 +02:00
Harald Hoyer
fc5b6b0328 systemd/initrd-switch-root.target: add ConditionPathExist 2012-07-11 08:41:31 +02:00
Harald Hoyer
4dda0095a1 test/*/server-init.sh: redirect stdin,out,err to /dev/console 2012-07-11 08:40:45 +02:00
Harald Hoyer
bef2fd9722 systemd: install all dracut units in /etc and let the generator cp to /run
All custom units, which should appear in the system later on should be
installed in /etc/systemd. They should have a guard like:
ConditionPathExists=/etc/initrd-release

So, we can later query via systemctl:

$ systemctl status dracut-initqueue.service
dracut-initqueue.service - Dracut initqueue hook
 Loaded: loaded (/run/systemd/system/dracut-initqueue.service; enabled-runtime)
 Active: inactive (dead) since Tue, 10 Jul 2012 16:01:22 +0200; 1min 37s ago
         start condition failed at Tue, 10 Jul 2012 16:01:23 +0200; 1min 36s ago
 Main PID: 173 (code=exited, status=0/SUCCESS)
 CGroup: name=systemd:/system/dracut-initqueue.service

Jul 10 16:01:22 lenovo dracut-initqueue[173]: Checking, if btrfs device complete
Jul 10 16:01:22 lenovo dracut-initqueue[173]: Remounting /dev/disk/by-uuid/ade13292-d23f-45be-b732-fa9a391a56b0 with -o compress=lzo,ssd,rw
Jul 10 16:01:22 lenovo dracut-initqueue[173]: Mounted root filesystem /dev/sda3
2012-07-10 17:02:42 +02:00
Harald Hoyer
ad401d1eaf systemd/initrd-switch-root.service: stop journald, rather than restart 2012-07-10 16:19:56 +02:00
Harald Hoyer
a92311074b install/dracut-install.c: redirect stderr to stdout and skip loader
skip if ldd was run on the loader
2012-07-10 12:24:16 +02:00
Harald Hoyer
9ede75b1ce TEST-01-BASIC: enable selinux 2012-07-10 12:24:16 +02:00
Harald Hoyer
fe5f8d0074 TEST-01-BASIC: turn on systemd debugging 2012-07-10 12:24:16 +02:00
Harald Hoyer
0028ffac74 plymouth: add plymouth-wait-quit.service to initrd 2012-07-10 12:24:16 +02:00
Harald Hoyer
792b189317 systemd service cleanup 2012-07-10 12:22:51 +02:00
Harald Hoyer
43bac63e33 TEST-99-RPM test trap 2012-07-09 20:44:48 +02:00
Harald Hoyer
450b5f336d resume: move resume process to initqueue 2012-07-09 17:06:51 +02:00
Harald Hoyer
4eafdbdbe8 test: new test TEST-99-RPM
This test installs the dracut rpm together with the kernel in an
installroot. rpm -Va and rpm -qf are used, to ensure nothing modified
files in the real root.
2012-07-09 16:44:45 +02:00
Harald Hoyer
27fa604418 test: export initdir 2012-07-09 15:30:15 +02:00
Colin Guthrie
3c1feedfd1 plymouth: Use latest plymouth's populate script.
The latest plymouth no longer relies on dracut to provide functions
needed to install binaries/libs so the check for a variable name
no longer works and the old, built-in script is used instead thus
breaking the new drm and framebuffer plymouth module installation.
2012-07-09 13:08:27 +02:00
Harald Hoyer
2023d8eb5b Makefile: do not install service from 98systemd. They are copied to /run 2012-07-09 13:02:36 +02:00
Dave Young
a17fc9902e dhclient initqueue hook fix
dhclient initqueue hook fix

setup_net is scheduled in initqueue, sometimes it does not get chance to run
So the default route will not be set properly

Add a check in initqueue/finished to resolve this issue.

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-07-09 12:03:55 +02:00
Dave Young
d6e8280cd8 02caps: do not create /bin/sh link
02caps: do not create /bin/sh link

caps.sh use !/bin/bash explictly, so no need to ln -sf bash /bin/sh

OTOH, 00dash will create the symlink /bin/sh, 99base will create it if
there's no /bin/sh symlink. It looks bad to creat /bin/sh in other modules.

If a script want to use bash as command interpreter it should use !/bin/bash
or !/bin/sh in case dash is not installed.

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-07-09 12:03:55 +02:00
Harald Hoyer
cbefa47006 TEST-30-ISCSI: convert to ext3 2012-07-09 10:17:22 +02:00
Harald Hoyer
b4e20a898e systemd-udev-trigger.service and systemd-udev-settle.service have no "d" 2012-07-09 10:12:04 +02:00
Harald Hoyer
6795dcc4fc require systemd >= 186 2012-07-09 10:04:35 +02:00
Harald Hoyer
fbf658fece dracut.sh: corrected error messages, if mktemp failed 2012-07-09 10:02:35 +02:00
Harald Hoyer
593b315c70 dracut-functions.sh: bail out, if $initdir is not set 2012-07-09 10:02:04 +02:00
Harald Hoyer
56ed92922e dracut.conf.d/fedora.conf.example: removed readonly from prefix 2012-07-09 08:21:00 +02:00
Harald Hoyer
9954876417 systemd/module-setup.sh: also include systemd-udevd* units
systemd-udev* was renamed to systemd-udevd*
2012-07-06 14:33:53 +02:00
Harald Hoyer
d96c3254e8 dracut.spec,dracut.conf.d/fedora.conf.example: no dash
hard remove dash from supported modules

we do not want to have anything to do with dash bugs
2012-07-06 14:22:10 +02:00
Harald Hoyer
e1619ee151 fixed bash/sh requirements 2012-07-06 14:06:41 +02:00
Harald Hoyer
e09048aaf5 systemd: check, that --prefix= does not contain /run
systemd will mount /run before dracut has a chance to copy over the
original content.
2012-07-06 13:49:03 +02:00
Harald Hoyer
a421016671 dracut.sh: keep vim syntax highlighting happy 2012-07-06 13:48:05 +02:00
Harald Hoyer
f1e7add2bf network/ifname-genrules.sh: check for multiple ifname= lines 2012-07-06 12:57:17 +02:00
Harald Hoyer
528864e460 mkinitrd.8.asc: mark paragraph as important 2012-07-06 12:42:06 +02:00
Harald Hoyer
1760dfc051 network: do not rename other interfaces and document the ifname usage
We do not support renaming in the kernel namespace anymore (as udev does
that not anymore). So, if a user wants to use ifname, he has to rename
to a custom namespace. "eth[0-9]+" is not allowed anymore.
2012-07-06 12:41:55 +02:00
Harald Hoyer
5d0404e3b3 dracut.cmdline.7.asc: fixup 2012-07-06 12:34:45 +02:00
Harald Hoyer
18595cede8 dracut.8.asc: fixup NOTE sections 2012-07-06 12:34:45 +02:00
Harald Hoyer
e5efb6a798 dracut.asc: add lsinitrd and mkinitrd 2012-07-06 12:34:45 +02:00
Harald Hoyer
f1e9f613d9 systemd: exit with sane state 2012-07-06 12:34:45 +02:00
Harald Hoyer
e7dc1e42cd network: factor out parse_ifname_opts() for ifname-genrules 2012-07-05 14:33:45 +02:00
Harald Hoyer
d04f16f600 install user/group adm for journal 2012-07-05 14:33:00 +02:00
Harald Hoyer
338b43cd6a fips: add instmods silent check mode "-c -s" 2012-07-05 11:15:42 +02:00
Harald Hoyer
394ffc1d97 i18n/module-setup.sh: s/error/info if no keymap is configured
https://bugzilla.redhat.com/show_bug.cgi?id=836418
2012-07-05 11:15:35 +02:00
Harald Hoyer
0251fcd400 fips: change module list 2012-07-05 10:11:27 +02:00
Harald Hoyer
eaf4cb6bbb Makefile: mkinitrd man page install typo 2012-07-05 06:57:43 +02:00
Harald Hoyer
a85ee030ab lsinitrd.sh: fixed version file extraction 2012-07-03 18:24:21 +02:00
Harald Hoyer
d8caa679e0 lsinitrd.sh: get rid of awk call 2012-07-03 18:23:59 +02:00
Harald Hoyer
f7bccf3724 lsinitrd.sh: print usage for -?, -h 2012-07-03 18:23:27 +02:00
Harald Hoyer
38bbec3731 TEST-30-ISCSI: put back in hard-off.sh for tests 2012-07-03 18:22:29 +02:00
Harald Hoyer
a128f03b30 TEST-03-USR-MOUNT: change test to use a seperate disk 2012-07-03 18:21:54 +02:00
Harald Hoyer
f0e10d9351 usrmount/mount-usr.sh: check the right path with ismounted 2012-07-03 18:20:46 +02:00
Harald Hoyer
ffa71b4afa dracut.sh: use getopt to parse arguments
now we can put options and arguments anywhere we like.

e.g.
$ dracut test.img --force
2012-07-03 14:50:18 +02:00
Harald Hoyer
9f355169f4 manpages: simplify AUTHORS 2012-07-03 14:20:14 +02:00
Harald Hoyer
0e14946a20 add lsinitrd and mkinitrd man pages 2012-07-03 14:19:58 +02:00
Harald Hoyer
c204501e3e base/init.sh: error out early, if /dev, /proc or /sys cannot be mounted 2012-07-03 13:14:12 +02:00
Harald Hoyer
194b80f974 dracut-functions.sh:find_kernel_modules_by_path() fixed hostonly part
filter /sys/module/* modules by path
2012-07-02 22:51:24 +02:00
Harald Hoyer
ec61f0a3af dracut-functions.sh: forgot --set-version $kernel for modprobe 2012-07-02 22:14:49 +02:00
Harald Hoyer
f225f180e3 usrmount/mount-usr.sh: give emergency_shell if /usr mount failed 2012-07-02 18:54:07 +02:00
Harald Hoyer
e74944eee5 dracut-install.c: for lazy install shebangs, do not check for existence 2012-07-02 18:54:07 +02:00
Harald Hoyer
eaa924b69e dracut-functions.sh: create $initdir, if it does not exist 2012-07-02 18:52:49 +02:00
Harald Hoyer
1d59e3e592 TEST-02-SYSTEMD: enlarge the root disk 2012-07-02 18:52:49 +02:00
Harald Hoyer
5113a3efff rootfs-block/mount-root.sh: warn if ro mount failed and remount
remount the root filesystem, if it was not unmounted
2012-07-02 18:52:49 +02:00
Harald Hoyer
1594d0bf9c fs-lib/fs-lib.sh: skip fsck for xfs and btrfs. remount is enough 2012-07-02 18:52:49 +02:00
Harald Hoyer
47057875e7 TEST-01-BASIC: grow the root disk 2012-07-02 18:52:49 +02:00
Harald Hoyer
ef9b54cfe6 new testsuite test TEST-03-USR-MOUNT
mounts /usr as a btrfs subvolume and should respect "rw" and "ro" kernel
command line arguments properly.
2012-07-02 18:52:49 +02:00
Harald Hoyer
04d18f5587 add "--hardlink" "--nohardlink" options 2012-07-02 18:52:49 +02:00
Harald Hoyer
73575f11a9 dracut-functions.sh,dracut.sh: use xargs with "-r" 2012-07-02 18:52:49 +02:00
Harald Hoyer
998bf6e088 dracut.sh: do not lazy resolve "include" directories 2012-07-02 18:52:49 +02:00
Harald Hoyer
34e43ceb0d dracut-install.c: give info that SOURCE argument is missing 2012-07-02 18:52:49 +02:00
Harald Hoyer
7209df9e91 do not umount root, remount it. do not mount ro if not specified
also mount /usr readonly if "ro" is specified on the command line
if /usr is a btrfs subvolume of root, use the same mount options
2012-07-02 18:52:49 +02:00
Harald Hoyer
0e95d84892 dracut-functions.sh: set LC_ALL=C to get correct parsing information 2012-07-02 18:52:49 +02:00
Amadeusz Żołnowski
965c2d8760 95rootfs-block: skip checks rel. to fsck if rd.skipfsck is supplied 2012-07-02 18:52:49 +02:00
Amadeusz Żołnowski
9fb01d49d6 new option: rd.skipfsck to skip fsck for rootfs and /usr 2012-07-02 18:52:49 +02:00
Amadeusz Żołnowski
e42b6f9e15 99base: don't require fs-lib to detect rootfstype
If fs-lib is not included, no rootfs autodetection is performed.
2012-07-02 18:52:49 +02:00
Amadeusz Żołnowski
2ee48b4b4b 98usrmount: force mounting /usr read-only option (rd.usrmount.ro) 2012-07-02 18:52:49 +02:00
Harald Hoyer
f4031e8a9a move dracut-install to dracutbasedir
We do not want to install dracut-install to /usr/bin until all
interfaces are set to stone and the manpage is written. Until then the
tool is dracut internal.
2012-07-02 18:52:49 +02:00
Harald Hoyer
85854b245e dracut-install.c: try clone ioctl for more speed 2012-06-30 12:50:43 +02:00
Harald Hoyer
09eaf9f5b3 Version 020 2012-06-29 12:54:38 +02:00
Harald Hoyer
89d44e720b Use /usr/bin/dracut-install if available
/usr/bin/dracut-install greatly improves initramfs creation speed
2012-06-29 12:54:38 +02:00
Harald Hoyer
7224913d16 dracut-functions.sh: grep for "--relative" for the ln_r() check 2012-06-29 12:54:38 +02:00
Harald Hoyer
026b81e980 install/*: add dracut-install tool 2012-06-29 12:54:38 +02:00
Harald Hoyer
6571cd4073 TEST-40-NBD: add watchdog 2012-06-29 12:51:13 +02:00
Harald Hoyer
67ab4f7718 testsuite: fixups 2012-06-29 12:51:13 +02:00
Harald Hoyer
f71145d20d TEST-20-NFS: trigger watchdog more often 2012-06-29 12:51:13 +02:00
Harald Hoyer
407fbc9e13 watchdog: stop watchdog in emergency_shell 2012-06-29 12:51:13 +02:00
Harald Hoyer
5ffa0114c0 kernel-modules: no need to install modules.dep et.al.
dracut_kernel_post() does it all
2012-06-29 12:41:28 +02:00
Harald Hoyer
08084370fd watchdog: call watchdog more often 2012-06-29 12:41:28 +02:00
Harald Hoyer
70c6b773ca dracut.sh, dracut-functions.sh: add dracut_kernel_post()
dracut_kernel_post() does lazy kernel module dependency installation,
depmod and cleans up temporary files
2012-06-29 12:41:28 +02:00
Harald Hoyer
0d339e7ffb fips/module-setup.sh: s/aes-xts/xts 2012-06-29 12:41:27 +02:00
Harald Hoyer
f0558da598 test/*/test.sh: correct ifup and dhclient paths 2012-06-29 12:41:27 +02:00
Harald Hoyer
ec1aa3bc48 dracut-functions.sh: error out, if $initdir is not set 2012-06-29 12:41:27 +02:00
Harald Hoyer
26c231f13b dracut.sh: set $initdir early before sourcing dracut-functions.sh 2012-06-29 12:41:27 +02:00
Harald Hoyer
99c7b70d1d modules.d: get rid of "tr"
replace it with sed or str_replace or bash ${var/a/b}
2012-06-29 12:41:27 +02:00
Harald Hoyer
92f26b6202 dracut-functions: inst(),inst_binary() fixed inst_symlink call 2012-06-29 12:41:27 +02:00
Harald Hoyer
0c6565c810 dracut-functions.sh:inst_libdir_files() combine installs
first, search for all files, then call dracut_install only once
2012-06-29 12:41:27 +02:00
Harald Hoyer
d8aeb3a72a dracut.sh, dracut-functions.sh: do lazy kernel module dep resolving
First, we just install the kernel module and keep track, what we
installed. At the very end, call modprobe and modinfo for firmwares to
resolve all kernel module dependencies. This speeds up image creation,
because we can call modprobe and modinfo with many modules.
2012-06-29 12:41:27 +02:00
Harald Hoyer
2cf987f5c3 fcoe/module-setup.sh: check() for needed tools 2012-06-29 12:41:27 +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
Srinivasa T N
e716c0f121 Fixed BOOTIF for converting mac addr to lowercase
The patch, acfab373 - Handle upper case MAC addresses in ifname
option,takes care of only the MAC conversion to lower case in the
interface name.  But the same has to be taken care for BOOTIF also.
This patch takes care of changing the BOOTIF to lower case.

Note that sed has been used in the patch instead of tr, as it is not
compulsion to install tr by dracut in the initramfs and may not be
available always.

Signed-off-by: Srinivasa T N (seenutn@linux.vnet.ibm.com)

>From 2ec9c91adbf808dbad9bdd2057d9df55a62b711f Mon Sep 17 00:00:00 2001
From: Srinivasa T N <seenutn@linux.vnet.ibm.com>
Date: Wed, 27 Jun 2012 11:20:13 +0530
Subject: [PATCH] Fixed BOOTIF for converting mac addr to lowercase
2012-06-29 12:41:27 +02:00
Amadeusz Żołnowski
1048124120 90dmsquash-live: don't source fs-lib.sh as it is not used 2012-06-29 12:41:27 +02:00
Amadeusz Żołnowski
84a12fbc21 dracut-lib.sh: Use "$*" instead of "$@" in warn, info, and so on...
"$@" might cause some uneccessary word breaking.
2012-06-29 12:41:27 +02:00
Amadeusz Żołnowski
1d97bb8b39 man pages: hostonly mode generates host-specific configuration
This fact hasn't been mentioned.
2012-06-29 12:41:27 +02:00
Amadeusz Żołnowski
4ea629b9e1 98usrmount: depend on fs-lib 2012-06-29 12:41:27 +02:00
Harald Hoyer
ad200fbc8c dracut.sh: do not copy devices nodes, mknod them 2012-06-29 12:41:26 +02:00
Harald Hoyer
b47d7a5fd4 dracut-logger.sh: empty functions for log funcs, which are below level 2012-06-29 12:41:26 +02:00
Harald Hoyer
5d897c82b9 dracut-logger.sh: use (( )) for numeric comparisons 2012-06-29 12:41:26 +02:00
Harald Hoyer
4d0f1d7b28 modules.d/*/module-setup.sh: no more sourcing of dracutfunctions 2012-06-29 12:41:26 +02:00
Harald Hoyer
2d2c8c2078 multipath/module-setup.sh:installkernel() fix return code 2012-06-29 12:41:26 +02:00
Harald Hoyer
8bc04b98c7 kernel-modules/module-setup.sh:installkernel() fix return code 2012-06-29 12:41:26 +02:00
Harald Hoyer
71947dcb91 plymouth/module-setup.sh:installkernel() fix return code 2012-06-29 12:41:26 +02:00
Harald Hoyer
9c2a1d0de6 iscsi/module-setup.sh: speedup installkernel() 2012-06-29 12:41:26 +02:00
Harald Hoyer
94165394ff network/module-setup.sh: fixed installkernel() return code 2012-06-29 12:41:26 +02:00
Harald Hoyer
3aa221aa1d terminfo/module-setup.sh: speedup install() of all terminfo 2012-06-29 12:41:26 +02:00
Harald Hoyer
a0df73b493 udev-rules/module-setup.sh: ln with --force 2012-06-29 12:41:26 +02:00
Harald Hoyer
5bccc94598 no more "mknod" in the initramfs!! 2012-06-29 12:41:26 +02:00
Harald Hoyer
a5f44604f7 bootchart/module-setup.sh: no need for mknod anymore 2012-06-29 12:41:26 +02:00
Harald Hoyer
8c6151bd63 i18n/module-setup.sh:install_all_kbd(): speedup install 2012-06-29 12:41:26 +02:00
Harald Hoyer
d531a0a307 systemd/module-setup.sh: ln with --force 2012-06-29 12:41:26 +02:00
Harald Hoyer
3639d2431f systemd/module-setup.sh: only create empty machine-id if non existing 2012-06-29 12:41:25 +02:00
Harald Hoyer
44cf581732 base/module-setup.sh: use --force for ln 2012-06-29 12:41:25 +02:00
Harald Hoyer
b65bde04e7 fs-lib/fs-lib.sh: removed test mounting of btrfs and xfs
mount/umount check only costs time and we fail later anyway.
mount can take very long on large filesystems. Better fail on the real
mount.
2012-06-29 12:41:25 +02:00
Harald Hoyer
28a6eef3be profile.py: do not count negative timestamp differences 2012-06-29 12:41:25 +02:00
Harald Hoyer
69b35075f3 dracut.sh: speedup "strip" 2012-06-29 12:41:25 +02:00
Harald Hoyer
744054779f dracut-functions.sh:find_kernel_modules_by_path() use IFS=:
For modules.dep use simpler IFS=: to read the file.
2012-06-29 12:41:25 +02:00
Harald Hoyer
b19c5d51f8 dracut-functions.sh:inst_decompress() simplify function 2012-06-29 12:41:25 +02:00
Harald Hoyer
22048b44db dracut-functions.sh:inst_simple() do inst_symlink for symlinks 2012-06-29 12:41:25 +02:00
Harald Hoyer
1488a9b34d Add qemu kernel modules, if we detect a qemu instance
Regardless of the host-only setting, add all know kernel driver for qemu
instances to support changing the virtual hardware.
2012-06-29 12:41:25 +02:00
Harald Hoyer
d5b5bb3103 dracut-functions.sh: cp with --reflink=auto and --sparse=auto
cp will use COW data copy most of the time. So, it's even better than
hardlink, because we don't have to care about hardlinks, when modifying
files in post.
2012-06-29 12:41:25 +02:00
Harald Hoyer
f8be752874 dracut-functions.sh: mksubdirs(): check for dir existence first 2012-06-29 12:41:25 +02:00
Harald Hoyer
520047c3c4 dracut-functions.sh: replace strstr()
the new strstr() is faster, when compared
2012-06-29 12:41:25 +02:00
Harald Hoyer
ae2d48a366 systemd: add ConditionPathExists=/etc/initrd-release to services 2012-06-29 12:41:25 +02:00
Cong Wang
472edf825e network: support vlan tagged bonding
This patch adds support of vlan tagged bonding, for example,
bond0.2. In case of regression, I also tested bond0 and eth0.2,
all work fine.

Cc: Harald Hoyer <harald@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
2012-06-21 11:17:36 +02:00
Harald Hoyer
cc51bc6fdb systemd/dracut-pre-pivot.sh: copy service files to /run/systemd/system
and remove the last info, so that the journal is not restarted again.
2012-06-21 10:52:40 +02:00
Harald Hoyer
55cb17c677 systemd: remove old udev services 2012-06-21 10:52:29 +02:00
Harald Hoyer
ee876e03b9 fixed i18n for systemd and include more config files in host-only 2012-06-21 10:52:29 +02:00
Harald Hoyer
579ca216b4 systemd: remove unneeded systemd services 2012-06-21 10:52:19 +02:00
Harald Hoyer
a20d24ded2 dracut-functions.sh: use "ln -r" instead of shell functions 2012-06-21 01:57:11 +02:00
Harald Hoyer
1e2673fd98 dracut.spec: require systemd >= 44-15 2012-06-21 01:20:11 +02:00
Harald Hoyer
16c88e493f dracut.conf.d/fedora.conf.example: make systemd default 2012-06-21 01:11:44 +02:00
Harald Hoyer
1e570bf8e3 base/dracut-lib.sh: for systemd start emergency.service
do not spawn the shell, start the emergency.service for systemd
2012-06-21 01:11:44 +02:00
Harald Hoyer
d9087a2d85 base/dracut-lib.sh: change output of info() and warn() for systemd 2012-06-21 01:11:44 +02:00
Harald Hoyer
e08710a289 systemd: fixed I/O of services 2012-06-21 01:11:44 +02:00
Harald Hoyer
b03e991113 systemd: fixed ordering of services 2012-06-21 01:11:44 +02:00
Harald Hoyer
a51aa0d0e2 systemd/dracut-pre-udev.service: fixed description 2012-06-21 01:11:44 +02:00
Harald Hoyer
f82659c552 systemd/dracut-pre-pivot.sh: remove trailing space 2012-06-21 01:11:44 +02:00
Harald Hoyer
f653c86229 systemd/dracut-cmdline: make dracut-cmdline a service
convert dracut-cmdline from hook to service after the journal
2012-06-21 01:11:44 +02:00
Harald Hoyer
edcbd379d5 systemd/dracut-pre-pivot.sh: stop old udev services 2012-06-21 01:11:44 +02:00
Harald Hoyer
3d3ddf082b systemd: do not flock for console 2012-06-21 01:11:44 +02:00
Harald Hoyer
f6eb1f1d1f systemd: do not redirect to /dev/console 2012-06-21 01:11:44 +02:00
Harald Hoyer
b47e023767 systemd: fix emergency.service and rescue.service 2012-06-21 01:11:44 +02:00
Harald Hoyer
529f7bf358 systemd/module-setup.sh: add old udev systemd services 2012-06-21 01:11:43 +02:00
Harald Hoyer
9f037266ee systemd: output all service output to the journal also 2012-06-21 01:11:43 +02:00
Harald Hoyer
c7896f1251 dracut-shutdown.service: fixed ordering to be before shutdown.target 2012-06-21 01:11:43 +02:00
Harald Hoyer
361306c131 check for arch before installing drivers/s390 2012-06-21 01:11:43 +02:00
Harald Hoyer
f48f9341a5 disable TEST-16-DMSQUASH for now 2012-06-18 20:05:25 +02:00
Harald Hoyer
d686298315 TEST-50-MULTINIC: libnss cleanup 2012-06-18 20:05:25 +02:00
Harald Hoyer
9f88b0370d TEST-20-NFS: libnss cleanup 2012-06-18 20:05:25 +02:00
Harald Hoyer
2dbd71b77a TEST-50-MULTINIC: add watchdog 2012-06-18 20:05:25 +02:00
Harald Hoyer
483b1e3aa8 TEST-20-NFS: add watchdog 2012-06-18 20:05:25 +02:00
Harald Hoyer
c8f3a1c057 TEST-01-BASIC: add watchdog 2012-06-18 20:05:25 +02:00
Harald Hoyer
ef914f7d83 add 04watchdog dracut module 2012-06-18 20:05:25 +02:00
Harald Hoyer
0efc6c716a plymouth: fixed inst_libdir_file() call
https://bugzilla.redhat.com/show_bug.cgi?id=831349
2012-06-18 13:46:03 +02:00
Harald Hoyer
4f9f76cd62 iscsi/module-setup.sh: only install s390 driver on s390 arch 2012-06-18 13:26:55 +02:00
Harald Hoyer
8d95b8b338 Set some global variables in dracut-functions.sh 2012-06-18 13:26:37 +02:00
Harald Hoyer
7abd426438 fixed instmods() return code and set pipefail globally 2012-06-18 13:26:01 +02:00
Harald Hoyer
8fab6e0463 resolve conflict between cms network rules and default rules 2012-06-15 11:56:13 +02:00
Harald Hoyer
c9aa3cc950 Revert "network/ifup.sh: do not default to dhcp, for interfaces without ip=..."
This reverts commit ede0532c58.
2012-06-15 11:56:05 +02:00
Harald Hoyer
f9ad49c2a5 Revert "network/ifup.sh: default to dhcp for BOOTIF"
This reverts commit bebb12fd0e.
2012-06-15 11:55:59 +02:00
Harald Hoyer
3eca0cc846 TEST-50-MULTINIC: install correct nss libs 2012-06-15 11:12:46 +02:00
Harald Hoyer
9f6baa127a nfs: extend libnss wildcard 2012-06-15 11:12:08 +02:00
Harald Hoyer
f79e587cf3 dracut.sh: unset some variables 2012-06-15 11:11:30 +02:00
Harald Hoyer
1d2c070071 dracut.sh: output unknown argument 2012-06-15 11:11:10 +02:00
Harald Hoyer
7828692f97 dracut-functions.sh: fixup inst_libdir_file() again 2012-06-15 09:34:00 +02:00
Thomas Lange
cacaa90c63 Debian multiarch support
Hi Jon,

here's the diff which works for me.  The quotation marks around $@ do
not work for me. Instead of "$@" I must to use $_dir/$@ (or
"$_dir"/$@) but no quotation marks around $@. Could you please review
my patch.
2012-06-15 09:20:01 +02:00
Harald Hoyer
b23a2837db add PARTUUID as root=PARTUUID=<partition uuid> parameter 2012-06-14 13:04:22 +02:00
Will Woods
30430fbe30 ifcfg: fix output for ipv6 static addressing
IPV6 configuration is pretty different than IPV4; write out the correct
set of values to make static IPV6 addressing work.
2012-06-12 19:24:46 +02:00
Will Woods
50b08e7b85 fix ifup for static ipv6
"brd +" is not valid for ipv6. This causes the 'ip addr add' command to
fail with the message "Broadcast can be set only for IPv4 addresses".

So: don't use "brd +" for ipv6.
2012-06-12 19:24:46 +02:00
Harald Hoyer
43fed15129 dracut.sh: mkdir $initdir/lib/dracut 2012-06-12 11:35:49 -04:00
Harald Hoyer
bebb12fd0e network/ifup.sh: default to dhcp for BOOTIF 2012-06-11 17:11:49 +02:00
Harald Hoyer
b4692ce388 mdraid/md-shutdown.sh: check for presence of mdadm 2012-06-08 12:42:12 +02:00
Harald Hoyer
df96787019 dm: check for presence of dmsetup 2012-06-08 12:41:49 +02:00
Harald Hoyer
d2a9c4a8e7 dracut.sh: mkdir of $libdirs at then end 2012-06-08 10:42:38 +02:00
Harald Hoyer
fbaf1517c3 s/Unable to process initqueue/Could not boot/g 2012-06-08 10:29:35 +02:00
Harald Hoyer
57038a41fa mdraid/md-shutdown.sh: wait until md devices are clean 2012-06-08 10:28:31 +02:00
Harald Hoyer
521c57aca5 systemd/dracut-initqueue.sh: remove pre-trigger sourcing
Thanks ms77 on #dracut!
2012-06-07 11:31:45 +02:00
Harald Hoyer
ede0532c58 network/ifup.sh: do not default to dhcp, for interfaces without ip=...
Don't try to be smarter than the admin configuring the machine.
Does also conflict with other methods trying to setup the interfaces,
like cmsifup.sh from the cms module.
2012-06-07 10:51:39 +02:00
Harald Hoyer
547bbe4876 systemd: strip down the installation of some unused tools 2012-06-07 10:38:31 +02:00
Harald Hoyer
fe1484f3db modules are now only handled with /sys/modules and modules.dep
No more "find" and /proc/modules checking. We now rely entirely on
depmod and modules.dep
2012-06-06 18:20:35 +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
b6fd45163a kernel-modules/module-setup.sh: include omapdrm in the arm modules to include 2012-06-06 11:46:19 +02:00
Harald Hoyer
4d76a85df1 dasd_mod: change rd.dasd to dasd_mod kernel parameter 2012-06-05 20:27:27 +02:00
Harald Hoyer
d77540c8e4 get rid of libdir and usrlibdir 2012-06-04 15:23:15 +02:00
Harald Hoyer
784df1e4e3 version 019 2012-06-04 14:24:25 +02:00
Harald Hoyer
6d82d7bcd5 NEWS: dracut-019 2012-06-04 14:23:54 +02:00
Harald Hoyer
2614421601 dracut.sh: precopy some essential device nodes 2012-06-04 14:00:49 +02:00
Harald Hoyer
200e235dee systemd/dracut-pre-trigger.sh: fixed rd.udev.{debug|info} 2012-06-04 13:56:55 +02:00
Harald Hoyer
0636ce1a7f systemd/module-setup.sh: package udev in sysinit.target 2012-06-04 13:12:07 +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
14b43bcaee systemd: use pkg-config to determine the systemd directories 2012-06-04 12:55:32 +02:00
Harald Hoyer
c79f3883cd test/TEST-16-DMSQUASH: add check for python-imgcreate 2012-06-04 11:35:31 +02:00
Harald Hoyer
df42cd3dbd test/test-functions: check with test_check() if test is suitable 2012-06-04 11:35:02 +02:00
Harald Hoyer
01bbe8311a dracut.sh: do not rely on the presence of lib64, check with ldd 2012-06-04 11:33:29 +02:00
Cong Wang
21928b97b0 Handle multiple underlying devices of a bridge
A bridge device with only one underlying ethernet device is almost
useless, for sure we want to support a bridge with multiple
underlying devices.

This patch adds the support by extending <ethname> in the original
bridge= cmdline to a comma-separated list of ethernet interfaces.

Cc: Harald Hoyer <harald@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
2012-06-04 11:06:53 +02:00
Jesse Keating
e82e54df2c Don't set an already set attribute (#826357)
Depending on how the dasd_mod module was loaded, our device could have
already been marked as online or offline.  We need to make the sysecho
sensitive to this and not fail if the attribute we're trying to set has
already been set.
2012-06-04 11:06:13 +02:00
Harald Hoyer
ecc6da6bf5 99base/init.sh: kill systemd-udevd instead of udevd 2012-06-04 10:04:19 +02:00
Harald Hoyer
b35ff065ec base/loginit.sh: revert "quiet" patch 2012-06-04 03:09:09 -04:00
Harald Hoyer
187c355bf4 systemd: mkdir basic.target.wants 2012-06-04 03:08:24 -04:00
Harald Hoyer
70516a04fe TODO: update 2012-06-04 03:07:43 -04:00
Harald Hoyer
fcd65d2418 add README.testsuite 2012-06-01 18:51:47 +02:00
Harald Hoyer
9073ff54c1 fix return value of some installkernel() functions 2012-06-01 17:09:51 +02:00
Harald Hoyer
840d8e4733 add filesystem options to fsck_single()
if we have e.g. special btrfs options for "/" and "/usr", we want to use
those for the test mount to determine if the filesystem is corrupted.
2012-05-31 12:57:23 +02:00
Harald Hoyer
5ad3803dac crypt: add rd.luks.allow-discards and honor options in crypttab
also fixed the retry loop for rd.luks.key
2012-05-31 12:01:19 +02:00
Harald Hoyer
e04d02cc3a dracut-shutdown.service: do not unpack old initramfs on shutdown
Do not unpack the initramfs, if the old initramfs still exists.
2012-05-31 10:09:50 +02:00
Harald Hoyer
51153fb18c removed scsi_wait_scan from standard install 2012-05-31 09:14:17 +02:00
Harald Hoyer
2268e3a32a dasd_mod/parse-dasd-mod.sh: fixed dasd_mod param generation 2012-05-31 09:13:24 +02:00
Harald Hoyer
8b88dc7f71 network: do not arping with qeth layer3 interfaces
https://bugzilla.redhat.com/show_bug.cgi?id=825783
2012-05-29 17:39:17 +02:00
Harald Hoyer
eecb3d5552 url-lib/url-lib.sh: disable curl progress bar
https://bugzilla.redhat.com/show_bug.cgi?id=817301
https://bugzilla.redhat.com/show_bug.cgi?id=824883
2012-05-29 16:18:22 +02:00
Will Woods
f629355b2f add anaconda-style option parsing to ip_to_var
Anaconda used arguments of the form:

  ip=<ip> gateway=<gw> netmask=<nm>

for static IP configuration. So if we get a value for "ip" that's an IP
address, look for gateway= and netmask= and related args to fill in the
ip config vars.
2012-05-29 11:32:45 +02:00
Will Woods
78274fe2b4 do emergency_shell in die() if rd.debug=1
If I said 'rd.debug=1' I should get to debug the system before it dies,
right?
2012-05-29 11:32:45 +02:00
Will Woods
4744e27350 don't wait_for_loginit in emergency_shell()
wait_for_loginit ends the log; this is unhelpful if you're using
emergency_shell to do debugging.

Just leave loginit running. It doesn't hurt anything.
2012-05-29 11:32:45 +02:00
Will Woods
31cfc9aa5e dracut-lib.sh: add copytree(), use it where applicable
copytree() recursively copies the contents of SRC into DEST.

If DEST doesn't exist it is created; if it exists the contents of SRC
get merged into it (duplicate files are overwritten).
2012-05-29 11:32:44 +02:00
Cong Wang
a2ead9a486 Update the documentation of ifname= cmdline
The documentation about ifname= needs to update.

Cc: Harald Hoyer <harald@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
2012-05-29 11:18:51 +02:00
Cong Wang
db2b12fa91 Remove rd.neednet cmdline
rd.neednet could be removed, as we can check /tmp/net.ifaces.
After this patch, kdump can bring up the NIC without
rd.neednet.

Cc: Harald Hoyer <harald@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
2012-05-29 11:18:51 +02:00
Cong Wang
cbf66c5f06 Do not use ifenslave
ifenslave is an old tool, and could be dropped,
we can use the /sys interface.

Cc: Harald Hoyer <harald@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
2012-05-29 11:18:51 +02:00
Cong Wang
037984c80e Remove netroot check in cmdline parsing code
Relax the rules for kdump, we don't specify netroot in kdump.

Cc: Harald Hoyer <harald@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
2012-05-29 11:18:51 +02:00
Cong Wang
9337c692bc Add doc for birdge= cmdline
Document bridge= cmdline in dracut.cmdline(7).

Cc: Harald Hoyer <harald@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
2012-05-29 11:18:51 +02:00
Cong Wang
c438bdb0d2 Add doc for bond= cmdline
Document bond= cmdline in dracut.cmdline(7).

Cc: Harald Hoyer <harald@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
2012-05-29 11:18:51 +02:00
Cong Wang
144787fe30 Add doc for vlan= cmdline
Document vlan= cmdline in dracut.cmdline(7).

Cc: Dave Young <dyoung@redhat.com>
Cc: Harald Hoyer <harald@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
2012-05-29 11:18:51 +02:00
Cong Wang
8eb81d482c Add vlan support in network module
This patch adds basic vlan support in network module.

The cmdline syntax for vlan is:

	vlan=<vlanname>:<phydevice>

for an example:

	vlan=eth0.2:eth0

or
	vlan=vlan2:eth0

See also patch 2/8.

Cc: Harald Hoyer <harald@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
2012-05-29 11:18:51 +02:00
Harald Hoyer
0363998d0a base/init.sh: use info() instead of vinfo() for version info
Thanks to Cong Wang for the hint
2012-05-29 10:19:02 +02:00
Harald Hoyer
806572d058 systemd/module-setup.sh: add journalctl and systemctl 2012-05-29 09:17:43 +02:00
Cong Wang
81ea383998 Relax the rules for kdump, we don't specify netroot in kdump. 2012-05-29 09:17:01 +02:00
Juan RP
8442dc45b6 dmsquash-live: do not hardcode path to mount(8) in generated hook.
In some cases (at least in mine) mount(8) is in /usr/bin/mount and
not in /bin/mount as dmsquash-live-root.sh expects. PATH is set to
/usr/bin:/usr/sbin:/sbin:/bin in that script anyway.
2012-05-29 09:15:34 +02:00
Juan RP
cfede42fc3 modules.d/99base/init.sh: check for a valid init in case INIT is a symlink.
Obviously we have to test if it's executable with the PATH to NEWROOT.
2012-05-29 09:15:34 +02:00
Harald Hoyer
982d59afea drop 10rpmversion module and introduce /etc/initrd-release 2012-05-22 15:22:35 +02:00
Harald Hoyer
ca024e3378 renamed switch-root.{service,target} -> initrd-switch-root 2012-05-22 14:50:19 +02:00
Harald Hoyer
dbf8f6ba0e add dracut-version.sh 2012-05-22 14:32:36 +02:00
Harald Hoyer
02805bd1fc ifcfg/write-ifcfg.sh: fixed IFS resetting 2012-05-22 11:36:41 +02:00
Jesse Keating
965d14726a Normalize dasd argument content for dasd.conf
Also overwrite any existing files, contents from CMSCONFFILE override
any boot arguments.
2012-05-21 14:19:07 -07:00
Jesse Keating
b0772db56a Translate dasd arg contents into proper dasd.conf
This uses a (new) s390utils utility to normalize the range we might get
in a dasd argument and generates a properly formatted output for
dasd.conf.
2012-05-21 14:19:07 -07:00
Jesse Keating
d695143329 Use the right argument for dasd module options
The legacy argument is DASD=, and the new arguments should be the same
as the arguments for populating dasd.conf.  If multiple arguments are
passed we can stack them by inserting a ',' between them.
2012-05-21 14:19:00 -07:00
Dennis Gilmore
59aa65c9b2 ARM: make sure that we get the storage modules into the initramfs 2012-05-21 11:11:31 +02:00
WANG Cong
ffc5bf686d check ifenslave instead of brctl in parse-bond.sh
This is obviously wrong, ifenslave instead of brctl is needed for bonding.

Cc: Harald Hoyer <harald@redhat.com>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
2012-05-21 11:11:11 +02:00
Dave Young
ec3c59518d add option --printsize
Add --printsize for measuring module installed size to initramfs

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-05-21 11:11:03 +02:00
Harald Hoyer
cfe32ef5ba TEST-01-BASIC: sync after creating the root disk 2012-05-16 11:51:26 +02:00
Vivek Goyal
8be5a0fa94 dracut:fstab-sys: Wait for devices specified using --mount option
dracut allows passing --mount option which mounts the specified devices.
But it does not wait for these devices to show up and mounting will fail
if devices do not show up by the time "mount" was called.

I am writing some patches to support kdump on iscsi target and I noticed
that one of the initqueue script was not called as we found the root
device and broke out of main loop.

There are two possible enancements to this patch.

- Introduce a time limited wait (rd.timeout something along the lines of
  rd.retry). That will allow kdump to try to dump to a backup target if
  primary targets fails to come up.

- Wait for UUID= and LABEL= to show up too. Right now kdump converts
  UUID= and LABEL= to respective devices and passes /dev/* to dracut
  --mount option. So I am not introducing the wait for UUID= or LABEL=
 in this patch.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
2012-05-16 11:44:21 +02:00
Cong Wang
bd4be59fb2 check install files passed by cmdline
We should not trust cmdline passed by users, always
check the install files passed from cmdline. This restores
the old behaviour which was changed by:

	commit c6c6a08850
	Author: Harald Hoyer <harald@redhat.com>
	Date:   Tue Feb 7 18:26:30 2012 +0100

	    add "install_items" to dracut.conf

Reported-by: Dave Young <dyoung@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Harald Hoyer <harald@redhat.com>
2012-05-16 11:43:25 +02:00
Cong Wang
a6d3be9dd5 check kernel module existance
This patch adds check of kernel module existance and
propagate errors to upper callers.

In case of break other callers of instmods(), this patch
adds an option '-c' to it, only when "-c" is specified
we fail, otherwise, errors are ignored.

Reported-by: Dave Young <dyoung@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Harald Hoyer <harald@redhat.com>
2012-05-16 11:43:25 +02:00
Olivier Blin
40913ad219 90kernel-modules/module-setup.sh: install xhci-hcd
to allow booting and using kbd devices from USB 3.0
2012-05-16 11:43:25 +02:00
Harald Hoyer
afd1fd8d41 Makefile: install dracut service files from systemd dracut module 2012-05-16 11:29:48 +02:00
Harald Hoyer
38111b9622 systemd: store switch-root.conf in /run/initramfs
Store switch-root.conf in /run/initramfs/switch-root.conf, so that the
service does not fail in ExecPost after switching to the real root.
2012-05-16 11:24:42 +02:00
Harald Hoyer
41153ca4f2 systemd/switch-root.service: do not require shutdown and isolate to default
do not require shutdown.target and final.target

After switch-root isolate to the default target. This will load the
default target in the real root after systemd deserializes.
2012-05-16 11:22:28 +02:00
Harald Hoyer
3df2306981 systemd/switch-root.target: run target before switch-root.service 2012-05-16 11:21:33 +02:00
Harald Hoyer
022c5a802f systemd/dracut-pre-pivot.sh: s/udevd.service/systemd-udev.service/ 2012-05-16 11:20:59 +02:00
Harald Hoyer
832d85cbbc base/module-setup.sh: link /proc/self/mounts to $initdir/etc/mtab 2012-05-15 19:03:50 +02:00
Harald Hoyer
f72318243c systemd: adapt to new switch-root mechanism 2012-05-15 18:57:29 +02:00
Harald Hoyer
a82d207b8d ifcfg/write-ifcfg.sh: add s390 specific configuration options
https://bugzilla.redhat.com/show_bug.cgi?id=811521
2012-05-10 14:34:53 +02:00
Harald Hoyer
53e3244dba Makefile: call git2spec.pl with LANG=C 2012-05-10 14:30:31 +02:00
Brian C. Lane
37427748d1 Fail to boot if mediacheck fails (#817419)
The return value of checkisomd5 was being ignored.
2012-05-10 11:52:45 +02:00
Harald Hoyer
6e26f9b447 dracut.spec: add 98systemd module 2012-05-09 15:13:28 +02:00
Harald Hoyer
5bfbfbfc22 ifcfg/write-ifcfg.sh: use PREFIX for prefix netmask form
https://bugzilla.redhat.com/show_bug.cgi?id=820185
2012-05-09 14:58:52 +02:00
Harald Hoyer
2c431e8ec4 add systemd module 2012-05-09 13:36:07 +02:00
Harald Hoyer
8aeec251e3 rootfs-block/block-genrules.sh: install systemd mount unit 2012-05-09 13:15:32 +02:00
Harald Hoyer
f2d887d7d5 dracut.sh: install var/run and var/lock 2012-05-09 13:15:32 +02:00
Harald Hoyer
fe98cfee37 base/dracut-lib.sh: export UDEVVERSION 2012-05-09 13:15:32 +02:00
Harald Hoyer
cad10a7f80 base/init.sh: set DRACUT_QUIET only in dracut-lib.sh 2012-05-09 13:15:32 +02:00
Harald Hoyer
3734f4ae48 plymouth/plymouth-pretrigger.sh: get consoledev from /sys/class/tty/console/active 2012-05-09 11:05:40 +02:00
Harald Hoyer
4b13b2e2bf test/TEST-01-BASIC/test.sh: fix cleanup of overlay dir 2012-05-07 16:32:28 +02:00
Harald Hoyer
f6a58604a0 dracut.spec: require "file" 2012-05-07 16:28:44 +02:00
Harald Hoyer
65ceb56dd5 plymouth/plymouth-pretrigger.sh: check for tty dev existence 2012-05-07 16:28:16 +02:00
Harald Hoyer
cce69be668 removed old udev "vol_id" 2012-05-07 16:27:48 +02:00
Harald Hoyer
a54658c158 TODO: update 2012-05-04 11:32:48 +02:00
Will Woods
335bb5a35b ifcfg: fix resolv.conf
/etc/net.*.resolv.conf is not a useful filename; copy it to resolv.conf
2012-05-02 14:41:37 +02:00
Will Woods
982161e062 fix _getcmdline arg-duplicating bug with /etc/cmdline*
If you unset CMDLINE to make _getcmdline re-read /etc/cmdline and
/etc/cmdline.d/*, CMDLINE_ETC and CMDLINE_ETC_D would keep their
contents.

This is a serious problem if you have (e.g.) "ip=eth0:dhcp" in
/etc/cmdline.d/net.conf, because getargs ip= will return
"ip=eth0:dhcp ip=eth0:dhcp" and then parse-ip-opts.sh will die() because
you have two configurations for eth0.
2012-05-02 14:41:37 +02:00
Harald Hoyer
5a81678219 TEST-15-BTRFSRAID: add one more partition to the btrfs raid10 2012-04-25 15:58:40 +02:00
Harald Hoyer
168952cea6 udev-rules/module-setup.sh: fixed udevd location 2012-04-25 15:58:40 +02:00
Harald Hoyer
5dc1be1df8 multipath/module-setup.sh: fix host-only/mount checks 2012-04-25 15:58:40 +02:00
Harald Hoyer
cb08b0132f iscsi/module-setup.sh: fix host-only/mount checks 2012-04-25 15:58:40 +02:00
Harald Hoyer
eb6e141adb ifcfg: write DNS1=... for nameserver= args (RHBZ#815369)
If you're using a static network config, you'll want to keep your
nameservers around when NM starts. Write DNS1 (and DNS2, DNS3, etc..)
into the ifcfg file.

Thanks to Mark Hamzy <hamzy@us.ibm.com>
and Will Woods <wwoods@redhat.com> for the patch.
2012-04-24 13:08:57 +02:00
Harald Hoyer
c6c704fda6 network: fix ifup and netroot calling 2012-04-23 11:32:45 +02:00
Harald Hoyer
eef7649e71 merge "cleanup" and "pre-pivot-cleanup" hooks 2012-04-23 11:32:45 +02:00
Harald Hoyer
f8d50f60b3 base/dracut-lib.sh: add arguments for source_hook() and source_all() 2012-04-23 11:32:45 +02:00
Harald Hoyer
476eb1b345 base: add export_n() function
resembles export -n for dash
2012-04-23 11:32:45 +02:00
Harald Hoyer
c32908cee3 base: add debug_on() and debug_off() functions 2012-04-23 11:32:45 +02:00
Will Woods
dc1504121b url-lib: don't use --progress-bar if TERM=dumb (RHBZ#814713)
Basically, s390 is the only place I've ever seen TERM=dumb, and it's too
dumb to handle '\r', so --progress-bar produces waaaaay too much output.

The normal progress meter only prints something once per second, so
that's reasonable on terminals where '\r' doesn't work.

See also: https://bugzilla.redhat.com/show_bug.cgi?id=814713
2012-04-23 11:25:20 +02:00
Will Woods
c6a91ec992 url-lib: don't add existing handlers multiple times
Every time url-lib gets imported we end up making the list of handlers
longer with redundant entries. That's silly - we shouldn't add items
that already exist.

Note that this means you'll have to manipulate the handler list yourself
if you want to change the position/priority of existing handlers.
2012-04-23 11:25:20 +02:00
Harald Hoyer
689c3e1fcd network/parse-ip-opts.sh: remove check for netroot
with anaconda and all other kind of stuff, we might want network, even
for root not on the network
2012-04-19 16:41:04 +02:00
Dave Young
1bd76bf981 move cleanup scripts to pre-pivot-cleanup hook
below cleanup scripts is moved:
40network: kill-dhclient.sh
90crypt: crypt-cleanup.sh
90multipath: multipathd-stop.sh
95iscsi: cleanup-iscsi.sh
95nfs: nfsroot-cleanup.sh

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-04-19 11:59:45 +02:00
Dave Young
2e7257a2e3 add pre-pivot-cleanup hook
Sometimes some hook script will need to be before the cleanup hook scripts
For example dhclient killing, nfs cleanup, etc. must not happen before kdump
because it will use their fuctionalities.

So here introduce a new hook pre-pivot-cleanup, all cleanup scripts will go there.
that means pre-pivot hook is splited to two hooks pre-pivot and pre-pivot-cleanup

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-04-19 11:59:45 +02:00
Harald Hoyer
76b83902dc network/module-setup.sh: include all kernel/drivers/net/phy drivers 2012-04-19 11:59:39 +02:00
Harald Hoyer
2de297334b Makefile: do not install systemd service in reboot
shutdown is enough. It is pulled in on reboot.
2012-04-19 11:59:39 +02:00
Harald Hoyer
b4664769dc 99shutdown/shutdown.sh: export PATH 2012-04-19 11:59:39 +02:00
Harald Hoyer
7f217d7726 base/init.sh: mount tmpfs with strictatime 2012-04-19 11:59:38 +02:00
Harald Hoyer
8a1a2f6ca4 udevd moved to /lib/systemd/systemd-udevd 2012-04-19 11:59:38 +02:00
Colin Guthrie
bd66d2b59a man: Fix --add-fstab option in man page 2012-04-17 13:19:56 +02:00
Colin Guthrie
9f630a1889 Do not run plymouth hook if the binary is missing.
There is a remove-boot-splash script in Mageia that can
strip plymouth from an initrd. Make this script a noop
if that has happened.
2012-04-17 13:18:45 +02:00
Harald Hoyer
04ab68a4dd dracut.spec: do not include IMA and selinux modules with systemd 2012-04-17 12:13:40 +02:00
Lennert Buytenhek
a7c9cbe1a2 virtfs root filesystem support
Qemu/KVM provides virtfs, a paravirtualised filesystem that is
implemented by running the Plan 9 folder sharing protocol over
virtio.

Make booting with root=virtfs:foobar use the virtfs filesystem
with mount tag 'foobar' as root filesystem, to allow booting
virtual machines off virtfs.

Note that this only handles 9p over virtio (i.e. virtfs), and
doesn't attempt to handle mounting 9p filesystems over TCP/IP,
for example.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
2012-04-17 12:07:14 +02:00
Harald Hoyer
97903dfc47 dracut.cmdline.7.asc: document "resume=" option 2012-04-17 12:07:13 +02:00
Nikoli
25ff71b0c7 lsinitrd: support symlinks 2012-04-17 11:54:27 +02:00
Harald Hoyer
324be70f80 udev-rules: remove 01-ignore.rules 2012-04-17 11:54:27 +02:00
Peter Rajnoha
b8a81fb885 lvm: disable lvmetad
Currently dracut uses lvm.conf as found in the system and modifies only
global/locking_type setting. As there's a new feature introduced - the lvmetad
daemon, dracut should disable its use as well by setting "global/use_lvmetad=0"
(patch attached).

Otherwise, there's a warning message issued:

dracut: WARNING: Failed to connect to lvmetad: No such file or directory.
Falling back to internal scanning.

@@ -, +, @@
 modules.d/90lvm/lvm_scan.sh     |    2 ++
 modules.d/90lvm/module-setup.sh |    1 +
 2 files changed, 3 insertions(+), 0 deletions(-)
2012-04-16 14:46:53 +02:00
Harald Hoyer
0a35a80b93 dracut.sh: log installed modules to $initdir/lib/dracut/modules.txt 2012-04-16 14:46:53 +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
Daniel Drake
6625b74e90 rootfs-block: avoid remount when options don't change
Mounting, unmounting and then mounting a disk partition takes some
time.

On embedded systems such as OLPC XO where we disable fsck and fstab
reading, the root options are not going to change throughout the
mount_root() function, so remounting is time consuming and without
change.

Detect and optimize for this case so that the filesystem is only
mounted once.
2012-04-16 11:53:04 +02:00
Will Woods
bd3bf2ce41 shutdown: use emergency_shell from dracut-lib 2012-04-16 11:53:04 +02:00
Will Woods
f7cadaa843 Make splitsep work as documented with less vars than fields
According to its comment in dracut-lib.sh:

    splitsep ":" "one:all:the:rest" one two

should set two="all:the:rest". But there's no check to see if the
current field is the last field, so it just gets "all".
2012-04-16 11:53:04 +02:00
Will Woods
e173f0b384 network: add save_netinfo, fix problems with nfs->NM takeover
For NetworkManager to properly take over a NFS-root system, we need to
have the interface name(s) in /tmp/net.ifaces and save the dhclient
lease. This lets the ifcfg module do its magic.

save_netinfo should properly write out /tmp/net.ifaces when needed, and
copies the dhclient files into place.
2012-04-16 11:53:04 +02:00
Will Woods
1e4a880125 run setup_net at start of initqueue/online hook
This makes sure the network is active and ready to use during the
initqueue/online hook.

It also makes it so you can run setup_net repeatedly without causing
error messages.
2012-04-16 11:53:04 +02:00
Will Woods
d8f0e320c2 dracut-lib: add str_ends, to go along with str_starts 2012-04-16 11:53:04 +02:00
Harald Hoyer
76c14799da Makefile: version 018 2012-04-05 13:54:38 +02:00
Harald Hoyer
ef5c6eb927 NEWS: update 2012-04-05 13:54:38 +02:00
Harald Hoyer
50bc2253d3 do not use dracut shutdown, if something failed while unpacking
also require "xzcat"
2012-04-05 13:54:38 +02:00
Harald Hoyer
f5af0df821 Makefile: fix syncheck
skip dash syntax check, if bash found in shebang
2012-04-05 13:54:38 +02:00
Harald Hoyer
b80078af39 add s390 cms setup 2012-04-05 13:54:38 +02:00
Harald Hoyer
990e945ffd add mtu and macaddr to ip= 2012-04-05 13:25:41 +02:00
Harald Hoyer
8a5456e872 95nfs/nfs-lib.sh: add server-ip to nfs server search 2012-04-05 13:25:41 +02:00
Harald Hoyer
46a1738161 base/mount-hook.sh: add forgotten file 2012-04-03 17:32:52 +02:00
Harald Hoyer
6c3b8e2c17 dracut-lib.sh: emergency_shell() test for setsit --ctty option 2012-04-03 09:30:26 +02:00
Harald Hoyer
b48f5e847c iscsi: renamed rd.iscsi_param to rd.iscsi.param 2012-04-03 09:30:26 +02:00
Harald Hoyer
bdb818997d lsinitrd: handle LZMA file type 2012-04-03 09:19:48 +02:00
Harald Hoyer
fc87119069 TEST-20-NFS: get shell in test root for rd.shell 2012-04-02 09:03:25 +02:00
Harald Hoyer
078acb598b fips: fixed aes_generic module typo 2012-04-02 09:01:49 +02:00
Harald Hoyer
030b8a160f 90lvm/module-setup.sh: ignore DM_UDEV_DISABLE_DISK_RULES_FLAG=1
Ignore logical volumes, which have DM_UDEV_DISABLE_DISK_RULES_FLAG=1
set for the generation of hostonly cmdline parameter.
2012-03-30 10:48:37 +02:00
Harald Hoyer
0e979d4829 dracut-functions.sh:get_fs_env() bail out early
if udevadm found information about a device (DEVPATH set), then bail out
early, if ID_FS_TYPE was not set.
2012-03-30 10:47:35 +02:00
Harald Hoyer
66b750a08e dracut-functions.sh: fix get_fs_env() 2012-03-29 15:20:41 +02:00
Harald Hoyer
31b6f4a3ae dracut.sh:_get_fs_type() readlink devices to avoid dups 2012-03-29 15:16:28 +02:00
Harald Hoyer
a5cde2dd18 dracut-functions.sh: removed get_fs_uuid() and get_fs_type()
get_fs_uuid() and get_fs_type() are not used anymore
2012-03-29 14:56:46 +02:00
Harald Hoyer
2f6fe2ec79 dracut-functions.sh: no '' for shell regex 2012-03-29 14:38:45 +02:00
Harald Hoyer
e03c77cb5b dracut-functions.sh: proper return get_fs_env() and get_fs_type() 2012-03-29 14:37:41 +02:00
Harald Hoyer
b5c2fc1141 lsinitrd.sh: no "" for shell regex 2012-03-29 14:36:43 +02:00
Harald Hoyer
513d26f7b7 TEST-12-RAID-DEG/create-root.sh: settle after deconstruct 2012-03-29 14:36:20 +02:00
Harald Hoyer
f1354b8af9 fstab-sys: also include the module, if --add-fstab was specified
also fixup the logic what and when to mount.

first initramfs/etc/fstab is mounted

$NEWROOT/etc/fstab.sys takes precendence over initramfs/etc/fstab.sys
2012-03-29 12:54:50 +02:00
Harald Hoyer
b2de89c5dc 90dmsquash-live/dmsquash-live-root.sh: add symlink
/run/initramfs/livedev
2012-03-29 12:53:53 +02:00
Harald Hoyer
8d51acbbe9 iscsi: add rd.iscsi_param
rd.iscsi_param is directly handed over to iscsistart as a --param option
2012-03-29 12:04:26 +02:00
Harald Hoyer
ac3f1c6e87 add iscsi interface binding
iscsi connections can now be bound to <iscsi_iface_name> and <netdev_name>
2012-03-29 12:02:12 +02:00
Harald Hoyer
61c4c83235 90livenet/parse-livenet.sh: unset CMDLINE, after adding parameters 2012-03-29 11:40:16 +02:00
Harald Hoyer
85f8bb16b2 dracut-functions.sh: skip comment lines in fstab 2012-03-28 11:09:46 +02:00
Harald Hoyer
6dd4370eaa 95fstab-sys/mount-sys.sh: removed check for existing /dev
there are a lot of filesystems, which do not need an actual device node
2012-03-27 16:03:00 +02:00
Harald Hoyer
0441230c51 95fstab-sys/mount-sys.sh: removed bashism 2012-03-27 16:03:00 +02:00
Harald Hoyer
26433e9c1f 95nbd/nbdroot.sh: removed bashism 2012-03-27 15:59:35 +02:00
Amadeusz Żołnowski
4dd68ca415 document --tmpdir option 2012-03-26 14:40:53 +02:00
Amadeusz Żołnowski
882c4c5a48 add --tmpdir option to cmd line args and tmpdir to config file
Default temporary directory used by Dracut is /var/tmp, but users might
want to change it to /tmp.
2012-03-26 14:40:53 +02:00
Harald Hoyer
2b59885976 dracut.conf: add comment about /etc/dracut.conf.d 2012-03-26 14:37:39 +02:00
Harald Hoyer
cb74b38247 dracut.sh: add "--no-hostonly" option 2012-03-26 14:30:39 +02:00
Amadeusz Żołnowski
e7da9734d8 inst_symlink: create parent dir if doesn't exist
If symlink is yet alone in target directory, inst_symlink will fail to
create it.  This is how to reproduce the bug:

 # mkdir /tmp/test
 # ln -s /bin/cp /tmp/test/cp
 # ./dracut -l -f -H /tmp/test.img -I /tmp/test/cp

Result:

[...]

I: *** Including modules done ***
ln: failed to create symbolic link
`/var/tmp/initramfs.Z5isVu//tmp/test/cp': No such file or directory
ln: failed to create symbolic link
`/var/tmp/initramfs.Z5isVu//tmp/test/cp': No such file or directory
I: Wrote /tmp/test.img:

[...]

Following patch creates directory for the symlink if it doesn't exist.
2012-03-26 13:20:29 +02:00
Harald Hoyer
0cec230406 dracut.8.asc: format for 80 chars page width 2012-03-23 11:01:54 +01:00
Harald Hoyer
f06905139f dracut.8.asc: correct c&p error and add desciption of "--mount" 2012-03-23 11:01:25 +01:00
Harald Hoyer
56bf6156d6 99base/init.sh: revert the "cp" "mv" change for /run/initramfs 2012-03-22 17:05:20 +01:00
Will Woods
317191848a shutdown: fix PATH
Some systems might not use /bin:/sbin in their paths anymore, but we're
still using it in initramfs, so make sure our PATH is correct.
2012-03-22 13:43:03 +01:00
Harald Hoyer
3d3f32aea3 dracut.asc: set level down for the manpage includes 2012-03-21 17:40:08 +01:00
Wim Muskee
b7b062ba79 provide name based nbd connects
Because nbd-server also provides name-based exports instead of
port-based ones, make it possible to connect to those.
2012-03-21 13:06:49 +01:00
Daniel Drake
4e25cf6edf Avoid use of "export -n"
"export -n" is a bash extension, not part of POSIX, and is hence
incompatible with the busybox shell.

This was breaking boot when the busybox module was used.

Reimplement the scope change in a few lines of standard shell code.
2012-03-21 13:04:58 +01:00
Will Woods
5055abb615 98selinux/selinux-loadpolicy.sh: use mount --rbind for /dev
This preserves /dev/shm and /dev/pts for the selinux relabel.
2012-03-20 13:33:10 +01:00
Harald Hoyer
abbb76fe93 Do not mount --bind /run anymore
switch_root in util-linux 2.21 does mount --move /run also
2012-03-20 13:31:17 +01:00
Will Woods
478314a90e Make sure 'set -x' gets turned back on in wait_for_loginit
wait_for_loginit does set +x (to turn off debugging temporarily), but
sometimes it would return before turning it back on. Move the set +x
line to fix that, then use 'setdebug' to make sure we don't turn it back
on unless it was needed.
2012-03-15 10:20:10 +01:00
Will Woods
8cd592dfcb fix "execvp: No such file or directory" in emergency_shell
Older versions of setsid emit this message on stderr if you try to run
"setsid --help". Redirect it to /dev/null.
2012-03-15 10:20:10 +01:00
Harald Hoyer
d8eb522e80 TEST-01-BASIC: add setsid 2012-03-14 16:32:19 +01:00
Harald Hoyer
c3d81de59b remove openvt and use "setsid -c", if possible 2012-03-14 16:19:53 +01:00
Harald Hoyer
02aa795514 remove --ctty 2012-03-14 16:15:11 +01:00
Harald Hoyer
0884261283 NEWS: update 2012-03-14 16:00:42 +01:00
Harald Hoyer
f94ceb13b8 TEST-10-RAID: wait for udev settle before deconstructing 2012-03-14 15:52:35 +01:00
Harald Hoyer
4ce3a1b1bb precompile doc 2012-03-14 15:48:33 +01:00
Harald Hoyer
888d53f270 replace xml documentation with asciidoc 2012-03-14 15:48:33 +01:00
Harald Hoyer
dc824f1994 remove dracut-gencmdline 2012-03-14 15:07:20 +01:00
Harald Hoyer
3a00cf9ecc AUTHORS: update 2012-03-14 11:50:07 +01:00
Harald Hoyer
803be5aa50 README: added github and sourceforge git links 2012-03-14 11:48:48 +01:00
Will Woods
52c4c9484d Add 'live.updates' to livenet module
live.updates allows you to specify the URL for an "updates image" that
should be applied to the live runtime before switch_root.

The URL can be anything supported by url-lib (http, https, ftp, possibly
nfs) and the image can be anything supported by img-lib (xz/gzip
compressed cpio/tar, uncompressed cpio/tar, filesystem image, etc.)
2012-03-09 11:13:08 +01:00
Will Woods
7e60091c6b url-lib: clean up output
For curl_fetch_url (http/https/ftp):
- use --progress-bar (the output is less messy)
- print the URL we're fetching so the user know's what's happening

For curl and nfs:
- don't echo the filename if it was provided by the user
2012-03-09 11:13:08 +01:00
Will Woods
04febed782 img-lib: fix unpack_img()
- det_img should have been det_archive
- for ft=xz|gzip|bzip2, decompr should be "$ft -dc"
2012-03-09 11:13:08 +01:00
Dan Horák
2ff3fc73c8 install ctcm network module on s390
The ctcm module is not loaded automagically because it doesn't pass the
"ether_type_trans" test in 40net/module-setup.sh, so load it explicitly.
2012-03-08 14:38:53 +01:00
Harald Hoyer
d33d60774f dracut.spec: add 98pollcdrom 2012-03-08 13:40:21 +01:00
Harald Hoyer
f8208d682f 95iscsi/iscsiroot.sh: fix for empty $root 2012-03-08 12:26:00 +01:00
Harald Hoyer
0635530dda TEST-20-NFS/test.sh: fsck with "-a" 2012-03-08 12:25:30 +01:00
Will Woods
6e3cc00f48 add initqueue --env and "online" hook
The "online" hook runs whenever a network interface comes online (that
is, once it's actually up and configured).

The initqueue --env argument is used to set "$netif" to the name of the
newly-online network interface.
2012-03-08 11:05:29 +01:00
Will Woods
25aa3c5a6e network: refactor stuff from netroot/parse-ip-opts to net-lib
Add new functions: all_ifaces_up, get_netroot_ip, ip_is_local, ifdown,
setup_net, set_ifname, ibft_to_cmdline

Use them in netroot.sh and parse-ip-opts.sh.

There's also a couple little unrelated cleanups.
2012-03-08 11:01:40 +01:00
Harald Hoyer
4d518aec86 move wait_for_loginit() to dracut-lib.sh 2012-03-08 11:00:29 +01:00
Harald Hoyer
74db72dd0b 98pollcdrom: factored out the ugly cdrom polling in the main loop 2012-03-08 11:00:29 +01:00
Harald Hoyer
4fed3ddf16 add "initqueue/*" to hookdirs and create them in dracut itsself
now we can just use
    inst_hook initqueue/settled 99 "$moddir/pollcdrom.sh"
2012-03-08 11:00:29 +01:00
Harald Hoyer
b8a9dc2d3f TEST-20-NFS: use ext3 on server and fsck after kill 2012-03-08 11:00:29 +01:00
Harald Hoyer
2c0317213e get rid of /tmp/root.info 2012-03-08 11:00:29 +01:00
Harald Hoyer
5861184e87 ifup.sh: check for "-m" to set manualup 2012-03-08 11:00:29 +01:00
Harald Hoyer
6a2c23d125 dracut-functions.sh: check for .kernelmodseen dir, before using it 2012-03-08 11:00:29 +01:00
Harald Hoyer
af8c8ed9f6 40network/net-genrules.sh: move ifup in the initqueue 2012-03-08 11:00:29 +01:00
Will Woods
b43d651511 fix apply-live-updates failing because of /lib symlink
Since cp won't copy a directory over a symlink, any updates that were
supposed to go into e.g. /lib would get dropped if you had /updates/lib
as an actual directory, but the target system had /lib->/usr/lib.
2012-03-08 10:58:42 +01:00
Will Woods
66666c670a write-ifcfg.sh: add UUID=.. and save the lease files with the same uuid
As described in https://bugzilla.redhat.com/show_bug.cgi?id=541410#c2,
if you want NetworkManager to take over an interface that you're using
for NFS root (or other network root device), you need to:

a) set UUID=<uuid> in ifcfg-<iface>, and
b) save the lease file as /var/lib/dhclient-<uuid>-<iface>.lease

This patch should make write-ifcfg handle both these things.
2012-03-08 10:58:42 +01:00
Will Woods
d37ad6aea0 write-ifcfg.sh: cleanups
mkdir -p creates intermediate directories and never returns an error, so
we don't need to create the intermediate directories ourself.
2012-03-08 10:58:42 +01:00
Harald Hoyer
a3f00efc99 40network/kill-dhclient.sh: kill dhclient silently 2012-03-08 10:58:16 +01:00
Will Woods
8a0d2fc56f url-lib: make nfs support optional
Only include /lib/nfs-lib.sh if it exists, and then only run
add_url_handler if nfs-lib was imported.
2012-03-02 11:11:56 +01:00
Will Woods
ffcc64bdea move emergency_shell to dracut-lib.sh
This lets things running outside init call an emergency_shell.
(example: scripts called by initqueue)
2012-03-02 11:11:56 +01:00
Jan Stodola
778f767bcc Fix correct nfs path 2012-03-02 11:10:59 +01:00
Harald Hoyer
e12c1a8da1 dracut-functions.sh:install_kmod_with_fw() delay .kernelmodseen
first check for omit, then mark the kernel module as seen

when we temporarily omit_drivers, we don't want to mark them as seen.

example: nfs.ko module in kernel-modules, but the nfs module
should be able to load it later on.
2012-03-01 17:45:30 +01:00
Harald Hoyer
8d021e4b8a 90crypt/parse-crypt.sh: simplify rd.luks.uuid testing 2012-02-29 16:20:02 +01:00
Harald Hoyer
95268ffed3 30convertfs/convertfs.sh: correct check for /usr/bin 2012-02-29 13:30:30 +01:00
Harald Hoyer
9eded206c9 98usrmount/mount-usr.sh: check, if we have $NEWROOT/etc/fstab 2012-02-28 16:35:08 +01:00
Harald Hoyer
b642ce5340 98usrmount/mount-usr.sh: ignore comments in fstab 2012-02-28 12:54:01 +01:00
Harald Hoyer
34769a1445 TODO: update 2012-02-28 12:19:39 +01:00
Harald Hoyer
b7ddf6c1d8 make bzip2 optional 2012-02-25 17:22:02 +01:00
Harald Hoyer
cf38fc7389 10i18n/module-setup.sh: optimize install of all kbd files 2012-02-25 17:18:51 +01:00
Harald Hoyer
ddd01008ff 95terminfo/module-setup.sh: no need to call "find" 2012-02-25 17:09:15 +01:00
Harald Hoyer
7a5f1ee46a dracut.spec: require "hardlink" 2012-02-25 17:09:15 +01:00
Harald Hoyer
379c34d2cf dracut.sh/dracut-functions.sh: use a marker-dir for kernel modules
use "$initdir/.kernelmodseen" to mark kernel modules, which we already
handled with install_kmod_with_fw()
2012-02-25 17:09:15 +01:00
Harald Hoyer
334cc28327 dracut-functions.sh: instmods() print only filename instead of fullpath
do not print the full path, when we use "find" for kernel modules, but
rather only the filename.
2012-02-25 17:09:14 +01:00
Harald Hoyer
edea870c3c dracut-functions.sh: instmods() removed special case for "=ata" 2012-02-25 17:09:14 +01:00
Harald Hoyer
86191581d1 dracut-functions.sh: instmods(): replace egrep with shell code 2012-02-25 17:09:14 +01:00
Harald Hoyer
07f3e4f168 dracut-functions.sh: get_fs_env() replaced egrep with shell 2012-02-25 17:09:14 +01:00
Harald Hoyer
b6f0dcbda1 30convertfs/convertfs.sh: use hardlinks for inter-/usr cp 2012-02-25 16:06:38 +01:00
Harald Hoyer
5e5f3d5e6c 95nfs/module-setup.sh: removed "egrep" and "ls" calls 2012-02-25 16:06:16 +01:00
Harald Hoyer
25b36ef124 99fs-lib/module-setup.sh: removed "touch" 2012-02-25 16:05:51 +01:00
Harald Hoyer
f5a9e45923 Version 017 2012-02-24 15:38:08 +01:00
Harald Hoyer
1701d7adc8 30convertfs/convertfs.sh: add check for /usr/bin
Check if /usr is mounted, by checking for /usr/bin
2012-02-24 14:59:18 +01:00
Harald Hoyer
d18bc9070d dracut-functions.sh: optimize ldd 2012-02-24 14:59:18 +01:00
Harald Hoyer
86bf239ede dracut-functions.sh: only call ldd in find_binary() for "*.so*" 2012-02-24 14:59:18 +01:00
Harald Hoyer
d433da4473 dracut.sh: first install /usr dirs, then toplevel
This saves some checks in inst_dir.
2012-02-24 14:58:21 +01:00
Harald Hoyer
3249c257a0 dracut-functions.sh: optimized
get rid off lots of duplicated checks and code
2012-02-24 14:56:40 +01:00
Harald Hoyer
a6b63f9192 dracut.spec,Makefile: backward compat symlink for dracut-functions.sh 2012-02-23 12:26:16 +01:00
Harald Hoyer
b019d405d9 dracut.spec: changes for RHEL-6 2012-02-22 19:53:07 +01:00
Harald Hoyer
004fd0557d host-only checks corrected and kernel_only mode
In kernel_only mode, we don't want to write /etc/cmdline.d

Correctly return the check functions, so we have a valid return of
for_each_host_dev_fs().

mdraid and dmraid functions had wrong checkings for the filesystem
type.
2012-02-22 19:29:57 +01:00
Harald Hoyer
2efa546f26 dracut-functions.sh:for_each_host_dev_fs() return a value
for_each_host_dev_fs() now returns 0 if one func returned with 0
2012-02-22 19:06:00 +01:00
Colin Guthrie
0330b91987 lvm: Only activate a given vg+lv once.
Due to the way the main loop runs to detect partions, the same one
might be included twice (albeit via different symlinks.

This code simply prevents the same combo being activated twice.

A better fix might simply be to not include duplicate (after
resolving symlinks) entries in the host_fs_types variable.
2012-02-22 18:30:58 +01:00
Colin Guthrie
e0a38de881 mount-usr: Calculate and pass full fsck options when mounting /usr.
Edited-By: Harald Hoyer <harald@redhat.com>
2012-02-22 18:11:27 +01:00
Colin Guthrie
d06580986b fs-lib: No need to pass in _dev and _fop as they are inherited, not used as arguments. 2012-02-22 18:04:43 +01:00
Harald Hoyer
03a44f0bf0 git2spec.pl: detect renames 2012-02-22 16:14:38 +01:00
Harald Hoyer
8b6e099892 90kernel-modules/module-setup.sh: exclude nfs* lockd from standard
do not install nfs* lockd filesystems for the standard kernel modules
2012-02-22 16:14:38 +01:00
Harald Hoyer
34248c926c change omit_drivers to support regexp expressions 2012-02-22 16:14:38 +01:00
Harald Hoyer
14c47b0ee4 dracut.sh: do not install some files in installkernel
/etc/cmdline.d
/etc/fstab
2012-02-22 16:14:23 +01:00
Harald Hoyer
edd3262efd 40network/parse-ip-opts.sh: "local" can only be used in functions 2012-02-22 16:13:20 +01:00
Harald Hoyer
9cb8447c90 dracut-functions.sh:inst_library(): readlink source dir first
read link of the source dir, before convert_abs_to_rel()
2012-02-22 16:13:20 +01:00
Harald Hoyer
cc227886c6 dracut-functions.sh:inst_simple(): no inst_dir if dir exists 2012-02-22 16:13:20 +01:00
Harald Hoyer
6d2a7942aa dracut-functions.sh: set IFS only for variable setting 2012-02-22 16:13:20 +01:00
Harald Hoyer
43dfbeec7b dracut-functions.sh: turn off regexp for strstr() 2012-02-22 16:13:20 +01:00
Harald Hoyer
3335ed0ef4 dracut.sh: skip symlink dirs for prelink unlink 2012-02-22 16:13:20 +01:00
Harald Hoyer
b6e244f794 90kernel-modules/module-setup.sh: install modules.* in installkernel()
modules.* should be in the kernel initramfs
2012-02-22 15:15:22 +01:00
Harald Hoyer
14669e3a86 95nfs/module-setup.sh: whitespace fixup 2012-02-22 15:15:22 +01:00
Harald Hoyer
552ecca6db Renamed all shell scripts to *.sh 2012-02-22 15:15:21 +01:00
Harald Hoyer
9373aec650 TEST-30-ISCSI/test.sh: factor out client runs 2012-02-22 11:32:59 +01:00
Harald Hoyer
30befb85e3 .gitignore: add eclipse directories 2012-02-22 11:32:40 +01:00
Will Woods
ed293f6d0c url-lib: fix fetch_url return value for dotfiles
If you do "fetch_url $url/.somefile", fetch_url would return failure,
because "$outdir/*" wouldn't match the file.

Use ls -A (which busybox ls supports) to actually find possible dotfiles
in the created output dir.

Signed-off-by: Will Woods <wwoods@redhat.com>
2012-02-21 10:11:11 +01:00
Harald Hoyer
cd9592385d 98usrmount/mount-usr.sh: honor fs_passno in /etc/fstab
If the sixth field in /etc/fstab is "0" or not present for /usr, do not
run fsck.

This prevents fsck for nfs /usr also.
2012-02-20 17:28:58 +01:00
Harald Hoyer
7e2bca4820 dracut-functions: documentation and restructuring 2012-02-16 11:49:19 +01:00
Harald Hoyer
c4e48eaea1 dracut-functions: factor out all get_maj_min() variants 2012-02-16 11:48:17 +01:00
Harald Hoyer
3905f6695e TEST-30-ISCSI: add test case for "root=iscsi:...." and untabify 2012-02-16 11:37:21 +01:00
Harald Hoyer
2a3faa2df9 95iscsi: fix "root=iscsi:...." case
install udev rules and wait for /dev/root
2012-02-16 11:34:37 +01: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
Will Woods
c1df00d2c6 livenet: avoid spurious error message / wait_for_dev
If the user didn't request a livenet boot, don't print an error
and don't do wait_for_dev.

Signed-off-by: Will Woods <wwoods@redhat.com>
2012-02-16 11:21:34 +01:00
Dave Young
75cade1216 add function wait_for_route_ok
Manually setuping nic through udev is not always done when
we want network access. Here add a function wait_for_route_ok to
wait and make sure the network is accesible

[v1 -> v2]:
Harald: don't use bash syntax
Add check for [ -n "$li" ] because `ip route show` will show nothing probably

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-02-16 11:19:07 +01:00
Harald Hoyer
a2c631c0a3 Makefile: also link dracut-shutdown.service to shutdown target 2012-02-16 09:37:11 +01:00
Harald Hoyer
6bee336909 Version 16 2012-02-15 18:05:34 +01:00
Harald Hoyer
5c4bb360e3 dracut.spec: add missing modules 2012-02-15 17:59:46 +01:00
Harald Hoyer
969394f503 95nfs/nfs-lib.sh: do not bail out at sourcing in nfsroot_from_dhcp()
nfsroot_from_dhcp() returned with failure if one of
/tmp/net.$iface.override /tmp/dhclient.$iface.dhcpopts was missing
2012-02-15 16:39:41 +01:00
Harald Hoyer
4977febf46 s/bash/sh for all new *-lib.sh 2012-02-15 15:46:24 +01:00
Will Woods
285e81c9e2 add img-lib: a library for handling filesystem images
img-lib handles identifying and unpacking archives (uncompressed or
compressed) and filesystem images.

Currently tar and gzip are required; cpio and xz are optional, and bzip2
is supported but unused.

Signed-off-by: Will Woods <wwoods@redhat.com>
2012-02-15 15:46:24 +01:00
Will Woods
d663f5aeb0 add set_http_header to url-lib
This allows you to set custom headers for curl to send with HTTP
requests.

Signed-off-by: Will Woods <wwoods@redhat.com>
2012-02-15 15:46:24 +01:00
Will Woods
370329ca3b url-lib: add support for NFS
This adds nfs_fetch_url to allow fetching arbitrary files from NFS.

This means that livenet can now run using an NFS-mounted live image,
which reduces memory usage by a lot.

Signed-off-by: Will Woods <wwoods@redhat.com>
2012-02-15 15:46:24 +01:00
Will Woods
5978983b30 90livenet: port to url-lib
This makes the livenetroot module use url-lib for fetching its root
image/filesystem. There's also some minor tweaks for POSIX compliance.

Signed-off-by: Will Woods <wwoods@redhat.com>
2012-02-15 15:46:24 +01:00
Will Woods
753c82d0e6 add module 45url-lib
url-lib adds some functions for dealing with URLs (mostly for fetching
files, for the moment).

It uses curl to handle http/https/ftp URLs, but it can be extended by other
modules at runtime by using the "add_url_handler" function.

Signed-off-by: Will Woods <wwoods@redhat.com>
2012-02-15 15:46:24 +01:00
Will Woods
9fcfa04ca9 port nfsroot to nfs-lib
Rewrite nfsroot to use nfs-lib. The functionality should be unchanged.

Signed-off-by: Will Woods <wwoods@redhat.com>
2012-02-15 15:46:24 +01:00
Will Woods
9c463909d6 95nfs: add nfs-lib.sh
nfs-lib.sh contains a bunch of functions used to parse NFS "url"s of
various types, pull nfs information out of dhcp info, and actually
perform nfs mounts sanely.

Signed-off-by: Will Woods <wwoods@redhat.com>
2012-02-15 15:46:24 +01:00
Will Woods
9d169a07ce 40network: add net-lib.sh
net-lib.sh is a library of useful functions for network stuff.

More things may get added/moved here in the future.

Signed-off-by: Will Woods <wwoods@redhat.com>
2012-02-15 15:46:24 +01:00
Harald Hoyer
dee929cded 99base/init: removed redirection of mount errors to /dev/null 2012-02-15 15:46:24 +01:00
Harald Hoyer
e0e2fb26c9 90kernel-modules: removed hard-removal of "ocfs2"
put omit_driver+=" ocfs2 " in the distribution configuration file
2012-02-15 15:46:23 +01:00
Harald Hoyer
fcbcb2521c dracut: add "--omit-driver" 2012-02-15 15:46:23 +01:00
Harald Hoyer
28f0b27fb9 TEST-40-NBD: correct symlinks by rerunning ldconfig 2012-02-15 15:08:34 +01:00
Harald Hoyer
0ddc098eb0 TEST-12-RAID-DEG: improve test case 2012-02-15 15:08:29 +01:00
Harald Hoyer
11c0e7d44e 99base/init: reload udev rules after "pre-trigger" hook 2012-02-15 11:32:21 +01:00
Harald Hoyer
dfb08e9f1c removed now useless cleanup hooks
in Fedora 17, we unpack /boot/initramfs-$(uname -r).img
on shutdown for a pivot root to disassemble the root device
2012-02-15 10:08:59 +01:00
Harald Hoyer
e539fa9980 90mdraid: add "--offroot" support 2012-02-13 21:16:31 +01:00
Harald Hoyer
e76921a58e 95terminfo/module-setup.sh: check for terminfo/l/linux
on Fedora 17 the old check found /etc/terminfo, but this directory is
emtpy.
2012-02-13 21:15:51 +01:00
Harald Hoyer
96d22bd7d6 test: fixed terminfo location 2012-02-13 21:15:22 +01:00
Harald Hoyer
927d9273c4 Makefile: s/dracut-initramfs-backup.sh/dracut-initramfs-restore.sh/ 2012-02-13 18:20:12 +01:00
Harald Hoyer
56a4cffd30 98integrity/module-setup.sh: depend on selinux dracut module 2012-02-13 18:17:40 +01:00
Harald Hoyer
682a2a9d1a 90kernel-modules/module-setup.sh: add "ata_piix" to hardcoded modules 2012-02-13 18:16:48 +01:00
Harald Hoyer
0b1296aa4f dracut.xml: mention log_buf_len=1M for rd.debug 2012-02-13 18:16:28 +01:00
Harald Hoyer
fb67e4aa36 shutdown on demand
Do not save and restore the initramfs, but instead, just unpack the
default initramfs for shutdown on shutdown.
2012-02-13 07:08:08 +01:00
Harald Hoyer
4cfd24d179 Backup and restore /run/initramfs via systemd services
This saves the space /run/initramfs is taking for the shutdown
2012-02-10 11:14:31 +01:00
Harald Hoyer
81dcf7c90a 99shutdown/shutdown: don't do console_init on shutdown emergency 2012-02-09 14:16:31 +01:00
Harald Hoyer
075de7be45 98usrmount/mount-usr.sh: remove extra slash
otherwise we have /sysroot//usr in fstab
2012-02-09 13:58:49 +01:00
Harald Hoyer
7b2d3d995c dracut: honor binaries in sbin first 2012-02-09 13:58:13 +01:00
Harald Hoyer
d20d307d69 lsinitrd: silence xz test 2012-02-09 11:36:21 +01:00
Harald Hoyer
12018c91ea TEST-15-BTRFSRAID: write diskimage to tmp dir 2012-02-08 17:02:57 +01:00
Harald Hoyer
68910ba4a5 dracut: setup clean PATH w/o existing one 2012-02-08 17:02:17 +01:00
Harald Hoyer
a74eae77ac Version 15 2012-02-07 20:57:12 +01:00
Harald Hoyer
ce18bc4e97 30convertfs/convertfs.sh: call setfiles w/o path & check for existence 2012-02-07 20:57:12 +01:00
Harald Hoyer
567cc5d814 40network/net-genrules.sh: increase udev timeout 2012-02-07 20:52:14 +01:00
Harald Hoyer
56ac6c7e76 move all file removal cleanups to "cleanup" hook 2012-02-07 19:44:03 +01:00
Harald Hoyer
59feafc6c7 use "openvt" for emergency shell 2012-02-07 19:44:03 +01:00
Harald Hoyer
5ccc88a742 omit dash for fedora 2012-02-07 19:28:59 +01:00
Harald Hoyer
de247618e7 init/shutdown: use "command -v" instead of "type" 2012-02-07 19:28:59 +01:00
Harald Hoyer
c6c6a08850 add "install_items" to dracut.conf 2012-02-07 19:28:58 +01:00
Harald Hoyer
204db8a134 90btrfs/btrfs_finished.sh: put check in a function 2012-02-07 18:48:04 +01:00
Harald Hoyer
96b8d60a9b dracut: precreate "${initdir}/etc/cmdline.d" 2012-02-07 18:48:04 +01:00
Harald Hoyer
4951a1199d 99base/init: predefine path to init
if you add realinitpath="<path1> <path2>" to dracut.conf, then it will
be written to $initdir/etc/cmdline.d/distroinit.conf with
"rd.distroinit=<path1> rd.distroinit=<path2>" and evaluated by
99base/init, when it searches for init.
2012-02-07 18:48:03 +01:00
Harald Hoyer
76a80dff18 dracut-functions: handle relative symlinks with symlinked directories
"inst_symlink /bin/sh" was not correctly working if:

/bin -> /usr/bin
/bin/sh -> bash

it produced

/usr/bin/sh -> ../usr/bin/bash
2012-02-07 17:15:11 +01:00
Harald Hoyer
9ea901191e dracut-functions: simplify nosegneg path 2012-02-07 17:14:54 +01:00
Harald Hoyer
3bdc01c9a5 dracut-functions:inst_binary() bail out early if target exists 2012-02-07 17:13:32 +01:00
Harald Hoyer
e29d0b8b85 dracut-functions: use normal PATH for find_binary 2012-02-07 17:13:07 +01:00
Harald Hoyer
65fe8ae8a5 dracut: construct PATH with resolved symlinks 2012-02-07 17:11:58 +01:00
Harald Hoyer
4b691cccbe 95ssh-client/module-setup.sh: add executable bit 2012-02-07 12:18:52 +01:00
Dave Young
935b37ee8b auto setup network without netroot
Current dracut network only will be setup when netroot is used. But there are
some cases we need network even without netroot. For example kdump will need
copy vmcore to remote machine via scp or nfs mount. OTOH, if we use dracut as
a recovery system the network is helpful even root is not a network device.

This implementation is based on the manually bring up method. Here add a kernel
cmdline argument rd.neednet. If rd.neednet is set dracut will bring up network
with ifup $INTERFACE -m. If netroot is used we still keep original behavior.

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-02-07 12:14:22 +01:00
Dave Young
fe266c6c69 do not check dev node exist for fstab-sys mounting
in case nfs mounting do not check if $_dev exist

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-02-07 12:14:22 +01:00
Dave Young
c6655c4115 split nfs rpc daemons startup script
fstab-sys will mount nonroot nfs as well, so we need to split the necessary
code from nfsroot to start rpc daemon as hook script.

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-02-07 12:14:21 +01:00
Dave Young
65bb31a405 source dracut-lib.sh in nfs cleanup script
nfsroot-cleanup.sh need source dracut-lib.sh for function incol2

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-02-07 12:14:21 +01:00
Dave Young
cc78087b83 add nobody group for rpc.idmapd
Add nobody group due to rpc.idmapd will fail to startup without nobody group

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-02-07 12:14:21 +01:00
Dave Young
0fc2080294 fix fstab-sys module check
If /etc/fstab.sys does not exist installing fstab-sys module will fail.
Fix this by checking use_fstab and fstab_lines as well

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-02-07 12:14:21 +01:00
Dave Young
957bc5c92f allow ifup bring up network manually even without netroot
For kdump we need scp vmcore to remote machine, the nic to be used is
not limited to netroot one. we need a feature for manually bringing up
 network interface. Also it is useful for emergency shell with
ssh-client for recovery or test purpose

I implement this by adding one argument to ifup script, user can use
`/sbin/ifup eth0 -m` to bring up eth0, note ifup will regard it a
manual operation for the nic specified in 1st argument if there's
the 2nd argument.

If same nic is used for netroot the 2nd argument will be ignored,
in this case we will leave netroot bring up it automatically to
avoid side effect. And in this case hooks such as kdump will need to
execute after netroot mounted.

`ifup eth0 -m` will create /tmp/net.eth0.manualup stamp file,
later dhclient-script can check this and pass $2 to netroot,
then netroot script will bring eth0 up

Thanks for comments and suggestions from David Dillow.

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-02-07 12:14:21 +01:00
Cong Wang
418febfc44 btrfs: fix two bugs in module-setup.sh
First, $host_fs_types is an array.
Second, use strstr to match btrfs type.

Cc: Harald Hoyer <harald@redhat.com>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
2012-02-07 12:14:21 +01:00
Harald Hoyer
6aafdc5c04 90crypt/crypt-cleanup.sh: send unneeded output to /dev/null 2012-02-07 11:23:42 +01:00
Harald Hoyer
a178ca6b5c more cleanup in pre-pivot 2012-02-07 10:32:35 +01:00
Harald Hoyer
9d5e3ed740 30convertfs/convertfs.sh: move /var/run and /var/lock fix to the start
Even, if the system is already converted, we want to fix /var/run and
/var/lock.
2012-02-07 10:24:10 +01:00
Harald Hoyer
415d268051 btrfs_finished.sh: fix udevadm query 2012-02-07 10:23:29 +01:00
Harald Hoyer
43a8f6133d kernel-modules: add hid-logitech-dj to hardcoded hid devices
https://bugzilla.redhat.com/show_bug.cgi?id=786303
2012-02-03 12:03:36 +01:00
Harald Hoyer
437cecb967 dracut.spec: s/usrmove/convertfs 2012-02-03 11:56:15 +01:00
Harald Hoyer
61ad49e7d3 30convertfs/convertfs.sh: fix check for /var/run and /var/lock 2012-02-02 19:18:48 +01:00
Harald Hoyer
2cf328ad0a renamed usrmove to convertfs 2012-02-02 18:50:26 +01:00
Harald Hoyer
dfbb922ddb dracut-functions: install nosegneg libs additionally to standard ones 2012-02-02 18:25:49 +01:00
Harald Hoyer
fe51c4ab3c 30usrmove/usrmove-convert.sh: do not force selinux autorelabel 2012-01-30 14:06:39 +01:00
Harald Hoyer
e684ee786a fix kernel modules search for s390
forgot last ; in {}
2012-01-26 18:08:46 +01:00
Harald Hoyer
c416b1de5a fix kernel modules search for s390
find_kernel_modules_by_path only takes one parameter

fixes c254ac796f
and 4fcd5409e0
2012-01-26 17:30:06 +01:00
Harald Hoyer
e4d85a77aa dracut.spec: create compat symlink, instead of %ghost 2012-01-26 16:41:35 +01:00
Harald Hoyer
5ebad51b84 30usrmove/usrmove-convert.sh: rename duplicate libraries
ldconfig does not ignore the duplicate leftover libs with a .usrmove~
suffix, so we rename ".so" to "_so".
2012-01-26 15:37:50 +01:00
Harald Hoyer
6334ffdbb0 usrmove: install missing binaries and "set -x" only for rd.debug 2012-01-26 13:55:50 +01:00
Harald Hoyer
4cbc0c79ac dracut.spec: add compat symlinks to /sbin 2012-01-26 12:52:17 +01:00
Harald Hoyer
ae8b82e395 add usrmove module 2012-01-26 12:21:45 +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
Will Woods
a2a74022e2 netroot: actually run netroot hooks
The line "source_all netroot" was trying to source netroot hooks from
/netroot, which doesn't exist, so netroot hooks were never executed.

Signed-off-by: Will Woods <wwoods@redhat.com>
2012-01-25 09:45:54 +01:00
Harald Hoyer
ba7fa583bf 99base/init: remove tmpfs on /dev
tmpfs on /dev is not supported anymore and devtmpfs is supported in
kernels for a long time.
2012-01-23 16:08:46 +01:00
Harald Hoyer
5f282199c8 90crypt/module-setup.sh: prepend "luks-" to hostonly cmdline file 2012-01-23 13:50:27 +01:00
Harald Hoyer
74132a10f3 dracut-functions: get_maj_min() major and minor was swapped 2012-01-23 13:50:05 +01:00
Harald Hoyer
4f10ae2b86 dracut: _get_fs_type() also handle /dev/block/maj:min 2012-01-23 13:49:39 +01:00
Harald Hoyer
4fcd5409e0 iscsi/multipath: also search in drivers/s390/scsi 2012-01-23 12:35:41 +01:00
Cong Wang
a29cf54c02 fix rpm build error after adding ssh-client module
This patch fixes the following error when building rpm,

      error: Installed (but unpackaged) file(s) found:
       /usr/lib/dracut/modules.d/95ssh-client/module-setup.sh

Based on my kdump tree.

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
2012-01-23 11:43:18 +01:00
Harald Hoyer
c254ac796f 40network: also look in drivers/s390/net for network drivers
https://bugzilla.redhat.com/show_bug.cgi?id=782074
2012-01-23 11:41:44 +01:00
Harald Hoyer
1b91369455 98usrmount/mount-usr.sh: do not mount /usr read-only
https://bugzilla.redhat.com/show_bug.cgi?id=782897
2012-01-23 11:32:29 +01:00
Harald Hoyer
ccaa9bee2e dracut, dracut.8.xml: added more documentation about "[LIST]"
added examples on how to use [LIST] on the shell command line.

https://bugzilla.redhat.com/show_bug.cgi?id=767736
2012-01-23 11:26:17 +01:00
Harald Hoyer
6769292c0d AUTHORS: updated and fixed .mailmap 2012-01-23 11:06:16 +01:00
Ian Dall
da55af4763 network/dhclient-script: set FQDN
When booting with nfsroot, dracut doesn't necessarily set the initial
hostname correctly.

According to dhcp-options(5), the name may or may not be qualified with
the local domain. It goes on to say "it is preferable to use the
domain-name option to specify the domain name".

So dhclient-script needs to be able to handle the cases: a) where
host-name is fully qualified and domain name is also specified; b)
where hostname is fully qualified and the domain is not separately
specified; c) where host-name is "short" and domain-name is also
specified; and d) do its best where host-name is short but domain-name
is not specified.

The dhclient-script in initramfs does not handle case "c", apparently
the preferred situation properly, setting hostname to "short".

https://bugzilla.redhat.com/show_bug.cgi?id=756347
2012-01-23 10:47:38 +01:00
Harald Hoyer
39339512e2 plymouth/kernel: cleanup not needed parts for shutdown
remove plymouth and kernel parts from /run/initramfs, which are not
needed at shutdown.

https://bugzilla.redhat.com/show_bug.cgi?id=751189
2012-01-23 10:41:41 +01:00
Harald Hoyer
c96425c364 lsinitrd: use xz with --single-stream, if available
The F16 installation image is two concatenated cpio images:
[xz-compressed dracut initramfs][uncompressed cpio with /squashfs.img]

So to show the contents, use xz with the "--single-stream" option.

https://bugzilla.redhat.com/show_bug.cgi?id=742299
2012-01-23 10:35:26 +01:00
Harald Hoyer
1fcf2d2f4a dracut: unset GREP_OPTIONS
GREP_OPTIONS can influence the image creation, if set to user defined
values, so unset it.

https://bugzilla.redhat.com/show_bug.cgi?id=676712
2012-01-23 10:11:04 +01:00
Cong Wang
3ea5d2e28f lsinitrd: add '-s' option to sort the initrd output by file size
This is useful to analyse which files consume the space of initrd.

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
2012-01-23 10:00:43 +01:00
James Buren
7fffc9f11f add xz compression for kernel modules 2012-01-23 09:59:39 +01:00
James Buren
e38fcc8608 plymouth: add xz support for kernel modules
This rewrites a portion of the module to support xz, as well as allow
an easier expansion should future compression methods for kernel
modules ever materialize.
2012-01-23 09:59:35 +01:00
Dave Young
b93aaba84f --ctty: add help line in usage
Adding missed help line in usage

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-01-23 09:48:35 +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
Dave Young
85bb744dfe change root home dir to /root
ssh need to read knownhosts from home directory, so change root home to /root

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-01-23 09:48:35 +01:00
Michal Soltys
4401925c82 Add job control support to emergency shell
Option --ctty will optionally add setsid binary to dracut's image.

During runtime, if rd.ctty is set and is a character device,
emergency shells will be spawned with job control.

in case no ctty was provided, shell was spawned without caring about
/dev/console. Also, the ctty is more opportunistic. If the image was
generated with --ctty, we will fallback to /dev/tty1 if rc.ctty is
invalid or missing. Otherwise we spawn standard shell on /dev/console

[dyoung@redhat.com: Rebased to usrmove branch]

Signed-off-by: Michal Soltys <soltys@ziu.info>
Signed-off-by: Dave Young <dyoung@redhat.com>
2012-01-23 09:48:35 +01:00
Dave Young
59ee80764e deal common part of etc passwd in 99base
ssh module will need root user in /etc/passwd, so add root and nobody
to /etc/passwd in 99base instead of nfs module

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-01-23 09:48:35 +01:00
Cong Wang
8e1ffb1859 remove extra semicolons in dracut.8.xml
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
2012-01-23 09:48:35 +01:00
Anton Blanchard
e7cbf8fd30 ip= server-id should be server-IP
From looking at the code it seems like server-id should really
be named server-IP.
2012-01-23 09:48:35 +01:00
Anton Blanchard
b3d838e5d0 server-id in ip= is not optional
The documentation suggests that server-id is an optional argument
but ip_to_var fails if it is not specified. Fix the documentation.
2012-01-23 09:48:35 +01:00
Anton Blanchard
acfab3733f Handle upper case MAC addresses in ifname option
While the documentation states that ifname MAC addresses must be
lower case, we silently accept upper case ones and fail later on
when udev doesn't rename the device.

Instead of adding sanity checking on the MAC address just convert
it to lower case and remove the requirement completely.
2012-01-23 09:48:34 +01:00
Harald Hoyer
2e7b661681 90kernel-modules/module-setup.sh: install modules.order
Also install modules.order and all modules.builtin*
2012-01-20 12:06:41 +01:00
Harald Hoyer
027dbc9f85 dmsquash-live: really changed /dev/live-baseloop to /run/initramfs/
Forgot to amend my change to ce32e32f2a
2012-01-20 12:02:15 +01:00
Peter Robinson
e263867f6b mktemp was long obsoleted by coreutils
commit 2e55bb35640c5c2b3b5604e06232cc679559defa
Author: Peter Robinson <pbrobinson@gmail.com>
Date:   Wed Jan 11 10:28:05 2012 +0000

    mktemp was long obsoleted by coreutils

 dracut.spec |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
2012-01-17 10:55:35 +01:00
Hermann Gausterer
0de93fa1da typo fix
Signed-off-by: Hermann Gausterer <git-dracut-2012@mrq1.org>
2012-01-17 10:55:35 +01:00
Dave Young
a996d703e9 fstab-sys: mount it in initramfs instead of newroot if mount point is not found
fstab-sys now also handles device passed by dracut argument "--mount"
The "--mount" mount point is possible not exist in $NEWROOT. Thus mount it
in initramfs if mount point is not exist in real rootfs
2012-01-13 11:50:53 +01:00
Will Woods
a75c3afe68 minor cleanups in parsing for dmsquash-live and livenet
- use wait_for_dev in livenet
- clarify log message and fix missing newline in dmsquash-live

Signed-off-by: Will Woods <wwoods@redhat.com>
2012-01-13 11:50:53 +01:00
Will Woods
1cc57edaf5 interpret 'off' as false in getargbool
Signed-off-by: Will Woods <wwoods@redhat.com>
2012-01-13 11:50:53 +01:00
Brian C. Lane
ce32e32f2a Create a symlink for the live image's base loop device
It is useful to know that loop device that the live image's / is mounted
from. Make a /run/initramfs/live-baseloop symlink that points to it.

Edited-By: harald@redhat.com: changed /dev/live-baseloop
                              to /run/initramfs/live-baseloop
2012-01-13 11:38:48 +01:00
Cong Wang
a72cae66dc lvm: pass the correct rd.lvm.lv parameter
rd.lvm.lv accepts ${DM_VG_NAME}/${DM_LV_NAME}, not ${DM_LV_NAME}.

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
2012-01-13 11:35:49 +01:00
Cong Wang
eead773204 nfs: fix regex patterns in check()
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
2012-01-13 11:35:49 +01:00
Cong Wang
d0096de764 Pass device name instead of major:minor in for_each_host_dev_fs()
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
2012-01-13 11:35:49 +01:00
Cong Wang
426b68b20a Fix get_maj_min() to follow symlink
Otherwise get_maj_min /dev/mapper/vg_cr0-lv_home will return 0:0.

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
2012-01-13 11:35:49 +01:00
Cong Wang
1b7fd0fa3e Check module dependencies of mount points
Like -H, we need to poll every module to check if it is needed
to mount a specific device in '--mount'.

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
2012-01-13 11:35:49 +01:00
Cong Wang
cd7ff122a4 Allow to add mount points even not in hostonly mode
Don't force --mount only working in hostonly mode, let users decide.
With this patch, people can still combine -H --mount '...' if they
want to use it in hostonly mode.

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
2012-01-13 11:35:49 +01:00
Harald Hoyer
cf5229190d TEST-10-RAID: fixed TESTDIR handling 2012-01-13 11:33:22 +01:00
Duane Griffin
345f9fa77e 98usrmount/mount-usr.sh: Don't pass mount options to fsck 2012-01-13 10:23:45 +01:00
Colin Guthrie
62073c3048 udev: Attempt to install any programs used by udev rules. 2012-01-09 13:34:51 +01:00
Colin Guthrie
54f1a77fb6 init: Fix bogus message about invalid root device.
When the initqueue cannot be processed, it might be about an invalid
root device (in which case a separate message produced via
wait_for_dev() should be displayed anyway), but it could also
be for any other reason (e.g. /dev/resume not existing).

Therefore, it is best to use a more generic error message.

Also a minor tab->space conversion in the near vacinity of
the real change.
2012-01-09 13:34:40 +01:00
Colin Guthrie
09ee7234b6 dmsquash: Ensure the 'loop' kernel module is included and loaded. 2012-01-09 13:34:17 +01:00
Colin Guthrie
f65b874bda resume: Fix failure when invalid device passed via 'resume='
This commit allows the waiting for a device to be cancelled.
When the resume partition does not exist, it becomes quite hard
to work out what to do (you have to either create the
/dev/resume symlink manually, or remove the 'finished' job
that is waiting for it). Additionally dracut incorrectly
displays a message about not being able to find the root
device, which is bogus and misleading.

This commit should just bail on the whole resume thing
if the device cannot be found and proceed with a normal boot.
2012-01-09 13:33:13 +01:00
Colin Guthrie
5d55ceb75c btrfs: Ensure crc32c module is installed.
As outlined here:
 https://bugs.mageia.org/show_bug.cgi?id=3214
and:
 https://bugs.launchpad.net/ubuntu/+source/linux-linaro-omap/+bug/715835
the btrfs module needs a CRC implementation.
2012-01-09 13:32:36 +01:00
Colin Guthrie
fa20c18525 kernel-modules: Find (and ulitmately dereference) any symlinks in modprobe.d dir.
Also only do the top level of files (ignore any subdirs and files within)
2012-01-09 13:29:24 +01:00
Anssi Hannula
5fae9d9a20 plymouth: Include kms modules even if they are not currently loaded.
This should fix initial initrd generation during install.
If the modules are not desired to be used, the nokmsboot kernel
command line should disable them.
2012-01-09 13:28:29 +01:00
Colin Guthrie
482c573d9e Only install files from /etc/ld.so.conf.d/ directory
When calling inst_simple() it will ignore anything that
is not a file, so harden the check done before the calling.
2012-01-09 13:26:57 +01:00
Colin Guthrie
7835e1465f Handle compressed kmods.
This was orignally from Mandriva patch: dracut-011-plymouth-compressed-kmod.patch
2012-01-09 13:26:06 +01:00
Colin Guthrie
95023eb325 Fix Unicode keytable.
This patch was originally from Mandriva: dracut-013-fix_unicode_keytable.patch
2012-01-09 13:25:12 +01:00
Colin Guthrie
39f87ab2ab mkinitrd: Mention the --nocompress option in help output
Originally from Mandriva patch: dracut-010-mkinitrd.patch
2012-01-09 13:23:47 +01:00
Harald Hoyer
dcba56cafa Makefile: dash does not like {} expansion
removed {} expansion for mandir mkdir for users, which have dash as
/bin/sh
2012-01-05 14:48:57 +01:00
Harald Hoyer
5e90d26658 Makefile: set bindir to ${prefix}/bin rather than sbin 2012-01-05 14:36:45 +01:00
Brian C. Lane
14599cd760 Fix live update script (#769970)
pushd and popd are not available in the shell used by dracut.
2012-01-05 11:02:04 +01:00
Harald Hoyer
e74167bd6a mkinitrd-dracut.sh: s/read_args/read_arg/g
https://bugzilla.redhat.com/show_bug.cgi?id=771106
2012-01-05 10:51:00 +01:00
Harald Hoyer
70cb8a686f dracut: add --add-fstab and --mount option
--add-fstab [FILE]    Add file to the initramfs fstab
--mount "[DEV] [MP] [FSTYPE] [FSOPTS]"
                      Mount device [DEV] on mountpoint [MP] with filesystem
                      [FSTYPE] and options [FSOPTS] in the initramfs
2011-12-15 14:49:20 +01:00
Harald Hoyer
bb61d657c1 99base/dracut-lib.sh: added inst_mount_hook add_mount_point
inst_mount_hook <mountpoint> <prio> <name> <script>

Install a mount hook with priority <prio>,
which executes <script> as soon as <mountpoint> is mounted.

add_mount_point <dev> <mountpoint> <filesystem> <fsopts>

Mount <dev> on <mountpoint> with <filesystem> and <fsopts>
and call any mount hooks, as soon, as it is mounted
2011-12-15 14:49:05 +01:00
Harald Hoyer
5112bfc8cc TEST-12-RAID-DEG: mkdir /run 2011-12-15 14:49:05 +01:00
Harald Hoyer
828feae4f1 dracut.spec: remove unnecessary dependencies
Since the initramfs generation is done in %postrans of the kernel rpm,
we can drop all hard requirements.

Also make some requirements a conflict to express the version
dependency.
2011-12-15 14:49:04 +01:00
Harald Hoyer
4d63882615 99base/dracut-lib.sh: killproc, prefix local variables 2011-12-15 14:49:04 +01:00
Harald Hoyer
43f2185221 95iscsi/iscsiroot: unset used variables before starting
If iscsiroot is called multiple times, then some variables can hold the
values of a previous call, so unset all variables before using them.

https://bugzilla.redhat.com/show_bug.cgi?id=752066
2011-12-15 14:49:04 +01:00
Harald Hoyer
480d772f22 */module-setup.sh: use host_fs_types host_devs
For the $hostonly case, use $host_fs_types and $host_devs to determine,
if a module has to be included in the initramfs.
2011-12-15 14:49:03 +01:00
Harald Hoyer
7ae5d9d11d dracut: export host_fs_types host_devs
Determine devices and filesystems to be included in the host-only
initramfs image.

To get a minimal initramfs, which can mount
 /
 /etc
 /usr
 /usr/bin
 /usr/sbin
 /usr/lib
 /usr/lib64
 /boot
we look in fstab for the corresponding devices and determine their and
their slaves' filesystem type and put all that in $host_fs_types
and $host_devs.
2011-12-15 10:33:26 +01:00
Harald Hoyer
ef8b121e2c version 014 2011-12-15 09:19:05 +01:00
Harald Hoyer
76bba2a1fc dracut.spec: only apply patches, if there are any 2011-12-15 09:19:05 +01:00
Harald Hoyer
45abddb069 renamed dracut.kernel.7 to dracut.cmdline.7 2011-12-15 09:19:04 +01:00
Harald Hoyer
f74775ba1c 99fs-lib/fs-lib.sh: handle nfs as nop
handle fstype=nfs for fsck and let it be a nop
2011-12-15 08:54:49 +01:00
Harald Hoyer
1939a4f96e 99fs-lib/fs-lib.sh: accept "UUID=" and "LABEL=" for fsck_single
with the reuse of crypt-lib.sh devnames() and putting it in
dracut-lib.sh, fsck_single() can use more generic names from /etc/fstab
2011-12-15 08:54:48 +01:00
Harald Hoyer
452e46dbfc 90mdraid/mdraid-waitclean.sh: add rd.md.waitclean parameter
add rd.md.waitclean parameter, which defaults to 0
https://bugzilla.redhat.com/show_bug.cgi?id=759148
2011-12-02 13:03:02 +01:00
Colin Guthrie
7eb8797b81 Fix /usr mounting due to variable name typo 2011-12-02 13:03:01 +01:00
Harald Hoyer
ed919de0a7 dracut.spec: move sbindir from /sbin to /usr/bin
https://fedoraproject.org/wiki/Features/UsrMove
2011-12-02 13:03:01 +01:00
Harald Hoyer
c5a6599080 Makefile, dracut.spec: move dracut to /usr/lib/dracut
Move dracut to /usr/lib/dracut.
We should not have picked /usr/share/dracut. Dracut is no ordinary "data".
2011-12-02 13:03:00 +01:00
Harald Hoyer
a9e8ca4ab4 git2spec.pl: strip path from patches 2011-11-17 11:03:08 +01:00
Harald Hoyer
a1abd64aff 90mdraid: wait for md devices to become clean
After assembling all devices, just wait for the raid devices to become
clean, before booting further.
2011-11-17 10:14:23 +01:00
Amadeusz Żołnowski
2799897ad8 Makefile: Append target files names for man pages.
Edited-By: harald@redhat.com: removed trailing whitespace
2011-11-16 15:32:07 +01:00
Harald Hoyer
191f6945ac test: moved TEST-14-IMSM to old.TEST-14-IMSM
TEST-14-IMSM does not work anymore in qemu instances
2011-11-16 14:05:57 +01:00
Harald Hoyer
0be1785aea test: introduce $TESTDIR tmpdir
to keep the git source tree clean, test files are now created in a
$TESTDIR created with mktemp.
2011-11-16 14:04:27 +01:00
Harald Hoyer
bf7487ab18 90dmsquash-live: wait for the /dev/mapper/live-rw device
wait for the /dev/mapper/live-rw device
2011-11-16 14:03:38 +01:00
Harald Hoyer
4e05cb4023 cryptroot-ask.sh: use key file, if specified in crypttab and present
if a key file is specified in crypttab and present in the initramfs use
it to open the device.

https://bugzilla.redhat.com/show_bug.cgi?id=751640
2011-11-16 11:42:09 +01:00
Harald Hoyer
dd03dea22e 90mdraid: remove mdadm_auto.sh completly
remove mdadm_auto.sh completly, because "mdadm -As --auto=yes" does not
add new appearing devices.
2011-11-16 10:50:21 +01:00
Harald Hoyer
0ec40e08d5 dracut: add install_items to dracut.conf
install_items+=" <file>[ <file> ...] "

    Specify additional files to include in the initramfs, separated by
    spaces.
2011-11-15 17:13:40 +01:00
Harald Hoyer
d1b7efd578 40network/ifup: add "brd +" to "ip addr add"
Unlike "ifconfig", the "ip" command does not set a broadcast address
unless explicitly requested.

add "brd +" to make "ip" calculate the broadcast address on the fly
2011-11-15 11:54:14 +01:00
Harald Hoyer
d00f97a7db 40network: check for brctl
if a bridge is configured on the kernel command line and brctl is
missing call die()
2011-11-15 09:47:29 +01:00
Harald Hoyer
7e800bfffc 99base/dracut-lib.sh: wait_for_if_up() extend wait time
Some NICs take longer than 2 seconds to ifup. Wait a little bit longer
now (20s).
2011-11-15 09:47:29 +01:00
Harald Hoyer
f6783bee07 95fcoe: support bnx2fc
To start bnx2fc, we need to run fipvlan only and not dcbtool.  DCBX is run
automatically in the hardware, but VLAN discovery needs to be started by
fipvlan.

https://bugzilla.redhat.com/show_bug.cgi?id=736094
2011-11-15 09:47:28 +01:00
Harald Hoyer
760dcc6a65 lvm, dm, dmraid: cleanup, which module installs what
The dm module, which lvm and dmraid depend on, installed dmraid
shared libs. The lvm module installed udev rules, which were
already installed by the dm module.
Cleaned up those issues.
2011-11-15 09:47:28 +01:00
Harald Hoyer
2e1b9171bf 02fips-aesni: add fips with aesni-intel
add this dracut module, if you want to start in FIPS mode with
the aesni-intel kernel module
2011-11-15 09:47:26 +01:00
Harald Hoyer
ef6900eb79 dracut: create var/log directory in the initramfs
https://bugzilla.redhat.com/show_bug.cgi?id=701864
2011-11-15 09:47:26 +01:00
Harald Hoyer
3fa9d4d717 95iscsi: add iscsiuio
install iscsiuio
start iscsiuio
stop iscsiuio before switching root
2011-11-15 09:47:25 +01:00
Harald Hoyer
ecf9496d17 95iscsi/parse-iscsiroot.sh: force load a lot of kernel modules
A lot of iSCSI driver are not autoloaded, so we have to manually
force load them.
2011-11-15 09:47:24 +01:00
Harald Hoyer
50acb19719 95iscsi/iscsiroot: use initiator-name from ibft firmware if unset
If initiator-name is unset, try to read it from the ibft firmware.
2011-11-15 09:47:23 +01:00
Harald Hoyer
745af91663 dracut-lib.sh: add killproc() 2011-11-15 09:47:22 +01:00
Harald Hoyer
87af1cba3c 50plymouth/plymouth-pretrigger.sh: respect primary console setting
The kernel's primary console device is determined by the last "console="
argument on the kernel command line. This setting should be respected by
dracut-generated initial RAM disks.

Steps to Reproduce:
(Easiest using a KVM VM, virt-manager and "virsh console")
1. Boot with a kernel command line ending in
 console=tty0 console=ttyS0,115200
2. Observe both tty0 and ttyS0.

The output of init scripts is sent to ttyS0, as the final "console="
argument determines the primary console device as per
Documentation/serial-console.txt in the kernel sources.

https://bugzilla.redhat.com/show_bug.cgi?id=752073
2011-11-15 09:47:22 +01:00
Daniel Drake
ce335a0d5c 99base/init: avoid using cp -t
-t is not supported by busybox's cp.

Signed-off-by: Daniel Drake <dsd@laptop.org>
2011-11-15 09:47:20 +01:00
Harald Hoyer
01f896d38e dracut.spec: remove xen module 2011-11-15 09:47:20 +01:00
Harald Hoyer
9af39cbe31 Makefile, git2spec.pl: use temporary builddir
to build the dracut rpm, use a temporary builddir
2011-11-15 09:47:19 +01:00
Harald Hoyer
1133b5e07a 99fs-lib/module-setup.sh: only include fsck helper needed for hostonly
for the host-only initramfs, check all relevant disks for the
filesystem type and only include those fsck tools, which are needed.
2011-11-15 09:47:18 +01:00
Harald Hoyer
470ee2d214 99base/init, 98usrmount: mount /usr if found in /sysroot/etc/fstab
We cannot boot correctly without /usr, because of
http://www.freedesktop.org/wiki/Software/systemd/separate-usr-is-broken
so, we mount /usr readonly.
2011-11-15 09:47:17 +01:00
Harald Hoyer
b0692d0311 add wait_for_dev() and wait_for_mount() 2011-11-15 09:47:16 +01:00
Harald Hoyer
9549014694 fs-lib: install /etc/e2fsck.conf, if e2fsck is installed 2011-11-07 09:38:30 +01:00
Harald Hoyer
e696ade15d 90kernel-modules/module-setup.sh: include usb mass storage drivers 2011-11-07 09:38:30 +01:00
Brian C. Lane
03cec38834 inst_script should call inst_simple (#750603)
inst_script checks for a shebang, if it doesn't exist it exits.
If it does it should not be calling inst_binary, it should call
inst_simple like it used to.
2011-11-02 08:18:26 +01:00
Will Woods
03b5494ca1 apply-live-updates.sh: copy without glob
cp $SRC/* $DEST will skip dotfiles in $SRC.
( cd $SRC; cp -a -t $DEST . ) will copy everything.
2011-10-21 13:18:06 +02:00
Paolo Bonzini
028a79b8a1 remove the xen dracut module
The Xen module is unnecessary and it has been for a while.
Most Xen systems will not be using the module, even now, because
xen-detect is not installed by default on most Xen systems, and
dracut uses xen-detect to decide whether to include the module.

It also has some problems:

1) it does not try loading xen_platform_pci;

2) it loads modules unnecessarily; modules.alias is where all Xen support
should reside.  Assuming xenbus_probe_frontend and xen_platform_pci
are loaded so that Xen devices are probed, other modules are picked up
automatically thanks to aliases such as

    alias xen:vbd xen_blkfront

3) Even not-so-recent kernels (say 2.6.32) require the xen_platform_pci
and xenbus_probe_frontend modules even for non-paravirtualized guests.
60xen/module-setup.sh picks the module only for PV guests.

So, just require xenbus_probe_frontend to be builtin, and also
xen_platform_pci for fully-virtualized guests, and remove the module.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2011-10-21 13:18:06 +02:00
Harald Hoyer
7c3a7bd1f0 dracut.spec: require new util-linux version with new switch_root
new switch_root knows how to handle "/run"
2011-10-21 12:35:34 +02:00
Harald Hoyer
85cda6ae16 dracut.spec: apply patches with git
This will take all renames and mode changes.
2011-10-21 12:35:07 +02:00
Harald Hoyer
f60995adb4 dracut-functions:inst_script() call inst_binary() with found bin
call inst_binary() with the already found executable to prevent
searching for the binary again
2011-10-21 12:33:05 +02:00
Harald Hoyer
4637c5c242 dracut-functions: do not install files from current directory
Protect against relative pathnames without a slash for all inst_*()
functions.
2011-10-21 10:57:13 +02:00
Harald Hoyer
624c70d763 90livenet: do not install by default 2011-10-21 10:29:58 +02:00
Harald Hoyer
bfdc0eba0b 90dmsquash-live: do not install by default 2011-10-21 10:29:58 +02:00
Harald Hoyer
4f6eb791b4 90livenet/module-setup.sh: silence check for wget 2011-10-21 09:35:38 +02:00
Harald Hoyer
b01885338b dracut-functions: inst_dir() handle relative symlinks 2011-10-20 13:06:53 +02:00
Harald Hoyer
44cef0d563 dracut-logger: re-set debugging 2011-10-20 13:06:53 +02:00
Harald Hoyer
d73bbd57ee 90livenet: check() for wget 2011-10-20 13:06:53 +02:00
Michal Soltys
5259da1043 minor changes
- in 10i18n - do stty -iutf8 on non-utf8 consoles, for consistency with
  iutf8 on utf8 ones
- vim modeline in xml file

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-10-20 13:06:52 +02:00
Harald Hoyer
c2801d0938 99base/dracut-lib.sh: add /etc/cmdline/*.conf parsing
modules and overlay images can set default kernel command line
parameters in /etc/cmdline/*.conf in the initramfs.
2011-10-20 13:06:52 +02:00
Harald Hoyer
15a5dc5b89 99base/init: fix check for in kernel polling 2011-10-20 13:06:52 +02:00
Harald Hoyer
e2d92b5adf */module-setup.sh: turn off debugging for module search
turn off debugging for module search, because it clutters the debug log
2011-10-20 13:06:37 +02:00
Harald Hoyer
6f00044317 95udev-rules/module-setup.sh: correctly create udevd symlink 2011-10-20 13:06:34 +02:00
Harald Hoyer
d3be5a89e5 netroot: do not die, if arping failed 2011-10-19 14:24:07 +02:00
Michal Soltys
f8342dd5f2 check root candidates more carefully
This is from the following thread:

http://thread.gmane.org/gmane.linux.raid/35753/focus=35795

Additional tests + more specific info.

Signed-off-by: Michal Soltys <soltys@ziu.info>

[harald@redhat.com: usable_root(): relaxed check for root]
2011-10-19 14:23:54 +02:00
Will Woods
54ba7acba1 dmsquash-live: fix log message about root/liveroot 2011-10-18 17:13:50 +02:00
Will Woods
2cd4a8065a dracut-lib.sh: fix dropped backslashes in CMDLINE
The "read" shell builtin consumes backslashes, which is a problem if
your root device is something like "LABEL=Fedora\x2016".

Using "read -r" tells the shell to leave backslashes alone.
2011-10-18 17:13:48 +02:00
Michal Soltys
7e8228cf5a dracut: remove duplicate options
'-I' and '--fwdir' were both read_arg and push_arg, and the latter has
priority.

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-10-18 11:33:56 +02:00
Michal Soltys
d239b550ce explicitly verify bash version
A simple check in main dracut script.

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-10-11 09:37:02 +02:00
Michal Soltys
c32bda6bb9 bash3 compat patch
This patch replaces:

- {var}>... redirections with functionally identical eval construct +
  explicit FDs
- ^^ and ,, case modifiers with temporary shopt

This allows us to lower minimum required bash version
to at least 3.1 (with current code).

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-10-11 09:37:01 +02:00
Dave Young
61bc3bbc0e dracut.conf.5.xml: tag mismatch fix
build failed with:
xsltproc -o dracut.conf.5 -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl dracut.conf.5.xml
dracut.conf.5.xml:169: parser error : Opening and ending tag mismatch: para line 168 and listitem
        </listitem>

Fix it by change to </para> at the end

Signed-off-by: Dave Young <dyoung@redhat.com>
2011-10-11 09:37:01 +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
ffcfc0e432 dracut.*.xml: s/exisiting/existing/g 2011-10-10 11:55:52 +02:00
Michal Soltys
c44e3cb4e5 dracut-functions: conv/normalize minor corrections
mostly with reference to earlier commit:

- bash doesn't need unsetting locals
- make normalize_path() a bit faster, also make sure we remove all
  trailing slashes
- normalize paths before tests

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-10-10 11:54:26 +02:00
Michal Soltys
4c5da0157f manuals: add info about fs-lib (fsck) configuration
in dracut.8.xml & dracut.conf.5.xml

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-10-10 11:54:26 +02:00
Michal Soltys
25b45979f2 fs-lib: add ability to choose fsck tools
in dracut.conf:

fscks="<tools>"
nofscks="yes"

and similary on command line:

--fscks [LIST] (in addition to conf's, if defined there)
--nofscks

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-10-10 11:54:26 +02:00
Michal Soltys
77270329ba dracut.8: add missing lvmconf info
Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-10-10 11:54:25 +02:00
Michal Soltys
c1609dd497 convert_abs_rel() fixups
- IFS was not preserved, and modified value could leak to outside functions

- the '.' relative path should be returned for arguments such as /x/y/z
  /x/y - but not for $1 == $2 ones

- $1 == $2 is self-looping link, so it returns final component of its
  name

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-10-10 11:54:25 +02:00
Dave Young
88b3e00515 dracut: check mktemp return value
in slackware the default mktemp is not from coreutils.
A simply make in test directory mangled my rootfs due
to initdir is blank

Also mktemp could failed with other reason like ENOSPC or EPERM
2011-10-10 11:41:14 +02:00
WANG Cong
0c3a8dea88 update the documentation of '--[no]prefix'
In

commit fd786adcf5
Author: Harald Hoyer <harald@redhat.com>
Date:   Wed Apr 20 16:47:40 2011 +0200

    dracut: make prefix configurable

Harald changed the meaning of --prefix/--noprefix, but
forgot to update their documentation. This patch
fixes that.

Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
2011-10-07 10:13:17 +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
54ffd5447d 90mdraid/module-setup.sh: fixed sed arguments 2011-10-04 13:30:35 +02:00
Harald Hoyer
e0e9221e23 90mdraid/mdraid_start.sh: fix path to md sysfs 2011-10-04 13:06:33 +02:00
Harald Hoyer
77a57d5eaf order mdadm and lvm timeout operations 2011-10-04 13:03:45 +02:00
John Reiser
d23159a69c dracut [PATCH]es: parallelize block_module filter and net_module_filter
Filtering modules requires enough work that instmods() in the
next pipeline stage was rarely busy.  Parallelize the two
filters which do the most work.  Also fix a filename-vs-contents
mistake in net_module_filter.

--
John Reiser, jreiser@BitWagon.com

>From f4533a2ceca52c443ddebec01eeaa35d51c39c1b Mon Sep 17 00:00:00 2001
From: John Reiser <jreiser@BitWagon.com>
Date: Tue, 13 Sep 2011 17:41:43 -0700
Subject: [PATCH 1/3] Parallelize block_module_filter
2011-09-30 09:40:49 +02:00
John Reiser
9e103df45e dracut [PATCH] Parameter expansion occurs before command evaluation.
Bash shell expands all ${parameter} before evaluating a command.
For multiple declarations and assignments within the same 'local' command,
then new variables or new values that appear towards the left
do not affect parameter expansion towards the right.

--
John Reiser, jreiser@BitWagon.com

>From 507ad6f66fc66f868a9e5fdd3806e012c4022baa Mon Sep 17 00:00:00 2001
From: John Reiser <jreiser@BitWagon.com>
Date: Fri, 23 Sep 2011 07:37:43 -0700
Subject: [PATCH] Parameter expansion occurs before command evaluation.

${parameter} on the right is expanded before evaluating "local var=value"
on the left.
2011-09-30 09:40:49 +02:00
Michal Soltys
9fc3f04520 90mdraid: adjust /dev/md loops
Include '_' to also handle old partitionable arrays (pre-2.6.28).

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-09-22 17:34:51 +02:00
Michal Soltys
ae816bb6aa 90mdraid: more thorough 64-md-raid.rules edit
Catch more variations of incremental assembly.

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-09-22 17:24:16 +02:00
Michal Soltys
db9b9f396e 90mdraid: check precisely for supported contaiers
ID_FS_TYPE can be much more than just ddf/imsm/linux raid member, so
do the proper checks.

This reverts certain changes from:
cf5891424e

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-09-22 17:14:42 +02:00
Harald Hoyer
08769b7f8a dracut-functions: inst_rules() add missing "" 2011-09-22 16:14:38 +02:00
Michal Soltys
f07aaccd06 99fs-lib: export FSTAB_FILE before fsck call
Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-09-22 15:53:51 +02:00
Amadeusz Żołnowski
7c14b3688c dracut: create /dev besides /proc, /sys and so
How it worked without it?  The issue only manifests itself with
initramfs integrated into kernel.
2011-09-22 15:53:50 +02:00
Harald Hoyer
69063507d4 dracut-logger: bail out early, if we don't have to log anything 2011-09-22 15:49:25 +02:00
Michal Soltys
cb28815405 str_replace() fix
Whitespace removal in:

	out="${out}${chop# }$r"

will damage certain strings, for example the following call:

	str_replace ' aax aaxaa' x y

would return 'aayaayaa' instead of ' aay aayaa'.

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-09-22 15:46:11 +02:00
Harald Hoyer
76f5fa549c dracut-functions: inst_rules() do not check std dirs for abs path
if an absolute path is given, we should not check the standard udev rule
directories.
2011-09-22 15:43:34 +02:00
Harald Hoyer
662ed0a13f 99fs-lib/fs-lib.sh: fsck btrfs via mounting like xfs
btrfsck is only for manual repairing your filesystem
2011-09-22 15:37:28 +02:00
Harald Hoyer
75e8f476e7 TEST-40-NBD: relaxed check on ext3 filesystem options
onerror=continue does not seem to be displayed for new kernels
2011-09-22 15:37:27 +02:00
Michal Soltys
a025cc17f0 90mdraid: fix/adjust 65-md* rules and related scripts
Reworked the flow of the rules file a bit, removed redundant tests, also
should be easier to follow. It's much shorter now as well, a bit more
similar to 90lvm script - both revolve around same concepts after all.

There's no reason to treat conf-assembled arrays differently from
incremental ones. Once we hit timeout in init's udev loop, we can use
common script (mdraid_start.sh) to try force inactive arrays
into degraded mode.

md-finished.sh was kind-of out of place - it didn't really wait for any
particular device(s) to show up, just watched if onetime mdadm scripts
are still in place. Furthermore, after moving mdraid_start to --timeout
initqueue, it didn't really have too much to watch at all, besides
mdadm_auto (and that served no purpose, as we do wait for concrete
devices).

Either way, with stock 64-md fixes, current version of 65-md*.rules does
the following:

- limits assembly to certain uuids, if specified
- watch for no ddf/imsm
- if mdadm.conf => setup onetime -As script, without forced --run option
- if !mdadm.conf => incrementally assemble
- for both cases, setup timeout script, run-forcing arrays as a last resort

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-09-22 15:37:26 +02:00
Michal Soltys
cf5891424e 90(md|dm)raid: recognize ddf container
This patch adds ddf support, consistently with imsm/isw options.

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-09-22 15:37:26 +02:00
Michal Soltys
66426469d0 90mdraid: fix/adjust force-run script
1) mdadm -As --auto=yes --run 2>&1 | vinfo (removed)

Currently such auto assembly will not complete or force-run partially
assembled arrays. It might assemble "concurrent" separate array and
force-run it, if possible (though the chances of suddenly showing
missing components in this scenario - a script run after udev timeout -
are pretty thin). See [1] for details. Also see #3 below.

2) mdadm -Is --run 2>&1 (removed)

This will only force-run native arrays - arrays in containers will not
be affected. See [1] for details. Also see #3 below.

3) mdadm -R run loop (implicitly handles #1 & #2)

This loop does everywthing that #1 & #2 are expected to do. Thus, the
above invocations are simply redundant and this is the most safe and
flexible option.

Also, it shouldn't be necessary to go under md/ directory, as those are
just symlinks to /dev/md[0-9]*.

Certain checks were changed to strict ones (array state, degraded state)
instead of relying on env tricks.

'cat' was added explicitly to installed programs (it has been used
implicitly in shutdown script either way)

4) mdmon bug

See [1] for details as well. In short - force-run arrays in containers
will not have mdmon started, so we do that manually.

5) stop/run queue magic

Also removed. mdadm -R will only cause change events to the array
itself, and they should not be an issue.

[1] http://article.gmane.org/gmane.linux.raid/35133

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-09-22 15:37:25 +02:00
Michal Soltys
9383421c1c 90mdraid: fix/adjust mdraid-cleanup
Stop both arrays (first pass) and containers (second pass).
Loop only over /dev/md[0-9]*
Call cleanup script only once, make sure it's after crypt cleanup.

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-09-22 15:37:25 +02:00
Michal Soltys
5f6a71b38a 90mdraid: containers are not runnable
Remove whole "start a container logic".

Containers once assembled, always remain in 'inactive' state.
Any attempt to run a container with mdadm -IR is a no-op, and any
attempt with just mdadm -R ends with an error.

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-09-22 15:37:23 +02:00
Michal Soltys
e3e5128cf2 90mdraid: adjust stock mdadm udev rules
Currently shipped mdadm rules incrementally assemble all imsm and native
raids, and do so unconditionally. This causes few issues:

- fine-grained controls in 65-md* are shadowed - for example,
  mdadm.conf's presence tests or uuid checks
- 90dmraid might also conflict with 90mdraid, if user prefers the former
  to handle containers
- possibly other subtle issues

This patch adjusts the behaviour.

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-09-22 15:37:23 +02:00
Harald Hoyer
6d385c7111 mount securityfs in a seperate dracut module 2011-09-22 15:37:23 +02:00
Harald Hoyer
16457c869d mount securityfs in a seperate dracut module 2011-09-20 11:16:53 +02:00
Harald Hoyer
d63fdc1198 99base/init: mount securityfs with source "securityfs" instead of dest 2011-09-20 10:10:29 +02:00
Harald Hoyer
ca8d4e8933 Do not use /run/udev/rules.d for udev rules
for rules, which should not be called in the real root.

Stale rules can cause this:
https://bugzilla.redhat.com/show_bug.cgi?id=734096
2011-09-19 12:21:51 +02:00
Harald Hoyer
6d82a0470e 99base/init: remove /dev/root helper symlink
Any tool relying on /dev/root has to be fixed.
2011-09-19 12:20:55 +02:00
Harald Hoyer
e41e5b78c6 90dmsquash-live: do not symlink to /dev/live
/dev/live should not be used anyway
2011-09-19 12:20:11 +02:00
Harald Hoyer
baa5c11363 dmsquash-live-root: load filesystem modules before mounting loop images
might prevent https://bugzilla.redhat.com/show_bug.cgi?id=735199
2011-09-02 20:01:57 +02:00
Harald Hoyer
380b8b516e dmsquash-live-root: use blkid to determine fstype of images
prevents:
dracut: FATAL: cannot mount live image (unknown filesystem type)
https://bugzilla.redhat.com/show_bug.cgi?id=735199
2011-09-02 20:01:50 +02:00
Harald Hoyer
86880b8ff7 99base/init: removed cdrom polling reset code
This is done globally now.
2011-09-02 19:19:40 +02:00
Harald Hoyer
59f288ce63 dracut: cp with sparse 2011-09-02 19:19:40 +02:00
Harald Hoyer
dffb93feaf 99base/init: do not fail, when importing the original kernel environment 2011-09-01 16:01:21 +02:00
John Reiser
f9708da223 instmods: factor out egrep of "FATAL: Module .* not found" 2011-09-01 10:30:59 +02:00
John Reiser
0024702fe7 instmods: sanity for _mpargs 2011-09-01 10:30:58 +02:00
John Reiser
881eda695e instmods: get filenames from stdin if no args; use it
Use bash  "[[ string =~ pattern ]]"  instead of "egrep -q".
Replace control-dominated serial fondling
	for var in $(proc1); do proc2 var; done
with data-dominated parallel pipeline
	proc1  |  while read var; do proc2 var; done
Together this is a large savings.

[harald@redhat.com: fixed network kernel module filter]
2011-09-01 10:30:29 +02:00
John Reiser
e6024e0030 install_kmod_with_fw: make fast case faster 2011-09-01 10:03:57 +02:00
John Reiser
ceebd9ac76 filter_kernel_modules is a specialized filter_kernel_modules_by_path 2011-09-01 10:03:54 +02:00
John Reiser
3f590c7840 inst_simple, inst_dir: make fast case faster
This small stuff saves 1.7% per dropped statement during "dracut --profile".
Fixing the comment about /lib -> lib64 is REQUIRED!
2011-09-01 10:03:54 +02:00
Harald Hoyer
f063d0e89f 95udev-rules: add input_id 2011-08-31 16:48:20 +02:00
Harald Hoyer
5f06f0c367 dracut-functions: hmac checksum files can be symlinks, too
use inst() instead of inst_simple() to install the hmac files
2011-08-31 15:22:09 +02:00
Harald Hoyer
1e2f60993f 99base/init: move switch_root breakpoint to a later point in the script 2011-08-30 16:23:17 +02:00
Harald Hoyer
ed42e64cfc 99base/init: save and restore environment given from the kernel 2011-08-30 16:22:46 +02:00
Harald Hoyer
2c0b5281f5 90crypt/parse-crypt.sh: also accept the beginning of the LUKS UUID
2e0c003435 introduced a too strict test
for LUKS UUIDs
2011-08-30 14:43:57 +02:00
John Reiser
f4ca564ba6 build initramfs: unclear _mpargs in instmods()
The local variable _mpargs in function instmods() in file dracut-functions
looks peculiar.  The documentation is non-existent, but still ...

First, $_mpargs is not passed to modprobe via for_each_kmod_dep.
This is strange because my guess is that "_mpargs" means
"extra arguments for modprobe".

Second, the leading "--" will be lopped when a leading pathname
is stripped via
	_mod=${_mod##*/}
It seems to me that a leading "--" should inhibit modification.

Here's the corresponding patch to current HEAD (from dracut-013.)
2011-08-30 13:58:45 +02:00
Harald Hoyer
ab55a117e2 99base/init: only poll cdroms, if the kernel does support autopolling 2011-08-29 19:12:47 +02:00
Harald Hoyer
a3381af1de 50plymouth: add plymouth.enable kernel command line option 2011-08-29 18:32:24 +02:00
Harald Hoyer
82dfee9960 dracut.spec: fixed rhel/fedora version checks 2011-08-29 13:11:49 +02:00
Harald Hoyer
1073b9f93a 90mdraid/65-md-incremental-imsm.rules: incremental run to settled
move incremental run to settled queue again

https://bugzilla.redhat.com/show_bug.cgi?id=732967
2011-08-24 17:23:00 +02:00
Harald Hoyer
8cf621ffd9 dracut-functions: fix inst_dir() for non-absolute dirs 2011-08-23 12:50:03 +02:00
Przemysław Rudy
2e0c003435 luks key on ext dev - wait for luks
This really waits for the luks mapper device, so luksOpen can do it job
2011-08-22 11:27:00 +02:00
Amadeusz Żołnowski
1f735f82cc crypt: changed cmdline arg name from rd.luks.tout to rd.luks.key.tout 2011-08-22 11:19:22 +02:00
Przemysław Rudy
c70f6415f8 luks key on ext dev - wait for luks
This asks for the luks passphrase if key is not found for defined time (if defined with rd.luks.tout cmd line):

 modules.d/90crypt/cryptroot-ask.sh |   21 ++++++++++++++++++---
 modules.d/90crypt/parse-crypt.sh   |    5 +++--
 2 files changed, 21 insertions(+), 5 deletions(-)
2011-08-22 11:19:22 +02:00
Amadeusz Żołnowski
07aeaae356 livenet: take into account other ca-bundle paths; use inst_any for that 2011-08-22 11:19:21 +02:00
Amadeusz Żołnowski
3378a54f15 dracut-functions: new function: inst_any [-d dest] f1 [f2 [f3 ...]] 2011-08-22 11:19:19 +02:00
Leho Kraav
641d84a4ec 99base: whitespace fix 2011-08-22 11:19:19 +02:00
Amadeusz Żołnowski
581dd40e73 90crypt: ask_for_password pings plymouthd
If plymouthd is not started, ask_for_password shouldn't try to prompt
for password with GUI and should use text prompt instead.
2011-08-19 15:18:04 +02:00
Harald Hoyer
a76dc27801 dracut-functions: speed up inst_dir() 2011-08-19 10:24:49 +02:00
John Reiser
bc313467bd build initramfs: prelink --undo /sbin/*
Fix a typo (omitting the 's' in "sbin") which caused
"prelink --undo" twice on      /bin/*,  and
"prelink --undo" omitted for  /sbin/*.
2011-08-19 08:10:57 +02:00
Harald Hoyer
d619fb5e1c dracut: unset LD_LIBRARY_PATH
LD_LIBRARY_PATH is not set in the initramfs, so it should not be set
while finding our libraries.
2011-08-19 08:08:18 +02:00
Harald Hoyer
d670e21998 dracut-functions: s/emergency-shutdown/shutdown-emergency/g 2011-08-17 17:40:59 +02:00
Harald Hoyer
ea8e543bb8 add TEST-16-DMSQUASH
This is a test for Fedora LiveCDs created via livecd-tools
2011-08-17 13:42:16 +02:00
Harald Hoyer
e7b8fe03e8 profile.py: parse the output of "dracut --profile" for profiling 2011-08-17 10:08:23 +02:00
Will Woods
fb216d1a7c fix live crash with livenet installed
parse-livenet.sh shouldn't mess with $root unless it finds a valid URL.
2011-08-17 09:02:22 +02:00
Harald Hoyer
566dab2ac1 90dmsquash-live/dmsquash-live-root: include fs_lib.sh for det_fs()
https://bugzilla.redhat.com/show_bug.cgi?id=730579
2011-08-17 08:24:30 +02:00
Harald Hoyer
4a049ce556 add x-bit to *.sh 2011-08-12 16:29:28 +02:00
Harald Hoyer
e9519a397f version 013 2011-08-12 16:17:58 +02:00
Harald Hoyer
2ae52e649b dracut-functions: fixed inst_dir for symbolic links 2011-08-12 15:56:14 +02:00
Harald Hoyer
57258a2c64 dracut: add "--profile" option for profiling 2011-08-12 13:37:40 +02:00
Harald Hoyer
1610a566c6 dracut-functions: use "type -P" for find_binary() 2011-08-12 13:22:17 +02:00
Harald Hoyer
7ef8ff9a2e 90dmraid: don't install non-existent dmraid-cleanup 2011-08-12 13:13:26 +02:00
Harald Hoyer
e59f58f854 use inst_simple to install non-binary files 2011-08-12 13:11:30 +02:00
Harald Hoyer
4073c8159c add filter_kernel_modules_by_path() to speed up module search 2011-08-12 10:29:00 +02:00
Harald Hoyer
02a0c05bf7 AUTHORS: update 2011-08-12 10:28:31 +02:00
Harald Hoyer
016c3cfed2 90kernel-modules: add unix module 2011-08-12 10:08:09 +02:00
Harald Hoyer
5e802b113a removed sourceforge references 2011-08-12 09:53:40 +02:00
Will Woods
f116ca115c add apply-live-updates.sh to pre-pivot hook
If we're about to start a Live image (i.e. if /dev/mapper/live-rw
exists) this script will take any files found in /updates (inside the
initramfs!) and and copy them into $NEWROOT.

This allows for hotfixes to be applied to existing Live images without
rebuilding the entire image.

Signed-off-by: Will Woods <wwoods@redhat.com>
2011-08-12 08:03:55 +02:00
Will Woods
a12db35efa dmsquash-live-root: determine img type by contents, not name
Currently dmsquash-live-root requires that squashfs images be named
"squashfs.img" and all others be "ext3fs.img" or "rootfs.img".

If we've got a live image in initramfs, this patch will make dracut use
losetup and det_fs to determine the actual filesystem type of the image.

Signed-off-by: Will Woods <wwoods@redhat.com>
2011-08-12 08:03:55 +02:00
Will Woods
48205bb064 dmsquash-live-root cleanups/mini-fixes
- use last ro/rw cmdline arg rather than favoring 'rw' over 'ro'
- don't bother with useless RES variable for holding $?
- only do fs check when $livedev is a block device

Signed-off-by: Will Woods <wwoods@redhat.com>
2011-08-12 08:03:55 +02:00
Harald Hoyer
ac965cd828 Makefile: increment version to 012 2011-08-11 17:52:58 +02:00
Harald Hoyer
e22ad50953 NEWS: update 2011-08-11 17:52:40 +02:00
Harald Hoyer
d128791b84 90btrfs: add btrfs device with multiple components 2011-08-11 17:52:40 +02:00
Harald Hoyer
1afa0cb674 99fs-lib: add btrfsck 2011-08-11 17:52:40 +02:00
Harald Hoyer
d6770cf001 TEST-11-LVM/create-root.sh: sleep before disassembling device 2011-08-11 17:52:39 +02:00
Harald Hoyer
bcf94bba99 TEST-40-NBD/test.sh: source reformat 2011-08-11 15:36:29 +02:00
Harald Hoyer
de0b239907 TEST-40-NBD/create-root.sh: sleep before disassembling root device 2011-08-11 15:36:29 +02:00
Harald Hoyer
459bfe02f9 95rootfs-block/mount-root.sh: also parse rootopts for "_netdev" 2011-08-11 15:36:29 +02:00
Harald Hoyer
cee3b8966c 95nbd/nbdroot: also mount nbd0 for root=dhcp and missing root= 2011-08-11 15:36:05 +02:00
Harald Hoyer
40e27f1bf0 40network/parse-bridge.sh: fixed bridge parameter parsing 2011-08-11 14:27:27 +02:00
Amerigo Wang
31f1c02dda dracut: add --force-add option
This patch adds a new option --force-add, which
can force dracut to load some module when -H
is specified.

Signed-off-by: Amerigo Wang <amwang@redhat.com>
2011-08-11 14:27:27 +02:00
Amerigo Wang
0c7112fcff lsinitrd: display the size of initrd
It is useful to display the size of initrd in human-friendly form.

Signed-off-by: Amerigo Wang <amwang@redhat.com>
2011-08-11 14:27:27 +02:00
Harald Hoyer
588c362362 dracut.spec: add livenet and fs-lib 2011-08-11 14:27:26 +02:00
Harald Hoyer
bdf96a5d25 TEST-12-RAID-DEG/test.sh: uncomment rd.shell 2011-08-11 14:27:26 +02:00
Harald Hoyer
5ce355f6c0 turn off masterkey,ecryptfs,integrity by default 2011-08-11 14:27:26 +02:00
Harald Hoyer
3f02ed32a7 90mdraid: move force assembly to timeout initqueue 2011-08-11 14:27:26 +02:00
Harald Hoyer
e23f46e86f 90lvm/lvm_scan.sh: use "--partial" to force assembly incomplete VGs
If our internal loop counter is bigger than half of the maximum
count, try to assemble lvm device partially with the "--partial"
option.

https://bugzilla.redhat.com/show_bug.cgi?id=723548
2011-08-11 14:27:26 +02:00
Harald Hoyer
6b592c1487 99base: add timeout queue
timeout queue is executed after half of the maximum retry count and if
jobs are found there, the counter is reset to zero.
2011-08-11 14:27:25 +02:00
Harald Hoyer
e7b877427b Makefile: do not remove rpmbuild on fail 2011-08-11 14:27:25 +02:00
Harald Hoyer
f295392724 git2spec.pl: filter patches with no file changes 2011-08-11 14:27:25 +02:00
Harald Hoyer
814fa9a58f 01fips/installkernel: add dm-mod and dm-crypt to the fipsmodules
https://bugzilla.redhat.com/show_bug.cgi?id=707609
2011-08-11 14:27:25 +02:00
Harald Hoyer
3236e662d4 98selinux: use setenforce to force permissive mode 2011-08-11 14:27:25 +02:00
Harald Hoyer
8ec1562355 90dm: install libdevmapper-event* for 90dm and cleanup 90dmraid 2011-08-11 14:27:24 +02:00
Harald Hoyer
37ee12b0f3 90dm/dm-pre-udev.sh: load dm-mirror module 2011-08-11 14:27:24 +02:00
Michal Soltys
c60dbcc0aa 95rootfs-block/mount-root.sh: comment out fstab generation
fsck_single() operates directly on the device, so fstab is not
necessary. fs-lib functions make sure fscks don't complain.
Code is only commented out just in case I missed something.
2011-08-11 14:27:24 +02:00
Michal Soltys
21b691152c 95rootfs-block/mount-root.sh: squash rootopts into rflags
Small simplification - prepend rootopts to rflags before mount
operations. Shortens resulting command lines quite a bit.
2011-08-11 14:27:24 +02:00
Michal Soltys
fefab84fff implement fs-lib, squash a few bugs that were part of det_fs/wrap_fsck
To not pollute dracut-lib.sh, all the fsck related functions were moved
to fs-lib.sh. The functions available are as follows:

- fsck_single

this will detect/verify filesystem, check if it has necessary tools and
check the filesystem respecting additional flags (if any), using
specific "driver" (or falling back to generic one). Currently
available: fsck_drv_{com,xfs,std}. 'com' is used for tools following
typical subset of options/return codes (e.g. ext, jfs), 'std' is used
for "unknown" fs and doesn't assume it can be run non-interactively.

Please see comments around the code for more info.

- fsck_batch

this will check provided list of the devices;

Both of the above functions will fake empty fstab, to make generic fsck
not complain too much (excact devices are always provided on the command
line).

"Known" filesystems currently: ext234, reiser, jfs, xfs

- det_fs

Small bug fixed - as this function is meant to be called in $(), it may
not be verbose.
Current behaviour is:
 - if detection is successful, use its result
 - if detection is not successful, and filesystem is provided, return
   the provided one; otherwise use auto
2011-08-11 14:27:24 +02:00
Michal Soltys
1ddaffda88 95rootfs-block/mount-root.sh: '-a' for ext? is handled in fs-lib now
Previously, '-a' was added for ext[234] filesystems if other
conflicting flag were not present. It's being done automatically
in fsck_drv_com() now (also for jfs and reiser).
2011-08-11 14:27:23 +02:00
Will Woods
6d2a79432b livenet: module for fetching live images from the network
The livenet module allows you to use a root arg like:

    root=live:http://server.name/path/to/live.img ip=dhcp

The named live image will be downloaded with wget and then set up as the
root device.

It currently supports FTP, HTTP, and HTTPS. dracut will try to install
the CA bundle (/etc/ssl/certs/ca-bundle.crt) into the initramfs so that
SSL certificate checking will work properly.

If an HTTPS URL is given and the site fails the certificate check, the
file will be rejected and the system will not boot into it.

Signed-off-by: Will Woods <wwoods@redhat.com>
2011-08-11 14:27:23 +02:00
Harald Hoyer
031bf1d0fa modules.d/90mdraid/65-md-incremental-imsm.rules: fix md_finished install 2011-08-11 14:27:22 +02:00
Harald Hoyer
1eb8e9217f test/TEST-13-ENC-RAID-LVM/create-root.sh: wait before disassembling lvm 2011-08-11 10:49:10 +02:00
Harald Hoyer
9a716018be initqueue: exit with 0 2011-08-11 10:49:09 +02:00
Harald Hoyer
a9fa6d265d dracut-lib.sh: fixed getargs() for empty arguments 2011-08-11 10:49:09 +02:00
Harald Hoyer
d765a3e71b dracut-lib.sh: getarg() echo with "" to prevent wildcard subst
if a value of a key on the kernel command line includes wildcards, these
would be expanded.
E.g., if you have "key=/dev/sd*" the value would be substituted with
"/dev/sda /dev/sda1 /dev/sda2" instead of returning "/dev/sd*"
2011-08-10 18:43:54 +02:00
Harald Hoyer
6a3c2215bb 99base/init: use udevadm control to set the logging priority
due to a bad revert commit, "udevadm control" was converted to
"udevproperty", which is the wrong command to set the logging priority.
2011-08-10 18:43:54 +02:00
Harald Hoyer
e51260e4fe dracut-functions: create relative symlinks for libraries 2011-08-10 18:43:54 +02:00
Harald Hoyer
d727c5ae7b dracut.spec: add 97masterkey 98ecryptfs 98integrity 2011-07-29 11:14:41 +02:00
Harald Hoyer
aaced3f990 git2spec.pl: make rename diffs 2011-07-29 11:12:44 +02:00
Michal Soltys
6c706227f5 parse-lvm.sh: fix for generated initqueue/finished script
The script that was generated always returned the status of the last test
condition, potentially missing any earlier non-existing devices.

The change assures, that the script returns 0 only if all expected
devices are found.

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-07-28 15:01:35 +02:00
Roberto Sassu
949a077a58 dracut: added new module ecryptfs
This module mounts an eCryptfs filesystem from the initial ramdisk using an
encrypted key.

Signed-off-by: Roberto Sassu <roberto.sassu@polito.it>
Acked-by: Gianluca Ramunno <ramunno@polito.it>
2011-07-28 15:01:35 +02:00
Roberto Sassu
0c71fb672f dracut: added new module integrity
This module initializes the EVM software and permits to load a custom IMA
policy.

Signed-off-by: Roberto Sassu <roberto.sassu@polito.it>
Acked-by: Gianluca Ramunno <ramunno@polito.it>
2011-07-28 15:01:34 +02:00
Roberto Sassu
e1ed2a207b dracut: added new module masterkey
This module initializes a trusted/user kernel master key that will be used
to decrypt other encrypted keys.

Signed-off-by: Roberto Sassu <roberto.sassu@polito.it>
Acked-by: Gianluca Ramunno <ramunno@polito.it>
2011-07-28 15:01:34 +02:00
Roberto Sassu
a6c418ee43 base/init: mount the securityfs filesystem
Mount the securityfs filesystem and make available its location through the
exported variable SECURITYFSDIR.

Signed-off-by: Roberto Sassu <roberto.sassu@polito.it>
Acked-by: Gianluca Ramunno <ramunno@polito.it>
2011-07-28 15:01:34 +02:00
Harald Hoyer
b6632d616f dracut-update-initramfs: removed on request of the debian maintainer 2011-07-25 18:01:02 +02:00
Harald Hoyer
626d9eba9c dracut-functions: remove double slashes, for symlink conversion
remove double slashes for symlink conversion from absolute to relative
2011-07-25 14:28:55 +02:00
Harald Hoyer
6f09acf855 dracut: install /lib* for kernel images 2011-07-25 14:28:40 +02:00
Harald Hoyer
5a10d93d29 removed debian.template 2011-07-25 10:57:52 +02:00
Harald Hoyer
7b07f4e83f dracut-functions: resolve relative path and recursively install destination 2011-07-25 10:55:19 +02:00
Harald Hoyer
a8eecab079 move "debian" to debian.template on request of debian maintainer 2011-07-25 10:31:54 +02:00
Harald Hoyer
d4bb431621 dracut-functions: convert absolute symlinks to relative 2011-07-25 10:25:44 +02:00
Harald Hoyer
3cd98a6094 dracut-logger: initialize basic vars 2011-07-25 10:25:12 +02:00
Thomas Lange
7641c73dec fixed typos 2011-07-25 09:11:56 +02:00
Harald Hoyer
40ee8c1814 99base/init: try to mount /usr, if init lives on /usr 2011-07-22 15:17:00 +02:00
Harald Hoyer
a4c235ed3a dracut-functions: only "dinfo" about missing optioal dracut_install 2011-07-22 14:20:27 +02:00
Harald Hoyer
82eea29797 99base/dracut-lib.sh: don't be quiet on rd.debug 2011-07-22 14:20:27 +02:00
Harald Hoyer
09e0549d51 dracut.kernel.7.xml: beautified doc 2011-07-22 09:49:49 +02:00
Harald Hoyer
c029f4c1da dracut.kernel.7.xml: s/voonsole.keymap/vconsole.keymap 2011-07-22 09:41:24 +02:00
Américo Wang
4a855e6beb busybox module: parse busybox defined functions dynamically
Currently in dracut busybox module, we hard-code the list of binaries
available in busybox. Actually we can get this list by running busybox
without any arguments.

Also, if find_binary() finds nothing, we would symlink $initdir/
which is not we expect.

Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
2011-07-21 09:58:38 +02:00
Harald Hoyer
8570b544e9 TEST-10-RAID/test-init: add comment for rd.break=shutdown 2011-07-20 21:40:50 +02:00
Harald Hoyer
b1b678427e 99base/dracut-lib.sh: fix previous getargs patch
patch 9e7f495589 ignored
"getargs key=value"
2011-07-20 21:38:07 +02:00
Harald Hoyer
9e7f495589 dracut-lib.sh: fixed getargs()
if $1 has a "=<value>", we want the exact match
if cmdline argument has no "=<value>", we assume "=1"
2011-07-20 21:12:17 +02:00
Harald Hoyer
f47e023498 shutdown: fixed check_shutdown loop 2011-07-20 21:11:36 +02:00
Harald Hoyer
00d89f5170 TEST-10-RAID/test-init: turn off debug for shutdown 2011-07-20 21:10:58 +02:00
Harald Hoyer
ceaf49d735 TEST-10-RAID: extend test case to shutdown 2011-07-20 19:08:25 +02:00
Harald Hoyer
8e448cadf9 90mdraid/md-shutdown.sh: put shutdown in function 2011-07-20 19:06:26 +02:00
Harald Hoyer
4456861f7e 90dm/dm-shutdown.sh: put shutdown in function 2011-07-20 19:06:08 +02:00
Harald Hoyer
2560da6be2 enable shutdown module by default 2011-07-20 19:04:54 +02:00
Harald Hoyer
34b22d6049 90dmsquash-live: optionally install eject 2011-07-20 17:49:29 +02:00
Harald Hoyer
e45ffb5d1f dracut-logger: create logfile with 0600 permissions 2011-07-20 17:24:33 +02:00
Harald Hoyer
8a29368bf1 dracut.logrotate: remove "yearly"
logrotate would only rotate yearly with it
2011-07-20 17:21:02 +02:00
Harald Hoyer
54703a719f add TEST-15-BTRFSRAID 2011-07-20 14:10:30 +02:00
Harald Hoyer
8e702c3d0f dracut.spec: remove noreplace for 01-dist.conf 2011-07-20 12:39:58 +02:00
Harald Hoyer
7893469fca Makefile: inc version 2011-07-18 17:05:06 +02:00
Harald Hoyer
4765889b2e TODO, NEWS: update 2011-07-18 17:04:54 +02:00
Harald Hoyer
b038e0aac9 Makefile: copy created rpms from rpmbuild in "rpm" target 2011-07-18 17:04:27 +02:00
Harald Hoyer
d8bf119dd2 dracut.spec: fixed logrotate 2011-07-18 16:33:26 +02:00
Amadeusz Żołnowski
d083dd4c39 90kernel-modules: fixed handling rd.driver.post= 2011-07-01 10:15:26 +02:00
Amadeusz Żołnowski
b52294d00b crypt: dropped plymouth --has-active-vt check on passwd prompt
As Ray Strode explains, plymouth --has-active-vt may fail if the user
passes console=ttyS0 or something other not corresponding to
console=tty0, because plymouth is outputing to the serial console and
not a VT in this case.
2011-07-01 10:15:26 +02:00
Harald Hoyer
802e7e1c2e dmsquash-live: install eject with dracut_install
the new search path does the right thing
2011-07-01 10:14:47 +02:00
Harald Hoyer
be1762caff selinux/selinux-loadpolicy.sh: set LANG=C for load_policy and restorecon
set LANG=C for chroot execed tools, because the terminal might not be
able to display the messages and the rest is not translated anyway.
2011-06-22 13:33:37 +02:00
Harald Hoyer
6a2a1ea75f base/init: do not mount devtmpfs with "noexec"
https://bugzilla.redhat.com/show_bug.cgi?id=710711

mmap /dev/zero: Operation not permitted
2011-06-17 13:50:17 +02:00
Harald Hoyer
565f6fb675 crypt/crypt-lib.sh: s/.console.lock/.console_lock/g
In the initrd, the init script and the sbin/cryptroot-ask script use
flock with different lock files for the console: /.console_lock and
/.console.lock respectively
2011-06-17 13:44:08 +02:00
Harald Hoyer
f2c6909468 base/init: mount virtual filesystems with the filesystem type as source 2011-06-17 13:14:18 +02:00
Harald Hoyer
0e6a94b329 Makefile: simplify "make rpm" 2011-05-31 16:34:37 +02:00
Harald Hoyer
cae57c60a1 shut 2011-05-31 16:34:24 +02:00
Harald Hoyer
657d68cfff mdraid: add shutdown script 2011-05-31 15:50:45 +02:00
Harald Hoyer
20636ce09f dm: add shutdown script 2011-05-31 15:50:45 +02:00
Harald Hoyer
168fa7e571 base: add shutdown script to be called from systemd 2011-05-31 15:50:43 +02:00
Harald Hoyer
55468fb9b3 dracut: use pigz, if available and no compress defined 2011-05-31 14:56:31 +02:00
Harald Hoyer
7ed1de2f1d mount-root.sh: fixed fsck and "-a" only for "ext*" 2011-05-31 14:56:30 +02:00
Harald Hoyer
c30c65c1b2 dracut-functions: do not redirect modprobe error output to /dev/null
filter modprobe error messages and log them. Very useful if modules.dep
is missing.
2011-05-23 17:40:44 +02:00
Harald Hoyer
2627d8a345 dracut-functions: make created directories writable 2011-05-20 20:08:59 +02:00
Harald Hoyer
5fe5c7d0b1 dracut: add --keep option, to inspect the initramfs directory 2011-05-20 20:08:13 +02:00
Michal Soltys
0d8c1d7fa1 95rootfs-block/block-genrules.sh: Use > instead of >>
trivial, blocksymlink.sh shouldn't exist at this point.

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-05-20 17:16:51 +02:00
Michal Soltys
0216d1cda3 95rootfs-block/mount-root.sh: Rely on det_fs and wrap_fsck
Use common fsck and det_fs code. Verify filesystem type more
aggressively, which has a chance to be more resistant to
accidental mistakes.

Also, there's no need to generate custom fstab for the sake of fsck
anymore.

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-05-20 17:16:51 +02:00
Michal Soltys
8b2896f9fa 95fstab-sys: use det_fs and wrap_fsck
This patch mainly adds fsck functionality to fstab-sys, with additional
sanity checks (checking for device existence, verifying fstype via
det_fs).

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-05-20 17:16:50 +02:00
Michal Soltys
e2c5015713 dracut-lib.sh: Add det_fs() and wrap_fsck()
Both functions will be used by rootfs-block and fstab-sys modules.

Both are based on code present in mount-root.sh, though few changes are
present.

det_fs:

will try to determine filesystem type for supplied device, even if it's
not auto. If fs cannot be detected, or if the detected one differs from
the supplied one - a warning is issued (so user can fix its stuff later)

wrap_fsck:

will call fsck for specific device with optionally additional
fsckoptions. The function returns fsck return value.

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-05-20 17:16:50 +02:00
Michal Soltys
e639630da4 dracut-lib.sh: add vwarn() function
Similary to vinfo()

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-05-20 17:16:50 +02:00
Harald Hoyer
ce4359ea85 dracut.spec: build require dash and bash 2011-05-20 15:33:51 +02:00
Harald Hoyer
9b30d4793d base/init: do not lazy umount /run 2011-05-20 15:17:32 +02:00
Harald Hoyer
dd483f4f42 base/init: mkdir non-existant dirs 2011-05-20 15:17:32 +02:00
Harald Hoyer
543f39cb52 base/init: save timestamp earlier and remove /sys mount duplicate 2011-05-20 15:17:32 +02:00
Harald Hoyer
4826b9b0d5 base/init: mkdir $NEWROOT, if it does not exist 2011-05-20 15:17:32 +02:00
Harald Hoyer
683db19a7d base/module-setup.sh: only mkdir /lib, if it does not exist 2011-05-20 15:17:31 +02:00
Harald Hoyer
1021371daf i18n: disable systemd-vconsole-setup, until the tool is fixed 2011-05-20 15:17:31 +02:00
Harald Hoyer
6a0b3ccf4e busybox: install busybox to /usr/bin 2011-05-20 15:17:31 +02:00
Harald Hoyer
b938443e2f lsinitrd: handle new output of "file" for XZ compressed images 2011-05-20 15:17:31 +02:00
Harald Hoyer
7db18ccd13 dracut-functions: change search path for find_binary 2011-05-20 15:17:31 +02:00
Harald Hoyer
c3b0d83ddf dracut-functions: handle symlinked directories 2011-05-20 14:04:57 +02:00
Harald Hoyer
785a6cd21c dracut: handle toplevel symlinks 2011-05-20 14:03:50 +02:00
Harald Hoyer
6f22336784 dracut: s/bzip/bzip2 2011-05-20 14:02:35 +02:00
Harald Hoyer
3da7836035 dracut: fix overlayfs paths 2011-05-20 13:00:46 +02:00
Harald Hoyer
23b28c0ab5 lvm/lvm_scan.sh: remove references to lvm-cleanup
lvm-cleanup was removed long time ago
2011-05-17 12:29:47 +02:00
Will Woods
7573ac58f2 Fix "can't shift that many" crash with empty /proc/cmdline
If /proc/cmdline is empty (like if root=... is set in /etc/cmdline),
modules.d/99base/init will crash with a message saying "can't shift that
many" right before switch_root. The problem is in the block of code that
tries to look for init args. It does something like:

read CMDLINE </proc/cmdline
    [...]
    set $CMDLINE
    shift

If CMDLINE="" then "set $CMDLINE" will dump all the variables to stdout.
(That should be "set -- $CMDLINE" instead.) Since there's no $1, the
"shift" causes an error, and dracut crashes.

The 'shift' was copy-and-pasted from the previous block. It doesn't
belong here; remove it.

[Harald Hoyer <harald@redhat.com>: corrected commit message]
[Harald Hoyer <harald@redhat.com>: fixed indention]

Signed-off-by: Will Woods <wwoods@redhat.com>
2011-05-17 10:29:48 +02:00
Harald Hoyer
6787b8ccee dracut: set TMPDIR to /var/tmp
we really don't want anything else than /var/tmp for our operations.
/tmp might be too small and any other location might not fit our needs.
2011-05-16 18:10:27 +02:00
Harald Hoyer
00dd4db5d2 dracut.spec: add crypt-gpg module 2011-05-12 17:17:47 +02:00
Harald Hoyer
7417574cdb cut.conf.d/fedora.conf.example: removed filename in comment 2011-05-12 16:42:25 +02:00
Alan Pevec
f7c05c5514 dmsquash-live/dmsquash-live-root: add missing changes for /run
Change to /run/initramfs/squashfs/ was not complete.
2011-05-12 14:28:04 +02:00
Harald Hoyer
29b10e65b1 dracut-functions: make local vars local and prefix with "_" 2011-05-12 11:06:47 +02:00
Harald Hoyer
982e78234c TODO: update 2011-05-12 11:06:47 +02:00
Harald Hoyer
c09a9932b8 README: s/initrd/initramfs 2011-05-12 11:06:46 +02:00
Amadeusz Żołnowski
7aa622cd14 dracut.conf: explain dracutmodules option better 2011-05-12 11:06:46 +02:00
Amadeusz Żołnowski
37b73a235a dracut.kernel.7: crypto LUKS - info about gpg-encrypted keys 2011-05-12 11:04:56 +02:00
Harald Hoyer
beb015706b dracut-lib.sh: warn, even if "quiet" is set 2011-05-11 20:19:13 +02:00
Michal Soltys
6e43debe67 dracut-functions: remove find_rule()
Not used anymore.

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-05-10 14:46:06 +02:00
Michal Soltys
09a19bb1ba dracut-functions: update inst_binary()
This update adds support for sort-of corner case - when explicitly
specified binary (e.g. through dracut_install or inst) is a library
itself.

In such case, we would expect the binary to undergo typical
library-related handling (symlinks and such).

Apart from that, the patch cleans indenting and a few unused variables
in inst_binary() (probably leftovers from the past ?)

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-05-10 14:46:06 +02:00
Harald Hoyer
0279111026 documentation: update TODO and links 2011-05-10 14:13:58 +02:00
Harald Hoyer
f58c3ccf44 TODO: updated 2011-05-10 12:03:49 +02:00
Harald Hoyer
3b403b32fc removed trailing whitespaces 2011-05-10 11:56:09 +02:00
Harald Hoyer
e2cdb570ae dracut-functions: only dinfo() about missing firmware files
People are scared about those messages, so only dwarn() if the module
is actually loaded on the system.
2011-05-10 11:31:45 +02:00
Harald Hoyer
9a5393ac7e dracut: use /var/tmp rather than /tmp for the initramfs creation
/tmp might be to small to hold the initramfs image
2011-05-10 10:59:18 +02:00
Harald Hoyer
da5f8554a4 ifcfg/write-ifcfg.sh: do not source net.*.override, if it doesn't exist 2011-05-10 10:55:48 +02:00
Amadeusz Żołnowski
ba902275d5 new module - 91crypt-gpg
It's an extension to 90crypt module.  Adds support for GPG-encrypted
keys (symmetrically, of course).  Module is optional.
2011-05-06 12:23:52 +02:00
Amadeusz Żołnowski
3909d7edfc crypt: functions for ask-for-password and reading key
Asking for password and reading key parts are moved to separate
functions in crypt-lib.sh: ask_for_password and readkey.
2011-05-06 12:23:52 +02:00
Amadeusz Żołnowski
2f95d699dc crypt-lib.sh: 'command -v' preferred over 'type' 2011-05-06 12:23:51 +02:00
Amadeusz Żołnowski
d04de5fdd0 .gitignore: ignore dracut.html, dracut.conf.d/*.conf files, test.log 2011-05-06 12:23:50 +02:00
Amadeusz Żołnowski
f584c502a6 .gitignore: cleanup (prefix paths with /, remove unnecessary)
*~ should be globally ignored anyway.  Paths were prefix with / to be
strict.
2011-05-06 12:23:49 +02:00
Harald Hoyer
3cf14ae1ae parse-kernel.sh: wrong index was used in for loop
Thanks Mike Snitzer <msnitzer@redhat.com>
2011-05-06 12:06:20 +02:00
Harald Hoyer
7c18802966 iscsi: find iscsi kernel modules by symbol names 2011-05-04 10:19:02 +02:00
Harald Hoyer
424ecce632 plymouth/gensplash: reset tty after plymouth messed with it 2011-05-03 14:49:45 +02:00
Harald Hoyer
6019e1053c 10i18n: do not use console_init shell script, if systemd-vconsole-setup
do not use console_init shell script, if systemd-vconsole-setup is
available
2011-05-03 14:49:44 +02:00
Harald Hoyer
aad6898fe4 10i18n: s/systemd-vconsole/systemd-vconsole-setup/g 2011-05-03 10:34:06 +02:00
Harald Hoyer
44110df25a base/init: remove double nosuid from devtmpfs mount line 2011-05-03 09:59:15 +02:00
Harald Hoyer
c99014d5ef console_init/plymouth: use systemd-vconsole, if available
also init the console before starting the plymouth daemon
2011-05-03 09:59:14 +02:00
Harald Hoyer
a7ee1cd7f6 test/TEST-13-ENC-RAID-LVM: double test root disk space 2011-05-03 09:59:14 +02:00
Harald Hoyer
c3f7567a65 dracut.kernel.7.xml: clarify iscsi_firmware parameter usage 2011-05-02 11:33:05 +02:00
Harald Hoyer
ba7457ee00 network/parse-ip-opts.sh: fix ifname for ibft with all args 2011-05-02 11:30:29 +02:00
Harald Hoyer
7b069d5ea7 network/net-genrules.sh: also honor rename events 2011-05-02 11:29:58 +02:00
Marian Ganisin
c34130f705 don't overwrite ifname=
[Harald Hoyer <harald@redhat.com>: replaced grep with strstr]
[Harald Hoyer <harald@redhat.com>: handle multiple ifname= arguments]
2011-05-02 11:28:29 +02:00
Marian Ganisin
cc8f077e9f skip condition fixed 2011-05-02 11:28:22 +02:00
Marian Ganisin
ccacb45c52 correct module name 2011-05-02 11:28:04 +02:00
Harald Hoyer
1325cddee9 let rpc user own /var/lib/rpcbind
https://bugzilla.redhat.com/show_bug.cgi?id=698160
2011-05-02 11:27:12 +02:00
Harald Hoyer
80df37f475 fcoe: moved edd detection to settled initqueue
At the time of modprobing edd, all pci devices must exist and have to be
initialized for the symlinks to work.
2011-05-02 11:25:13 +02:00
Harald Hoyer
979c4a9304 dracut: revert prelink, if fips module was used 2011-05-02 11:19:12 +02:00
Harald Hoyer
4257798f8a fips: forward port RHEL-6 fips changes
- also support FIPS on separate LVM partition
- use small settle loop to get /boot
- "set -e" has no effect, if we use "||"
- make fips work with encrypted root and seperate boot
- moved to pre-pivot to support /boot in /
2011-05-02 11:15:46 +02:00
Harald Hoyer
12b9736228 dm: add 11-dm.rules for udev-168 and cleanup-db
add OPTIONS+="db_persist" to dm devices, to persist through a
udevadm info --cleanup-db
2011-05-02 10:55:44 +02:00
Amadeusz Żołnowski
64fcb3cce7 kernel-modules: inst modules.builtin if there's no modules.builtin.bin
Also report failure if none of them exist.
2011-04-28 15:44:54 +02:00
Michal Soltys
336eb5b04c modules.d/99base/init: missing slash in ismounted check
ismounted sys -> ismounted /sys

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-04-28 15:44:54 +02:00
Harald Hoyer
f024bf0dcd base, crypt: install umount, because it is used 2011-04-20 16:51:39 +02:00
Harald Hoyer
fd786adcf5 dracut: make prefix configurable 2011-04-20 16:47:40 +02:00
Harald Hoyer
0743486127 test/TEST-11-LVM, test/TEST-14-IMSM: update test cases
- more diskspace
- add /run
- drop to shell in test-init
2011-04-14 15:24:50 +02:00
Harald Hoyer
bf512ee2e0 base/init: export RD_TIMESTAMP 2011-04-14 15:23:05 +02:00
Harald Hoyer
b99dc517d6 inc version 2011-04-14 12:03:24 +02:00
Harald Hoyer
6a168568a5 base/init: use "udevadm control --exit" and "udevadm info --cleanup-db"
For udev >= 168 use the advanced udevadm features for shutting down udev.

Thanks Kay!!!
2011-04-14 12:00:11 +02:00
Harald Hoyer
dbad9f4661 Move all files to /run/initramfs
Given that we boot into a modern Linux distribution with the "/run" toplevel
directory, we can easily mount move the whole /run directory to the real
root in the end and have the complete initramfs later on in
/run/initramfs. All log files and /run states are still accessible and
to save space /run/initramfs can be removed later on.

Because the kernel does not mount a tmpfs on /run prior to unpacking the
initramfs cpio image, we have to copy ourselves very early to a tmpfs
and mount it on /run.
Due to lazy umount the old initramfs binaries should
be removed in the end by switch_root.

This feature can be turned on with "--prefix".
2011-04-12 12:08:50 +02:00
Harald Hoyer
7eb40c488c base: s#initlog#loginit#g for consistency 2011-04-12 11:07:40 +02:00
Harald Hoyer
2a9b703903 set udev property hookdir
Revert "mdraid/65-md-incremental-imsm.rules: s#$hookdir#/lib/dracut/hooks/"

This reverts commit e1f68dc6a0.
2011-04-12 08:45:31 +02:00
Harald Hoyer
65e0dd452c base/init: removed rd.copystate
all files are available in /run/initramfs
2011-04-12 08:32:03 +02:00
Harald Hoyer
5d7cdc38d0 base/init: removed rd.timestamp and automatically export RD_* 2011-04-12 08:30:33 +02:00
Harald Hoyer
e1f68dc6a0 mdraid/65-md-incremental-imsm.rules: s#$hookdir#/lib/dracut/hooks/ 2011-04-11 19:25:00 +02:00
Harald Hoyer
06ae51be51 TEST-50-MULTINIC/client-init: drop to shell, if "rd.shell" 2011-04-11 19:24:59 +02:00
Harald Hoyer
8a6ecb19b9 TEST-50-MULTINIC/test.sh: add /run dir and "ls" to client image 2011-04-11 19:24:59 +02:00
Harald Hoyer
1254925f1e dracut: do not install ld.so.conf* for kernel-only 2011-04-11 19:24:59 +02:00
Harald Hoyer
a6c34848eb base/init: set DRACUT_QUIET based on "loglevel" and "quiet" 2011-04-11 19:24:59 +02:00
Harald Hoyer
182660d864 base/init: set PATH like new kernels do 2011-04-11 13:58:33 +02:00
Harald Hoyer
3fc621ee45 iscsi/mount-lun.sh: use NEWROOT 2011-04-11 13:35:27 +02:00
Harald Hoyer
8234b92d85 crypt/cryptroot-ask.sh: check and use NEWROOT 2011-04-11 13:34:58 +02:00
Harald Hoyer
6822764f25 base/dracut-lib.sh: add ismounted() 2011-04-11 13:34:34 +02:00
Harald Hoyer
0d837ebf2a base/dracut-lib.sh: turn on PS4 for bash debugging 2011-04-11 13:34:06 +02:00
Harald Hoyer
8f5d36896d loginit: create pid and kill loginit by pid 2011-04-11 13:17:24 +02:00
Harald Hoyer
e365864bbc removed switch_root.c 2011-04-11 13:12:30 +02:00
Harald Hoyer
df60555037 precreate /run/udev/rules.d 2011-04-11 13:02:14 +02:00
Harald Hoyer
6730280c5b crypt/parse-crypt.sh: fixed rule creation
"\n" was missing
create rules file on tmp file and rename it later
2011-04-08 13:50:10 +02:00
Harald Hoyer
fb59f4c967 get rid of absolute PATHs 2011-04-08 13:49:06 +02:00
Harald Hoyer
77e2cadd88 base/init: fixed "unset" of vars 2011-04-08 13:27:28 +02:00
Harald Hoyer
a2cb4dbc82 base/dracut-lib.sh:incol2() return 1 on error 2011-04-08 13:27:07 +02:00
Harald Hoyer
36e30eb096 init: s/RDDEBUG/RD_DEBUG/g 2011-04-08 13:26:23 +02:00
Harald Hoyer
03f405bc04 init: move /.die to /run/initramfs/.die 2011-04-08 13:26:02 +02:00
Harald Hoyer
4abb498d79 initqueue: add "--finished" 2011-04-08 13:25:49 +02:00
Harald Hoyer
ef85627e93 test/TEST-01-BASIC/test.sh: uncomment debug options 2011-04-08 13:25:22 +02:00
Harald Hoyer
486ec65745 TEST-01-BASIC: softlink fstab to proc/mounts in test-init 2011-04-08 13:25:18 +02:00
Harald Hoyer
dd26a551c2 test/TEST-01-BASIC: add basic ext3 test 2011-04-08 11:17:31 +02:00
Alan Pevec
93724aa28f dmsquash-live: hide plymouth while checking ISO
Fixes long-standing FIXME
Latest isomd5sum added an option to abort media check with ESC key,
but that key is taken by plymouth for switching to the detailed log
messages, making it impossible to abort checkisomd5.
Tested in text mode.
2011-04-08 10:54:05 +02:00
Harald Hoyer
4c2a28c64b dracut-functions: ln -s with '-fn' 2011-04-08 10:42:42 +02:00
Harald Hoyer
2a72df9cf0 busybox/module-setup.sh: do not create absolute symlinks 2011-04-08 10:39:57 +02:00
Harald Hoyer
6600691ff1 README.modules: update documentation 2011-04-08 10:39:52 +02:00
Harald Hoyer
d125a47061 mkdir always with -m 0755 2011-04-08 10:39:46 +02:00
Harald Hoyer
8daaa46478 loginit: fix loglevel 2011-04-08 10:39:40 +02:00
Harald Hoyer
0a9d5422c6 dracut.kernel.7.xml: add FIPS parameter doc 2011-04-08 10:34:01 +02:00
Harald Hoyer
02c1bd6bb6 fips: add "rd.fips.skipkernel" boot option 2011-04-08 10:27:32 +02:00
Harald Hoyer
1cd1da13da iscsi: add additional hardcoded modules
https://bugzilla.redhat.com/show_bug.cgi?id=692781
https://bugzilla.redhat.com/show_bug.cgi?id=689694
2011-04-08 10:26:33 +02:00
Harald Hoyer
ea8ca78af0 crypt/parse-crypt.sh: fix udev rule creation 2011-04-08 10:23:58 +02:00
Harald Hoyer
dc4fc03e4b fcoe/parse-fcoe.sh: s#source#.#g
dash does not understand "source"
2011-04-08 10:22:59 +02:00
Amadeusz Żołnowski
76353076c0 dracut: don't fail on empty /etc/ld.so.conf.d/ 2011-04-04 14:12:25 +02:00
Harald Hoyer
829c258554 lsinitrd: default to /boot/initramfs-$(uname -r).img 2011-03-31 19:50:31 +02:00
Harald Hoyer
5dcd565dab NEWS: inc version and add NEWS 2011-03-31 18:49:27 +02:00
Harald Hoyer
7838d85351 dracut.spec: drop net-tools requirement 2011-03-31 18:49:02 +02:00
Harald Hoyer
db59288d79 PKGBUILD, debian/*: changed URLs to kernel.org 2011-03-31 18:48:27 +02:00
Harald Hoyer
82794b4b90 dracut.spec: fixed URL 2011-03-31 18:45:49 +02:00
Harald Hoyer
b4fbdbbe1e Makefile: "make dist" now generates .tar.gz 2011-03-31 18:45:01 +02:00
Harald Hoyer
9853774351 base/init: reset PATH after the /run move 2011-03-31 14:10:22 +02:00
Harald Hoyer
79471f365e base/dracut-lib.sh: changed kmgs log levels
New kernel/dmesg understands syslog levels, so we log with "+24" to indicate
that dracut is a daemon (current init).
2011-03-31 13:12:38 +02:00
Harald Hoyer
98b108284c dmsquash-live/dmsquash-live-genrules.sh: fixed udev rule location
Fixed the rule directory to $UDEVRULESD
2011-03-31 08:24:15 +02:00
Harald Hoyer
8ee30d09a4 plymouth: use /run/plymouth/pid instead of /run/initramfs/plymouth 2011-03-30 16:24:57 +02:00
Harald Hoyer
01583ae4ad fips: fixed "boot=<dev>" handling 2011-03-30 14:57:01 +02:00
Harald Hoyer
249f8b5bfc base/init: fixed compat /dev/.initramfs copy 2011-03-30 03:23:37 +02:00
Harald Hoyer
561d7f4d7c doc: s#/init.log#/run/initramfs/init.log#g 2011-03-30 03:22:14 +02:00
Harald Hoyer
4ad453445a base/dracut-lib.sh: relax getargbool value parsing
if a non-boolean value was specified, like "yes" or "no",
getargbool() would error, because we check for "$val -eq 0"
2011-03-30 01:45:17 +02:00
Harald Hoyer
e620bb01da base/init: fix cdrom polling 2011-03-30 00:01:00 +02:00
Harald Hoyer
7931bf0420 plymouth gensplash: check for console_init before calling it
Thanks Jon Ander Hernandez!
2011-03-29 16:38:11 +02:00
Jon Ander Hernandez
c174aea07d Ensure rpc_pipefs is mounted
While on some systems (like Fedora) rpc_pipefs is mounted
automatically when sunrpc module is loaded, on Debian based systems it
needs to be mounted manually.
2011-03-29 16:17:03 +02:00
Harald Hoyer
85323dcbb9 40network/dhcp-root.sh: s#initqueue-finished#initqueue/finished#g 2011-03-29 15:46:53 +02:00
Harald Hoyer
8bc650d9dc dracut: add "/lib/firmware/updates" to default firmware path 2011-03-29 15:32:34 +02:00
Harald Hoyer
ea216a650e dracut: removed extra char in "Including modules done" 2011-03-29 14:45:08 +02:00
Harald Hoyer
a16ebfd56a dracut-functions: bashified ret=ret+$? to ret+=$? 2011-03-29 11:30:27 +02:00
Harald Hoyer
2aad23443e dracut: source reformat with line breaks 2011-03-29 11:27:15 +02:00
Harald Hoyer
8a5354a9a5 dracut: simplify $kernel version argument setting 2011-03-29 11:21:54 +02:00
Amadeusz Żołnowski
dbf381f7fb dracut: don't skip zero-length string outfile argument
When '' was passed as outfile, dracut generated name with following
pattern:

  /boot/initramfs-$kernel

With commit 486a1b9324 dracut skips ''
argument.
2011-03-29 10:52:50 +02:00
Harald Hoyer
1080ce600a Revert "dracut: don't skip zero-length string outfile argument"
This reverts commit 0dd37f13c5.
2011-03-29 10:52:22 +02:00
Harald Hoyer
0dd37f13c5 dracut: don't skip zero-length string outfile argument
When '' was passed as outfile, dracut generated name with following
pattern:

  /boot/initramfs-${kernel}.img

With commit 486a1b9324 dracut skips ''
argument.
2011-03-29 10:25:24 +02:00
Harald Hoyer
6981a0bfe7 NEWS: update 2011-03-28 21:09:34 +02:00
Harald Hoyer
e232c168d8 dracut.conf.d/fedora.conf.example: change stdloglvl to 3 2011-03-28 21:08:54 +02:00
Harald Hoyer
66259efc14 AUTHORS: update 2011-03-28 21:08:23 +02:00
Harald Hoyer
dc36969ae1 02caps: changed pre-pivot priority to 00
caps should be dropped before any actions with the mounted rootfs happen
2011-03-28 20:33:20 +02:00
Harald Hoyer
ec88eb91d6 10rpmversion/version.sh: version file moved to /lib/dracut 2011-03-28 20:26:29 +02:00
Harald Hoyer
9a54908fd7 NEWS: update 2011-03-28 17:52:56 +02:00
Harald Hoyer
5b2cc025f4 99base/init: fall back to manual cdrom polling 2011-03-28 17:52:33 +02:00
Harald Hoyer
1489c9b1af 40network: make dhclient mandatory again 2011-03-28 17:23:06 +02:00
Amadeusz Żołnowski
86d404513f 40network: install dhclient, brctl and ifenslave optionally
Warning given by check() function in case if any of those binaries
doesn't exist was removed, because it's produces by "dracut_install -o"
later.
2011-03-25 16:28:28 +01:00
Amadeusz Żołnowski
adcccd187d dracut.conf.5.xml, dracut.8.xml: logging options and -M documented 2011-03-25 16:24:10 +01:00
Amadeusz Żołnowski
956af8f26e dracut: new option: -M, --show-modules - lists modules on build
Module name is printed to standard output before its inclusion.
2011-03-25 16:24:09 +01:00
Amadeusz Żołnowski
d60b71e8e8 dracut-logger: /dev/log is socket, not character device
Fixed typo in error message by the way.
2011-03-25 16:23:49 +01:00
Amadeusz Żołnowski
d1ef3951f3 modules.d: logging functions adjusted to dracut-logger 2011-03-25 16:22:05 +01:00
Amadeusz Żołnowski
e27770e10c dracut-functions: logging functions adjusted to dracut-logger 2011-03-25 16:21:32 +01:00
Amadeusz Żołnowski
0b70674329 dracut-functions: code formatting corrected 2011-03-25 16:21:08 +01:00
Amadeusz Żołnowski
b991617f19 dracut: when stdloglvl not set defaulted to 0 - should be 4
Removed unnecessary stdloglvl default in dracut.conf.
2011-03-25 16:10:48 +01:00
Amadeusz Żołnowski
9ebc51100b dracut-logger: 'user' facility for build-time and 'daemon' for boot-time 2011-03-25 16:10:48 +01:00
Harald Hoyer
0874654c78 dracut-functions: try to find dracutbasedir, if not set 2011-03-25 16:10:47 +01:00
Harald Hoyer
d6d53f60b2 dracut-functions: use "type" to determine the need of sourcing dracut-logger 2011-03-25 16:10:47 +01:00
Harald Hoyer
e94f4cce47 loginit: log to /run/initramfs/init.log 2011-03-25 16:10:47 +01:00
Harald Hoyer
07fa164e16 loginit: use /run/initramfs/init.log.end as end marker 2011-03-25 16:10:47 +01:00
Harald Hoyer
9e7a3bf242 base/dracut-lib.sh: s/RDDEBUG/RD_DEBUG/g
RDDEBUG would be unset by the environment cleanup in init and logging
would be turned off afterwards.
2011-03-25 16:10:47 +01:00
Harald Hoyer
0b53ca70b6 Move all hooks to "$hookdir"
hookdir=/lib/dracut/hooks for now, to keep the root directory clean
2011-03-25 16:10:46 +01:00
Harald Hoyer
c9f1e3d1f4 check for getarg() function before sourcing dracut-lib.sh
make use of "type getarg" to check, if we really need to source
dracut-lib.sh
2011-03-25 16:10:46 +01:00
Harald Hoyer
c97e1a76f3 dracut-functions: install udev rules
Install the udev rules to /lib, if the original rule is found there.
2011-03-25 16:10:46 +01:00
Harald Hoyer
94f4923039 mkdir -m 0755
add the missing directory permissions to mkdir
2011-03-25 15:44:00 +01:00
Harald Hoyer
e86a6d390d network: install brctl optionally 2011-03-25 15:44:00 +01:00
Harald Hoyer
4af5e99124 move dracut version file to /lib/dracut/dracut-$version 2011-03-25 15:44:00 +01:00
Harald Hoyer
7bfacf2f21 dracut: use readlink for drautbasedir if "-l" 2011-03-25 15:44:00 +01:00
Harald Hoyer
e43df9e342 base/init: fixed /dev/.initramfs creation, for no "/run" 2011-03-25 15:43:54 +01:00
Harald Hoyer
52eed26853 dracut: fixed directory handling, if image is created in "/" 2011-03-24 11:30:23 +01:00
Victor Lowther
4b3124ae85 Update PKGBUILD to force backups of /etc/dracut.conf on install. 2011-03-23 11:29:36 +01:00
Victor Lowther
3a71443953 Make compression do The Right Thing based on what is in the config files. 2011-03-23 11:29:36 +01:00
Victor Lowther
5e6c3b035d Update and slightly refactor compression handling.
This adds a --compress= option along with xz support for 2.6.38 and above.
2011-03-23 11:29:13 +01:00
Michal Soltys
e5e5c8952d dracut: fix arithemtic ${#VAR[@]} tests
This patch fixes a handful of ${#VAR[@]} tests, which can't be evaluated
as text expressions - the results is always true in such case, because
"0" is non-empty string.

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-03-23 11:25:55 +01:00
Harald Hoyer
19f3a804e7 s#/dev/.run#/run#g
Move things where they really belong to.
2011-03-18 18:23:44 +01:00
Harald Hoyer
519d339233 dracut-logger: don't debug log "return 0" of dlog() 2011-03-17 12:16:33 +01:00
Harald Hoyer
1e64e4939f dracut-logger: turn off xtrace for log messages
Turn off xtrace for log messages and turn it back on, if $debug is set.
2011-03-17 12:13:44 +01:00
Harald Hoyer
da22a02130 Makefile: split syntax check from target "check" to "syncheck"
also add syntax check for the bash scripts
2011-03-17 12:12:48 +01:00
Amadeusz Żołnowski
432196aef8 dracut: script adjusted to new logging facility; -v changed
-v meaning has changed. Now it increases verbosity level. -q option has
been added, which decreases verbosity level. Both options might be
specified multiple times.
2011-03-16 21:42:32 +01:00
Amadeusz Żołnowski
46265a9d3e dracut-logger: make $maxloglvl public
$maxloglvl might be useful to check, if expensive informational
operation is going to be logged at all, before executing it.
2011-03-16 21:42:32 +01:00
Amadeusz Żołnowski
1953052994 dracut: install ld.so.conf* with dracut_install instead of cp 2011-03-16 21:42:30 +01:00
Harald Hoyer
0afae1c7ce base/init: for udev > 166 we will create and use /dev/.run/udev/rules.d
See:
http://git.kernel.org/?p=linux/hotplug/udev.git;a=commitdiff;h=e68b4c2857942257268134cf7028b80f5a6a8103;hp=98ab6a377285d5943563cfa397e8b350e43878ec
2011-03-16 21:24:57 +01:00
Harald Hoyer
e7b1b342bf dracut: add "--check=crc32" to xz compression
As mentioned in kernel/Documentation/xz.txt:

...
Notes on compression options

  Since the XZ Embedded supports only streams with no integrity check
  or CRC32, make sure that you don't use some other integrity check
  type when encoding files that are supposed to be decoded by the
  kernel. With liblzma, you need to use either LZMA_CHECK_NONE or
  LZMA_CHECK_CRC32 when encoding. With the xz command line tool, use
  --check=none or --check=crc32.

  Using CRC32 is strongly recommended unless there is some other layer
  which will verify the integrity of the uncompressed data anyway.
...
2011-03-16 21:17:26 +01:00
Harald Hoyer
f709fa439b Install dracut-logger and add it to the spec file 2011-03-16 13:56:20 +01:00
Amadeusz Żołnowski
510ef3af84 dracut-logger: convertion to kernel console log level for kmsg 2011-03-16 12:01:42 +01:00
Will Woods
bb08c7632a docs: "/conf/conf.d" should be "/etc/conf.d"
The code actually looks in /etc/conf.d; make the docs reflect that.
2011-03-16 12:01:39 +01:00
Harald Hoyer
200c7fd4b2 dracut-logger: wrap dlog to read stdin
Moved dlog() to _do_dlog() and created dlog() which reads from stdin if
no arguments (except the loglevel) are given.

This enables e.g.:

dwarn "This is a warning!"

echo "This is a warning!" | dwarn
2011-03-15 20:51:58 +01:00
Harald Hoyer
4f7654715f dracut: initialize stdloglvl_l 2011-03-15 20:07:01 +01:00
Harald Hoyer
7fc4fb0131 dracut-logger: export _maxloglvl to skip multiple dlog_init() 2011-03-15 20:03:17 +01:00
Amadeusz Żołnowski
e103615be2 dracut-logger: logging facility module for build- and boot-time
It's dash compatible to be used also at boot-time. For now it's included
by dracut-functions and replaces functions: dinfo(), dwarning() and
derror(). New options are introduced: -L|--stdlog, and -q|--quiet to
control stderr verbosity. Logging to file or syslog may be controlled by
options set in config file.

Note that code is not adjusted to the meaning of the new logging
functions, yet.

Doxygen formatted documentation (as a proposal, by the way) is included
in dracut-logger.
2011-03-15 19:52:59 +01:00
Harald Hoyer
d486e8f607 dracut: add --xz to compress with xz 2011-03-15 19:51:07 +01:00
Harald Hoyer
66fe35eb3e lsinitrd: cope with xz and lzma compressed images 2011-03-15 19:51:07 +01:00
Harald Hoyer
29cfd6c80b syslog: fixed warn() and dwarning() calls 2011-03-15 19:51:07 +01:00
Will Woods
fe17f4e86b dmsquash-live: use 'rootfs.img' for rootfs image name
Every image gets handled the same way regardless of filesystem, so
let's use a filesystem-neutral name (rather than adding new
lines for every fstype anyone might want to use).
2011-03-14 16:30:39 +01:00
Andrey Borzenkov
6927f09e1c cryptoroot-ask: limit number of plymouth password requests
Set number ot retries to 5 to align with non-plymouth case.

Signed-off-by: Andrey Borzenkov <arvidjaar@gmail.com>
2011-03-11 11:44:02 +01:00
Andrey Borzenkov
96d1d01572 cryptroot-ask: check that plymouth is running before use
Otherwise there is no way to skip pasword prompt. --has-active-vt
seems to correctly catch also the case when plymouthd is started
but splash is disabled.

Signed-off-by: Andrey Borzenkov <arvidjaar@gmail.com>
2011-03-11 09:43:44 +01:00
Harald Hoyer
b151c3b1fe dracut.conf.d/fedora.conf.example: turn off fips again
use dracut.conf.d/fips.conf.example and install it to
/etc/dracut.conf.d/40-fips.conf to turn it on
2011-03-10 21:38:02 +01:00
Harald Hoyer
28eb2436c8 TEST-50-MULTINIC: change /dev/.initramfs to /dev/.run/initramfs 2011-03-10 19:49:08 +01:00
Harald Hoyer
4877bb510e dracut.spec: inc release to 009 prerelease 2011-03-10 19:25:09 +01:00
Harald Hoyer
2aee7e16ac dracut.spec: remove insmodpost module 2011-03-10 19:23:21 +01:00
Harald Hoyer
52881470ee dracut.spec: add caps subpackage 2011-03-10 19:22:40 +01:00
Harald Hoyer
77e607a3a7 prepare for future udev rules.d location
future udev will have rules.d in /dev/.run/udev/rules.d

Also remove compat symlinks, because we want to get rid of these files
anyway.
2011-03-10 19:19:09 +01:00
Harald Hoyer
1e2a167fe6 rootfs-block/mount-root.sh: rename flag file for fsck
/dev/.run/initramfs/fsck -> /dev/.run/initramfs/root-fsck
2011-03-10 19:17:23 +01:00
Harald Hoyer
2d7fe72bbb base/init: copy /init.log with rd.copystate=1 2011-03-10 19:16:29 +01:00
Harald Hoyer
661f9a3451 dracut: let some parameters be specified multiple times
These parameters can now be specified multiple times:
-a|--add
--add-drivers
-m|--modules
-o|--omit
-d|--drivers
--filesystems
-I|--install
--fwdir
-i|--include
2011-03-10 17:22:56 +01:00
Harald Hoyer
8466db967e dracut-functions: add pop() and push() 2011-03-10 17:22:56 +01:00
Harald Hoyer
486a1b9324 dracut: make options position independent
now this is possible:
$ dracut test.img -f
$ dracut test.img '' -f
2011-03-10 17:22:56 +01:00
Harald Hoyer
4fea3ea6f1 dracut: make "-i, --include SOURCE TARGET" work for files, too 2011-03-10 17:22:56 +01:00
Harald Hoyer
529349c66d add caps module, to drop capabilities
This adds the following parameters:
rd.caps=1
	turn the caps module on/off
rd.caps.initdrop=cap_sys_module,cap_sys_rawio
	drop the specified comma seperated capabilities
rd.caps.disablemodules=1
	turn off module loading
rd.caps.disablekexec=1
	turn off the kexec functionality

If module loading is turned off, all modules have to be loaded in the
initramfs, which are used later on. This can be done with
"rd.driver.pre="
rd.driver.pre=autofs4,sunrpc,ipt_REJECT,nf_conntrack_ipv4,....

Because the kernel command line would get huge with all those drivers, I
recommend to make use of $initramfs/etc/cmdline.

So, all rd.caps.* and rd.driver.pre arguments are in caps.conf can be
copied to $initramfs/etc/cmdline with "-i caps.conf /etc/cmdline".

Also all modules have to be loaded in the initramfs via "--add-drivers".

The resulting initramfs creation would look like this:

  --add-drivers "autofs4 sunrpc ipt_REJECT nf_conntrack_ipv4 \
  nf_defrag_ipv4 iptable_filter ip_tables
  ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack
  ip6table_filter ip6_tables dm_mirror dm_region_hash dm_log uinput ppdev
  parport_pc parport ipv6 sg 8139too 8139cp mii i2c_piix4 i2c_core ext3
  jbd mbcache sd_mod crc_t10dif sr_mod cdrom ata_generic pata_acpi ata_piix
  dm_mod" \
  /boot/initramfs-caps.img
2011-03-10 17:22:56 +01:00
Vadim Kuznetsov
80bafe6d36 mkinitrd: fix incorrect basename in mkinitrd usage message
Steps to Reproduce:
1. run mkinitrd -h

Actual results:
$ mkinitrd
usage: /usr/sbin [--version] [--help] [-v] [-f] [--preload <module>]
       [--image-version] [--with=<module>]
        <initrd-image> <kernel-version>

Expected results:
$ mkinitrd
usage: mkinitrd [--version] [--help] [-v] [-f] [--preload <module>]
       [--image-version] [--with=<module>]
       <initrd-image> <kernel-version>
2011-03-10 17:22:55 +01:00
Harald Hoyer
7838ab5010 kernel-modules/module-setup.sh: fix instmods $filesystems
especially in host_only mode, $filesystems was not honored
2011-03-10 17:22:55 +01:00
Harald Hoyer
5078c98abe move insmodpost and blacklisting to 90kernel-modules
also correctly parse rd.driver.{blacklist,pre,post}
2011-03-10 17:22:25 +01:00
Harald Hoyer
4c4c8b7239 rd.driver.*: accept comma separated list
accept a comma seperated list of kernel drivers for
rd.driver.blacklist
rd.driver.pre
rd.driver.post
2011-03-10 14:11:42 +01:00
Harald Hoyer
b177e9133e move all /dev/.initramfs to /dev/.run/initramfs
We want all "/var/run" information to live in /dev/.run, until the real
root is mounted.
Therefore we mount a tmpfs on /dev/.run, which can/will be bind/move mounted
on /var/run later on.
2011-03-10 12:40:47 +01:00
Amadeusz Żołnowski
9fe4f5ff25 crypt: installing all crypto kernel modules instead of few selected 2011-03-09 18:09:23 +01:00
Will Woods
0ddd68f7e6 Add support for in-initramfs live images with "root=live:/path/name.img"
This allows creation of initramfs images which contain a Live system.
The primary use for this is keeping very large initramfs-based systems
(e.g. anaconda, the Fedora installer) compressed in-memory, by using a
compressed filesystem image like squashfs or btrfs.

dmsquash-live-genrules.sh will initqueue dmsquash-live-root itself
(rather than making udev rules) if the given live "device" is actually
an existing, plain file.

parse-dmsquash-live.sh will only accept paths that end in ".img".
dmsquash-live-root will only handle images named "*squashfs.img",
"*ext3fs.img", or "*btrfs.img".
2011-03-09 12:10:22 +01:00
Will Woods
533318113b Look for btrfs.img in dmsquash-live-root
Btrfs is an excellent option for the root fs image for live systems,
especially since it does its own transparent compression.
2011-03-09 12:09:34 +01:00
Will Woods
a5e33c7d6f Use 'btrfs' command rather than 'btrfsctl', and install btrfs driver
btrfsctl is being replaced by the btrfs command in the upstream
tools, so change accordingly. Also, if we're using the btrfs module
we should probably make sure the btrfs driver gets installed.
2011-03-09 12:09:29 +01:00
Will Woods
dfec8467b9 Change EXT3FS to FSIMG
Change the EXT3FS variable to FSIMG, since we might want to use other
filesystems as our live root. Change comments to reflect this fact.
2011-03-09 12:09:24 +01:00
Will Woods
44159d0598 Make dmsquash-live install the squashfs driver
dmsquash-live uses squashfs, so let's make sure the driver is installed
2011-03-09 12:09:20 +01:00
Will Woods
fe9cdf741f inst_dir: fix handling of relative symlinks outside the current dir
inst_dir used the following to try to resolve a relative path:
  [[ $target = ${target##*/} ]] && target="${file%/*}/$target"
  inst_dir $target

This will only match if $target has no slashes, so something like
/usr/bin -> ../sbin would result in: inst_dir ../sbin, or
/usr/share -> local/share would result in: inst_dir local/share
which is not going to do the right thing.

Instead, we resolve any non-absolute link, like so:
  [[ $target == ${target#/} ]] && target=$(dirname "$file")/$target
Thus /usr/bin -> ../sbin results in: inst_dir /usr/../sbin, and
/usr/share -> local/share results in: inst_dir /usr/local/share
which is what you would expect.
2011-03-09 12:09:10 +01:00
Will Woods
3d88d27810 Fix bash logic typo/buglet ([ condition ] & expression) 2011-03-09 12:08:59 +01:00
Amadeusz Żołnowski
d8e8e14e0b listing modules fixed
Modules were not listed because code relied only on deprecated 'install'
and 'installkernel' scripts. Check for 'module-setup.sh' script was
added.
2011-03-09 12:08:58 +01:00
Harald Hoyer
fa79f00803 test/*/test.sh: mv 01hard-off.sh 000-hard-off.sh
otherwise "die" will let the kernel panic
2011-03-07 16:22:42 +01:00
Amadeusz Żołnowski
b20ff981c4 crypt-lib.sh: moved IFS=: from before 'read' to before 'while'
Some versions of dash don't behave as expected with code like this:

while IFS=: read a b c; do
    blah
done

Thanks to Eric Mertens who identified the issue.
2011-03-07 13:56:41 +01:00
Harald Hoyer
535ad9d1fb dracut-lib: improve die() logging 2011-03-07 13:37:22 +01:00
Harald Hoyer
a382492bf3 init: improve emergency logging 2011-03-07 13:37:22 +01:00
Harald Hoyer
8be12be16a biosdevname: be verbose about biosdevname activation 2011-03-07 13:37:22 +01:00
Harald Hoyer
6fecffaab5 fcoe: add EDD parsing
[backport of 70dfe537]
2011-03-07 13:37:21 +01:00
Harald Hoyer
6767fdaaed lvm: move emergency script from 00 to 90
[forward port of cfb4747e]
2011-03-07 13:37:21 +01:00
Harald Hoyer
fcbcc89bb2 crypt: fix emergency script generation
[ forward port of e45a2dba]
2011-03-07 13:37:20 +01:00
Harald Hoyer
38ba0d7a62 network: add iBFT interface configuration
[forward port of 0828d4c357]
2011-03-07 13:37:20 +01:00
Harald Hoyer
10b5dca0f7 fips/fips.sh: do not load tcrypt with "noexit" parameter
"noexit=1" is the default mode for the tcrypt module now.

[forward ported 7e7308158c]
2011-03-07 13:37:20 +01:00
Harald Hoyer
b60d5e90a5 fips/fips.sh: die(), if boot=<device> is not present or has wrong format 2011-03-07 13:37:19 +01:00
Harald Hoyer
674bdee804 fips/fips.sh: only trigger udev, if device node of boot is not present 2011-03-07 13:37:19 +01:00
Harald Hoyer
62d0c4e7c1 dracut.spec: add dracut logrotate 2011-03-07 13:37:19 +01:00
Harald Hoyer
0b440844bd dracut-functions: fixed instmods() return value
The FIPS installkernel() relies on the instmods() return value. So only
return 0, if the module and its dependencies were actually installed
correctly.
2011-03-07 13:37:18 +01:00
Harald Hoyer
724b87a6f8 dracut-functions: check for missing dracut modules
If the user explicitly specified "-a <modules>" or "-m <modules>",
   warn him about possible missing modules.
2011-03-07 13:37:18 +01:00
Harald Hoyer
5242d8fb57 dracut-functions: if .hmac files are present, install them also
For FIPS mode, we need all checksum files, called .<filename>.hmac. So,
if we find one, we install it.
2011-03-07 13:37:18 +01:00
Harald Hoyer
1a0d82a3dd dracut-functions: space 2011-03-07 13:37:17 +01:00
Harald Hoyer
ebaee770ac dracut-functions: more verbose logging message format 2011-03-07 13:37:17 +01:00
Harald Hoyer
ee89f47453 dracut-functions: check if directory of logfile is writable
Do not check, if the logfile itsself is writable. Check the directory
instead.
2011-03-07 13:37:11 +01:00
Harald Hoyer
58dad7025b dracut: more verbose logging 2011-03-07 12:54:47 +01:00
Amadeusz Żołnowski
5d72984a01 Gentoo ebuild for LVM2 prior to 2.02.63-r1 doesn't install rules:
10-dm.rules
  11-dm-lvm.rules
  13-dm-disk.rules
  95-dm-notify.rules

but provides only 64-device-mapper.rules combining more or less the
above rules files.
2011-03-04 13:07:28 +01:00
Amadeusz Żołnowski
f90fd5b34b dracut-functions: fixed doubled $initdir prefix inst_library()
Commit 172d85b9c9 caused following error:

./dracut-functions: line 307: cd: /tmp/initramfs.mP7cPY/tmp/initramfs.mP7cPY/lib64: No such file or directory

Patch removes beginning $initdir for symlink case.
2011-02-25 10:06:35 +01:00
Harald Hoyer
9d49507f80 kernel-modules: add hid-cherry hid-logitech hid-microsoft kbd drivers 2011-02-23 16:34:23 +01:00
Harald Hoyer
e38e9e3f5e AUTHORS: update 2011-02-23 13:35:46 +01:00
Harald Hoyer
6f590cd1c5 dracut: do not use "derror", when we cannot find dracut-functions 2011-02-23 13:32:31 +01:00
Harald Hoyer
41f90cbe50 dracut.spec: add /var/lib/initramfs 2011-02-23 13:21:07 +01:00
Harald Hoyer
7d4f1101bc add missing editor format commands 2011-02-23 09:41:08 +01:00
Harald Hoyer
8ce58f1f42 add missing shebang 2011-02-23 09:38:25 +01:00
Harald Hoyer
2826a877af 90lvm/lvm_scan.sh: removed garbage line 2011-02-22 18:40:40 +01:00
Harald Hoyer
53570e16c3 90lvm/lvm_scan.sh: fixed lvm version parsing 2011-02-22 17:45:11 +01:00
Harald Hoyer
94cce410aa vconsole.font.unicode -> vconsole.unicode 2011-02-21 09:23:27 +01:00
Andrey Borzenkov
06e07df001 fix c0a82e271e
Let inst_key_val usage agree with above patch :)

Also UNICODE is rather global console property, not font specific
(and if anything, is rather keyboard specific). Let it be just
vconsole.unicode

Signed-off-by: Andrey Borzenkov <arvidjaar@gmail.com>
Cc: initramfs@vger.kernel.org
2011-02-21 09:21:22 +01:00
Harald Hoyer
9edf1b206b init: set cdrom polling in kernel
and reset to -1 after we are done.
2011-02-18 13:27:31 +01:00
Harald Hoyer
440a4cc247 Makefile: do not dash syntax check module-setup.sh
module-setup.sh is bash syntax, so dash complains about bash contructs
2011-02-18 13:11:53 +01:00
Harald Hoyer
b282107fa9 lvm: use --sysinit, if lvm version >= v2.02.65 2011-02-18 10:58:39 +01:00
Harald Hoyer
0ce274f02b selinux: turn off selinux by default
In Fedora selinux is now handled by systemd. If you want to enable
selinux by default, just add it to your /etc/dracut.conf.d/01-dist.conf
with:
add_dracutmodules+=" selinux "
2011-02-18 09:44:47 +01:00
Harald Hoyer
c0a82e271e i18n: default to vconsole.font.unicode=1 2011-02-18 09:37:11 +01:00
Harald Hoyer
ebaed7d51f i18n: fixed config file parsing in hostonly mode
I accidently removed some parenthesis.
2011-02-18 09:33:06 +01:00
Jon Ander Hernandez
172d85b9c9 dracut-functions: fixed installing libraries which links to another directory
$ ldd `which bash` | grep ld
/lib64/ld-linux-x86-64.so.2 (0x00007fa1cc3ff000)

$ readlink -f /lib64/ld-linux-x86-64.so.2
/lib/ld-2.12.1.so

So inst_library /lib64/ld-linux-x86-64.so.2 was doing :

(cd "/tmp/initramfs.4uaeD9/lib64" && ln -s "/lib/ld-2.12.1.so"
 "ld-linux-x86-64.so.2")

But, /tmp/initramfs.4uaeD9/lib64 -> /lib... :-S
2011-02-17 10:50:18 +01:00
Harald Hoyer
81c6e7fb69 dracut-functions: handle shared objects in find_binary w/o the exec flag 2011-02-17 10:50:16 +01:00
maximilian attems
f63c30d89b dracut: Don't suppress the modprobe error output.
It happens that either due to newer modprobe or missing depmod
module-init-tools cries.
Suppressing the error ensures for a funny debug search for the user.
Resulting initramfs is generally unbootable due to missing module deps.

Better use the quiet option of modprobe itself.
It makes it less chatty, but doesn't suppress "fatal" errors.

Signed-off-by: maximilian attems <max@stro.at>
2011-02-16 15:01:30 +01:00
Harald Hoyer
1cedde0681 plymouth: touch /dev/.systemd/plymouth
until plymouth does it itsself, touch /dev/.systemd/plymouth
https://bugzilla.redhat.com/show_bug.cgi?id=676302
2011-02-09 13:22:49 +01:00
Harald Hoyer
c965ed2db4 dracut.8.xml: corrected typo 2011-02-08 18:06:25 +01:00
Harald Hoyer
52889453c1 dracut-functions: write to $HOME/dracut.log instead of /tmp/dracut.log 2011-02-08 17:59:48 +01:00
Harald Hoyer
534b0525a5 dracut.spec: add biosdevname 2011-02-02 17:43:03 +01:00
Harald Hoyer
051501eea6 add rpmversion and fips to the fedora default modules 2011-02-02 17:39:45 +01:00
Harald Hoyer
71df3c4329 renamed module-info.sh to module-setup.sh 2011-02-02 16:35:18 +01:00
Harald Hoyer
6ae5caf008 version 008 2011-02-02 16:33:35 +01:00
Harald Hoyer
b9d7fda0e1 selinux: call emergency_shell for failures 2011-02-02 15:10:42 +01:00
Harald Hoyer
e6752f1a6c fips: add aes-xts module 2011-02-02 14:48:37 +01:00
Harald Hoyer
46bc0593ac dracut: use derror for error messages 2011-02-02 13:56:04 +01:00
Harald Hoyer
76c4613abc multipath: use new "-B" parameter 2011-02-02 13:56:04 +01:00
Harald Hoyer
7238aa0cf0 base/init: do not poll cdrom, if kernel supports polling 2011-02-02 13:56:03 +01:00
Harald Hoyer
95d2dabc25 replaced check,install,installkernel with module-info.sh 2011-02-02 13:56:03 +01:00
Harald Hoyer
07caee2662 add 97biosdevname dracut module 2011-01-26 13:01:10 +01:00
Harald Hoyer
b43f4df540 iscsi: changed parameters to new rd.iscsi style 2011-01-25 11:53:52 +01:00
Harald Hoyer
a2b5bb004d dracut.kernel.7.xml: s/rd_ZNET/rd.znet 2011-01-25 11:34:25 +01:00
Harald Hoyer
444061de67 base/init: drop "noexec" from /dev/shm 2011-01-25 10:35:20 +01:00
Harald Hoyer
ee1fa07f3d base/install: create emergency subdir 2011-01-24 13:41:24 +01:00
Harald Hoyer
cf3bc080c1 dracut.spec: removed "mount" requirement
mount is part of util-linux-ng. There is no mount package.
2011-01-17 11:15:16 +01:00
Harald Hoyer
2ca68bb82b base/install: make install of "less" optional 2011-01-07 12:05:42 +01:00
Harald Hoyer
e2d86d001a fips: s/==/= 2011-01-03 09:48:37 +01:00
Harald Hoyer
8082a0946e multipath/install: install the complete /etc/multipath directory
Resolves: rhbz#630911
2010-12-06 16:20:43 +01:00
Harald Hoyer
79799c954f mkinitrd-dracut.sh: add "--force"
Resolves: rhbz#626389
2010-12-06 16:19:27 +01:00
Harald Hoyer
1b434f1ba9 mdraid/parse-md.sh: create new rules, then mv to old one
If udevd is already running, then we should assemble the new rules files
in a seperate file first, before calling it *.rules

Resolves: rhbz#595096
2010-12-06 16:12:54 +01:00
Harald Hoyer
3003cfdf9e kernel-modules/installkernel: add hid_sunplus to keyboard drivers 2010-12-02 17:13:15 +01:00
Harald Hoyer
7c6eb15280 added dracut logo 2010-12-02 17:13:04 +01:00
Christian Heinz
ab9b7eee0a fix installation of `modules.builtin.bin'
`modules.builtin.bin' is installed like a regular file, thereby ending
up in the wrong place when `--kmoddir' is in effect. Fix this by
specifying the installation destination.
2010-11-26 09:36:18 +01:00
Tomasz Torcz
3f003263d2 - move btrfs rules order from 40 to 80 for ID_FS_TYPE to work (which is populated by 60-persistent-storage.rules) 2010-11-24 19:02:13 +01:00
Harald Hoyer
b9cc6f7ca9 dracut.xml: fixed "Omitting dracut Modules" 2010-11-23 12:51:31 +01:00
Harald Hoyer
5b928ffade dracut.spec: inc release 2010-11-22 10:05:42 +01:00
Lubomir Rintel
ae202ef02e Search in for KMS-capable drivers in extra/ as well
User can have an out-of-tree video driver supporting KMS installed;
Intel GMA500 drivers from RPM Fusion are one example of such module.
2010-11-19 19:08:03 +01:00
Harald Hoyer
7f7a91b75f base/init: fix init executable check 2010-11-19 13:40:34 +01:00
Harald Hoyer
770b796e52 base/init: honor old "real_init=" 2010-11-19 13:37:17 +01:00
Harald Hoyer
b2415f4414 base: use systemd-timestamp for RD_TIMESTAMP, if possible 2010-11-18 12:28:21 +01:00
Harald Hoyer
2eea164db7 base/init: do not set umask
somehow /dev/dri gets created with the wrong permissions
https://bugzilla.redhat.com/show_bug.cgi?id=626559
2010-11-17 17:37:22 +01:00
Amadeusz Żołnowski
7a8a33b6cd dracut-lib.sh: splitsep fix 2010-11-16 10:30:33 +01:00
Harald Hoyer
325d491360 dracut.spec: remove uswsusp and added busybox module 2010-11-12 14:27:36 +01:00
Harald Hoyer
91f4d45f93 crypt: change /tmp/luks.keys seperator from "|" to ":"
Do it like on the kernel command line, so we only have one forbidden
character.
2010-11-12 14:11:33 +01:00
Amadeusz Żołnowski
c7e72136b2 dracut.kernel.7: updated to latest changes in 90crypt 2010-11-12 14:08:09 +01:00
Amadeusz Żołnowski
8844cd6b6c 90crypt: probe for keydev asynchronously; changed kernel arg
New kernel argument syntax for LUKS-keydev is introduced:

  rd.luks.key=<key_path>[:<key_dev>[:<luks_dev>]]

Unfolding <key_dev> in BNF:

  <key_dev> ::= "UUID=" <uuid> | "LABEL=" <label> | <kname>

Where <kname> matches following regular expression:

  ^/dev/.*

<kname> need to be a character device and not a symlink for now.

For every rd.luks.key argument udev rule is created.  That rule runs
test to check whether matching device contains <key_path>.  If it does
it's applied to matching <luks_dev>.
2010-11-12 14:08:08 +01:00
Amadeusz Żołnowski
ccb0ab7348 99base/dracut-lib.sh: 5 new functions & 1 modified
New:
  str_starts, str_replace
  funiq - print new unique file name
  mkuniqdir - create and print new unique dir
  splitsep - splits given string 'str' with separator 'sep' into vars
  udevmatch - create udev rule match for a device

Modified:
  foreach_uuid_until - use $___ as a place holder
2010-11-12 14:08:08 +01:00
Harald Hoyer
5023964844 move initlog.pipe to /dev/.initramfs 2010-11-11 11:08:40 +01:00
Harald Hoyer
4af673c3f8 base/init: merge mkdir and add more mount options 2010-11-11 11:08:40 +01:00
Harald Hoyer
5dc6f24085 base/loginit: s/==/=
stupid bug!
2010-11-10 22:50:20 +01:00
Harald Hoyer
e53fdd1c35 rootfs-block/mount-root.sh: remove $NEWROOT/.autofsck if possible 2010-11-10 22:10:54 +01:00
Harald Hoyer
040f3d2ffc base/init: re-add initqueue-finished 2010-11-10 21:27:33 +01:00
Harald Hoyer
d884af8077 rootfs-block/mount-root.sh: remove $NEWROOT/{.autofsck,forcefsck} if possible 2010-11-10 20:47:15 +01:00
Harald Hoyer
a4f88b8a49 rootfs-block/mount-root.sh: set prompt in emergency shell 2010-11-10 20:45:02 +01:00
Harald Hoyer
3d7c58ca1e rootfs-block/mount-root.sh: echo fsck return code to
/dev/.initramfs/fsck
2010-11-10 20:43:22 +01:00
Harald Hoyer
ce51f3be11 rootfs-block/mount-root.sh: fixed filesystem type udev parsing 2010-11-10 20:12:05 +01:00
Harald Hoyer
4cba811f6c rootfs-block/mount-root.sh: correctly printf to fstab 2010-11-10 20:11:31 +01:00
Harald Hoyer
85de3d281a rootfs-block/mount-root.sh: only warn if fsck returned != 0 2010-11-10 20:06:34 +01:00
Harald Hoyer
3817c2f138 rootfs-block/mount-root.sh: default rootfs to auto, even without fstab 2010-11-10 20:01:30 +01:00
Harald Hoyer
13af399f65 rootfs-block/mount-root.sh: clear fsckoptions 2010-11-10 19:58:15 +01:00
Harald Hoyer
2cbcbd7532 AUTHORS: update 2010-11-10 19:07:16 +01:00
Peter Rajnoha
c2c3108882 *.rules: honor DM_UDEV_DISABLE_OTHER_RULES_FLAG
honour the DM_UDEV_DISABLE_OTHER_RULES_FLAG which is set by
libdevmapper/LVM directly for devices that should be skipped.
2010-11-10 18:14:59 +01:00
Harald Hoyer
cd7ee4913d busybox/check: disable module by default and check for busybox binary 2010-11-10 16:38:40 +01:00
Andrey Borzenkov
856285aa90 resume: merge uswsusp module into resume
uswsusp almost completely duplicates resume; merge them.

Signed-off-by: Andrey Borzenkov <arvidjaar@gmail.com>
2010-11-10 16:07:01 +01:00
Andrey Borzenkov
0e08f1de8d 95rootfs-block: fix missing root when label contains slash
It is not clearly documented, but apparently fsck
(or, probably, getmntent) is using backslash as
escape character.

Label containing slash is converted to \x2f but '\'
is eaten by fsck later. Escape '\' before writing
into fstab.

v2:
- fix sed expression
- use printf instead of echo because echo eats '\' as well

Signed-off-by: Andrey Borzenkov <arvidjaar@gmail.com>
2010-11-10 16:03:14 +01:00
Andrey Borzenkov
161da365e2 i18n: do not use systemd-vconsole-setup
systemd-vconsole-setup was not designed to be run from udevd.
It checks locale environment to decide, whether UNICODE should
be enabled or disabled. Normally environment is setup by
systemd; but the only environment available in udev rules is
those from device properties. It means systemd-vconsole-setup
always assumes default C locale and disables UNICODE.

Revert to using built-in console_init which explicitly
imports locale settings from /etc/vconsole.conf. Alternative
is to revert 6545b9d7 and call console_init directly :)

Additionally patch fixes console_init to use new namespace as
well as ensures that default font is always installed.

Signed-off-by: Andrey Borzenkov <arvidjaar@gmail.com>
2010-11-10 15:53:04 +01:00
Daniel Drake
dbcc4e94c5 Add busybox shell replacements module
On the OLPC XO-1, there is a noticable delay during boot while the
initramfs is loaded from disk and uncompressed, so we have an interest
in making it small. We are also pushed for disk space.

Using busybox instead of all the regular tools saves a lot of space.
I have not tried every module but the basics are working with busybox's
replacements. Our initramfs is now down to 1.9mb.
2010-11-10 15:49:48 +01:00
Andrey Borzenkov
d118a5990a i18n: mention {vconsole,locale}.conf in README
i18n does not use /etc/sysconfig/{i18n,keyboard} anymore

Signed-off-by: Andrey Borzenkov <arvidjaar@gmail.com>
2010-11-10 15:49:48 +01:00
Harald Hoyer
498a131239 Makefile: use xhtml instead of xhtml-1_1 for the docbook.xsl 2010-11-10 15:05:04 +01:00
Harald Hoyer
9840eaade6 rootfs-block/install: install e2fsck for slackware 2010-11-10 15:00:30 +01:00
Harald Hoyer
f8fcc56ed9 dm/install: install dmeventd, only if present 2010-11-10 15:00:01 +01:00
Harald Hoyer
1c290032a4 dracut.spec: bump release 2010-11-05 14:15:09 -04:00
Harald Hoyer
1fbe575888 base/init: removed scsi_wait_scan hack 2010-11-05 14:14:34 -04:00
Harald Hoyer
6545b9d792 i18n/parse-i18n: remove manual call for console_init
setfont and loadkeys are better called in udev,
because then they are started in parallel to other jobs
2010-11-05 14:13:00 -04:00
Harald Hoyer
67bde9f067 bootchart/install: create tmpfs directory 2010-11-05 14:12:33 -04:00
Harald Hoyer
921f4b5b52 base/init: fixed " typo 2010-11-03 15:41:50 -04:00
Harald Hoyer
7853bbfa7d base/init: do not clean RD_* environment variables 2010-11-03 14:15:11 -04:00
Harald Hoyer
c79517b4d9 base/init: fixed indention 2010-11-03 14:12:30 -04:00
Harald Hoyer
5e1898fa5a base/init: only mknod /dev/null, if it does not exist yet 2010-11-03 13:45:14 -04:00
Harald Hoyer
11a2ab6228 base/init: merge mkdir calls 2010-11-03 13:42:20 -04:00
Harald Hoyer
c56e44a63a rootfs-block/mount-root.sh: fixed fsck "-a" option 2010-11-03 13:40:42 -04:00
Harald Hoyer
3871942d13 rootfs-block:mount-root.sh add fsck 2010-10-29 19:00:35 +02:00
Harald Hoyer
07ecac56da 10i18n/parse-i18n.sh: run console_init directly if /dev/tty0 exists 2010-10-29 18:38:55 +02:00
Harald Hoyer
5ce6642fed dracut.spec: s#fedora_version#fedora#g and simplified %if checks 2010-10-29 16:57:52 +02:00
Harald Hoyer
fb4ba86f44 dracut.conf.d/suse.conf.example: remove hostonly mode 2010-10-29 16:22:56 +02:00
Harald Hoyer
353ef76019 dracut.spec: dracut-network obsoletes and provides dracut-generic 2010-10-29 15:22:59 +02:00
Harald Hoyer
44b013967a dracut.spec: add dracut.html to %doc 2010-10-29 15:08:51 +02:00
Harald Hoyer
67c0c1847b i18n/install: if hostonly install fails, install all files 2010-10-29 14:07:56 +02:00
Harald Hoyer
544de3c87f i18n/install: s/dwarn/dwarning/ 2010-10-29 14:00:13 +02:00
Harald Hoyer
1be365c500 i18n/install: do not error out, if local i18n could not be found 2010-10-29 13:58:40 +02:00
Harald Hoyer
13f91fc78d i18n/install: cleanup and honor new config files
honor local /etc/locale.conf and /etc/vconsole.conf files
2010-10-29 13:55:22 +02:00
Harald Hoyer
256a816c9f dracut.conf.d/fedora.conf.example: SYSFONT -> FONT 2010-10-29 13:47:05 +02:00
Harald Hoyer
ee6fa3240d i18n: move to vconfig.* and locale.* namespace 2010-10-29 13:39:20 +02:00
Harald Hoyer
9b79345001 base/init: rd.shell=1 per default
to securely lock a machine, the admin has to set rd.shell=0!
2010-10-29 13:24:12 +02:00
Harald Hoyer
51c977d1ff dracut-functions:find_block_device() workaround for btrfs
/proc/self/mountinfo contains the btrfs virtual device major minor.
Determine the real major minor with the device.
2010-10-29 12:34:27 +02:00
Harald Hoyer
577b1fc833 base/init: s/RDTIMESTAMP/RD_TIMESTAMP/g
systemd will clear all RD_* env for its children
2010-10-28 18:09:45 +02:00
Harald Hoyer
6ef8e5b4d3 mkdir /dev/.initramfs with "-p" 2010-10-28 17:11:35 +02:00
Harald Hoyer
9bfff3746f base: send DRACUT_LOG_END to loginit at the end 2010-10-28 17:11:35 +02:00
Harald Hoyer
b2559a8895 TEST-50-MULTINIC/test.sh: only set hdc for no cdrom 2010-10-28 17:11:35 +02:00
Harald Hoyer
51b28ba9c4 test/TEST-*/test.sh: set -serial to null for servers
-serial udp might have stalled
2010-10-28 17:11:35 +02:00
Pádraig Brady
c8584872be network: don't die if gateway is down and root server is local
modules.d/40network/netroot: Don't arping the gateway if we don't need to
2010-10-28 17:11:34 +02:00
Harald Hoyer
387bf82e30 test/*/*-init: set PATH
/sbin and /usr/sbin are no longer in $PATH
2010-10-28 17:11:34 +02:00
Harald Hoyer
11adeb7c01 dracut-functions:inst_symlink() create target dir
if the target directory of the symlink didn't exist, we failed
2010-10-28 17:11:34 +02:00
Vladislav Bogdanov
3afca618da ifcfg/write-ifcfg.sh: fixes typos and generated ifcfg files 2010-10-28 17:11:34 +02:00
Harald Hoyer
2c1f37d45c base/init: fix for /sbin/init being an absolute softlink 2010-10-28 17:11:34 +02:00
Harald Hoyer
fa7ada31d0 new parameter option names with "rd.*" namespace
Renamed Options
       Here is a list of options, which were used in dracut prior to
       version 008, and their new replacement.

       rdbreak
           rd.break

       rd_CCW
           rd.ccw

       rdcopystate
           rd.copystate

       rd_DASD_MOD
           rd.dasd_mod.dasd

       rd_DASD
           rd.dasd

       rdinitdebug rdnetdebug
           rd.debug

       rd_NO_DM
           rd.dm=0

       rd_DM_UUID
           rd.dm.uuid

       rdblacklist
           rd.driver.blacklist

       rdinsmodpost
           rd.driver.post

       rdloaddriver
           rd.driver.pre

       rd_NO_FSTAB
           rd.fstab=0

       rdinfo
           rd.info

       check
           rd.live.check

       rdlivedebug
           rd.live.debug

       live_dir
           rd.live.dir

       liveimg
           rd.live.image

       overlay
           rd.live.overlay

       readonly_overlay
           rd.live.overlay.readonly

       reset_overlay
           rd.live.overlay.reset

       live_ram
           rd.live.ram

       rd_NO_CRYPTTAB
           rd.luks.crypttab=0

       rd_LUKS_KEYDEV_UUID
           rd.luks.keydev.uuid

       rd_LUKS_KEYPATH
           rd.luks.keypath

       rd_NO_LUKS
           rd.luks=0

       rd_LUKS_UUID
           rd.luks.uuid

       rd_LUKS_UUID
           rd.luks.uuid

       rd_NO_LVMCONF
           rd.lvm.conf

       rd_LVM_LV
           rd.lvm.lv

       rd_NO_LVM
           rd.lvm=0

       rd_LVM_SNAPSHOT
           rd.lvm.snapshot

       rd_LVM_SNAPSIZE
           rd.lvm.snapsize

       rd_LVM_VG
           rd.lvm.vg

       rd_NO_MDADMCONF
           rd.md.conf=0

       rd_NO_MDIMSM
           rd.md.imsm=0

       rd_NO_MD
           rd.md=0

       rd_MD_UUID
           rd.md.uuid

       rd_NFS_DOMAIN
           rd.nfs.domain

       rd_NO_PLYMOUTH
           rd.plymouth=0

       rd_retry
           rd.retry

       rdshell
           rd.shell

       rd_NO_SPLASH
           rd.splash

       rdudevdebug
           rd.udev.debug

       rdudevinfo
           rd.udev.info

       rd_NO_ZFCPCONF
           rd.zfcp.conf=0

       rd_ZFCP
           rd.zfcp
2010-10-28 17:11:27 +02:00
Harald Hoyer
54b01e99d3 dracut-functions: suppress modinfo errors for hostonly mode 2010-10-27 11:19:27 +02:00
Harald Hoyer
75bb595c6c fcoe: remove vconfig requirement 2010-10-26 12:45:59 +02:00
Harald Hoyer
490f98aa6c dracut.spec: own dracut/modules.d directory 2010-10-26 11:50:09 +02:00
Harald Hoyer
e6b637b067 dracut-gencmdline: strip also _rnetdev
https://bugzilla.redhat.com/show_bug.cgi?id=644494
2010-10-26 11:48:14 +02:00
Harald Hoyer
453fd25152 bootchart: fixed file perms 2010-10-25 17:27:06 +02:00
Harald Hoyer
228694e5a9 dracut.spec: modified to build on opensuse 2010-10-25 17:27:00 +02:00
Harald Hoyer
c54f73a2ff dracut.spec: removed gittag 2010-10-25 14:21:33 +02:00
Harald Hoyer
d9416c0df5 dracut.spec: add opensuse 2010-10-25 14:20:33 +02:00
Harald Hoyer
771c215192 dracut.spec: add 95fstab-sys and 96insmodpost 2010-10-25 14:20:32 +02:00
Harald Hoyer
0a70f452bb add dracut.conf.d/suse.conf.example 2010-10-25 14:20:26 +02:00
Harald Hoyer
bfd602f849 base: install switch_root to /sbin and call it with the full path 2010-10-25 12:31:38 +02:00
Harald Hoyer
8541b35ed7 i18n: also search in /usr/share/kbd 2010-10-25 12:31:07 +02:00
Harald Hoyer
57a49c6727 chmod 0755 modules.d/40network/parse-bond.sh 2010-10-18 16:20:19 +02:00
Vladislav Bogdanov
96fb9c8dd7 add bonding
Format:
bond=<bondname>[:<bondslaves>:[:<options>]]

bondslaves is a comma-separated list of physical (ethernet) interfaces.

options is a comma-separated list on bonding options (modinfo bonding for
details) in format compatible with initscripts.

If options include multi-valued arp_ip_target option, then its values
should be separated by semicolon.

bond without parameters assumes bond=bond0:eth0,eth1:balance-rr
2010-10-18 16:10:41 +02:00
Harald Hoyer
6daac70e55 add 96insmodpost dracut module
due to popular demand, this module loads a custom kernel module, after the
first udev settle (all basic device drivers loaded)
2010-10-18 16:07:58 +02:00
Harald Hoyer
d4916e36d0 documentation update 2010-10-18 16:05:47 +02:00
Harald Hoyer
1b4a9d8ad8 documentation update 2010-10-15 13:14:08 +02:00
Amadeusz Żołnowski
6bde7a17be suppress modprobe errors on builtins (credits to Kay Sievers)
Install /lib/modules/$kv/modules.builtin.bin to suppress modprobe error
messages saying module was not found, while it's built-in.

Credits go to Kay Sievers who enlighten us about meaning of this cool
file.
2010-10-15 09:52:45 +02:00
Amadeusz Żołnowski
9d1015b646 Revert "add option --ignore-kernel-modules"
This reverts commit 0ca3a5ee84
and removes later changes related to this commit.

Conflicts:

	dracut
	dracut.8
	modules.d/99base/install
2010-10-15 09:52:45 +02:00
Harald Hoyer
2ca35ac7ee init: symlink /dev/stdin /dev/stdout /dev/stderr 2010-10-07 19:11:11 +02:00
Amadeusz Żołnowski
4bacdf2811 99base/init: honor env. vars provided by kernel (PATH, HOME and TERM)
Let take a look at Linux sources, /usr/src/linux-2.6.35/init/main.c:

  204: char * envp_init[MAX_INIT_ENVS+2] = { "HOME=/", "TERM=linux", NULL, };

  857: run_init_process("/sbin/init");

  817: static void run_init_process(char *init_filename)
  818: {
  819:        argv_init[0] = init_filename;
  820:        kernel_execve(init_filename, argv_init, envp_init);
  821: }

As we can see HOME=/ and TERM=linux are provided for init and this might be
expected on some systems (Gentoo comes to my mind, here ;-)).  That's why we
should give to init the same set of env. vars as Linux kernel does.
2010-10-01 11:38:14 +02:00
Harald Hoyer
94388aaffa init: removed bogus nop line
+    initargs="$initargs"
2010-09-23 17:45:37 +02:00
Harald Hoyer
a8a949d9e5 network: kill -9 dhclient, if normal kill does not succeed
https://bugzilla.redhat.com/show_bug.cgi?id=583348
2010-09-23 16:26:30 +02:00
Harald Hoyer
1b29b0f7cf test: double disk space for root images 2010-09-23 16:10:00 +02:00
Ian Dall
ecefdfc280 95fstab-sys: mount all /etc/fstab.sys volumes before switch_root
A new dracut module to implement fstab.sys handling

This module implements fstab.sys handling. This has to happen after the root
mount and before the nfsroot-cleanup pre-pivot at least. I've made to happen at
the beginning of the pre-pivot scripts, although it should maybe be at the end
of the mount scripts. This latter would be harder to do because the actual
mount is currently done by 99mount-root.sh and there is no 2 digit integer
higher than 99 :-(

There are perhaps other ways of achieving this end, such as having the
nfsroot-cleanup trawl through the newroot's /etc/fstab and auto-magically
figure out if there are any mounts which are pre-requisites for the
/var/lib/nfs/rpc_pipefs mount and do them first. Likewise post pivot,
/etc/rc.sysinit could figure out of there are any pre-requisite mounts for
/var/lib/stateless/{writeable,state} before doing those mounts. In short, make
it the responsibility of anything doing a mount to check if there are any
pre-requisites in /etc/fstab and mount them first. However, this spreads the
changes needed over more places, so I favour the fstab.sys approach. Also, who
knows what other uses administartors may have put fstab.sys to? and this undoes
a regression caused by the move from mkinitrd to dracut.
2010-09-22 16:50:35 +02:00
James Laska
b2dff45423 lvm: support for dynamic LVM SNAPSHOT root volume
I'm looking for a way to have a system with disposable storage that can be
rebooted and all filesystem changes are thrown away.  After reboot, the system
starts with a fresh root volume again.  The use case is for automated testing.
We run test scripts that could potentially not clean up after themselves.

This is almost like stateless, but the storage is local to the system (not
iSCSI, NFS or NBB).

1. Install Fedora 13 using default partition layout
  NOTE: modify the layout to leave extra room in the LVM volume group
2. Apply attached patch
3. Update grub.conf to enable dracut LVM snapshot support.  Add the following
boot arguments

 rd_LVM_SNAPSHOT=vg_test1055/lv_snap (note the VG name will depend on your
system).
 rd_LVM_SNAPSIZE= (optional, defaults to size of volume specified with by
rd_LVM_SNAPSHOT)

4. Adjust grub.conf and fstab to use LVM snapshot
 $ sed -i -e 's|lv_root|lv_snap|' /boot/grub/grub.conf
 $ sed -i -e 's|lv_root|lv_snap|' /etc/fstab
5. Reboot system

Expected results (no value provided for rd_LVM_SNAPSIZE):

  dracut: Starting plymouth daemon
  dracut: rd_NO_DM: removing DM RAID activation
  dracut: rd_NO_MD: removing MD RAID activation
  dracut: Removing existing LVM snapshot vg_test1055/lv_snap
  dracut: Logical volume "lv_snap" successfully removed
  dracut: No LVM snapshot size provided, using size of vg_test1055/lv_root (
9024.00m)
  dracut: Creating LVM snapshot vg_test1055/lv_snap  (  9024.00m)
  dracut: Logical volume "lv_snap" created
  dracut: Scanning devices sda2  for LVM logical volumes vg_test1055/lv_root
vg_test1055/lv_swap
  dracut: inactive Original '/dev/vg_test1055/lv_root' [8.81 GiB] inherit
  dracut: inactive '/dev/vg_test1055/lv_swap' [1.00 GiB] inherit
  dracut: inactive Snapshot '/dev/vg_test1055/lv_snap' [8.81 GiB] inherit
  dracut: Mounted root filesystem /dev/mapper/vg_test1055-lv_snap
  dracut: Loading SELinux policy
  dracut: Switching root

Expected results (rd_LVM_SNAPSIZE=100m):

  dracut: Starting plymouth daemon
  dracut: rd_NO_DM: removing DM RAID activation
  dracut: rd_NO_MD: removing MD RAID activation
  dracut: Removing existing LVM snapshot vg_test1055/lv_snap
  dracut: Logical volume "lv_snap" successfully removed
  dracut: Creating LVM snapshot vg_test1055/lv_snap  (100m )
  dracut: Rounding up size to full physical extent 128.00 MiB
  dracut: Logical volume "lv_snap" created
  dracut: Scanning devices sda2  for LVM logical volumes vg_test1055/lv_root
vg_test1055/lv_swap
  dracut: inactive Original '/dev/vg_test1055/lv_root' [8.81 GiB] inherit
  dracut: inactive '/dev/vg_test1055/lv_swap' [1.00 GiB] inherit
  dracut: inactive Snapshot '/dev/vg_test1055/lv_snap' [128.00 MiB] inherit
  dracut: Mounted root filesystem /dev/mapper/vg_test1055-lv_snap
  dracut: Loading SELinux policy
  dracut: Switching root
2010-09-22 16:39:51 +02:00
Harald Hoyer
1f9de919e0 dracut-functions: filter_kernel_modules() search in extra dirs
search also in "extra" and "weak-updates" for kernel modules
https://bugzilla.redhat.com/show_bug.cgi?id=622641
2010-09-22 16:19:11 +02:00
Harald Hoyer
0437ced41d lvm: also handle LVM1 volumes 2010-09-22 16:13:20 +02:00
Harald Hoyer
90ccb5efe7 documentation update 2010-09-22 14:33:10 +02:00
Harald Hoyer
647bef8ca6 base/init: set RDTIMESTAMP
set $RDTIMESTAMP for init, if rd.timestamp is specified on the
kernel command line, so that systemd can print out:

"systemd: Boot finished after 15s = 3s (kernel) + 2s (initrd) + 10s
(userspace)"
2010-09-20 14:58:25 +02:00
Harald Hoyer
2d9f5858bc add dracut.xml documentation 2010-09-20 14:53:51 +02:00
Harald Hoyer
5b11bb734a dracut: added --list-modules 2010-09-20 14:53:45 +02:00
Harald Hoyer
430bfefda3 lsinitrd: add "catinitrd" functionality
lsinitrd <initramfs image> [<file to cat>]
2010-09-20 14:53:45 +02:00
Harald Hoyer
3636d59e38 base/init: unset HOME and TERM for real init 2010-09-20 14:53:45 +02:00
Peter Jones
9346982f22 Be sure and get the right architecture for rsylogd modules.
I've tested this locally on 64-bit with:

dracut -a syslog -f -v foo.img `uname -r`

And I see this in the output:

I: *** Sourcing module syslog
I: Installing /sbin/rsyslogd
I: Installing /lib64/rsyslog/lmnet.so
I: Installing /lib64/rsyslog/imklog.so
I: Installing /lib64/rsyslog/imuxsock.so
I: Installing /usr/share/dracut/modules.d/98syslog/parse-syslog-opts.sh
I: Installing /usr/share/dracut/modules.d/98syslog/syslog-genrules.sh
I: Installing /usr/share/dracut/modules.d/98syslog/syslog-cleanup.sh
I: Installing /usr/share/dracut/modules.d/98syslog/rsyslogd-start.sh
I: Installing /usr/share/dracut/modules.d/98syslog/rsyslogd-stop.sh
I: Installing /usr/share/dracut/modules.d/98syslog/rsyslog.conf
2010-09-10 12:32:31 -04:00
Harald Hoyer
48d2199e94 nfs/install: fixed s/LIBDIR/libdir 2010-09-10 17:51:32 +02:00
Harald Hoyer
f8bc899063 reformat source
untabified
2010-09-10 15:55:51 +02:00
Harald Hoyer
cc02093d69 reformat source code
removed tabs and set indention to 4 spaces
added emacs and vi format headers
2010-09-10 15:34:36 +02:00
Glen Gray
d95d2f3b44 update rsyslog plugin paths
rsyslog's plugin paths moved, so correct for them.
2010-08-27 11:11:24 -04:00
Harald Hoyer
a79f11d254 plymouth: do not create hvc0
must have been a copy&paste error
2010-08-25 13:26:13 +02:00
Andrey Borzenkov
89fb4162e3 mkinitrd-dracut.sh: fix stray "fi"
Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
2010-08-23 22:32:47 +02:00
Harald Hoyer
dab1a1dc99 dmraid: switch to rd_NO_MDIMSM, if no mdadm installed 2010-08-23 14:42:33 +02:00
Andrey Borzenkov
4c77612245 bootchart module cleanup
- create /lib/bootchart in initramfs, not in live filesystem
- use proper dracut API to install files

Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
2010-08-23 12:43:45 +02:00
Harald Hoyer
5acc508cae fixed "use $libdir and $usrlibdir instead of ..." 2010-08-23 12:40:15 +02:00
Harald Hoyer
f844e7dc8f manpage corrections 2010-08-23 12:22:52 +02:00
Harald Hoyer
620d031534 NEWS: fixed typo 2010-08-23 12:22:03 +02:00
Harald Hoyer
e4e3b4c821 mkinitrd: do not call dracut in host only mode 2010-08-23 12:13:48 +02:00
Harald Hoyer
094d9cae63 dm: install all md/dm* kernel modules 2010-08-23 12:13:19 +02:00
Harald Hoyer
eaa62cd541 dracut: fixed "Add support for bzip2 and xz"
s/xz/lzma/g and added manpage documentation
2010-08-23 12:06:28 +02:00
Harald Hoyer
ae24b1146b dracut: fixed "Clean up some conditional checking..." 2010-08-23 11:58:39 +02:00
Harald Hoyer
0a325a917d dracut: fixed "Shorten permission checking..." 2010-08-23 11:57:39 +02:00
Matt Smith
7254c24a76 Merged cryptroot-ask.sh from plymouth to crypt module.
First, it's duplicate code.

Second, it did not allow those who had plymouth installed to use other
methods, like the new usb key file. When building the initram,
it would install the plymouth cryptroot-ask script, and not
the crypt module one.

Added these new items to crypt module's cryptroot-ask.sh:
  - 'unset' for used variables
  - udevsettle

The non-plymouth cryptsetup prompt was using $1 instead of $device.
Changed prompt number from 1 to 5, as this is much nicer.
I believe plymouth already does infinite prompts.

Also added unset for usb key. Just saw it didn't unset its vars.
2010-08-23 11:55:11 +02:00
Amadeusz Żołnowski
55309e7800 use $libdir and $usrlibdir instead of individual detect with ldd 2010-08-23 11:55:11 +02:00
Amadeusz Żołnowski
fa5cd2bf50 dracut: lib and usr/lib dirs detection
First we check if $libdir and $usrlibdir vars are already set in config
file. If not we perform simple detect. Vars are exported - to be useful
in module/check scripts.
2010-08-23 11:54:09 +02:00
Amadeusz Żołnowski
1ad309fbc6 60xen: use 'hash' instead of 'type' 2010-08-23 11:54:09 +02:00
Amadeusz Żołnowski
f3af7bd66b use 'type' built-in instead of external cmd 'which' in every Bash script 2010-08-23 11:54:09 +02:00
Victor Lowther
5fce1ef0c9 Add a PKGBUILD file to make building on Arch Linux from a git checkout easy.
This might come in handy for anyone else trying out dracut on Arch.
2010-08-23 11:51:35 +02:00
Victor Lowther
85ab21a6e0 We are precise about hostonly checking these days.
So get rid of the comment in 90crypt/check.
Also do a bit of trivial bashification.
2010-08-23 11:51:35 +02:00
Victor Lowther
1de37e808c Trivial bashification of 00dash/install 2010-08-23 11:51:35 +02:00
Victor Lowther
b2ff4317f1 Trivial bashification and minor code rearrangement for initramfs compression. 2010-08-23 11:51:35 +02:00
Victor Lowther
690396a5b1 Prettify the option setting loop in dracut.
THis just makes the args line up all nice and pretty.
2010-08-23 11:51:34 +02:00
Victor Lowther
5bc545ed79 Bashify mkinitrd-dracut.sh, introduce read_arg.
Hack up argument processing in dracut and mkinitrd-dracut.sh to use
read_arg to flexibly process arguments.
2010-08-23 11:51:34 +02:00
Victor Lowther
644c5241d2 Bashify error() and usage() in mkinitrd-dracut.sh
Some more trivial bashification.
2010-08-23 11:51:34 +02:00
Victor Lowther
937f678ef6 Just test the status of the cpio-and-compress pipe directly. 2010-08-23 11:51:34 +02:00
Victor Lowther
5b158ad3a9 Add support for bzip2 and xz compressed initramfs images.
Current kernels know how to uncompress bzip2 and xz, so use them for compressing
the initramfs if asked.  The more compression the merrier.

Also add support for generating uncompressed images, although they
are usually not what you want.
2010-08-23 11:51:34 +02:00
Victor Lowther
afbeadb9da We have $UID, use it instead of $(id -u)
No point in spawning a command and parsing its output when the UID
is already in the environment.
2010-08-23 11:51:34 +02:00
Victor Lowther
8a4745694b Flatten our check to ensure that depmod works.
No need for a nested if here.
2010-08-23 11:51:34 +02:00
Victor Lowther
ebfdb219c6 Shorten permission checking to ensure we can actually write our initramfs.
These tests can be combined into an if... elif... elif... statement, and
that makes it clear they are all part of the same test.
2010-08-23 11:51:34 +02:00
Victor Lowther
6438b4fedf Bashify the code that actually sources out config files.
Just some trivial bashification.
2010-08-23 11:51:33 +02:00
Victor Lowther
eebc929abb Clean up some conditional checking when trying to find our config files.
No point in checking the same condition twice when compound commands will do.
2010-08-23 11:51:33 +02:00
Victor Lowther
0e4fee3d5a Get rid of unneeded dirname calls.
Use parameter expansion instead.
2010-08-23 11:51:33 +02:00
Victor Lowther
3478b3146f Trivial cleanups in dracut-functions
This is a patch series I have been playing with for awhile.

It cleans up some of the dracut code and adds a PKGBUILD file to make
it easier to use in Arch Linux.
2010-08-23 11:51:33 +02:00
Harald Hoyer
cfa5a0da6d plymouth: udev trigger with action=add 2010-08-13 11:26:34 +02:00
Harald Hoyer
c033d96e49 version inc 2010-08-09 16:28:38 +02:00
Harald Hoyer
59a232ddcd version 007 2010-08-09 16:13:51 +02:00
Harald Hoyer
01816f2bb1 NEWS: update for 007 2010-08-09 16:13:50 +02:00
Harald Hoyer
0d86614794 dracut.spec: add dracut.kernel man page 2010-08-09 16:13:45 +02:00
Harald Hoyer
8821f4109e dracut.spec: build require docbook tools 2010-08-09 16:11:22 +02:00
Harald Hoyer
783721b34b dracut.spec: remove gentoo specific modules 2010-08-09 16:06:50 +02:00
Harald Hoyer
f6c76abe8e dracut.spec s/bootchartd/bootchart 2010-08-09 16:03:47 +02:00
Harald Hoyer
41bad60c82 dracut.spec: install fedora.conf.example 2010-08-09 16:01:48 +02:00
Harald Hoyer
9c7f67a94d crypt: depend on dm 2010-08-09 13:24:08 +02:00
Amadeusz Żołnowski
26df1299cb add module gensplash 2010-08-09 13:10:04 +02:00
Amadeusz Żołnowski
1f03abefad 10i18n: --quiet for loadkeys 2010-08-09 13:10:04 +02:00
Harald Hoyer
f2db681002 plymouth: load dm_crypt module 2010-08-09 13:09:13 +02:00
Harald Hoyer
5bb59e428f Makefile: install dracut.kernel.7 2010-08-06 18:15:51 +02:00
Harald Hoyer
a1ef436531 AUTHORS update 2010-08-06 16:06:06 +02:00
Harald Hoyer
c865ecbf32 manpage update 2010-08-06 15:38:52 +02:00
Harald Hoyer
2576bec68f manpage update 2010-08-06 15:32:08 +02:00
Harald Hoyer
7c1796860f dracut: add --fstab, to ignore /proc/self/mountinfo 2010-08-06 13:54:34 +02:00
Harald Hoyer
d350ae6966 manpage xml: changed DTD to docbook 4.5 2010-08-06 13:53:24 +02:00
Amadeusz Żołnowski
9b3d462b68 dracut.kernel.7.xml: updated I18N and LUKS sections
10i18n/README: typo corrected
2010-08-06 13:36:13 +02:00
Amadeusz Żołnowski
5150d44a7e Makefile: use $(MAKE) and $(RM) instead of make and rm -f
See: http://www.gnu.org/software/make/manual/make.html#MAKE-Variable
2010-08-06 11:53:02 +02:00
Harald Hoyer
30cd3616e9 fedora.conf moved back to fedora.conf.example 2010-08-06 11:47:39 +02:00
Harald Hoyer
609d00c467 manpages: changed to UTF-8 2010-08-06 11:46:39 +02:00
Harald Hoyer
27e15000d0 manpages: add note, that host-only mode does not work in chroot() 2010-08-05 19:13:16 +02:00
Harald Hoyer
029f2691f8 dracut-functions: use /proc/self/mountinfo, instead of /proc/mounts
1. it's easier to get the major:minor
2. it's more failsafe in a chroot() (rescue CD case)
2010-08-05 18:59:51 +02:00
Andrey Borzenkov
0493f9c849 Fix ahci detection in kernel 2.6.35
Kernel 2.6.35 (may be, earlier) split ahci into libahci.ko and ahci.ko
and added ahci_platform.ko. As a result, drivers ahci and ahci_platform
do not contain any symbol that are checked for storage modules (it is
libahci.ko that references ata_scsi_ioctl now). So add additional
symbol ahci_init_controller; it seems this is expected to be called by
every driver based on libahci.ko.

Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
2010-08-05 18:16:37 +02:00
Harald Hoyer
3eccdb5289 manpage corrections 2010-08-05 18:12:38 +02:00
Harald Hoyer
17cb0e3fe8 dracut: let --fwdir be specified multiple times 2010-08-05 18:12:08 +02:00
Harald Hoyer
cdc8d9c403 documentation: moved to docbook man pages 2010-08-05 16:38:49 +02:00
Harald Hoyer
719cc30626 fips: udev trigger with action=add 2010-08-05 08:47:17 +02:00
Amadeusz Żołnowski
0ca3a5ee84 add option --ignore-kernel-modules
Instead of adding modprobe and rmmod, create symlinks to /bin/true to
don't produce unnecessary errors.  Anyway it's a workaround for
following desired behaviour: modprobe tries to insert module only if
it's not built into kernel
2010-08-04 18:30:03 +02:00
Andrey Borzenkov
62f8a2b63c Harden check for used modules in hostonly mode
Make sure that we do not accept module name which is substring of
some other module name. This resulted in piix being mistakenly loaded
together with ata_piix. It completely broke DVD access here.

Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
2010-08-04 18:30:02 +02:00
Amadeusz Żołnowski
a0342347e9 10i18n: exit if console already initialized 2010-08-04 18:30:02 +02:00
Harald Hoyer
076bab08c1 renamed 00bootchartd to 00bootchart 2010-08-04 18:27:48 +02:00
Harald Hoyer
578c24a473 dracut-functions: fixed --omit 2010-08-04 17:46:54 +02:00
Harald Hoyer
c492fe12c0 init: create /dev/.udev/rules.d with correct permissions 2010-08-02 15:58:48 +02:00
Harald Hoyer
e0c1d4e79f mkdir /dev/.udev/rules.d with mode 0755 2010-08-02 15:26:55 +02:00
Harald Hoyer
0b2ddf8f69 NEWS: update for version 007 2010-08-02 14:54:09 +02:00
Harald Hoyer
80a18b8bef manpages: updated for /etc/dracut.conf.d 2010-08-02 14:53:47 +02:00
Harald Hoyer
3a4d0c9c14 dracut-lib.sh: fixed getarg for nonexistent parameters
getarg returned an old "$val" for nonexistent parameters, because "val"
was not local
2010-08-02 14:18:00 +02:00
Harald Hoyer
3122e93350 mdraid: try to start degraded arrays in various ways 2010-08-02 14:18:00 +02:00
Harald Hoyer
21a7b84486 mdraid: remove mdadm.conf on rd_NO_MDADMCONF 2010-08-02 14:18:00 +02:00
Harald Hoyer
4b0a61c586 TEST-12-RAID-DEG: do not execute rd_NO_MDADMCONF tests 2010-08-02 14:18:00 +02:00
Harald Hoyer
cc97412c32 TEST-14-IMSM: fixed test 2010-08-02 14:17:59 +02:00
Harald Hoyer
aceaf13b44 TEST-13-ENC-RAID-LVM: prepend "luks-" to rd_LUKS_UUID argument 2010-08-02 14:17:59 +02:00
Harald Hoyer
d7cc3f2ef5 mdraid: remove "local" 2010-08-02 14:17:59 +02:00
Harald Hoyer
db3641a2ea init: set old umask before switch_root 2010-08-02 14:17:59 +02:00
Harald Hoyer
8e102a2487 crypt: fix printf 2010-08-02 14:17:58 +02:00
Harald Hoyer
4c2d8f5816 TEST-12-RAID-DEG: double disk space 2010-08-02 14:17:58 +02:00
Harald Hoyer
d6351b36b8 i18n: only source config files, if present 2010-08-02 14:17:58 +02:00
Harald Hoyer
d752c51b90 mdraid: --no-degraded not allowed with -I 2010-08-02 14:17:58 +02:00
Harald Hoyer
f007e84e8e dracut-functions: fix check=255 logic and dependencies 2010-08-02 14:17:52 +02:00
Harald Hoyer
9c111e59c9 TEST: omit network module for non-network tests 2010-08-02 10:35:31 +02:00
Harald Hoyer
4754226a1a dracut: let some arguments add up
Specifying multiple -a, -o, -m, -d, --add-drivers, --filesystems now
adds up.
2010-08-02 10:35:31 +02:00
Harald Hoyer
606852a4a6 crypt: loop until all non-busy crypt devs closed 2010-08-02 09:59:10 +02:00
Harald Hoyer
8220945b2c debug: add fsck to debug module 2010-08-02 09:39:49 +02:00
Harald Hoyer
6292ee9d18 dracut: use hardlink, if available to safe some space 2010-08-02 09:39:13 +02:00
Harald Hoyer
dd2c34a82b version pre 7 2010-08-02 09:00:01 +02:00
Harald Hoyer
1246703bb4 dracut.spec: redhat-i18n -> i18n 2010-08-02 09:00:00 +02:00
Harald Hoyer
d2a535855b dracut.spec: add bootchartd 2010-08-02 08:59:14 +02:00
Harald Hoyer
ddd109bdf9 dracut.spec: add dracut.conf.d/fedora.conf 2010-08-02 08:19:54 +02:00
Harald Hoyer
3f62b2637c crypt: strip "luks-" from rd_LUKS_UUID 2010-07-29 16:35:31 +02:00
Harald Hoyer
08852c50b9 removed redundant 64-lvm.rules install
Thanks to Amadeusz Żołnowski, who found it.
2010-07-28 14:09:28 +02:00
Harald Hoyer
bb7645459e dracut-functions: fix "-m -a" handling 2010-07-27 11:51:27 +02:00
Harald Hoyer
e5c6cb2a8c crypt: remove emergency source of dracut-lib.sh 2010-07-23 12:26:42 +02:00
Harald Hoyer
3272ed884f fcoe: add sleeps to fcoe-up 2010-07-23 12:20:32 +02:00
Harald Hoyer
3ad4f77cef lvm: wait for all rd_LVM_LV and rd_LVM_VG specified to appear 2010-07-23 12:16:11 +02:00
Harald Hoyer
e001359311 mknod with mode and set umask for the rest 2010-07-23 11:30:45 +02:00
Harald Hoyer
dcdca91d91 btrfs: add hostonly check 2010-07-21 14:31:13 +02:00
Harald Hoyer
6baa63110e 10i18n: fixed i18n_vars parsing
gather_vars() should replace "every" occurance of the seperator
2010-07-21 14:21:47 +02:00
Harald Hoyer
93ad8c19bb selinux: fixed error handling for load-policy
{} | cmd opens a subshell for {}
2010-07-21 13:44:03 +02:00
Amadeusz Żołnowski
2926b5b35d 90crypt: keys on external devices support
99base/dracut-lib.sh: new fun.: getoptcomma, foreach_uuid_until
2010-07-21 13:38:47 +02:00
Amadeusz Żołnowski
76514565c0 10i18n: README corrected 2010-07-21 13:38:46 +02:00
Amadeusz Żołnowski
bd324b9d94 README for 10i18n module 2010-07-21 13:38:46 +02:00
Amadeusz Żołnowski
a10a1416c1 dracut-functions: additional symlinks for library files
rev_lib_symlinks: it's new
inst_library: creating additional symlinks for installed library files
2010-07-21 13:38:46 +02:00
Harald Hoyer
e13918d24a bootchartd: do not enable bootchartd by default
users can always add "-a bootchartd" on image creation or add it
to /etc/dracut.conf.d/myconf.conf
2010-07-21 13:37:23 +02:00
Frederic Crozat
466f36159d bootchartd support
add preliminary bootchard support

Signed-off-by: Maarten Vanraes <maarten.vanraes@gmail.com>
2010-07-21 13:33:43 +02:00
Andrey Borzenkov
2245f3723b conffile before confdir
conffile should be sourced before confdir

Signed-off-by: Maarten Vanraes <maarten.vanraes@gmail.com>
2010-07-21 13:33:35 +02:00
Harald Hoyer
dde97b301f dracut: fixed stripping of kernel modules 2010-07-20 11:24:37 +02:00
Harald Hoyer
6f9d69c95a multipath: install by default, but run only if wwids are present 2010-07-20 11:23:14 +02:00
Harald Hoyer
adde3a7a27 dracut-lib.sh: getarg() returns the value of the last argument
a=0 a=1 a=2
$(getarg a) == "2"
2010-07-12 18:52:44 +02:00
Harald Hoyer
ed61aae141 cryptroot-ask: s/getargs rd_NO_CRYPTTAB/getarg rd_NO_CRYPTTAB/g 2010-07-12 18:47:08 +02:00
Harald Hoyer
26257a5cf4 dracut.conf.d/fedora.conf: created 2010-07-12 16:33:14 +02:00
Harald Hoyer
0e1d2c3efa 10i18n: fixed directory check logic 2010-07-12 16:32:32 +02:00
Harald Hoyer
b8a2f174d7 TEST-13-ENC-RAID: add check for rd_LUKS_UUID argument parsing 2010-07-12 16:16:57 +02:00
Harald Hoyer
e9ef52b460 crypt: wait for all rd_LUKS_UUID disks to appear
Also give a hint in emergency, if one disk is not found.
2010-07-12 16:16:39 +02:00
Harald Hoyer
3a4989cae2 dracut-lib: export RDDEBUG 2010-07-12 15:33:44 +02:00
Harald Hoyer
ecee64bffa crypt/parse-crypt.sh: fix end label for luks udev rules 2010-07-12 14:43:11 +02:00
Harald Hoyer
540eb97162 crypt: removed default 70-luks.rules 2010-07-12 14:33:43 +02:00
Harald Hoyer
013986a8ad crypt: assemble 70-luks.rules dynamically 2010-07-12 14:31:21 +02:00
Harald Hoyer
a0af4fa5ea dracut.spec: removed duplicate COPYING 2010-07-09 11:19:57 +02:00
Harald Hoyer
5cae1fe179 plymouth: depend on crypt, if cryptsetup exists 2010-07-09 11:19:32 +02:00
Harald Hoyer
91bb250aed dmsquash-live: do not umount /dev/.initramfs/live for cdrom_id to work 2010-07-09 11:18:31 +02:00
Harald Hoyer
40d69001ac dm: load dm_mod if device-mapper not in /proc/misc 2010-07-08 16:18:09 +02:00
Harald Hoyer
06f91665df dmsquash-live: depend on dm module 2010-07-08 16:14:55 +02:00
Harald Hoyer
8442b51e20 i18n: now on by default and removed redhat-i18n 2010-07-07 11:21:38 +02:00
Harald Hoyer
e9a9c8bb7e fcoe: moved fcoeup to initqueue (udev timeouts) 2010-07-07 11:20:27 +02:00
Harald Hoyer
847b618b4c dmsquash-live: mount live image at /dev/.initramfs/live 2010-07-06 10:19:02 +02:00
Amadeusz Żołnowski
fd2312e03d dracut-functions: cosmetic changes to inst_rules 2010-07-06 10:19:02 +02:00
Amadeusz Żołnowski
5f70a1bd06 dracut-functions: info which udev rules are skipped
I found it useful.  Maybe help others debugging.
2010-07-06 10:19:01 +02:00
Amadeusz Żołnowski
876bd1a2be dracut: info which module is sourced; updated dracut usage
Added description for --confdir.
2010-07-06 10:19:01 +02:00
Amadeusz Żołnowski
87122afcda add module i18n
dracut-functions: added functions: mksubdirs, inst_decompress,
                  inst_opt_decompress and print_vars

dracut.conf.d: added configuration files for Gentoo and RedHat/Fedora
2010-07-06 10:18:30 +02:00
Harald Hoyer
78cd3b9824 dracut.spec: dracut-network needs vconfig for fcoe 2010-06-25 12:06:19 +02:00
Harald Hoyer
185468f57d dmsquash, resume: do not name the /dev/.udev/rules like the /etc ones 2010-06-25 11:42:51 +02:00
Harald Hoyer
45b5a4e142 dracut-functions: use LC_ALL=C rather than LANG=C 2010-06-22 11:59:49 +02:00
Harald Hoyer
e4ebd474ec dracut-functions: set LANG=C for ldd output parsing 2010-06-22 10:32:25 +02:00
Harald Hoyer
ae5ec68355 Write rules for symlinks to /dev/.udev/rules.d for later usage
We want some symlinks to persist in the real root, so we write them to
/dev/.udev/rules.d, that they survive a retrigger.
2010-06-22 10:30:39 +02:00
Harald Hoyer
95c1941ce5 crypt: add fpu kernel module 2010-06-21 20:47:01 +02:00
Harald Hoyer
59a083d8d1 fips: fixes copy&paste error for "check" 2010-06-18 12:52:52 +02:00
Harald Hoyer
be217dc4d4 dracut.8: changed IPv6 addresses to the documentation address space 2010-06-17 17:14:09 +02:00
Harald Hoyer
e8e4b28dfa dracut.8: add note about putting IPv6 addresses in brackets 2010-06-17 17:03:38 +02:00
Harald Hoyer
1c894acb42 fixed "ip=dhcp6" 2010-06-17 16:25:28 +02:00
Harald Hoyer
7d86d90d11 Version 006 2010-06-17 10:58:27 +02:00
Harald Hoyer
532b8c7a43 dracut.spec: moved znet to dracut-network 2010-06-17 10:46:29 +02:00
Amadeusz Żołnowski
22ecea456b dracut, dracut-functions: better vercmp
credits go to V. Lowther
2010-06-17 09:43:16 +02:00
Harald Hoyer
5f927f201d network: strip pxelinux hardware type field from BOOTIF 2010-06-11 13:16:36 +02:00
Harald Hoyer
b48d98dda3 crypt: install more aes modules 2010-06-11 12:52:16 +02:00
Harald Hoyer
4eab305062 network: depend on ifcfg, if /etc/sysconfig/network-scripts exist 2010-06-10 13:52:31 +02:00
Harald Hoyer
edcd2c5eb7 lvm: install lvm mirror and snaphot libs 2010-06-10 13:51:40 +02:00
Amadeusz Żołnowski
2c24ee9a72 dracut-functions: fun. vercmp optimized; credits go to Victor Lowther 2010-06-09 17:36:02 +02:00
Harald Hoyer
169f167151 iscsi: add support for multiple netroot=iscsi:
The whole netdisk concept should be reviewed though!
2010-06-09 16:46:33 +02:00
Harald Hoyer
08e10f05f6 plymouth/cryptroot-ask.sh: beautify password prompt 2010-06-09 11:56:06 +02:00
Harald Hoyer
bd987e3036 selinux: move selinux to a separate module 2010-06-09 11:22:22 +02:00
Amadeusz Żołnowski
be0921a413 90crypt: 'crypto_LUKS' identifier corrected 2010-06-09 11:04:02 +02:00
Amadeusz Żołnowski
f01d965f0e 95uswsusp: Gentoo path for 'resume' binary 2010-06-09 10:46:38 +02:00
Amadeusz Żołnowski
ecf42850c3 Support old version of module-init-tools
modprobe included in version prior to 3.7 of module-init-tools doesn't
have -d | --dirname option which allows to give a prefix other than
'/' for kernel modules path. Dracut assumes existence of that
option and uses it even with default '/'. The patch passes -d option
only if it's different from default and also checks module-init-tools
version if user changes the prefix by --kmoddir Dracut option.
2010-06-09 10:46:38 +02:00
Victor Lowther
2974f382f8 Have cryptroot-ask load dm_crypt if needed. 2010-06-09 10:46:38 +02:00
Victor Lowther
6a4f980921 Just look for cryptroot instead of /sbin/cryptroot
We know what the path is and what it contains in the initrd, and
not everyone puts cryptroot in /sbin
2010-06-09 10:46:38 +02:00
Victor Lowther
5a4bbf1bda Arch handles loading modules from udev in a somewhat customized manner. 2010-06-09 10:46:38 +02:00
Harald Hoyer
123e24a3b5 multipath: remove multipath udev rules, if no multipath.conf was found 2010-05-27 14:34:02 +02:00
Harald Hoyer
dcdf5c8801 multipath: simplify and install wwids (rhbz 595719)
install /etc/multipath/wwids

With the proper 40-multipath.rules and new udev device-mapper mechanism,
we don't need the multipath scan anymore.

rhbz#595719
2010-05-27 14:19:11 +02:00
Harald Hoyer
ed8c7bf5c2 dracut-functions: beautified warnings 2010-05-26 17:43:18 +02:00
Harald Hoyer
70503db416 dracut-functions: check if specific dracut module is missing 2010-05-26 17:42:57 +02:00
Harald Hoyer
a2929f90ff selinux-loadpolicy.sh: exit for "selinux=0" 2010-05-19 10:01:33 +02:00
Harald Hoyer
9cdde06d50 Makefile: make more clean 2010-05-19 09:55:48 +02:00
Harald Hoyer
b6a7c09070 chmod 0755 *.sh 2010-05-19 09:40:48 +02:00
Harald Hoyer
680ac04370 95znet: removed 55-ccw.rules and ccw_init 2010-05-19 09:39:36 +02:00
Harald Hoyer
e54a84113e get rid of rdnetdebug
set PS4 and output to /dev/initlog.pipe
2010-05-19 09:38:09 +02:00
Harald Hoyer
91d8394093 95fcoe/fcoe-up: wait_for_if_up 2010-05-19 09:36:11 +02:00
Harald Hoyer
e02c2d5c43 TEST-50-MULTINIC: do not provide a cdrom in the testcase 2010-05-19 09:35:01 +02:00
Harald Hoyer
7c0aa2a2ea 40network/ifup: be more verbose 2010-05-19 09:33:58 +02:00
Harald Hoyer
9ab1426534 40network/dhclient-script: be more verbose 2010-05-19 09:33:20 +02:00
Harald Hoyer
647035f9aa 40network/parse-ip-opts.sh: add "ip=auto6" to valid options 2010-05-19 08:29:05 +02:00
Andy Lutomirski
a3afcf2a5a 90mdraid dracut-functions: fix md raid hostonly detection
check_block_and_slaves looks at slaves but not parents.
2010-05-19 08:13:12 +02:00
Harald Hoyer
7e33fa5b52 dracut.spec: clean up the requirements 2010-05-07 11:04:23 +02:00
Harald Hoyer
d0ced35fc6 dracut: get rid of the "file" command 2010-05-07 11:03:55 +02:00
Harald Hoyer
a8ca68a91e plymouth/plymouth-populate-initrd: get rid of awk 2010-05-07 11:02:31 +02:00
Harald Hoyer
5be225d299 use "grep" directly without "nm" to drop binutils requirement 2010-05-07 10:44:30 +02:00
Harald Hoyer
a8a103e093 dracut.spec: remove elfutils-libelf requirement 2010-05-07 10:16:03 +02:00
Harald Hoyer
d7a272a95e plymouth: only display luksname and device for multiple luks
https://bugzilla.redhat.com/show_bug.cgi?id=561092
2010-05-06 17:32:34 +02:00
Alexander Todorov
c198a4bc8c dracut.8: fix rd_LVM_LV description 2010-05-06 16:58:51 +02:00
Harald Hoyer
13289be133 fcoe: add /sbin/vconfig and the 8021q kernel module 2010-05-06 16:23:46 +02:00
Harald Hoyer
3df3a99759 znet: renamed rd_CCW to rd_ZNET
but parse old rd_CCW anyway
2010-05-05 12:54:04 +02:00
Dan Horák
270ba358fa znet: use ccw-init and ccw rules from s390utils in dracut 2010-05-05 12:51:46 +02:00
Harald Hoyer
d87c2708ec dracut.conf: use "+=" as default for config variables 2010-05-03 11:35:10 +02:00
Harald Hoyer
d8b9844c61 dracut-functions: use udevadm to get ID_FS_* 2010-05-03 11:34:30 +02:00
Harald Hoyer
1d323cd938 kernel-modules: add more hardcoded modules 2010-05-03 11:33:52 +02:00
Harald Hoyer
8f74a60ced btfrs: load btrfs module and updated NEWS 2010-04-16 18:10:47 +02:00
Matt
127fb81754 Needs btrfsctl, not btrfs module 2010-04-16 18:03:08 +02:00
Harald Hoyer
ebcfda6c61 test/NBD: check for nbd kernel module first 2010-04-16 17:59:51 +02:00
Harald Hoyer
bdcb63b0e6 NEWS: update 2010-04-16 17:59:51 +02:00
Harald Hoyer
8f4c066020 test/MULTINIC: kill server after passing all tests 2010-04-16 17:59:51 +02:00
Harald Hoyer
1fca65c576 dracut.spec: removed e2fsprogs requirement 2010-04-16 17:59:51 +02:00
Harald Hoyer
da4e644327 test/TEST-50-MULTINIC: install sd_mod and ata_piix kernel modules 2010-04-16 17:59:51 +02:00
Harald Hoyer
c5ef4b63a3 test/TEST-50-MULTINIC: install all nfsidmap libs for server 2010-04-16 17:59:50 +02:00
Harald Hoyer
6c980807d0 test/TEST-50-MULTINIC: kill server after failed test 2010-04-16 17:59:50 +02:00
Harald Hoyer
97add1b383 NBD: kill server after failed test 2010-04-16 17:59:50 +02:00
Harald Hoyer
3de984ba7f test/nfs: correct return code and cleanup 2010-04-16 17:59:50 +02:00
Harald Hoyer
85fd75f91f add rd_retry kernel command line parameter
rd_retry=<seconds to retry in the main loop>

speeds up internal test suite
2010-04-16 17:59:50 +02:00
Harald Hoyer
0c88742669 test: change testsuite to local tcp rather than udp multicast
multicast needs an ethernet device and correct firewall rules
the loopback interface suites better as we only have 2 machines
2010-04-16 17:59:49 +02:00
Harald Hoyer
709302e3cc run-qemu: add /usr/libexec/qemu-kvm to search 2010-04-16 17:59:49 +02:00
Harald Hoyer
3e96d7aa33 TEST-12-RAID-DEG/create-root: filter MD_UUID only 2010-04-16 17:59:49 +02:00
Harald Hoyer
3409c2377f loginit: turn off debugging 2010-04-16 17:59:49 +02:00
Harald Hoyer
4058d85cb6 init: do not redirect to - 2010-04-16 17:59:49 +02:00
Harald Hoyer
2937028c54 init: fix cdrom polling loop 2010-04-16 17:59:49 +02:00
Harald Hoyer
56f184310a mdraid: try to start container childs manually with "mdadm -R" 2010-04-16 17:59:48 +02:00
Harald Hoyer
1d149cd039 dracut-lib: turn of shell debug mode in strstr and getarg(s) 2010-04-16 17:59:48 +02:00
Harald Hoyer
dafa4f621f udev-rules: be more careful about md devices and blkid runs 2010-04-16 17:59:48 +02:00
Harald Hoyer
0679a6d24e nfs: add missing nfsidmap libs 2010-04-16 17:59:48 +02:00
Harald Hoyer
8ded2a65c0 network: correct rules for multiple nics 2010-04-16 17:59:48 +02:00
Harald Hoyer
400723054c network: removed bogus udev rules 2010-04-16 17:59:48 +02:00
Harald Hoyer
7f00669875 nfs: fixed nsswitch.conf parsing
based on a patch of Ian Dall.
https://bugzilla.redhat.com/show_bug.cgi?id=578060
2010-04-15 16:26:06 +02:00
Ville Skyttä
c91570782c Use pigz for gzipping if available. 2010-04-15 14:46:48 +02:00
Harald Hoyer
fede5bbcda dracut.spec: add btrfs module 2010-04-15 14:38:38 +02:00
Harald Hoyer
e9e93e2ec6 kernel-modules: only remove ocfs2, if all filesystems are installed 2010-04-15 12:47:52 +02:00
Harald Hoyer
d4abad2288 kernel-modules: hardcode sr_mod 2010-04-15 12:47:26 +02:00
Harald Hoyer
ddbdebb9c8 AUTHORS: updated 2010-04-15 11:54:28 +02:00
Harald Hoyer
4828beb949 dracut: add_drivers from the command line should add up to the conffile 2010-04-14 19:32:44 +02:00
Harald Hoyer
9b17b085f3 manpage addition for kernel drivers
The kernel modules have to be specified without the ".ko" suffix.
2010-04-14 17:58:56 +02:00
Harald Hoyer
d293133982 add missing paragraph for --add-drivers 2010-04-14 17:50:39 +02:00
Harald Hoyer
cd83e4c54d init: trigger with --action=add 2010-04-14 16:36:30 +02:00
Joey Boggs
fbf1b5b138 teach dmsquash-live-root to use rootflags 2010-04-13 16:02:10 +02:00
Harald Hoyer
58ffd15bff add module btrfs 2010-04-13 15:22:36 +02:00
Harald Hoyer
0e0bf83057 init: add hacky cdrom polling mechanism 2010-04-13 13:51:49 +02:00
Harald Hoyer
d693f34afb dmraid: parse different error messages 2010-04-13 12:54:12 +02:00
Harald Hoyer
d1bae3cd17 dracut.8: add information, which parameter can be specified multiple times 2010-04-13 12:53:41 +02:00
Harald Hoyer
7ea25f3a34 dracut.8: fixed LUKS paragraph 2010-04-13 12:53:36 +02:00
Harald Hoyer
e876763655 updated NEWS, moved tag 005 2010-03-19 17:35:47 +01:00
Harald Hoyer
ab56546dc7 version 005 2010-03-19 16:51:05 +01:00
Harald Hoyer
3592d8683b dracut.spec: rpmlint cosmetics 2010-03-19 16:51:05 +01:00
Harald Hoyer
c55b20803a dracut.spec: change description and summaries 2010-03-19 16:51:05 +01:00
Harald Hoyer
7095aab4a2 dracut.spec: remove libselinux, libsepol requirement 2010-03-19 16:51:05 +01:00
Harald Hoyer
8ef5ade737 dracut.spec: remove dracut-kernel subpackage 2010-03-19 16:51:05 +01:00
Harald Hoyer
b3561ee15f lvm/lvm_scan.sh: silence lvm version check 2010-03-19 16:51:05 +01:00
Harald Hoyer
16b046d5da fcoe: soft install fcoe bins 2010-03-19 16:51:04 +01:00
Hans de Goede
37b14e7295 Add dcb support to dracut's FCoE support (rh563794)
Note that there are still some patches queued upstream for fcoe-utils to
enable it to work with the new lldpad and to add support to fipvlan to
bring up FCoE connections without requiring fcoemon to run.

The invocations of the various tools as in this patch should be final though,
see the discussion in:
http://bugzilla.redhat.com/show_bug.cgi?id=563794

This is the second revision of this patch, which no longer adds /etc/fcoe
to the initrd as that is not needed.
2010-03-19 15:03:21 +01:00
Mike Snitzer
f6458b80ef lvm_scan: use '--ignoremonitoring' rather than '--monitor n'
lvchange and vgchange '--monitor n' will not prevent lvm from
attempting to dlopen the libdevmapper-event library.

dracut git commit 47ab3b6c5e introduced the use of '--monitor n' but
'--ignoremonitoring' is needed now that the libdevmapper-event library
isn't copied into the initramfs (ever since 0fae59d6eb)

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
2010-03-17 11:59:38 +01:00
Harald Hoyer
3b0f71921d kernel-modules/installkernel: force install some modules even in
hostonly mode
2010-03-17 11:50:18 +01:00
Luca Berra
df54ef1390 silence xen-detect detection
Signed-off-by: Luca Berra <bluca@comedia.it>
2010-03-17 11:50:18 +01:00
Philippe Seewer
16add2aac7 debian: add dracut-gencmdline 2010-03-05 15:01:18 +01:00
Philippe Seewer
501cc2458c debian: Add manpage for dracut-catimages 2010-03-05 14:58:59 +01:00
Philippe Seewer
ee7eb10523 debian: add dracut.conf.d 2010-03-05 14:55:37 +01:00
Philippe Seewer
232c082cbc debian: Add xen and uswsusp modules 2010-03-05 11:57:14 +01:00
Philippe Seewer
58659bf221 xen: try harder to locate xen-detect
On debian systems xen-detect does not resite somewhere in $PATH,
but under /usr/lib/xen-default/bin. This patch ensures that this
is searched as well when locating and installing xen-detect.
2010-03-05 11:51:56 +01:00
Philippe Seewer
8a08012764 test: use ldconfig processing for roots as well 2010-03-05 11:42:04 +01:00
Harald Hoyer
fdc421dbac dracut: move ldconfig after include 2010-03-05 11:14:28 +01:00
Harald Hoyer
70aaa95d52 dracut: do a full ldconfig in the initramfs 2010-03-05 11:07:10 +01:00
Harald Hoyer
80a6943fc4 ifcfg: set mode 0755 for scripts 2010-03-04 18:03:36 +01:00
Harald Hoyer
72011255e0 rpmversion/install: add shebang 2010-03-04 18:02:27 +01:00
Harald Hoyer
de50046cd7 dmsquash-live-root: use blockdev with --getsz
Thanks Karel for pointing this out.. again :)
2010-03-04 16:49:51 +01:00
Harald Hoyer
e606012ce6 udev-rules: hotplug.functions is not executable, so use -e instead of -x 2010-03-04 14:21:56 +01:00
Andrey Borzenkov
b63fd4d905 Pass init argument(s) to real init
Common wisdom to enter single user on Linux is to edit command
line and add "single". This was not possible because switch_root
was always called with empty init arguments. Collect them from
command line and pass to real init when switching root.

Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
2010-03-04 14:06:48 +01:00
Andrey Borzenkov
01b8cdffca Fix boot with user suspend and no resume= kernel argument
Mandriva bug https://qa.mandriva.com/show_bug.cgi?id=57924. Check
if dracut got resume= argument before calling /usr/sbin/resume
2010-03-04 14:06:48 +01:00
Harald Hoyer
aab70adc0b dmsquash-live: use --getsize64 instead of --getsize 2010-03-04 14:06:48 +01:00
Joey Boggs
7baade2b87 add readonly overlay support for dmsquash
Adds the readonly_overlay karg for cases where the dm snapshot should be set to readonly. Use case would be a livecd that is configured to have a readonly root where filling up the dm snapshot would cause a problem.
2010-03-04 14:06:47 +01:00
Harald Hoyer
b686095f99 udev-rules: choose between several firmware upload tools
debian: firmware.agent hotplug.functions
old fedora: firmware.sh
new udev upstream: firmware
2010-03-04 14:06:47 +01:00
Harald Hoyer
a56e93c10c kernel-modules: add keyboard kernel modules 2010-03-04 14:06:46 +01:00
Philippe Seewer
465f223905 fix permissions: should be +x 2010-03-03 17:29:39 +01:00
Philippe Seewer
3121677949 parse-kernel.sh must have a shebang 2010-03-03 17:29:26 +01:00
Philippe Seewer
a65914b4a2 debian: update Standards-Version 2010-03-03 16:49:10 +01:00
Philippe Seewer
cff621603c debian: dracut package should at least suggest dracut-network 2010-03-03 16:48:43 +01:00
Philippe Seewer
259872feac debian: complete s/dracut-net/dracut-network/g
When changing package names, corresponding files must be renamed
as well.
2010-03-03 16:48:16 +01:00
Peter Jones
43f2533977 Use multipath if it's installed and being used for the root fs.
Don't conditionalize on hostonly; use multipath if it's installed and in
use.
2010-02-25 10:24:14 -05:00
Harald Hoyer
454771cd86 dracut: add check, if we can write to the output image file 2010-02-18 18:27:39 +01:00
Harald Hoyer
0ec519f8a4 mount-root: also filter "defaults" from mount options 2010-02-18 18:05:51 +01:00
Harald Hoyer
d793fc2e8b mount-root: skip comments 2010-02-18 17:46:01 +01:00
Harald Hoyer
26999d6ddb dracut: removed "local" not inside of function 2010-02-18 17:28:41 +01:00
Harald Hoyer
9232cab470 fix IFS restoring 2010-02-18 09:46:19 +01:00
Harald Hoyer
a15935c143 selinux: fix "selinux=0" handling 2010-02-18 08:46:57 +01:00
Harald Hoyer
11ce36d78e mount-root: do not pollute init arguments
and do not remount if no new rootopts set in /etc/fstab
2010-02-17 20:18:10 +01:00
Harald Hoyer
4819ae98ac fix lib64 check
on ppc we can have libc in /lib64/power6/
2010-02-17 17:02:04 +01:00
Harald Hoyer
8c8cd69d32 s390: *_cio_free needs "seq" 2010-02-15 18:08:11 +01:00
Harald Hoyer
7800cc247e fix selinux disabled state
Execute load-policy when the config file contains SELINUX=disabled.
2010-02-15 12:58:00 +01:00
Harald Hoyer
21a74b32b2 nfs4: rpc.idmapd does not accept parameters anymore
modify /etc/idmapd.conf instead
2010-02-15 10:43:51 +01:00
Harald Hoyer
1cf0b1750b removed cdrom hack for live CDs
The hack does not work reliable for CDROMs with the firmware bug.
We have really to fix cdrom_id.
2010-02-15 09:55:20 +01:00
Harald Hoyer
94d2148707 dracut.conf: added add_dracutmodules 2010-02-12 12:19:33 +01:00
Harald Hoyer
2c2c45800c add /etc/dracut.conf.d 2010-02-12 11:12:37 +01:00
Harald Hoyer
edb511860c Fixed: Move multipath scan earlier. It must go before any other dm rules.
Also changed the filename in the install file.
2010-02-12 11:00:21 +01:00
Harald Hoyer
a39ea24f10 nfs: suppress error message about missing passwd 2010-02-10 18:54:31 +01:00
Harald Hoyer
93bc3d440c make nfs4 work 2010-02-10 17:21:46 +01:00
Peter Jones
7e22ab0891 Move multipath scan earlier. It must go before any other dm rules.
multipath scan needs to go before lvm, or else lvm may grab the device
multipath would activate, and multipath will be unable to claim it.
2010-02-05 14:23:20 -05:00
Harald Hoyer
c98bcec89c add preliminary IPv6 support 2010-02-04 16:05:19 +01:00
Harald Hoyer
b456ab777d zfcp: install s390utils script rather than local one 2010-02-04 16:03:35 +01:00
Harald Hoyer
d43036ffeb rootfs-block: strip "ro|rw" options from fstab options
https://bugzilla.redhat.com/show_bug.cgi?id=560424
2010-02-03 17:24:51 +01:00
Harald Hoyer
54aaad9dad test/iSCSI: fixed test script 2010-02-03 16:42:43 +01:00
Harald Hoyer
c88b219410 dasd_mod: changed prio of cmdline hook to be executed after dasd 2010-02-03 10:17:58 +01:00
Harald Hoyer
bab749e23e init: dashified $[] -> $(()) 2010-02-02 15:21:51 +01:00
Harald Hoyer
d54a0e5ae8 beautified man pages 2010-02-02 15:11:59 +01:00
Harald Hoyer
4dc4cc3fc6 fixed permissions for the check files 2010-01-27 16:11:19 +01:00
Peter Jones
3d45f9bba9 Add a check file for multipath.
If multipath isn't installed, don't use it.  If we're in hostonly mode,
only install the multipath module if it's used for / .  Otherwise, if
the user was dumb enough to install it, they get it during bootup.
2010-01-27 16:10:43 +01:00
Harald Hoyer
97c97ff6d5 base: fix selinux handling if .autorelabel is present
rhbz#557744
2010-01-27 16:09:15 +01:00
Harald Hoyer
d8231fa5c2 mdraid: prefer /etc/mdadm.conf over /etc/mdadm/mdadm.conf
see https://bugzilla.redhat.com/show_bug.cgi?id=557339
https://bugzilla.redhat.com/show_bug.cgi?id=559073
2010-01-27 15:59:10 +01:00
Harald Hoyer
5db587d7c1 init: fixed emergency_shell argument parsing 2010-01-20 16:04:55 +01:00
Harald Hoyer
3ee26913e7 version 004 2010-01-15 14:09:06 +01:00
Harald Hoyer
4bb570c9a4 dracut-lib: do not leave debug mode in getarg and getargs 2010-01-15 14:07:54 +01:00
Harald Hoyer
0e8b76a57e test: remove lvm.conf in create-root.sh 2010-01-15 12:58:46 +01:00
Harald Hoyer
2dfdcbf4e7 dracut-lib: read multiple lines from $init/etc/cmdline 2010-01-15 12:33:41 +01:00
Harald Hoyer
1b3bdcc1a6 dracut.spec: only obsolete for rhel >= 6 and fedora > 12
and do not provide lsinitrd and mkinitrd
2010-01-15 10:28:44 +01:00
Warren Togami
dc5bb506ff dracut.spec: nbd is Fedora only 2010-01-14 18:11:52 +01:00
Harald Hoyer
074d12c1fa add lsinitrd 2010-01-14 17:20:43 +01:00
Harald Hoyer
80deff7c4b lvm: remove lvm-cleanup 2010-01-14 17:04:06 +01:00
Harald Hoyer
b7b6c6e1c6 test: remove lvm.conf in create-root.sh 2010-01-14 17:02:18 +01:00
Munehiro Matsuda
651f3f3d1a dmsquash: add support for loopmounted *.iso files
https://bugzilla.redhat.com/show_bug.cgi?id=548283
2010-01-14 16:47:16 +01:00
Harald Hoyer
0bc4ef1caf dracut.spec: update plymouth requirements 2010-01-14 15:54:17 +01:00
Harald Hoyer
dc0a0f6c93 lvm: add rd_LVM_LV and "--poll n" 2010-01-13 17:59:14 +01:00
Harald Hoyer
63d8d27b03 install lsinitrd/mkinitrd 2010-01-13 17:13:20 +01:00
Harald Hoyer
dc40ea7fa1 crypt/dm: move dmeventd to dm module 2010-01-13 16:33:40 +01:00
Mike Snitzer
0fae59d6eb lvm: lvm.conf (locking_type = 4)
- the use of sed is placeholder "hack" until lvm2 provides a proper
  tool for changing lvm.conf
- lvm_scan.sh should run lvm commands with --ignorelockingfailure to
  re-use lvm's existing initrd-specific logic; future lvm2 changes
  will split this flag out into various new command-line switches
- no monitoring should be started from within initramfs
- NOTE: the same should apply to 90dmraid/install
- the correct types would be: '[ "blkext", 1 , "cciss0", 16 ]'
  but lvm2 (>= 2.02.52) already properly supports both 'blkext' and
  'cciss' (including cciss0 -> cciss7)
2010-01-13 16:29:12 +01:00
Andrey Borzenkov
5c7821b6c5 Add user suspend support
This patch adds support for user mode suspend to disk. It is installed
in parallel to kernel mode suspend module; either will fail if
system was not suspended using correct tool so next one can be tried.

Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
2010-01-13 16:08:22 +01:00
Luca Berra
f5745ec58b Ensure UNICODE keyboard layout is functional in emergency shell
/lib/udev/cosole_init will load either non-unicode or unicode versions
of keyboard layout for the same value of KEYMAP depending on language
setting. The simplest solution is to install both versions in initrd;
it does not take much space.

While on it, copy some additional maps to ensure emergency shell
has the same keyboard layout as full system.

Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
Signed-off-by: Luca Berra <bluca@vodka.it>
2010-01-13 16:06:11 +01:00
Luca Berra
b21d5cb2dc add mkinitrd-dracut.sh wrapper
a wrapper around dracut with the syntax from mkinitrd, could
help transition to dracut.
2010-01-13 16:03:32 +01:00
Luca Berra
74c5dd2158 dracut-functions: add additional drivers in host-only mode, too
this makes dracut load kernel module specified in add-drivers even
if building an host-only mkinitrd, it is useful in cases where we
might change some storage drivers and still don't want to build
an enormous initrd (e.g. ahci/ata_piix)
2010-01-13 16:02:10 +01:00
Luca Berra
b5664d5d02 base: improve emergency shell
for some unknown reason the emergency shell
starts with stderr closed, at first I even tought it was not working at
all, then I came up with this hack, which seems to work properly. I also
change the prompt to remind which step are we breaking to.
2010-01-13 16:01:36 +01:00
Luca Berra
506c7f2ab0 install umount for the modules, which use it 2010-01-13 15:57:32 +01:00
Luca Berra
17dcc1a801 base: do not force load policy if selinux is not installed at all 2010-01-13 15:56:34 +01:00
Luca Berra
9b37edbff5 dracut-functions: add support for compressed kernel modules 2010-01-13 15:53:17 +01:00
Luca Berra
e22cdb9ef8 terminfo: search also for /usr/share/terminfo 2010-01-13 15:50:52 +01:00
Luca Berra
636fa8bea8 redhat-i18n: search also in /usr/lib
we have kbd data in /usr/lib, so this patch will
search for /lib/kbd and /usr/lib/kbd and use the existing one
2010-01-13 15:50:02 +01:00
Konrad Rzeszutek Wilk
9799e0ad8e 60xen: add support for loading Xen modules 2010-01-13 15:37:05 +01:00
Harald Hoyer
6ca1d346be kernel: add rdloaddriver kernel command line parameter
rdloaddriver=<drivername>
force loading kernel module <drivername>
2010-01-13 15:34:18 +01:00
Harald Hoyer
e1603bf7e4 s390: add call to *_cio_free and use current s390utils udev rules 2010-01-13 14:26:46 +01:00
Harald Hoyer
5c554bd278 dracut.spec: add Obsoletes of mkinitrd/nash/libbdevid-python 2010-01-13 14:16:49 +01:00
Harald Hoyer
71cfa2e225 dmsquash: add nasty hack for cdroms
Some CDROMs do not generate a label symlink and have to be read from.
2010-01-12 15:08:54 +01:00
Harald Hoyer
bb2200ffca cryptroot-ask.sh: fixed luks handling
see https://bugzilla.redhat.com/show_bug.cgi?id=530898#c16
2010-01-12 14:55:09 +01:00
Harald Hoyer
66e45737e1 add man pages for dracut-catimages and dracut-gencmdline 2010-01-12 14:51:17 +01:00
Harald Hoyer
695de8493d dracut-lib: prevent double log output 2010-01-12 10:37:27 +01:00
Harald Hoyer
c5488692d4 multipath: check for existance before trying to install 2010-01-12 10:31:51 +01:00
Harald Hoyer
0a19e31886 plymouth-pretrigger: force initializing of console (bug #526570) 2009-12-21 15:15:38 +01:00
Harald Hoyer
2c2e3ad860 cryptroot-ask.sh: s/==/=/g (bug #542081) 2009-12-21 15:15:23 +01:00
Harald Hoyer
938dbad1e8 multipath: supress warnings, if multipath not installed on system 2009-11-30 15:24:47 +01:00
Harald Hoyer
ff0bfa28d3 .mailmap: updated 2009-11-27 15:38:37 +01:00
Harald Hoyer
d3e11cf813 AUTHORS: updated 2009-11-27 15:38:21 +01:00
Harald Hoyer
9993392f6d version 003 2009-11-27 15:25:46 +01:00
Harald Hoyer
e891618572 debian: s/dracut-net/dracut-network/g 2009-11-27 15:03:34 +01:00
Philippe Seewer
96f8e314b3 Debian support: Add necessary control files for packaging
This patch adds all necessary files to build dracut debian packages.

- I've split dracut into two parts: The dracut package for booting from block
  devices and dracut-net for netroot.
- I've deliberately left out all redhat specific modules, they do not make any
  sense on debian at all
2009-11-27 15:02:41 +01:00
Philippe Seewer
0edcf5fa8b Debian support: Add dracut-update-initramfs
This script is necessary to integrate dracut into the initramfs-
infrastructure of debian.

The file itself is just a copy from initramfs-tools' update-initramfs,
with a few lines modified to run dracut instead of mkinitramfs.
2009-11-27 15:02:38 +01:00
Harald Hoyer
0cd23d778e Makefile: gitrpm: cleanup on failed rpmbuild 2009-11-27 14:57:37 +01:00
Harald Hoyer
14f6ad921b dracut.spec: removed ubuntu module 2009-11-27 14:57:28 +01:00
Harald Hoyer
8e93970944 fips: do not activate fips module by default 2009-11-27 14:55:02 +01:00
Harald Hoyer
b65f499f60 fips: more shebang 2009-11-27 14:32:28 +01:00
Harald Hoyer
c2bcc5be2f fips: add shebang to fips.sh 2009-11-27 14:31:05 +01:00
Harald Hoyer
ba67b9239b changed hostonly documentation and handling 2009-11-27 14:29:32 +01:00
Harald Hoyer
f4f45af792 dracut.spec: add comment how to get source for a git snapshot 2009-11-27 14:17:53 +01:00
Philippe Seewer
9cce5af5af Remove Ubuntu 8.10 support
This is outdated and no longer needed
2009-11-27 14:07:21 +01:00
Philippe Seewer
2e6b98c7f6 All module scripts should have a shebang 2009-11-27 14:07:21 +01:00
Philippe Seewer
a8dbfbb8ce Fix manpage display errors
Some lines in dracut's manpage are just too long for justified
display on 80c terminals. These small corrections fix this. In addition
man --warnings does not complain anymore about anything at all.
2009-11-27 14:07:21 +01:00
Philippe Seewer
a68c99c94e loginit: Fix shebang 2009-11-27 14:07:21 +01:00
Philippe Seewer
00da3293e2 initqueue: Remove trailing ;
dash -n complains about the trailing ';' and somehow I think this
really isn't needed.
2009-11-27 14:07:21 +01:00
Philippe Seewer
6a0ce0a518 Module scripts should be executable 2009-11-27 14:07:20 +01:00
Philippe Seewer
7ce55fd6b7 syslog-genrules.sh: Shebang should be /bin/sh not /bin/dash 2009-11-27 14:07:20 +01:00
Harald Hoyer
6cc96b358a add dracut.conf man page 2009-11-27 10:53:28 +01:00
Harald Hoyer
4d6660c2ed dracut: fix no_kernel typo 2009-11-27 10:52:55 +01:00
Harald Hoyer
f5b01e3c57 test: set PATH 2009-11-26 19:12:20 +01:00
Harald Hoyer
57c6b805ce rootfs-block/mount-root: remount root with /etc/fstab filesystem options 2009-11-26 19:12:10 +01:00
Harald Hoyer
17ed15182a multipath: corrected initqueue parameter 2009-11-26 11:41:53 +01:00
Harald Hoyer
77eaa2fea1 dm: install dmsetup 2009-11-26 11:02:34 +01:00
Harald Hoyer
3c56f37265 dracut-functions: inst_simple(): do not bail out if target is a dir and exists 2009-11-26 10:56:53 +01:00
Harald Hoyer
4073e3a325 nfs: add rd_NFS_DOMAIN parameter to set the NFSv4 domain name
https://bugzilla.redhat.com/show_bug.cgi?id=537969
2009-11-26 10:38:40 +01:00
Harald Hoyer
48df9fcc11 nfs: install passwd entries for nobody and nfsnobody 2009-11-26 10:38:06 +01:00
Harald Hoyer
bad6113059 lvm/dmraid: make LIBDIR depend on the binary 2009-11-25 20:08:22 +01:00
Yanko Kaneti
9e7ac6982a Wildcards need dracut_install 2009-11-25 19:55:17 +01:00
Harald Hoyer
47ab3b6c5e lvm: scan without monitor
https://bugzilla.redhat.com/show_bug.cgi?id=540289
2009-11-25 19:55:17 +01:00
Peter Jones
c761b26aef Handle modules with hyphens in their names properly.
If a module has a hyphen in its name, it will show up as an underscore
in /proc/modules.  Because of this, when we're testing /proc/modules,
we have to munge our module filename expression to match.
2009-11-25 13:40:22 -05:00
Peter Jones
4ee9ce444b This has to be executable.
multipath-scan.sh has to be executable, of course.
2009-11-25 11:26:38 -05:00
Peter Jones
01ba5f2192 Fix missing shell variables.
Somehow copy+paste from one machine to the other removed all the shell
variables from this line.  Oops.
2009-11-25 11:06:35 -05:00
Peter Jones
b869710aff Bring up multipath devices that are configured in multipath.conf.
This brings up multipath devices which are configured in multipath.conf
as we find them.
2009-11-25 10:54:12 -05:00
Peter Jones
323428ced5 Make sure and get all the multipath related modules.
Install all modules that are any of:
- scsi device handler
- dm log handler
- dm path selector
- dm target

It would be nice if we could tell which log handlers and targets are
multipath related, but we really can't.
2009-11-25 10:54:12 -05:00
Peter Jones
8f99a7f6e3 Add #!/bin/bash for consistency.
Most install scripts seem to have it there, may as well make this one
like the rest...
2009-11-25 10:54:12 -05:00
Peter Jones
aff873923c Use glob for libdir when installing multipath libraries.
Use "/lib*/" not "/lib/" so it works when they're in /lib/multipath as
well as when they're in /lib64/multipath
2009-11-25 10:54:09 -05:00
Harald Hoyer
4d1661d39a specfile update 2009-11-23 15:19:19 +01:00
Harald Hoyer
a34a0df207 90dm: install more device mapper kernel modules 2009-11-23 12:28:58 +01:00
Harald Hoyer
5841610c7f kernel-modules: add firewire-ohci to hardcoded modules list 2009-11-23 12:28:58 +01:00
Harald Hoyer
557ea7a8da fips: search different lib paths 2009-11-23 12:28:57 +01:00
Harald Hoyer
7f1282834f Makefile: add WITH_SWITCH_ROOT 2009-11-23 12:28:53 +01:00
Harald Hoyer
4e0ef1d982 dracut: create initramfs-$(kernelversion).img by default 2009-11-19 15:47:06 +01:00
Harald Hoyer
734a0d9ebc dracut: check more return codes, check for permissions and use derror 2009-11-19 15:46:09 +01:00
Harald Hoyer
4d66861107 dracut.8: fixed formatting for rootfs and mount options 2009-11-18 10:24:08 +01:00
Harald Hoyer
44a6a0d941 specfile update 2009-11-17 15:00:56 +01:00
Harald Hoyer
95940758e9 multipath: install multipath kernel module 2009-11-17 14:58:51 +01:00
Harald Hoyer
bfd98ad44b multipath: install xdr utils 2009-11-17 14:58:42 +01:00
Harald Hoyer
b59d3549fd NEWS update 2009-11-13 10:36:27 +01:00
Harald Hoyer
5f7149068e multipath: install udev rules and helper tools 2009-11-13 10:27:09 +01:00
Harald Hoyer
8ec6bfcbe7 specfile update 2009-11-13 10:26:50 +01:00
Dan Horák
200e59149c move dasd initialization script and rules to s390utils
The primary source for dasd initialization script and udev rules is
now in s390utils package. The s390utils-base subpackage, that carries
the required files, is always installed on s390/s390x, because it's
part of the Core group in comps.

Signed-off-by: Dan Horák <dan@danny.cz>
2009-11-12 15:56:58 +01:00
Harald Hoyer
978d78f7b2 add module 90multipath 2009-11-12 15:12:18 +01:00
Harald Hoyer
03d8ec2601 add module fips 2009-11-12 14:59:28 +01:00
Harald Hoyer
b941e8fb9f renamed module 95ccw to 95znet 2009-11-12 14:59:28 +01:00
Harald Hoyer
394f30d8d4 crypt: ignore devices in /etc/crypttab (root is not in there) 2009-11-12 14:56:36 +01:00
Harald Hoyer
1e0eb68b69 dasd: only install /etc/dasd.conf in hostonly mode 2009-11-12 14:55:30 +01:00
Harald Hoyer
f791957ae3 zfcp: only install /etc/zfcp.conf in hostonly mode 2009-11-12 14:55:04 +01:00
Harald Hoyer
f21b3f874f kernel-modules: add scsi_dh scsi_dh_rdac scsi_dh_emc 2009-11-12 13:50:12 +01:00
Dan Horák
8fa510d483 control filesystems included in the generic initramfs
New "filesystems" command line/config file option is added with the ability to
control the list of kernel filesystem modules that are included in the generic
initramfs.

Signed-off-by: Dan Horák <dan@danny.cz>
2009-11-10 11:16:50 +01:00
Harald Hoyer
ff777576d8 dracut.8: add FILES section 2009-11-10 11:15:22 +01:00
Harald Hoyer
3b6c1c661e dracut.spec: update 2009-11-06 08:51:50 +01:00
Harald Hoyer
8686bd554b 95dasd: fixed rd_DASD argument handling 2009-11-06 08:44:01 +01:00
Harald Hoyer
62cfb5c161 dracut.8: add more documentation to rd_LUKS_UUID 2009-11-05 17:06:27 +01:00
Harald Hoyer
349bac4214 crypt: install /etc/crypttab and honor crypttab entries 2009-11-05 17:06:26 +01:00
Harald Hoyer
c3844cbf4a crypt: refix rd_LUKS_UUID handling
https://bugzilla.redhat.com/show_bug.cgi?id=533177
2009-11-05 17:06:26 +01:00
Harald Hoyer
556e4ccb42 dracut-gencmdline: do not use full path for readlink 2009-11-05 17:06:26 +01:00
Harald Hoyer
116cb137fe dracut-functions: dinfo() on missing firmware, rather than dwarning() 2009-11-05 17:06:26 +01:00
Harald Hoyer
d7b97367b2 udev-rules: do not run blkid on temporary device mapper devices 2009-11-05 17:06:26 +01:00
Harald Hoyer
b82e22dcaf kernel-modules: install all usb storage modules also 2009-11-05 17:06:26 +01:00
Alan Jenkins
95bde7588c Tidy up some comments
Fix a few typos.
2009-11-03 17:47:38 +01:00
Alan Jenkins
13425eb243 dracut-gencmdline: fix regex quoting in findstoragedriver()
On my LVM system this changes the relevant output from "rd_NO_LVM" to
"rd_LVM_VG=alan-desktop.Linux"

Note that on my newer system, it now reaches moduledep() and complains.
I don't know enough awk to tell whose fault it is :).

    awk: line 2: function gensub never defined
    awk: line 2: function gensub never defined
    rd_NO_MD rd_NO_LVM rd_NO_LUKS LANG=en_GB.UTF-8 root=/dev/sda2

Both my systems (old ubuntu and debian unstable) agree that bash
regexes should not be quoted:

    $ [[ 'a' =~ a ]] && echo match
    match
    $ [[ 'a' =~ ^a$ ]] && echo match
    match
    $ [[ 'a' =~ '^a$' ]] && echo match
    $

(and yes, it is safe against globbing)

    $ touch 9
    $ echo [0-9]
    9
    $ [[ 1 =~ [0-9] ]] && echo match
    match
2009-11-03 17:47:38 +01:00
Harald Hoyer
5bde13f927 specfile update 2009-11-03 17:42:51 +01:00
David Cantrell
78b52181bd Update dracut.8 with new rd_DASD parameter information.
Rename existing rd_DASD parameter to rd_DASD_MOD.  Document new rd_DASD
parameter handling.
2009-11-03 10:43:23 +01:00
David Cantrell
a790547896 Support new rd_DASD parameter for s390 systems.
The new rd_DASD parameter allows dracut to handle multiple rd_DASD
options.  One parameter per DASD.  The syntax is:

    rd_DASD=<device path>[,readonly=X][,erplog=X][,use_diag=X][,failfast=X]

The device path is a CCW device path, such as 0.0.0200.  The optional
parameters are sysfs attributes for the DASD.  The X value can be 0 or
1.  Dracut will write out each of the rd_DASD settings to
/etc/dasd.conf and on bootup, the dasdconf.sh script will parse this
file and bring each DASD online with the specified attribute settings.
2009-11-03 10:43:15 +01:00
David Cantrell
fe32b77f87 Rename existing 95dasd handling to 95dasd_mod.
Rename the existing rd_DASD module handler to rd_DASD_MOD.
2009-11-03 10:43:03 +01:00
Harald Hoyer
dd854ea985 dracut.spec: update 2009-10-27 16:02:57 +01:00
Harald Hoyer
121e7b3e2d TEST-14-IMSM/create-root.sh: wait until md0 is ready synced 2009-10-27 16:02:56 +01:00
Harald Hoyer
15c82415c2 90dmraid,90lvm: device mapper upstream rules got renamed 2009-10-27 16:02:56 +01:00
Harald Hoyer
5d791c0ea9 join $dsrc and $dracutbasedir 2009-10-27 16:02:56 +01:00
Harald Hoyer
07db0defa7 specfile update 2009-10-27 16:02:56 +01:00
Philippe Seewer
41f8a4f14f Add dm_mod loader
Some kernel configurations might build base dm support as a module.
Add module dm which ensures that dm_mod is there and loaded.
2009-10-27 16:02:56 +01:00
Philippe Seewer
778d2ba28b test: Add compatibility for different kernel configs
Some distros, including debian unstable with 2.6.30, still shop
style ide drivers and/or have important filesystems like ext3 as
modules.

This patch ensures that all test cases work on these configurations
by including the necessary modules and adding a simple udev rule
file that provides /dev/sd* symlinks for the case where old style
ide drivers are still in use.
2009-10-27 16:02:56 +01:00
Philippe Seewer
dc490a0f08 Add old style ide drivers if available
Some distros, including debian unstable with 2.6.30, still ship
old style ide drivers. These should be installed as well.

Sadly there are no symbols to use for nm, so a simple =ide needs
to suffice.
2009-10-27 16:02:56 +01:00
Harald Hoyer
641eae0f5a dracut.spec: reverse switch_root logic 2009-10-27 16:02:55 +01:00
Harald Hoyer
2cc8cbeaf4 test/TEST-20-NFS: kill server if pid file present on run() 2009-10-27 16:02:54 +01:00
Warren Togami
24dcacc78f dmsquash-live-root requires grep 2009-10-13 16:23:56 -04:00
Warren Togami
157a8ddf5c Revert to per-device resolv.conf by Seewer's suggestion. 2009-10-13 14:19:49 -04:00
Warren Togami
08d82be71d Better check if writing ifcfg files is necessary. 2009-10-13 13:20:07 -04:00
Harald Hoyer
ba54a4c747 test: add rdinfo 2009-10-09 13:57:35 +02:00
Harald Hoyer
b26260a0b9 dracut-lib: fixed wait_for_if_up() 2009-10-09 13:18:59 +02:00
Harald Hoyer
ffd0861b7c test/*/hard-off.sh: do not powerdown on rdshell 2009-10-09 13:18:05 +02:00
Harald Hoyer
e5ccf5eb93 run-qemu: specify PATH 2009-10-09 13:17:45 +02:00
Harald Hoyer
67307075d1 dmraid: only install libdmraid-events-isw.so
the symlink will trigger install of the real lib file
2009-10-09 13:16:02 +02:00
Harald Hoyer
42c719474e dracut: if called with "-l" read only local dracut.conf 2009-10-09 13:15:32 +02:00
Harald Hoyer
4d9b6060d4 dmraid: do not fail if /usr/lib/libdmraid-events-isw.so is not present 2009-10-09 10:16:08 +02:00
Harald Hoyer
2331d1ff15 ccw: s/layer1/layer2/g 2009-10-08 18:19:11 +02:00
Harald Hoyer
218292f6b1 add s390 network support 2009-10-08 18:10:02 +02:00
Harald Hoyer
95c07b4659 dracut.8: correct typo 2009-10-08 18:09:37 +02:00
Harald Hoyer
186b9c9aac network/parse-bridge: check for bridge parameter not ip 2009-10-08 18:08:34 +02:00
Harald Hoyer
1ccc0fad27 add zfcp support for s390 2009-10-08 14:21:32 +02:00
Harald Hoyer
3e0f415fc6 dasd: rename dasd= to rd_DASD= 2009-10-08 14:21:32 +02:00
Harald Hoyer
5af0cf0ce6 dracut: exit traps with original exitcode 2009-10-08 14:21:31 +02:00
Harald Hoyer
8aa36728f5 plymouth: suppress "find" errors 2009-10-08 14:21:31 +02:00
Harald Hoyer
f2a716d47c base/init: make link /dev/fd, mount devpts,tmpfs with correct dev parm 2009-10-08 14:21:31 +02:00
Warren Togami
4431431c23 Fix comment typo 2009-10-07 16:23:52 -04:00
Harald Hoyer
13ef589dc8 dracut.8: fixed typos 2009-10-07 16:53:59 +02:00
Harald Hoyer
ac36d5db7e base/init: kill loginit after one second of waiting 2009-10-07 16:09:20 +02:00
Harald Hoyer
cdc74b198e dmsquash-live: run dmsquash-live-root after udev settle 2009-10-07 12:49:52 +02:00
Harald Hoyer
8d0a55cfac do not use init= arg as first argument 2009-10-07 12:48:47 +02:00
Harald Hoyer
3f793c91f4 AUTHORS: generated by git-shortlog
add AUTHORS target to Makefile

only list main authors in man page
2009-10-07 10:11:55 +02:00
Harald Hoyer
2dc4a31b6c add .mailmap 2009-10-07 10:03:47 +02:00
Harald Hoyer
40ef4325d9 test: run all tests with rdinitdebug by default 2009-10-06 19:09:22 +02:00
Harald Hoyer
16da29bf9d 99base/initqueue: make operations more atomic 2009-10-06 19:09:22 +02:00
Harald Hoyer
9fbe8a001b TEST-50-MULTINIC/test.sh: add selinux=0 2009-10-06 19:09:21 +02:00
Harald Hoyer
f12b432efd test: add "failme" parameter for failing tests 2009-10-06 19:09:17 +02:00
Harald Hoyer
e71a5ca5f2 test/*/hard-off.sh: poweroff, if failme specified 2009-10-06 16:37:20 +02:00
Harald Hoyer
837a5a6021 dracut.spec: update changelog and filelists 2009-10-06 15:24:31 +02:00
Philippe Seewer
7a6e646c83 Move write-ifcfg to its own module
ifcfg config style is redhat specific, this should be in its own
module.
2009-10-06 15:23:52 +02:00
Philippe Seewer
a71f1b4917 Add multinic test suite
This is a start a test suite for the multinic support of dracut
2009-10-06 15:17:39 +02:00
Philippe Seewer
5fb4ac2286 Add DAD to dhclient-script
The manpage for dhclient-script says:

Before actually configuring the address, dhclient-script should
somehow ARP for it and exit with a nonzero status if it receives a
reply.

By using arping in dracut this is very easy, since arping has a
specific option to do just that.
2009-10-06 15:17:39 +02:00
Philippe Seewer
98f25e9694 Add simple STP timeout handler
This patch adds STP timeout error handling with arping. It's rather
simple since it only cares about the primary interface and blindly
assumes that if no gateway is available the root server is on the
same subnet.
2009-10-06 15:16:52 +02:00
Philippe Seewer
d92ca28b16 Get rid of hostname utility
dracut doesn't really need a utility to set the hostname. It only
saves a few ks of space, but every bit is good.
2009-10-06 15:14:04 +02:00
Seewer Philippe
d1dd6bb746 Be a bit more optimistic when setting mtus
The usual approach to setting mtus is to set the interface down,
set the mtu then set the interface back up again. Modern hardware
and/or drivers may support setting this on the fly, so we try
this and fall back to the old behaviour it it doesn't work.

In addition this patch only allows mtus greater than 576, this is
taken from debian/ubuntu dhclient-script.
2009-10-06 15:09:34 +02:00
Harald Hoyer
bf87d252f3 network: wait for interfaces to come up, before proceeding 2009-10-06 15:07:52 +02:00
Harald Hoyer
8f397a9be7 base: add missing loginit 2009-10-06 14:43:53 +02:00
Michal Schmidt
ca270f7c17 dracut.8: removed switch_root relicts and changed URL 2009-10-06 10:30:43 +02:00
Harald Hoyer
a8a3ca5102 updated NEWS 2009-10-01 19:59:43 +02:00
Harald Hoyer
2c78a5a5a0 dracut-gencmdline: fixed rd_NO_LUKS case 2009-10-01 19:52:48 +02:00
Harald Hoyer
2521f714f9 fixed UUID= and LABEL= handling 2009-10-01 19:38:14 +02:00
Harald Hoyer
95b4875c8a updated NEWS 2009-10-01 18:57:23 +02:00
Harald Hoyer
ec01ab23fb dmsquash: use info() and die() rather than echo 2009-10-01 18:43:35 +02:00
Harald Hoyer
34debf18bf dracut: strip kernel modules which have no x bit set 2009-10-01 18:41:04 +02:00
Harald Hoyer
4592b6983a base: add logger for rdinitdebug
initlog logs to /init.log /dev/kmsg and /dev/console
2009-10-01 18:11:24 +02:00
Harald Hoyer
a0e44f97bd iscsi/iscsiroot: remove redirection on rdnetdebug
iscsiroot is now executed in the initqueue
2009-10-01 15:21:55 +02:00
Harald Hoyer
de439e24d7 base/init: stop udev exec queue before killing it 2009-10-01 15:17:59 +02:00
Harald Hoyer
187d04ccb0 syslog: use initqueue to start syslog 2009-10-01 14:46:16 +02:00
Harald Hoyer
f214273fd6 nfs/nfsroot: do not redirect output on rdnetdebug
nfsroot is now in the initqueue
2009-10-01 14:46:16 +02:00
Harald Hoyer
52aeb3f312 base/dracut-lib: add setdebug
do not clutter rdinitdebug output with getarg and getargs debug
2009-10-01 14:46:16 +02:00
Harald Hoyer
d84c1df906 nbd/nbdroot: add better check if nbd0 is ready to be mounted 2009-10-01 14:46:15 +02:00
Harald Hoyer
a1dd79d4fe network/netroot: remove flock
netroot is now in the initqueue
2009-10-01 14:46:15 +02:00
Harald Hoyer
0519556070 network/netroot: do not redirect output on rdnetdebug
netroot is now in the initqueue
2009-10-01 14:46:15 +02:00
Harald Hoyer
d64d04df39 nbd/nbdroot: do not redirect debug output on rdnetdebug
nbdroot is now in the initqueue and rdinitdebug should cover that
2009-10-01 14:46:15 +02:00
Harald Hoyer
cf476dbc41 nbd/nbdroot: use udevsettle to wait for /dev/nbd0
nbdroot is now in the initqueue, so we can use udevsettle
2009-10-01 14:46:15 +02:00
Harald Hoyer
8bfed103d8 mdraid: do not cleanup on auto assembly with mdadm.conf 2009-10-01 14:46:14 +02:00
Harald Hoyer
e9b6e4e839 nbd: finish on /dev/root rather than on nbd0 2009-10-01 14:46:14 +02:00
Harald Hoyer
1dc53cfd1e nfs: specify nfs version 3 explicitly and retry with nfs version 2 2009-10-01 14:46:13 +02:00
Harald Hoyer
f57b5bc735 network: move netroot to initqueue
Schedule netroot for the initqueue inside ifup and dhclient.
2009-10-01 14:45:24 +02:00
Harald Hoyer
d46c2e8b0a dracut-functions: let inst*() honor and handle symlinks correctly 2009-09-30 15:35:33 +02:00
Harald Hoyer
f6d1cb89de dracut-functions: inst_simple() with cp -p to preserver timestamps, etc. 2009-09-30 15:34:12 +02:00
Harald Hoyer
0e0031dc61 init: start udevd with --resolve-names=never 2009-09-30 15:04:50 +02:00
Harald Hoyer
2168327bfa init: mount /dev/shm 2009-09-30 15:04:36 +02:00
Harald Hoyer
5cf5569d6e Makefile: reorder targets 2009-09-30 10:18:25 +02:00
Lance Albertson
b4391067ff dracut-gencmdline: check for keyboard & i18n files 2009-09-29 19:02:05 +02:00
Lance Albertson
1961248339 dir symlinks
On amd64 multilib Gentoo, /lib is a symlink to /lib64, and dracut creates
duplicate files in /lib and /lib64 in a resulting cpio image. Other files are
missing in /lib64 but exists in /lib in that image. So /usr/sbin/lvm fails to
run from initrd due to missing libraries.  A possible solution is to create in
the initrd the same /lib symlink as in host system, if /lib is a symlink.

http://bugs.gentoo.org/show_bug.cgi?id=278442#c10
2009-09-29 19:01:29 +02:00
Lance Albertson
13d942e163 custom paths
Fix Makefile so that it allows us to install the root in a sane location (which
is needed in Gentoo).
2009-09-29 19:00:48 +02:00
Harald Hoyer
99fd62e3be dm/lvm: make usage of new udev event rules optionally 2009-09-29 18:29:34 +02:00
Harald Hoyer
0cded44025 95dasd: add dasd_diag_mod module 2009-09-29 18:20:48 +02:00
Harald Hoyer
a8aad9de61 dracut.8: fixed ifname position 2009-09-29 17:12:03 +02:00
Harald Hoyer
ffe53c91c5 95dasd: use 'uname -m' instead of 'arch' 2009-09-29 17:10:22 +02:00
Harald Hoyer
9a2860a3ee 95dasd: fixed typo in modules.conf generation 2009-09-29 14:51:21 +02:00
Harald Hoyer
896199c652 95dasd: do not install zfcp kernel module 2009-09-29 14:48:06 +02:00
Harald Hoyer
5fcc6b4a0a rename 95s390 to 95dasd 2009-09-29 14:47:29 +02:00
Harald Hoyer
678b3605e8 dmraid: add missing dso 2009-09-23 17:16:31 -07:00
Harald Hoyer
b9c4654a63 devicemapper: add dmeventd and new rules for device mapper 2009-09-23 16:52:14 -07:00
Warren Togami
845dd50275 Removing umount appears to be a mistake, it seems to have been OK prior. 2009-09-23 15:16:59 -04:00
Warren Togami
23aa204856 Fix LiveCD boot regression caused by bf55e2c5d3
FIXME: There is still something wrong with this boot where it wants to use umount, but doing so breaks live boot.
2009-09-21 18:14:27 -04:00
Harald Hoyer
8eb16b0827 selinux: bail out if policy could not be loaded and selinux=0 not
specified
2009-09-21 17:44:14 +02:00
Harald Hoyer
fc1abcfa1f dmsquash-live: add initqueue-finished 2009-09-19 10:51:34 +02:00
Harald Hoyer
c53acc3015 lvm: add rd_NO_LVMCONF 2009-09-18 12:28:36 +02:00
Harald Hoyer
7a34efa5c4 md/dm/lvm: install pre-pivot cleanup hooks only if actually needed
- removed dmraid cleanup
- only call lvm cleanup, if no lvm.conf provided
- copy over lvm.conf by default
- add --nolvmconf --lvmconf parameters
2009-09-18 12:20:21 +02:00
Harald Hoyer
2727e45b43 kernel-modules: force install of scsi_wait_scan in hostonly mode 2009-09-18 12:20:04 +02:00
Harald Hoyer
5e5ec023be dracut-gencmdline: add missing functions 2009-09-18 09:08:23 +02:00
Hans de Goede
d6a5b04043 Recognize nodmraid and noiswmd kernel cmdline options
Recognize nodmraid and noiswmd kernel cmdline options, for anaconda /
rc.sysinit / mkinitrd compatibility.
2009-09-18 08:58:14 +02:00
Hans de Goede
1de9edc06e Do not stop / start udev exec-queue around "mdadm -As --run"
When assembling containers + embedded arrays from mdadm.conf,
mdadm needs the /dev/md# node for the container to assemble the
arrays within the container. Stopping the udev exec queue, results in
this node not getting created and mdadm failing to online the
arrays within the container.

Not having stop / start udev exec-queue around "mdadm -As --run" should
be safe as the exact same command is run from rc.sysinit without
any queue locking.
2009-09-18 08:15:59 +02:00
Harald Hoyer
9a99c974a4 version 002 2009-09-17 17:52:00 +02:00
Quentin Armitage
bf84ee3c7c dracut : remove extraneous output to screen during execution 2009-09-17 17:48:02 +02:00
Harald Hoyer
f8545d04b7 dracut: use and export PATH=/sbin:/bin:/usr/sbin:/usr/bin
There's no need for /usr/local to be in our paths at all, nor to
include a :$PATH at the end. The path should be exported though,
so modules don't have to worry about finding things.
2009-09-17 16:36:08 +02:00
Harald Hoyer
e73c975bad dracut.spec: inc release 2009-09-17 16:36:08 +02:00
Harald Hoyer
0f7e10cef4 mdraid: save state dir for mdmon/mdadm for the real root 2009-09-17 12:13:54 +02:00
Harald Hoyer
689f9b8af7 create /var/run in 99base 2009-09-17 12:10:48 +02:00
Harald Hoyer
654cbf0687 dracut.spec: removed gittags 2009-09-16 16:25:47 +02:00
Harald Hoyer
041b0d76ca dracut.spec: update changelog 2009-09-16 16:24:54 +02:00
Harald Hoyer
24bac034d1 65-md-incremental-imsm.rules: check if md raid is already running 2009-09-16 16:10:09 +02:00
Harald Hoyer
094097fab3 lvm/dm/md: switch from lockfiles to $sys/$devpath/holders/*
This is a more sane solution, than ignoring subsequent "change" events.

The only danger is that we could loop, if a lvm scan triggers a broken
md partition, which triggers a broken PV and so on.

Better fix the scanning tools, not to emit change events for devices,
if no action was taken.
2009-09-16 15:34:13 +02:00
Harald Hoyer
26fbe9a101 TEST-14-IMSM: rd_NO_DM rd_NO_MDIMSM rd_NO_MDADMCONF succeeds now
This test succeeds, because the mirror parts are found without
assembling the mirror itsself, which is what we want

client_run rd_NO_DM rd_NO_MDIMSM rd_NO_MDADMCONF || return 1
2009-09-16 15:32:55 +02:00
Harald Hoyer
f8ddafcca2 TEST-11-LVM: add rdinfo 2009-09-16 15:32:29 +02:00
Hans de Goede
04a8f224c1 Add ifname= argument for persistent netdev names
ifname=<interface>:<MAC>
Assign network device name <interface> (ie eth0) to the NIC
with MAC <MAC>.
Note that if you use this option you *must* specify an ifname=
argument for all interfaces used in ip= or fcoe= arguments
2009-09-16 15:01:08 +02:00
Harald Hoyer
597839331c dmraid: use and install kpartx for dmraids 2009-09-16 11:21:24 +02:00
Hans de Goede
26b72485cf 90dmraid: use kpartx to scan for partitions 2009-09-16 11:20:57 +02:00
Harald Hoyer
7dbaf59ccf 10rpmversion/install: fix non-rpm install 2009-09-16 11:18:22 +02:00
Harald Hoyer
95cf0a8803 10rpmversion,dracut.spec: generate version file and install it 2009-09-16 10:43:50 +02:00
Harald Hoyer
1dd5bc3fba add udevproperty() to dracut-lib and use it
newer versions of udev use --property instead of --env
2009-09-16 10:43:50 +02:00
Warren Togami
bf55e2c5d3 dmsquash-live-root requires umount 2009-09-15 17:17:57 -04:00
Harald Hoyer
4d92475240 changelog/NEWS update 2009-09-15 15:54:14 +02:00
Harald Hoyer
a52586e8ea network: break udevsettle early 2009-09-15 15:38:53 +02:00
Hans de Goede
5759574b26 Document that MAC addresses must be lowercase 2009-09-15 15:14:19 +02:00
Hans de Goede
56580efe68 Document netroot=fcoe:.... 2009-09-15 15:14:19 +02:00
Hans de Goede
68f28d6976 Add ifname= argument for persistent netdev names
ifname=<interface>:<MAC>
Assign network device name <interface> (ie eth0) to the NIC with MAC <MAC>.
Note that if you use this option you *must* specify an ifname= argument
for all interfaces used in ip= or fcoe= arguments
2009-09-15 15:13:21 +02:00
Harald Hoyer
5c3f5746bb 90mdraid/65-md-incremental-imsm.rules: first set initqueue-finished,
then initqueue-settled

also introduce md_finished.sh to check for all md activity to be settled
2009-09-15 15:00:25 +02:00
Harald Hoyer
54a73cbb2b dracut-lib.sh: change -f to -e to allow symlinks 2009-09-15 15:00:24 +02:00
Harald Hoyer
ab0f04844b 10rpmversion: try to get the correct dracut rpm version during %post 2009-09-15 15:00:24 +02:00
Harald Hoyer
ad8f03af22 TEST-14-IMSM: "rd_NO_DM rd_NO_MDIMSM rd_NO_MDADMCONF" fails 2009-09-15 15:00:24 +02:00
Harald Hoyer
3329f92136 90crypt/70-luks.rules: set unique name for initqueue job 2009-09-15 15:00:24 +02:00
Harald Hoyer
c27ec060da 95rootfs-block/block-genrules.sh: beautify code 2009-09-15 15:00:24 +02:00
Harald Hoyer
82b2189d01 initqueue-finished: fail also on empty queue 2009-09-15 15:00:24 +02:00
Harald Hoyer
4ce52970c0 initqueue: first remove the job, then execute it 2009-09-15 15:00:24 +02:00
Harald Hoyer
99433dd289 90mdraid: only switch mdmon to new root, if an instance is running 2009-09-15 15:00:23 +02:00
Harald Hoyer
b94c520660 plymouth: add rd_NO_PLYMOUTH 2009-09-15 15:00:23 +02:00
Harald Hoyer
2f02ae9d45 mdraid: add rd_NO_MDADMCONF --mdadmconf --nomdadmconf
Copy /etc/mdadm.conf to initramfs (even for non-hostonly) if
mdadmconf="yes" is set in dracut.conf or --mdadmconf is specified on the
dracut command line.

This was done, because there seems _no_ sane way to autoassemble md raid
arrays.

also moved rd_NO_MD to an udev ENV
2009-09-15 15:00:18 +02:00
Harald Hoyer
11fcc8c8f9 95resume/install: give resume higher prio than mount 2009-09-15 11:17:28 +02:00
Harald Hoyer
e8cf498dcc 95rootfs-block/mount-root.sh: ignore /.resume 2009-09-15 11:17:28 +02:00
Harald Hoyer
2178a00eea 95resume: simplyfy rules and also recognize blkid typo 2009-09-15 11:17:27 +02:00
Harald Hoyer
33ff830c1b 90dmraid: switch rd_NO_DM to udev ENV 2009-09-15 11:17:27 +02:00
Harald Hoyer
5a8d8dfbb6 switch modules to initqueue-finished 2009-09-15 11:17:22 +02:00
Harald Hoyer
8238850caa init: add initqueue-finished
/initqueue-finished/*.sh are scripts, which return != 0, if the main
loop still has pending jobs to do.
2009-09-15 08:47:47 +02:00
Harald Hoyer
fc3c64c8d4 dracut: determine path to dracut-functions 2009-09-14 19:35:18 +02:00
Harald Hoyer
1888e57bf9 plymouth: grep for PLYMOUTH_POPULATE_SOURCE_FUNCTIONS 2009-09-14 19:34:30 +02:00
Harald Hoyer
94dcc5b8d8 fix backwards inst() compat 2009-09-14 19:33:54 +02:00
Harald Hoyer
4839a7995e add pcmcia adapter 2009-09-14 19:30:20 +02:00
Harald Hoyer
1aca526cb4 90dmraid: install parse-dm.sh 2009-09-14 16:47:30 +02:00
Harald Hoyer
9541165d33 dracut-functions: fixed inst() for mkinitrd compat 2009-09-14 15:53:55 +02:00
Harald Hoyer
600131fe85 selinux-loadpolicy: do not check for selinux config files
leave it up to load_policy
2009-09-11 16:30:10 +02:00
Harald Hoyer
8c45b484ce plymouth: removed rd_plytheme 2009-09-11 16:29:40 +02:00
Harald Hoyer
650da7bada removed initrdargs from parse-*.sh 2009-09-10 17:34:15 +02:00
Harald Hoyer
247c9f70bf init: fixed command line handling for /sbin/init and init=<custom init> 2009-09-10 16:48:36 +02:00
Harald Hoyer
233f79df99 selinux-loadpolicy.sh: also check for /etc/selinux/config 2009-09-10 15:49:03 +02:00
Harald Hoyer
236852c109 dracut.spec: require plymouth-scripts 2009-09-09 21:16:01 +02:00
Harald Hoyer
6f0e469d79 selinux-loadpolicy: set initial ret=0 2009-09-09 19:50:44 +02:00
Harald Hoyer
f9749f368f plymouth: use /usr/libexec/plymouth/plymouth-populate-initrd if possible 2009-09-09 18:05:00 +02:00
Harald Hoyer
f165864f09 dracut-functions: make inst() mkinitrd compatible 2009-09-09 18:05:00 +02:00
Harald Hoyer
dc077a52c9 dracut.spec: do not require policycoreutils
since might do load_policy with chroot, we don't need to require it
2009-09-09 18:05:00 +02:00
Harald Hoyer
0b2de1f895 99base/init: output more info() 2009-09-09 18:04:55 +02:00
Harald Hoyer
94eb3cf222 selinux-loadpolicy: do not mount /proc and /selinux
load_policy already does these things for us
2009-09-09 17:06:21 +02:00
Harald Hoyer
cb47caf786 add parameter to specify additional kernel modules to include
--add-drivers for dracut
add_drivers for dracut.conf
2009-09-09 17:02:37 +02:00
Harald Hoyer
d9f0633878 selinux-loadpolicy: do not mount /proc and /selinux
load_policy mounts it for us
2009-09-09 14:41:40 +02:00
Harald Hoyer
71094bee63 base/init: add scsi_wait_scan to wait for host adapter scans 2009-09-09 11:09:04 +02:00
Harald Hoyer
f5c4374d2c selinux-loadpolicy.sh: mount /proc and /selinux before loading the
policies

also check for /sbin/load_policy
2009-09-08 16:26:37 +02:00
Harald Hoyer
aa297ca6b6 65-md-incremental-imsm.rules: refine rules 2009-09-08 15:33:19 +02:00
Harald Hoyer
4712e4ece6 initqueue: add --name parameter to give a name for --unique 2009-09-08 15:31:48 +02:00
Harald Hoyer
e51b607189 TEST-14-IMSM: create raid5 inside isw raid container 2009-09-08 15:31:27 +02:00
Harald Hoyer
fdf2a763d4 TEST-14-IMSM: more test cases 2009-09-08 15:31:00 +02:00
Harald Hoyer
f25c9697f8 mdraid: stop udev queue until mdraid assembled 2009-09-08 15:30:17 +02:00
Harald Hoyer
7e282f5df1 dmraid: only install 64-md-raid.rules if no vol_id present 2009-09-08 15:29:30 +02:00
Harald Hoyer
0e9bb3f30c TEST-14-IMSM: no test for a isw raid array 2009-09-08 13:43:21 +02:00
Harald Hoyer
3bb5b261c7 65-md-incremental-imsm: add additional check for md-non-containers 2009-09-08 13:42:31 +02:00
Harald Hoyer
273b197d75 added initqueue-settled and refactored code 2009-09-07 19:12:01 +02:00
Harald Hoyer
906dedf4d5 mdraid-cleanup: do not stop mdraid container 2009-09-07 19:12:00 +02:00
Harald Hoyer
4f4a79b1a1 add scp to debug module 2009-09-07 17:10:19 +02:00
Harald Hoyer
587b3497c1 mdraid_start.sh: fixed raid activation 2009-09-07 16:18:12 +02:00
Harald Hoyer
1753a63081 TEST-12-RAID-DEG: check with root=LABEL=root 2009-09-07 11:41:38 +02:00
Harald Hoyer
96f3cf1d27 95udev-rules: fixed c&p bug which did not install 61-persistent-storage.rules 2009-09-07 11:40:20 +02:00
Harald Hoyer
e4dec3d6b6 {crypt,dmraid,lvm,mdraid}: cleanup with pre-pivot 30 and 31 2009-09-03 17:11:57 +02:00
Harald Hoyer
429aa1a2c2 mdraid: add grep for convenience 2009-09-03 17:11:03 +02:00
Harald Hoyer
d889c019e7 version 001 2009-09-02 15:55:35 +02:00
Harald Hoyer
52168b7b9d reordered blkid/vol_id rules 2009-09-02 15:55:34 +02:00
Peter Rajnoha
d6462323d6 LVM/DM rules in dracut
I've looked at the LVM rules used in dracut just recently
and it needs fixing - we should react to change events only
for DM devices, so we have to skip vol_id/blkid call on ADD:

KERNEL=="dm-[0-9]*", ACTION=="add", GOTO="lvm_end"

Also, MD devices have their own rules, where vol_id/blkid
is called and where the symlinks are created (when looking
into raw initrd, this is in  64-md-raid.rules).

Also, if those rules are meant to be for DM devices only,
maybe we should skip symlink creation for the other devices
there, to keep the rules clean and straightforward. I think
we shouldn't create/recreate symlinks for non-dm devices in
LVM/DM rules (..should be in appropriate rules for that type
of device):

KERNEL!="dm-[0-9]*", GOTO="lvm_end"
2009-09-02 15:55:34 +02:00
Victor Lowther
1d368457e3 Merge commit 'origin/master' 2009-09-02 07:40:28 -05:00
Victor Lowther
7c3fe07ac0 Made hostonly checking for fcoe fail for now.
Having it unconditionally pass pulls in all the networking cruft even
for systems that do not need it, and that sorta defeats the purpose of
hostonly mode.
2009-09-02 07:37:33 -05:00
Harald Hoyer
194f7d125f 90*/*cleanup.sh: fixed redirection to /dev/null 2009-09-01 15:59:31 +02:00
Harald Hoyer
8ef0be5671 dracut-lib: try to set UDEVVERSION, if not set 2009-09-01 15:51:51 +02:00
Harald Hoyer
b809e77f54 plymouth: in the generic case, only install text and details themes 2009-09-01 15:51:51 +02:00
Harald Hoyer
780afa9876 release any raid/crypt/lvm device assembled, but not in use 2009-09-01 15:51:51 +02:00
Harald Hoyer
5ebc1acb7f selinux-loadpolicy.sh: redirect output of selinux load_policy 2009-09-01 15:51:50 +02:00
Harald Hoyer
59580f28a1 dracut-functions: do not try to clear logfile, if not writable 2009-09-01 15:42:28 +02:00
Harald Hoyer
533d7dc4ab dracut-function: add check for volume group members
see https://bugzilla.redhat.com/show_bug.cgi?id=506189

not all members of a linear volume group are listed in /sys slaves
2009-09-01 15:42:28 +02:00
Harald Hoyer
ec74fa8789 split dracut in network / non-network 2009-09-01 15:42:28 +02:00
Harald Hoyer
988061a5ee dracut.spec: removed s390 conditionals 2009-09-01 15:42:28 +02:00
Harald Hoyer
c10d53bf0c dracut.spec: fixed gittag 2009-09-01 15:42:28 +02:00
Harald Hoyer
54b87586aa fixed gitrpm 2009-09-01 15:42:27 +02:00
Harald Hoyer
461ff22cd5 new test/TEST-13-ENC-RAID-LVM 2009-09-01 15:42:27 +02:00
Harald Hoyer
b1a4919cb2 TEST-12-RAID-DEG/test.sh: add rdinfo 2009-09-01 15:42:27 +02:00
Harald Hoyer
c1d670a893 65-md-incremental-imsm.rules: also check on "change" 2009-09-01 15:42:27 +02:00
Harald Hoyer
b6bf29b054 lvm.rules: blkid for cciss devices 2009-09-01 15:42:27 +02:00
Harald Hoyer
5c6a593f2e add udevsettle function and settle after raid/lvm/crypto activities 2009-09-01 15:42:27 +02:00
Harald Hoyer
f4c36b28f6 mdraid_start: check if raid is already active before trying to run it 2009-09-01 15:42:27 +02:00
Harald Hoyer
73e649b5f5 dracut.spec: require policycoreutils 2009-09-01 15:42:26 +02:00
Harald Hoyer
ba72631039 add hostonly to dracut.conf 2009-09-01 15:42:26 +02:00
Warren Togami
a89fb6daa5 Write netboot config for passing to OS as requested in https://bugzilla.redhat.com/show_bug.cgi?id=515771#c18 2009-08-31 19:34:27 -04:00
Harald Hoyer
6568d86aec instmods(): fixed "instmods =drivers/md" 2009-08-28 13:33:57 +02:00
Hans de Goede
3508cc816e Add fcoe booting support
Supported cmdline formats:
fcoe=<networkdevice>:<dcb|nodcb>
fcoe=<macaddress>:<dcb|nodcb>

Note currently only nodcb is supported, the dcb option is reserved for
future use.

Note letters in the macaddress must be lowercase!

Examples:
fcoe=eth0:nodcb
fcoe=4A:3F:4C:04:F8:D7:nodcb
2009-08-28 12:53:56 +02:00
Harald Hoyer
ffa264f077 dracut.8: document rootfstype and rootflags 2009-08-28 12:53:03 +02:00
Harald Hoyer
84c2266f1a network/installkernel: it's eth_type_trans and not eth_type_transfer 2009-08-27 13:06:46 +02:00
Harald Hoyer
973c23b0d6 should_source_module(): refined check
Do not bail out early if no install exists.
Check also for installkernel.
2009-08-27 12:53:38 +02:00
Victor Lowther
9ede1929b2 Oops, clean up broken get_fs_type implementation.
While we are at it, make a couple of other fixups.
2009-08-22 12:04:11 -05:00
Victor Lowther
054e038512 Add accurate --hostonly checking for 95iscsi 2009-08-21 22:22:40 -05:00
Victor Lowther
fb8923f681 Minor fixups to kernel module loading
Also rewrite filter_kernel_modules to make it a little easier to read.
2009-08-20 22:21:33 -05:00
Victor Lowther
240cc7c480 Abstract out hostonly vs. generic module installation differences.
This introduces filter_kernel_modules, which should be used to install
all kernel modules that match whatever criteria you want.

If running in --hostonly, filter_kernel_modules will only consider
modules that are loaded in the kernel, otherwise it will consider
all the modules installed on the system for the appropriate kernel.

This drastically reduces initramfs generation time when using --hostonly
by eliminating lots of unneeded filesystem activity.
2009-08-20 15:52:45 -05:00
Victor Lowther
8d04a1287d Some updates to the README files 2009-08-20 14:14:21 -05:00
Victor Lowther
16df64ef1f Abstract out vol_id vs. blkid usage.
vol_id seems to be going away, and blkid can be used as a drop-in replacement
for it.
2009-08-20 07:28:04 -05:00
Victor Lowther
f76ef3aa3d Speed up loading block drivers when running with --hostonly
Instead of grovelling through all the modules available for the
kernel looking for block devices, only look at the modules that are
actually loaded. This speeds things up by a rather large amount
when generating the initramfs with --hostonly.

While we are at it, only load the filesystem module that will actually
be used for the root filesystem when running in --hostonly instead
of all the filesystem modules that happen to be loaded at the time.
2009-08-19 22:21:29 -05:00
Victor Lowther
59c88f499f Abstract out vol_id vs. blkid usage
Since different distros may or may not use vol_id in udev, and blkid
is generally replacing vol_id, abstract them out into a function which
tries to use vol_id first and blkid second, on the assumption that
blkid can take over for vol_id if vol_id is no longer there.
2009-08-19 22:21:07 -05:00
Harald Hoyer
afe25d0ccc {crypt,dmraid,,lvm,mdraid}/check use blkid if no vol_id found 2009-08-19 17:11:29 +02:00
Harald Hoyer
bdccc34e7e Makefile: add hostimage target for a hostonly image
call it with root priviledges
2009-08-19 17:10:38 +02:00
Harald Hoyer
495a964322 nbd/check: moved host-only checks and added ";" 2009-08-19 17:09:53 +02:00
Harald Hoyer
9defc609e8 dracut-functions: check for existance of slave devices before opening it 2009-08-19 17:08:57 +02:00
Harald Hoyer
68b26290f0 udev-rules: install vol_id 2009-08-19 11:12:42 +02:00
Harald Hoyer
d41f7ae750 rsyslogd-start.sh: read correct filters file 2009-08-19 10:59:37 +02:00
Marc Grimme
e15bc1f330 Syslog support for dracut
This module provides syslog functionality in the initrd.
This is especially interesting when complex configuration being
used to provide access to the device the rootfs resides on.

When this module is installed into the ramfs it is triggered by
the udev event from the nic being setup (online).

Then if syslog is configured it is started and will forward all
kernel messages to the given syslog server.

The syslog implementation is detected automatically by finding the
apropriate binary with the following order:
rsyslogd
syslogd
syslog-ng
Then if detected the syslog.conf is generated and syslog is started.

Bootparameters:
syslogserver=ip    Where to syslog to
sysloglevel=level  What level has to be logged
syslogtype=rsyslog|syslog|syslogng
                   Don't auto detect syslog but set it
2009-08-19 10:40:02 +02:00
Jeremy Katz
a607b7d4b8 Fix syntax error in conditional
Fix a typo in the conditionals.  Not sure how I didn't notice these
before
2009-08-19 10:34:06 +02:00
Victor Lowther
1a4c4015bc Modify nbd hostonly checking to use check_block_and_slaves.
This allows hostonly nbd checking to work in more exotic situations,
such as mdraid/dmraid/lvm/crypt on top of nbd.
2009-08-16 18:22:21 -05:00
Victor Lowther
d7df77d172 Modified lvm hostonly checking to use dracut-functions 2009-08-16 15:29:59 -05:00
Victor Lowther
7e2b4f8367 Make mdraid checking use common functionality in dracut-functions 2009-08-16 15:29:59 -05:00
Victor Lowther
bc9ae19deb Make dmraid checking use common functionality in dracut-functions 2009-08-16 15:29:50 -05:00
Victor Lowther
17829e94aa Move common rootfs finding and backing store tree checking to dracut-functions 2009-08-16 15:29:50 -05:00
Victor Lowther
e0dca0e43c Minor spacing fixups in dracut-finctions 2009-08-16 15:29:49 -05:00
Victor Lowther
4e207ec862 The network check script sources , so it must use /bin/bash 2009-08-16 15:29:49 -05:00
Victor Lowther
b5ccf21d2b Make the lvm check script really check to see if root is on an lvm device
somehow when run in hostonly mode.
2009-08-16 15:29:42 -05:00
Victor Lowther
62bde8ed7e make mdraid check script really check to see of the rootfs is on an
mdraid block device when run in hostonly mode.
2009-08-16 15:29:27 -05:00
Victor Lowther
dc670134f8 Make hostonly check for dmraid only pass if root is really on
a dmraid volume somehow.
2009-08-16 15:29:18 -05:00
Victor Lowther
39d6cb5df4 Make hostonly checking in 90crypt only pass if root is really on an
encrypted block device somewhere along the chain.
2009-08-16 15:28:56 -05:00
Victor Lowther
ddfd1d10a0 Split kernel module loading into smaller chunks.
This prepares to more tightly integrate dracut-gencmdline with the
rest of the dracut scripts
2009-08-16 15:28:45 -05:00
Victor Lowther
0c1a8ebc37 More quotation fixups in dracut-functions 2009-08-15 10:56:36 -05:00
Victor Lowther
bd4c4bcb76 Simplify dracut_install a bit, an make a minor fixup to check_module_deps 2009-08-15 07:55:59 -05:00
Victor Lowther
161efa1f40 Some quotation cleanups in dracut-functions.
Quotes are generally not needed in when assigning one variable to another,
and are also not needed inside [[ ]] comaprisons, as word splitting and
pathname expansion are not performed in these cases.
2009-08-15 07:38:26 -05:00
Victor Lowther
ebdddd29d3 Get rid of redundant NONL stuff in dracut-gencmdline 2009-08-14 22:54:38 -05:00
Victor Lowther
2790d5b2ed Update dracut-catimages to make it much more robust in the face of
image filenames with spaces, carriage returns, and other such nasty
characters in them.  Bash arrays are very useful for these sorts of things.
2009-08-14 22:51:25 -05:00
Victor Lowther
98adb06ea3 No need to quote variable expansion in [[ ]] 2009-08-14 22:36:41 -05:00
Victor Lowther
0b90cfaa9f Bashify drivers_dir check 2009-08-14 22:31:04 -05:00
Harald Hoyer
ded38dbfbd dracut.spec add NEWS to dracut and dracut-tools 2009-08-14 18:03:33 +02:00
Harald Hoyer
5d12f1a485 version 0.9 2009-08-14 17:59:43 +02:00
Harald Hoyer
7addf9d430 rpmversion: dash does not want as I do 2009-08-14 17:47:07 +02:00
Harald Hoyer
6d0480426d rpmversion: fixed rpm query 2009-08-14 17:37:00 +02:00
Harald Hoyer
5a8b143888 TEST-10-RAID: new mdadm is picky about partitions 2009-08-14 17:27:50 +02:00
Michael Ploujnikov
5bf0b329c9 update the rdbreak breakpoint list 2009-08-14 17:27:50 +02:00
Harald Hoyer
51123629d7 dracut.spec: add more plymouth themes 2009-08-14 17:27:50 +02:00
Harald Hoyer
0ad78ae8e7 dracut.spec: requieres dash
how could we forget to add that?? :-)
2009-08-14 17:27:50 +02:00
Harald Hoyer
1c6e9e5c0a new module 10rpmversion
outputs rpm version of dracut
2009-08-14 17:27:50 +02:00
Harald Hoyer
0b610a002c removed 90dmsetup 2009-08-14 17:27:49 +02:00
Harald Hoyer
0f1361ee1c udev-rules: hardcode helper binaries 2009-08-14 17:27:49 +02:00
Harald Hoyer
b806825d2a nfs: only install libnfsidmap_nsswitch.so of all libnfsidmap_*.so 2009-08-14 17:27:49 +02:00
Harald Hoyer
f905c1d7d6 dmsquash-live: install the "real" eject
eject might be a symlink to consolehelper
2009-08-14 17:27:49 +02:00
Harald Hoyer
926b2c3337 dracut: set ownership to root.root for all files 2009-08-14 17:27:49 +02:00
Harald Hoyer
fc900b8be4 dracut-gencmdline: fix LUKS_UUID and MD_UUID output 2009-08-14 16:21:03 +02:00
Harald Hoyer
88838bf238 network: exclude kernel modules, which need iw_handler_get_spy 2009-08-14 16:21:03 +02:00
Harald Hoyer
ed2de829e1 cryptroot-ask.sh: fix rd_LUKS_UUID handling 2009-08-14 16:21:03 +02:00
Harald Hoyer
ff34c9dcd4 10redhat-i18n: remove unnecessary files 2009-08-14 16:21:03 +02:00
Harald Hoyer
3d4641fd98 add rdinfo command line parameter
print informational output though "quiet" is set
2009-08-14 16:21:03 +02:00
Harald Hoyer
860ace56f8 inst_simple(): add -p flag to cp 2009-08-13 14:22:54 +02:00
Harald Hoyer
ed6220fd25 plymouth: make the daemon attach to the session/terminal
https://bugzilla.redhat.com/show_bug.cgi?id=516104

it can be so simple :-)
2009-08-07 12:08:31 +02:00
Harald Hoyer
be9ca6c8a8 dracut.spec: require versioned util-linux-ng instead of switch_root 2009-08-07 12:08:04 +02:00
Warren Togami
148284ced6 Remove ugly hack 2009-08-06 11:07:43 -04:00
Harald Hoyer
1def132d53 version 0.8 2009-08-06 15:10:59 +02:00
Harald Hoyer
0de910602c add NEWS 2009-08-06 15:01:24 +02:00
Harald Hoyer
3714170f33 plymouth-populate-initrd: do not install label.so
https://bugzilla.redhat.com/show_bug.cgi?id=515589

It ends up installing the label.so control plugin which isn't supposed
to get installed into the initrd.  this makes cairo and libX11 and all sorts of
things move into the initrd that aren't supposed to.
2009-08-06 14:43:13 +02:00
Harald Hoyer
c6ca79eb4e dracut.spec: version for module-init-tools requirement
https://bugzilla.redhat.com/show_bug.cgi?id=515630

dracut-0.7-1 uses a modprobe option (-d) that exists only in
module-init-tools >= 3.7-9, but the 'Requires: module-init-tools'
of dracut is not version-specific.
2009-08-06 14:43:13 +02:00
Thilo Bangert
a15ad925e9 support for unusual terminfo location
the following patch makes the 95terminfo module work on gentoo.
2009-08-06 14:43:12 +02:00
Warren Togami
13d5225fc8 Temporary hack to provide ifcfg files to OS in a way that might work with existing initscripts.
I am not happy about this.  It shouldn't be the job of dracut to do this.  The initscripts should
deal with the plain /dev/.initramfs/ifcfg/ directory accordingly.  Doing this for now because
notting insists upon it.  We need to clean this up after we network option passing working.
2009-08-04 17:15:39 -04:00
Harald Hoyer
e3052553cf dracut.spec: fixed requirements for dracut-tools 2009-08-04 16:36:18 +02:00
Jeremy Katz
cc0e7a369b Parse options earlier for live root 2009-08-04 16:25:43 +02:00
Jeremy Katz
7f819d7041 Support resetting the live overlay
If you're using a persistent overlay, you might want to reset it
at boot time if it has become corrupted somehow.  Support using
reset_overlay as a command line optino to do so
2009-08-04 16:25:43 +02:00
Jeremy Katz
dfba82b3d3 And support passing in the persistent overlay
The persistent overlay can be specified with an overlay= argument
on the command line.  We'll probably try to move this into the
root= syntax soon, but this is the old way that works
2009-08-04 16:25:43 +02:00
Jeremy Katz
3ae2f09a04 Support passing live_ram
live_ram allows you to load the entirety of the live image into
RAM and run it from there rather than off of the block device
2009-08-04 16:25:43 +02:00
Jeremy Katz
a2a2a956dd Support passing the live_dir with live_dir=
The live image is assumed to be under LiveOS/ unless live_dir
is passed specifying otherwise
2009-08-04 16:25:43 +02:00
Jeremy Katz
fa9d7304bf Support old syntax
livecd-creator previously added 'liveimg' and used root=CDLABEL=;
it's easy enough to support that old syntax for now at least
and it will make it easier to get people testing
2009-08-04 16:25:43 +02:00
Jeremy Katz
c56b63d1bd Support checking the iso
Support checking the iso image with checkisomd5 if available
2009-08-04 16:25:43 +02:00
Jeremy Katz
2e44f115b9 Add basic support for dmsquashed live images
Fedora/Red Hat live images are implemented as an ext3fs inside of
a squashfs.  Writability is achieved with a device-mapper snapshot
on top of that.

This gives the basic support without a lot of things like persistent
overlays, iso md5sum checking, etc and also with a new basic syntax
that has to be specified as root=live:LABEL=...
2009-08-04 16:25:42 +02:00
Sergey Fionov
0c296f15b1 Fix full pathname condition in find_library
Hello,

Now a fact that the path is full is checked by
[[ -x $1 ]]

But if the working directory is /bin or a directory with a file named
"mount",
this condition will be met for "inst mount", and "mount" will not be copied
into initrd at all.
2009-08-04 16:21:58 +02:00
Harald Hoyer
345f573546 90mdraid/parse-md.sh: removed bashism 2009-08-04 11:36:06 +02:00
Warren Togami
69288348dd dracut requires bzip2 2009-08-03 14:26:26 -04:00
Harald Hoyer
9babe97e6f iscsiroot: check real root if it is block:... 2009-07-31 14:43:14 +02:00
Harald Hoyer
863fa9c295 dracut.8: fixed iscsi username/pw documentation 2009-07-31 13:22:58 +02:00
Hans de Goede
766968bb6f Implement extended iscsi: rfc4173 syntax which allows specifying credentials
As discussed before, it would be nice to be able to specify
the iscsi chap credentials inside the netroot=iscsi:.....
syntax, this patch implements this in a backwards compatible way, like
this:
iscsi:username:pass@127.0.0.1::3260::iqn.2009-01.com.example:testdisk
iscsi:username:pass:reverse:pass@127.0.0.1::3260::iqn.2009-01.com.example:test

The only downside is that the backwards compatibility is broken when there
is an @ in the iscsi target name (very unlikely), that can still be used,
but only like this:
iscsi:@192.168.1.100::3260::iqn.2009-01.com.example:testdi@sk
2009-07-31 12:44:18 +02:00
Harald Hoyer
123e04b23e 40network/installkernel: do not install isdn and uwb modules 2009-07-31 12:40:53 +02:00
Harald Hoyer
9d2eb35d7a 90kernel-modules/installkernel: do not install fs/ocfs2 filesystems 2009-07-31 12:40:53 +02:00
Harald Hoyer
67a38adacf nfs: only install libnss_*.so which are used by nsswitch.conf 2009-07-31 12:40:53 +02:00
Harald Hoyer
80aa303c29 dracut.spec: removed duplicate requirements 2009-07-31 12:40:53 +02:00
Harald Hoyer
5ea16f2790 kernel-modules: add modules for virtio devices 2009-07-31 12:40:53 +02:00
Harald Hoyer
2f24b79ddd iscsi: manually load the iscsi_ibft kernel module 2009-07-31 10:58:03 +02:00
Harald Hoyer
d9f8feb04a iscsi: install iscsi_ibft kernel module 2009-07-30 16:57:30 +02:00
Harald Hoyer
bb57587b42 iscsiroot: fixed udev rules for iscsi_firmware 2009-07-30 16:14:09 +02:00
Harald Hoyer
b61ca28260 dracut.spec: no more switch_root for >= F12 and Require "which" 2009-07-30 16:12:52 +02:00
Harald Hoyer
a3f4e7709b add udev rules for iscsi_firmware 2009-07-30 16:12:52 +02:00
Warren Togami
984a819b92 There is only one resolv.conf. 2009-07-30 09:27:09 -04:00
Warren Togami
edae4b5efb Mark the other ifcfg file when bridges are used. 2009-07-29 16:54:53 -04:00
Warren Togami
2098ebf712 Need some way of differentiating these interfaces as being netboot. 2009-07-29 14:07:08 -04:00
Harald Hoyer
f72c10f657 getarg()/getargs(): check existance of /etc/cmdline before reading it 2009-07-28 18:29:40 +02:00
Warren Togami
645bde35d3 Use standard ifcfg filenames, put them into an ifcfg directory. 2009-07-27 15:54:21 -04:00
Warren Togami
0c39f9f6f6 --strip requires file 2009-07-27 13:16:51 -04:00
638 changed files with 46585 additions and 5583 deletions

7
.dir-locals.el Normal file
View File

@@ -0,0 +1,7 @@
;;; Directory Local Variables
;;; For more information see (info "(emacs) Directory Variables")
((sh-mode
(indent-tabs-mode)
(sh-basic-offset . 4)))

24
.gitignore vendored
View File

@@ -1,3 +1,23 @@
/Makefile.inc
/dracut.8
/dracut-catimages.8
/dracut.conf.5
/dracut.conf.d/*.conf
/dracut-gencmdline.8
/dracut.html
/dracut.kernel.7
/dracut.pc
/dracut-install
/modules.d/99base/switch_root
/test/*/test.log
test*.img
modules.d/99base/switch_root
*~
/.buildpath
/.project
/dracut-version.sh
/install/dracut-install
/*.rpm
/*.[0-9]
/modules.d/98dracut-systemd/*.service.8
/*.sign
*.o
skipcpio/skipcpio

1
.kateconfig Normal file
View File

@@ -0,0 +1 @@
kate: space-indent on; tab-width 4; indent-width 4; replace-tabs on; eol unix;

9
.kateproject Normal file
View File

@@ -0,0 +1,9 @@
{
"name": "Dracut"
, "files": [ { "git": 1 } ]
, "build": {
"directory": "./"
, "build": "make -j $(getconf _NPROCESSORS_ONLN) all"
, "clean": "make clean"
}
}

33
.mailmap Normal file
View File

@@ -0,0 +1,33 @@
Philippe Seewer <philippe.seewer@bfh.ch> <philippe.seewer-omB+W0Dpw2o@public.gmane.org>
Seewer Philippe <philippe.seewer@bfh.ch> <philippe.seewer@bfh.ch>
Philippe Seewer <philippe.seewer@bfh.ch> <philippe.seewer@bfh.ch>
Victor Lowther <victor.lowther@gmail.com> <victor.lowther-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Harald Hoyer <harald@redhat.com> <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Harald Hoyer <harald@redhat.com> <harald@eeepc.(none)>
Harald Hoyer <harald@redhat.com> <harald@hoyer.xyz>
Mike Snitzer <snitzer@redhat.com> <msnitzer@redhat.com>
Amerigo Wang <amwang@redhat.com> <xiyou.wangcong@gmail.com>
Andrey Borzenkov <arvidjaar@gmail.com> <arvidjaar@mail.ru>
Dan Horák <dhorak@redhat.com> <dan@danny.cz>
John Reiser <jreiser@bitwagon.com> <jreiser@BitWagon.com>
Luca Berra <bluca@vodka.it> <bluca@comedia.it>
Dave Young <dyoung@redhat.com> <dyoung@redhat.com>
Dave Young <dyoung@redhat.com> <dave@redhat.com>
Frederick Grose <fgrose@sugarlabs.org> <fgrose@gmail.com>
Frederic Crozat <fcrozat@suse.com> <fcrozat@mandriva.com>
Shawn W Dunn <sfalken@opensuse.org> <sfalken@opensuse.org>
Kyle McMartin <kmcmarti@redhat.com> <kyle@redhat.com>
Angelo "pallotron" Failla <pallotron@fb.com> <pallotron@fb.com>
Yu Watanabe <watanabe.yu+github@gmail.com>
Martin Wilck <mwilck@suse.de> <mwilck@suse.com>
Thomas Renninger <trenn@suse.com> <trenn@suse.de>
Andrey Borzenkov <arvidjaar@gmail.com>
Cristian Rodríguez <crrodriguez@opensuse.org>
Daniel Drake <drake@endlessm.com> <dsd@laptop.org>
Fabian Vogt <fvogt@suse.com>
Hannes Reinecke <hare@suse.com> <hare@suse.de>
Julian Wolf <juwolf@suse.com> <juwolf@suse.de>
Lidong Zhong <lidong.zhong@suse.com> <lzhong@suse.com>
Nikoli <nikoli@gmx.us> <nikoli@lavabit.com>
Peter Robinson <pbrobinson@fedoraproject.org> <pbrobinson@gmail.com>
Xunlei Pang <xlpang@redhat.com> <xpang@redhat.com>

48
.travis.yml Normal file
View File

@@ -0,0 +1,48 @@
language: generic
sudo: required
services:
- docker
env:
matrix:
- IMAGE=latest
- IMAGE=latest TESTS=01
- IMAGE=latest TESTS=12
- IMAGE=latest TESTS=20
- IMAGE=latest TESTS=50
- IMAGE=latest TESTS=30
- IMAGE=latest TESTS=31
- IMAGE=latest TESTS=60
- IMAGE=latest TESTS=70
- IMAGE=latest TESTS=99
- IMAGE=latest TESTS=02
- IMAGE=latest TESTS=03
- IMAGE=latest TESTS=04
- IMAGE=latest TESTS=10
- IMAGE=latest TESTS=11
- IMAGE=29 TESTS=13
- IMAGE=29 TESTS=14
- IMAGE=latest TESTS=15
- IMAGE=latest TESTS=17
before_script:
- docker pull fedora:$IMAGE
- |
sudo modprobe kvm-intel nested=1 || :
sudo modprobe kvm-amd nested=1 || :
dmesg | tail || :
- git fetch --tags --unshallow
- |
git describe --abbrev=0 --tags || :
git describe --tags || :
script:
- docker run --privileged -it -v $(pwd)/:/dracut fedora:$IMAGE /dracut/fedora-test.sh $IMAGE-$$ "$TESTS"
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/effa917ca3e0ed5fd00e
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: never # options: [always|never|change] default: always

60
50-dracut.install Executable file
View File

@@ -0,0 +1,60 @@
#!/bin/bash
COMMAND="$1"
KERNEL_VERSION="$2"
BOOT_DIR_ABS="$3"
KERNEL_IMAGE="$4"
# If KERNEL_INSTALL_MACHINE_ID is defined but empty, BOOT_DIR_ABS is a fake directory.
# So, let's skip to create initrd.
if ! [[ ${KERNEL_INSTALL_MACHINE_ID-x} ]]; then
exit 0
fi
if [[ -d "$BOOT_DIR_ABS" ]]; then
INITRD="initrd"
else
BOOT_DIR_ABS="/boot"
INITRD="initramfs-${KERNEL_VERSION}.img"
fi
ret=0
case "$COMMAND" in
add)
INITRD_IMAGE_PREGENERATED=${KERNEL_IMAGE%/*}/initrd
if [[ -f ${INITRD_IMAGE_PREGENERATED} ]]; then
# we found an initrd at the same place as the kernel
# use this and don't generate a new one
cp "$INITRD_IMAGE_PREGENERATED" "$BOOT_DIR_ABS/$INITRD" \
&& chown root:root "$BOOT_DIR_ABS/$INITRD" \
&& chmod 0600 "$BOOT_DIR_ABS/$INITRD" \
&& exit 0
fi
if [[ -f /etc/kernel/cmdline ]]; then
read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
elif [[ -f /usr/lib/kernel/cmdline ]]; then
read -r -d '' -a BOOT_OPTIONS < /usr/lib/kernel/cmdline
fi
if ! [[ ${BOOT_OPTIONS[*]} ]]; then
read -r -d '' -a BOOT_OPTIONS < /proc/cmdline
fi
unset noimageifnotneeded
for ((i=0; i < "${#BOOT_OPTIONS[@]}"; i++)); do
if [[ ${BOOT_OPTIONS[$i]} == root\=PARTUUID\=* ]]; then
noimageifnotneeded="yes"
break
fi
done
dracut -f ${noimageifnotneeded:+--noimageifnotneeded} "$BOOT_DIR_ABS/$INITRD" "$KERNEL_VERSION"
ret=$?
;;
remove)
rm -f -- "$BOOT_DIR_ABS/$INITRD"
ret=$?
;;
esac
exit $ret

68
51-dracut-rescue-postinst.sh Executable file
View File

@@ -0,0 +1,68 @@
#!/bin/bash
export LANG=C
KERNEL_VERSION="$1"
KERNEL_IMAGE="$2"
[[ -f /etc/os-release ]] && . /etc/os-release
if [[ ! -f /etc/machine-id ]] || [[ ! -s /etc/machine-id ]]; then
systemd-machine-id-setup
fi
[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
[[ $MACHINE_ID ]] || exit 1
[[ -f $KERNEL_IMAGE ]] || exit 1
INITRDFILE="/boot/initramfs-0-rescue-${MACHINE_ID}.img"
NEW_KERNEL_IMAGE="${KERNEL_IMAGE%/*}/vmlinuz-0-rescue-${MACHINE_ID}"
[[ -f $INITRDFILE ]] && [[ -f $NEW_KERNEL_IMAGE ]] && exit 0
dropindirs_sort()
{
suffix=$1; shift
args=("$@")
files=$(
while (( $# > 0 )); do
for i in ${1}/*${suffix}; do
[[ -f $i ]] && echo ${i##*/}
done
shift
done | sort -Vu
)
for f in $files; do
for d in "${args[@]}"; do
if [[ -f "$d/$f" ]]; then
echo "$d/$f"
continue 2
fi
done
done
}
# source our config dir
for f in $(dropindirs_sort ".conf" "/etc/dracut.conf.d" "/usr/lib/dracut/dracut.conf.d"); do
[[ -e $f ]] && . "$f"
done
[[ $dracut_rescue_image != "yes" ]] && exit 0
if [[ ! -f $INITRDFILE ]]; then
dracut --no-hostonly -a "rescue" "$INITRDFILE" "$KERNEL_VERSION"
((ret+=$?))
fi
if [[ ! -f $NEW_KERNEL_IMAGE ]]; then
cp "$KERNEL_IMAGE" "$NEW_KERNEL_IMAGE"
((ret+=$?))
fi
new-kernel-pkg --install "$KERNEL_VERSION" --kernel-image "$NEW_KERNEL_IMAGE" --initrdfile "$INITRDFILE" --banner "$NAME $VERSION_ID Rescue $MACHINE_ID"
((ret+=$?))
exit $ret

131
51-dracut-rescue.install Executable file
View File

@@ -0,0 +1,131 @@
#!/bin/bash
export LANG=C
COMMAND="$1"
KERNEL_VERSION="$2"
BOOT_DIR_ABS="${3%/*}/0-rescue"
KERNEL_IMAGE="$4"
dropindirs_sort()
{
suffix=$1; shift
args=("$@")
files=$(
while (( $# > 0 )); do
for i in ${1}/*${suffix}; do
[[ -f $i ]] && echo ${i##*/}
done
shift
done | sort -Vu
)
for f in $files; do
for d in "${args[@]}"; do
if [[ -f "$d/$f" ]]; then
echo "$d/$f"
continue 2
fi
done
done
}
[[ -f /etc/os-release ]] && . /etc/os-release
if [[ ${KERNEL_INSTALL_MACHINE_ID+x} ]]; then
MACHINE_ID=$KERNEL_INSTALL_MACHINE_ID
elif [[ -f /etc/machine-id ]] ; then
read MACHINE_ID < /etc/machine-id
fi
if ! [[ $MACHINE_ID ]]; then
exit 0
fi
if [[ -f /etc/kernel/cmdline ]]; then
read -r -d '' -a BOOT_OPTIONS < /etc/kernel/cmdline
elif [[ -f /usr/lib/kernel/cmdline ]]; then
read -r -d '' -a BOOT_OPTIONS < /usr/lib/kernel/cmdline
fi
if ! [[ "${BOOT_OPTIONS[@]}" ]]; then
read -r -d '' -a line < /proc/cmdline
for i in "${line[@]}"; do
[[ "${i#initrd=*}" != "$i" ]] && continue
BOOT_OPTIONS+=("$i")
done
fi
if ! [[ ${BOOT_OPTIONS[*]} ]]; then
echo "Could not determine the kernel command line parameters." >&2
echo "Please specify the kernel command line in /etc/kernel/cmdline!" >&2
exit 1
fi
if [[ -d "${BOOT_DIR_ABS%/*}" ]]; then
BOOT_DIR="/${MACHINE_ID}/0-rescue"
BOOT_ROOT=${BOOT_DIR_ABS%$BOOT_DIR}
LOADER_ENTRY="$BOOT_ROOT/loader/entries/${MACHINE_ID}-0-rescue.conf"
KERNEL="linux"
INITRD="initrd"
else
BLS_DIR="/boot/loader/entries"
BOOT_DIR_ABS="/boot"
LOADER_ENTRY="$BLS_DIR/${MACHINE_ID}-0-rescue.conf"
KERNEL="vmlinuz-0-rescue-${MACHINE_ID}"
INITRD="initramfs-0-rescue-${MACHINE_ID}.img"
fi
ret=0
case "$COMMAND" in
add)
[[ -f "$LOADER_ENTRY" ]] && [[ -f "$BOOT_DIR_ABS/$KERNEL" ]] \
&& [[ -f "$BOOT_DIR_ABS/$INITRD" ]] && exit 0
# source our config dir
for f in $(dropindirs_sort ".conf" "/etc/dracut.conf.d" "/usr/lib/dracut/dracut.conf.d"); do
[[ -e $f ]] && . "$f"
done
[[ $dracut_rescue_image != "yes" ]] && exit 0
[[ -d "$BOOT_DIR_ABS" ]] || mkdir -p "$BOOT_DIR_ABS"
if ! cp "$KERNEL_IMAGE" "$BOOT_DIR_ABS/$KERNEL"; then
echo "Can't copy '$KERNEL_IMAGE to '$BOOT_DIR_ABS/$KERNEL'!" >&2
fi
if [[ ! -f "$BOOT_DIR_ABS/$INITRD" ]]; then
dracut -f --no-hostonly -a "rescue" "$BOOT_DIR_ABS/$INITRD" "$KERNEL_VERSION"
((ret+=$?))
fi
if [[ "${BOOT_DIR_ABS}" != "/boot" ]]; then
{
echo "title $PRETTY_NAME - Rescue Image"
echo "version $KERNEL_VERSION"
echo "machine-id $MACHINE_ID"
echo "options ${BOOT_OPTIONS[@]} rd.auto=1"
echo "linux $BOOT_DIR/linux"
echo "initrd $BOOT_DIR/initrd"
} > $LOADER_ENTRY
else
cp -aT "${KERNEL_IMAGE%/*}/bls.conf" $LOADER_ENTRY
sed -i 's/'$KERNEL_VERSION'/0-rescue-'${MACHINE_ID}'/' $LOADER_ENTRY
fi
((ret+=$?))
;;
remove)
exit 0
;;
*)
usage
ret=1;;
esac
exit $ret

233
AUTHORS
View File

@@ -1,11 +1,228 @@
Andreas Thienemann <andreas@bawue.net>
Bill Nottingham <notting@redhat.com>
Dave Jones <davej@redhat.com>
David Dillow <dave@thedillows.org>
Harald Hoyer <harald@redhat.com>
Jeremy Katz <katzj@redhat.com>
Peter Jones <pjones@redhat.com>
Seewer Philippe <philippe.seewer@bfh.ch>
Victor Lowther <victor.lowther@gmail.com>
Amadeusz Żołnowski <aidecoe@aidecoe.name>
Hannes Reinecke <hare@suse.com>
Will Woods <wwoods@redhat.com>
Philippe Seewer <philippe.seewer@bfh.ch>
Warren Togami <wtogami@redhat.com>
Dave Young <dyoung@redhat.com>
Jeremy Katz <katzj@redhat.com>
David Dillow <dave@thedillows.org>
Michal Soltys <soltys@ziu.info>
Colin Guthrie <colin@mageia.org>
Daniel Molkentin <dmolkentin@suse.com>
Amerigo Wang <amwang@redhat.com>
Thomas Renninger <trenn@suse.com>
Lukas Nykryn <lnykryn@redhat.com>
Alexander Tsoy <alexander@tsoy.me>
Frederick Grose <fgrose@sugarlabs.org>
WANG Chao <chaowang@redhat.com>
Yu Watanabe <watanabe.yu+github@gmail.com>
Andrey Borzenkov <arvidjaar@gmail.com>
Hans de Goede <hdegoede@redhat.com>
Peter Jones <pjones@redhat.com>
Andreas Thienemann <andreas@bawue.net>
Peter Robinson <pbrobinson@fedoraproject.org>
Fabian Vogt <fvogt@suse.com>
Kairui Song <kasong@redhat.com>
John Reiser <jreiser@bitwagon.com>
Luca Berra <bluca@vodka.it>
Xunlei Pang <xlpang@redhat.com>
Daniel Drake <drake@endlessm.com>
Lubomir Rintel <lkundrak@v3.sk>
Angelo "pallotron" Failla <pallotron@fb.com>
Brian C. Lane <bcl@redhat.com>
Ville Skyttä <ville.skytta@iki.fi>
Cristian Rodríguez <crrodriguez@opensuse.org>
Dan Horák <dhorak@redhat.com>
Baoquan He <bhe@redhat.com>
Brendan Germain <brendan.germain@nasdaqomx.com>
Colin Walters <walters@verbum.org>
Leho Kraav <leho@kraav.com>
Moritz Maxeiner <moritz@ucworks.org>
Nicolas Chauvet <kwizart@gmail.com>
Ondrej Mosnacek <omosnace@redhat.com>
Fabian Deutsch <fabiand@fedoraproject.org>
Javier Martinez Canillas <javierm@redhat.com>
Kamil Rytarowski <n54@gmx.com>
Lidong Zhong <lidong.zhong@suse.com>
Marc Grimme <grimme@atix.de>
NeilBrown <neilb@suse.de>
Peter Rajnoha <prajnoha@redhat.com>
Radek Vykydal <rvykydal@redhat.com>
Thorsten Behrens <tbehrens@suse.com>
Chao Wang <chaowang@redhat.com>
Frederic Crozat <fcrozat@suse.com>
James Lee <jlee@thestaticvoid.com>
Jesse Keating <jkeating@redhat.com>
Martin Wilck <mwilck@suse.de>
Mike Gilbert <floppym@gentoo.org>
Milan Broz <mbroz@redhat.com>
Mimi Zohar <zohar@linux.vnet.ibm.com>
Roberto Sassu <roberto.sassu@polito.it>
Stefan Reimer <it@startux.de>
Adam Williamson <awilliam@redhat.com>
Anton Blanchard <anton@samba.org>
Bill Nottingham <notting@redhat.com>
Chapman Flack <g2@anastigmatix.net>
Chris Leech <cleech@redhat.com>
David Cantrell <dcantrell@redhat.com>
Dennis Gilmore <dennis@ausil.us>
Jan Synacek <jsynacek@redhat.com>
Jon Ander Hernandez <jonan.h@gmail.com>
Juan RP <xtraeme@gmail.com>
Lance Albertson <lance@osuosl.org>
Marcos Mello <marcosfrm@gmail.com>
Marian Ganisin <mganisin@redhat.com>
Matthias Gerstner <matthias.gerstner@suse.de>
Michael Ploujnikov <plouj@somanetworks.com>
Pratyush Anand <panand@redhat.com>
Silvio Fricke <silvio.fricke@gmail.com>
Steven Brudenell <steven.brudenell@gmail.com>
Stig Telfer <stelfer@cray.com>
Thomas Backlund <tmb@mageia.org>
Vasiliy Tolstov <v.tolstov@selfip.ru>
Wim Muskee <wimmuskee@gmail.com>
tpgxyz <tpgxyz@gmail.com>
Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Alan Pevec <apevec@redhat.com>
Alex Harpin <development@landsofshadow.co.uk>
Ankit Kumar <ankit@linux.vnet.ibm.com>
Antony Messerli <amesserl@rackspace.com>
Chao Fan <cfan@redhat.com>
Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Daniel Schaal <farbing@web.de>
Denis Silakov <dsilakov@virtuozzo.com>
Dimitri John Ledkov <dimitri.j.ledkov@intel.com>
Erwan Velu <erwan.velu@enovance.com>
Evgeny Vereshchagin <evvers@ya.ru>
Guido Trentalancia <guido@trentalancia.net>
Hari Bathini <hbathini@linux.vnet.ibm.com>
Ian Dall <ian@beware.dropbear.id.au>
Imran Haider <imran1008@gmail.com>
James Buren <ryuo@frugalware.org>
Joey Boggs <jboggs@redhat.com>
Julian Wolf <juwolf@suse.com>
Koen Kooi <koen@dominion.thruhere.net>
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Kyle McMartin <kmcmarti@redhat.com>
Lukas Wunner <lukas@wunner.de>
Mike Snitzer <snitzer@redhat.com>
Minfei Huang <mhuang@redhat.com>
Nikoli <nikoli@gmx.us>
Pingfan Liu <piliu@redhat.com>
Przemysław Rudy <prudy1@o2.pl>
Robert LeBlanc <robert@leblancnet.us>
Robert Scheck <robert@fedoraproject.org>
Stefan Berger <stefanb@us.ibm.com>
Thomas Lange <lange@informatik.uni-koeln.de>
Till Maas <opensource@till.name>
Tony Asleson <tasleson@redhat.com>
Vivek Goyal <vgoyal@redhat.com>
Vladislav Bogdanov <bubble@hoster-ok.com>
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Alexander Kurtz <alexander@kurtz.be>
Alexander Todorov <atodorov@redhat.com>
Andreas Stieger <astieger@suse.com>
Andy Lutomirski <luto@mit.edu>
Anssi Hannula <anssi@mageia.org>
Artem Savkov <asavkov@redhat.com>
B. Wilson <x@wilsonb.com>
Brandon Philips <brandon@ifup.co>
Bryn M. Reeves <bmr@redhat.com>
Canek Peláez Valdés <caneko@gmail.com>
Carlo Caione <carlo@endlessm.com>
Chad Dupuis <chad.dupuis@cavium.com>
Christian Heinz <christian.ch.heinz@gmail.com>
Cong Wang <amwang@redhat.com>
Dan Fuhry <dfuhry@datto.com>
Dave Jones <davej@redhat.com>
David Disseldorp <ddiss@suse.de>
David Michael <david.michael@coreos.com>
Dennis Schridde <devurandom@gmx.net>
Derek Higgins <derekh@redhat.com>
Duane Griffin <duaneg@dghda.com>
Elan Ruusamäe <glen@delfi.ee>
Enno Boland <g@s01.de>
Eugene Syromiatnikov <esyr@redhat.com>
Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com>
Florian Gamböck <mail@floga.de>
François Cami <fcami@fedoraproject.org>
Gerd von Egidy <gerd.von.egidy@intra2net.com>
Glen Gray <slaine@slaine.org>
HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
Hendrik Brueckner <brueckner@linux.ibm.com>
Hermann Gausterer <git-dracut-2012@mrq1.org>
Hiroaki Mizuguchi <hiroaki-m@iij.ad.jp>
Hui Wang <john.wanghui@huawei.com>
Ignaz Forster <iforster@suse.com>
James Laska <jlaska@redhat.com>
Jan Stodola <jstodola@redhat.com>
Jason Dana <jasondana@quarksecurity.com>
Jeremy Linton <lintonrjeremy@gmail.com>
Jiri Pirko <jiri@resnulli.us>
Joe Lawrence <Joe.Lawrence@stratus.com>
Johannes Thumshirn <jthumshirn@suse.com>
Jonas Jonsson <jonas@websystem.se>
Kevin Yung <Kevin.Yung@myob.com>
Lars R. Damerow <lars@pixar.com>
Lennert Buytenhek <buytenh@wantstofly.org>
Major Hayden <major@mhtx.net>
Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
Marian Csontos <mcsontos@redhat.com>
Mark Fasheh <mfasheh@suse.de>
Marko Myllynen <myllynen@redhat.com>
Matt <smoothsailing72@hotmail.com>
Matt Smith <shadowfax@gmx.com>
Matthew Thode <mthode@mthode.org>
Mei Liu <liumbj@linux.vnet.ibm.com>
Michael Chapman <mike@very.puzzling.org>
Michael McCracken <michael.mccracken@gmail.com>
Michal Koutný <mkoutny@suse.com>
Michal Schmidt <mschmidt@redhat.com>
Michal Sekletar <msekleta@redhat.com>
Mike Gorse <mgorse@suse.com>
Moritz 'Morty' Strübe <morty@gmx.net>
Munehiro Matsuda <haro@kgt.co.jp>
Nicolas Porcel <nicolasporcel06@gmail.com>
Olivier Blin <dev@blino.org>
P J P <ppandit@redhat.com>
Paolo Bonzini <pbonzini@redhat.com>
Pavel Zhukov <pzhukov@redhat.com>
Pawel Wieczorkiewicz <pwieczorkiewicz@suse.de>
Pekka Wallendahl <wyrmiyu@gmail.com>
Prarit Bhargava <prarit@redhat.com>
Praveen_Paladugu@Dell.com <Praveen_Paladugu@Dell.com>
Pádraig Brady <P@draigBrady.com>
Quentin Armitage <quentin@armitage.org.uk>
Renaud Métrich <rmetrich@redhat.com>
Robert Buchholz <rbu@goodpoint.de>
Ruben Kerkhof <ruben@rubenkerkhof.com>
Rusty Bird <rustybird@openmailbox.org>
Sergey Fionov <fionov@gmail.com>
Shawn W Dunn <sfalken@opensuse.org>
Srinivasa T N <seenutn@linux.vnet.ibm.com>
Stijn Hoop <stijn@sandcat.nl>
Sullivan (CTR), Austin <austin.sullivan.ctr@progeny.net>
Thilo Bangert <thilo.bangert@gmx.net>
Thomas Blume <thomas.blume@suse.com>
Tobias Geerinckx <tobias.geerinckx@gmail.com>
Tobias Klauser <tklauser@distanz.ch>
Tom Gundersen <teg@jklm.no>
Tomasz Paweł Gajc <tpgxyz@gmail.com>
Tomasz Torcz <tomek@pipebreaker.pl>
Tong Li <tonli@redhat.com>
Vadim Kuznetsov <vadimk@gentoo.org>
Vaughan Cao <vaughan.cao@oracle.com>
Vratislav Podzimek <vpodzime@redhat.com>
Yanko Kaneti <yaneti@declera.com>
Zhiguo Deng <bjzgdeng@linux.vnet.ibm.com>
Ziyue Yang <ziyang@redhat.com>
honza801 <honza801@gmail.com>
jloeser <jloeser@suse.de>
johannes <johannes.brechtmann@gmail.com>
jonathan-teh <30538043+jonathan-teh@users.noreply.github.com>
maximilian attems <max@stro.at>
privb0x23 <privb0x23@users.noreply.github.com>
tpg <tpgxyz@gmail.com>
xtraeme <xtraeme@voidlinux.eu>

42
COPYING
View File

@@ -1,12 +1,12 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
@@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
@@ -55,8 +55,8 @@ patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
@@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
@@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
@@ -225,7 +225,7 @@ impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
@@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
@@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
@@ -291,7 +291,7 @@ convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -303,16 +303,16 @@ the "copyright" line and a pointer to where the full notice is found.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
@@ -335,5 +335,5 @@ necessary. Here is a sample; alter the names:
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View File

@@ -1,11 +1,11 @@
Right now, most of the testing is done using a qemu/kvm guest and
generating the initramfs on another box but the support is all present
to build for the "running" machine. For the former, you can boot the guest
using qemu's -kernel and -initrd options.
using qemu's -kernel and -initrd options.
dracut exists and will build an image. It is command-line equivalent
to most mkinitrd implementations and should be pretty straight-forward
to use.
to use.
To use, just run dracut with an output file name and, optionally, a
kernel version (it defaults to using the current). The appropriate
@@ -14,7 +14,7 @@ like to customize the list of modules copied in, edit /etc/dracut.conf
and set
dracutmodules="foo bar baz"
Note that dracut calls functional components in modules.d "modules"
Note that dracut calls functional components in modules.d "modules"
while kernel modules are called "drivers".
Requirements:

312
Makefile
View File

@@ -1,77 +1,281 @@
VERSION=0.7
GITVERSION=$(shell [ -d .git ] && git rev-list --abbrev-commit -n 1 HEAD |cut -b 1-8)
-include dracut-version.sh
prefix = /usr
datadir = ${prefix}/share
pkglibdir = ${datadir}/dracut
sysconfdir = ${prefix}/etc
sbindir = ${prefix}/sbin
mandir = ${prefix}/share/man
VERSION ?= $(shell [ -d .git ] && git describe --abbrev=0 --tags --always 2>/dev/null || echo $(DRACUT_VERSION))
GITVERSION ?= $(shell [ -d .git ] && { v=$$(git describe --tags --always 2>/dev/null); [ -n "$$v" ] && [ $${v\#*-} != $$v ] && echo -$${v\#*-}; } )
modules.d/99base/switch_root: switch_root.c
gcc -D _GNU_SOURCE -D 'PACKAGE_STRING="dracut"' -std=gnu99 -fsigned-char -g -O2 -o modules.d/99base/switch_root switch_root.c
-include Makefile.inc
all: modules.d/99base/switch_root
prefix ?= /usr
libdir ?= ${prefix}/lib
datadir ?= ${prefix}/share
pkglibdir ?= ${libdir}/dracut
sysconfdir ?= ${prefix}/etc
bindir ?= ${prefix}/bin
mandir ?= ${prefix}/share/man
CFLAGS ?= -O2 -g -Wall
CFLAGS += -std=gnu99 -D_FILE_OFFSET_BITS=64 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 $(KMOD_CFLAGS)
bashcompletiondir ?= ${datadir}/bash-completion/completions
pkgconfigdatadir ?= $(datadir)/pkgconfig
.PHONY: install clean archive rpm testimage test all check
man1pages = lsinitrd.1
install:
man5pages = dracut.conf.5
man7pages = dracut.cmdline.7 \
dracut.bootup.7 \
dracut.modules.7
man8pages = dracut.8 \
dracut-catimages.8 \
mkinitrd.8 \
mkinitrd-suse.8 \
modules.d/98dracut-systemd/dracut-cmdline.service.8 \
modules.d/98dracut-systemd/dracut-initqueue.service.8 \
modules.d/98dracut-systemd/dracut-mount.service.8 \
modules.d/98dracut-systemd/dracut-shutdown.service.8 \
modules.d/98dracut-systemd/dracut-pre-mount.service.8 \
modules.d/98dracut-systemd/dracut-pre-pivot.service.8 \
modules.d/98dracut-systemd/dracut-pre-trigger.service.8 \
modules.d/98dracut-systemd/dracut-pre-udev.service.8
manpages = $(man1pages) $(man5pages) $(man7pages) $(man8pages)
.PHONY: install clean archive rpm srpm testimage test all check AUTHORS doc dracut-version.sh
all: dracut-version.sh dracut.pc dracut-install skipcpio/skipcpio
DRACUT_INSTALL_OBJECTS = \
install/dracut-install.o \
install/hashmap.o\
install/log.o \
install/strv.o \
install/util.o
# deps generated with gcc -MM
install/dracut-install.o: install/dracut-install.c install/log.h install/macro.h \
install/hashmap.h install/util.h
install/hashmap.o: install/hashmap.c install/util.h install/macro.h install/log.h \
install/hashmap.h
install/log.o: install/log.c install/log.h install/macro.h install/util.h
install/util.o: install/util.c install/util.h install/macro.h install/log.h
install/strv.o: install/strv.c install/strv.h install/util.h install/macro.h install/log.h
install/dracut-install: $(DRACUT_INSTALL_OBJECTS)
$(CC) $(LDFLAGS) -o $@ $(DRACUT_INSTALL_OBJECTS) $(LDLIBS) $(KMOD_LIBS)
logtee: logtee.c
$(CC) $(LDFLAGS) -o $@ $<
dracut-install: install/dracut-install
ln -fs $< $@
SKIPCPIO_OBJECTS= \
skipcpio/skipcpio.o
skipcpio/skipcpio.o: skipcpio/skipcpio.c
skipcpio/skipcpio: skipcpio/skipcpio.o
indent:
indent -i8 -nut -br -linux -l120 install/dracut-install.c
indent -i8 -nut -br -linux -l120 skipcpio/skipcpio.c
doc: $(manpages) dracut.html
ifneq ($(enable_documentation),no)
all: doc
endif
%: %.xml
@rm -f -- "$@"
xsltproc -o "$@" -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
%.xml: %.asc
@rm -f -- "$@"
asciidoc -d manpage -b docbook -o "$@" $<
dracut.8: dracut.usage.asc dracut.8.asc
dracut.html: dracut.asc $(manpages) dracut.css dracut.usage.asc
@rm -f -- dracut.xml
asciidoc -a numbered -d book -b docbook -o dracut.xml dracut.asc
@rm -f -- dracut.html
xsltproc -o dracut.html --xinclude -nonet \
--stringparam custom.css.source dracut.css \
--stringparam generate.css.header 1 \
http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl dracut.xml
@rm -f -- dracut.xml
dracut.pc: Makefile.inc Makefile
@echo "Name: dracut" > dracut.pc
@echo "Description: dracut" >> dracut.pc
@echo "Version: $(VERSION)$(GITVERSION)" >> dracut.pc
@echo "dracutdir=$(pkglibdir)" >> dracut.pc
@echo "dracutmodulesdir=$(pkglibdir)/modules.d" >> dracut.pc
@echo "dracutconfdir=$(pkglibdir)/dracut.conf.d" >> dracut.pc
install: all
mkdir -p $(DESTDIR)$(pkglibdir)
mkdir -p $(DESTDIR)$(sbindir)
mkdir -p $(DESTDIR)$(bindir)
mkdir -p $(DESTDIR)$(sysconfdir)
mkdir -p $(DESTDIR)$(pkglibdir)/modules.d
mkdir -p $(DESTDIR)$(mandir)/man8
install -m 0755 dracut $(DESTDIR)$(sbindir)/dracut
install -m 0755 dracut-gencmdline $(DESTDIR)$(sbindir)/dracut-gencmdline
install -m 0755 dracut-catimages $(DESTDIR)$(sbindir)/dracut-catimages
install -m 0755 modules.d/99base/switch_root $(DESTDIR)$(sbindir)/switch_root
mkdir -p $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5 $(DESTDIR)$(mandir)/man7 $(DESTDIR)$(mandir)/man8
install -m 0755 dracut.sh $(DESTDIR)$(bindir)/dracut
install -m 0755 dracut-catimages.sh $(DESTDIR)$(bindir)/dracut-catimages
install -m 0755 mkinitrd-dracut.sh $(DESTDIR)$(bindir)/mkinitrd
install -m 0755 lsinitrd.sh $(DESTDIR)$(bindir)/lsinitrd
install -m 0644 dracut.conf $(DESTDIR)$(sysconfdir)/dracut.conf
install -m 0755 dracut-functions $(DESTDIR)$(pkglibdir)/dracut-functions
mkdir -p $(DESTDIR)$(sysconfdir)/dracut.conf.d
mkdir -p $(DESTDIR)$(pkglibdir)/dracut.conf.d
install -m 0755 dracut-init.sh $(DESTDIR)$(pkglibdir)/dracut-init.sh
install -m 0755 dracut-functions.sh $(DESTDIR)$(pkglibdir)/dracut-functions.sh
install -m 0755 dracut-version.sh $(DESTDIR)$(pkglibdir)/dracut-version.sh
ln -fs dracut-functions.sh $(DESTDIR)$(pkglibdir)/dracut-functions
install -m 0755 dracut-logger.sh $(DESTDIR)$(pkglibdir)/dracut-logger.sh
install -m 0755 dracut-initramfs-restore.sh $(DESTDIR)$(pkglibdir)/dracut-initramfs-restore
cp -arx modules.d $(DESTDIR)$(pkglibdir)
install -m 0644 dracut.8 $(DESTDIR)$(mandir)/man8
rm $(DESTDIR)$(pkglibdir)/modules.d/99base/switch_root
ifneq ($(enable_documentation),no)
for i in $(man1pages); do install -m 0644 $$i $(DESTDIR)$(mandir)/man1/$${i##*/}; done
for i in $(man5pages); do install -m 0644 $$i $(DESTDIR)$(mandir)/man5/$${i##*/}; done
for i in $(man7pages); do install -m 0644 $$i $(DESTDIR)$(mandir)/man7/$${i##*/}; done
for i in $(man8pages); do install -m 0644 $$i $(DESTDIR)$(mandir)/man8/$${i##*/}; done
ln -fs dracut.cmdline.7 $(DESTDIR)$(mandir)/man7/dracut.kernel.7
endif
if [ -n "$(systemdsystemunitdir)" ]; then \
mkdir -p $(DESTDIR)$(systemdsystemunitdir); \
ln -srf $(DESTDIR)$(pkglibdir)/modules.d/98dracut-systemd/dracut-shutdown.service $(DESTDIR)$(systemdsystemunitdir)/dracut-shutdown.service; \
mkdir -p $(DESTDIR)$(systemdsystemunitdir)/sysinit.target.wants; \
ln -s ../dracut-shutdown.service \
$(DESTDIR)$(systemdsystemunitdir)/sysinit.target.wants/dracut-shutdown.service; \
mkdir -p $(DESTDIR)$(systemdsystemunitdir)/initrd.target.wants; \
for i in \
dracut-cmdline.service \
dracut-initqueue.service \
dracut-mount.service \
dracut-pre-mount.service \
dracut-pre-pivot.service \
dracut-pre-trigger.service \
dracut-pre-udev.service \
; do \
ln -srf $(DESTDIR)$(pkglibdir)/modules.d/98dracut-systemd/$$i $(DESTDIR)$(systemdsystemunitdir); \
ln -s ../$$i \
$(DESTDIR)$(systemdsystemunitdir)/initrd.target.wants/$$i; \
done \
fi
if [ -f install/dracut-install ]; then \
install -m 0755 install/dracut-install $(DESTDIR)$(pkglibdir)/dracut-install; \
fi
if [ -f skipcpio/skipcpio ]; then \
install -m 0755 skipcpio/skipcpio $(DESTDIR)$(pkglibdir)/skipcpio; \
fi
mkdir -p $(DESTDIR)${prefix}/lib/kernel/install.d
install -m 0755 50-dracut.install $(DESTDIR)${prefix}/lib/kernel/install.d/50-dracut.install
install -m 0755 51-dracut-rescue.install $(DESTDIR)${prefix}/lib/kernel/install.d/51-dracut-rescue.install
mkdir -p $(DESTDIR)${bashcompletiondir}
install -m 0644 dracut-bash-completion.sh $(DESTDIR)${bashcompletiondir}/dracut
install -m 0644 lsinitrd-bash-completion.sh $(DESTDIR)${bashcompletiondir}/lsinitrd
mkdir -p $(DESTDIR)${pkgconfigdatadir}
install -m 0644 dracut.pc $(DESTDIR)${pkgconfigdatadir}/dracut.pc
dracut-version.sh:
@rm -f dracut-version.sh
@echo "DRACUT_VERSION=$(VERSION)$(GITVERSION)" > dracut-version.sh
clean:
rm -f *~
rm -f modules.d/99base/switch_root
rm -f test-*.img
rm -f dracut-*.rpm dracut-*.tar.bz2
make -C test clean
$(RM) *~
$(RM) */*~
$(RM) */*/*~
$(RM) $(manpages:%=%.xml) dracut.xml
$(RM) test-*.img
$(RM) dracut-*.rpm dracut-*.tar.bz2 dracut-*.tar.xz
$(RM) dracut-version.sh
$(RM) dracut-install install/dracut-install $(DRACUT_INSTALL_OBJECTS)
$(RM) skipcpio/skipcpio $(SKIPCPIO_OBJECTS)
$(RM) $(manpages) dracut.html
$(MAKE) -C test clean
archive: dracut-$(VERSION)-$(GITVERSION).tar.bz2
dist: dracut-$(VERSION).tar.xz
dist: dracut-$(VERSION).tar.bz2
dracut-$(VERSION).tar.xz: doc syncheck
@echo "DRACUT_VERSION=$(VERSION)" > dracut-version.sh
git archive --format=tar $(VERSION) --prefix=dracut-$(VERSION)/ > dracut-$(VERSION).tar
mkdir -p dracut-$(VERSION)
for i in $(manpages) dracut.html dracut-version.sh; do [ "$${i%/*}" != "$$i" ] && mkdir -p "dracut-$(VERSION)/$${i%/*}"; cp "$$i" "dracut-$(VERSION)/$$i"; done
tar --owner=root --group=root -rf dracut-$(VERSION).tar $$(find dracut-$(VERSION) -type f)
rm -fr -- dracut-$(VERSION).tar.xz dracut-$(VERSION)
xz -9 dracut-$(VERSION).tar
rm -f -- dracut-$(VERSION).tar
dracut-$(VERSION).tar.bz2:
git archive --format=tar $(VERSION) --prefix=dracut-$(VERSION)/ |bzip2 > dracut-$(VERSION).tar.bz2
rpm: dracut-$(VERSION).tar.xz syncheck
rpmbuild=$$(mktemp -d -t rpmbuild-dracut.XXXXXX); src=$$(pwd); \
cp dracut-$(VERSION).tar.xz "$$rpmbuild"; \
LC_MESSAGES=C $$src/git2spec.pl $(VERSION) "$$rpmbuild" < dracut.spec > $$rpmbuild/dracut.spec; \
(cd "$$rpmbuild"; \
wget https://www.gnu.org/licenses/lgpl-2.1.txt; \
rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" \
--define "_specdir $$PWD" --define "_srcrpmdir $$PWD" \
--define "_rpmdir $$PWD" -ba dracut.spec; ) && \
( mv "$$rpmbuild"/{,$$(arch)/}*.rpm $(DESTDIR).; rm -fr -- "$$rpmbuild"; ls $(DESTDIR)*.rpm )
dracut-$(VERSION)-$(GITVERSION).tar.bz2:
git archive --format=tar HEAD --prefix=dracut-$(VERSION)-$(GITVERSION)/ |bzip2 > dracut-$(VERSION)-$(GITVERSION).tar.bz2
srpm: dracut-$(VERSION).tar.xz syncheck
rpmbuild=$$(mktemp -d -t rpmbuild-dracut.XXXXXX); src=$$(pwd); \
cp dracut-$(VERSION).tar.xz "$$rpmbuild"; \
LC_MESSAGES=C $$src/git2spec.pl $(VERSION) "$$rpmbuild" < dracut.spec > $$rpmbuild/dracut.spec; \
(cd "$$rpmbuild"; \
[ -f $$src/lgpl-2.1.txt ] && cp $$src/lgpl-2.1.txt . || wget https://www.gnu.org/licenses/lgpl-2.1.txt; \
rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" \
--define "_specdir $$PWD" --define "_srcrpmdir $$PWD" \
--define "_rpmdir $$PWD" -bs dracut.spec; ) && \
( mv "$$rpmbuild"/*.src.rpm $(DESTDIR).; rm -fr -- "$$rpmbuild"; ls $(DESTDIR)*.rpm )
rpm: clean dracut-$(VERSION).tar.bz2
rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" --define "_specdir $$PWD" --define "_srcrpmdir $$PWD" --define "_rpmdir $$PWD" -ba dracut.spec
rm -fr BUILD BUILDROOT
gitrpm: dracut-$(VERSION)-$(GITVERSION).tar.bz2
rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" --define "_specdir $$PWD" --define "_srcrpmdir $$PWD" --define "_rpmdir $$PWD" --define "gittag $(GITVERSION)" -ba dracut.spec
rm -fr BUILD BUILDROOT
check: all
@ret=0;for i in modules.d/99base/init modules.d/*/*.sh; do \
dash -n "$$i" ; ret=$$(($$ret+$$?)); \
syncheck:
@ret=0;for i in dracut-initramfs-restore.sh modules.d/*/*.sh; do \
[ "$${i##*/}" = "module-setup.sh" ] && continue; \
read line < "$$i"; [ "$${line#*bash*}" != "$$line" ] && continue; \
[ $$V ] && echo "posix syntax check: $$i"; bash --posix -n "$$i" ; ret=$$(($$ret+$$?)); \
[ $$V ] && echo "checking for [[: $$i"; if grep -Fq '[[ ' "$$i" ; then ret=$$(($$ret+1)); echo "$$i contains [["; fi; \
[ $$V ] && echo "checking for echo -n: $$i"; if grep -Fq 'echo -n ' "$$i" ; then ret=$$(($$ret+1)); echo "$$i contains echo -n"; fi \
done;exit $$ret
make -C test check
@ret=0;for i in *.sh mkinitrd-dracut.sh modules.d/*/*.sh \
modules.d/*/module-setup.sh; do \
[ $$V ] && echo "bash syntax check: $$i"; bash -n "$$i" ; ret=$$(($$ret+$$?)); \
done;exit $$ret
check: all syncheck rpm
@[ "$$EUID" == "0" ] || { echo "'check' must be run as root! Please use 'sudo'."; exit 1; }
@$(MAKE) -C test check
testimage: all
./dracut -l -a debug -f test-$(shell uname -r).img $(shell uname -r)
@echo wrote test-$(shell uname -r).img
./dracut.sh -N -l -a debug -f test-$(shell uname -r).img $(shell uname -r)
@echo wrote test-$(shell uname -r).img
debugtestimage: all
./dracut.sh --debug -l -a debug -f test-$(shell uname -r).img $(shell uname -r)
@echo wrote test-$(shell uname -r).img
testimages: all
./dracut -l -a debug --kernel-only -f test-kernel-$(shell uname -r).img $(shell uname -r)
@echo wrote test-$(shell uname -r).img
./dracut -l -a debug --no-kernel -f test-dracut.img $(shell uname -r)
@echo wrote test-dracut.img
./dracut.sh -l -a debug --kernel-only -f test-kernel-$(shell uname -r).img $(shell uname -r)
@echo wrote test-$(shell uname -r).img
./dracut.sh -l -a debug --no-kernel -f test-dracut.img $(shell uname -r)
@echo wrote test-dracut.img
debughostimage: all
./dracut.sh --debug -H -l -f test-$(shell uname -r).img $(shell uname -r)
@echo wrote test-$(shell uname -r).img
hostimage: all
./dracut.sh -H -l -f test-$(shell uname -r).img $(shell uname -r)
@echo wrote test-$(shell uname -r).img
efi: all
./dracut.sh --uefi -H -l -f linux-$(shell uname -r).efi $(shell uname -r)
@echo wrote linux-$(shell uname -r).efi
AUTHORS:
git shortlog --numbered --summary -e |while read a rest || [ -n "$$rest" ]; do echo $$rest;done > AUTHORS
dracut.html.sign: dracut-$(VERSION).tar.xz dracut.html
gpg-sign-all dracut-$(VERSION).tar.xz dracut.html
upload: dracut.html.sign
kup put dracut-$(VERSION).tar.xz dracut-$(VERSION).tar.sign /pub/linux/utils/boot/dracut/
kup put dracut.html dracut.html.sign /pub/linux/utils/boot/dracut/

1618
NEWS Normal file

File diff suppressed because it is too large Load Diff

38
PKGBUILD Normal file
View File

@@ -0,0 +1,38 @@
pkgname=dracut-git
pkgver=1
pkgrel=1
pkgdesc="Initramfs generation utility"
arch=('i686' 'x86_64')
url="https://dracut.wiki.kernel.org/"
license=('GPL')
conflicts=('dracut' 'mkinitcpio')
provides=('dracut=9999' 'mkinitcpio=9999')
depends=('bash')
optdepends=('cryptsetup' 'lvm2')
makedepends=('libxslt')
backup=(etc/dracut.conf)
source=()
md5sums=()
# out of tree builds disallowed for this PKGFILE
BUILDDIR="${PWD}"
PKGDEST="${PWD}"
SRCDEST=""
SRCPKGDEST=""
LOGDEST=""
pkgver() {
cd ..
desc="$(git describe)"
printf "%s.%s.%s" ${desc//-/ }
}
build() {
cd ..
make sysconfdir=/etc || return 1
}
package() {
cd ..
make DESTDIR="${pkgdir}" sysconfdir=/etc install || return 1
}

66
README
View File

@@ -1,9 +1,10 @@
Dracut
dracut
------
Dracut is a new initramfs infrastructure.
dracut is an event driven initramfs infrastructure.
Information about the initial goals and aims can be found at
https://fedoraproject.org/wiki/Initrdrewrite
dracut (the tool) is used to create an initramfs image by copying tools
and files from an installed system and combining it with the
dracut framework, usually found in /usr/lib/dracut/modules.d.
Unlike existing initramfs's, this is an attempt at having as little as
possible hard-coded into the initramfs as possible. The initramfs has
@@ -19,17 +20,19 @@ we'll grow some hooks for running arbitrary commands in the flow of
the script, but it's worth trying to resist the urge as much as we can
as hooks are guaranteed to be the path to slow-down.
Most of the initrd generation functionality in dracut is provided by a bunch
Most of the initramfs generation functionality in dracut is provided by a bunch
of generator modules that are sourced by the main dracut script to install
specific functionality into the initrd. They live in the modules.d subdirectory,
and use functionality provided by dracut-functions to do their work.
specific functionality into the initramfs. They live in the modules.d
subdirectory, and use functionality provided by dracut-functions to do their
work.
Some general rules for writing modules:
* Use one of the inst family of functions to actually install files
on to the initrd. They handle mangling the pathnames and (for binaries,
on to the initramfs. They handle mangling the pathnames and (for binaries,
scripts, and kernel modules) installing dependencies as appropriate so
you do not have to.
* Scripts that end up on the initrd should be POSIX compliant. dracut
will try to use /bin/dash as /bin/sh for the initrd if it is available,
* Scripts that end up on the initramfs should be POSIX compliant. dracut
will try to use /bin/dash as /bin/sh for the initramfs if it is available,
so you should install it on your system -- dash aims for strict POSIX
compliance to the extent possible.
* Hooks MUST be POSIX compliant -- they are sourced by the init script,
@@ -42,35 +45,42 @@ Some general rules for writing modules:
* We have some breakpoints for debugging your hooks. If you pass 'rdbreak'
as a kernel parameter, the initramfs will drop to a shell just before
switching to a new root. You can pass 'rdbreak=hookpoint', and the initramfs
will break just before hooks in that hookpoint run.
will break just before hooks in that hookpoint run.
Also, there is an attempt to keep things as distribution-agnostic as
possible. Every distribution has their own tool here and it's not
something which is really interesting to have separate across them.
So contributions to help decrease the distro-dependencies are welcome.
Currently dracut lives on sourceforge.
Currently dracut lives on github.com and kernel.org.
Project Page:
https://sourceforge.net/projects/dracut/
The tarballs can be found here:
http://www.kernel.org/pub/linux/utils/boot/dracut/
ftp://ftp.kernel.org/pub/linux/utils/boot/dracut/
Drop Harald Hoyer <harald@redhat.com> a mail, if you want to help with
the documentation, git access, etc.
Git:
git://git.kernel.org/pub/scm/boot/dracut/dracut.git
http://git.kernel.org/pub/scm/boot/dracut/dracut.git
https://git.kernel.org/pub/scm/boot/dracut/dracut.git
Git Repository:
http://dracut.git.sourceforge.net/
git://dracut.git.sourceforge.net/gitroot/dracut
git@github.com:dracutdevs/dracut.git
Trac Instance:
http://apps.sourceforge.net/trac/dracut/
Git Web:
https://github.com/dracutdevs/dracut.git
The git tree can be found at
git://dracut.git.sourceforge.net/gitroot/dracut for now. See the TODO
file for things which still need to be done and HACKING for some
instructions on how to get started. There is also a mailing list that
is being used for the discussion -- initramfs@vger.kernel.org. It is
a typical vger list, send mail to majordomo@vger.kernel.org with body
of 'subscribe initramfs email@host.com'
http://git.kernel.org/?p=boot/dracut/dracut.git
Project Documentation:
http://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html
Project Wiki:
http://dracut.wiki.kernel.org
See the TODO file for things which still need to be done and HACKING for
some instructions on how to get started. There is also a mailing list
that is being used for the discussion -- initramfs@vger.kernel.org.
It is a typical vger list, send mail to majordomo@vger.kernel.org with body
of 'subscribe initramfs email@host.com'
Licensed under the GPLv2

View File

@@ -1,10 +1,13 @@
To build a generic initramfs, you have to install the following software packages:
* device-mapper
* cryptsetup-luks
* rpcbind nfs-utils
* rpcbind nfs-utils
* lvm2
* iscsi-initiator-utils
* nbd
* mdadm
* net-tools iproute
Generic initramfs'es are huge (usually over 10 megs in size uncompressed), but
should be able to automatically boot any bootable configuration with appropriate
boot flags (root device, network configuration information, etc.)

View File

@@ -1,6 +1,3 @@
dracut-kernel is used to pull in all firmware files to build an initrd with
only kernel modules and firmware files.
dracut --kernel-only only executes "installkernel" in the modules
subdirectories.
"dracut --kernel-only" is to build an initrd with only kernel modules and firmware files.
"dracut --kernel-only" only executes "installkernel" in the modules subdirectories.

31
README.md Normal file
View File

@@ -0,0 +1,31 @@
# dracut - master branch
dracut is an initramfs infrastructure.
## Travis
[![Build Status](https://travis-ci.org/dracutdevs/dracut.svg?branch=master)](https://travis-ci.org/dracutdevs/dracut)
## CentOS CI
[![Build Status](https://ci.centos.org/job/dracut-push-master/badge/icon)](https://ci.centos.org/job/dracut-push-master/)
- Test 01: [![Test 01](https://ci.centos.org/job/dracut-matrix-master/TESTS=01,label=dracut-ci-slave01/badge/icon)](https://ci.centos.org/job/dracut-matrix-master/TESTS=01,label=dracut-ci-slave01/)
- Test 02: [![Test 02](https://ci.centos.org/job/dracut-matrix-master/TESTS=02,label=dracut-ci-slave01/badge/icon)](https://ci.centos.org/job/dracut-matrix-master/TESTS=02,label=dracut-ci-slave01/)
- Test 03: [![Test 03](https://ci.centos.org/job/dracut-matrix-master/TESTS=03,label=dracut-ci-slave01/badge/icon)](https://ci.centos.org/job/dracut-matrix-master/TESTS=03,label=dracut-ci-slave01/)
- Test 04: [![Test 04](https://ci.centos.org/job/dracut-matrix-master/TESTS=04,label=dracut-ci-slave01/badge/icon)](https://ci.centos.org/job/dracut-matrix-master/TESTS=04,label=dracut-ci-slave01/)
- Test 10: [![Test 10](https://ci.centos.org/job/dracut-matrix-master/TESTS=10,label=dracut-ci-slave01/badge/icon)](https://ci.centos.org/job/dracut-matrix-master/TESTS=10,label=dracut-ci-slave01/)
- Test 11: [![Test 11](https://ci.centos.org/job/dracut-matrix-master/TESTS=11,label=dracut-ci-slave01/badge/icon)](https://ci.centos.org/job/dracut-matrix-master/TESTS=11,label=dracut-ci-slave01/)
- Test 12: [![Test 12](https://ci.centos.org/job/dracut-matrix-master/TESTS=12,label=dracut-ci-slave01/badge/icon)](https://ci.centos.org/job/dracut-matrix-master/TESTS=12,label=dracut-ci-slave01/)
- Test 13: [![Test 13](https://ci.centos.org/job/dracut-matrix-master/TESTS=13,label=dracut-ci-slave01/badge/icon)](https://ci.centos.org/job/dracut-matrix-master/TESTS=13,label=dracut-ci-slave01/)
- Test 14: [![Test 14](https://ci.centos.org/job/dracut-matrix-master/TESTS=14,label=dracut-ci-slave01/badge/icon)](https://ci.centos.org/job/dracut-matrix-master/TESTS=14,label=dracut-ci-slave01/)
- Test 15: [![Test 15](https://ci.centos.org/job/dracut-matrix-master/TESTS=15,label=dracut-ci-slave01/badge/icon)](https://ci.centos.org/job/dracut-matrix-master/TESTS=15,label=dracut-ci-slave01/)
- Test 16: [![Test 16](https://ci.centos.org/job/dracut-matrix-master/TESTS=16,label=dracut-ci-slave01/badge/icon)](https://ci.centos.org/job/dracut-matrix-master/TESTS=16,label=dracut-ci-slave01/)
- Test 17: [![Test 17](https://ci.centos.org/job/dracut-matrix-master/TESTS=17,label=dracut-ci-slave01/badge/icon)](https://ci.centos.org/job/dracut-matrix-master/TESTS=17,label=dracut-ci-slave01/)
- Test 20: [![Test 20](https://ci.centos.org/job/dracut-matrix-master/TESTS=20,label=dracut-ci-slave01/badge/icon)](https://ci.centos.org/job/dracut-matrix-master/TESTS=20,label=dracut-ci-slave01/)
- Test 30: [![Test 30](https://ci.centos.org/job/dracut-matrix-master/TESTS=30,label=dracut-ci-slave01/badge/icon)](https://ci.centos.org/job/dracut-matrix-master/TESTS=30,label=dracut-ci-slave01/)
- Test 31: [![Test 31](https://ci.centos.org/job/dracut-matrix-master/TESTS=31,label=dracut-ci-slave01/badge/icon)](https://ci.centos.org/job/dracut-matrix-master/TESTS=31,label=dracut-ci-slave01/)
- Test 40: [![Test 40](https://ci.centos.org/job/dracut-matrix-master/TESTS=40,label=dracut-ci-slave01/badge/icon)](https://ci.centos.org/job/dracut-matrix-master/TESTS=40,label=dracut-ci-slave01/)
- Test 50: [![Test 50](https://ci.centos.org/job/dracut-matrix-master/TESTS=50,label=dracut-ci-slave01/badge/icon)](https://ci.centos.org/job/dracut-matrix-master/TESTS=50,label=dracut-ci-slave01/)
- Test 60: [![Test 60](https://ci.centos.org/job/dracut-matrix-master/TESTS=60,label=dracut-ci-slave01/badge/icon)](https://ci.centos.org/job/dracut-matrix-master/TESTS=60,label=dracut-ci-slave01/)
- Test 70: [![Test 70](https://ci.centos.org/job/dracut-matrix-master/TESTS=70,label=dracut-ci-slave01/badge/icon)](https://ci.centos.org/job/dracut-matrix-master/TESTS=70,label=dracut-ci-slave01/)

View File

@@ -1,10 +1,10 @@
Most of the functionality that dracut implements are actually implemented
by dracut modules. Dracut modules live in modules.d, and have the following
by dracut modules. dracut modules live in modules.d, and have the following
structure:
dracut_install_dir/modules.d/
00modname/
install
module-setup.sh
check
<other files as needed by the hook>
@@ -12,42 +12,55 @@ dracut_install_dir/modules.d/
The numeric code must be present and in the range of 00 - 99.
Modules with lower numbers are installed first. This is important
because the dracut install functions (which install files onto
the initrd) refuse to overwrite already installed files. This makes
it easy for an earlier module to override the functionality of a
the initrd) refuse to overwrite already installed files. This makes
it easy for an earlier module to override the functionality of a
later module, so that you can have a distro or system specific
module override or modify the functionality of a generic module
without having to patch the more generic module.
install: dracut sources this script to install the functionality that a
module-setup.sh:
dracut sources this script to install the functionality that a
module implements onto the initrd. For the most part, this amounts
to copying files from the host system onto the initrd in a controlled
manner. dracut supplies several install functions that are
manner.
install():
This function of module-setup.sh is called to install all
non-kernel files. dracut supplies several install functions that are
specialized for different file types. Browse through dracut-functions
fore more details. dracut also provides a $moddir variable if you
need to install a file from the module directory, such as an initrd
hook, a udev rule, or a specialized executable.
check: Dracut calls this program to check and see if a module can be installed
installkernel():
This function of module-setup.sh is called to install all
kernel related files.
check():
dracut calls this function to check and see if a module can be installed
on the initrd.
When called without options, check should check to make sure that
any files it needs to install into the initrd from the host system
are present. It should exit with a 0 if they are, and a 1 if they are
not.
When called with -H, it should perform the same check that it would
without any options, and it should also check to see if the
When called with $hostonly set, it should perform the same check
that it would without it set, and it should also check to see if the
functionality the module implements is being used on the host system.
For example, if this module handles installing support for LUKS
encrypted volumes, it should return 0 if all the tools to handle
encrpted volumes are available and the host system has the root
partition on an encrypted volume, 1 otherwise.
Check may take additional options in the future.
We will most likely grow a module dependency checking system in the
near future, and check will need to handle a -d option when we do.
depends():
This function should output a list of dracut modules
that it relies upon. An example would be the nfs and iscsi modules,
which rely on the network module to detect and configure network
interfaces.
Any other files in the module will not be touched by dracut directly.
Any other files in the module will not be touched by dracut directly.
You are encouraged to provide a README that describes what the module is for.
@@ -57,39 +70,42 @@ HOOKS
init has the following hook points to inject scripts:
/cmdline/*.sh
/lib/dracut/hooks/cmdline/*.sh
scripts for command line parsing
/pre-udev/*.sh
/lib/dracut/hooks/pre-udev/*.sh
scripts to run before udev is started
/pre-trigger/*.sh
/lib/dracut/hooks/pre-trigger/*.sh
scripts to run before the main udev trigger is pulled
/initqueue/*.sh
/lib/dracut/hooks/initqueue/*.sh
runs in parallel to the udev trigger
Udev events can add scripts here with /sbin/initqueue.
If /sbin/initqueue is called with the "--onetime" option, the script
will be removed after it was run.
If /initqueue/work is created and udev >= 143 then this loop can
process the jobs in parallel to the udevtrigger.
If /lib/dracut/hooks/initqueue/work is created and udev >= 143 then
this loop can process the jobs in parallel to the udevtrigger.
If the udev queue is empty and no root device is found or no root
filesystem was mounted, the user will be dropped to a shell after
a timeout.
Scripts can remove themselves from the initqueue by "rm $job".
/pre-mount/*.sh
/lib/dracut/hooks/pre-mount/*.sh
scripts to run before the root filesystem is mounted
Network filesystems like NFS that do not use device files are an
Network filesystems like NFS that do not use device files are an
exception. Root can be mounted already at this point.
/mount/*.sh
/lib/dracut/hooks/mount/*.sh
scripts to mount the root filesystem
If the udev queue is empty and no root device is found or no root
filesystem was mounted, the user will be dropped to a shell after
a timeout.
/pre-pivot/*.sh
/lib/dracut/hooks/pre-pivot/*.sh
scripts to run before latter initramfs cleanups
/lib/dracut/hooks/cleanup/*.sh
scripts to run before the real init is executed and the initramfs
disappears
All processes started before should be killed here.

45
README.testsuite Normal file
View File

@@ -0,0 +1,45 @@
For the testsuite to work, you will have to install at least the following software packages:
dash \
asciidoc \
mdadm \
lvm2 \
dmraid \
cryptsetup \
nfs-utils \
nbd \
dhcp-server \
scsi-target-utils \
iscsi-initiator-utils \
strace \
syslinux \
python-imgcreate \
genisoimage \
btrfs-progs \
kmod-devel \
gcc \
bzip2 \
xz \
tar \
wget \
rpm-build \
${NULL}
TEST-04-FULL-SYSTEMD: systemd >= 187
How to run the testsuite:
$ sudo make clean check
in verbose mode:
$ sudo make V=1 clean check
only specific test:
$ sudo make TESTS="01 20 40" clean check
only runs the 01, 20 and 40 tests.
debug a specific test case:
$ cd TEST-01-BASIC
$ sudo make clean setup run
... change some kernel parameters ...
$ sudo make run
to run the test without doing the setup

51
TODO
View File

@@ -1,2 +1,51 @@
See https://sourceforge.net/apps/trac/dracut/wiki/TODO
Current TODO list, broken into things which are relevant for the
initramfs itself (/init et al) vs the generator.
A lot of things are/should be marked with "FIXME" in the code.
Items are ordered in priority.
INITRAMFS TODO
- search domain string
- allow dual stack configuration (IPv4, IPv6) for the same interface
- "bind-mount" kernel drivers in real root for the rescue image,
if the real root does not have any kernel modules for this kernel
https://bugzilla.redhat.com/show_bug.cgi?id=1046510
- use info and warn prefix
- generate systemd unit dracut-initramfs-restore in /run/systemd dynamically
- put "root=" parsing hooks in separate hook dir
- call "root=" parsing hooks after getting new rootpath from dhcp
- put mount hook in main initqueue loop / careful about resume!
- the hard-coded list of udev rules that we care about is kind of lame.
- panic fallback
- progress indication for fsck https://bugzilla.redhat.com/show_bug.cgi?id=827118
- domain, searchdomain https://bugzilla.redhat.com/show_bug.cgi?id=840778
- probably fix "--include" https://bugzilla.redhat.com/show_bug.cgi?id=849338
GENERATOR TODO
- report errors on missing files in check()
- remove wait for swap devs, if no "resume=" is given on the kernel command line
- remove wait for swap devs, if the "resume" dracut module is not included (omitted)
- add presets (predefined set of modules)
- add interpreter/plugin-scripts to be sourced at the beginning or end (can use dracut-functions)
- add mechanism for module specific command line options
- pkg-config integration, to make it easy for other packages to use us.
- default module specification could use some work
- udev rule copying, as mentioned above, is a bit too hard-coded
- dracut-install parse LD_SHOW_AUXV="" AT_PLATFORM for lib install
CODE TODO
- document more functions
- make function vars local, and prefix with "_"
Future Enhancement Requests
- run ssh server to enter crypto password or perform debugging (supported by debian)
- https://bugzilla.redhat.com/show_bug.cgi?id=524727 - dracut + encrypted root + networking
- lsinitrd --print-cmdline
- dracut --print-cmdline error if additional arguments
- library for cmdline

85
configure vendored Executable file
View File

@@ -0,0 +1,85 @@
#!/bin/bash
# We don't support srcdir != builddir
echo \#buildapi-variable-no-builddir >/dev/null
prefix=/usr
enable_documentation=yes
PKG_CONFIG="${PKG_CONFIG:-pkg-config}"
# Little helper function for reading args from the commandline.
# it automatically handles -a b and -a=b variants, and returns 1 if
# we need to shift $3.
read_arg() {
# $1 = arg name
# $2 = arg value
# $3 = arg parameter
local rematch='^[^=]*=(.*)$'
if [[ $2 =~ $rematch ]]; then
read "$1" <<< "${BASH_REMATCH[1]}"
else
read "$1" <<< "$3"
# There is no way to shift our callers args, so
# return 1 to indicate they should do it instead.
return 1
fi
return 0
}
while (($# > 0)); do
case "${1%%=*}" in
--prefix) read_arg prefix "$@" || shift;;
--libdir) read_arg libdir "$@" || shift;;
--datadir) read_arg datadir "$@" || shift;;
--sysconfdir) read_arg sysconfdir "$@" || shift;;
--sbindir) read_arg sbindir "$@" || shift;;
--mandir) read_arg mandir "$@" || shift;;
--disable-documentation) enable_documentation=no;;
--program-prefix) read_arg programprefix "$@" || shift;;
--exec-prefix) read_arg execprefix "$@" || shift;;
--bindir) read_arg bindir "$@" || shift;;
--includedir) read_arg includedir "$@" || shift;;
--libexecdir) read_arg libexecdir "$@" || shift;;
--localstatedir) read_arg localstatedir "$@" || shift;;
--sharedstatedir) read_arg sharedstatedir "$@" || shift;;
--infodir) read_arg infodir "$@" || shift;;
--systemdsystemunitdir) read_arg systemdsystemunitdir "$@" || shift;;
--bashcompletiondir) read_arg bashcompletiondir "$@" || shift;;
*) echo "Ignoring unknown option '$1'";;
esac
shift
done
if ! ${PKG_CONFIG} --exists --print-errors " libkmod >= 23 "; then
echo "dracut needs pkg-config and libkmod >= 23." >&2
exit 1
fi
cat > Makefile.inc.$$ <<EOF
prefix ?= ${prefix}
libdir ?= ${libdir:-${prefix}/lib}
datadir ?= ${datadir:-${prefix}/share}
sysconfdir ?= ${sysconfdir:-${prefix}/etc}
sbindir ?= ${sbindir:-${prefix}/sbin}
mandir ?= ${mandir:-${prefix}/share/man}
enable_documentation ?= ${enable_documentation:-yes}
bindir ?= ${bindir:-${prefix}/bin}
KMOD_CFLAGS ?= $(${PKG_CONFIG} --cflags " libkmod >= 23 ")
KMOD_LIBS ?= $(${PKG_CONFIG} --libs " libkmod >= 23 ")
EOF
{
[[ $programprefix ]] && echo "programprefix ?= ${programprefix}"
[[ $execprefix ]] && echo "execprefix ?= ${execprefix}"
[[ $includedir ]] && echo "includedir ?= ${includedir}"
[[ $libexecdir ]] && echo "libexecdir ?= ${libexecdir}"
[[ $localstatedir ]] && echo "localstatedir ?= ${localstatedir}"
[[ $sharedstatedir ]] && echo "sharedstatedir ?= ${sharedstatedir}"
[[ $infodir ]] && echo "infodir ?= ${infodir}"
[[ $systemdsystemunitdir ]] && echo "systemdsystemunitdir ?= ${systemdsystemunitdir}"
[[ $bashcompletiondir ]] && echo "bashcompletiondir ?= ${bashcompletiondir}"
} >> Makefile.inc.$$
mv Makefile.inc.$$ Makefile.inc

246
dracut
View File

@@ -1,246 +0,0 @@
#!/bin/bash
#
# Generator script for a dracut initramfs
# Tries to retain some degree of compatibility with the command line
# of the various mkinitrd implementations out there
#
# Copyright 2005-2009 Red Hat, Inc. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
usage() {
# 80x25 linebreak here ^
echo "Usage: $0 [OPTION]... <initramfs> <kernel-version>
Creates initial ramdisk images for preloading modules
-f, --force Overwrite existing initramfs file.
-m, --modules [LIST] Specify a space-separated list of dracut modules to
call when building the initramfs. Modules are located
in /usr/share/dracut/modules.d.
-o, --omit [LIST] Omit a space-separated list of dracut modules.
-a, --add [LIST] Add a space-separated list of dracut modules.
-d, --drivers [LIST] Specify a space-separated list of kernel modules to
include in the initramfs.
-k, --kmoddir [DIR] Specify the directory, where to look for kernel
modules
--fwdir [DIR] Specify additional directories, where to look for
firmwares, separated by :
--kernel-only Only install kernel drivers and firmware files
--no-kernel Do not install kernel drivers and firmware files
--strip Strip binaries in the initramfs (default)
--nostrip Do not strip binaries in the initramfs
-h, --help This message
--debug Output debug information of the build process
-v, --verbose Verbose output during the build process
-c, --conf [FILE] Specify configuration file to use.
Default: /etc/dracut.conf
-l, --local Local mode. Use modules from the current working
directory instead of the system-wide installed in
/usr/share/dracut/modules.d.
Useful when running dracut from a git checkout.
-H, --hostonly Host-Only mode: Install only what is needed for
booting the local host instead of a generic host.
-i, --include [SOURCE] [TARGET]
Include the files in the SOURCE directory into the
Target directory in the final initramfs.
-I, --install [LIST] Install the space separated list of files into the
initramfs.
"
}
while (($# > 0)); do
case $1 in
-f|--force) force=yes;;
-m|--modules) dracutmodules_l="$2"; shift;;
-o|--omit) omit_dracutmodules_l="$2"; shift;;
-a|--add) add_dracutmodules_l="$2"; shift;;
-d|--drivers) drivers_l="$2"; shift;;
-k|--kmoddir) drivers_dir_l="$2"; shift;;
--fwdir) fw_dir_l="$2"; shift;;
--kernel-only) kernel_only="yes"; nokernel="no";;
--no-kernel) kernel_only="no"; no_kernel="yes";;
--strip) do_strip_l="yes";;
--nostrip) do_strip_l="no";;
-h|--help) usage; exit 1 ;;
--debug) debug="yes";;
-v|--verbose) beverbose="yes";;
-c|--conf) conffile="$2"; shift;;
-l|--local) allowlocal="yes" ;;
-H|--hostonly) hostonly="-h" ;;
-i|--include) include_src="$2"; include_target="$3"; shift 2;;
-I|--install) install_items="$2"; shift;;
-*) printf "\nUnknown option: %s\n\n" "$1" >&2; usage; exit 1;;
*) break ;;
esac
shift
done
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
[[ $debug ]] && {
export PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): ';
set -x
}
# if we were not passed a config file, try the default one
[[ ! -f $conffile ]] && conffile="/etc/dracut.conf"
# source our config file
[[ -f $conffile ]] && . "$conffile"
# these options override the stuff in the config file
[[ $dracutmodules_l ]] && dracutmodules=$dracutmodules_l
[[ $omit_dracutmodules_l ]] && omit_dracutmodules=$omit_dracutmodules_l
[[ $add_dracutmodules_l ]] && add_dracutmodules="$add_dracutmodules $add_dracutmodules_l"
[[ $drivers_l ]] && drivers=$drivers_l
[[ $drivers_dir_l ]] && drivers_dir=$drivers_dir_l
[[ $fw_dir_l ]] && fw_dir=$fw_dir_l
[[ $do_strip_l ]] && do_strip=$do_strip_l
[[ $dracutbasedir ]] || dracutbasedir=/usr/share/dracut
[[ $fw_dir ]] || fw_dir=/lib/firmware
[[ $do_strip ]] || do_strip=yes
[[ $allowlocal && -f "$(dirname $0)/dracut-functions" ]] && dsrc="$(dirname $0)" || dsrc=$dracutbasedir
if [[ -f $dsrc/dracut-functions ]]; then
. $dsrc/dracut-functions
else
echo "Cannot find $dsrc/dracut-functions. Are you running from a git checkout?"
echo "Try passing -l as an argument to $0"
exit 1
fi
dracutfunctions=$dsrc/dracut-functions
export dracutfunctions
# This is kinda legacy -- eventually it should go away.
case $dracutmodules in
""|auto) dracutmodules="all" ;;
esac
[[ $2 ]] && kernel=$2 || kernel=$(uname -r)
[[ $1 ]] && outfile=$(readlink -f $1) || outfile="/boot/initrd-$kernel.img"
srcmods="/lib/modules/$kernel/"
[ -n "$drivers_dir" ] && srcmods="$drivers_dir"
export srcmods
if [[ -f $outfile && ! $force ]]; then
echo "Will not override existing initramfs ($outfile) without --force"
exit 1
fi
hookdirs="cmdline pre-udev pre-trigger netroot pre-mount pre-pivot mount emergency"
readonly initdir=$(mktemp -d -t initramfs.XXXXXX)
trap 'rm -rf "$initdir"' 0 # clean up after ourselves no matter how we die.
# Need to be able to have non-root users read stuff (rpcbind etc)
chmod 755 "$initdir"
export initdir hookdirs dsrc dracutmodules drivers \
fw_dir drivers_dir debug beverbose no_kernel kernel_only
if [[ "$kernel_only" != "yes" ]]; then
# Create some directory structure first
for d in bin sbin usr/bin usr/sbin usr/lib etc proc sys sysroot tmp dev/pts var/run; do
mkdir -p "$initdir/$d";
done
fi
# check all our modules to see if they should be sourced.
# This builds a list of modules that we will install next.
check_modules
#source our modules.
for moddir in "$dsrc/modules.d"/[0-9][0-9]*; do
mod=${moddir##*/}; mod=${mod#[0-9][0-9]}
if strstr "$mods_to_load" " $mod "; then
if [[ "$kernel_only" = "yes" ]]; then
[[ -x "$moddir/installkernel" ]] && . "$moddir/installkernel"
else
. "$moddir/install"
if [[ "$no_kernel" != "yes" && -x "$moddir/installkernel" ]]; then
. "$moddir/installkernel"
fi
fi
mods_to_load=${mods_to_load// $mod /}
fi
done
unset moddir
echo $mods_to_load
## final stuff that has to happen
# generate module dependencies for the initrd
if [ -d "$initdir/lib/modules/$kernel" ]; then
if ! depmod -a -b "$initdir" $kernel; then
echo "\"depmod -a $kernel\" failed."
exit 1
fi
fi
# make sure that library links are correct and up to date
ldconfig -n -r "$initdir" /lib* /usr/lib*
if [[ $include_src && $include_target ]]; then
mkdir -p "$initdir$include_target"
cp -a -t "$initdir$include_target" "$include_src"/*
fi
for item in $install_items; do
dracut_install "$item"
done
unset item
[[ "$beverbose" = "yes" ]] && (du -c "$initdir" | sort -n)
# strip binaries
if [ "$do_strip" = "yes" ] ; then
for p in strip objdump sed grep find; do
if ! which $p >/dev/null 2>&1; then
derror "Could not find '$p'. You should run $0 with '--nostrip'."
do_strip=no
fi
done
fi
if [ "$do_strip" = "yes" ] ; then
for f in $(find "$initdir" -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; |
grep -v ' shared object,' |
sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'); do
dinfo "Stripping $f"
strip -g "$f" || :
#
# FIXME: only strip -g for now
#
#strip -g --strip-unneeded "$f" || :
#note="-R .note"
#if objdump -h $f | grep '^[ ]*[0-9]*[ ]*.note[ ]' -A 1 | \
# grep -q ALLOC; then
# note=
#fi
#strip -R .comment $note "$f" || :
done
fi
( cd "$initdir"; find . |cpio -H newc -o |gzip -9 > "$outfile"; )
[[ "$beverbose" = "yes" ]] && ls -lh "$outfile"
exit 0

78
dracut-bash-completion.sh Normal file
View File

@@ -0,0 +1,78 @@
#
# Copyright 2013 Red Hat, Inc. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
__contains_word () {
local word=$1; shift
for w in $*; do [[ $w = $word ]] && return 0; done
return 1
}
_dracut() {
local field_vals= cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
local -A OPTS=(
[STANDALONE]='-f -v -q -l -H -h -M -N
--ro-mnt --force --kernel-only --no-kernel --strip --nostrip
--hardlink --nohardlink --noprefix --mdadmconf --nomdadmconf
--lvmconf --nolvmconf --debug --profile --verbose --quiet
--local --hostonly --no-hostonly --fstab --help --bzip2 --lzma
--xz --zstd --no-compress --gzip --list-modules --show-modules --keep
--printsize --regenerate-all --noimageifnotneeded --early-microcode
--no-early-microcode --print-cmdline --reproducible --uefi'
[ARG]='-a -m -o -d -I -k -c -L --kver --add --force-add --add-drivers
--omit-drivers --modules --omit --drivers --filesystems --install
--fwdir --libdirs --fscks --add-fstab --mount --device --nofscks
--kmoddir --conf --confdir --tmpdir --stdlog --compress --prefix
--kernel-cmdline --sshkey --persistent-policy --install-optional
--loginstall --uefi-stub --kernel-image
'
)
if __contains_word "$prev" ${OPTS[ARG]}; then
case $prev in
--kmoddir|-k|--fwdir|--confdir|--tmpdir)
comps=$(compgen -d -- "$cur")
compopt -o filenames
;;
-c|--conf|--sshkey|--add-fstab|--add-device|-I|--install|--install-optional)
comps=$(compgen -f -- "$cur")
compopt -o filenames
;;
-a|-m|-o|--add|--modules|--omit)
comps=$(dracut --list-modules 2>/dev/null)
;;
--persistent-policy)
comps=$(cd /dev/disk/; echo *)
;;
--kver)
comps=$(cd /lib/modules; echo [0-9]*)
;;
*)
return 0
;;
esac
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
return 0
fi
if [[ $cur = -* ]]; then
COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
return 0
fi
}
complete -F _dracut dracut

59
dracut-catimages.8.asc Normal file
View File

@@ -0,0 +1,59 @@
DRACUT-CATIMAGES(8)
===================
:doctype: manpage
:man source: dracut
:man manual: dracut
NAME
----
dracut-catimages - creates initial ramdisk image by concatenating images
SYNOPSIS
--------
**dracut-catimages** [_OPTION_...] _<initramfs base image>_ [_<image>_...]
DESCRIPTION
-----------
dracut-catimages creates an initial ramdisk image by concatenating several
images from the command line and /boot/dracut/*.img
OPTIONS
-------
**-f, --force**::
overwrite existing initramfs file.
**-i, --imagedir**::
Directory with additional images to add (default: /boot/dracut/)
**-o, --overlaydir**::
Overlay directory, which contains additional files that will be used to
create an additional image
**--nooverlay**:: Do not use the overlay directory
**--noimagedir**:: Do not use the additional image directory
**-h, --help**:: display help text and exit.
**--debug**:: output debug information of the build process
**-v, --verbose**:: verbose output during the build process
FILES
-----
_/boot/dracut/*.img_::
images to work with
AUTHORS
-------
Harald Hoyer
AVAILABILITY
------------
The dracut-catimages command is part of the dracut package and is available from
link:$$https://dracut.wiki.kernel.org$$[https://dracut.wiki.kernel.org]
SEE ALSO
--------
*dracut*(8)

View File

@@ -1,5 +1,5 @@
#!/bin/bash --norc
#
# Copyright 2009 Red Hat, Inc. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
@@ -31,12 +31,13 @@ derror() {
usage() {
# 80x25 linebreak here ^
echo "Usage: $0 [OPTION]... <initramfs> <base image> [<image>...]
cat << EOF
Usage: $0 [OPTION]... <initramfs> <base image> [<image>...]
Creates initial ramdisk image by concatenating several images from the command
line and /boot/dracut/
-f, --force Overwrite existing initramfs file.
-i, --imagedir Directory with additional images to add
-i, --imagedir Directory with additional images to add
(default: /boot/dracut/)
-o, --overlaydir Overlay directory, which contains files that
will be used to create an additional image
@@ -45,7 +46,7 @@ line and /boot/dracut/
-h, --help This message
--debug Output debug information of the build process
-v, --verbose Verbose output during the build process
"
EOF
}
@@ -54,23 +55,23 @@ overlay=/var/lib/dracut/overlay
while (($# > 0)); do
case $1 in
-f|--force) force=yes;;
-i|--imagedir) imagedir=$2;shift;;
-o|--overlaydir) overlay=$2;shift;;
--nooverlay) no_overlay=yes;shift;;
--noimagedir) no_imagedir=yes;shift;;
-h|--help) usage; exit 1 ;;
--debug) debug="yes";;
-v|--verbose) beverbose="yes";;
-*) printf "\nUnknown option: %s\n\n" "$1" >&2; usage; exit 1;;
*) break ;;
-f|--force) force=yes;;
-i|--imagedir) imagedir=$2;shift;;
-o|--overlaydir) overlay=$2;shift;;
--nooverlay) no_overlay=yes;shift;;
--noimagedir) no_imagedir=yes;shift;;
-h|--help) usage; exit 1 ;;
--debug) debug="yes";;
-v|--verbose) beverbose="yes";;
-*) printf "\nUnknown option: %s\n\n" "$1" >&2; usage; exit 1;;
*) break ;;
esac
shift
done
outfile=$1; shift
if [ -z "$outfile" ]; then
if [[ -z $outfile ]]; then
derror "No output file specified."
usage
exit 1
@@ -78,45 +79,48 @@ fi
baseimage=$1; shift
if [ -z "$baseimage" ]; then
if [[ -z $baseimage ]]; then
derror "No base image specified."
usage
exit 1
fi
if [ -f $outfile -a -z "$force" ]; then
if [[ -f $outfile && ! $force ]]; then
derror "Will not override existing initramfs ($outfile) without --force"
exit 1
fi
if [ -z "$no_imagedir" -a ! -d "$imagedir" ]; then
if [[ ! $no_imagedir && ! -d $imagedir ]]; then
derror "Image directory $overlay is not a directory"
exit 1
fi
if [ -z "$no_overlay" -a ! -d "$overlay" ]; then
if [[ ! $no_overlay && ! -d $overlay ]]; then
derror "Overlay $overlay is not a directory"
exit 1
fi
if [ -z "$no_overlay" ]; then
if [[ ! $no_overlay ]]; then
ofile="$imagedir/90-overlay.img"
dinfo "Creating image $ofile from directory $overlay"
( cd "$overlay"; find . |cpio --quiet -H newc -o |gzip -9 > "$ofile"; )
type pigz &>/dev/null && gzip=pigz || gzip=gzip
( cd "$overlay"; find . |cpio --quiet -H newc -o |$gzip -9 > "$ofile"; )
fi
if [ -z "$no_imagedir" ]; then
images=$(for i in $imagedir/*.img;do [ -f $i ] || continue; echo $i; done)
if [[ ! $no_imagedir ]]; then
for i in "$imagedir/"*.img; do
[[ -f $i ]] && images+=("$i")
done
fi
images="$images $@"
images+=($@)
dinfo "Using base image $baseimage"
cat $baseimage > $outfile
cat -- "$baseimage" > "$outfile"
for i in $images; do
for i in "${images[@]}"; do
dinfo "Appending $i"
cat $i >> $outfile
cat -- "$i" >> "$outfile"
done
dinfo "Created $outfile"

View File

@@ -1,345 +0,0 @@
#!/bin/bash
#
# functions used by dracut and other tools.
#
# Copyright 2005-2009 Red Hat, Inc. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
IF_RTLD=""
IF_dynamic=""
# Generic substring function. If $2 is in $1, return 0.
strstr() { [[ ! ${1#*$2*} = $1 ]]; }
# Log initrd creation.
if ! [[ $dracutlogfile ]]; then
[[ $dsrc = /usr/share/dracut ]] && \
dracutlogfile=/var/log/dracut.log || \
dracutlogfile=/tmp/dracut.log
[[ -w "$dracutlogfile" ]] || dracutlogfile=/tmp/dracut.log
>"$dracutlogfile"
fi
dwarning() {
echo "W: $@" >&2
[[ -w "$dracutlogfile" ]] && echo "W: $@" >>"$dracutlogfile"
}
dinfo() {
[[ $beverbose ]] && echo "I: $@" >&2
[[ -w "$dracutlogfile" ]] && echo "I: $@" >>"$dracutlogfile"
}
derror() {
echo "E: $@" >&2
[[ -w "$dracutlogfile" ]] && echo "E: $@" >>"$dracutlogfile"
}
# $1 = file to copy to ramdisk
# $2 (optional) Name for the file on the ramdisk
# Location of the image dir is assumed to be $initdir
# We never overwrite the target if it exists.
inst_simple() {
local src target
[[ -f $1 ]] || return 1
src=$1 target="${initdir}${2:-$1}"
[[ -f $target ]] && return 0
mkdir -p "${target%/*}"
dinfo "Installing $src"
cp -fL "$src" "$target"
}
# Same as above, but specialzed to handle dynamic libraries.
# It handles making symlinks according to how the original library
# is referenced.
inst_library() {
local src=$1 dest=${2:-$1}
[[ -f $initdir$dest ]] && return 0
if [[ -L $src ]]; then
reallib="$(readlink -f "$src")"
lib=${src##*/}
inst_simple "$reallib" "$reallib"
mkdir -p ${initdir}${dest%/*}
(cd "${initdir}${dest%/*}" && ln -s "$reallib" "$lib")
else
inst_simple "$src" "$dest"
fi
}
# find a binary. If we were not passed the full path directly,
# search in the usual places to find the binary.
find_binary() {
local binpath="/bin /sbin /usr/bin /usr/sbin" p
[[ -x $1 ]] && { echo $1; return 0; }
for p in $binpath; do
[[ -x $p/$1 ]] && { echo "$p/$1"; return 0; }
done
return 1
}
# Same as above, but specialized to install binary executables.
# Install binary executable, and all shared library dependencies, if any.
inst_binary() {
local bin target
bin=$(find_binary "$1") || return 1
target=${2:-$bin}
local LDSO NAME IO FILE ADDR I1 n f TLIBDIR
[[ -f $initdir$target ]] && return 0
# I love bash!
ldd $bin 2>/dev/null | while read line; do
[[ $line = 'not a dynamic executable' ]] && return 1
if [[ $line =~ not\ found ]]; then
derror "Missing a shared library required by $bin."
derror "Run \"ldd $bin\" to find out what it is."
derror "dracut cannot create an initrd."
exit 1
fi
so_regex='([^ ]*/lib[^/]*/[^ ]*\.so[^ ]*)'
[[ $line =~ $so_regex ]] || continue
FILE=${BASH_REMATCH[1]}
[[ -f ${initdir}$FILE ]] && continue
# see if we are loading an optimized version of a shared lib.
lib_regex='^(/lib[^/]*).*'
if [[ $FILE =~ $lib_regex ]]; then
TLIBDIR=${BASH_REMATCH[1]}
BASE="${FILE##*/}"
# prefer nosegneg libs, then unoptimized ones.
for f in "$TLIBDIR/i686/nosegneg" "$TLIBDIR"; do
[[ -f $f/$BASE ]] || continue
FILE="$f/$BASE"
break
done
inst_library "$FILE" "$TLIBDIR/$BASE"
IF_dynamic="yes"
continue
fi
inst_library "$FILE"
done
inst_simple "$bin" "$target"
}
# same as above, except for shell scripts.
# If your shell script does not start with shebang, it is not a shell script.
inst_script() {
[[ -f $1 ]] || return 1
local line
read -r -n 80 line <"$1"
# If debug is set, clean unprintable chars to prevent messing up the term
[[ $debug ]] && line=$(echo -n "$line" | tr -c -d '[:print:][:space:]')
shebang_regex='(#! *)(/[^ ]+).*'
[[ $line =~ $shebang_regex ]] || return 1
inst "${BASH_REMATCH[2]}" && inst_simple "$@"
}
# same as above, but specialized for symlinks
inst_symlink() {
local src=$1 target=$initdir${2:-$1} realsrc
[[ -L $1 ]] || return 1
[[ -L $target ]] && return 0
realsrc=$(readlink -f "$src")
[[ $realsrc = ${realsrc##*/} ]] && realsrc="${src%/*}/$realsrc"
inst "$realsrc" && ln -s "$realsrc" "$target"
}
# find a rule in the usual places.
find_rule() {
[[ -f $1 ]] && { echo "$1"; return 0; }
for r in . /lib/udev/rules.d /etc/udev/rules.d $dsrc/rules.d; do
[[ -f $r/$1 ]] && { echo "$r/$1"; return 0; }
done
return 1
}
# udev rules always get installed in the same place, so
# create a function to install them to make life simpler.
inst_rules() {
local target="/etc/udev/rules.d"
mkdir -p "$initdir/lib/udev/rules.d" "$initdir$target"
for rule in "$@"; do
rule=$(find_rule $rule) && \
inst_simple "$rule" "$target/${rule##*/}"
done
}
# general purpose installation function
# Same args as above.
inst() {
if (($# != 1 && $# != 2 )); then
derror "inst only takes 1 or 2 arguments"
exit 1
fi
for x in inst_symlink inst_script inst_binary inst_simple; do
$x "$@" && return 0
done
return 1
}
# install function specialized for hooks
# $1 = type of hook, $2 = hook priority (lower runs first), $3 = hook
# All hooks should be POSIX/SuS compliant, they will be sourced by init.
inst_hook() {
if ! [[ -f $3 ]]; then
derror "Cannot install a hook ($3) that does not exist."
derror "Aborting initrd creation."
exit 1
elif ! strstr "$hookdirs" "$1"; then
derror "No such hook type $1. Aborting initrd creation."
exit 1
fi
inst_simple "$3" "/${1}/${2}${3##*/}"
}
dracut_install() {
local optional=
while (($# > 0)); do
# Might be nice to optionally install a binary
if [ "$1" == "-o" ]; then
optional="yes"
shift
continue
fi
if inst "$1" ; then
shift
continue
fi
if [ "$optional" == "yes" ]; then
dwarning "Skipping program $1 as it cannot be found and is flagged to be optional"
shift
continue
else
derror "Failed to install $1"; exit 1
fi
done
}
check_module_deps() {
local moddir dep ret
# if we are already set to be loaded, we do not have to be checked again.
strstr "$mods_to_load" " $1 "
# turn a module name into a directory, if we can.
moddir=$(echo ${dsrc}/modules.d/??${1})
[[ -d $moddir && -x $moddir/install ]] || return 1
# if we do not have a check script, we are unconditionally included
if [[ -x $moddir/check ]]; then
"$moddir/check"
ret=$?
# a return value of 255 = load module only as a dependency.
((ret==0||ret==255)) || return 1
for dep in $("$moddir/check" -d); do
check_module_deps "$dep" && continue
dwarning "Dependency $mod failed."
return 1
done
fi
mods_to_load+=" $1 "
}
should_source_module() {
local dep
[[ -x $1/install ]] || return 1
if [[ "$kernel_only" = "yes" ]]; then
[[ -x $1/installkernel ]] && return 0
return 1
fi
[[ -x $1/check ]] || return 0
"$1/check" $hostonly || return 1
for dep in $("$1/check" -d); do
check_module_deps "$dep" && continue
dwarning "Cannot load $mod, dependencies failed."
return 1
done
}
check_modules() {
for moddir in "$dsrc/modules.d"/[0-9][0-9]*; do
local mod=${moddir##*/}; mod=${mod#[0-9][0-9]}
# If we are already scheduled to be loaded, no need to check again.
strstr "$mods_to_load" " $mod " && continue
# This should never happen, but...
[[ -d $moddir ]] || continue
[[ $dracutmodules != all ]] && ! strstr "$dracutmodules" "$mod" && \
continue
strstr "$omit_dracutmodules" "$mod" && continue
if ! strstr "$add_dracutmodules" "$mod"; then
should_source_module "$moddir" || continue
fi
mods_to_load+=" $mod "
done
}
# install kernel modules, and handle installing all their dependencies as well.
instmods() {
[[ "$no_kernel" = "yes" ]] && return
local mod mpargs modpath modname cmd
while (($# > 0)); do
mod=${1%.ko}
case $mod in
=*) # This introduces 2 incompatible meanings for =* arguments
# to instmods. We need to decide which one to keep.
if [ "$mod" = "=ata" -a -f $srcmods/modules.block ] ; then
instmods $mpargs $(egrep 'ata|ahci' "${srcmods}/modules.block")
elif [ -f $srcmods/modules.${mod#=} ]; then
instmods $mpargs $(cat ${srcmods}/modules.${mod#=} )
else
instmods $mpargs $(find "$srcmods" -path "*/${mod#=}/*")
fi
;;
--*) mpargs+=" $mod";;
i2o_scsi)
# Must never run this diagnostic-only module
shift; continue;
;;
*) mod=${mod##*/}
# if we are already installed, skip this module and go on
# to the next one.
[[ -f $initdir/$1 ]] && { shift; continue; }
# If we are building a host-specific initramfs and this
# module is not already loaded, move on to the next one.
[[ $hostonly ]] && ! grep -q "$mod" /proc/modules && {
shift; continue;
}
modprobe $mpargs --ignore-install --set-version $kernel -d ${srcmods%%/lib/modules/*}/ \
--show-depends $mod 2>/dev/null | \
while read cmd modpath options; do
[[ $cmd = insmod ]] || continue
modname=${modpath##*/}
modname=${modname%.ko}
if [[ ${mod/-/_} != ${modname/-/_} ]]; then
dinfo "Installing dependencies for $mod ($modpath)"
instmods $mpargs $modname
fi
inst_simple "$modpath" "/lib/modules/$kernel/${modpath##*/lib/modules/$kernel/}"
for fw in $(modinfo -k $kernel -F firmware $modpath 2>/dev/null); do
unset found
IFS=:
for fwdir in $fw_dir; do
if [ -d "$fwdir" -a -f $fwdir/$fw ]; then
inst_simple "$fwdir/$fw" "/lib/firmware/$fw"
found=yes
fi
done
if [ "$found" != "yes" ]; then
dwarning "Possible missing firmware ${fw} for module ${mod}.ko"
fi
done
done
;;
esac
shift
done
}
# vim:ts=8:sw=4:sts=4:et

709
dracut-functions.sh Executable file
View File

@@ -0,0 +1,709 @@
#!/bin/bash
#
# functions used by dracut and other tools.
#
# Copyright 2005-2009 Red Hat, Inc. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
export LC_MESSAGES=C
# is_func <command>
# Check whether $1 is a function.
is_func() {
[[ "$(type -t "$1")" = "function" ]]
}
# Generic substring function. If $2 is in $1, return 0.
strstr() { [[ $1 = *"$2"* ]]; }
# Generic glob matching function. If glob pattern $2 matches anywhere in $1, OK
strglobin() { [[ $1 = *$2* ]]; }
# Generic glob matching function. If glob pattern $2 matches all of $1, OK
strglob() { [[ $1 = $2 ]]; }
# returns OK if $1 contains literal string $2 at the beginning, and isn't empty
str_starts() { [ "${1#"$2"*}" != "$1" ]; }
# returns OK if $1 contains literal string $2 at the end, and isn't empty
str_ends() { [ "${1%*"$2"}" != "$1" ]; }
# find a binary. If we were not passed the full path directly,
# search in the usual places to find the binary.
find_binary() {
if [[ -z ${1##/*} ]]; then
if [[ -x $1 ]] || { [[ "$1" == *.so* ]] && ldd "$1" &>/dev/null; }; then
printf "%s\n" "$1"
return 0
fi
fi
type -P "${1##*/}"
}
ldconfig_paths()
{
ldconfig -pN 2>/dev/null | grep -E -v '/(lib|lib64|usr/lib|usr/lib64)/[^/]*$' | sed -n 's,.* => \(.*\)/.*,\1,p' | sort | uniq
}
# Version comparision function. Assumes Linux style version scheme.
# $1 = version a
# $2 = comparision op (gt, ge, eq, le, lt, ne)
# $3 = version b
vercmp() {
local _n1=(${1//./ }) _op=$2 _n2=(${3//./ }) _i _res
for ((_i=0; ; _i++))
do
if [[ ! ${_n1[_i]}${_n2[_i]} ]]; then _res=0
elif ((${_n1[_i]:-0} > ${_n2[_i]:-0})); then _res=1
elif ((${_n1[_i]:-0} < ${_n2[_i]:-0})); then _res=2
else continue
fi
break
done
case $_op in
gt) ((_res == 1));;
ge) ((_res != 2));;
eq) ((_res == 0));;
le) ((_res != 1));;
lt) ((_res == 2));;
ne) ((_res != 0));;
esac
}
# Create all subdirectories for given path without creating the last element.
# $1 = path
mksubdirs() {
[[ -e ${1%/*} ]] || mkdir -m 0755 -p -- "${1%/*}"
}
# Function prints global variables in format name=value line by line.
# $@ = list of global variables' name
print_vars() {
local _var _value
for _var in "$@"
do
eval printf -v _value "%s" \""\$$_var"\"
[[ ${_value} ]] && printf '%s="%s"\n' "$_var" "$_value"
done
}
# normalize_path <path>
# Prints the normalized path, where it removes any duplicated
# and trailing slashes.
# Example:
# $ normalize_path ///test/test//
# /test/test
normalize_path() {
shopt -q -s extglob
set -- "${1//+(\/)//}"
shopt -q -u extglob
printf "%s\n" "${1%/}"
}
# convert_abs_rel <from> <to>
# Prints the relative path, when creating a symlink to <to> from <from>.
# Example:
# $ convert_abs_rel /usr/bin/test /bin/test-2
# ../../bin/test-2
# $ ln -s $(convert_abs_rel /usr/bin/test /bin/test-2) /usr/bin/test
convert_abs_rel() {
local __current __absolute __abssize __cursize __newpath
local -i __i __level
set -- "$(normalize_path "$1")" "$(normalize_path "$2")"
# corner case #1 - self looping link
[[ "$1" == "$2" ]] && { printf "%s\n" "${1##*/}"; return; }
# corner case #2 - own dir link
[[ "${1%/*}" == "$2" ]] && { printf ".\n"; return; }
IFS="/" __current=($1)
IFS="/" __absolute=($2)
__abssize=${#__absolute[@]}
__cursize=${#__current[@]}
while [[ "${__absolute[__level]}" == "${__current[__level]}" ]]
do
(( __level++ ))
if (( __level > __abssize || __level > __cursize ))
then
break
fi
done
for ((__i = __level; __i < __cursize-1; __i++))
do
if ((__i > __level))
then
__newpath=$__newpath"/"
fi
__newpath=$__newpath".."
done
for ((__i = __level; __i < __abssize; __i++))
do
if [[ -n $__newpath ]]
then
__newpath=$__newpath"/"
fi
__newpath=$__newpath${__absolute[__i]}
done
printf "%s\n" "$__newpath"
}
# get_fs_env <device>
# Get and the ID_FS_TYPE variable from udev for a device.
# Example:
# $ get_fs_env /dev/sda2
# ext4
get_fs_env() {
local evalstr
local found
[[ $1 ]] || return
unset ID_FS_TYPE
ID_FS_TYPE=$(blkid -u filesystem -o export -- "$1" \
| while read line || [ -n "$line" ]; do
if [[ "$line" == TYPE\=* ]]; then
printf "%s" "${line#TYPE=}";
exit 0;
fi
done)
if [[ $ID_FS_TYPE ]]; then
printf "%s" "$ID_FS_TYPE"
return 0
fi
return 1
}
# get_maj_min <device>
# Prints the major and minor of a device node.
# Example:
# $ get_maj_min /dev/sda2
# 8:2
get_maj_min() {
local _maj _min _majmin
_majmin="$(stat -L -c '%t:%T' "$1" 2>/dev/null)"
printf "%s" "$((0x${_majmin%:*})):$((0x${_majmin#*:}))"
}
# get_devpath_block <device>
# get the DEVPATH in /sys of a block device
get_devpath_block() {
local _majmin _i
_majmin=$(get_maj_min "$1")
for _i in /sys/block/*/dev /sys/block/*/*/dev; do
[[ -e "$_i" ]] || continue
if [[ "$_majmin" == "$(<"$_i")" ]]; then
printf "%s" "${_i%/dev}"
return 0
fi
done
return 1
}
# get a persistent path from a device
get_persistent_dev() {
local i _tmp _dev _pol
_dev=$(get_maj_min "$1")
[ -z "$_dev" ] && return
if [[ -n "$persistent_policy" ]]; then
_pol="/dev/disk/${persistent_policy}/*"
else
_pol=
fi
for i in \
$_pol \
/dev/mapper/* \
/dev/disk/by-uuid/* \
/dev/disk/by-label/* \
/dev/disk/by-partuuid/* \
/dev/disk/by-partlabel/* \
/dev/disk/by-id/* \
/dev/disk/by-path/* \
; do
[[ -e "$i" ]] || continue
[[ $i == /dev/mapper/control ]] && continue
[[ $i == /dev/mapper/mpath* ]] && continue
_tmp=$(get_maj_min "$i")
if [ "$_tmp" = "$_dev" ]; then
printf -- "%s" "$i"
return
fi
done
printf -- "%s" "$1"
}
expand_persistent_dev() {
local _dev=$1
case "$_dev" in
LABEL=*)
_dev="/dev/disk/by-label/${_dev#LABEL=}"
;;
UUID=*)
_dev="${_dev#UUID=}"
_dev="${_dev,,}"
_dev="/dev/disk/by-uuid/${_dev}"
;;
PARTUUID=*)
_dev="${_dev#PARTUUID=}"
_dev="${_dev,,}"
_dev="/dev/disk/by-partuuid/${_dev}"
;;
PARTLABEL=*)
_dev="/dev/disk/by-partlabel/${_dev#PARTLABEL=}"
;;
esac
printf "%s" "$_dev"
}
shorten_persistent_dev() {
local _dev="$1"
case "$_dev" in
/dev/disk/by-uuid/*)
printf "%s" "UUID=${_dev##*/}";;
/dev/disk/by-label/*)
printf "%s" "LABEL=${_dev##*/}";;
/dev/disk/by-partuuid/*)
printf "%s" "PARTUUID=${_dev##*/}";;
/dev/disk/by-partlabel/*)
printf "%s" "PARTLABEL=${_dev##*/}";;
*)
printf "%s" "$_dev";;
esac
}
# find_block_device <mountpoint>
# Prints the major and minor number of the block device
# for a given mountpoint.
# Unless $use_fstab is set to "yes" the functions
# uses /proc/self/mountinfo as the primary source of the
# information and only falls back to /etc/fstab, if the mountpoint
# is not found there.
# Example:
# $ find_block_device /usr
# 8:4
find_block_device() {
local _dev _majmin _find_mpt
_find_mpt="$1"
if [[ $use_fstab != yes ]]; then
[[ -d $_find_mpt/. ]]
findmnt -e -v -n -o 'MAJ:MIN,SOURCE' --target "$_find_mpt" | { \
while read _majmin _dev || [ -n "$_dev" ]; do
if [[ -b $_dev ]]; then
if ! [[ $_majmin ]] || [[ $_majmin == 0:* ]]; then
_majmin=$(get_maj_min $_dev)
fi
if [[ $_majmin ]]; then
printf "%s\n" "$_majmin"
else
printf "%s\n" "$_dev"
fi
return 0
fi
if [[ $_dev = *:* ]]; then
printf "%s\n" "$_dev"
return 0
fi
done; return 1; } && return 0
fi
# fall back to /etc/fstab
findmnt -e --fstab -v -n -o 'MAJ:MIN,SOURCE' --target "$_find_mpt" | { \
while read _majmin _dev || [ -n "$_dev" ]; do
if ! [[ $_dev ]]; then
_dev="$_majmin"
unset _majmin
fi
if [[ -b $_dev ]]; then
[[ $_majmin ]] || _majmin=$(get_maj_min $_dev)
if [[ $_majmin ]]; then
printf "%s\n" "$_majmin"
else
printf "%s\n" "$_dev"
fi
return 0
fi
if [[ $_dev = *:* ]]; then
printf "%s\n" "$_dev"
return 0
fi
done; return 1; } && return 0
return 1
}
# find_mp_fstype <mountpoint>
# Echo the filesystem type for a given mountpoint.
# /proc/self/mountinfo is taken as the primary source of information
# and /etc/fstab is used as a fallback.
# No newline is appended!
# Example:
# $ find_mp_fstype /;echo
# ext4
find_mp_fstype() {
local _fs
if [[ $use_fstab != yes ]]; then
findmnt -e -v -n -o 'FSTYPE' --target "$1" | { \
while read _fs || [ -n "$_fs" ]; do
[[ $_fs ]] || continue
[[ $_fs = "autofs" ]] && continue
printf "%s" "$_fs"
return 0
done; return 1; } && return 0
fi
findmnt --fstab -e -v -n -o 'FSTYPE' --target "$1" | { \
while read _fs || [ -n "$_fs" ]; do
[[ $_fs ]] || continue
[[ $_fs = "autofs" ]] && continue
printf "%s" "$_fs"
return 0
done; return 1; } && return 0
return 1
}
# find_dev_fstype <device>
# Echo the filesystem type for a given device.
# /proc/self/mountinfo is taken as the primary source of information
# and /etc/fstab is used as a fallback.
# No newline is appended!
# Example:
# $ find_dev_fstype /dev/sda2;echo
# ext4
find_dev_fstype() {
local _find_dev _fs
_find_dev="$1"
if ! [[ "$_find_dev" = /dev* ]]; then
[[ -b "/dev/block/$_find_dev" ]] && _find_dev="/dev/block/$_find_dev"
fi
if [[ $use_fstab != yes ]]; then
findmnt -e -v -n -o 'FSTYPE' --source "$_find_dev" | { \
while read _fs || [ -n "$_fs" ]; do
[[ $_fs ]] || continue
[[ $_fs = "autofs" ]] && continue
printf "%s" "$_fs"
return 0
done; return 1; } && return 0
fi
findmnt --fstab -e -v -n -o 'FSTYPE' --source "$_find_dev" | { \
while read _fs || [ -n "$_fs" ]; do
[[ $_fs ]] || continue
[[ $_fs = "autofs" ]] && continue
printf "%s" "$_fs"
return 0
done; return 1; } && return 0
return 1
}
# find_mp_fsopts <mountpoint>
# Echo the filesystem options for a given mountpoint.
# /proc/self/mountinfo is taken as the primary source of information
# and /etc/fstab is used as a fallback.
# No newline is appended!
# Example:
# $ find_mp_fsopts /;echo
# rw,relatime,discard,data=ordered
find_mp_fsopts() {
if [[ $use_fstab != yes ]]; then
findmnt -e -v -n -o 'OPTIONS' --target "$1" 2>/dev/null && return 0
fi
findmnt --fstab -e -v -n -o 'OPTIONS' --target "$1"
}
# find_dev_fsopts <device>
# Echo the filesystem options for a given device.
# /proc/self/mountinfo is taken as the primary source of information
# and /etc/fstab is used as a fallback.
# Example:
# $ find_dev_fsopts /dev/sda2
# rw,relatime,discard,data=ordered
find_dev_fsopts() {
local _find_dev _opts
_find_dev="$1"
if ! [[ "$_find_dev" = /dev* ]]; then
[[ -b "/dev/block/$_find_dev" ]] && _find_dev="/dev/block/$_find_dev"
fi
if [[ $use_fstab != yes ]]; then
findmnt -e -v -n -o 'OPTIONS' --source "$_find_dev" 2>/dev/null && return 0
fi
findmnt --fstab -e -v -n -o 'OPTIONS' --source "$_find_dev"
}
# finds the major:minor of the block device backing the root filesystem.
find_root_block_device() { find_block_device /; }
# for_each_host_dev_fs <func>
# Execute "<func> <dev> <filesystem>" for every "<dev> <fs>" pair found
# in ${host_fs_types[@]}
for_each_host_dev_fs()
{
local _func="$1"
local _dev
local _ret=1
[[ "${#host_fs_types[@]}" ]] || return 2
for _dev in "${!host_fs_types[@]}"; do
$_func "$_dev" "${host_fs_types[$_dev]}" && _ret=0
done
return $_ret
}
host_fs_all()
{
printf "%s\n" "${host_fs_types[@]}"
}
# Walk all the slave relationships for a given block device.
# Stop when our helper function returns success
# $1 = function to call on every found block device
# $2 = block device in major:minor format
check_block_and_slaves() {
local _x
[[ -b /dev/block/$2 ]] || return 1 # Not a block device? So sorry.
if ! lvm_internal_dev $2; then "$1" $2 && return; fi
check_vol_slaves "$@" && return 0
if [[ -f /sys/dev/block/$2/../dev ]] && [[ /sys/dev/block/$2/../subsystem -ef /sys/class/block ]]; then
check_block_and_slaves $1 $(<"/sys/dev/block/$2/../dev") && return 0
fi
[[ -d /sys/dev/block/$2/slaves ]] || return 1
for _x in /sys/dev/block/$2/slaves/*; do
[[ -f $_x/dev ]] || continue
[[ $_x/subsystem -ef /sys/class/block ]] || continue
check_block_and_slaves $1 $(<"$_x/dev") && return 0
done
return 1
}
check_block_and_slaves_all() {
local _x _ret=1
[[ -b /dev/block/$2 ]] || return 1 # Not a block device? So sorry.
if ! lvm_internal_dev $2 && "$1" $2; then
_ret=0
fi
check_vol_slaves_all "$@" && return 0
if [[ -f /sys/dev/block/$2/../dev ]] && [[ /sys/dev/block/$2/../subsystem -ef /sys/class/block ]]; then
check_block_and_slaves_all $1 $(<"/sys/dev/block/$2/../dev") && _ret=0
fi
[[ -d /sys/dev/block/$2/slaves ]] || return 1
for _x in /sys/dev/block/$2/slaves/*; do
[[ -f $_x/dev ]] || continue
[[ $_x/subsystem -ef /sys/class/block ]] || continue
check_block_and_slaves_all $1 $(<"$_x/dev") && _ret=0
done
return $_ret
}
# for_each_host_dev_and_slaves <func>
# Execute "<func> <dev>" for every "<dev>" found
# in ${host_devs[@]} and their slaves
for_each_host_dev_and_slaves_all()
{
local _func="$1"
local _dev
local _ret=1
[[ "${host_devs[@]}" ]] || return 2
for _dev in "${host_devs[@]}"; do
[[ -b "$_dev" ]] || continue
if check_block_and_slaves_all $_func $(get_maj_min $_dev); then
_ret=0
fi
done
return $_ret
}
for_each_host_dev_and_slaves()
{
local _func="$1"
local _dev
[[ "${host_devs[@]}" ]] || return 2
for _dev in "${host_devs[@]}"; do
[[ -b "$_dev" ]] || continue
check_block_and_slaves $_func $(get_maj_min $_dev) && return 0
done
return 1
}
# ugly workaround for the lvm design
# There is no volume group device,
# so, there are no slave devices for volume groups.
# Logical volumes only have the slave devices they really live on,
# but you cannot create the logical volume without the volume group.
# And the volume group might be bigger than the devices the LV needs.
check_vol_slaves() {
local _lv _vg _pv _dm _majmin
_majmin="$2"
_lv="/dev/block/$_majmin"
_dm=/sys/dev/block/$_majmin/dm
[[ -f $_dm/uuid && $(<$_dm/uuid) =~ LVM-* ]] || return 1
_vg=$(dmsetup splitname --noheadings -o vg_name $(<"$_dm/name") )
# strip space
_vg="${_vg//[[:space:]]/}"
if [[ $_vg ]]; then
for _pv in $(lvm vgs --noheadings -o pv_name "$_vg" 2>/dev/null)
do
check_block_and_slaves $1 $(get_maj_min $_pv) && return 0
done
fi
return 1
}
check_vol_slaves_all() {
local _lv _vg _pv _majmin
_majmin="$2"
_lv="/dev/block/$_majmin"
_dm="/sys/dev/block/$_majmin/dm"
[[ -f $_dm/uuid && $(<$_dm/uuid) =~ LVM-* ]] || return 1
_vg=$(dmsetup splitname --noheadings -o vg_name $(<"$_dm/name") )
# strip space
_vg="${_vg//[[:space:]]/}"
if [[ $_vg ]]; then
for _pv in $(lvm vgs --noheadings -o pv_name "$_vg" 2>/dev/null)
do
check_block_and_slaves_all $1 $(get_maj_min $_pv)
done
return 0
fi
return 1
}
# fs_get_option <filesystem options> <search for option>
# search for a specific option in a bunch of filesystem options
# and return the value
fs_get_option() {
local _fsopts=$1
local _option=$2
local OLDIFS="$IFS"
IFS=,
set -- $_fsopts
IFS="$OLDIFS"
while [ $# -gt 0 ]; do
case $1 in
$_option=*)
echo ${1#${_option}=}
break
esac
shift
done
}
check_kernel_config()
{
local _config_opt="$1"
local _config_file
[[ -f /boot/config-$kernel ]] \
&& _config_file="/boot/config-$kernel"
[[ -f /lib/modules/$kernel/config ]] \
&& _config_file="/lib/modules/$kernel/config"
# no kernel config file, so return true
[[ $_config_file ]] || return 0
grep -q -F "${_config_opt}=" "$_config_file" && return 0
return 1
}
# get_cpu_vendor
# Only two values are returned: AMD or Intel
get_cpu_vendor ()
{
if grep -qE AMD /proc/cpuinfo; then
printf "AMD"
fi
if grep -qE Intel /proc/cpuinfo; then
printf "Intel"
fi
}
# get_host_ucode
# Get the hosts' ucode file based on the /proc/cpuinfo
get_ucode_file ()
{
local family=`grep -E "cpu family" /proc/cpuinfo | head -1 | sed s/.*:\ //`
local model=`grep -E "model" /proc/cpuinfo |grep -v name | head -1 | sed s/.*:\ //`
local stepping=`grep -E "stepping" /proc/cpuinfo | head -1 | sed s/.*:\ //`
if [[ "$(get_cpu_vendor)" == "AMD" ]]; then
if [[ $family -ge 21 ]]; then
printf "microcode_amd_fam%xh.bin" $family
else
printf "microcode_amd.bin"
fi
fi
if [[ "$(get_cpu_vendor)" == "Intel" ]]; then
# The /proc/cpuinfo are in decimal.
printf "%02x-%02x-%02x" ${family} ${model} ${stepping}
fi
}
# Get currently loaded modules
# sorted, and delimited by newline
get_loaded_kernel_modules ()
{
local modules=( )
while read _module _size _used _used_by; do
modules+=( "$_module" )
done <<< "$(lsmod | sed -n '1!p')"
printf '%s\n' "${modules[@]}" | sort
}
# Not every device in /dev/mapper should be examined.
# If it is an LVM device, touch only devices which have /dev/VG/LV symlink.
lvm_internal_dev() {
local dev_dm_dir=/sys/dev/block/$1/dm
[[ ! -f $dev_dm_dir/uuid || $(<$dev_dm_dir/uuid) != LVM-* ]] && return 1 # Not an LVM device
local DM_VG_NAME DM_LV_NAME DM_LV_LAYER
eval $(dmsetup splitname --nameprefixes --noheadings --rows "$(<$dev_dm_dir/name)" 2>/dev/null)
[[ ${DM_VG_NAME} ]] && [[ ${DM_LV_NAME} ]] || return 0 # Better skip this!
[[ ${DM_LV_LAYER} ]] || [[ ! -L /dev/${DM_VG_NAME}/${DM_LV_NAME} ]]
}
btrfs_devs() {
local _mp="$1"
btrfs device usage "$_mp" \
| while read _dev _rest; do
str_starts "$_dev" "/" || continue
_dev=${_dev%,}
printf -- "%s\n" "$_dev"
done
}

View File

@@ -1,699 +0,0 @@
#!/bin/bash --norc
#
# Copyright 2005-2009 Red Hat, Inc. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# code taken from mkinitrd
#
#. /usr/libexec/initrd-functions
function error() {
local NONL=""
if [ "$1" == "-n" ]; then
NONL="-n"
shift
fi
echo $NONL "$@" >&2
}
function vecho() {
return
local NONL=""
if [ "$1" == "-n" ]; then
NONL="-n"
shift
fi
is_verbose && echo $NONL "$@"
}
# module dep finding and installation functions
moduledep() {
MPARGS=""
if [ "$1" == "--ignore-install" ]; then
MPARGS="$MPARGS --ignore-install"
shift
fi
vecho -n "Looking for deps of module $1"
deps=""
deps=$(modprobe $MPARGS --set-version $kernel --show-depends $1 2>/dev/null| awk '/^insmod / { print gensub(".*/","","g",$2) }' | while read foo ; do [ "${foo%%.ko}" != "$1" ] && echo -n "${foo%%.ko} " ; done)
[ -n "$deps" ] && vecho ": $deps" || vecho
}
if [ $UID != 0 ]; then
error "$0 must be run as root."
exit 1
fi
export MALLOC_PERTURB_=204
PATH=/sbin:/usr/sbin:/bin:/usr/bin:$PATH
export PATH
. /etc/rc.d/init.d/functions
# Set the umask. For iscsi, the initrd can contain plaintext
# password (chap secret), so only allow read by owner.
umask 077
VERSION=6.0.87
PROBE="yes"
MODULES=""
GRAPHICSMODS=""
PREMODS=""
DMRAIDS=""
ncryptodevs=0
ncryptoparts=0
ncryptolvs=0
ncryptoraids=0
root=""
scsi_wait_scan="no"
NET_LIST=""
LD_SO_CONF=/etc/ld.so.conf
LD_SO_CONF_D=/etc/ld.so.conf.d/
[ -e /etc/sysconfig/mkinitrd ] && . /etc/sysconfig/mkinitrd
CONFMODS="$MODULES"
MODULES=""
ARCH=$(uname -m | sed -e 's/s390x/s390/')
compress=1
allowmissing=""
target=""
kernel=""
force=""
img_vers=""
builtins=""
modulefile=/etc/modules.conf
[ "$ARCH" != "s390" ] && withusb=1
rc=0
nolvm=""
nodmraid=""
IMAGESIZE=8000
PRESCSIMODS=""
fstab="/etc/fstab"
vg_list=""
net_list="$NET_LIST"
usage () {
if [ "$1" == "-n" ]; then
cmd=echo
else
cmd=error
fi
$cmd "usage: `basename $0` [--version] [--help] [-v] [-f]"
if [ "$1" == "-n" ]; then
exit 0
else
exit 1
fi
}
qpushd() {
pushd "$1" >/dev/null 2>&1
}
qpopd() {
popd >/dev/null 2>&1
}
resolve_device_name() {
echo "$1"
# echo "resolve_device_name $1" 1>&2
}
freadlink() {
/usr/bin/readlink -f "$1"
}
finddevnoinsys() {
majmin="$1"
if [ -n "$majmin" ]; then
dev=$(for x in /sys/block/* ; do find $x/ -name dev ; done | while read device ; do \
echo "$majmin" | cmp -s $device && echo $device ; done)
if [ -n "$dev" ]; then
dev=${dev%%/dev}
dev=${dev%%/}
echo "$dev"
return 0
fi
fi
return 1
}
finddevicedriverinsys () {
if is_iscsi $PWD; then
handleiscsi "$PWD"
return
fi
while [ "$PWD" != "/sys/devices" ]; do
deps=
if [ -f modalias ]; then
MODALIAS=$(cat modalias)
if [ "${MODALIAS::7}" == "scsi:t-" ]; then
scsi_wait_scan=yes
fi
moduledep $MODALIAS
unset MODALIAS
fi
cd ..
done
}
findstoragedriverinsys () {
local sysfs=$(freadlink "$1")
# if its a partition look at the device holding the partition
if [ -f "$sysfs/start" ]; then
sysfs=$(freadlink ${sysfs%/*})
fi
if [[ ! "$sysfs" =~ '^/sys/.*block/.*$' ]]; then
#error "WARNING: $sysfs is a not a block sysfs path, skipping"
return
fi
case " $handleddevices " in
*" $sysfs "*)
return ;;
*) handleddevices="$handleddevices $sysfs" ;;
esac
if [[ "$sysfs" =~ '^/sys/.*block/md[0-9]+$' ]]; then
local raid=${sysfs##*/}
vecho "Found MDRAID component $raid"
handleraid $raid
fi
if [[ "$sysfs" =~ '^/sys/.*block/dm-[0-9]+$' ]]; then
vecho "Found DeviceMapper component ${sysfs##*/}"
handledm $(cat $sysfs/dev |cut -d : -f 1) $(cat $sysfs/dev |cut -d : -f 2)
fi
for slave in $(ls -d "$sysfs"/slaves/* 2>/dev/null) ; do
findstoragedriverinsys "$slave"
done
if [ -L "$sysfs/device" ]; then
qpushd $(freadlink "$sysfs/device")
finddevicedriverinsys
qpopd
fi
}
findstoragedriver () {
local device="$1"
if [ ! -b "$device" ]; then
#error "WARNING: $device is a not a block device, skipping"
return
fi
local majmin=$(get_numeric_dev dec "$device")
local sysfs=$(finddevnoinsys "$majmin")
if [ -z "$sysfs" ]; then
#error "WARNING: $device major:minor $majmin not found, skipping"
return
fi
vecho "Looking for driver for $device in $sysfs"
findstoragedriverinsys "$sysfs"
}
iscsi_get_rec_val() {
# The open-iscsi 742 release changed to using flat files in
# /var/lib/iscsi.
result=$(grep "^${2} = " "$1" | sed -e s'/.* = //')
}
iscsi_set_parameters() {
path=$1
vecho setting iscsi parameters
tmpfile=$(mktemp)
# Check once before getting explicit values, so we can output a decent
# error message.
/sbin/iscsiadm --show -m session -r $path > $tmpfile
if [ ! -s $tmpfile ]; then
echo Unable to find iscsi record for $path
exit 1
fi
nit_name=$(grep "^InitiatorName=" /etc/iscsi/initiatorname.iscsi | \
sed -e "s/^InitiatorName=//")
iscsi_get_rec_val $tmpfile "node.name"
tgt_name=${result}
iscsi_get_rec_val $tmpfile "node.tpgt"
tpgt=${result}
# iscsistart wants node.conn[0].address / port
iscsi_get_rec_val $tmpfile 'node.conn\[0\].address'
tgt_ipaddr=${result}
iscsi_get_rec_val $tmpfile 'node.conn\[0\].port'
tgt_port=${result}
# Note: we get chap secrets (passwords) in plaintext, and also store
# them in the initrd.
iscsi_get_rec_val $tmpfile "node.session.auth.username"
chap=${result}
if [ -n "${chap}" -a "${chap}" != "<empty>" ]; then
chap="-u ${chap}"
iscsi_get_rec_val $tmpfile "node.session.auth.password"
chap_pw="-w ${result}"
else
chap=""
fi
iscsi_get_rec_val $tmpfile "node.session.auth.username_in"
chap_in=${result}
if [ -n "${chap_in}" -a "${chap_in}" != "<empty>" ]; then
chap_in="-U ${chap_in}"
iscsi_get_rec_val $tmpfile "node.session.auth.password_in"
chap_in_pw="-W ${result}"
else
chap_in=""
fi
rm $tmpfile
}
emit_iscsi () {
if [ -n "${iscsi_devs}" ]; then
for dev in ${iscsi_devs}; do
iscsi_set_parameters $dev
# recid is not really used, just use 0 for it
echo "/bin/iscsistart -t ${tgt_name} -i ${nit_name} \
-g ${tpgt} -a ${tgt_ipaddr} ${chap} ${chap_pw} \
${chap_in} ${chap_in_pw}"
done
fi
}
is_iscsi() {
path=$1
if echo $path | grep -q "/platform/host[0-9]*/session[0-9]*/target[0-9]*:[0-9]*:[0-9]*/[0-9]*:[0-9]*:[0-9]*:[0-9]*"; then
return 0
else
return 1
fi
}
handledm() {
major=$1
minor=$2
while read dmstart dmend dmtype r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 ; do
case "$dmtype" in
crypt)
# this device is encrypted; find the slave device and see
# whether the encryption is LUKS; if not, bail.
slavedev=$(finddevnoinsys $r3)
# get the basename, then s,!,/, in case it's a cciss device
slavedev=$(echo ${slavedev##*/} | tr '!' '/')
cryptsetup isLuks "/dev/$slavedev" 2>/dev/null || continue
find_base_dm_mods
dmname=$(dmsetup info -j $major -m $minor -c --noheadings -o name)
# do the device resolution dance to get /dev/mapper/foo
# since 'lvm lvs' doesn't like dm-X device nodes
if [[ "$slavedev" =~ ^dm- ]]; then
majmin=$(get_numeric_dev dec "/dev/$slavedev")
for dmdev in /dev/mapper/* ; do
dmnum=$(get_numeric_dev dev $dmdev)
if [ $dmnum = $majmin ]; then
slavedev=${dmdev#/dev/}
break
fi
done
fi
# determine if $slavedev is an LV
# if so, add the device to latecryptodevs
# if not, add the device to cryptodevs
local vg=$(lvshow /dev/$slavedev)
if [ -n "$vg" ]; then
eval cryptolv${ncryptolvs}='"'/dev/$slavedev $dmname'"'
let ncryptolvs++
elif grep -q "^$slavedev :" /proc/mdstat ; then
eval cryptoraid${ncryptoraids}='"'/dev/$slavedev $dmname'"'
let ncryptoraids++
else
eval cryptoparts${ncryptoparts}='"'/dev/$slavedev $dmname'"'
let ncryptoparts++
fi
let ncryptodevs++
findstoragedriver "/dev/$slavedev"
;;
esac
done << EOF
$(dmsetup table -j $major -m $minor 2>/dev/null)
EOF
local name=$(dmsetup info --noheadings -c -j $major -m $minor -o name)
local vg=$(lvshow "/dev/mapper/$name")
local raids=$(/sbin/dmraid -s -craidname 2>/dev/null | grep -vi "no raid disks")
if [ -n "$vg" ]; then
vg=`echo $vg` # strip whitespace
case " $vg_list " in
*" $vg "*) ;;
*) vg_list="$vg_list $vg"
[ -z "$nolvm" ] && find_base_dm_mods
;;
esac
fi
for raid in $raids ; do
if [ "$raid" == "$name" ]; then
case " $DMRAIDS " in
*" $raid "*) ;;
*) DMRAIDS="$DMRAIDS $raid"
[ -z "$nodmraid" ] && find_base_dm_mods
;;
esac
break
fi
done
}
handleiscsi() {
vecho "Found iscsi component $1"
# We call iscsi_set_parameters once here to figure out what network to
# use (it sets tgt_ipaddr), and once again to emit iscsi values,
# not very efficient.
iscsi_set_parameters $1
iscsi_devs="$iscsi_devs $1"
netdev=$(/sbin/ip route get to $tgt_ipaddr | \
sed 's|.*dev \(.*\).*|\1|g' | awk '{ print $1; exit }')
addnetdev $netdev
}
handleraid() {
local start=0
if [ -n "$noraid" -o ! -f /proc/mdstat ]; then
return 0
fi
levels=$(awk "/^$1[ ]*:/ { print\$4 }" /proc/mdstat)
for level in $levels ; do
case $level in
linear)
start=1
;;
multipath)
start=1
;;
raid[01] | raid10)
start=1
;;
raid[456])
start=1
;;
*)
error "raid level $level (in /proc/mdstat) not recognized"
;;
esac
done
if [ "$start" = 1 ]; then
raiddevices="$raiddevices $1"
fi
return $start
}
lvshow() {
lvm lvs --ignorelockingfailure --noheadings -o vg_name \
$1 2>/dev/null | egrep -v '^ *(WARNING:|Volume Groups with)'
}
vgdisplay() {
lvm vgdisplay --ignorelockingfailure -v $1 2>/dev/null |
sed -n 's/PV Name//p'
}
dmmods_found="n"
find_base_dm_mods()
{
[ "$dmmods_found" == "n" ] || return
dmmods_found="y"
}
savedargs=$*
while [ $# -gt 0 ]; do
case $1 in
--fstab*)
if [ "$1" != "${1##--fstab=}" ]; then
fstab=${1##--fstab=}
else
fstab=$2
shift
fi
;;
-v|--verbose)
set_verbose true
;;
--net-dev*)
if [ "$1" != "${1##--net-dev=}" ]; then
net_list="$net_list ${1##--net-dev=}"
else
net_list="$net_list $2"
shift
fi
;;
--rootdev*)
if [ "$1" != "${1##--rootdev=}" ]; then
rootdev="${1##--rootdev=}"
else
rootdev="$2"
shift
fi
;;
--thawdev*)
if [ "$1" != "${1##--thawdev=}" ]; then
thawdev="${1##--thawdev=}"
else
thawdev="$2"
shift
fi
;;
--rootfs*)
if [ "$1" != "${1##--rootfs=}" ]; then
rootfs="${1##--rootfs=}"
else
rootfs="$2"
shift
fi
;;
--rootopts*)
if [ "$1" != "${1##--rootopts=}" ]; then
rootopts="${1##--rootopts=}"
else
rootopts="$2"
shift
fi
;;
--root*)
if [ "$1" != "${1##--root=}" ]; then
root="${1##--root=}"
else
root="$2"
shift
fi
;;
--loopdev*)
if [ "$1" != "${1##--loopdev=}" ]; then
loopdev="${1##--loopdev=}"
else
loopdev="$2"
shift
fi
;;
--loopfs*)
if [ "$1" != "${1##--loopfs=}" ]; then
loopfs="${1##--loopfs=}"
else
loopfs="$2"
shift
fi
;;
--loopopts*)
if [ "$1" != "${1##--loopopts=}" ]; then
loopopts="${1##--loopopts=}"
else
loopopts="$2"
shift
fi
;;
--looppath*)
if [ "$1" != "${1##--looppath=}" ]; then
looppath="${1##--looppath=}"
else
looppath="$2"
shift
fi
;;
--help)
usage -n
;;
*)
if [ -z "$target" ]; then
target=$1
elif [ -z "$kernel" ]; then
kernel=$1
else
usage
fi
;;
esac
shift
done
[ -z "$rootfs" ] && rootfs=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $3; }}' $fstab)
[ -z "$rootopts" ] && rootopts=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $4; }}' $fstab)
[ -z "$rootopts" ] && rootopts="defaults"
[ -z "$rootdev" ] && rootdev=$(awk '/^[ \t]*[^#]/ { if ($2 == "/") { print $1; }}' $fstab)
# check if it's nfsroot
physdev=""
if [ "$rootfs" == "nfs" ]; then
if [ "x$net_list" == "x" ]; then
handlenfs $rootdev
fi
else
# check if it's root by label
rdev=$rootdev
if [[ "$rdev" =~ ^(UUID=|LABEL=) ]]; then
rdev=$(resolve_device_name "$rdev")
fi
rootopts=$(echo $rootopts | sed -e 's/^r[ow],//' -e 's/,_netdev//' -e 's/_netdev//' -e 's/,r[ow],$//' -e 's/,r[ow],/,/' -e 's/^r[ow]$/defaults/' -e 's/$/,ro/')
findstoragedriver "$rdev"
fi
# find the first swap dev which would get used for swsusp
[ -z "$thawdev" ] && thawdev=$(awk '/^[ \t]*[^#]/ { if ($3 == "swap") { print $1; exit }}' $fstab)
swsuspdev="$thawdev"
if [ -n "$swsuspdev" ]; then
if [[ "$swsuspdev" =~ ^(UUID=|LABEL=) ]]; then
swsuspdev=$(resolve_device_name "$swsuspdev")
fi
findstoragedriver "$swsuspdev"
fi
cemit()
{
cat
}
emit()
{
NONL=""
if [ "$1" == "-n" ]; then
NONL="-n"
shift
fi
echo $NONL "$@"
}
emitdmraids()
{
if [ -z "$nodmraid" -a -n "$DMRAIDS" ]; then
for raid in $DMRAIDS; do
echo -n "rd_DM_UUID=$raid "
done
fi
}
# HACK: module loading + device creation isn't necessarily synchronous...
# this will make sure that we have all of our devices before trying
# things like RAID or LVM
emitdmraids
emitcrypto()
{
local luksuuid=$(grep "^$2 " /etc/crypttab 2>/dev/null| awk '{ print $2 }')
if [ -z "$luksuuid" ]; then
luksuuid="$2"
fi
echo -n "rd_LUKS_UUID=$luksuuid "
}
for cryptdev in ${!cryptopart@} ; do
emitcrypto `eval echo '$'$cryptdev`
done
if [ -n "$raiddevices" ]; then
for dev in $raiddevices; do
echo -n "rd_MD_UUID=${dev} "
done
fi
for cryptdev in ${!cryptoraid@} ; do
emitcrypto `eval echo '$'$cryptdev`
done
if [ -z "$nolvm" -a -n "$vg_list" ]; then
for vg in $vg_list; do
echo -n "rd_LVM_VG=$vg "
done
fi
for cryptdev in ${!cryptolv@} ; do
emitcrypto `eval echo '$'$cryptdev`
done
# output local keyboard/18n settings
. /etc/sysconfig/keyboard
. /etc/sysconfig/i18n
for i in KEYTABLE SYSFONT SYSFONTACM UNIMAP LANG; do
val=$(eval echo \$$i)
[[ $val ]] && echo -n "$i=$val "
done
if [ -n "$KEYBOARDTYPE" -a "$KEYBOARDTYPE" != "pc" ]; then
echo -n "KEYBOARDTYPE=$KEYBOARDTYPE "
fi
if [ -n "$rootdev" ]; then
echo -n "root=$rootdev "
fi
if [ -L /usr/share/plymouth/themes/default.plymouth ]; then
theme=$(basename \
$(dirname \
$(readlink -f \
/usr/share/plymouth/themes/default.plymouth)))
[ -n "$theme" ] && echo -n "rd_plytheme=$theme "
fi
echo
# vim:ts=8:sw=4:sts=4:et

1047
dracut-init.sh Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,43 @@
#!/bin/bash
set -e
# do some sanity checks first
[ -e /run/initramfs/bin/sh ] && exit 0
[ -e /run/initramfs/.need_shutdown ] || exit 0
KERNEL_VERSION="$(uname -r)"
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
SKIP="$dracutbasedir/skipcpio"
[[ -x $SKIP ]] || SKIP=cat
[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
mount -o ro /boot &>/dev/null || true
if [[ $MACHINE_ID ]] && [[ -d /boot/${MACHINE_ID} || -L /boot/${MACHINE_ID} ]] ; then
IMG="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
fi
[[ -f $IMG ]] || IMG="/boot/initramfs-${KERNEL_VERSION}.img"
cd /run/initramfs
[ -f .need_shutdown -a -f "$IMG" ] || exit 1
if $SKIP "$IMG" | zcat | cpio -id --no-absolute-filenames --quiet >/dev/null; then
rm -f -- .need_shutdown
elif $SKIP "$IMG" | xzcat | cpio -id --no-absolute-filenames --quiet >/dev/null; then
rm -f -- .need_shutdown
elif $SKIP "$IMG" | lz4 -d -c | cpio -id --no-absolute-filenames --quiet >/dev/null; then
rm -f -- .need_shutdown
elif $SKIP "$IMG" | zstd -d -c | cpio -id --no-absolute-filenames --quiet >/dev/null; then
rm -f -- .need_shutdown
else
# something failed, so we clean up
echo "Unpacking of $IMG to /run/initramfs failed" >&2
rm -f -- /run/initramfs/shutdown
exit 1
fi
exit 0

441
dracut-logger.sh Executable file
View File

@@ -0,0 +1,441 @@
#!/bin/bash
#
# logging faciality module for dracut both at build- and boot-time
#
# Copyright 2010 Amadeusz Żołnowski <aidecoe@aidecoe.name>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
__DRACUT_LOGGER__=1
## @brief Logging facility module for dracut both at build- and boot-time.
#
# @section intro Introduction
#
# The logger takes a bit from Log4j philosophy. There are defined 6 logging
# levels:
# - TRACE (6)
# The TRACE Level designates finer-grained informational events than the
# DEBUG.
# - DEBUG (5)
# The DEBUG Level designates fine-grained informational events that are most
# useful to debug an application.
# - INFO (4)
# The INFO level designates informational messages that highlight the
# progress of the application at coarse-grained level.
# - WARN (3)
# The WARN level designates potentially harmful situations.
# - ERROR (2)
# The ERROR level designates error events that might still allow the
# application to continue running.
# - FATAL (1)
# The FATAL level designates very severe error events that will presumably
# lead the application to abort.
# Descriptions are borrowed from Log4j documentation:
# http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html
#
# @section usage Usage
#
# First of all you have to start with dlog_init() function which initializes
# required variables. Don't call any other logging function before that one!
# If you're ready with this, you can use following functions which corresponds
# clearly to levels listed in @ref intro Introduction. Here they are:
# - dtrace()
# - ddebug()
# - dinfo()
# - dwarn()
# - derror()
# - dfatal()
# They take all arguments given as a single message to be logged. See dlog()
# function for details how it works. Note that you shouldn't use dlog() by
# yourself. It's wrapped with above functions.
#
# @see dlog_init() dlog()
#
# @section conf Configuration
#
# Logging is controlled by following global variables:
# - @var stdloglvl - logging level to standard error (console output)
# - @var sysloglvl - logging level to syslog (by logger command)
# - @var fileloglvl - logging level to file
# - @var kmsgloglvl - logging level to /dev/kmsg (only for boot-time)
# - @var logfile - log file which is used when @var fileloglvl is higher
# than 0
# and two global variables: @var maxloglvl and @var syslogfacility which <b>must
# not</b> be overwritten. Both are set by dlog_init(). @var maxloglvl holds
# maximum logging level of those three and indicates that dlog_init() was run.
# @var syslogfacility is set either to 'user' (when building initramfs) or
# 'daemon' (when booting).
#
# Logging level set by the variable means that messages from this logging level
# and above (FATAL is the highest) will be shown. Logging levels may be set
# independently for each destination (stderr, syslog, file, kmsg).
#
# @see dlog_init()
## @brief Initializes dracut Logger.
#
# @retval 1 if something has gone wrong
# @retval 0 on success.
#
# @note This function need to be called before any other from this file.
#
# If any of the variables is not set, this function set it to default:
# - @var stdloglvl = 4 (info)
# - @var sysloglvl = 0 (no logging)
# - @var fileloglvl is set to 4 when @var logfile is set too, otherwise it's
# - @var kmsgloglvl = 0 (no logging)
# set to 0
#
# @warning Function sets global variables @var maxloglvl and @syslogfacility.
# See file doc comment for details.
dlog_init() {
local __oldumask
local ret=0; local errmsg
[ -z "$stdloglvl" ] && stdloglvl=4
[ -z "$sysloglvl" ] && sysloglvl=0
[ -z "$kmsgloglvl" ] && kmsgloglvl=0
# Skip initialization if it's already done.
[ -n "$maxloglvl" ] && return 0
if [ -z "$fileloglvl" ]; then
[ -w "$logfile" ] && fileloglvl=4 || fileloglvl=0
elif (( $fileloglvl > 0 )); then
if [[ $logfile ]]; then
__oldumask=$(umask)
umask 0377
! [ -e "$logfile" ] && >"$logfile"
umask $__oldumask
if [ -w "$logfile" -a -f "$logfile" ]; then
# Mark new run in the log file
echo >>"$logfile"
if command -v date >/dev/null; then
echo "=== $(date) ===" >>"$logfile"
else
echo "===============================================" >>"$logfile"
fi
echo >>"$logfile"
else
# We cannot log to file, so turn this facility off.
fileloglvl=0
ret=1
errmsg="'$logfile' is not a writable file"
fi
fi
fi
if (( $UID != 0 )); then
kmsgloglvl=0
sysloglvl=0
fi
if (( $sysloglvl > 0 )); then
if [[ -d /run/systemd/journal ]] \
&& type -P systemd-cat &>/dev/null \
&& systemctl --quiet is-active systemd-journald.socket &>/dev/null \
&& { echo "dracut-$DRACUT_VERSION" | systemd-cat -t 'dracut' &>/dev/null; } ; then
readonly _systemdcatfile="$DRACUT_TMPDIR/systemd-cat"
mkfifo "$_systemdcatfile"
readonly _dlogfd=15
systemd-cat -t 'dracut' --level-prefix=true <"$_systemdcatfile" &
exec 15>"$_systemdcatfile"
elif ! [ -S /dev/log -a -w /dev/log ] || ! command -v logger >/dev/null; then
# We cannot log to syslog, so turn this facility off.
kmsgloglvl=$sysloglvl
sysloglvl=0
ret=1
errmsg="No '/dev/log' or 'logger' included for syslog logging"
fi
fi
if (($sysloglvl > 0)) || (($kmsgloglvl > 0 )); then
if [ -n "$dracutbasedir" ]; then
readonly syslogfacility=user
else
readonly syslogfacility=daemon
fi
export syslogfacility
fi
local lvl; local maxloglvl_l=0
for lvl in $stdloglvl $sysloglvl $fileloglvl $kmsgloglvl; do
(( $lvl > $maxloglvl_l )) && maxloglvl_l=$lvl
done
readonly maxloglvl=$maxloglvl_l
export maxloglvl
if (($stdloglvl < 6)) && (($kmsgloglvl < 6)) && (($fileloglvl < 6)) && (($sysloglvl < 6)); then
unset dtrace
dtrace() { :; };
fi
if (($stdloglvl < 5)) && (($kmsgloglvl < 5)) && (($fileloglvl < 5)) && (($sysloglvl < 5)); then
unset ddebug
ddebug() { :; };
fi
if (($stdloglvl < 4)) && (($kmsgloglvl < 4)) && (($fileloglvl < 4)) && (($sysloglvl < 4)); then
unset dinfo
dinfo() { :; };
fi
if (($stdloglvl < 3)) && (($kmsgloglvl < 3)) && (($fileloglvl < 3)) && (($sysloglvl < 3)); then
unset dwarn
dwarn() { :; };
unset dwarning
dwarning() { :; };
fi
if (($stdloglvl < 2)) && (($kmsgloglvl < 2)) && (($fileloglvl < 2)) && (($sysloglvl < 2)); then
unset derror
derror() { :; };
fi
if (($stdloglvl < 1)) && (($kmsgloglvl < 1)) && (($fileloglvl < 1)) && (($sysloglvl < 1)); then
unset dfatal
dfatal() { :; };
fi
[ -n "$errmsg" ] && derror "$errmsg"
return $ret
}
## @brief Converts numeric logging level to the first letter of level name.
#
# @param lvl Numeric logging level in range from 1 to 6.
# @retval 1 if @a lvl is out of range.
# @retval 0 if @a lvl is correct.
# @result Echoes first letter of level name.
_lvl2char() {
case "$1" in
1) echo F;;
2) echo E;;
3) echo W;;
4) echo I;;
5) echo D;;
6) echo T;;
*) return 1;;
esac
}
## @brief Converts numeric level to logger priority defined by POSIX.2.
#
# @param lvl Numeric logging level in range from 1 to 6.
# @retval 1 if @a lvl is out of range.
# @retval 0 if @a lvl is correct.
# @result Echoes logger priority.
_lvl2syspri() {
printf $syslogfacility.
case "$1" in
1) echo crit;;
2) echo error;;
3) echo warning;;
4) echo info;;
5) echo debug;;
6) echo debug;;
*) return 1;;
esac
}
## @brief Converts dracut-logger numeric level to syslog log level
#
# @param lvl Numeric logging level in range from 1 to 6.
# @retval 1 if @a lvl is out of range.
# @retval 0 if @a lvl is correct.
# @result Echoes kernel console numeric log level
#
# Conversion is done as follows:
#
# <tt>
# none -> LOG_EMERG (0)
# none -> LOG_ALERT (1)
# FATAL(1) -> LOG_CRIT (2)
# ERROR(2) -> LOG_ERR (3)
# WARN(3) -> LOG_WARNING (4)
# none -> LOG_NOTICE (5)
# INFO(4) -> LOG_INFO (6)
# DEBUG(5) -> LOG_DEBUG (7)
# TRACE(6) /
# </tt>
#
# @see /usr/include/sys/syslog.h
_dlvl2syslvl() {
local lvl
case "$1" in
1) lvl=2;;
2) lvl=3;;
3) lvl=4;;
4) lvl=6;;
5) lvl=7;;
6) lvl=7;;
*) return 1;;
esac
[ "$syslogfacility" = user ] && echo $((8+$lvl)) || echo $((24+$lvl))
}
## @brief Prints to stderr and/or writes to file, to syslog and/or /dev/kmsg
# given message with given level (priority).
#
# @param lvl Numeric logging level.
# @param msg Message.
# @retval 0 It's always returned, even if logging failed.
#
# @note This function is not supposed to be called manually. Please use
# dtrace(), ddebug(), or others instead which wrap this one.
#
# This is core logging function which logs given message to standard error, file
# and/or syslog (with POSIX shell command <tt>logger</tt>) and/or to /dev/kmsg.
# The format is following:
#
# <tt>X: some message</tt>
#
# where @c X is the first letter of logging level. See module description for
# details on that.
#
# Message to syslog is sent with tag @c dracut. Priorities are mapped as
# following:
# - @c FATAL to @c crit
# - @c ERROR to @c error
# - @c WARN to @c warning
# - @c INFO to @c info
# - @c DEBUG and @c TRACE both to @c debug
_do_dlog() {
local lvl="$1"; shift
local lvlc=$(_lvl2char "$lvl") || return 0
local msg="$*"
local lmsg="$lvlc: $*"
(( $lvl <= $stdloglvl )) && printf -- 'dracut: %s\n' "$msg" >&2
if (( $lvl <= $sysloglvl )); then
if [[ "$_dlogfd" ]]; then
printf -- "<%s>%s\n" "$(($(_dlvl2syslvl $lvl) & 7))" "$msg" >&$_dlogfd
else
logger -t "dracut[$$]" -p $(_lvl2syspri $lvl) -- "$msg"
fi
fi
if (( $lvl <= $fileloglvl )) && [[ -w "$logfile" ]] && [[ -f "$logfile" ]]; then
echo "$lmsg" >>"$logfile"
fi
(( $lvl <= $kmsgloglvl )) && \
echo "<$(_dlvl2syslvl $lvl)>dracut[$$] $msg" >/dev/kmsg
}
## @brief Internal helper function for _do_dlog()
#
# @param lvl Numeric logging level.
# @param msg Message.
# @retval 0 It's always returned, even if logging failed.
#
# @note This function is not supposed to be called manually. Please use
# dtrace(), ddebug(), or others instead which wrap this one.
#
# This function calls _do_dlog() either with parameter msg, or if
# none is given, it will read standard input and will use every line as
# a message.
#
# This enables:
# dwarn "This is a warning"
# echo "This is a warning" | dwarn
dlog() {
[ -z "$maxloglvl" ] && return 0
(( $1 <= $maxloglvl )) || return 0
if (( $# > 1 )); then
_do_dlog "$@"
else
while read line || [ -n "$line" ]; do
_do_dlog "$1" "$line"
done
fi
}
## @brief Logs message at TRACE level (6)
#
# @param msg Message.
# @retval 0 It's always returned, even if logging failed.
dtrace() {
set +x
dlog 6 "$@"
[ -n "$debug" ] && set -x || :
}
## @brief Logs message at DEBUG level (5)
#
# @param msg Message.
# @retval 0 It's always returned, even if logging failed.
ddebug() {
set +x
dlog 5 "$@"
[ -n "$debug" ] && set -x || :
}
## @brief Logs message at INFO level (4)
#
# @param msg Message.
# @retval 0 It's always returned, even if logging failed.
dinfo() {
set +x
dlog 4 "$@"
[ -n "$debug" ] && set -x || :
}
## @brief Logs message at WARN level (3)
#
# @param msg Message.
# @retval 0 It's always returned, even if logging failed.
dwarn() {
set +x
dlog 3 "$@"
[ -n "$debug" ] && set -x || :
}
## @brief It's an alias to dwarn() function.
#
# @param msg Message.
# @retval 0 It's always returned, even if logging failed.
dwarning() {
set +x
dwarn "$@"
[ -n "$debug" ] && set -x || :
}
## @brief Logs message at ERROR level (2)
#
# @param msg Message.
# @retval 0 It's always returned, even if logging failed.
derror() {
set +x
dlog 2 "$@"
[ -n "$debug" ] && set -x || :
}
## @brief Logs message at FATAL level (1)
#
# @param msg Message.
# @retval 0 It's always returned, even if logging failed.
dfatal() {
set +x
dlog 1 "$@"
[ -n "$debug" ] && set -x || :
}

299
dracut.8
View File

@@ -1,299 +0,0 @@
.TH DRACUT 8 "June 2009" "Linux"
.SH NAME
switch_root \- switch to another filesystem as the root of the mount tree.
.SH SYNOPSIS
\fBdracut\fR [\fIOPTION\fR]... \fI<image>\fR \fI<kernel-version>\fR
.SH DESCRIPTION
.B switch_root
\fBdracut\fR creates an initial image used by the kernel for
preloading the block device modules (such as IDE, SCSI or RAID)
which are needed to access the root filesystem.
.SH OPTIONS
.TP
.BR \-f ", " \-\-force
overwrite existing initramfs file.
.TP
.BR \-m ", " \-\-modules " \fILIST\fR"
specify a space-separated list of dracut modules to call
when building the initramfs.
Modules are located in
.IR /usr/share/dracut/modules.d .
.TP
.BR \-o ", " \-\-omit " \fILIST\fR"
omit a space-separated list of dracut modules.
.TP
.BR \-a ", " \-\-add " \fILIST\fR"
add a space-separated list of dracut modules.
.TP
.BR \-d ", " \-\-drivers " \fILIST\fR"
specify a space-separated list of kernel modules to include in the initramfs.
.TP
.BR \-k ", " \-\-kmoddir " \fI{DIR}\fR
specify the directory, where to look for kernel modules
.TP
.BR " \-\-fwdir " \fI{DIR}\fR
specify additional directory, where to look for firmwares
.TP
.BR \-\-kernel-only
only install kernel drivers and firmware files
.TP
.BR \-\-no-kernel
do not install kernel drivers and firmware files
.TP
.BR \-\-strip
strip binaries in the initramfs (default)
.TP
.BR \-\-nostrip
do not strip binaries in the initramfs
.TP
.BR \-h ", " \-\-help
display help text and exit.
.TP
.B \-\-debug
output debug information of the build process
.TP
.BR \-v ", " \-\-verbose
verbose output during the build process
.TP
.BR \-c ", " \-\-conf " \fIFILE\fR"
specify configuration file to use.
Default:
.IR /etc/dracut.conf
.TP
.BR \-l ", " \-\-local
local mode. Use modules from the current working
directory instead of the system-wide installed in
.IR /usr/share/dracut/modules.d .
Useful when running dracut from a git checkout.
.TP
.BR \-H ", " \-\-hostonly
Host-Only mode: Install only what is needed for
booting the local host instead of a generic host.
.TP
.BR \-i ", " \-\-include " \fISOURCE\fR" "" " \fITARGET\fR"
include the files in the SOURCE directory into the
target directory in the final initramfs.
.TP
.BR \-I ", " \-\-install " \fILIST\fR"
install the space separated list of files into the initramfs.
.SH KERNEL COMMAND LINE
The root filesystem used by the kernel is specified in the boot configuration
file, as always. The traditional \fBroot=/dev/hda1\fR style device
specification is allowed. If a label is used, as in \fBroot=LABEL=rootPart\fR
the initrd will search all available devices for an ext2 or ext3 filesystem
with the appropriate label, and mount that device as the root filesystem.
\fBroot=UUID=uuidnumber\fR will mount the partition with that UUID as the
root filesystem.
.SH Standard
.TP
.B init=<path to real init>
.TP
.B root=<path to blockdevice>
specify e.g. \fI/dev/sda1\fR or
\fI/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1\fR
.SH I18N
e.g. LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=de-latin1-nodeadkeys
.TP
.B KEYBOARDTYPE=sun|pc
will be written to /etc/sysconfig/keyboard in the initramfs
.TP
.B KEYTABLE=<keytable filename>
will be written to /etc/sysconfig/keyboard in the initramfs
.TP
.B SYSFONT= Console font
will be written to /etc/sysconfig/i18n in the initramfs
.TP
.B SYSFONTACM= Unicode font map
will be written to /etc/sysconfig/i18n in the initramfs
.TP
.B UNIMAP= Unicode font map
will be written to /etc/sysconfig/i18n in the initramfs
.TP
.B LANG=<locale>
will be written to /etc/sysconfig/i18n in the initramfs
.SH Bootsplash - plymouth
.TP
.B rd_plytheme=<theme name>
specify the plymouth bootsplash theme (fallback is text)
.SH LVM
.TP
.B rd_NO_LVM
disable LVM detection
.TP
.B rd_LVM_VG=<volume group name>
only activate the volume groups with the given name
.SH crypto LUKS
.TP
.B rd_NO_LUKS
disable crypto LUKS detection
.TP
.B rd_LUKS_UUID=<luks uuid>
only activate the LUKS partitions with the given UUID
.SH MD
.TP
.B rd_NO_MD
disable MD RAID detection
.TP
.B rd_NO_MDIMSM
no MD RAID for imsm/isw raids, use dmraid instead
.TP
.B rd_MD_UUID=<md uuid>
only activate the raid sets with the given UUID
.SH DMRAID
.TP
.B rd_NO_DM
disable DM RAID detection
.TP
.B rd_DM_UUID=<dmraid uuid>
only activate the raid sets with the given UUID
.SH DASD
.TP
.B dasd=....
same syntax as the kernel module parameter (s390 only)
.SH DHCP
.TP
.B root=dhcp
get IP from dhcp server, root-path option from dhcp specifies root location
.SH NFS
.TP
.B root=[<server-ip>:]<root-dir>[:<nfs-options>]
mount nfs share from <server-ip>:/<root-dir>, if no server-ip is given,
use dhcp next_server.
NFS options can be appended with the prefix "." or ","
.TP
.B root=nfs:[<server-ip>:]<root-dir>[:<nfs-options>]
.TP
.B root=nfs4:[<server-ip>:]<root-dir>[:<nfs-options>]
.TP
.B root=dhcp
root=dhcp alone directs initrd to look at the DHCP root-path where NFS
options can be specified.
root-path=<server-ip>:<root-dir>[,<nfs-options>]
root-path=nfs:<server-ip>:<root-dir>[,<nfs-options>]
root-path=nfs4:<server-ip>:<root-dir>[,<nfs-options>]
.TP
.B root=/dev/nfs nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>]
\fBDeprecated!\fR kernel Documentation/filesystems/nfsroot.txt defines
this method.
This is supported by dracut but not recommended.
.SH iSCSI
.TP
.B root=iscsi:[<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname>
protocol defaults to "6", LUN defaults to "0".
If the "servername" field is provided by BOOTP or DHCP, then that
field is used in conjunction with other associated fields to contact
the boot server in the Boot stage (Section 7). However, if the
"servername" field is not provided, then the "targetname" field is
then used in the Discovery Service stage in conjunction with other
associated fields.
http://tools.ietf.org/html/rfc4173
.TP
.B root=iscsi:[<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname>
e.g. root=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0
.TP
.B root=??? netroot=iscsi:[<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname> ...
multiple netroot options allow setting up multiple iscsi disks
e.g.
root=UUID=12424547 netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0 netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target1
.B not yet implemented
.TP
.B root=??? iscsi_initiator= iscsi_target_name= iscsi_target_ip= iscsi_target_port= iscsi_target_group= iscsi_username= iscsi_password= iscsi_in_username= iscsi_in_password=
.TP
.B root=??? iscsi_firmware
will read the iscsi parameter from the BIOS firmware
.SH NBD
.TP
.B root=nbd:<server>:<port>[:<fstype>][:<mountopts>]
mount nbd share from <server>
.TP
.B root=dhcp
with dhcp root-path=nbd:<server>:<port>[:<fstype>][:<mountopts>]
root=dhcp alone directs initrd to look at the DHCP root-path where NBD options can be specified.
This syntax is only usable in cases where you are directly mounting the volume as the rootfs.
.SH Network
.TP bootdev=<interface>
.B specify the network interface to boot from
.TP
.B ip={dhcp|on|any}
get ip from dhcp server from all interfaces. If root=dhcp, loop sequentially through all interfaces (eth0, eth1, ...) and use the first with a valid DHCP root-path.
.TP
.B ip=<interface>:{dhcp|on|any}
get ip from dhcp server on a specific interface
.TP
.B ip=<client-IP-number>:[<server-id>]:<gateway-IP-number>:<netmask>:<client-hostname>:<interface>:{none|off}
explicit network configuration
.SH Misc
.TP
.B rdblacklist=<drivername>
do not load kernel module <drivername>
.SH Debug
.TP
.B rdshell
allow dropping to a shell, if root mounting fails
.TP
.B rdinitdebug
set -x for the dracut shell
.TP
.B rdbreak
drop to a shell at the end
.TP
.B rdbreak={pre-udev|pre-mount|mount|pre-pivot|commandline|initqueue}
drop to a shell on defined breakpoint
.TP
.B rdudevinfo
set udev to loglevel info
.TP
.B rdudevdebug
set udev to loglevel debug
.TP
.B rdnetdebug
debug network scripts in dracut. Output is written to /tmp/
.SH CONFIGURATION IN INITRAMFS
.TP
.B /conf/conf.d/
Any files found in /conf/conf.d/ will be sourced in the initramfs to
set initial values. Command line options will override these values
set in the configuration files.
.SH AUTHORS
.nf
Andreas Thienemann <andreas@bawue.net>
Bill Nottingham <notting@redhat.com>
Dave Jones <davej@redhat.com>
David Dillow <dave@thedillows.org>
Harald Hoyer <harald@redhat.com>
Jeremy Katz <katzj@redhat.com>
Peter Jones <pjones@redhat.com>
Seewer Philippe <philippe.seewer@bfh.ch>
Victor Lowther <victor.lowther@gmail.com>
Warren Togami <wtogami@redhat.com>
.fi
.SH AVAILABILITY
The dracut command is part of the dracut package and is available from
https://sourceforge.net/apps/trac/dracut/wiki

577
dracut.8.asc Normal file
View File

@@ -0,0 +1,577 @@
DRACUT(8)
=========
:doctype: manpage
:man source: dracut
:man manual: dracut
NAME
----
dracut - low-level tool for generating an initramfs/initrd image
SYNOPSIS
--------
*dracut* [__OPTION...__] [__<image>__ [__<kernel version>__]]
DESCRIPTION
-----------
Create an initramfs <image> for the kernel with the version <kernel version>.
If <kernel version> is omitted, then the version of the actual running
kernel is used. If <image> is omitted or empty, then the default location
/boot/initramfs-<kernel version>.img is used.
dracut creates an initial image used by the kernel for preloading the block
device modules (such as IDE, SCSI or RAID) which are needed to access the root
filesystem, mounting the root filesystem and booting into the real system.
At boot time, the kernel unpacks that archive into RAM disk, mounts and uses it
as initial root file system. All finding of the root device happens in this
early userspace.
Initramfs images are also called "initrd".
For a complete list of kernel command line options see *dracut.cmdline*(7).
If you are dropped to an emergency shell, while booting your initramfs,
the file _/run/initramfs/rdsosreport.txt_ is created, which can be saved to a
(to be mounted by hand) partition (usually /boot) or a USB stick.
Additional debugging info can be produced by adding **rd.debug** to the kernel
command line. _/run/initramfs/rdsosreport.txt_ contains all logs and the output
of some tools. It should be attached to any report about dracut problems.
USAGE
-----
include::dracut.usage.asc[]
OPTIONS
-------
**--kver** _<kernel version>_::
set the kernel version. This enables to specify the kernel version, without
specifying the location of the initramfs image. For example:
----
# dracut --kver 3.5.0-0.rc7.git1.2.fc18.x86_64
----
**-f, --force**::
overwrite existing initramfs file.
**-a, --add** _<list of dracut modules>_::
add a space-separated list of dracut modules to the default set of modules.
This parameter can be specified multiple times.
+
[NOTE]
===============================
If [LIST] has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --add "module1 module2" ...
----
===============================
**--force-add** _<list of dracut modules>_::
force to add a space-separated list of dracut modules to the default set of
modules, when -H is specified. This parameter can be specified multiple
times.
+
[NOTE]
===============================
If [LIST] has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --force-add "module1 module2" ...
----
===============================
**-o, --omit** _<list of dracut modules>_::
omit a space-separated list of dracut modules. This parameter can be
specified multiple times.
+
[NOTE]
===============================
If [LIST] has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --omit "module1 module2" ...
----
===============================
**-m, --modules** _<list of dracut modules>_::
specify a space-separated list of dracut modules to call when building the
initramfs. Modules are located in _/usr/lib/dracut/modules.d_. This
parameter can be specified multiple times.
This option forces dracut to only include the specified dracut modules.
In most cases the "--add" option is what you want to use.
+
[NOTE]
===============================
If [LIST] has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --modules "module1 module2" ...
----
===============================
**-d, --drivers** _<list of kernel modules>_::
specify a space-separated list of kernel modules to exclusively include
in the initramfs. The kernel modules have to be specified without the ".ko"
suffix. This parameter can be specified multiple times.
+
[NOTE]
===============================
If [LIST] has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --drivers "kmodule1 kmodule2" ...
----
===============================
**--add-drivers** _<list of kernel modules>_::
specify a space-separated list of kernel modules to add to the initramfs.
The kernel modules have to be specified without the ".ko" suffix. This
parameter can be specified multiple times.
+
[NOTE]
===============================
If [LIST] has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --add-drivers "kmodule1 kmodule2" ...
----
===============================
**--force-drivers** _<list of kernel modules>_::
See add-drivers above. But in this case it is ensured that the drivers
are tried to be loaded early via modprobe.
+
[NOTE]
===============================
If [LIST] has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --force-drivers "kmodule1 kmodule2" ...
----
===============================
**--omit-drivers** _<list of kernel modules>_::
specify a space-separated list of kernel modules not to add to the
initramfs.
The kernel modules have to be specified without the ".ko" suffix. This
parameter can be specified multiple times.
+
[NOTE]
===============================
If [LIST] has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --omit-drivers "kmodule1 kmodule2" ...
----
===============================
**--filesystems** _<list of filesystems>_::
specify a space-separated list of kernel filesystem modules to exclusively
include in the generic initramfs. This parameter can be specified multiple
times.
+
[NOTE]
===============================
If [LIST] has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --filesystems "filesystem1 filesystem2" ...
----
===============================
**-k, --kmoddir** _<kernel directory>_::
specify the directory, where to look for kernel modules
**--fwdir** _<dir>[:<dir>...]++_::
specify additional directories, where to look for firmwares. This parameter
can be specified multiple times.
**--kernel-cmdline <parameters>**::
specify default kernel command line parameters
**--kernel-only**::
only install kernel drivers and firmware files
**--no-kernel**::
do not install kernel drivers and firmware files
**--early-microcode**::
Combine early microcode with ramdisk
**--no-early-microcode**::
Do not combine early microcode with ramdisk
**--print-cmdline**::
print the kernel command line for the current disk layout
**--mdadmconf**::
include local _/etc/mdadm.conf_
**--nomdadmconf**::
do not include local _/etc/mdadm.conf_
**--lvmconf**::
include local _/etc/lvm/lvm.conf_
**--nolvmconf**::
do not include local _/etc/lvm/lvm.conf_
**--fscks** [LIST]::
add a space-separated list of fsck tools, in addition to _dracut.conf_'s
specification; the installation is opportunistic (non-existing tools are
ignored)
+
[NOTE]
===============================
If [LIST] has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --fscks "fsck.foo barfsck" ...
----
===============================
**--nofscks**::
inhibit installation of any fsck tools
**--strip**::
strip binaries in the initramfs (default)
**--nostrip**::
do not strip binaries in the initramfs
**--hardlink**::
hardlink files in the initramfs (default)
**--nohardlink**::
do not hardlink files in the initramfs
**--prefix** _<dir>_::
prefix initramfs files with the specified directory
**--noprefix**::
do not prefix initramfs files (default)
**-h, --help**::
display help text and exit.
**--debug**::
output debug information of the build process
**-v, --verbose**::
increase verbosity level (default is info(4))
**-q, --quiet**:: decrease verbosity level (default is info(4))
**-c, --conf** _<dracut configuration file>_::
specify configuration file to use.
+
Default:
_/etc/dracut.conf_
**--confdir** _<configuration directory>_::
specify configuration directory to use.
+
Default:
_/etc/dracut.conf.d_
**--tmpdir** _<temporary directory>_::
specify temporary directory to use.
+
Default:
_/var/tmp_
**--sshkey** _<sshkey file>_:: ssh key file used with ssh-client module.
**--logfile** _<logfile>_:: logfile to use; overrides any setting from
the configuration files.
+
Default:
_/var/log/dracut.log_
**-l, --local**::
activates the local mode. dracut will use modules from the current working
directory instead of the system-wide installed modules in
_/usr/lib/dracut/modules.d_.
This is useful when running dracut from a git checkout.
**-H, --hostonly**::
Host-Only mode: Install only what is needed for booting the local host
instead of a generic host and generate host-specific configuration.
+
[WARNING]
====
If chrooted to another root other than the real root device, use "--fstab" and
provide a valid _/etc/fstab_.
====
**-N, --no-hostonly**::
Disable Host-Only mode
**--hostonly-cmdline**:
Store kernel command line arguments needed in the initramfs
**--no-hostonly-cmdline**:
Do not store kernel command line arguments needed in the initramfs
**--no-hostonly-default-device**:
Do not generate implicit host devices like root, swap, fstab, etc.
Use "--mount" or "--add-device" to explicitly add devices as needed.
**--hostonly-i18n**:
Install only needed keyboard and font files according to the host configuration (default).
**--no-hostonly-i18n**:
Install all keyboard and font files available.
**--persistent-policy** _<policy>_::
Use _<policy>_ to address disks and partitions.
_<policy>_ can be any directory name found in /dev/disk.
E.g. "by-uuid", "by-label"
**--fstab**::
Use _/etc/fstab_ instead of _/proc/self/mountinfo_.
**--add-fstab** _<filename>_::
Add entries of _<filename>_ to the initramfs /etc/fstab.
**--mount** "_<device>_ _<mountpoint>_ _<filesystem type>_ [_<filesystem options>_ [_<dump frequency>_ [_<fsck order>_]]]"::
Mount _<device>_ on _<mountpoint>_ with _<filesystem type>_ in the
initramfs. _<filesystem options>_, _<dump options>_ and _<fsck order>_ can
be specified, see fstab manpage for the details.
The default _<filesystem options>_ is "defaults".
The default _<dump frequency>_ is "0".
the default _<fsck order>_ is "2".
**--mount** "_<mountpoint>_"::
Like above, but _<device>_, _<filesystem type>_ and _<filesystem options>_
are determined by looking at the current mounts.
**--add-device** _<device>_ ::
Bring up _<device>_ in initramfs, _<device>_ should be the device name.
This can be useful in hostonly mode for resume support when your swap is on
LVM or an encrypted partition.
[NB --device can be used for compatibility with earlier releases]
**-i, --include** _<SOURCE>_ _<TARGET>_::
include the files in the SOURCE directory into the
TARGET directory in the final initramfs. If SOURCE is a file, it will be
installed to TARGET in the final initramfs. This parameter can be specified
multiple times.
**-I, --install** _<file list>_::
install the space separated list of files into the initramfs.
+
[NOTE]
===============================
If [LIST] has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --install "/bin/foo /sbin/bar" ...
----
===============================
**--install-optional** _<file list>_::
install the space separated list of files into the initramfs, if they exist.
**--gzip**::
Compress the generated initramfs using gzip. This will be done by default,
unless another compression option or --no-compress is passed. Equivalent to
"--compress=gzip -9"
**--bzip2**::
Compress the generated initramfs using bzip2.
+
[WARNING]
====
Make sure your kernel has bzip2 decompression support compiled in, otherwise you
will not be able to boot. Equivalent to "--compress=bzip2"
====
**--lzma**::
Compress the generated initramfs using lzma.
+
[WARNING]
====
Make sure your kernel has lzma decompression support compiled in, otherwise you
will not be able to boot. Equivalent to "lzma --compress=lzma -9"
====
**--xz**::
Compress the generated initramfs using xz.
+
[WARNING]
====
Make sure your kernel has xz decompression support compiled in, otherwise you
will not be able to boot. Equivalent to
"lzma --compress=xz --check=crc32 --lzma2=dict=1MiB"
====
**--lzo**::
Compress the generated initramfs using lzop.
[WARNING]
====
Make sure your kernel has lzo decompression support compiled in, otherwise you
will not be able to boot.
====
**--lz4**::
Compress the generated initramfs using lz4.
[WARNING]
====
Make sure your kernel has lz4 decompression support compiled in, otherwise you
will not be able to boot.
====
**--zstd**::
Compress the generated initramfs using Zstandard.
[WARNING]
====
Make sure your kernel has zstd decompression support compiled in, otherwise you
will not be able to boot.
====
**--compress** _<compressor>_::
Compress the generated initramfs using the passed compression program. If
you pass it just the name of a compression program, it will call that
program with known-working arguments. If you pass a quoted string with
arguments, it will be called with exactly those arguments. Depending on what
you pass, this may result in an initramfs that the kernel cannot decompress.
The default value can also be set via the _INITRD_COMPRESS_ environment variable.
**--no-compress**::
Do not compress the generated initramfs. This will override any other
compression options.
**--reproducible**::
Create reproducible images.
**--no-reproducible**::
Do not create reproducible images.
**--list-modules**::
List all available dracut modules.
**-M, --show-modules**::
Print included module's name to standard output during build.
**--keep**::
Keep the initramfs temporary directory for debugging purposes.
**--printsize**::
Print out the module install size
**--profile**:
Output profile information of the build process
**--ro-mnt**:
Mount / and /usr read-only by default.
**-L, --stdlog** _<level>_::
[0-6] Specify logging level (to standard error)
----
0 - suppress any messages
1 - only fatal errors
2 - all errors
3 - warnings
4 - info
5 - debug info (here starts lots of output)
6 - trace info (and even more)
----
**--regenerate-all**::
Regenerate all initramfs images at the default location with the kernel
versions found on the system. Additional parameters are passed through.
**--loginstall _<DIR>_**::
Log all files installed from the host to _<DIR>_.
**--uefi**::
Instead of creating an initramfs image, dracut will create an UEFI executable,
which can be executed by an UEFI BIOS. The default output filename is
_<EFI>/EFI/Linux/linux-$kernel$-<MACHINE_ID>-<BUILD_ID>.efi_. <EFI> might be
_/efi_, _/boot_ or _/boot/efi_ depending on where the ESP partition is mounted.
The <BUILD_ID> is taken from BUILD_ID in _/usr/lib/os-release_ or if it exists
_/etc/os-release_ and is left out, if BUILD_ID is non-existant or empty.
**--no-machineid**::
affects the default output filename of **--uefi** and will discard the <MACHINE_ID>
part.
**--uefi-stub _<FILE>_**::
Specifies the UEFI stub loader, which will load the attached kernel, initramfs and
kernel command line and boots the kernel. The default is
_$prefix/lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_
or _$prefix/lib/gummiboot/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_
**--kernel-image _<FILE>_**::
Specifies the kernel image, which to include in the UEFI executable. The default is
_/lib/modules/<KERNEL-VERSION>/vmlinuz_ or _/boot/vmlinuz-<KERNEL-VERSION>_
ENVIRONMENT
-----------
_INITRD_COMPRESS_::
sets the default compression program. See **--compress**.
FILES
-----
_/var/log/dracut.log_::
logfile of initramfs image creation
_/tmp/dracut.log_::
logfile of initramfs image creation, if _/var/log/dracut.log_ is not
writable
_/etc/dracut.conf_::
see dracut.conf5
_/etc/dracut.conf.d/*.conf_::
see dracut.conf5
_/usr/lib/dracut/dracut.conf.d/*.conf_::
see dracut.conf5
Configuration in the initramfs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_/etc/conf.d/_::
Any files found in _/etc/conf.d/_ will be sourced in the initramfs to
set initial values. Command line options will override these values
set in the configuration files.
_/etc/cmdline_::
Can contain additional command line options. Deprecated, better use
/etc/cmdline.d/*.conf.
_/etc/cmdline.d/*.conf_::
Can contain additional command line options.
AVAILABILITY
------------
The dracut command is part of the dracut package and is available from
link:$$https://dracut.wiki.kernel.org$$[https://dracut.wiki.kernel.org]
AUTHORS
-------
Harald Hoyer
Victor Lowther
Philippe Seewer
Warren Togami
Amadeusz Żołnowski
Jeremy Katz
David Dillow
Will Woods
SEE ALSO
--------
*dracut.cmdline*(7) *dracut.conf*(5) *lsinitrd*(1)

185
dracut.asc Normal file
View File

@@ -0,0 +1,185 @@
dracut
======
Harald Hoyer <harald@redhat.com>
v3.0, October 2013
:language: bash
= Introduction
This section is a modified version of
http://en.wikipedia.org/wiki/Initrd which is licensed under the
Creative Commons Attribution/Share-Alike License.
== Definition
An _initial ramdisk_ is a temporary file system used in the boot process of the
Linux kernel. _initrd_ and _initramfs_ refer to slightly different schemes for
loading this file system into memory. Both are commonly used to make
preparations before the real root file system can be mounted.
== Rationale
Many Linux distributions ship a single, generic kernel image that is intended to
boot as wide a variety of hardware as possible. The device drivers for this
generic kernel image are included as loadable modules, as it is not possible to
statically compile them all into the one kernel without making it too large to
boot from computers with limited memory or from lower-capacity media like floppy
disks.
This then raises the problem of detecting and loading the modules necessary to
mount the root file system at boot time (or, for that matter, deducing where or
what the root file system is).
To further complicate matters, the root file system may be on a software RAID
volume, LVM, NFS (on diskless workstations), or on an encrypted partition. All
of these require special preparations to mount.
Another complication is kernel support for hibernation, which suspends the
computer to disk by dumping an image of the entire system to a swap partition or
a regular file, then powering off. On next boot, this image has to be made
accessible before it can be loaded back into memory.
To avoid having to hardcode handling for so many special cases into the kernel,
an initial boot stage with a temporary root file system
—now dubbed early user space— is used. This root file system would contain
user-space helpers that would do the hardware detection, module loading and
device discovery necessary to get the real root file system mounted.
== Implementation
An image of this initial root file system (along with the kernel image) must be
stored somewhere accessible by the Linux bootloader or the boot firmware of the
computer. This can be:
* The root file system itself
* A boot image on an optical disc
* A small ext2/ext3 or FAT-formatted partition on a local disk
(a _boot partition_)
* A TFTP server (on systems that can boot from Ethernet)
The bootloader will load the kernel and initial root file system image into
memory and then start the kernel, passing in the memory address of the image.
Depending on which algorithms were compiled statically into it, the kernel can
currently unpack initrd/initramfs images compressed with gzip, bzip2 and LZMA.
== Mount preparations
dracut can generate a customized initrams image which contains only whatever is
necessary to boot some particular computer, such as ATA, SCSI and filesystem
kernel modules (host-only mode).
dracut can also generate a more generic initramfs image (default mode).
dracut's initramfs starts only with the device name of the root file system (or
its UUID) and must discover everything else at boot time. A complex cascade of
tasks must be performed to get the root file system mounted:
* Any hardware drivers that the boot process depends on must be loaded. All
kernel modules for common storage devices are packed onto the initramfs and then
udev pulls in modules matching the computer's detected hardware.
* On systems which display a boot rd.splash screen, the video hardware must be
initialized and a user-space helper started to paint animations onto the display
in lockstep with the boot process.
* If the root file system is on NFS, dracut does then:
** Bring up the primary network interface.
** Invoke a DHCP client, with which it can obtain a DHCP lease.
** Extract the name of the NFS share and the address of the NFS server from the
lease.
** Mount the NFS share.
* If the root file system appears to be on a software RAID device, there is no
way of knowing which devices the RAID volume spans; the standard MD utilities
must be invoked to scan all available block devices with a raid signature and
bring the required ones online.
* If the root file system appears to be on a logical volume, the LVM utilities
must be invoked to scan for and activate the volume group containing it.
* If the root file system is on an encrypted block device:
** Invoke a helper script to prompt the user to type in a passphrase and/or
insert a hardware token (such as a smart card or a USB security dongle).
* Create a decryption target with the device mapper.
dracut uses udev, an event-driven hotplug agent, which invokes helper programs
as hardware devices, disk partitions and storage volumes matching certain rules
come online. This allows discovery to run in parallel, and to progressively
cascade into arbitrary nestings of LVM, RAID or encryption to get at the root
file system.
When the root file system finally becomes visible:
* Any maintenance tasks which cannot run on a mounted root file system
are done.
* The root file system is mounted read-only.
* Any processes which must continue running (such as the rd.splash screen helper
and its command FIFO) are hoisted into the newly-mounted root file system.
The final root file system cannot simply be mounted over /, since that would
make the scripts and tools on the initial root file system inaccessible for any
final cleanup tasks. On an initramfs, the initial root file system cannot be
rotated away. Instead, it is simply emptied and the final root file system
mounted over the top.
If the systemd module is used in the initramfs, the ordering of the services
started looks like <<dracutbootup7>>.
== Dracut on shutdown
On a systemd driven system, the dracut initramfs is also used for the shutdown
procedure.
The following steps are executed during a shutdown:
* systemd switches to the shutdown.target
* systemd starts
$prefix/lib/systemd/system/shutdown.target.wants/dracut-shutdown.service
* dracut-shutdown.service executes /usr/lib/dracut/dracut-initramfs-restore
which unpacks the initramfs to /run/initramfs
* systemd finishes shutdown.target
* systemd kills all processes
* systemd tries to unmount everything and mounts the remaining read-only
* systemd checks, if there is a /run/initramfs/shutdown executable
* if yes, it does a pivot_root to /run/initramfs and executes ./shutdown.
The old root is then mounted on /oldroot.
/usr/lib/dracut/modules.d/99shutdown/shutdown.sh is the shutdown executable.
* shutdown will try to umount every /oldroot mount and calls the various
shutdown hooks from the dracut modules
This ensures, that all devices are disassembled and unmounted cleanly.
= User Manual
:leveloffset: 1
include::dracut.8.asc[]
:leveloffset: 1
[[dracutconf5]]
include::dracut.conf.5.asc[]
[[dracutcmdline7]]
include::dracut.cmdline.7.asc[]
[[lsinitrd1]]
include::lsinitrd.1.asc[]
[[mkinitrd8]]
include::mkinitrd.8.asc[]
= Developer Manual
:leveloffset: 1
[[dracutmodules7]]
include::dracut.modules.7.asc[]
[[dracutbootup7]]
include::dracut.bootup.7.asc[]
:leveloffset: 0
[appendix]
License
-------
This work is licensed under the Creative Commons Attribution/Share-Alike
License. To view a copy of this license, visit
http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative
Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

123
dracut.bootup.7.asc Normal file
View File

@@ -0,0 +1,123 @@
DRACUT.BOOTUP(7)
================
:doctype: manpage
:man source: dracut
:man manual: dracut
NAME
----
dracut.bootup - boot ordering in the initramfs
DESCRIPTION
-----------
This flow chart illustrates the ordering of the services, if systemd is used in
the dracut initramfs.
----
systemd-journal.socket
|
v
dracut-cmdline.service
|
v
dracut-pre-udev.service
|
v
systemd-udevd.service
|
v
local-fs-pre.target dracut-pre-trigger.service
| |
v v
(various mounts) (various swap systemd-udev-trigger.service
| devices...) | (various low-level (various low-level
| | | services: seed, API VFS mounts:
v v v tmpfiles, random mqueue, configfs,
local-fs.target swap.target dracut-initqueue.service sysctl, ...) debugfs, ...)
| | | | |
\_______________|____________________ | ___________________|____________________/
\|/
v
sysinit.target
|
_________________/|\___________________
/ | \
| | |
v | v
(various | rescue.service
sockets...) | |
| | v
v | rescue.target
sockets.target |
| |
\_________________ | emergency.service
\| |
v v
basic.target emergency.target
|
______________________/|
/ |
| v
| dracut-pre-mount.service
| |
| v
| sysroot.mount
| |
| v
| initrd-root-fs.target
(custom initrd services) |
| v
| dracut-mount.service
| |
| v
| initrd-parse-etc.service
| |
| v
| (sysroot-usr.mount and
| various mounts marked
| with fstab option
| x-initrd.mount)
| |
| v
| initrd-fs.target
\______________________ |
\|
v
initrd.target
|
v
dracut-pre-pivot.service
|
v
initrd-cleanup.service
isolates to
initrd-switch-root.target
|
v
______________________/|
/ |
| initrd-udevadm-cleanup-db.service
| |
(custom initrd services) |
| |
\______________________ |
\|
v
initrd-switch-root.target
|
v
initrd-switch-root.service
|
v
switch-root
----
AUTHOR
------
Harald Hoyer
SEE ALSO
--------
*dracut*(8) *bootup*(7)

1277
dracut.cmdline.7.asc Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,10 +1,3 @@
# Sample dracut config file
# Specific list of dracut modules to use
#dracutmodules=""
# Dracut modules to omit
#omit_dracutmodules=""
# Additional kernel modules to install
#drivers=""
# PUT YOUR CONFIG IN separate files
# in /etc/dracut.conf.d named "<name>.conf"
# SEE man dracut.conf(5) for options

229
dracut.conf.5.asc Normal file
View File

@@ -0,0 +1,229 @@
DRACUT.CONF(5)
==============
:doctype: manpage
:man source: dracut
:man manual: dracut
NAME
----
dracut.conf - configuration file(s) for dracut
SYNOPSIS
--------
_/etc/dracut.conf_
_/etc/dracut.conf.d/\*.conf_
_/usr/lib/dracut/dracut.conf.d/*.conf_
Description
-----------
_dracut.conf_ is loaded during the initialisation phase of dracut. Command line
parameter will override any values set here.
_*.conf_ files are read from /usr/lib/dracut/dracut.conf.d and
/etc/dracut.conf.d. Files with the same name in /etc/dracut.conf.d will replace
files in /usr/lib/dracut/dracut.conf.d.
The files are then read in alphanumerical order and will override parameters
set in _/etc/dracut.conf_. Each line specifies an attribute and a value. A '#'
indicates the beginning of a comment; following characters, up to the end of the
line are not interpreted.
dracut command line options will override any values set here.
Configuration files must have the extension .conf; other extensions are ignored.
*add_dracutmodules+=*" __<dracut modules>__ "::
Add a space-separated list of dracut modules to call when building the
initramfs. Modules are located in _/usr/lib/dracut/modules.d_.
*dracutmodules+=*" __<dracut modules>__ "::
Specify a space-separated list of dracut modules to call when building the
initramfs. Modules are located in _/usr/lib/dracut/modules.d_.
This option forces dracut to only include the specified dracut modules.
In most cases the "add_dracutmodules" option is what you want to use.
*omit_dracutmodules+=*" __<dracut modules>__ "::
Omit a space-separated list of dracut modules to call when building the
initramfs. Modules are located in _/usr/lib/dracut/modules.d_.
*drivers+=*" __<kernel modules>__ "::
Specify a space-separated list of kernel modules to exclusively include in
the initramfs. The kernel modules have to be specified without the ".ko"
suffix.
*add_drivers+=*" __<kernel modules>__ "::
Specify a space-separated list of kernel modules to add to the initramfs.
The kernel modules have to be specified without the ".ko" suffix.
*force_drivers+=*" __<list of kernel modules>__ "::
See add_drivers above. But in this case it is ensured that the drivers
are tried to be loaded early via modprobe.
*omit_drivers+=*" __<kernel modules>__ "::
Specify a space-separated list of kernel modules not to add to the
initramfs. The kernel modules have to be specified without the ".ko" suffix.
*filesystems+=*" __<filesystem names>__ "::
Specify a space-separated list of kernel filesystem modules to exclusively
include in the generic initramfs.
*drivers_dir=*"__<kernel modules directory>__"::
Specify the directory, where to look for kernel modules
*fw_dir+=*" :__<dir>__[:__<dir>__ ...] "::
Specify additional directories, where to look for firmwares, separated by :
*install_items+=*" __<file>__[ __<file>__ ...] "::
Specify additional files to include in the initramfs, separated by spaces.
*install_optional_items+=*" __<file>__[ __<file>__ ...] "::
Specify additional files to include in the initramfs, separated by spaces,
if they exist.
*compress=*"__{bzip2|lzma|xz|gzip|lzo|lz4|zstd|<compressor [args ...]>}__"::
Compress the generated initramfs using the passed compression program. If
you pass it just the name of a compression program, it will call that
program with known-working arguments. If you pass arguments, it will be called
with exactly those arguments. Depending on what you pass, this may result in
an initramfs that the kernel cannot decompress.
*do_strip=*"__{yes|no}__"::
Strip binaries in the initramfs (default=yes)
*hostonly=*"__{yes|no}__"::
Host-Only mode: Install only what is needed for booting the local host
instead of a generic host and generate host-specific configuration.
*hostonly_cmdline=*"__{yes|no}__"::
If set to "yes", store the kernel command line arguments needed in the initramfs
*persistent_policy=*"__<policy>__"::
Use _<policy>_ to address disks and partitions.
_<policy>_ can be any directory name found in /dev/disk.
E.g. "by-uuid", "by-label"
*tmpdir=*"__<temporary directory>__"::
Specify temporary directory to use.
[WARNING]
====
If chrooted to another root other than the real root device, use --fstab and
provide a valid _/etc/fstab_.
====
*use_fstab=*"__{yes|no}__"::
Use _/etc/fstab_ instead of _/proc/self/mountinfo_.
*add_fstab+=*" __<filename>__ "::
Add entries of __<filename>__ to the initramfs /etc/fstab.
*add_device+=*" __<device>__ "::
Bring up _<device>_ in initramfs, _<device>_ should be the device name.
This can be useful in hostonly mode for resume support when your swap is on
LVM an encrypted partition.
*mdadmconf=*"__{yes|no}__"::
Include local _/etc/mdadm.conf_ (default=yes)
*lvmconf=*"__{yes|no}__"::
Include local _/etc/lvm/lvm.conf_ (default=yes)
*fscks=*" __<fsck tools>__ "::
Add a space-separated list of fsck tools. If nothing is specified, the
default is: "umount mount /sbin/fsck* xfs_db xfs_check xfs_repair e2fsck
jfs_fsck reiserfsck btrfsck". The installation is opportunistic
(non-existing tools are ignored).
*nofscks=*"__{yes|no}__"::
If specified, inhibit installation of any fsck tools.
*ro_mnt=*"__{yes|no}__"::
Mount _/_ and _/usr_ read-only by default.
*kernel_cmdline=*"__parameters__"::
Specify default kernel command line parameters
*kernel_only=*"__{yes|no}__"::
Only install kernel drivers and firmware files. (default=no)
*no_kernel=*"__{yes|no}__"::
Do not install kernel drivers and firmware files (default=no)
*acpi_override=*"__{yes|no}__"::
[WARNING] ONLY USE THIS IF YOU KNOW WHAT YOU ARE DOING! +
Override BIOS provided ACPI tables. For further documentation read
Documentation/acpi/initrd_table_override.txt in the kernel sources.
Search for ACPI table files (must have .aml suffix) in acpi_table_dir=
directory (see below) and add them to a separate uncompressed cpio
archive. This cpio archive gets glued (concatenated, uncompressed one
must be the first one) to the compressed cpio archive. The first,
uncompressed cpio archive is for data which the kernel must be able
to access very early (and cannot make use of uncompress alogrithms yet)
like microcode or ACPI tables (default=no).
*acpi_table_dir=*"__<dir>__"::
Directory to search for ACPI tables if acpi_override= is set to yes.
*early_microcode=*"{yes|no}"::
Combine early microcode with ramdisk (default=yes)
*stdloglvl*="__\{0-6\}__"::
Set logging to standard error level.
*sysloglvl*="__\{0-6\}__"::
Set logging to syslog level.
*fileloglvl=*"__\{0-6\}__"::
Set logging to file level.
*logfile=*"__<file>__"::
Path to log file.
*show_modules=*"__{yes|no}__"::
Print the name of the included modules to standard output during build.
*i18n_vars=*"__<variable mapping>__"::
Distribution specific variable mapping.
See dracut/modules.d/10i18n/README for a detailed description.
*i18n_default_font=*"__<fontname>__"::
The font <fontname> to install, if not specified otherwise.
Default is "LatArCyrHeb-16".
*i18n_install_all=*"__{yes|no}__"::
Install everything regardless of generic or hostonly mode.
*reproducible=*"__{yes|no}__"::
Create reproducible images.
*loginstall=*"__<DIR>__"::
Log all files installed from the host to _<DIR>_.
*uefi_stub=*"_<FILE>_"::
Specifies the UEFI stub loader, which will load the attached kernel, initramfs and
kernel command line and boots the kernel. The default is
_/lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_
or _/usr/lib/gummiboot/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_
*kernel_image=*"_<FILE>_"::
Specifies the kernel image, which to include in the UEFI executable. The default is
_/lib/modules/<KERNEL-VERSION>/vmlinuz_ or _/boot/vmlinuz-<KERNEL-VERSION>_
Files
-----
_/etc/dracut.conf_::
Old configuration file. You better use your own file in
_/etc/dracut.conf.d/_.
_/etc/dracut.conf.d/_::
Any _/etc/dracut.conf.d/*.conf_ file can override the values in
_/etc/dracut.conf_. The configuration files are read in alphanumerical
order.
AUTHOR
------
Harald Hoyer
See Also
--------
*dracut*(8) *dracut.cmdline*(7)

View File

@@ -0,0 +1,20 @@
# dracut config file customized for RedHat/Fedora.
# i18n
i18n_vars="/etc/sysconfig/keyboard:KEYTABLE-KEYMAP /etc/sysconfig/i18n:SYSFONT-FONT,FONTACM-FONT_MAP,FONT_UNIMAP"
i18n_default_font="eurlatgr"
i18n_install_all="yes"
stdloglvl=3
sysloglvl=5
install_optional_items+=" vi /etc/virc ps grep cat rm "
prefix="/"
systemdutildir=/usr/lib/systemd
systemdsystemunitdir=/usr/lib/systemd/system
systemdsystemconfdir=/etc/systemd/system
udevdir=/usr/lib/udev
hostonly="yes"
hostonly_cmdline="no"
early_microcode="yes"
reproducible="yes"

View File

@@ -0,0 +1,3 @@
# turn on fips module
add_dracutmodules+=" fips "

View File

@@ -0,0 +1,5 @@
# /etc/dracut.conf.d/gentoo-systemd.conf
# Paths of systemd dirs on Gentoo
systemdutildir=/usr/lib/systemd
systemdsystemunitdir=/usr/lib/systemd/system

View File

@@ -0,0 +1,15 @@
# /etc/dracut.conf.d/gentoo.conf
# dracut config file customized for Gentoo Base System release 2
udevdir=/lib/udev
ro_mnt=yes
#
# Modules
#
# i18n
i18n_vars="/etc/conf.d/keymaps:keymap-KEYMAP,extended_keymaps-EXT_KEYMAPS /etc/conf.d/consolefont:consolefont-FONT,consoletranslation-FONT_MAP /etc/rc.conf:unicode-UNICODE"
i18n_default_font="LatArCyrHeb-16"
omit_drivers+=" i2o_scsi"

View File

@@ -0,0 +1,24 @@
# SUSE specifc dracut settings
#
# SUSE by default always builds a as small as possible initrd for performance
# and resource reasons.
# If you like to build a generic initrd which works on other platforms than
# on the one dracut/mkinitrd got called comment out below setting(s).
hostonly="yes"
hostonly_cmdline="yes"
compress="xz -0 --check=crc32 --memlimit-compress=50%"
i18n_vars="/etc/sysconfig/language:RC_LANG-LANG,RC_LC_ALL-LC_ALL /etc/sysconfig/console:CONSOLE_UNICODEMAP-FONT_UNIMAP,CONSOLE_FONT-FONT,CONSOLE_SCREENMAP-FONT_MAP /etc/sysconfig/keyboard:KEYTABLE-KEYMAP"
omit_drivers+=" i2o_scsi"
# Below adds additional tools to the initrd which are not urgently necessary to
# bring up the system, but help to debug problems.
# See /usr/lib/dracut/modules.d/95debug/module-setup.sh which additional tools
# are installed and add more if you need them. This specifically helps if you
# use:
# rd.break=[cmdline|pre-udev|pre-trigger|initqueue|pre-mount|
# mount|pre-pivot|cleanup]
# boot parameter or if you are forced to enter the dracut emergency shell.
# add_dracutmodules+=debug

1120
dracut.css Normal file

File diff suppressed because it is too large Load Diff

6
dracut.logrotate Normal file
View File

@@ -0,0 +1,6 @@
/var/log/dracut.log {
missingok
notifempty
size 30k
create 0600 root root
}

301
dracut.modules.7.asc Normal file
View File

@@ -0,0 +1,301 @@
DRACUT.MODULES(7)
=================
:doctype: manpage
:man source: dracut
:man manual: dracut
NAME
----
dracut.modules - dracut modules
DESCRIPTION
-----------
dracut uses a modular system to build and extend the initramfs image. All
modules are located in _/usr/lib/dracut/modules.d_ or in _<git-src>/modules.d_.
The most basic dracut module is _99base_. In _99base_ the initial shell script
init is defined, which gets run by the kernel after initramfs loading. Although
you can replace init with your own version of _99base_, this is not encouraged.
Instead you should use, if possible, the hooks of dracut. All hooks, and the
point of time in which they are executed, are described in <<stages>>.
The main script, which creates the initramfs is dracut itself. It parses all
arguments and sets up the directory, in which everything is installed. It then
executes all check, install, installkernel scripts found in the modules, which
are to be processed. After everything is installed, the install directory is
archived and compressed to the final initramfs image. All helper functions used
by check, install and installkernel are found in in the file _dracut-functions_.
These shell functions are available to all module installer (install,
installkernel) scripts, without the need to source _dracut-functions_.
A module can check the preconditions for install and installkernel with the
check script. Also dependencies can be expressed with check. If a module passed
check, install and installkernel will be called to install all of the necessary
files for the module. To split between kernel and non-kernel parts of the
installation, all kernel module related parts have to be in installkernel. All
other files found in a module directory are module specific and mostly are hook
scripts and udev rules.
[[stages]]
== Boot Process Stages
dracut modules can insert custom script at various points, to control the boot
process.
These hooks are plain directories containing shell scripts ending with ".sh",
which are sourced by init.
Common used functions are in _dracut-lib.sh_, which can be sourced by any script.
=== Hook: cmdline
The _cmdline_ hook is a place to insert scripts to parse the kernel command line
and prepare the later actions, like setting up udev rules and configuration
files.
In this hook the most important environment variable is defined: root. The
second one is rootok, which indicates, that a module claimed to be able to parse
the root defined. So for example, **root=**__iscsi:....__ will be claimed by the
iscsi dracut module, which then sets rootok.
=== Hook: pre-udev
This hook is executed right after the cmdline hook and a check if root and
rootok were set. Here modules can take action with the final root, and before
udev has been run.
=== Start Udev
Now udev is started and the logging for udev is setup.
=== Hook: pre-trigger
In this hook, you can set udev environment variables with **udevadm control
--property=KEY=_value_** or control the further execution of udev with
udevadm.
=== Trigger Udev
udev is triggered by calling udevadm trigger, which sends add events for all
devices and subsystems.
=== Main Loop
In the main loop of dracut loops until udev has settled and
all scripts in _initqueue/finished_ returned true.
In this loop there are three hooks, where scripts can be inserted
by calling /sbin/initqueue.
==== Initqueue
This hook gets executed every time a script is inserted here, regardless of the
udev state.
==== Initqueue settled
This hooks (initqueue/settled) gets executed every time udev has settled.
==== Initqueue timeout
This hooks (initqueue/timeout) gets executed, when the main loop counter becomes
half of the rd.retry counter.
==== Initqueue finished
This hook (initqueue/finished) is called after udev has settled and
if all scripts herein return 0 the main loop will be ended.
Abritary scripts can be added here, to loop in the
initqueue until something happens, which a dracut module wants to wait for.
=== Hook: pre-mount
Before the root device is mounted all scripts in the hook pre-mount are
executed. In some cases (e.g. NFS) the real root device is already mounted,
though.
=== Hook: mount
This hook is mainly to mount the real root device.
=== Hook: pre-pivot
This hook is called before cleanup hook, This is a good place for
actions other than cleanups which need to be called before pivot.
=== Hook: cleanup
This hook is the last hook and is called before init finally switches root to
the real root device. This is a good place to clean up and kill processes not
needed anymore.
=== Cleanup and switch_root
Init (or systemd) kills all udev processes, cleans up the environment,
sets up the arguments for the real init process and finally calls switch_root.
switch_root removes the whole filesystem hierarchy of the initramfs,
chroot()s to the real root device and calls /sbin/init with the specified
arguments.
To ensure all files in the initramfs hierarchy can be removed, all processes
still running from the initramfs should not have any open file descriptors left.
== Network Infrastructure
FIXME
== Writing a Module
A simple example module is _96insmodpost_, which modprobes a kernel module after
udev has settled and the basic device drivers have been loaded.
All module installation information is in the file module-setup.sh.
First we create a check() function, which just exits with 0 indicating that this
module should be included by default.
check():
----
return 0
----
The we create the install() function, which installs a cmdline hook with
priority number 20 called _parse-insmodpost.sh_. It also installs the
_insmodpost.sh_ script in _/sbin_.
install():
----
inst_hook cmdline 20 "$moddir/parse-insmodpost.sh"
inst_simple "$moddir/insmodpost.sh" /sbin/insmodpost.sh
----
The _parse-instmodpost.sh_ parses the kernel command line for a argument
rd.driver.post, blacklists the module from being autoloaded and installs the
hook _insmodpost.sh_ in the _initqueue/settled_.
_parse-insmodpost.sh_:
----
for p in $(getargs rd.driver.post=); do
echo "blacklist $p" >> /etc/modprobe.d/initramfsblacklist.conf
_do_insmodpost=1
done
[ -n "$_do_insmodpost" ] && /sbin/initqueue --settled --unique --onetime /sbin/insmodpost.sh
unset _do_insmodpost
----
_insmodpost.sh_, which is called in the _initqueue/settled_ hook will just
modprobe the kernel modules specified in all rd.driver.post kernel command line
parameters. It runs after udev has settled and is only called once (--onetime).
_insmodpost.sh_:
----
. /lib/dracut-lib.sh
for p in $(getargs rd.driver.post=); do
modprobe $p
done
----
=== module-setup.sh: check()
_check()_ is called by dracut to evaluate the inclusion of a dracut module in
the initramfs.
$hostonly:: If the $hostonly variable is set, then the module check() function
should be in "hostonly" mode, which means, that the check() should only return
0, if the module is really needed to boot this specific host.
check() should return with:
0:: Include the dracut module in the initramfs.
1:: Do not include the dracut module. The requirements are not fulfilled
(missing tools, etc.)
255:: Only include the dracut module, if another module requires it or if
explicitly specified in the config file or on the argument list.
=== module-setup.sh: depends()
The function depends() should echo all other dracut module names the module
depends on.
=== module-setup.sh: cmdline()
This function should print the kernel command line options needed to boot the
current machine setup. It should start with a space and should not print a
newline.
=== module-setup.sh: install()
The install() function is called to install everything non-kernel related.
To install binaries, scripts, and other files, you can use the functions
mentioned in <<creation>>.
To address a file in the current module directory, use the variable "$moddir".
=== module-setup.sh: installkernel()
In installkernel() all kernel related files should be installed. You can use all
of the functions mentioned in <<creation>> to install files.
=== [[creation]]Creation Functions
==== inst_multiple [-o] <file> [ <file> ...]
installs multiple binaries and files. If executables are specified without a
path, dracut will search the path PATH=/usr/sbin:/sbin:/usr/bin:/bin for the
binary. If the option "-o" is given as the first parameter, a missing file does
not lead to an error.
==== inst <src> [<dst>]
installs _one_ file <src> either to the same place in the initramfs or to an
optional <dst>. inst with more than two arguments is treated the same as
inst_multiple, all arguments are treated as files to install and none as
install destinations.
==== inst_hook <hookdir> <prio> <src>
installs an executable/script <src> in the dracut hook <hookdir> with priority
<prio>.
==== inst_rules <udevrule> [ <udevrule> ...]
installs one ore more udev rules. Non-existant udev rules are reported, but do
not let dracut fail.
==== instmods <kernelmodule> [ <kernelmodule> ... ]
instmods should be used only in the installkernel() function.
instmods installs one or more kernel modules in the initramfs. <kernelmodule>
can also be a whole subsystem, if prefixed with a "=", like "=drivers/net/team".
instmods will not install the kernel module, if $hostonly is set and the kernel
module is not currently needed by any /sys/*...*/uevent MODALIAS.
To install a kernel module regardless of the hostonly mode use the form:
----
hostonly='' instmods <kernelmodule>
----
=== Initramfs Functions
FIXME
=== Network Modules
FIXME
AUTHOR
------
Harald Hoyer
SEE ALSO
--------
*dracut*(8)

BIN
dracut.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

1986
dracut.sh Executable file

File diff suppressed because it is too large Load Diff

View File

@@ -1,168 +1,482 @@
%if 0%{?fedora} < 12
%define with_switch_root 1
%else
%define with_switch_root 1
%endif
%define dracutlibdir %{_prefix}/lib/dracut
%bcond_without doc
%if %{defined gittag}
%define rdist 1.git%{gittag}%{?dist}
%define dashgittag -%{gittag}
%else
%define rdist %{?dist}
%endif
# We ship a .pc file but don't want to have a dep on pkg-config. We
# strip the automatically generated dep here and instead co-own the
# directory.
%global __requires_exclude pkg-config
%define dist_free_release xxx
Name: dracut
Version: 0.7
Release: 1%{?rdist}
Version: xxx
Release: %{dist_free_release}%{?dist}
Summary: Initramfs generator using udev
Group: System Environment/Base
License: GPLv2+
URL: http://apps.sourceforge.net/trac/dracut/wiki
Source0: dracut-%{version}%{?dashgittag}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: udev
Requires: util-linux-ng
Requires: module-init-tools
Requires: cpio
Requires: coreutils
Requires: findutils
Requires: binutils
Requires: grep
Requires: mktemp
Requires: mount
Requires: bash
Requires: /bin/sh
Requires: fileutils, grep, mount, gzip, tar, mktemp >= 1.5-5, findutils
Requires: lvm2 >= 2.02.33-9, dhclient
Requires: filesystem >= 2.1.0, cpio, device-mapper, initscripts >= 8.63-1
Requires: e2fsprogs >= 1.38-12, libselinux, libsepol, coreutils
Requires: mdadm, elfutils-libelf, plymouth >= 0.7.0
Requires: cryptsetup-luks
Requires: bridge-utils
%ifnarch s390 s390x
Requires: dmraid
Requires: kbd
%if 0%{?fedora} || 0%{?rhel}
Group: System Environment/Base
%endif
%if 0%{?suse_version}
Group: System/Base
%endif
%if ! 0%{?with_switch_root}
Requires: /sbin/switch_root
BuildArch: noarch
# The entire source code is GPLv2+
# except install/* which is LGPLv2+
License: GPLv2+ and LGPLv2+
URL: https://dracut.wiki.kernel.org/
# Source can be generated by
# http://git.kernel.org/?p=boot/dracut/dracut.git;a=snapshot;h=%%{version};sf=tgz
Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar.xz
Source1: https://www.gnu.org/licenses/lgpl-2.1.txt
BuildRequires: bash
BuildRequires: git
BuildRequires: kmod-devel >= 23
BuildRequires: gcc
%if 0%{?fedora} || 0%{?rhel}
BuildRequires: pkgconfig
BuildRequires: systemd
%endif
%if 0%{?fedora}
BuildRequires: bash-completion
%endif
%if %{with doc}
%if 0%{?fedora} || 0%{?rhel}
BuildRequires: docbook-style-xsl docbook-dtds libxslt
%endif
%if 0%{?suse_version}
BuildRequires: docbook-xsl-stylesheets libxslt
%endif
BuildRequires: asciidoc
%endif
%if 0%{?suse_version} > 9999
Obsoletes: mkinitrd < 2.6.1
Provides: mkinitrd = 2.6.1
%endif
Obsoletes: dracut-fips <= 047
Provides: dracut-fips = %{version}-%{release}
Obsoletes: dracut-fips-aesni <= 047
Provides: dracut-fips-aesni = %{version}-%{release}
Obsoletes: dracut-kernel < 005
Provides: dracut-kernel = %{version}-%{release}
Obsoletes: dracut < 030
Obsoletes: dracut-norescue < 030
Provides: dracut-norescue = %{version}-%{release}
Requires: bash >= 4
Requires: coreutils
Requires: cpio
Requires: filesystem >= 2.1.0
Requires: findutils
Requires: grep
Requires: kmod
Requires: sed
Requires: xz
Requires: gzip
%if 0%{?fedora} || 0%{?rhel}
Recommends: hardlink
Recommends: pigz
Recommends: kpartx
Requires: util-linux >= 2.21
Requires: systemd >= 219
Requires: systemd-udev >= 219
Requires: procps-ng
%else
Requires: hardlink
Requires: gzip
Requires: kpartx
Requires: udev > 166
Requires: util-linux-ng >= 2.21
%endif
%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version}
Requires: libkcapi-hmaccalc
%endif
%description
dracut is a new, event-driven initramfs infrastructure based around udev.
dracut contains tools to create bootable initramfses for the Linux
kernel. Unlike previous implementations, dracut hard-codes as little
as possible into the initramfs. dracut contains various modules which
are driven by the event-based udev. Having root on MD, DM, LVM2, LUKS
is supported as well as NFS, iSCSI, NBD, FCoE with the dracut-network
package.
%package generic
Summary: Metapackage to build a generic initramfs with dracut
%package network
Summary: dracut modules to build a dracut initramfs with network support
%if 0%{?_module_build}
# In the module-build-service, we have pieces of dracut provided by different
# modules ("base-runtime" provides most functionality, but we need
# dracut-network in "installer". Since these two modules build with separate
# dist-tags, we need to reduce this strict requirement to ignore the dist-tag.
Requires: %{name} >= %{version}-%{dist_free_release}
%else
Requires: %{name} = %{version}-%{release}
Requires: rpcbind nfs-utils
Requires: iscsi-initiator-utils
Requires: nbd
Requires: net-tools iproute
Requires: plymouth-system-theme plymouth-theme-charge plymouth-theme-solar
%endif
Requires: iputils
Requires: iproute
Requires: dhclient
Obsoletes: dracut-generic < 008
Provides: dracut-generic = %{version}-%{release}
%description generic
%description network
This package requires everything which is needed to build a generic
all purpose initramfs with dracut.
all purpose initramfs with network support with dracut.
%package kernel
Summary: Metapackage to build generic initramfs with dracut with only kernel modules
%package caps
Summary: dracut modules to build a dracut initramfs which drops capabilities
Requires: %{name} = %{version}-%{release}
Requires: ql2100-firmware
Requires: ql2200-firmware
Requires: ql23xx-firmware
Requires: ql2400-firmware
Requires: ql2500-firmware
Requires: libcap
%description kernel
This package requires everything which is needed to build a initramfs with all
kernel modules and firmware files needed by dracut modules.
%description caps
This package requires everything which is needed to build an
initramfs with dracut, which drops capabilities.
%package live
Summary: dracut modules to build a dracut initramfs with live image capabilities
%if 0%{?_module_build}
# See the network subpackage comment.
Requires: %{name} >= %{version}-%{dist_free_release}
%else
Requires: %{name} = %{version}-%{release}
%endif
Requires: %{name}-network = %{version}-%{release}
Requires: tar gzip coreutils bash device-mapper curl
%if 0%{?fedora}
Requires: fuse ntfs-3g
%endif
%description live
This package requires everything which is needed to build an
initramfs with dracut, with live image capabilities, like Live CDs.
%package config-generic
Summary: dracut configuration to turn off hostonly image generation
Requires: %{name} = %{version}-%{release}
Obsoletes: dracut-nohostonly < 030
Provides: dracut-nohostonly = %{version}-%{release}
%description config-generic
This package provides the configuration to turn off the host specific initramfs
generation with dracut and generates a generic image by default.
%package config-rescue
Summary: dracut configuration to turn on rescue image generation
Requires: %{name} = %{version}-%{release}
Obsoletes: dracut < 030
%description config-rescue
This package provides the configuration to turn on the rescue initramfs
generation with dracut.
%package tools
Summary: dracut tools to build the local initramfs
Requires: %{name} = %{version}-%{release}
Requires: ql2100-firmware
Requires: ql2200-firmware
Requires: ql23xx-firmware
Requires: ql2400-firmware
Requires: ql2500-firmware
%description tools
This package contains tools to assemble the local initrd and host configuration.
%package squash
Summary: dracut module to build an initramfs with most files in a squashfs image
Requires: %{name} = %{version}-%{release}
Requires: squashfs-tools
%description squash
This package provides a dracut module to build an initramfs, but store most files
in a squashfs image, result in a smaller initramfs size and reduce runtime memory
usage.
%prep
%setup -q -n %{name}-%{version}%{?dashgittag}
%autosetup -n %{name}-%{version} -S git_am
cp %{SOURCE1} .
%build
make
%configure --systemdsystemunitdir=%{_unitdir} \
--bashcompletiondir=$(pkg-config --variable=completionsdir bash-completion) \
--libdir=%{_prefix}/lib \
%if %{without doc}
--disable-documentation \
%endif
${NULL}
make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT sbindir=/sbin sysconfdir=/etc mandir=%{_mandir}
make %{?_smp_mflags} install \
DESTDIR=$RPM_BUILD_ROOT \
libdir=%{_prefix}/lib
%if ! 0%{?with_switch_root}
rm -f $RPM_BUILD_ROOT/sbin/switch_root
echo "DRACUT_VERSION=%{version}-%{release}" > $RPM_BUILD_ROOT/%{dracutlibdir}/dracut-version.sh
%if 0%{?fedora} == 0 && 0%{?rhel} == 0 && 0%{?suse_version} == 0
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/01fips
%endif
%if %{defined _unitdir}
# for systemd, better use systemd-bootchart
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00bootchart
%endif
# we do not support dash in the initramfs
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00dash
# remove gentoo specific modules
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/50gensplash
%if %{defined _unitdir}
# with systemd IMA and selinux modules do not make sense
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/96securityfs
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/97masterkey
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/98integrity
%endif
%ifnarch s390 s390x
# remove architecture specific modules
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/80cms
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/81cio_ignore
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/91zipl
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95dasd
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95dasd_mod
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95dasd_rules
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95dcssblk
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95qeth_rules
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95zfcp
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95zfcp_rules
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/95znet
%else
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/00warpclock
%endif
mkdir -p $RPM_BUILD_ROOT/boot/dracut
mkdir -p $RPM_BUILD_ROOT/var/lib/dracut/overlay
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log
touch $RPM_BUILD_ROOT%{_localstatedir}/log/dracut.log
mkdir -p $RPM_BUILD_ROOT%{_sharedstatedir}/initramfs
%clean
rm -rf $RPM_BUILD_ROOT
%if 0%{?fedora} || 0%{?rhel}
install -m 0644 dracut.conf.d/fedora.conf.example $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/01-dist.conf
rm -f $RPM_BUILD_ROOT%{_mandir}/man?/*suse*
%endif
%if 0%{?suse_version}
install -m 0644 dracut.conf.d/suse.conf.example $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/01-dist.conf
%endif
%if 0%{?fedora} == 0 && 0%{?rhel} == 0 && 0%{?suse_version} <= 9999
rm -f -- $RPM_BUILD_ROOT%{_bindir}/mkinitrd
rm -f -- $RPM_BUILD_ROOT%{_bindir}/lsinitrd
%endif
%if 0%{?fedora} || 0%{?rhel}
echo 'hostonly="no"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/02-generic-image.conf
echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/02-rescue.conf
# FIXME: remove after F30
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/kernel/postinst.d
install -m 0755 51-dracut-rescue-postinst.sh $RPM_BUILD_ROOT%{_sysconfdir}/kernel/postinst.d/51-dracut-rescue-postinst.sh
%endif
%files
%defattr(-,root,root,0755)
%doc README HACKING TODO COPYING AUTHORS
/sbin/dracut
%if 0%{?with_switch_root}
/sbin/switch_root
%if %{with doc}
%doc README HACKING TODO AUTHORS NEWS dracut.html dracut.png dracut.svg
%endif
%dir %{_datadir}/dracut
%{_datadir}/dracut/dracut-functions
%{_datadir}/dracut/modules.d
%config(noreplace) /etc/dracut.conf
%{!?_licensedir:%global license %%doc}
%license COPYING lgpl-2.1.txt
%{_bindir}/dracut
%{_datadir}/bash-completion/completions/dracut
%{_datadir}/bash-completion/completions/lsinitrd
%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} > 9999
%{_bindir}/mkinitrd
%{_bindir}/lsinitrd
%endif
%dir %{dracutlibdir}
%dir %{dracutlibdir}/modules.d
%{dracutlibdir}/dracut-functions.sh
%{dracutlibdir}/dracut-init.sh
%{dracutlibdir}/dracut-functions
%{dracutlibdir}/dracut-version.sh
%{dracutlibdir}/dracut-logger.sh
%{dracutlibdir}/dracut-initramfs-restore
%{dracutlibdir}/dracut-install
%{dracutlibdir}/skipcpio
%config(noreplace) %{_sysconfdir}/dracut.conf
%if 0%{?fedora} || 0%{?suse_version} || 0%{?rhel}
%{dracutlibdir}/dracut.conf.d/01-dist.conf
%endif
%dir %{_sysconfdir}/dracut.conf.d
%dir %{dracutlibdir}/dracut.conf.d
%dir %{_datadir}/pkgconfig
%{_datadir}/pkgconfig/dracut.pc
%if %{with doc}
%{_mandir}/man8/dracut.8*
%{_mandir}/man8/*service.8*
%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version} > 9999
%{_mandir}/man8/mkinitrd.8*
%{_mandir}/man1/lsinitrd.1*
%endif
%{_mandir}/man7/dracut.kernel.7*
%{_mandir}/man7/dracut.cmdline.7*
%{_mandir}/man7/dracut.modules.7*
%{_mandir}/man7/dracut.bootup.7*
%{_mandir}/man5/dracut.conf.5*
%endif
%files generic
%defattr(-,root,root,0755)
%doc README.generic
%if %{undefined _unitdir}
%{dracutlibdir}/modules.d/00bootchart
%endif
%{dracutlibdir}/modules.d/00bash
%{dracutlibdir}/modules.d/00systemd
%ifnarch s390 s390x
%{dracutlibdir}/modules.d/00warpclock
%endif
%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version}
%{dracutlibdir}/modules.d/01fips
%endif
%{dracutlibdir}/modules.d/01systemd-initrd
%{dracutlibdir}/modules.d/03modsign
%{dracutlibdir}/modules.d/03rescue
%{dracutlibdir}/modules.d/04watchdog
%{dracutlibdir}/modules.d/05busybox
%{dracutlibdir}/modules.d/06rngd
%{dracutlibdir}/modules.d/10i18n
%{dracutlibdir}/modules.d/30convertfs
%{dracutlibdir}/modules.d/45url-lib
%{dracutlibdir}/modules.d/50drm
%{dracutlibdir}/modules.d/50plymouth
%{dracutlibdir}/modules.d/80lvmmerge
%{dracutlibdir}/modules.d/90btrfs
%{dracutlibdir}/modules.d/90crypt
%{dracutlibdir}/modules.d/90dm
%{dracutlibdir}/modules.d/90dmraid
%{dracutlibdir}/modules.d/90kernel-modules
%{dracutlibdir}/modules.d/90kernel-modules-extra
%{dracutlibdir}/modules.d/90lvm
%{dracutlibdir}/modules.d/90mdraid
%{dracutlibdir}/modules.d/90multipath
%{dracutlibdir}/modules.d/90stratis
%{dracutlibdir}/modules.d/90qemu
%{dracutlibdir}/modules.d/91crypt-gpg
%{dracutlibdir}/modules.d/91crypt-loop
%{dracutlibdir}/modules.d/95debug
%{dracutlibdir}/modules.d/95fstab-sys
%{dracutlibdir}/modules.d/95lunmask
%{dracutlibdir}/modules.d/95resume
%{dracutlibdir}/modules.d/95rootfs-block
%{dracutlibdir}/modules.d/95terminfo
%{dracutlibdir}/modules.d/95udev-rules
%{dracutlibdir}/modules.d/95virtfs
%ifarch s390 s390x
%{dracutlibdir}/modules.d/80cms
%{dracutlibdir}/modules.d/81cio_ignore
%{dracutlibdir}/modules.d/91zipl
%{dracutlibdir}/modules.d/95dasd
%{dracutlibdir}/modules.d/95dasd_mod
%{dracutlibdir}/modules.d/95dasd_rules
%{dracutlibdir}/modules.d/95dcssblk
%{dracutlibdir}/modules.d/95qeth_rules
%{dracutlibdir}/modules.d/95zfcp
%{dracutlibdir}/modules.d/95zfcp_rules
%endif
%if %{undefined _unitdir}
%{dracutlibdir}/modules.d/96securityfs
%{dracutlibdir}/modules.d/97masterkey
%{dracutlibdir}/modules.d/98integrity
%endif
%{dracutlibdir}/modules.d/97biosdevname
%{dracutlibdir}/modules.d/98dracut-systemd
%{dracutlibdir}/modules.d/98ecryptfs
%{dracutlibdir}/modules.d/98pollcdrom
%{dracutlibdir}/modules.d/98selinux
%{dracutlibdir}/modules.d/98syslog
%{dracutlibdir}/modules.d/98usrmount
%{dracutlibdir}/modules.d/99base
%{dracutlibdir}/modules.d/99fs-lib
%{dracutlibdir}/modules.d/99shutdown
%attr(0644,root,root) %ghost %config(missingok,noreplace) %{_localstatedir}/log/dracut.log
%dir %{_sharedstatedir}/initramfs
%if %{defined _unitdir}
%{_unitdir}/dracut-shutdown.service
%{_unitdir}/sysinit.target.wants/dracut-shutdown.service
%{_unitdir}/dracut-cmdline.service
%{_unitdir}/dracut-initqueue.service
%{_unitdir}/dracut-mount.service
%{_unitdir}/dracut-pre-mount.service
%{_unitdir}/dracut-pre-pivot.service
%{_unitdir}/dracut-pre-trigger.service
%{_unitdir}/dracut-pre-udev.service
%{_unitdir}/initrd.target.wants/dracut-cmdline.service
%{_unitdir}/initrd.target.wants/dracut-initqueue.service
%{_unitdir}/initrd.target.wants/dracut-mount.service
%{_unitdir}/initrd.target.wants/dracut-pre-mount.service
%{_unitdir}/initrd.target.wants/dracut-pre-pivot.service
%{_unitdir}/initrd.target.wants/dracut-pre-trigger.service
%{_unitdir}/initrd.target.wants/dracut-pre-udev.service
%files kernel
%defattr(-,root,root,0755)
%doc README.kernel
%endif
%if 0%{?fedora} || 0%{?rhel}
%{_prefix}/lib/kernel/install.d/50-dracut.install
%endif
%files tools
%defattr(-,root,root,0755)
%doc COPYING
/sbin/dracut-gencmdline
/sbin/dracut-catimages
%files network
%{dracutlibdir}/modules.d/02systemd-networkd
%{dracutlibdir}/modules.d/35network-manager
%{dracutlibdir}/modules.d/35network-legacy
%{dracutlibdir}/modules.d/40network
%{dracutlibdir}/modules.d/45ifcfg
%{dracutlibdir}/modules.d/90kernel-network-modules
%{dracutlibdir}/modules.d/90qemu-net
%{dracutlibdir}/modules.d/95cifs
%{dracutlibdir}/modules.d/95fcoe
%{dracutlibdir}/modules.d/95fcoe-uefi
%{dracutlibdir}/modules.d/95iscsi
%{dracutlibdir}/modules.d/95nbd
%{dracutlibdir}/modules.d/95nfs
%{dracutlibdir}/modules.d/95ssh-client
%ifarch s390 s390x
%{dracutlibdir}/modules.d/95znet
%endif
%{dracutlibdir}/modules.d/99uefi-lib
%files caps
%{dracutlibdir}/modules.d/02caps
%files live
%{dracutlibdir}/modules.d/99img-lib
%{dracutlibdir}/modules.d/90dmsquash-live
%{dracutlibdir}/modules.d/90dmsquash-live-ntfs
%{dracutlibdir}/modules.d/90livenet
%files tools
%if %{with doc}
%doc %{_mandir}/man8/dracut-catimages.8*
%endif
%{_bindir}/dracut-catimages
%dir /boot/dracut
%dir /var/lib/dracut
%dir /var/lib/dracut/overlay
%files squash
%{dracutlibdir}/modules.d/99squash
%files config-generic
%{dracutlibdir}/dracut.conf.d/02-generic-image.conf
%files config-rescue
%{dracutlibdir}/dracut.conf.d/02-rescue.conf
%if 0%{?fedora} || 0%{?rhel}
%{_prefix}/lib/kernel/install.d/51-dracut-rescue.install
# FIXME: remove after F30
%{_sysconfdir}/kernel/postinst.d/51-dracut-rescue-postinst.sh
%endif
%changelog
* Fri Jul 24 2009 Harald Hoyer <harald@redhat.com> 0.7-1
- version 0.7
* Wed Jul 22 2009 Harald Hoyer <harald@redhat.com> 0.6-1
- version 0.6
* Fri Jul 17 2009 Harald Hoyer <harald@redhat.com> 0.5-1
- version 0.5
* Sat Jul 04 2009 Harald Hoyer <harald@redhat.com> 0.4-1
- version 0.4
* Thu Jul 02 2009 Harald Hoyer <harald@redhat.com> 0.3-1
- version 0.3
* Wed Jul 01 2009 Harald Hoyer <harald@redhat.com> 0.2-1
- version 0.2
* Fri Jun 19 2009 Harald Hoyer <harald@redhat.com> 0.1-1
- first release
* Thu Dec 18 2008 Jeremy Katz <katzj@redhat.com> - 0.0-1
- Initial build

1701
dracut.svg Normal file

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 68 KiB

518
dracut.usage.asc Normal file
View File

@@ -0,0 +1,518 @@
To create a initramfs image, the most simple command is:
----
# dracut
----
This will generate a general purpose initramfs image, with all possible
functionality resulting of the combination of the installed dracut modules and
system tools. The image is /boot/initramfs-_++<kernel version>++_.img and
contains the kernel modules of the currently active kernel with version
_++<kernel version>++_.
If the initramfs image already exists, dracut will display an error message, and
to overwrite the existing image, you have to use the --force option.
----
# dracut --force
----
If you want to specify another filename for the resulting image you would issue
a command like:
----
# dracut foobar.img
----
To generate an image for a specific kernel version, the command would be:
----
# dracut foobar.img 2.6.40-1.rc5.f20
----
A shortcut to generate the image at the default location for a specific kernel
version is:
----
# dracut --kver 2.6.40-1.rc5.f20
----
If you want to create lighter, smaller initramfs images, you may want to specify
the --hostonly or -H option. Using this option, the resulting image will
contain only those dracut modules, kernel modules and filesystems, which are
needed to boot this specific machine. This has the drawback, that you can't put
the disk on another controller or machine, and that you can't switch to another
root filesystem, without recreating the initramfs image. The usage of the
--hostonly option is only for experts and you will have to keep the broken
pieces. At least keep a copy of a general purpose image (and corresponding
kernel) as a fallback to rescue your system.
=== Inspecting the Contents
To see the contents of the image created by dracut, you can use the lsinitrd
tool.
----
# lsinitrd | less
----
To display the contents of a file in the initramfs also use the lsinitrd tool:
----
# lsinitrd -f /etc/ld.so.conf
include ld.so.conf.d/*.conf
----
=== Adding dracut Modules
Some dracut modules are turned off by default and have to be activated manually.
You can do this by adding the dracut modules to the configuration file
_/etc/dracut.conf_ or _/etc/dracut.conf.d/myconf.conf_. See *dracut.conf*(5).
You can also add dracut modules on the command line
by using the -a or --add option:
----
# dracut --add bootchart initramfs-bootchart.img
----
To see a list of available dracut modules, use the --list-modules option:
----
# dracut --list-modules
----
=== Omitting dracut Modules
Sometimes you don't want a dracut module to be included for reasons of speed,
size or functionality. To do this, either specify the omit_dracutmodules
variable in the _dracut.conf_ or _/etc/dracut.conf.d/myconf.conf_ configuration
file (see *dracut.conf*(5)), or use the -o or --omit option
on the command line:
----
# dracut -o "multipath lvm" no-multipath-lvm.img
----
=== Adding Kernel Modules
If you need a special kernel module in the initramfs, which is not
automatically picked up by dracut, you have the use the --add-drivers option
on the command line or the drivers vaiable in the _/etc/dracut.conf_
or _/etc/dracut.conf.d/myconf.conf_ configuration file (see *dracut.conf*(5)):
----
# dracut --add-drivers mymod initramfs-with-mymod.img
----
=== Boot parameters
An initramfs generated without the "hostonly" mode, does not contain any system
configuration files (except for some special exceptions), so the configuration
has to be done on the kernel command line. With this flexibility, you can easily
boot from a changed root partition, without the need to recompile the initramfs
image. So, you could completly change your root partition (move it inside a md
raid with encryption and LVM on top), as long as you specify the correct
filesystem LABEL or UUID on the kernel command line for your root device, dracut
will find it and boot from it.
The kernel command line can also be provided by the dhcp server with the
root-path option. See <<NetworkBoot>>.
For a full reference of all kernel command line parameters,
see *dracut.cmdline*(5).
To get a quick start for the suitable kernel command line on your system,
use the __--print-cmdline__ option:
----
# dracut --print-cmdline
root=UUID=8b8b6f91-95c7-4da2-831b-171e12179081 rootflags=rw,relatime,discard,data=ordered rootfstype=ext4
----
==== Specifying the root Device
This is the only option dracut really needs to boot from your root partition.
Because your root partition can live in various environments, there are a lot of
formats for the root= option. The most basic one is root=_++<path to device
node>++_:
----
root=/dev/sda2
----
Because device node names can change, dependent on the drive ordering, you are
encouraged to use the filesystem identifier (UUID) or filesystem label (LABEL)
to specify your root partition:
----
root=UUID=19e9dda3-5a38-484d-a9b0-fa6b067d0331
----
or
----
root=LABEL=myrootpartitionlabel
----
To see all UUIDs or LABELs on your system, do:
----
# ls -l /dev/disk/by-uuid
----
or
----
# ls -l /dev/disk/by-label
----
If your root partition is on the network see <<NetworkBoot>>.
==== Keyboard Settings
If you have to input passwords for encrypted disk volumes, you might want to set
the keyboard layout and specify a display font.
A typical german kernel command would contain:
----
rd.vconsole.font=latarcyrheb-sun16 rd.vconsole.keymap=de-latin1-nodeadkeys rd.locale.LANG=de_DE.UTF-8
----
Setting these options can override the setting stored on your system, if you use
a modern init system, like systemd.
==== Blacklisting Kernel Modules
Sometimes it is required to prevent the automatic kernel module loading of a
specific kernel module. To do this, just add rd.blacklist=_++<kernel module
name>++_, with _++<kernel module name>++_ not containing the _.ko_
suffix, to the kernel command line. For example:
----
rd.driver.blacklist=mptsas rd.driver.blacklist=nouveau
----
The option can be specified multiple times on the kernel command line.
==== Speeding up the Boot Process
If you want to speed up the boot process, you can specify as much information
for dracut on the kernel command as possible. For example, you can tell dracut,
that you root partition is not on a LVM volume or not on a raid partition, or
that it lives inside a specific crypto LUKS encrypted volume. By default, dracut
searches everywhere. A typical dracut kernel command line for a plain primary or
logical partition would contain:
----
rd.luks=0 rd.lvm=0 rd.md=0 rd.dm=0
----
This turns off every automatic assembly of LVM, MD raids, DM raids and
crypto LUKS.
Of course, you could also omit the dracut modules in the initramfs creation
process, but then you would lose the posibility to turn it on on demand.
[[Injecting]]
=== Injecting custom Files
To add your own files to the initramfs image, you have several possibilities.
The --include option let you specify a source path and a target path.
For example
----
# dracut --include cmdline-preset /etc/cmdline.d/mycmdline.conf initramfs-cmdline-pre.img
----
will create an initramfs image, where the file cmdline-preset will be copied
inside the initramfs to _/etc/cmdline.d/mycmdline.conf_. --include can only
be specified once.
----
# mkdir -p rd.live.overlay/etc/cmdline.d
# mkdir -p rd.live.overlay/etc/conf.d
# echo "ip=dhcp" >> rd.live.overlay/etc/cmdline.d/mycmdline.conf
# echo export FOO=testtest >> rd.live.overlay/etc/conf.d/testvar.conf
# echo export BAR=testtest >> rd.live.overlay/etc/conf.d/testvar.conf
# tree rd.live.overlay/
rd.live.overlay/
`-- etc
|-- cmdline.d
| `-- mycmdline.conf
`-- conf.d
`-- testvar.conf
# dracut --include rd.live.overlay / initramfs-rd.live.overlay.img
----
This will put the contents of the rd.live.overlay directory into the root of the
initramfs image.
The --install option let you specify several files, which will get installed in
the initramfs image at the same location, as they are present on initramfs
creation time.
----
# dracut --install 'strace fsck.ext3 ssh' initramfs-dbg.img
----
This will create an initramfs with the strace, fsck.ext3 and ssh executables,
together with the libraries needed to start those. The --install option can be
specified multiple times.
[[NetworkBoot]]
=== Network Boot
If your root partition is on a network drive, you have to have the network
dracut modules installed to create a network aware initramfs image.
If you specify ip=dhcp on the kernel command line, then dracut asks a dhcp
server about the ip address for the machine. The dhcp server can also serve an
additional root-path, which will set the root device for dracut. With this
mechanism, you have static configuration on your client machine and a
centralized boot configuration on your TFTP/DHCP server. If you can't pass a
kernel command line, then you can inject _/etc/cmdline.d/mycmdline.conf_, with a
method described in <<Injecting>>.
==== Reducing the Image Size
To reduce the size of the initramfs, you should create it with by omitting all
dracut modules, which you know, you don't need to boot the machine.
You can also specify the exact dracut and kernel modules to produce a very tiny
initramfs image.
For example for a NFS image, you would do:
----
# dracut -m "nfs network base" initramfs-nfs-only.img
----
Then you would boot from this image with your target machine and reduce the size
once more by creating it on the target machine with the --host-only option:
----
# dracut -m "nfs network base" --host-only initramfs-nfs-host-only.img
----
This will reduce the size of the initramfs image significantly.
== Troubleshooting
If the boot process does not succeed, you have several options to debug the
situation. Some of the basic operations are covered here. For more information
you should also visit:
https://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html
[[identifying-your-problem-area]]
=== Identifying your problem area
. Remove ''rhgb'' and ''quiet'' from the kernel command line
. Add ''rd.shell'' to the kernel command line. This will present a shell should
dracut be unable to locate your root device
. Add ''rd.shell rd.debug log_buf_len=1M'' to the kernel command line so that
dracut shell commands are printed as they are executed
. The file /run/initramfs/rdsosreport.txt is generated,
which contains all the logs and the output of all significant tools, which are
mentioned later.
If you want to save that output, simply mount /boot by hand or insert an USB
stick and mount that. Then you can store the output for later inspection.
[[information-to-include-in-your-report]]
=== Information to include in your report
[[all-bug-reports]]
==== All bug reports
In all cases, the following should be mentioned and attached to your bug report:
* The exact kernel command-line used. Typically from the bootloader
configuration file (e.g. _/boot/grub2/grub.cfg_) or from _/proc/cmdline_.
* A copy of your disk partition information from _/etc/fstab_, which might be
obtained booting an old working initramfs or a rescue medium.
* Turn on dracut debugging (see _the 'debugging dracut' section_), and attach
the file /run/initramfs/rdsosreport.txt.
* If you use a dracut configuration file, please include _/etc/dracut.conf_ and
all files in _/etc/dracut.conf.d/*.conf_
[[network-root-device-related-problems]]
==== Network root device related problems
This section details information to include when experiencing problems on a
system whose root device is located on a network attached volume (e.g. iSCSI,
NFS or NBD). As well as the information from <<all-bug-reports>>, include the
following information:
* Please include the output of
+
----
# /sbin/ifup <interfacename>
# ip addr show
----
[[debugging-dracut]]
=== Debugging dracut
[[configure-a-serial-console]]
==== Configure a serial console
Successfully debugging dracut will require some form of console
logging during the system boot. This section documents configuring a
serial console connection to record boot messages.
. First, enable serial console output for both the kernel and the bootloader.
. Open the file _/boot/grub2/grub.cfg_ for editing. Below the line ''timeout=5'', add
the following:
+
----
serial --unit=0 --speed=9600
terminal --timeout=5 serial console
----
+
. Also in _/boot/grub2/grub.cfg_, add the following boot arguemnts to the ''kernel''
line:
+
----
console=tty0 console=ttyS0,9600
----
+
. When finished, the _/boot/grub2/grub.cfg_ file should look similar to the example
below.
+
----
default=0
timeout=5
serial --unit=0 --speed=9600
terminal --timeout=5 serial console
title Fedora (2.6.29.5-191.fc11.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.29.5-191.fc11.x86_64 ro root=/dev/mapper/vg_uc1-lv_root console=tty0 console=ttyS0,9600
initrd /dracut-2.6.29.5-191.fc11.x86_64.img
----
+
. More detailed information on how to configure the kernel for console output
can be found at
http://www.faqs.org/docs/Linux-HOWTO/Remote-Serial-Console-HOWTO.html#CONFIGURE-KERNEL.
. Redirecting non-interactive output
+
--
NOTE: You can redirect all non-interactive output to _/dev/kmsg_ and the kernel
will put it out on the console when it reaches the kernel buffer by doing
----
# exec >/dev/kmsg 2>&1 </dev/console
----
--
[[using-the-dracut-shell]]
==== Using the dracut shell
dracut offers a shell for interactive debugging in the event dracut fails to
locate your root filesystem. To enable the shell:
. Add the boot parameter ''rd.shell'' to your bootloader configuration file
(e.g. _/boot/grub2/grub.cfg_)
. Remove the boot arguments ''rhgb'' and ''quiet''
+
A sample _/boot/grub2/grub.cfg_ bootloader configuration file is listed below.
+
----
default=0
timeout=5
serial --unit=0 --speed=9600
terminal --timeout=5 serial console
title Fedora (2.6.29.5-191.fc11.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.29.5-191.fc11.x86_64 ro root=/dev/mapper/vg_uc1-lv_root console=tty0 rd.shell
initrd /dracut-2.6.29.5-191.fc11.x86_64.img
----
+
. If system boot fails, you will be dropped into a shell as seen in the example
below.
+
----
No root device found
Dropping to debug shell.
#
----
+
. Use this shell prompt to gather the information requested above
(see <<all-bug-reports>>).
[[accessing-the-root-volume-from-the-dracut-shell]]
==== Accessing the root volume from the dracut shell
From the dracut debug shell, you can manually perform the task of locating and
preparing your root volume for boot. The required steps will depend on how your
root volume is configured. Common scenarios include:
* A block device (e.g. _/dev/sda7_)
* A LVM logical volume (e.g. _/dev/VolGroup00/LogVol00_)
* An encrypted device
(e.g. _/dev/mapper/luks-4d5972ea-901c-4584-bd75-1da802417d83_)
* A network attached device
(e.g. _netroot=iscsi:@192.168.0.4::3260::iqn.2009-02.org.example:for.all_)
The exact method for locating and preparing will vary. However, to continue with
a successful boot, the objective is to locate your root volume and create a
symlink _/dev/root_ which points to the file system. For example, the following
example demonstrates accessing and booting a root volume that is an encrypted
LVM Logical volume.
. Inspect your partitions using parted
+
----
# parted /dev/sda -s p
Model: ATA HTS541060G9AT00 (scsi)
Disk /dev/sda: 60.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 32.3kB 10.8GB 107MB primary ext4 boot
2 10.8GB 55.6GB 44.7GB logical lvm
----
+
. You recall that your root volume was a LVM logical volume. Scan and activate
any logical volumes.
+
----
# lvm vgscan
# lvm vgchange -ay
----
+
. You should see any logical volumes now using the command blkid:
+
----
# blkid
/dev/sda1: UUID="3de247f3-5de4-4a44-afc5-1fe179750cf7" TYPE="ext4"
/dev/sda2: UUID="Ek4dQw-cOtq-5MJu-OGRF-xz5k-O2l8-wdDj0I" TYPE="LVM2_member"
/dev/mapper/linux-root: UUID="def0269e-424b-4752-acf3-1077bf96ad2c" TYPE="crypto_LUKS"
/dev/mapper/linux-home: UUID="c69127c1-f153-4ea2-b58e-4cbfa9257c5e" TYPE="ext3"
/dev/mapper/linux-swap: UUID="47b4d329-975c-4c08-b218-f9c9bf3635f1" TYPE="swap"
----
+
. From the output above, you recall that your root volume exists on an encrypted
block device. Following the guidance disk encryption guidance from the
Installation Guide, you unlock your encrypted root volume.
+
----
# UUID=$(cryptsetup luksUUID /dev/mapper/linux-root)
# cryptsetup luksOpen /dev/mapper/linux-root luks-$UUID
Enter passphrase for /dev/mapper/linux-root:
Key slot 0 unlocked.
----
+
. Next, make a symbolic link to the unlocked root volume
+
----
# ln -s /dev/mapper/luks-$UUID /dev/root
----
+
. With the root volume available, you may continue booting the system by exiting
the dracut shell
+
----
# exit
----
[[additional-dracut-boot-parameters]]
==== Additional dracut boot parameters
For more debugging options, see *dracut.cmdline*(7).
[[debugging-dracut-on-shutdown]]
==== Debugging dracut on shutdown
To debug the shutdown sequence on systemd systems, you can _rd.break_
on _pre-shutdown_ or _shutdown_.
To do this from an already booted system:
----
# mkdir -p /run/initramfs/etc/cmdline.d
# echo "rd.debug rd.break=pre-shutdown rd.break=shutdown" > /run/initramfs/etc/cmdline.d/debug.conf
# touch /run/initramfs/.need_shutdown
----
This will give you a dracut shell after the system pivot'ed back in the
initramfs.

61
fedora-test.sh Executable file
View File

@@ -0,0 +1,61 @@
#!/bin/bash
set -ex
[[ -d ${0%/*} ]] && cd ${0%/*}
RUN_ID="$1"
TESTS=$2
dnf -y update --best --allowerasing &>/dev/null
dnf -y install --best --allowerasing \
dash \
asciidoc \
mdadm \
lvm2 \
dmraid \
cryptsetup \
nfs-utils \
nbd \
dhcp-server \
scsi-target-utils \
iscsi-initiator-utils \
strace \
btrfs-progs \
kmod-devel \
gcc \
bzip2 \
xz \
tar \
wget \
rpm-build \
make \
git \
bash-completion \
sudo \
kernel \
dhcp-client \
/usr/bin/qemu-kvm \
/usr/bin/qemu-system-$(uname -i) \
e2fsprogs \
$NULL &>/dev/null
./configure
NCPU=$(getconf _NPROCESSORS_ONLN)
if ! [[ $TESTS ]]; then
make -j$NCPU all syncheck rpm logtee
else
make -j$NCPU all logtee
cd test
time sudo make \
KVERSION=$(rpm -qa kernel --qf '%{VERSION}-%{RELEASE}.%{ARCH}\n' | sort -rn | head -1) \
TEST_RUN_ID=$RUN_ID \
${TESTS:+TESTS="$TESTS"} \
-k V=2 \
check
fi

64
git2spec.pl Executable file
View File

@@ -0,0 +1,64 @@
#!/usr/bin/perl
sub create_patches {
my $tag=shift;
my $pdir=shift;
my $n=1;
my @lines;
my $fname;
my $f=0;
mkdir $pdir, 0755;
open( GIT, 'git log -p --pretty=email --stat -m --first-parent --reverse '.$tag.'..HEAD |');
while (<GIT>) {
if (/^From [a-z0-9]{40} .*$/) {
$fname = sprintf("%04d", $n++).".patch";
open FH, ">".$pdir."/".$fname;
$f=1;
}
if (/^---$/ && $f == 1) {
push @lines, $fname;
$f=0;
}
print FH;
}
return @lines;
};
use POSIX qw(strftime);
my $datestr = strftime "%Y%m%d", gmtime;
my $tag=shift;
my $pdir=shift;
$tag=`git describe --abbrev=0 --tags` if not defined $tag;
chomp($tag);
my @patches=&create_patches($tag, $pdir);
my $num=$#patches + 2;
$tag=~s/[^0-9]+?([0-9]+)/$1/ if $tag !~ /\b[0-9a-f]{5,40}\b/;
my $release="$num.git$datestr";
$release="1" if $num == 1;
while(<>) {
if (/^Version:/) {
print "Version: $tag\n";
}
elsif (/^%define dist_free_release/) {
print "%define dist_free_release $release\n";
}
elsif ((/^Source0:/) || (/^Source:/)) {
print $_;
$num=1;
for(@patches) {
s/.*\///g;
print "Patch$num: $_\n";
$num++;
}
print "\n";
}
else {
print $_;
}
}

1
install/.kateconfig Normal file
View File

@@ -0,0 +1 @@
kate: space-indent on; tab-width 8; indent-width 8; replace-tabs on; eol unix;

7
install/Makefile Normal file
View File

@@ -0,0 +1,7 @@
all:
$(MAKE) -C ..
clean:
$(MAKE) -C .. clean
.PHONY: all clean

1821
install/dracut-install.c Normal file

File diff suppressed because it is too large Load Diff

729
install/hashmap.c Normal file
View File

@@ -0,0 +1,729 @@
/***
This file is part of systemd.
Copyright 2010 Lennart Poettering
systemd is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "util.h"
#include "hashmap.h"
#include "macro.h"
#define NBUCKETS 127
struct hashmap_entry {
const void *key;
void *value;
struct hashmap_entry *bucket_next, *bucket_previous;
struct hashmap_entry *iterate_next, *iterate_previous;
};
struct Hashmap {
hash_func_t hash_func;
compare_func_t compare_func;
struct hashmap_entry *iterate_list_head, *iterate_list_tail;
unsigned n_entries;
bool from_pool;
};
#define BY_HASH(h) ((struct hashmap_entry**) ((uint8_t*) (h) + ALIGN(sizeof(Hashmap))))
struct pool {
struct pool *next;
unsigned n_tiles;
unsigned n_used;
};
static struct pool *first_hashmap_pool = NULL;
static void *first_hashmap_tile = NULL;
static struct pool *first_entry_pool = NULL;
static void *first_entry_tile = NULL;
static void* allocate_tile(struct pool **first_pool, void **first_tile, size_t tile_size) {
unsigned i;
if (*first_tile) {
void *r;
r = *first_tile;
*first_tile = * (void**) (*first_tile);
return r;
}
if (_unlikely_(!*first_pool) || _unlikely_((*first_pool)->n_used >= (*first_pool)->n_tiles)) {
unsigned n;
size_t size;
struct pool *p;
n = *first_pool ? (*first_pool)->n_tiles : 0;
n = MAX(512U, n * 2);
size = PAGE_ALIGN(ALIGN(sizeof(struct pool)) + n*tile_size);
n = (size - ALIGN(sizeof(struct pool))) / tile_size;
p = malloc(size);
if (!p)
return NULL;
p->next = *first_pool;
p->n_tiles = n;
p->n_used = 0;
*first_pool = p;
}
i = (*first_pool)->n_used++;
return ((uint8_t*) (*first_pool)) + ALIGN(sizeof(struct pool)) + i*tile_size;
}
static void deallocate_tile(void **first_tile, void *p) {
* (void**) p = *first_tile;
*first_tile = p;
}
#ifndef __OPTIMIZE__
static void drop_pool(struct pool *p) {
while (p) {
struct pool *n;
n = p->next;
free(p);
p = n;
}
}
__attribute__((destructor)) static void cleanup_pool(void) {
/* Be nice to valgrind */
drop_pool(first_hashmap_pool);
drop_pool(first_entry_pool);
}
#endif
unsigned string_hash_func(const void *p) {
unsigned hash = 5381;
const signed char *c;
/* DJB's hash function */
for (c = p; *c; c++)
hash = (hash << 5) + hash + (unsigned) *c;
return hash;
}
int string_compare_func(const void *a, const void *b) {
return strcmp(a, b);
}
unsigned trivial_hash_func(const void *p) {
return PTR_TO_UINT(p);
}
int trivial_compare_func(const void *a, const void *b) {
return a < b ? -1 : (a > b ? 1 : 0);
}
Hashmap *hashmap_new(hash_func_t hash_func, compare_func_t compare_func) {
bool b;
Hashmap *h;
size_t size;
b = is_main_thread();
size = ALIGN(sizeof(Hashmap)) + NBUCKETS * sizeof(struct hashmap_entry*);
if (b) {
h = allocate_tile(&first_hashmap_pool, &first_hashmap_tile, size);
if (!h)
return NULL;
memset(h, 0, size);
} else {
h = malloc0(size);
if (!h)
return NULL;
}
h->hash_func = hash_func ? hash_func : trivial_hash_func;
h->compare_func = compare_func ? compare_func : trivial_compare_func;
h->n_entries = 0;
h->iterate_list_head = h->iterate_list_tail = NULL;
h->from_pool = b;
return h;
}
int hashmap_ensure_allocated(Hashmap **h, hash_func_t hash_func, compare_func_t compare_func) {
assert(h);
if (*h)
return 0;
if (!(*h = hashmap_new(hash_func, compare_func)))
return -ENOMEM;
return 0;
}
static void link_entry(Hashmap *h, struct hashmap_entry *e, unsigned hash) {
assert(h);
assert(e);
/* Insert into hash table */
e->bucket_next = BY_HASH(h)[hash];
e->bucket_previous = NULL;
if (BY_HASH(h)[hash])
BY_HASH(h)[hash]->bucket_previous = e;
BY_HASH(h)[hash] = e;
/* Insert into iteration list */
e->iterate_previous = h->iterate_list_tail;
e->iterate_next = NULL;
if (h->iterate_list_tail) {
assert(h->iterate_list_head);
h->iterate_list_tail->iterate_next = e;
} else {
assert(!h->iterate_list_head);
h->iterate_list_head = e;
}
h->iterate_list_tail = e;
h->n_entries++;
assert(h->n_entries >= 1);
}
static void unlink_entry(Hashmap *h, struct hashmap_entry *e, unsigned hash) {
assert(h);
assert(e);
/* Remove from iteration list */
if (e->iterate_next)
e->iterate_next->iterate_previous = e->iterate_previous;
else
h->iterate_list_tail = e->iterate_previous;
if (e->iterate_previous)
e->iterate_previous->iterate_next = e->iterate_next;
else
h->iterate_list_head = e->iterate_next;
/* Remove from hash table bucket list */
if (e->bucket_next)
e->bucket_next->bucket_previous = e->bucket_previous;
if (e->bucket_previous)
e->bucket_previous->bucket_next = e->bucket_next;
else
BY_HASH(h)[hash] = e->bucket_next;
assert(h->n_entries >= 1);
h->n_entries--;
}
static void remove_entry(Hashmap *h, struct hashmap_entry *e) {
unsigned hash;
assert(h);
assert(e);
hash = h->hash_func(e->key) % NBUCKETS;
unlink_entry(h, e, hash);
if (h->from_pool)
deallocate_tile(&first_entry_tile, e);
else
free(e);
}
void hashmap_free(Hashmap*h) {
if (!h)
return;
hashmap_clear(h);
if (h->from_pool)
deallocate_tile(&first_hashmap_tile, h);
else
free(h);
}
void hashmap_free_free(Hashmap *h) {
void *p;
while ((p = hashmap_steal_first(h)))
free(p);
hashmap_free(h);
}
void hashmap_clear(Hashmap *h) {
if (!h)
return;
while (h->iterate_list_head)
remove_entry(h, h->iterate_list_head);
}
static struct hashmap_entry *hash_scan(Hashmap *h, unsigned hash, const void *key) {
struct hashmap_entry *e;
assert(h);
assert(hash < NBUCKETS);
for (e = BY_HASH(h)[hash]; e; e = e->bucket_next)
if (h->compare_func(e->key, key) == 0)
return e;
return NULL;
}
int hashmap_put(Hashmap *h, const void *key, void *value) {
struct hashmap_entry *e;
unsigned hash;
assert(h);
hash = h->hash_func(key) % NBUCKETS;
if ((e = hash_scan(h, hash, key))) {
if (e->value == value)
return 0;
return -EEXIST;
}
if (h->from_pool)
e = allocate_tile(&first_entry_pool, &first_entry_tile, sizeof(struct hashmap_entry));
else
e = new(struct hashmap_entry, 1);
if (!e)
return -ENOMEM;
e->key = key;
e->value = value;
link_entry(h, e, hash);
return 1;
}
int hashmap_replace(Hashmap *h, const void *key, void *value) {
struct hashmap_entry *e;
unsigned hash;
assert(h);
hash = h->hash_func(key) % NBUCKETS;
if ((e = hash_scan(h, hash, key))) {
e->key = key;
e->value = value;
return 0;
}
return hashmap_put(h, key, value);
}
void* hashmap_get(Hashmap *h, const void *key) {
unsigned hash;
struct hashmap_entry *e;
if (!h)
return NULL;
hash = h->hash_func(key) % NBUCKETS;
if (!(e = hash_scan(h, hash, key)))
return NULL;
return e->value;
}
void* hashmap_remove(Hashmap *h, const void *key) {
struct hashmap_entry *e;
unsigned hash;
void *data;
if (!h)
return NULL;
hash = h->hash_func(key) % NBUCKETS;
if (!(e = hash_scan(h, hash, key)))
return NULL;
data = e->value;
remove_entry(h, e);
return data;
}
int hashmap_remove_and_put(Hashmap *h, const void *old_key, const void *new_key, void *value) {
struct hashmap_entry *e;
unsigned old_hash, new_hash;
if (!h)
return -ENOENT;
old_hash = h->hash_func(old_key) % NBUCKETS;
if (!(e = hash_scan(h, old_hash, old_key)))
return -ENOENT;
new_hash = h->hash_func(new_key) % NBUCKETS;
if (hash_scan(h, new_hash, new_key))
return -EEXIST;
unlink_entry(h, e, old_hash);
e->key = new_key;
e->value = value;
link_entry(h, e, new_hash);
return 0;
}
int hashmap_remove_and_replace(Hashmap *h, const void *old_key, const void *new_key, void *value) {
struct hashmap_entry *e, *k;
unsigned old_hash, new_hash;
if (!h)
return -ENOENT;
old_hash = h->hash_func(old_key) % NBUCKETS;
if (!(e = hash_scan(h, old_hash, old_key)))
return -ENOENT;
new_hash = h->hash_func(new_key) % NBUCKETS;
if ((k = hash_scan(h, new_hash, new_key)))
if (e != k)
remove_entry(h, k);
unlink_entry(h, e, old_hash);
e->key = new_key;
e->value = value;
link_entry(h, e, new_hash);
return 0;
}
void* hashmap_remove_value(Hashmap *h, const void *key, void *value) {
struct hashmap_entry *e;
unsigned hash;
if (!h)
return NULL;
hash = h->hash_func(key) % NBUCKETS;
if (!(e = hash_scan(h, hash, key)))
return NULL;
if (e->value != value)
return NULL;
remove_entry(h, e);
return value;
}
void *hashmap_iterate(Hashmap *h, Iterator *i, const void **key) {
struct hashmap_entry *e;
assert(i);
if (!h)
goto at_end;
if (*i == ITERATOR_LAST)
goto at_end;
if (*i == ITERATOR_FIRST && !h->iterate_list_head)
goto at_end;
e = *i == ITERATOR_FIRST ? h->iterate_list_head : (struct hashmap_entry*) *i;
if (e->iterate_next)
*i = (Iterator) e->iterate_next;
else
*i = ITERATOR_LAST;
if (key)
*key = e->key;
return e->value;
at_end:
*i = ITERATOR_LAST;
if (key)
*key = NULL;
return NULL;
}
void *hashmap_iterate_backwards(Hashmap *h, Iterator *i, const void **key) {
struct hashmap_entry *e;
assert(i);
if (!h)
goto at_beginning;
if (*i == ITERATOR_FIRST)
goto at_beginning;
if (*i == ITERATOR_LAST && !h->iterate_list_tail)
goto at_beginning;
e = *i == ITERATOR_LAST ? h->iterate_list_tail : (struct hashmap_entry*) *i;
if (e->iterate_previous)
*i = (Iterator) e->iterate_previous;
else
*i = ITERATOR_FIRST;
if (key)
*key = e->key;
return e->value;
at_beginning:
*i = ITERATOR_FIRST;
if (key)
*key = NULL;
return NULL;
}
void *hashmap_iterate_skip(Hashmap *h, const void *key, Iterator *i) {
unsigned hash;
struct hashmap_entry *e;
if (!h)
return NULL;
hash = h->hash_func(key) % NBUCKETS;
if (!(e = hash_scan(h, hash, key)))
return NULL;
*i = (Iterator) e;
return e->value;
}
void* hashmap_first(Hashmap *h) {
if (!h)
return NULL;
if (!h->iterate_list_head)
return NULL;
return h->iterate_list_head->value;
}
void* hashmap_first_key(Hashmap *h) {
if (!h)
return NULL;
if (!h->iterate_list_head)
return NULL;
return (void*) h->iterate_list_head->key;
}
void* hashmap_last(Hashmap *h) {
if (!h)
return NULL;
if (!h->iterate_list_tail)
return NULL;
return h->iterate_list_tail->value;
}
void* hashmap_steal_first(Hashmap *h) {
void *data;
if (!h)
return NULL;
if (!h->iterate_list_head)
return NULL;
data = h->iterate_list_head->value;
remove_entry(h, h->iterate_list_head);
return data;
}
void* hashmap_steal_first_key(Hashmap *h) {
void *key;
if (!h)
return NULL;
if (!h->iterate_list_head)
return NULL;
key = (void*) h->iterate_list_head->key;
remove_entry(h, h->iterate_list_head);
return key;
}
unsigned hashmap_size(Hashmap *h) {
if (!h)
return 0;
return h->n_entries;
}
bool hashmap_isempty(Hashmap *h) {
if (!h)
return true;
return h->n_entries == 0;
}
int hashmap_merge(Hashmap *h, Hashmap *other) {
struct hashmap_entry *e;
assert(h);
if (!other)
return 0;
for (e = other->iterate_list_head; e; e = e->iterate_next) {
int r;
if ((r = hashmap_put(h, e->key, e->value)) < 0)
if (r != -EEXIST)
return r;
}
return 0;
}
void hashmap_move(Hashmap *h, Hashmap *other) {
struct hashmap_entry *e, *n;
assert(h);
/* The same as hashmap_merge(), but every new item from other
* is moved to h. This function is guaranteed to succeed. */
if (!other)
return;
for (e = other->iterate_list_head; e; e = n) {
unsigned h_hash, other_hash;
n = e->iterate_next;
h_hash = h->hash_func(e->key) % NBUCKETS;
if (hash_scan(h, h_hash, e->key))
continue;
other_hash = other->hash_func(e->key) % NBUCKETS;
unlink_entry(other, e, other_hash);
link_entry(h, e, h_hash);
}
}
int hashmap_move_one(Hashmap *h, Hashmap *other, const void *key) {
unsigned h_hash, other_hash;
struct hashmap_entry *e;
if (!other)
return 0;
assert(h);
h_hash = h->hash_func(key) % NBUCKETS;
if (hash_scan(h, h_hash, key))
return -EEXIST;
other_hash = other->hash_func(key) % NBUCKETS;
if (!(e = hash_scan(other, other_hash, key)))
return -ENOENT;
unlink_entry(other, e, other_hash);
link_entry(h, e, h_hash);
return 0;
}
Hashmap *hashmap_copy(Hashmap *h) {
Hashmap *copy;
assert(h);
if (!(copy = hashmap_new(h->hash_func, h->compare_func)))
return NULL;
if (hashmap_merge(copy, h) < 0) {
hashmap_free(copy);
return NULL;
}
return copy;
}
char **hashmap_get_strv(Hashmap *h) {
char **sv;
Iterator it;
char *item;
int n;
sv = new(char*, h->n_entries+1);
if (!sv)
return NULL;
n = 0;
HASHMAP_FOREACH(item, h, it)
sv[n++] = item;
sv[n] = NULL;
return sv;
}

89
install/hashmap.h Normal file
View File

@@ -0,0 +1,89 @@
#ifndef foohashmaphfoo
#define foohashmaphfoo
/***
This file is part of systemd.
Copyright 2010 Lennart Poettering
systemd is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <stdbool.h>
/* Pretty straightforward hash table implementation. As a minor
* optimization a NULL hashmap object will be treated as empty hashmap
* for all read operations. That way it is not necessary to
* instantiate an object for each Hashmap use. */
typedef struct Hashmap Hashmap;
typedef struct _IteratorStruct _IteratorStruct;
typedef _IteratorStruct* Iterator;
#define ITERATOR_FIRST ((Iterator) 0)
#define ITERATOR_LAST ((Iterator) -1)
typedef unsigned (*hash_func_t)(const void *p);
typedef int (*compare_func_t)(const void *a, const void *b);
unsigned string_hash_func(const void *p);
int string_compare_func(const void *a, const void *b);
unsigned trivial_hash_func(const void *p);
int trivial_compare_func(const void *a, const void *b);
Hashmap *hashmap_new(hash_func_t hash_func, compare_func_t compare_func);
void hashmap_free(Hashmap *h);
void hashmap_free_free(Hashmap *h);
Hashmap *hashmap_copy(Hashmap *h);
int hashmap_ensure_allocated(Hashmap **h, hash_func_t hash_func, compare_func_t compare_func);
int hashmap_put(Hashmap *h, const void *key, void *value);
int hashmap_replace(Hashmap *h, const void *key, void *value);
void* hashmap_get(Hashmap *h, const void *key);
void* hashmap_remove(Hashmap *h, const void *key);
void* hashmap_remove_value(Hashmap *h, const void *key, void *value);
int hashmap_remove_and_put(Hashmap *h, const void *old_key, const void *new_key, void *value);
int hashmap_remove_and_replace(Hashmap *h, const void *old_key, const void *new_key, void *value);
int hashmap_merge(Hashmap *h, Hashmap *other);
void hashmap_move(Hashmap *h, Hashmap *other);
int hashmap_move_one(Hashmap *h, Hashmap *other, const void *key);
unsigned hashmap_size(Hashmap *h);
bool hashmap_isempty(Hashmap *h);
void *hashmap_iterate(Hashmap *h, Iterator *i, const void **key);
void *hashmap_iterate_backwards(Hashmap *h, Iterator *i, const void **key);
void *hashmap_iterate_skip(Hashmap *h, const void *key, Iterator *i);
void hashmap_clear(Hashmap *h);
void *hashmap_steal_first(Hashmap *h);
void *hashmap_steal_first_key(Hashmap *h);
void* hashmap_first(Hashmap *h);
void* hashmap_first_key(Hashmap *h);
void* hashmap_last(Hashmap *h);
char **hashmap_get_strv(Hashmap *h);
#define HASHMAP_FOREACH(e, h, i) \
for ((i) = ITERATOR_FIRST, (e) = hashmap_iterate((h), &(i), NULL); (e); (e) = hashmap_iterate((h), &(i), NULL))
#define HASHMAP_FOREACH_KEY(e, k, h, i) \
for ((i) = ITERATOR_FIRST, (e) = hashmap_iterate((h), &(i), (const void**) &(k)); (e); (e) = hashmap_iterate((h), &(i), (const void**) &(k)))
#define HASHMAP_FOREACH_BACKWARDS(e, h, i) \
for ((i) = ITERATOR_LAST, (e) = hashmap_iterate_backwards((h), &(i), NULL); (e); (e) = hashmap_iterate_backwards((h), &(i), NULL))
#endif

12
install/hashmap.lo Normal file
View File

@@ -0,0 +1,12 @@
# src/shared/hashmap.lo - a libtool object file
# Generated by libtool (GNU libtool) 2.4.2
#
# Please DO NOT delete this file!
# It is necessary for linking the library.
# Name of the PIC object.
pic_object='.libs/hashmap.o'
# Name of the non-PIC object
non_pic_object='hashmap.o'

293
install/log.c Normal file
View File

@@ -0,0 +1,293 @@
/***
This file is part of systemd.
Copyright 2010 Lennart Poettering
systemd is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <stdarg.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <stddef.h>
#include "log.h"
#include "util.h"
#include "macro.h"
#define SNDBUF_SIZE (8*1024*1024)
static LogTarget log_target = LOG_TARGET_CONSOLE;
static int log_max_level = LOG_WARNING;
static int log_facility = LOG_DAEMON;
static int console_fd = STDERR_FILENO;
static bool show_location = false;
/* Akin to glibc's __abort_msg; which is private and we hence cannot
* use here. */
static char *log_abort_msg = NULL;
void log_close_console(void) {
if (console_fd < 0)
return;
if (getpid() == 1) {
if (console_fd >= 3)
close_nointr_nofail(console_fd);
console_fd = -1;
}
}
static int log_open_console(void) {
if (console_fd >= 0)
return 0;
if (getpid() == 1) {
console_fd = open_terminal("/dev/console", O_WRONLY|O_NOCTTY|O_CLOEXEC);
if (console_fd < 0) {
log_error("Failed to open /dev/console for logging: %s", strerror(-console_fd));
return console_fd;
}
log_debug("Successfully opened /dev/console for logging.");
} else
console_fd = STDERR_FILENO;
return 0;
}
int log_open(void) {
return log_open_console();
}
void log_close(void) {
log_close_console();
}
void log_set_max_level(int level) {
assert((level & LOG_PRIMASK) == level);
log_max_level = level;
}
void log_set_facility(int facility) {
log_facility = facility;
}
static int write_to_console(
int level,
const char*file,
unsigned int line,
const char *func,
const char *buffer) {
struct iovec iovec[5];
unsigned n = 0;
if (console_fd < 0)
return 0;
zero(iovec);
IOVEC_SET_STRING(iovec[n++], "dracut-install: ");
if (show_location) {
char location[64];
if (snprintf(location, sizeof(location), "(%s:%u) ", file, line) <= 0)
return -errno;
IOVEC_SET_STRING(iovec[n++], location);
}
IOVEC_SET_STRING(iovec[n++], buffer);
IOVEC_SET_STRING(iovec[n++], "\n");
if (writev(console_fd, iovec, n) < 0)
return -errno;
return 1;
}
static int log_dispatch(
int level,
const char*file,
int line,
const char *func,
char *buffer) {
int r = 0;
if (log_target == LOG_TARGET_NULL)
return 0;
/* Patch in LOG_DAEMON facility if necessary */
if ((level & LOG_FACMASK) == 0)
level = log_facility | LOG_PRI(level);
do {
char *e;
int k = 0;
buffer += strspn(buffer, NEWLINE);
if (buffer[0] == 0)
break;
if ((e = strpbrk(buffer, NEWLINE)))
*(e++) = 0;
k = write_to_console(level, file, line, func, buffer);
if (k < 0)
return k;
buffer = e;
} while (buffer);
return r;
}
int log_metav(
int level,
const char*file,
int line,
const char *func,
const char *format,
va_list ap) {
char buffer[LINE_MAX];
int saved_errno, r;
if (_likely_(LOG_PRI(level) > log_max_level))
return 0;
saved_errno = errno;
vsnprintf(buffer, sizeof(buffer), format, ap);
char_array_0(buffer);
r = log_dispatch(level, file, line, func, buffer);
errno = saved_errno;
return r;
}
int log_meta(
int level,
const char*file,
int line,
const char *func,
const char *format, ...) {
int r;
va_list ap;
va_start(ap, format);
r = log_metav(level, file, line, func, format, ap);
va_end(ap);
return r;
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
_noreturn_ static void log_assert(const char *text, const char *file, int line, const char *func, const char *format) {
static char buffer[LINE_MAX];
snprintf(buffer, sizeof(buffer), format, text, file, line, func);
char_array_0(buffer);
log_abort_msg = buffer;
log_dispatch(LOG_CRIT, file, line, func, buffer);
abort();
}
#pragma GCC diagnostic pop
_noreturn_ void log_assert_failed(const char *text, const char *file, int line, const char *func) {
log_assert(text, file, line, func, "Assertion '%s' failed at %s:%u, function %s(). Aborting.");
}
_noreturn_ void log_assert_failed_unreachable(const char *text, const char *file, int line, const char *func) {
log_assert(text, file, line, func, "Code should not be reached '%s' at %s:%u, function %s(). Aborting.");
}
void log_set_target(LogTarget target) {
assert(target >= 0);
assert(target < _LOG_TARGET_MAX);
log_target = target;
}
int log_set_target_from_string(const char *e) {
LogTarget t;
t = log_target_from_string(e);
if (t < 0)
return -EINVAL;
log_set_target(t);
return 0;
}
int log_set_max_level_from_string(const char *e) {
int t;
t = log_level_from_string(e);
if (t < 0)
return t;
log_set_max_level(t);
return 0;
}
void log_parse_environment(void) {
const char *e;
if ((e = getenv("DRACUT_LOG_TARGET")))
if (log_set_target_from_string(e) < 0)
log_warning("Failed to parse log target %s. Ignoring.", e);
if ((e = getenv("DRACUT_LOG_LEVEL")))
if (log_set_max_level_from_string(e) < 0)
log_warning("Failed to parse log level %s. Ignoring.", e);
}
LogTarget log_get_target(void) {
return log_target;
}
int log_get_max_level(void) {
return log_max_level;
}
static const char *const log_target_table[] = {
[LOG_TARGET_CONSOLE] = "console",
[LOG_TARGET_AUTO] = "auto",
[LOG_TARGET_SAFE] = "safe",
[LOG_TARGET_NULL] = "null"
};
DEFINE_STRING_TABLE_LOOKUP(log_target, LogTarget);

113
install/log.h Normal file
View File

@@ -0,0 +1,113 @@
#ifndef foologhfoo
#define foologhfoo
/***
This file is part of systemd.
Copyright 2010 Lennart Poettering
systemd is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <syslog.h>
#include <stdbool.h>
#include <stdarg.h>
#include "macro.h"
typedef enum LogTarget{
LOG_TARGET_CONSOLE,
LOG_TARGET_KMSG,
LOG_TARGET_JOURNAL,
LOG_TARGET_JOURNAL_OR_KMSG,
LOG_TARGET_SYSLOG,
LOG_TARGET_SYSLOG_OR_KMSG,
LOG_TARGET_AUTO, /* console if stderr is tty, JOURNAL_OR_KMSG otherwise */
LOG_TARGET_SAFE, /* console if stderr is tty, KMSG otherwise */
LOG_TARGET_NULL,
_LOG_TARGET_MAX,
_LOG_TARGET_INVALID = -1
} LogTarget;
void log_set_target(LogTarget target);
void log_set_max_level(int level);
void log_set_facility(int facility);
int log_set_target_from_string(const char *e);
int log_set_max_level_from_string(const char *e);
void log_show_color(bool b);
void log_show_location(bool b);
int log_show_color_from_string(const char *e);
int log_show_location_from_string(const char *e);
LogTarget log_get_target(void);
int log_get_max_level(void);
int log_open(void);
void log_close(void);
void log_forget_fds(void);
void log_close_syslog(void);
void log_close_journal(void);
void log_close_kmsg(void);
void log_close_console(void);
void log_parse_environment(void);
int log_meta(
int level,
const char*file,
int line,
const char *func,
const char *format, ...) _printf_attr_(5,6);
int log_metav(
int level,
const char*file,
int line,
const char *func,
const char *format,
va_list ap);
_noreturn_ void log_assert_failed(const char *text, const char *file, int line, const char *func);
_noreturn_ void log_assert_failed_unreachable(const char *text, const char *file, int line, const char *func);
/* This modifies the buffer passed! */
int log_dump_internal(
int level,
const char*file,
int line,
const char *func,
char *buffer);
#define log_full(level, ...) log_meta(level, __FILE__, __LINE__, __func__, __VA_ARGS__)
#define log_debug(...) log_meta(LOG_DEBUG, __FILE__, __LINE__, __func__, __VA_ARGS__)
#define log_info(...) log_meta(LOG_INFO, __FILE__, __LINE__, __func__, __VA_ARGS__)
#define log_notice(...) log_meta(LOG_NOTICE, __FILE__, __LINE__, __func__, __VA_ARGS__)
#define log_warning(...) log_meta(LOG_WARNING, __FILE__, __LINE__, __func__, __VA_ARGS__)
#define log_error(...) log_meta(LOG_ERR, __FILE__, __LINE__, __func__, __VA_ARGS__)
/* This modifies the buffer passed! */
#define log_dump(level, buffer) log_dump_internal(level, __FILE__, __LINE__, __func__, buffer)
const char *log_target_to_string(LogTarget target);
LogTarget log_target_from_string(const char *s);
const char *log_level_to_string(int i);
int log_level_from_string(const char *s);
#endif

282
install/macro.h Normal file
View File

@@ -0,0 +1,282 @@
#pragma once
/***
This file is part of systemd.
Copyright 2010 Lennart Poettering
systemd is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <assert.h>
#include <sys/param.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <inttypes.h>
#define _printf_attr_(a,b) __attribute__ ((format (printf, a, b)))
#define _sentinel_ __attribute__ ((sentinel))
#define _noreturn_ __attribute__((noreturn))
#define _unused_ __attribute__ ((unused))
#define _destructor_ __attribute__ ((destructor))
#define _pure_ __attribute__ ((pure))
#define _const_ __attribute__ ((const))
#define _deprecated_ __attribute__ ((deprecated))
#define _packed_ __attribute__ ((packed))
#define _malloc_ __attribute__ ((malloc))
#define _weak_ __attribute__ ((weak))
#define _likely_(x) (__builtin_expect(!!(x),1))
#define _unlikely_(x) (__builtin_expect(!!(x),0))
#define _public_ __attribute__ ((visibility("default")))
#define _hidden_ __attribute__ ((visibility("hidden")))
#define _weakref_(x) __attribute__((weakref(#x)))
#define _introspect_(x) __attribute__((section("introspect." x)))
#define _alignas_(x) __attribute__((aligned(__alignof(x))))
#define _cleanup_(x) __attribute__((cleanup(x)))
/* automake test harness */
#define EXIT_TEST_SKIP 77
#define XSTRINGIFY(x) #x
#define STRINGIFY(x) XSTRINGIFY(x)
/* Rounds up */
#define ALIGN4(l) (((l) + 3) & ~3)
#define ALIGN8(l) (((l) + 7) & ~7)
#if __SIZEOF_POINTER__ == 8
#define ALIGN(l) ALIGN8(l)
#elif __SIZEOF_POINTER__ == 4
#define ALIGN(l) ALIGN4(l)
#else
#error "Wut? Pointers are neither 4 nor 8 bytes long?"
#endif
#define ALIGN_PTR(p) ((void*) ALIGN((unsigned long) p))
#define ALIGN4_PTR(p) ((void*) ALIGN4((unsigned long) p))
#define ALIGN8_PTR(p) ((void*) ALIGN8((unsigned long) p))
static inline size_t ALIGN_TO(size_t l, size_t ali) {
return ((l + ali - 1) & ~(ali - 1));
}
#define ALIGN_TO_PTR(p, ali) ((void*) ALIGN_TO((unsigned long) p))
#define ELEMENTSOF(x) (sizeof(x)/sizeof((x)[0]))
/*
* container_of - cast a member of a structure out to the containing structure
* @ptr: the pointer to the member.
* @type: the type of the container struct this is embedded in.
* @member: the name of the member within the struct.
*
*/
#define container_of(ptr, type, member) \
__extension__ ({ \
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
(type *)( (char *)__mptr - offsetof(type,member) ); \
})
#undef MAX
#define MAX(a,b) \
__extension__ ({ \
typeof(a) _a = (a); \
typeof(b) _b = (b); \
_a > _b ? _a : _b; \
})
#define MAX3(x,y,z) \
__extension__ ({ \
typeof(x) _c = MAX(x,y); \
MAX(_c, z); \
})
#undef MIN
#define MIN(a,b) \
__extension__ ({ \
typeof(a) _a = (a); \
typeof(b) _b = (b); \
_a < _b ? _a : _b; \
})
#ifndef CLAMP
#define CLAMP(x, low, high) \
__extension__ ({ \
typeof(x) _x = (x); \
typeof(low) _low = (low); \
typeof(high) _high = (high); \
((_x > _high) ? _high : ((_x < _low) ? _low : _x)); \
})
#endif
#define assert_se(expr) \
do { \
if (_unlikely_(!(expr))) \
log_assert_failed(#expr, __FILE__, __LINE__, __PRETTY_FUNCTION__); \
} while (false) \
/* We override the glibc assert() here. */
#undef assert
#ifdef NDEBUG
#define assert(expr) do {} while(false)
#else
#define assert(expr) assert_se(expr)
#endif
#define assert_not_reached(t) \
do { \
log_assert_failed_unreachable(t, __FILE__, __LINE__, __PRETTY_FUNCTION__); \
} while (false)
#if defined(static_assert)
#define assert_cc(expr) \
do { \
static_assert(expr, #expr); \
} while (false)
#else
#define assert_cc(expr) \
do { \
switch (0) { \
case 0: \
case !!(expr): \
; \
} \
} while (false)
#endif
#define PTR_TO_UINT(p) ((unsigned int) ((uintptr_t) (p)))
#define UINT_TO_PTR(u) ((void*) ((uintptr_t) (u)))
#define PTR_TO_UINT32(p) ((uint32_t) ((uintptr_t) (p)))
#define UINT32_TO_PTR(u) ((void*) ((uintptr_t) (u)))
#define PTR_TO_ULONG(p) ((unsigned long) ((uintptr_t) (p)))
#define ULONG_TO_PTR(u) ((void*) ((uintptr_t) (u)))
#define PTR_TO_INT(p) ((int) ((intptr_t) (p)))
#define INT_TO_PTR(u) ((void*) ((intptr_t) (u)))
#define TO_INT32(p) ((int32_t) ((intptr_t) (p)))
#define INT32_TO_PTR(u) ((void*) ((intptr_t) (u)))
#define PTR_TO_LONG(p) ((long) ((intptr_t) (p)))
#define LONG_TO_PTR(u) ((void*) ((intptr_t) (u)))
#define memzero(x,l) (memset((x), 0, (l)))
#define zero(x) (memzero(&(x), sizeof(x)))
#define CHAR_TO_STR(x) ((char[2]) { x, 0 })
#define char_array_0(x) x[sizeof(x)-1] = 0;
#define IOVEC_SET_STRING(i, s) \
do { \
struct iovec *_i = &(i); \
char *_s = (char *)(s); \
_i->iov_base = _s; \
_i->iov_len = strlen(_s); \
} while(false)
static inline size_t IOVEC_TOTAL_SIZE(const struct iovec *i, unsigned n) {
unsigned j;
size_t r = 0;
for (j = 0; j < n; j++)
r += i[j].iov_len;
return r;
}
static inline size_t IOVEC_INCREMENT(struct iovec *i, unsigned n, size_t k) {
unsigned j;
for (j = 0; j < n; j++) {
size_t sub;
if (_unlikely_(k == 0))
break;
sub = MIN(i[j].iov_len, k);
i[j].iov_len -= sub;
i[j].iov_base = (uint8_t*) i[j].iov_base + sub;
k -= sub;
}
return k;
}
#define VA_FORMAT_ADVANCE(format, ap) \
do { \
int _argtypes[128]; \
size_t _i, _k; \
_k = parse_printf_format((format), ELEMENTSOF(_argtypes), _argtypes); \
assert(_k < ELEMENTSOF(_argtypes)); \
for (_i = 0; _i < _k; _i++) { \
if (_argtypes[_i] & PA_FLAG_PTR) { \
(void) va_arg(ap, void*); \
continue; \
} \
\
switch (_argtypes[_i]) { \
case PA_INT: \
case PA_INT|PA_FLAG_SHORT: \
case PA_CHAR: \
(void) va_arg(ap, int); \
break; \
case PA_INT|PA_FLAG_LONG: \
(void) va_arg(ap, long int); \
break; \
case PA_INT|PA_FLAG_LONG_LONG: \
(void) va_arg(ap, long long int); \
break; \
case PA_WCHAR: \
(void) va_arg(ap, wchar_t); \
break; \
case PA_WSTRING: \
case PA_STRING: \
case PA_POINTER: \
(void) va_arg(ap, void*); \
break; \
case PA_FLOAT: \
case PA_DOUBLE: \
(void) va_arg(ap, double); \
break; \
case PA_DOUBLE|PA_FLAG_LONG_DOUBLE: \
(void) va_arg(ap, long double); \
break; \
default: \
assert_not_reached("Unknown format string argument."); \
} \
} \
} while(false)
/* Because statfs.t_type can be int on some architecures, we have to cast
* the const magic to the type, otherwise the compiler warns about
* signed/unsigned comparison, because the magic can be 32 bit unsigned.
*/
#define F_TYPE_CMP(a, b) (a == (typeof(a)) b)
/* Returns the number of chars needed to format variables of the
* specified type as a decimal string. Adds in extra space for a
* negative '-' prefix. */
#define DECIMAL_STR_MAX(type) \
(1+(sizeof(type) <= 1 ? 3 : \
sizeof(type) <= 2 ? 5 : \
sizeof(type) <= 4 ? 10 : \
sizeof(type) <= 8 ? 20 : sizeof(int[-2*(sizeof(type) > 8)])))
#include "log.h"

585
install/strv.c Normal file
View File

@@ -0,0 +1,585 @@
/***
This file is part of systemd.
Copyright 2010 Lennart Poettering
systemd is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <assert.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <errno.h>
#include "util.h"
#include "strv.h"
char *strv_find(char **l, const char *name) {
char **i;
assert(name);
STRV_FOREACH(i, l)
if (streq(*i, name))
return *i;
return NULL;
}
char *strv_find_prefix(char **l, const char *name) {
char **i;
assert(name);
STRV_FOREACH(i, l)
if (startswith(*i, name))
return *i;
return NULL;
}
void strv_free(char **l) {
char **k;
if (!l)
return;
for (k = l; *k; k++)
free(*k);
free(l);
}
char **strv_copy(char * const *l) {
char **r, **k;
k = r = new(char*, strv_length(l) + 1);
if (!r)
return NULL;
if (l)
for (; *l; k++, l++) {
*k = strdup(*l);
if (!*k) {
strv_free(r);
return NULL;
}
}
*k = NULL;
return r;
}
unsigned int strv_length(char * const *l) {
unsigned n = 0;
if (!l)
return 0;
for (; *l; l++)
n++;
return n;
}
char **strv_new_ap(const char *x, va_list ap) {
const char *s;
char **a;
unsigned n = 0, i = 0;
va_list aq;
/* As a special trick we ignore all listed strings that equal
* (const char*) -1. This is supposed to be used with the
* STRV_IFNOTNULL() macro to include possibly NULL strings in
* the string list. */
if (x) {
n = x == (const char*) -1 ? 0 : 1;
va_copy(aq, ap);
while ((s = va_arg(aq, const char*))) {
if (s == (const char*) -1)
continue;
n++;
}
va_end(aq);
}
a = new(char*, n+1);
if (!a)
return NULL;
if (x) {
if (x != (const char*) -1) {
a[i] = strdup(x);
if (!a[i])
goto fail;
i++;
}
while ((s = va_arg(ap, const char*))) {
if (s == (const char*) -1)
continue;
a[i] = strdup(s);
if (!a[i])
goto fail;
i++;
}
}
a[i] = NULL;
return a;
fail:
strv_free(a);
return NULL;
}
char **strv_new(const char *x, ...) {
char **r;
va_list ap;
va_start(ap, x);
r = strv_new_ap(x, ap);
va_end(ap);
return r;
}
char **strv_merge(char **a, char **b) {
char **r, **k;
if (!a)
return strv_copy(b);
if (!b)
return strv_copy(a);
r = new(char*, strv_length(a) + strv_length(b) + 1);
if (!r)
return NULL;
for (k = r; *a; k++, a++) {
*k = strdup(*a);
if (!*k)
goto fail;
}
for (; *b; k++, b++) {
*k = strdup(*b);
if (!*k)
goto fail;
}
*k = NULL;
return r;
fail:
strv_free(r);
return NULL;
}
char **strv_merge_concat(char **a, char **b, const char *suffix) {
char **r, **k;
/* Like strv_merge(), but appends suffix to all strings in b, before adding */
if (!b)
return strv_copy(a);
r = new(char*, strv_length(a) + strv_length(b) + 1);
if (!r)
return NULL;
k = r;
if (a)
for (; *a; k++, a++) {
*k = strdup(*a);
if (!*k)
goto fail;
}
for (; *b; k++, b++) {
*k = strappend(*b, suffix);
if (!*k)
goto fail;
}
*k = NULL;
return r;
fail:
strv_free(r);
return NULL;
}
char **strv_split(const char *s, const char *separator) {
char *state;
char *w;
size_t l;
unsigned n, i;
char **r;
assert(s);
n = 0;
FOREACH_WORD_SEPARATOR(w, l, s, separator, state)
n++;
r = new(char*, n+1);
if (!r)
return NULL;
i = 0;
FOREACH_WORD_SEPARATOR(w, l, s, separator, state) {
r[i] = strndup(w, l);
if (!r[i]) {
strv_free(r);
return NULL;
}
i++;
}
r[i] = NULL;
return r;
}
char **strv_split_quoted(const char *s) {
char *state;
char *w;
size_t l;
unsigned n, i;
char **r;
assert(s);
n = 0;
FOREACH_WORD_QUOTED(w, l, s, state)
n++;
r = new(char*, n+1);
if (!r)
return NULL;
i = 0;
FOREACH_WORD_QUOTED(w, l, s, state) {
r[i] = cunescape_length(w, l);
if (!r[i]) {
strv_free(r);
return NULL;
}
i++;
}
r[i] = NULL;
return r;
}
char **strv_split_newlines(const char *s) {
char **l;
unsigned int n;
assert(s);
/* Special version of strv_split() that splits on newlines and
* suppresses an empty string at the end */
l = strv_split(s, NEWLINE);
if (!l)
return NULL;
n = strv_length(l);
if (n == 0)
return l;
if (isempty(l[n-1])) {
free(l[n-1]);
l[n-1] = NULL;
}
return l;
}
char *strv_join(char **l, const char *separator) {
char *r, *e;
char **s;
size_t n, k;
if (!separator)
separator = " ";
k = strlen(separator);
n = 0;
STRV_FOREACH(s, l) {
if (n != 0)
n += k;
n += strlen(*s);
}
r = new(char, n+1);
if (!r)
return NULL;
e = r;
STRV_FOREACH(s, l) {
if (e != r)
e = stpcpy(e, separator);
e = stpcpy(e, *s);
}
*e = 0;
return r;
}
char **strv_append(char **l, const char *s) {
char **r, **k;
if (!l)
return strv_new(s, NULL);
if (!s)
return strv_copy(l);
r = new(char*, strv_length(l)+2);
if (!r)
return NULL;
for (k = r; *l; k++, l++) {
*k = strdup(*l);
if (!*k)
goto fail;
}
k[0] = strdup(s);
if (!k[0])
goto fail;
k[1] = NULL;
return r;
fail:
strv_free(r);
return NULL;
}
int strv_push(char ***l, char *value) {
char **c;
unsigned n;
if (!value)
return 0;
n = strv_length(*l);
c = realloc(*l, sizeof(char*) * (n + 2));
if (!c)
return -ENOMEM;
c[n] = value;
c[n+1] = NULL;
*l = c;
return 0;
}
int strv_extend(char ***l, const char *value) {
char *v;
int r;
if (!value)
return 0;
v = strdup(value);
if (!v)
return -ENOMEM;
r = strv_push(l, v);
if (r < 0)
free(v);
return r;
}
char **strv_uniq(char **l) {
char **i;
/* Drops duplicate entries. The first identical string will be
* kept, the others dropped */
STRV_FOREACH(i, l)
strv_remove(i+1, *i);
return l;
}
char **strv_remove(char **l, const char *s) {
char **f, **t;
if (!l)
return NULL;
assert(s);
/* Drops every occurrence of s in the string list, edits
* in-place. */
for (f = t = l; *f; f++) {
if (streq(*f, s)) {
free(*f);
continue;
}
*(t++) = *f;
}
*t = NULL;
return l;
}
char **strv_remove_prefix(char **l, const char *s) {
char **f, **t;
if (!l)
return NULL;
assert(s);
/* Drops every occurrence of a string prefixed with s in the
* string list, edits in-place. */
for (f = t = l; *f; f++) {
if (startswith(*f, s)) {
free(*f);
continue;
}
*(t++) = *f;
}
*t = NULL;
return l;
}
char **strv_parse_nulstr(const char *s, size_t l) {
const char *p;
unsigned c = 0, i = 0;
char **v;
assert(s || l == 0);
if (l == 0)
return new0(char*, 1);
for (p = s; p < s + l; p++)
if (*p == 0)
c++;
if (s[l-1] != 0)
c++;
v = new0(char*, c+1);
if (!v)
return NULL;
p = s;
while (p < s + l) {
const char *e;
e = memchr(p, 0, s + l - p);
v[i] = strndup(p, e ? e - p : s + l - p);
if (!v[i]) {
strv_free(v);
return NULL;
}
i++;
if (!e)
break;
p = e + 1;
}
assert(i == c);
return v;
}
char **strv_split_nulstr(const char *s) {
const char *i;
char **r = NULL;
NULSTR_FOREACH(i, s)
if (strv_extend(&r, i) < 0) {
strv_free(r);
return NULL;
}
if (!r)
return strv_new(NULL, NULL);
return r;
}
bool strv_overlap(char **a, char **b) {
char **i, **j;
STRV_FOREACH(i, a) {
STRV_FOREACH(j, b) {
if (streq(*i, *j))
return true;
}
}
return false;
}
static int str_compare(const void *_a, const void *_b) {
const char **a = (const char**) _a, **b = (const char**) _b;
return strcmp(*a, *b);
}
char **strv_sort(char **l) {
if (strv_isempty(l))
return l;
qsort(l, strv_length(l), sizeof(char*), str_compare);
return l;
}
void strv_print(char **l) {
char **s;
if (!l)
return;
STRV_FOREACH(s, l)
puts(*s);
}

116
install/strv.h Normal file
View File

@@ -0,0 +1,116 @@
#pragma once
/***
This file is part of systemd.
Copyright 2010 Lennart Poettering
systemd is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <stdarg.h>
#include <stdbool.h>
#include "util.h"
char *strv_find(char **l, const char *name) _pure_;
char *strv_find_prefix(char **l, const char *name) _pure_;
void strv_free(char **l);
DEFINE_TRIVIAL_CLEANUP_FUNC(char**, strv_free);
#define _cleanup_strv_free_ _cleanup_(strv_freep)
char **strv_copy(char * const *l);
unsigned int strv_length(char * const *l) _pure_;
char **strv_merge(char **a, char **b);
char **strv_merge_concat(char **a, char **b, const char *suffix);
char **strv_append(char **l, const char *s);
int strv_extend(char ***l, const char *value);
int strv_push(char ***l, char *value);
char **strv_remove(char **l, const char *s);
char **strv_remove_prefix(char **l, const char *s);
char **strv_uniq(char **l);
#define strv_contains(l, s) (!!strv_find((l), (s)))
char **strv_new(const char *x, ...) _sentinel_;
char **strv_new_ap(const char *x, va_list ap);
static inline const char* STRV_IFNOTNULL(const char *x) {
return x ? x : (const char *) -1;
}
static inline bool strv_isempty(char * const *l) {
return !l || !*l;
}
char **strv_split(const char *s, const char *separator);
char **strv_split_quoted(const char *s);
char **strv_split_newlines(const char *s);
char *strv_join(char **l, const char *separator);
char **strv_parse_nulstr(const char *s, size_t l);
char **strv_split_nulstr(const char *s);
bool strv_overlap(char **a, char **b) _pure_;
#define STRV_FOREACH(s, l) \
for ((s) = (l); (s) && *(s); (s)++)
#define STRV_FOREACH_BACKWARDS(s, l) \
STRV_FOREACH(s, l) \
; \
for ((s)--; (l) && ((s) >= (l)); (s)--)
#define STRV_FOREACH_PAIR(x, y, l) \
for ((x) = (l), (y) = (x+1); (x) && *(x) && *(y); (x) += 2, (y) = (x + 1))
char **strv_sort(char **l);
void strv_print(char **l);
#define STRV_MAKE(...) ((char**) ((const char*[]) { __VA_ARGS__, NULL }))
#define STRV_MAKE_EMPTY ((char*[1]) { NULL })
#define strv_from_stdarg_alloca(first) \
({ \
char **_l; \
\
if (!first) \
_l = (char**) &first; \
else { \
unsigned _n; \
va_list _ap; \
\
_n = 1; \
va_start(_ap, first); \
while (va_arg(_ap, char*)) \
_n++; \
va_end(_ap); \
\
_l = newa(char*, _n+1); \
_l[_n = 0] = (char*) first; \
va_start(_ap, first); \
for (;;) { \
_l[++_n] = va_arg(_ap, char*); \
if (!_l[_n]) \
break; \
} \
va_end(_ap); \
} \
_l; \
})

514
install/util.c Normal file
View File

@@ -0,0 +1,514 @@
/***
This file is part of systemd.
Copyright 2010 Lennart Poettering
systemd is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/syscall.h>
#include "util.h"
static inline pid_t gettid(void) {
return (pid_t) syscall(SYS_gettid);
}
size_t page_size(void) {
static __thread size_t pgsz = 0;
long r;
if (_likely_(pgsz > 0))
return pgsz;
assert_se((r = sysconf(_SC_PAGESIZE)) > 0);
pgsz = (size_t) r;
return pgsz;
}
bool endswith(const char *s, const char *postfix) {
size_t sl, pl;
assert(s);
assert(postfix);
sl = strlen(s);
pl = strlen(postfix);
if (pl == 0)
return true;
if (sl < pl)
return false;
return memcmp(s + sl - pl, postfix, pl) == 0;
}
int close_nointr(int fd) {
assert(fd >= 0);
for (;;) {
int r;
r = close(fd);
if (r >= 0)
return r;
if (errno != EINTR)
return -errno;
}
}
void close_nointr_nofail(int fd) {
int saved_errno = errno;
/* like close_nointr() but cannot fail, and guarantees errno
* is unchanged */
assert_se(close_nointr(fd) == 0);
errno = saved_errno;
}
int open_terminal(const char *name, int mode) {
int fd, r;
unsigned c = 0;
/*
* If a TTY is in the process of being closed opening it might
* cause EIO. This is horribly awful, but unlikely to be
* changed in the kernel. Hence we work around this problem by
* retrying a couple of times.
*
* https://bugs.launchpad.net/ubuntu/+source/linux/+bug/554172/comments/245
*/
for (;;) {
if ((fd = open(name, mode)) >= 0)
break;
if (errno != EIO)
return -errno;
if (c >= 20)
return -errno;
usleep(50 * USEC_PER_MSEC);
c++;
}
if (fd < 0)
return -errno;
if ((r = isatty(fd)) < 0) {
close_nointr_nofail(fd);
return -errno;
}
if (!r) {
close_nointr_nofail(fd);
return -ENOTTY;
}
return fd;
}
bool streq_ptr(const char *a, const char *b) {
/* Like streq(), but tries to make sense of NULL pointers */
if (a && b)
return streq(a, b);
if (!a && !b)
return true;
return false;
}
bool is_main_thread(void) {
static __thread int cached = 0;
if (_unlikely_(cached == 0))
cached = getpid() == gettid() ? 1 : -1;
return cached > 0;
}
int safe_atou(const char *s, unsigned *ret_u) {
char *x = NULL;
unsigned long l;
assert(s);
assert(ret_u);
errno = 0;
l = strtoul(s, &x, 0);
if (!x || *x || errno)
return errno ? -errno : -EINVAL;
if ((unsigned long) (unsigned) l != l)
return -ERANGE;
*ret_u = (unsigned) l;
return 0;
}
static const char *const log_level_table[] = {
[LOG_EMERG] = "emerg",
[LOG_ALERT] = "alert",
[LOG_CRIT] = "crit",
[LOG_ERR] = "err",
[LOG_WARNING] = "warning",
[LOG_NOTICE] = "notice",
[LOG_INFO] = "info",
[LOG_DEBUG] = "debug"
};
DEFINE_STRING_TABLE_LOOKUP(log_level, int);
char *strnappend(const char *s, const char *suffix, size_t b) {
size_t a;
char *r;
if (!s && !suffix)
return strdup("");
if (!s)
return strndup(suffix, b);
if (!suffix)
return strdup(s);
assert(s);
assert(suffix);
a = strlen(s);
if (b > ((size_t) -1) - a)
return NULL;
r = new(char, a+b+1);
if (!r)
return NULL;
memcpy(r, s, a);
memcpy(r+a, suffix, b);
r[a+b] = 0;
return r;
}
char *strappend(const char *s, const char *suffix) {
return strnappend(s, suffix, suffix ? strlen(suffix) : 0);
}
char *strjoin(const char *x, ...) {
va_list ap;
size_t l;
char *r;
va_start(ap, x);
if (x) {
l = strlen(x);
for (;;) {
const char *t;
size_t n;
t = va_arg(ap, const char *);
if (!t)
break;
n = strlen(t);
if (n > ((size_t) -1) - l) {
va_end(ap);
return NULL;
}
l += n;
}
} else
l = 0;
va_end(ap);
r = new(char, l+1);
if (!r)
return NULL;
if (x) {
char *p;
p = stpcpy(r, x);
va_start(ap, x);
for (;;) {
const char *t;
t = va_arg(ap, const char *);
if (!t)
break;
p = stpcpy(p, t);
}
va_end(ap);
} else
r[0] = 0;
return r;
}
char *cunescape_length_with_prefix(const char *s, size_t length, const char *prefix) {
char *r, *t;
const char *f;
size_t pl;
assert(s);
/* Undoes C style string escaping, and optionally prefixes it. */
pl = prefix ? strlen(prefix) : 0;
r = new(char, pl+length+1);
if (!r)
return r;
if (prefix)
memcpy(r, prefix, pl);
for (f = s, t = r + pl; f < s + length; f++) {
if (*f != '\\') {
*(t++) = *f;
continue;
}
f++;
switch (*f) {
case 'a':
*(t++) = '\a';
break;
case 'b':
*(t++) = '\b';
break;
case 'f':
*(t++) = '\f';
break;
case 'n':
*(t++) = '\n';
break;
case 'r':
*(t++) = '\r';
break;
case 't':
*(t++) = '\t';
break;
case 'v':
*(t++) = '\v';
break;
case '\\':
*(t++) = '\\';
break;
case '"':
*(t++) = '"';
break;
case '\'':
*(t++) = '\'';
break;
case 's':
/* This is an extension of the XDG syntax files */
*(t++) = ' ';
break;
case 'x': {
/* hexadecimal encoding */
int a, b;
a = unhexchar(f[1]);
b = unhexchar(f[2]);
if (a < 0 || b < 0) {
/* Invalid escape code, let's take it literal then */
*(t++) = '\\';
*(t++) = 'x';
} else {
*(t++) = (char) ((a << 4) | b);
f += 2;
}
break;
}
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7': {
/* octal encoding */
int a, b, c;
a = unoctchar(f[0]);
b = unoctchar(f[1]);
c = unoctchar(f[2]);
if (a < 0 || b < 0 || c < 0) {
/* Invalid escape code, let's take it literal then */
*(t++) = '\\';
*(t++) = f[0];
} else {
*(t++) = (char) ((a << 6) | (b << 3) | c);
f += 2;
}
break;
}
case 0:
/* premature end of string.*/
*(t++) = '\\';
goto finish;
default:
/* Invalid escape code, let's take it literal then */
*(t++) = '\\';
*(t++) = *f;
break;
}
}
finish:
*t = 0;
return r;
}
char *cunescape_length(const char *s, size_t length) {
return cunescape_length_with_prefix(s, length, NULL);
}
/* Split a string into words, but consider strings enclosed in '' and
* "" as words even if they include spaces. */
char *split_quoted(const char *c, size_t *l, char **state) {
const char *current, *e;
bool escaped = false;
assert(c);
assert(l);
assert(state);
current = *state ? *state : c;
current += strspn(current, WHITESPACE);
if (*current == 0)
return NULL;
else if (*current == '\'') {
current ++;
for (e = current; *e; e++) {
if (escaped)
escaped = false;
else if (*e == '\\')
escaped = true;
else if (*e == '\'')
break;
}
*l = e-current;
*state = (char*) (*e == 0 ? e : e+1);
} else if (*current == '\"') {
current ++;
for (e = current; *e; e++) {
if (escaped)
escaped = false;
else if (*e == '\\')
escaped = true;
else if (*e == '\"')
break;
}
*l = e-current;
*state = (char*) (*e == 0 ? e : e+1);
} else {
for (e = current; *e; e++) {
if (escaped)
escaped = false;
else if (*e == '\\')
escaped = true;
else if (strchr(WHITESPACE, *e))
break;
}
*l = e-current;
*state = (char*) e;
}
return (char*) current;
}
/* Split a string into words. */
char *split(const char *c, size_t *l, const char *separator, char **state) {
char *current;
current = *state ? *state : (char*) c;
if (!*current || *c == 0)
return NULL;
current += strspn(current, separator);
*l = strcspn(current, separator);
*state = current+*l;
return (char*) current;
}
int unhexchar(char c) {
if (c >= '0' && c <= '9')
return c - '0';
if (c >= 'a' && c <= 'f')
return c - 'a' + 10;
if (c >= 'A' && c <= 'F')
return c - 'A' + 10;
return -1;
}
int unoctchar(char c) {
if (c >= '0' && c <= '7')
return c - '0';
return -1;
}

586
install/util.h Normal file
View File

@@ -0,0 +1,586 @@
#ifndef fooutilhfoo
#define fooutilhfoo
/***
This file is part of systemd.
Copyright 2010 Lennart Poettering
systemd is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
#define _GNU_SOURCE
#include <inttypes.h>
#include <time.h>
#include <sys/time.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <signal.h>
#include <sched.h>
#include <limits.h>
#include <sys/stat.h>
#include <dirent.h>
#include <sys/resource.h>
#include "macro.h"
typedef uint64_t usec_t;
typedef uint64_t nsec_t;
typedef struct dual_timestamp {
usec_t realtime;
usec_t monotonic;
} dual_timestamp;
#define MSEC_PER_SEC 1000ULL
#define USEC_PER_SEC 1000000ULL
#define USEC_PER_MSEC 1000ULL
#define NSEC_PER_SEC 1000000000ULL
#define NSEC_PER_MSEC 1000000ULL
#define NSEC_PER_USEC 1000ULL
#define USEC_PER_MINUTE (60ULL*USEC_PER_SEC)
#define NSEC_PER_MINUTE (60ULL*NSEC_PER_SEC)
#define USEC_PER_HOUR (60ULL*USEC_PER_MINUTE)
#define NSEC_PER_HOUR (60ULL*NSEC_PER_MINUTE)
#define USEC_PER_DAY (24ULL*USEC_PER_HOUR)
#define NSEC_PER_DAY (24ULL*NSEC_PER_HOUR)
#define USEC_PER_WEEK (7ULL*USEC_PER_DAY)
#define NSEC_PER_WEEK (7ULL*NSEC_PER_DAY)
#define USEC_PER_MONTH (2629800ULL*USEC_PER_SEC)
#define NSEC_PER_MONTH (2629800ULL*NSEC_PER_SEC)
#define USEC_PER_YEAR (31557600ULL*USEC_PER_SEC)
#define NSEC_PER_YEAR (31557600ULL*NSEC_PER_SEC)
/* What is interpreted as whitespace? */
#define WHITESPACE " \t\n\r"
#define NEWLINE "\n\r"
#define QUOTES "\"\'"
#define COMMENTS "#;\n"
#define FORMAT_TIMESTAMP_MAX 64
#define FORMAT_TIMESTAMP_PRETTY_MAX 256
#define FORMAT_TIMESPAN_MAX 64
#define FORMAT_BYTES_MAX 8
#define ANSI_HIGHLIGHT_ON "\x1B[1;39m"
#define ANSI_HIGHLIGHT_RED_ON "\x1B[1;31m"
#define ANSI_HIGHLIGHT_GREEN_ON "\x1B[1;32m"
#define ANSI_HIGHLIGHT_YELLOW_ON "\x1B[1;33m"
#define ANSI_HIGHLIGHT_OFF "\x1B[0m"
usec_t now(clockid_t clock);
dual_timestamp* dual_timestamp_get(dual_timestamp *ts);
dual_timestamp* dual_timestamp_from_realtime(dual_timestamp *ts, usec_t u);
#define dual_timestamp_is_set(ts) ((ts)->realtime > 0)
usec_t timespec_load(const struct timespec *ts);
struct timespec *timespec_store(struct timespec *ts, usec_t u);
usec_t timeval_load(const struct timeval *tv);
struct timeval *timeval_store(struct timeval *tv, usec_t u);
size_t page_size(void);
#define PAGE_ALIGN(l) ALIGN_TO((l), page_size())
#define streq(a,b) (strcmp((a),(b)) == 0)
#define strneq(a, b, n) (strncmp((a), (b), (n)) == 0)
bool streq_ptr(const char *a, const char *b);
#define new(t, n) ((t*) malloc(sizeof(t)*(n)))
#define new0(t, n) ((t*) calloc((n), sizeof(t)))
#define newa(t, n) ((t*) alloca(sizeof(t)*(n)))
#define newdup(t, p, n) ((t*) memdup(p, sizeof(t)*(n)))
#define malloc0(n) (calloc((n), 1))
static inline const char* yes_no(bool b) {
return b ? "yes" : "no";
}
static inline const char* strempty(const char *s) {
return s ? s : "";
}
static inline const char* strnull(const char *s) {
return s ? s : "(null)";
}
static inline const char *strna(const char *s) {
return s ? s : "n/a";
}
static inline bool isempty(const char *p) {
return !p || !p[0];
}
static inline const char *startswith(const char *s, const char *prefix) {
if (strncmp(s, prefix, strlen(prefix)) == 0)
return s + strlen(prefix);
return NULL;
}
bool endswith(const char *s, const char *postfix);
bool startswith_no_case(const char *s, const char *prefix);
bool first_word(const char *s, const char *word);
int close_nointr(int fd);
void close_nointr_nofail(int fd);
void close_many(const int fds[], unsigned n_fd);
int parse_boolean(const char *v);
int parse_usec(const char *t, usec_t *usec);
int parse_nsec(const char *t, nsec_t *nsec);
int parse_bytes(const char *t, off_t *bytes);
int parse_pid(const char *s, pid_t* ret_pid);
int parse_uid(const char *s, uid_t* ret_uid);
#define parse_gid(s, ret_uid) parse_uid(s, ret_uid)
int safe_atou(const char *s, unsigned *ret_u);
int safe_atoi(const char *s, int *ret_i);
int safe_atollu(const char *s, unsigned long long *ret_u);
int safe_atolli(const char *s, long long int *ret_i);
#if LONG_MAX == INT_MAX
static inline int safe_atolu(const char *s, unsigned long *ret_u) {
assert_cc(sizeof(unsigned long) == sizeof(unsigned));
return safe_atou(s, (unsigned*) ret_u);
}
static inline int safe_atoli(const char *s, long int *ret_u) {
assert_cc(sizeof(long int) == sizeof(int));
return safe_atoi(s, (int*) ret_u);
}
#else
static inline int safe_atolu(const char *s, unsigned long *ret_u) {
assert_cc(sizeof(unsigned long) == sizeof(unsigned long long));
return safe_atollu(s, (unsigned long long*) ret_u);
}
static inline int safe_atoli(const char *s, long int *ret_u) {
assert_cc(sizeof(long int) == sizeof(long long int));
return safe_atolli(s, (long long int*) ret_u);
}
#endif
static inline int safe_atou32(const char *s, uint32_t *ret_u) {
assert_cc(sizeof(uint32_t) == sizeof(unsigned));
return safe_atou(s, (unsigned*) ret_u);
}
static inline int safe_atoi32(const char *s, int32_t *ret_i) {
assert_cc(sizeof(int32_t) == sizeof(int));
return safe_atoi(s, (int*) ret_i);
}
static inline int safe_atou64(const char *s, uint64_t *ret_u) {
assert_cc(sizeof(uint64_t) == sizeof(unsigned long long));
return safe_atollu(s, (unsigned long long*) ret_u);
}
static inline int safe_atoi64(const char *s, int64_t *ret_i) {
assert_cc(sizeof(int64_t) == sizeof(long long int));
return safe_atolli(s, (long long int*) ret_i);
}
char *split(const char *c, size_t *l, const char *separator, char **state);
char *split_quoted(const char *c, size_t *l, char **state);
#define FOREACH_WORD(word, length, s, state) \
for ((state) = NULL, (word) = split((s), &(length), WHITESPACE, &(state)); (word); (word) = split((s), &(length), WHITESPACE, &(state)))
#define FOREACH_WORD_SEPARATOR(word, length, s, separator, state) \
for ((state) = NULL, (word) = split((s), &(length), (separator), &(state)); (word); (word) = split((s), &(length), (separator), &(state)))
#define FOREACH_WORD_QUOTED(word, length, s, state) \
for ((state) = NULL, (word) = split_quoted((s), &(length), &(state)); (word); (word) = split_quoted((s), &(length), &(state)))
pid_t get_parent_of_pid(pid_t pid, pid_t *ppid);
int get_starttime_of_pid(pid_t pid, unsigned long long *st);
int write_one_line_file(const char *fn, const char *line);
int write_one_line_file_atomic(const char *fn, const char *line);
int read_one_line_file(const char *fn, char **line);
int read_full_file(const char *fn, char **contents, size_t *size);
int parse_env_file(const char *fname, const char *separator, ...) _sentinel_;
int load_env_file(const char *fname, char ***l);
int write_env_file(const char *fname, char **l);
char *strappend(const char *s, const char *suffix);
char *strnappend(const char *s, const char *suffix, size_t length);
char *replace_env(const char *format, char **env);
char **replace_env_argv(char **argv, char **env);
int readlink_malloc(const char *p, char **r);
int readlink_and_make_absolute(const char *p, char **r);
int readlink_and_canonicalize(const char *p, char **r);
int reset_all_signal_handlers(void);
char *strstrip(char *s);
char *delete_chars(char *s, const char *bad);
char *truncate_nl(char *s);
char *file_in_same_dir(const char *path, const char *filename);
int rmdir_parents(const char *path, const char *stop);
int get_process_comm(pid_t pid, char **name);
int get_process_cmdline(pid_t pid, size_t max_length, bool comm_fallback, char **line);
int get_process_exe(pid_t pid, char **name);
int get_process_uid(pid_t pid, uid_t *uid);
char hexchar(int x);
int unhexchar(char c);
char octchar(int x);
int unoctchar(char c);
char decchar(int x);
int undecchar(char c);
char *cescape(const char *s);
char *cunescape(const char *s);
char *cunescape_length(const char *s, size_t length);
char *xescape(const char *s, const char *bad);
char *bus_path_escape(const char *s);
char *bus_path_unescape(const char *s);
char *ascii_strlower(char *path);
bool dirent_is_file(const struct dirent *de);
bool dirent_is_file_with_suffix(const struct dirent *de, const char *suffix);
bool ignore_file(const char *filename);
bool chars_intersect(const char *a, const char *b);
char *format_timestamp(char *buf, size_t l, usec_t t);
char *format_timestamp_pretty(char *buf, size_t l, usec_t t);
char *format_timespan(char *buf, size_t l, usec_t t);
int make_stdio(int fd);
int make_null_stdio(void);
unsigned long long random_ull(void);
#define __DEFINE_STRING_TABLE_LOOKUP(name,type,scope) \
scope const char *name##_to_string(type i) { \
if (i < 0 || i >= (type) ELEMENTSOF(name##_table)) \
return NULL; \
return name##_table[i]; \
} \
scope type name##_from_string(const char *s) { \
type i; \
unsigned u = 0; \
assert(s); \
for (i = 0; i < (type)ELEMENTSOF(name##_table); i++) \
if (name##_table[i] && \
streq(name##_table[i], s)) \
return i; \
if (safe_atou(s, &u) >= 0 && \
u < ELEMENTSOF(name##_table)) \
return (type) u; \
return (type) -1; \
} \
struct __useless_struct_to_allow_trailing_semicolon__
#define DEFINE_STRING_TABLE_LOOKUP(name,type) __DEFINE_STRING_TABLE_LOOKUP(name,type,)
#define DEFINE_PRIVATE_STRING_TABLE_LOOKUP(name,type) __DEFINE_STRING_TABLE_LOOKUP(name,type,static)
int fd_nonblock(int fd, bool nonblock);
int fd_cloexec(int fd, bool cloexec);
int close_all_fds(const int except[], unsigned n_except);
bool fstype_is_network(const char *fstype);
int chvt(int vt);
int read_one_char(FILE *f, char *ret, usec_t timeout, bool *need_nl);
int ask(char *ret, const char *replies, const char *text, ...);
int reset_terminal_fd(int fd, bool switch_to_text);
int reset_terminal(const char *name);
int open_terminal(const char *name, int mode);
int acquire_terminal(const char *name, bool fail, bool force, bool ignore_tiocstty_eperm);
int release_terminal(void);
int flush_fd(int fd);
int ignore_signals(int sig, ...);
int default_signals(int sig, ...);
int sigaction_many(const struct sigaction *sa, ...);
int close_pipe(int p[]);
int fopen_temporary(const char *path, FILE **_f, char **_temp_path);
ssize_t loop_read(int fd, void *buf, size_t nbytes, bool do_poll);
ssize_t loop_write(int fd, const void *buf, size_t nbytes, bool do_poll);
bool is_device_path(const char *path);
int dir_is_empty(const char *path);
void rename_process(const char name[8]);
void sigset_add_many(sigset_t *ss, ...);
char* gethostname_malloc(void);
bool hostname_is_set(void);
char* getlogname_malloc(void);
int getttyname_malloc(int fd, char **r);
int getttyname_harder(int fd, char **r);
int get_ctty_devnr(pid_t pid, dev_t *d);
int get_ctty(pid_t, dev_t *_devnr, char **r);
int chmod_and_chown(const char *path, mode_t mode, uid_t uid, gid_t gid);
int fchmod_and_fchown(int fd, mode_t mode, uid_t uid, gid_t gid);
int rm_rf_children(int fd, bool only_dirs, bool honour_sticky, struct stat *root_dev);
int rm_rf(const char *path, bool only_dirs, bool delete_root, bool honour_sticky);
int pipe_eof(int fd);
cpu_set_t* cpu_set_malloc(unsigned *ncpus);
void status_vprintf(const char *status, bool ellipse, const char *format, va_list ap);
void status_printf(const char *status, bool ellipse, const char *format, ...);
void status_welcome(void);
int fd_columns(int fd);
unsigned columns(void);
int fd_lines(int fd);
unsigned lines(void);
int running_in_chroot(void);
char *ellipsize(const char *s, size_t length, unsigned percent);
char *ellipsize_mem(const char *s, size_t old_length, size_t new_length, unsigned percent);
int touch(const char *path);
char *unquote(const char *s, const char *quotes);
char *normalize_env_assignment(const char *s);
int wait_for_terminate(pid_t pid, siginfo_t *status);
int wait_for_terminate_and_warn(const char *name, pid_t pid);
_noreturn_ void freeze(void);
bool null_or_empty(struct stat *st);
int null_or_empty_path(const char *fn);
DIR *xopendirat(int dirfd, const char *name, int flags);
void dual_timestamp_serialize(FILE *f, const char *name, dual_timestamp *t);
void dual_timestamp_deserialize(const char *value, dual_timestamp *t);
char *fstab_node_to_udev_node(const char *p);
bool tty_is_vc(const char *tty);
bool tty_is_vc_resolve(const char *tty);
bool tty_is_console(const char *tty);
int vtnr_from_tty(const char *tty);
const char *default_term_for_tty(const char *tty);
void execute_directory(const char *directory, DIR *_d, char *argv[]);
int kill_and_sigcont(pid_t pid, int sig);
bool nulstr_contains(const char*nulstr, const char *needle);
bool plymouth_running(void);
void parse_syslog_priority(char **p, int *priority);
void skip_syslog_pid(char **buf);
void skip_syslog_date(char **buf);
bool hostname_is_valid(const char *s);
char* hostname_cleanup(char *s);
char* strshorten(char *s, size_t l);
int terminal_vhangup_fd(int fd);
int terminal_vhangup(const char *name);
int vt_disallocate(const char *name);
int copy_file(const char *from, const char *to);
int symlink_or_copy(const char *from, const char *to);
int symlink_or_copy_atomic(const char *from, const char *to);
int fchmod_umask(int fd, mode_t mode);
bool display_is_local(const char *display);
int socket_from_display(const char *display, char **path);
int get_user_creds(const char **username, uid_t *uid, gid_t *gid, const char **home);
int get_group_creds(const char **groupname, gid_t *gid);
int in_group(const char *name);
int glob_exists(const char *path);
int dirent_ensure_type(DIR *d, struct dirent *de);
int in_search_path(const char *path, char **search);
int get_files_in_directory(const char *path, char ***list);
char *join(const char *x, ...) _sentinel_;
bool is_main_thread(void);
bool in_charset(const char *s, const char* charset);
int block_get_whole_disk(dev_t d, dev_t *ret);
int file_is_priv_sticky(const char *p);
int strdup_or_null(const char *a, char **b);
#define NULSTR_FOREACH(i, l) \
for ((i) = (l); (i) && *(i); (i) = strchr((i), 0)+1)
#define NULSTR_FOREACH_PAIR(i, j, l) \
for ((i) = (l), (j) = strchr((i), 0)+1; (i) && *(i); (i) = strchr((j), 0)+1, (j) = *(i) ? strchr((i), 0)+1 : (i))
const char *ioprio_class_to_string(int i);
int ioprio_class_from_string(const char *s);
const char *sigchld_code_to_string(int i);
int sigchld_code_from_string(const char *s);
const char *log_facility_unshifted_to_string(int i);
int log_facility_unshifted_from_string(const char *s);
const char *log_level_to_string(int i);
int log_level_from_string(const char *s);
const char *sched_policy_to_string(int i);
int sched_policy_from_string(const char *s);
const char *rlimit_to_string(int i);
int rlimit_from_string(const char *s);
const char *ip_tos_to_string(int i);
int ip_tos_from_string(const char *s);
const char *signal_to_string(int i);
int signal_from_string(const char *s);
int signal_from_string_try_harder(const char *s);
extern int saved_argc;
extern char **saved_argv;
bool kexec_loaded(void);
int prot_from_flags(int flags);
char *format_bytes(char *buf, size_t l, off_t t);
int fd_wait_for_event(int fd, int event, usec_t timeout);
void* memdup(const void *p, size_t l);
int is_kernel_thread(pid_t pid);
static inline void freep(void *p) {
free(*(void**) p);
}
static inline void fclosep(FILE **f) {
if (*f)
fclose(*f);
}
static inline void pclosep(FILE **f) {
if (*f)
pclose(*f);
}
static inline void closep(int *fd) {
if (*fd >= 0)
close_nointr_nofail(*fd);
}
static inline void closedirp(DIR **d) {
if (*d)
closedir(*d);
}
static inline void umaskp(mode_t *u) {
umask(*u);
}
#define _cleanup_free_ _cleanup_(freep)
#define _cleanup_fclose_ _cleanup_(fclosep)
#define _cleanup_pclose_ _cleanup_(pclosep)
#define _cleanup_close_ _cleanup_(closep)
#define _cleanup_closedir_ _cleanup_(closedirp)
#define _cleanup_umask_ _cleanup_(umaskp)
#define _cleanup_globfree_ _cleanup_(globfree)
int fd_inc_sndbuf(int fd, size_t n);
int fd_inc_rcvbuf(int fd, size_t n);
int fork_agent(pid_t *pid, const int except[], unsigned n_except, const char *path, ...);
int setrlimit_closest(int resource, const struct rlimit *rlim);
int getenv_for_pid(pid_t pid, const char *field, char **_value);
int can_sleep(const char *type);
bool is_valid_documentation_url(const char *url);
bool in_initrd(void);
void warn_melody(void);
char *strjoin(const char *x, ...) _sentinel_;
#define DEFINE_TRIVIAL_CLEANUP_FUNC(type, func) \
static inline void func##p(type *p) { \
if (*p) \
func(*p); \
} \
struct __useless_struct_to_allow_trailing_semicolon__
char *split_quoted(const char *c, size_t *l, char **state);
char *cunescape_length(const char *s, size_t length);
int unhexchar(char c) _const_;
int unoctchar(char c) _const_;
#endif

54
logtee.c Normal file
View File

@@ -0,0 +1,54 @@
#define _GNU_SOURCE
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <limits.h>
#define BUFLEN 4096
int
main(int argc, char *argv[])
{
int fd;
int len, slen;
if (argc != 2) {
fprintf(stderr, "Usage: %s <file>\n", argv[0]);
exit(EXIT_FAILURE);
}
fd = open(argv[1], O_WRONLY | O_CREAT | O_TRUNC, 0644);
if (fd == -1) {
perror("open");
exit(EXIT_FAILURE);
}
fprintf(stderr, "Logging to %s: ", argv[1]);
slen = 0;
do {
len = splice(STDIN_FILENO, NULL, fd, NULL,
BUFLEN, SPLICE_F_MOVE);
if (len < 0) {
if (errno == EAGAIN)
continue;
perror("tee");
exit(EXIT_FAILURE);
} else
if (len == 0)
break;
slen += len;
if ((slen/BUFLEN) > 0) {
fprintf(stderr, ".");
}
slen = slen % BUFLEN;
} while (1);
close(fd);
fprintf(stderr, "\n");
exit(EXIT_SUCCESS);
}

View File

@@ -0,0 +1,60 @@
#
# Copyright 2013 Red Hat, Inc. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
__contains_word () {
local word=$1; shift
for w in $*; do [[ $w = $word ]] && return 0; done
return 1
}
_lsinitrd() {
local field_vals= cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
local -A OPTS=(
[STANDALONE]='-s --size -h --help'
[ARG]='-f --file -k --kver'
)
if __contains_word "$prev" ${OPTS[ARG]}; then
case $prev in
--file|-f)
comps=$(compgen -f -- "$cur")
compopt -o filenames
;;
--kver|-k)
comps=$(cd /lib/modules; echo [0-9]*)
;;
*)
return 0
;;
esac
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
return 0
fi
if [[ $cur = -* ]]; then
COMPREPLY=( $(compgen -W '${OPTS[*]}' -- "$cur") )
return 0
fi
comps=$(compgen -f -- "$cur")
compopt -o filenames
COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
return 0
}
complete -F _lsinitrd lsinitrd

67
lsinitrd.1.asc Normal file
View File

@@ -0,0 +1,67 @@
LSINITRD(1)
=========
:doctype: manpage
:man source: dracut
:man manual: dracut
NAME
----
lsinitrd - tool to show the contents of an initramfs image
SYNOPSIS
--------
*lsinitrd* ['OPTION...'] [<image> [<filename> [<filename> [...] ]]]
*lsinitrd* ['OPTION...'] -k <kernel-version>
DESCRIPTION
-----------
lsinitrd shows the contents of an initramfs image. if <image> is omitted, then
lsinitrd uses the default image _/boot/<machine-id>/<kernel-version>/initrd_ or
_/boot/initramfs-<kernel-version>.img_.
OPTIONS
-------
**-h, --help**::
print a help message and exit.
**-s, --size**::
sort the contents of the initramfs by size.
**-f, --file** _<filename>_::
print the contents of <filename>.
**-k, --kver** _<kernel version>_::
inspect the initramfs of <kernel version>.
**-m, --mod**::
list dracut modules included of the initramfs image.
**--unpack**::
unpack the initramfs to the current directory, instead of displaying the contents.
If optional filenames are given, will only unpack specified files, else the whole image will be unpacked.
Won't unpack anything from early cpio part.
**--unpackearly**::
unpack the early microcode initramfs to the current directory, instead of displaying the contents.
Same as --unpack, but only unpack files from early cpio part.
**-v, --verbose**::
unpack verbosely
AVAILABILITY
------------
The lsinitrd command is part of the dracut package and is available from
link:$$https://dracut.wiki.kernel.org$$[https://dracut.wiki.kernel.org]
AUTHORS
-------
Harald Hoyer
Amerigo Wang
Nikoli
SEE ALSO
--------
*dracut*(8)

293
lsinitrd.sh Executable file
View File

@@ -0,0 +1,293 @@
#!/bin/bash
#
# Copyright 2005-2010 Harald Hoyer <harald@redhat.com>
# Copyright 2005-2010 Red Hat, Inc. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
usage()
{
{
echo "Usage: ${0##*/} [options] [<initramfs file> [<filename> [<filename> [...] ]]]"
echo "Usage: ${0##*/} [options] -k <kernel version>"
echo
echo "-h, --help print a help message and exit."
echo "-s, --size sort the contents of the initramfs by size."
echo "-m, --mod list modules."
echo "-f, --file <filename> print the contents of <filename>."
echo "--unpack unpack the initramfs, instead of displaying the contents."
echo " If optional filenames are given, will only unpack specified files,"
echo " else the whole image will be unpacked. Won't unpack anything from early cpio part."
echo "--unpackearly unpack the early microcode part of the initramfs."
echo " Same as --unpack, but only unpack files from early cpio part."
echo "-v, --verbose unpack verbosely."
echo "-k, --kver <kernel version> inspect the initramfs of <kernel version>."
echo
} >&2
}
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
sorted=0
modules=0
unset verbose
declare -A filenames
unset POSIXLY_CORRECT
TEMP=$(getopt \
-o "vshmf:k:" \
--long kver: \
--long file: \
--long mod \
--long help \
--long size \
--long unpack \
--long unpackearly \
--long verbose \
-- "$@")
if (( $? != 0 )); then
usage
exit 1
fi
eval set -- "$TEMP"
while (($# > 0)); do
case $1 in
-k|--kver) KERNEL_VERSION="$2"; shift;;
-f|--file) filenames[${2#/}]=1; shift;;
-s|--size) sorted=1;;
-h|--help) usage; exit 0;;
-m|--mod) modules=1;;
-v|--verbose) verbose="--verbose";;
--unpack) unpack=1;;
--unpackearly) unpackearly=1;;
--) shift;break;;
*) usage; exit 1;;
esac
shift
done
[[ $KERNEL_VERSION ]] || KERNEL_VERSION="$(uname -r)"
if [[ $1 ]]; then
image="$1"
if ! [[ -f "$image" ]]; then
{
echo "$image does not exist"
echo
} >&2
usage
exit 1
fi
else
[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
if [[ -d /boot/loader/entries || -L /boot/loader/entries ]] \
&& [[ $MACHINE_ID ]] \
&& [[ -d /boot/${MACHINE_ID} || -L /boot/${MACHINE_ID} ]] ; then
image="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
else
image="/boot/initramfs-${KERNEL_VERSION}.img"
fi
fi
shift
while (($# > 0)); do
filenames[${1#/}]=1;
shift
done
if ! [[ -f "$image" ]]; then
{
echo "No <initramfs file> specified and the default image '$image' cannot be accessed!"
echo
} >&2
usage
exit 1
fi
dracutlibdirs() {
for d in lib64/dracut lib/dracut usr/lib64/dracut usr/lib/dracut; do
echo "$d/$1"
done
}
extract_files()
{
(( ${#filenames[@]} == 1 )) && nofileinfo=1
for f in "${!filenames[@]}"; do
[[ $nofileinfo ]] || echo "initramfs:/$f"
[[ $nofileinfo ]] || echo "========================================================================"
$CAT "$image" 2>/dev/null | cpio --extract --verbose --quiet --to-stdout "$f" 2>/dev/null
((ret+=$?))
[[ $nofileinfo ]] || echo "========================================================================"
[[ $nofileinfo ]] || echo
done
}
list_modules()
{
echo "dracut modules:"
$CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- \
$(dracutlibdirs modules.txt) 2>/dev/null
((ret+=$?))
}
list_files()
{
echo "========================================================================"
if [ "$sorted" -eq 1 ]; then
$CAT "$image" 2>/dev/null | cpio --extract --verbose --quiet --list | sort -n -k5
else
$CAT "$image" 2>/dev/null | cpio --extract --verbose --quiet --list | sort -k9
fi
((ret+=$?))
echo "========================================================================"
}
unpack_files()
{
if (( ${#filenames[@]} > 0 )); then
for f in "${!filenames[@]}"; do
$CAT "$image" 2>/dev/null | cpio -id --quiet $verbose $f
((ret+=$?))
done
else
$CAT "$image" 2>/dev/null | cpio -id --quiet $verbose
((ret+=$?))
fi
}
if (( ${#filenames[@]} <= 0 )) && [[ -z "$unpack" ]] && [[ -z "$unpackearly" ]]; then
echo "Image: $image: $(du -h $image | while read a b || [ -n "$a" ]; do echo $a;done)"
echo "========================================================================"
fi
read -N 6 bin < "$image"
case $bin in
$'\x71\xc7'*|070701)
CAT="cat --"
is_early=$(cpio --extract --verbose --quiet --to-stdout -- 'early_cpio' < "$image" 2>/dev/null)
if [[ "$is_early" ]]; then
if [[ -n "$unpack" ]]; then
# should use --unpackearly for early CPIO
:
elif [[ -n "$unpackearly" ]]; then
unpack_files
elif (( ${#filenames[@]} > 0 )); then
extract_files
else
echo "Early CPIO image"
list_files
fi
if [[ -d "$dracutbasedir/skipcpio" ]]; then
SKIP="$dracutbasedir/skipcpio/skipcpio"
else
SKIP="$dracutbasedir/skipcpio"
fi
if ! [[ -x $SKIP ]]; then
echo
echo "'$SKIP' not found, cannot display remaining contents!" >&2
echo
exit 0
fi
fi
;;
esac
if [[ $SKIP ]] ; then
bin="$($SKIP "$image" | { read -N 6 bin && echo "$bin" ; })"
else
read -N 6 bin < "$image"
fi
case $bin in
$'\x1f\x8b'*)
CAT="zcat --"
;;
BZh*)
CAT="bzcat --"
;;
$'\x71\xc7'*|070701)
CAT="cat --"
;;
$'\x02\x21'*)
CAT="lz4 -d -c"
;;
$'\x89'LZO$'\0'*)
CAT="lzop -d -c"
;;
$'\x28\xB5\x2F\xFD'*)
CAT="zstd -d -c"
;;
*)
if echo "test"|xz|xzcat --single-stream >/dev/null 2>&1; then
CAT="xzcat --single-stream --"
else
CAT="xzcat --"
fi
;;
esac
skipcpio()
{
$SKIP "$@" | $ORIG_CAT
}
if [[ $SKIP ]]; then
ORIG_CAT="$CAT"
CAT=skipcpio
fi
if (( ${#filenames[@]} > 1 )); then
TMPFILE="$(mktemp -t --suffix=.cpio lsinitrd.XXXXXX)"
$CAT "$image" 2>/dev/null > $TMPFILE
trap "rm -f '$TMPFILE'" EXIT
pre_decompress()
{
cat $TMPFILE
}
CAT=pre_decompress
fi
ret=0
if [[ -n "$unpack" ]]; then
unpack_files
elif (( ${#filenames[@]} > 0 )); then
extract_files
else
version=$($CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- \
$(dracutlibdirs 'dracut-*') 2>/dev/null)
((ret+=$?))
echo "Version: $version"
echo
if [ "$modules" -eq 1 ]; then
list_modules
echo "========================================================================"
else
echo -n "Arguments: "
$CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- \
$(dracutlibdirs build-parameter.txt) 2>/dev/null
echo
list_modules
list_files
fi
fi
exit $ret

226
mkinitrd-dracut.sh Executable file
View File

@@ -0,0 +1,226 @@
#!/bin/bash --norc
kver=$(uname -r)
boot_dir="/boot"
quiet=0
host_only=0
force=0
error() { echo "$@" >&2; }
usage () {
[[ $1 = '-n' ]] && cmd=echo || cmd=error
$cmd "usage: ${0##*/} [--version] [--help] [-v] [-f] [--preload <module>]"
$cmd " [--image-version] [--with=<module>]"
$cmd " [--nocompress]"
$cmd " <initrd-image> <kernel-version>"
$cmd ""
$cmd " (ex: ${0##*/} /boot/initramfs-$kver.img $kver)"
[[ $1 = '-n' ]] && exit 0
exit 1
}
# Little helper function for reading args from the commandline.
# it automatically handles -a b and -a=b variants, and returns 1 if
# we need to shift $3.
read_arg() {
# $1 = arg name
# $2 = arg value
# $3 = arg parameter
param="$1"
local rematch='^[^=]*=(.*)$' result
if [[ $2 =~ $rematch ]]; then
read "$param" <<< "${BASH_REMATCH[1]}"
else
for ((i=3; $i <= $#; i++)); do
# Only read next arg if it not an arg itself.
if [[ ${@:$i:1} = -* ]];then
break
fi
result="$result ${@:$i:1}"
# There is no way to shift our callers args, so
# return "no of args" to indicate they should do it instead.
done
read "$1" <<< "$result"
return $(($i - 3))
fi
}
# Taken over from SUSE mkinitrd
default_kernel_images() {
local regex kernel_image kernel_version version_version initrd_image
local qf='%{NAME}-%{VERSION}-%{RELEASE}\n'
case "$(uname -m)" in
s390|s390x)
regex='image'
;;
ppc|ppc64)
regex='vmlinux'
;;
i386|x86_64)
regex='vmlinuz'
;;
arm*)
regex='[uz]Image'
;;
aarch64)
regex='Image'
;;
*) regex='vmlinu.'
;;
esac
# user mode linux
if grep -q UML /proc/cpuinfo; then
regex='linux'
fi
kernel_images=""
initrd_images=""
for kernel_image in $(ls $boot_dir \
| sed -ne "\|^$regex\(-[0-9.]\+-[0-9]\+-[a-z0-9]\+$\)\?|p" \
| grep -v kdump$ ) ; do
# Note that we cannot check the RPM database here -- this
# script is itself called from within the binary kernel
# packages, and rpm does not allow recursive calls.
[ -L "$boot_dir/$kernel_image" ] && continue
[ "${kernel_image%%.gz}" != "$kernel_image" ] && continue
kernel_version=$(/usr/bin/get_kernel_version \
$boot_dir/$kernel_image 2> /dev/null)
initrd_image=$(echo $kernel_image | sed -e "s|${regex}|initrd|")
if [ "$kernel_image" != "$initrd_image" -a \
-n "$kernel_version" -a \
-d "/lib/modules/$kernel_version" ]; then
kernel_images="$kernel_images $boot_dir/$kernel_image"
initrd_images="$initrd_images $boot_dir/$initrd_image"
fi
done
for kernel_image in $kernel_images;do
kernels="$kernels ${kernel_image#*-}"
done
for initrd_image in $initrd_images;do
targets="$targets $initrd_image"
done
host_only=1
force=1
}
while (($# > 0)); do
case ${1%%=*} in
--with-usb) read_arg usbmodule "$@" || shift $?
basicmodules="$basicmodules ${usbmodule:-usb-storage}"
unset usbmodule;;
--with-avail) read_arg modname "$@" || shift $?
basicmodules="$basicmodules $modname";;
--with) read_arg modname "$@" || shift $?
basicmodules="$basicmodules $modname";;
--version)
echo "mkinitrd: dracut compatibility wrapper"
exit 0;;
-v|--verbose) dracut_args="${dracut_args} -v";;
-f|--force) force=1;;
--preload) read_arg modname "$@" || shift $?
basicmodules="$basicmodules $modname";;
--image-version) img_vers=yes;;
--rootfs|-d) read_arg rootfs "$@" || shift $?
dracut_args="${dracut_args} --filesystems $rootfs";;
--nocompress) dracut_args="$dracut_args --no-compress";;
--help) usage -n;;
--builtin) ;;
--without*) ;;
--without-usb) ;;
--fstab*) ;;
--ifneeded) ;;
--omit-scsi-modules) ;;
--omit-ide-modules) ;;
--omit-raid-modules) ;;
--omit-lvm-modules) ;;
--omit-dmraid) ;;
--allow-missing) ;;
--net-dev*) ;;
--noresume) ;;
--rootdev*) ;;
--thawdev*) ;;
--rootopts*) ;;
--root*) ;;
--loopdev*) ;;
--loopfs*) ;;
--loopopts*) ;;
--looppath*) ;;
--dsdt*) ;;
--bootchart) ;;
-s) ;;
--quiet|-q) quiet=1;;
-b) read_arg boot_dir "$@" || shift $?
if [ ! -d $boot_dir ];then
error "Boot directory $boot_dir does not exist"
exit 1
fi
;;
-k) # Would be nice to get a list of images here
read_arg kernel_images "$@" || shift $?
for kernel_image in $kernel_images;do
kernels="$kernels ${kernel_image#*-}"
done
host_only=1
force=1
;;
-i) read_arg initrd_images "$@" || shift $?
for initrd_image in $initrd_images;do
targets="$targets $boot_dir/$initrd_image"
done
;;
*) if [[ ! $targets ]]; then
targets=$1
elif [[ ! $kernels ]]; then
kernels=$1
else
usage
fi;;
esac
shift
done
[[ $targets && $kernels ]] || default_kernel_images
[[ $targets && $kernels ]] || (error "No kernel found in $boot_dir" && usage)
# We can have several targets/kernels, transform the list to an array
targets=( $targets )
[[ $kernels ]] && kernels=( $kernels )
[[ $host_only == 1 ]] && dracut_args="${dracut_args} -H"
[[ $force == 1 ]] && dracut_args="${dracut_args} -f"
echo "Creating: target|kernel|dracut args|basicmodules "
for ((i=0 ; $i<${#targets[@]} ; i++)); do
if [[ $img_vers ]];then
target="${targets[$i]}-${kernels[$i]}"
else
target="${targets[$i]}"
fi
kernel="${kernels[$i]}"
# Duplicate code: No way found how to redirect output based on $quiet
if [[ $quiet == 1 ]];then
echo "$target|$kernel|$dracut_args|$basicmodules"
if [[ $basicmodules ]]; then
dracut $dracut_args --add-drivers "$basicmodules" "$target" \
"$kernel" &>/dev/null
else
dracut $dracut_args "$target" "$kernel" &>/dev/null
fi
else
if [[ $basicmodules ]]; then
dracut $dracut_args --add-drivers "$basicmodules" "$target" \
"$kernel"
else
dracut $dracut_args "$target" "$kernel"
fi
fi
done

106
mkinitrd-suse.8.asc Normal file
View File

@@ -0,0 +1,106 @@
MKINITRD(8)
===========
:doctype: manpage
:man source: dracut
:man manual: dracut
NAME
----
mkinitrd-suse - is a compat wrapper, which calls dracut to generate an initramfs
SYNOPSIS
--------
*mkinitrd* ['OPTION...']
DESCRIPTION
-----------
*mkinitrd* creates an initramfs image <initrd-image> for the kernel with
version <kernel-version> by calling *dracut*.
[IMPORTANT]
This version of mkinitrd is provided for compatibility with older
versions of mkinitrd. If a more fine grained control over the
resulting image is needed, *dracut* should be called directly.
OPTIONS
-------
**-R, --version**::
print info about the version
**-k** _<kernel_list>_::
List of kernel images for which initrd files are created (relative
to _boot_dir_), Image name should begin with the following string,
defaults to _vmlinux_ on ppc/ppc64, _image_ on s390/s390x and _vmlinuz_
for everything else.
**-i** _<initrd_list>_::
List of file names (relative to _boot_dir_) for the initrd; positions
have to match the _kernel_list_. Defaults to _initrd_.
**-m** _<module_list>_::
Modules to include in initrd, defaults to _INITRD_MODULES_ variable
in */etc/sysconfig/kernel*.
**-f** _<feature_list>_::
Features to be enabled for the initrd. In general mkinitrd
configures the initrd for the root device it is started from. With
this option additional feature can be enabled.
**-b** _<bootdir>_::
Boot directory, defaults to */boot*, where the initrd is created.
**-d** _<root_device>_::
Root device, defaults to the device from which the root_dir is
mounted; overwrites the rootdev environment variable if set
**-s** _<size>_::
Add splash animation and bootscreen to initrd.
**-D** _<interface>::
Run dhcp on the specified interface (for example "eth0").
**-I** _<interface>::
Configure the specified interface statically.
**-a** _<acpi_dsdt>::
Attach compiled ACPI DSDT (Differentiated System Description Table)
to initrd. This replaces the DSDT of the BIOS. Defaults to the
_ACPI_DSDT_ variable in */etc/sysconfig/kernel*.
**-M** _<map>::
System.map file to use.
**-B**::
Dont run the *update-bootloader(8)* script after the initrd(s) have
been created. This is useful if you call mkinitrd(8) for anything
else than the running system.
**-A**::
Create a so called "monster initrd" which includes all available
features and modules. This calls dracut with --no-hostonly and
--no-hostonly-cmdline parameters internally, instead of the default
--hostonly and --hostonly-cmdline.
**-v, --verbose**::
increase verbosity level
**-L**::
Disable logging to _/var/log/YaST2/mkinitrd.log_. This is useful for
testing if you dont want to clutter the system log.
**--help**::
print a help message and exit.
AVAILABILITY
------------
The mkinitrd command is part of the dracut package and is available from
link:$$https://dracut.wiki.kernel.org$$[https://dracut.wiki.kernel.org]
AUTHORS
-------
Harald Hoyer, Hannes Reinecke
SEE ALSO
--------
*dracut*(8)
*update-bootloader*(8)

393
mkinitrd-suse.sh Executable file
View File

@@ -0,0 +1,393 @@
#!/bin/bash --norc
#
# mkinitrd compability wrapper for SUSE.
#
# Copyright (c) 2013 SUSE Linux Products GmbH. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
boot_dir="/boot"
quiet=0
logfile=/var/log/YaST2/mkinitrd.log
dracut_cmd=dracut
error() { echo "$@" >&2; }
usage () {
[[ $1 = '-n' ]] && cmd=echo || cmd=error
$cmd "usage: ${0##*/} [options]"
$cmd ""
$cmd " Create initial ramdisk images that contain all kernel modules needed"
$cmd " in the early boot process, before the root file system becomes"
$cmd " available."
$cmd " This usually includes SCSI and/or RAID modules, a file system module"
$cmd " for the root file system, or a network interface driver module for dhcp."
$cmd ""
$cmd " options:"
$cmd " -f \"feature list\" Features to be enabled when generating initrd."
$cmd " Available features are:"
$cmd " iscsi, md, multipath, lvm, lvm2,"
$cmd " ifup, fcoe, dcbd"
$cmd " -k \"kernel list\" List of kernel images for which initrd files are"
$cmd " created. Defaults to all kernels found in /boot."
$cmd " -i \"initrd list\" List of file names for the initrd; position have"
$cmd " match to \"kernel list\". Defaults to all kernels"
$cmd " found in /boot."
$cmd " -b boot_dir Boot directory. Defaults to /boot."
$cmd " -t tmp_dir Temporary directory. Defaults to /var/tmp."
$cmd " -M map System.map file to use."
$cmd " -A Create a so called \"monster initrd\" which"
$cmd " includes all features and modules possible."
$cmd " -B Do not update bootloader configuration."
$cmd " -v Verbose mode."
$cmd " -L Disable logging."
$cmd " -h This help screen."
$cmd " -m \"module list\" Modules to include in initrd. Defaults to the"
$cmd " INITRD_MODULES variable in /etc/sysconfig/kernel"
$cmd " -u \"DomU module list\" Modules to include in initrd. Defaults to the"
$cmd " DOMU_INITRD_MODULES variable in"
$cmd " /etc/sysconfig/kernel."
$cmd " -d root_device Root device. Defaults to the device from"
$cmd " which / is mounted. Overrides the rootdev"
$cmd " enviroment variable if set."
$cmd " -j device Journal device"
$cmd " -D interface Run dhcp on the specified interface."
$cmd " -I interface Configure the specified interface statically."
$cmd " -a acpi_dsdt Obsolete, do not use."
$cmd " -s size Add splash animation and bootscreen to initrd."
[[ $1 = '-n' ]] && exit 0
exit 1
}
# Little helper function for reading args from the commandline.
# it automatically handles -a b and -a=b variants, and returns 1 if
# we need to shift $3.
read_arg() {
# $1 = arg name
# $2 = arg value
# $3 = arg parameter
param="$1"
local rematch='^[^=]*=(.*)$' result
if [[ $2 =~ $rematch ]]; then
read "$param" <<< "${BASH_REMATCH[1]}"
else
for ((i=3; $i <= $#; i++)); do
# Only read next arg if it not an arg itself.
if [[ ${@:$i:1} = -* ]];then
break
fi
result="$result ${@:$i:1}"
# There is no way to shift our callers args, so
# return "no of args" to indicate they should do it instead.
done
read "$1" <<< "$result"
return $(($i - 3))
fi
}
# Helper functions to calculate ipconfig command line
calc_netmask() {
local prefix=$1
[ -z "$prefix" ] && return
mask=$(( 0xffffffff << (32 - $prefix) ))
byte1=$(( mask >> 24 ))
byte2=$(( mask >> 16 ))
byte3=$(( mask >> 8 ))
byte4=$(( mask & 0xff ))
netmask=$(printf "%d.%d.%d.%d" $(( byte1 & 0xff )) $(( byte2 & 0xff )) $(( byte3 & 0xff )) $byte4);
echo $netmask
}
ipconfig() {
local interface=$1
local iplink macaddr broadcast gateway ipaddr prefix netmask
iplink=$(ip addr show dev $interface | sed -n 's/ *inet \(.*\) brd.*/\1/p')
macaddr=$(ip addr show dev $interface | sed -n 's/.*ether \(.*\) brd.*/\1/p')
broadcast=$(ip addr show dev $interface | sed -n 's/.*brd \(.*\) scope.*/\1/p')
gateway=$(ip route show dev $interface | sed -n 's/default via \([0-9\.]*\).*/\1/p')
ipaddr=${iplink%%/*}
prefix=${iplink##*/}
netmask=$(calc_netmask $prefix)
echo "${ipaddr}:${serveraddr}:${gateway}:${netmask}:${hostname}:${interface}:none::${macaddr}"
}
is_xen_kernel() {
local kversion=$1
local root_dir=$2
local cfg
for cfg in ${root_dir}/boot/config-$kversion $root_dir/lib/modules/$kversion/build/.config
do
test -r $cfg || continue
grep -q "^CONFIG_XEN=y\$" $cfg
return
done
test $kversion != "${kversion%-xen*}"
return
}
# kernel_image_gz_from_image() and kernel_version_from_image() are helpers
# for arm* kernels which produce zImage files which cannot be read from
# get_kernel_version -> get rid of this workaround if possible
kernel_image_gz_from_image() {
local arch=$(uname -i)
local r=${1}.gz
# uImage kernels can't be extracted directly. Use the vmlinux.gz instead
r=${r//uImage/vmlinux}
# on ARM a zImage can't be extracted directly. Other platforms define it
# as a gzipped vmlinux file, but not ARM. So only on ARM, use vmlinux.gz.
if [[ $arch =~ arm ]] || [[ $arch =~ aarch ]]; then
r=${r//zImage/vmlinux}
fi
echo $r
}
kernel_version_from_image() {
local kernel_image="$1" kernel_image_gz=$(kernel_image_gz_from_image "$1")
if get_kernel_version "$kernel_image" 2>/dev/null; then
return
fi
get_kernel_version "$kernel_image_gz" 2>/dev/null
}
# Taken over from SUSE mkinitrd
default_kernel_images() {
local regex kernel_image kernel_version version_version initrd_image
local qf='%{NAME}-%{VERSION}-%{RELEASE}\n'
case "$(uname -m)" in
s390|s390x)
regex='image'
;;
ppc|ppc64)
regex='vmlinux'
;;
i386|x86_64)
regex='vmlinuz'
;;
arm*)
regex='[uz]Image'
;;
aarch64)
regex='Image'
;;
*) regex='vmlinu.'
;;
esac
kernel_images=""
initrd_images=""
for kernel_image in $(ls $boot_dir \
| sed -ne "\|^$regex\(-[0-9.]\+-[0-9]\+-[a-z0-9]\+$\)\?|p" \
| grep -v kdump$ ) ; do
# Note that we cannot check the RPM database here -- this
# script is itself called from within the binary kernel
# packages, and rpm does not allow recursive calls.
[ -L "$boot_dir/$kernel_image" ] && continue
[ "${kernel_image%%.gz}" != "$kernel_image" ] && continue
kernel_version=$(kernel_version_from_image \
$boot_dir/$kernel_image 2> /dev/null)
initrd_image=$(echo $kernel_image | sed -e "s|${regex}|initrd|")
if [ "$kernel_image" != "$initrd_image" -a \
-n "$kernel_version" -a \
-d "/lib/modules/$kernel_version" ]; then
kernel_images="$kernel_images $boot_dir/$kernel_image"
initrd_images="$initrd_images $boot_dir/$initrd_image"
fi
done
for kernel_image in $kernel_images;do
kernels="$kernels ${kernel_image#*-}"
done
for initrd_image in $initrd_images;do
targets="$targets $initrd_image"
done
}
while (($# > 0)); do
case ${1%%=*} in
-f) read_arg feature_list "$@" || shift $?
# Could be several features
;;
-k) # Would be nice to get a list of images here
read_arg kernel_images "$@" || shift $?
for kernel_image in $kernel_images;do
[ -L "/boot/$kernel_image" ] && kernel_image="$(readlink "/boot/$kernel_image")"
kernels="$kernels ${kernel_image#*-}"
done
;;
-i) read_arg initrd_images "$@" || shift $?
for initrd_image in $initrd_images;do
[ -L "/boot/$initrd_image" ] && initrd_image="$(readlink "/boot/$initrd_image")"
# Check if the initrd_image contains a path.
# if not, then add the default boot_dir
dname=`dirname $initrd_image`
if [ "$dname" == "." ]; then
targets="$targets $boot_dir/$initrd_image";
else
targets="$targets $initrd_image";
fi
done
;;
-b) read_arg boot_dir "$@" || shift $?
if [ ! -d $boot_dir ];then
error "Boot directory $boot_dir does not exist"
exit 1
fi
;;
-t) read_arg tmp_dir "$@" || shift $?
dracut_args="${dracut_args} --tmpdir $tmp_dir"
;;
-M) read_arg map_file "$@" || shift $?
;;
-A) dracut_args="${dracut_args} --no-host-only";;
-B) skip_update_bootloader=1;;
-v|--verbose) dracut_args="${dracut_args} -v";;
-L) logfile=;;
-h|--help) usage -n;;
-m) read_arg module_list "$@" || shift $? ;;
-u) read_arg domu_module_list "$@" || shift $?
echo "mkinitrd: DomU modules not yet supported" ;;
-d) read_arg rootfs "$@" || shift $?
dracut_args="${dracut_args} --filesystems $rootfs" ;;
-D) read_arg dhcp_if "$@" || shift $?
dracut_cmdline="${dracut_cmdline} ip=${dhcp_if}:dhcp"
;;
-I) read_arg static_if "$@" || shift $?
dracut_cmdline="${dracut_cmdline} ip=$(ipconfig $static_if)":
;;
-a) read_arg acpi_dsdt "$@" || shift $?
echo "Obsolete -a param, use acpi_table_dir= and acpi_override= variables in /etc/dracut.conf.d/"
exit 1
;;
-s) read_arg boot_splash "$@" || shift $?
echo "mkinitrd: boot splash not yet supported"
exit 1
;;
-V) echo "mkinitrd: vendor scipts are no longer supported"
exit 1;;
--dracut)
read_arg dracut_cmd "$@" || shift $? ;;
--version|-R)
echo "mkinitrd: dracut compatibility wrapper"
exit 0;;
--quiet|-q) quiet=1;;
*) if [[ ! $targets ]]; then
targets=$1
elif [[ ! $kernels ]]; then
kernels=$1
else
usage
fi;;
esac
shift
done
[[ $targets && $kernels ]] || default_kernel_images
if [[ ! $targets || ! $kernels ]];then
error "No kernel found in $boot_dir or bad modules dir in /lib/modules"
exit 1
fi
# We can have several targets/kernels, transform the list to an array
targets=( $targets )
[[ $kernels ]] && kernels=( $kernels )
[[ $logfile ]] && dracut_args="${dracut_args} --logfile $logfile"
dracut_args="${dracut_args} --force"
[[ $dracut_cmdline ]] && dracut_args="${dracut_args} --kernel-cmdline ${dracut_cmdline}"
[ -z "$(type -p update-bootloader)" ] && skip_update_bootloader=1
# Update defaults from /etc/sysconfig/kernel
if [ -f /etc/sysconfig/kernel ] ; then
. /etc/sysconfig/kernel
fi
[[ $module_list ]] || module_list="${INITRD_MODULES}"
[[ $domu_module_list ]] || domu_module_list="${DOMU_INITRD_MODULES}"
shopt -s extglob
failed=""
for ((i=0 ; $i<${#targets[@]} ; i++)); do
if [[ $img_vers ]];then
target="${targets[$i]}-${kernels[$i]}"
else
target="${targets[$i]}"
fi
kernel="${kernels[$i]}"
if is_xen_kernel $kernel $rootfs ; then
modules_all="${module_list} ${domu_module_list}"
else
modules_all="${module_list}"
fi
# Remove leading and trailing spaces needs (set above): shopt -s extglob
modules_all=${modules_all%%+([[:space:]])}
modules_all=${modules_all##+([[:space:]])}
echo "Creating initrd: $target"
# Duplicate code: No way found how to redirect output based on $quiet
if [[ $quiet == 1 ]];then
# Duplicate code: --force-drivers must not be called with empty string
# -> dracut bug workarounded ugly, because of complex whitespace
# expansion magics
if [ -n "${modules_all}" ];then
$dracut_cmd $dracut_args --force-drivers "${modules_all}" "$target" "$kernel" &>/dev/null
[ $? -ne 0 ] && failed="$failed $target"
else
$dracut_cmd $dracut_args "$target" "$kernel" &>/dev/null
[ $? -ne 0 ] && failed="$failed $target"
fi
else
if [ -n "${modules_all}" ];then
$dracut_cmd $dracut_args --force-drivers "${modules_all}" "$target" "$kernel"
[ $? -ne 0 ] && failed="$failed $target"
else
$dracut_cmd $dracut_args "$target" "$kernel"
[ $? -ne 0 ] && failed="$failed $target"
fi
fi
done
if [ "$skip_update_bootloader" ] ; then
echo 2>&1 "Did not refresh the bootloader. You might need to refresh it manually."
else
update-bootloader --refresh
[ $? -ne 0 ] && echo "Updating bootloader failed" && exit 1
fi
if [ "$failed" != "" ]; then
echo "Generating $failed targets failed"
exit 1
fi
exit 0

65
mkinitrd.8.asc Normal file
View File

@@ -0,0 +1,65 @@
MKINITRD(8)
=========
:doctype: manpage
:man source: dracut
:man manual: dracut
NAME
----
mkinitrd - is a compat wrapper, which calls dracut to generate an initramfs
SYNOPSIS
--------
*mkinitrd* ['OPTION...'] [<initrd-image>] <kernel-version>
DESCRIPTION
-----------
mkinitrd creates an initramfs image <initrd-image> for the kernel with
version <kernel-version> by calling "dracut".
[IMPORTANT]
If a more fine grained control over the resulting image is needed,
"dracut" should be called directly.
OPTIONS
-------
**--version**::
print info about the version
**-v, --verbose**::
increase verbosity level
**-f, --force**::
overwrite existing initramfs file.
**--image-version*::
append the kernel version to the target image
<initrd-image>-<kernel-version>.
**--with=<module>**::
add the kernel module <module> to the initramfs.
**--preload=<module>**::
preload the kernel module <module> in the initramfs before any other kernel
modules are loaded. This can be used to ensure a certain device naming,
which should in theory be avoided and the use of symbolic links in /dev is
encouraged.
**--nocompress**::
do not compress the resulting image.
**--help**::
print a help message and exit.
AVAILABILITY
------------
The mkinitrd command is part of the dracut package and is available from
link:$$https://dracut.wiki.kernel.org$$[https://dracut.wiki.kernel.org]
AUTHORS
-------
Harald Hoyer
SEE ALSO
--------
*dracut*(8)

View File

@@ -0,0 +1,21 @@
#!/bin/bash
# called by dracut
check() {
require_binaries /bin/bash
}
# called by dracut
depends() {
return 0
}
# called by dracut
install() {
# If another shell is already installed, do not use bash
[[ -x $initdir/bin/sh ]] && return
# Prefer bash as /bin/sh if it is available.
inst /bin/bash && ln -sf bash "${initdir}/bin/sh"
}

View File

@@ -0,0 +1,30 @@
#!/bin/bash
# called by dracut
check() {
[[ "$mount_needs" ]] && return 1
require_binaries /sbin/bootchartd || return 1
return 255
}
# called by dracut
depends() {
return 0
}
# called by dracut
install() {
inst_symlink /init /sbin/init
inst_dir /lib/bootchart/tmpfs
inst_multiple bootchartd bash \
/lib/bootchart/bootchart-collector /etc/bootchartd.conf \
accton \
echo \
grep \
usleep
inst /usr/bin/pkill /bin/pkill
inst /usr/bin/[ /bin/[
}

View File

@@ -1,2 +0,0 @@
#!/bin/sh
[ -x /bin/dash ]

View File

@@ -1,6 +0,0 @@
#!/bin/bash
# If another shell is already installed, do not use dash
[ -x "${initdir}/bin/sh" ] && return
# Prefer dash as /bin/sh if it is available.
inst /bin/dash && ln -sf dash "${initdir}/bin/sh"

View File

@@ -0,0 +1,21 @@
#!/bin/bash
# called by dracut
check() {
require_binaries /bin/dash
}
# called by dracut
depends() {
return 0
}
# called by dracut
install() {
# If another shell is already installed, do not use dash
[[ -x $initdir/bin/sh ]] && return
# Prefer dash as /bin/sh if it is available.
inst /bin/dash && ln -sf dash "${initdir}/bin/sh"
}

View File

@@ -0,0 +1,240 @@
#!/bin/bash
# called by dracut
check() {
[[ $mount_needs ]] && return 1
if require_binaries $systemdutildir/systemd; then
SYSTEMD_VERSION=$($systemdutildir/systemd --version | { read a b a; echo $b; })
(( $SYSTEMD_VERSION >= 198 )) && return 0
return 255
fi
return 1
}
# called by dracut
depends() {
return 0
}
installkernel() {
hostonly='' instmods autofs4 ipv6 algif_hash hmac sha256
instmods -s efivarfs
}
# called by dracut
install() {
local _mods
if [[ "$prefix" == /run/* ]]; then
dfatal "systemd does not work with a prefix, which contains \"/run\"!!"
exit 1
fi
inst_multiple -o \
$systemdutildir/systemd \
$systemdutildir/systemd-coredump \
$systemdutildir/systemd-cgroups-agent \
$systemdutildir/systemd-shutdown \
$systemdutildir/systemd-reply-password \
$systemdutildir/systemd-fsck \
$systemdutildir/systemd-udevd \
$systemdutildir/systemd-journald \
$systemdutildir/systemd-sysctl \
$systemdutildir/systemd-modules-load \
$systemdutildir/systemd-vconsole-setup \
$systemdutildir/system-generators/systemd-fstab-generator \
$systemdutildir/system-generators/systemd-gpt-auto-generator \
\
$systemdsystemunitdir/cryptsetup.target \
$systemdsystemunitdir/emergency.target \
$systemdsystemunitdir/sysinit.target \
$systemdsystemunitdir/basic.target \
$systemdsystemunitdir/halt.target \
$systemdsystemunitdir/kexec.target \
$systemdsystemunitdir/local-fs.target \
$systemdsystemunitdir/local-fs-pre.target \
$systemdsystemunitdir/remote-fs.target \
$systemdsystemunitdir/remote-fs-pre.target \
$systemdsystemunitdir/multi-user.target \
$systemdsystemunitdir/network.target \
$systemdsystemunitdir/network-pre.target \
$systemdsystemunitdir/network-online.target \
$systemdsystemunitdir/nss-lookup.target \
$systemdsystemunitdir/nss-user-lookup.target \
$systemdsystemunitdir/poweroff.target \
$systemdsystemunitdir/reboot.target \
$systemdsystemunitdir/rescue.target \
$systemdsystemunitdir/rpcbind.target \
$systemdsystemunitdir/shutdown.target \
$systemdsystemunitdir/final.target \
$systemdsystemunitdir/sigpwr.target \
$systemdsystemunitdir/sockets.target \
$systemdsystemunitdir/swap.target \
$systemdsystemunitdir/timers.target \
$systemdsystemunitdir/paths.target \
$systemdsystemunitdir/umount.target \
\
$systemdsystemunitdir/sys-kernel-config.mount \
\
$systemdsystemunitdir/kmod-static-nodes.service \
$systemdsystemunitdir/systemd-tmpfiles-setup.service \
$systemdsystemunitdir/systemd-tmpfiles-setup-dev.service \
$systemdsystemunitdir/systemd-ask-password-console.path \
$systemdsystemunitdir/systemd-udevd-control.socket \
$systemdsystemunitdir/systemd-udevd-kernel.socket \
$systemdsystemunitdir/systemd-ask-password-plymouth.path \
$systemdsystemunitdir/systemd-journald.socket \
$systemdsystemunitdir/systemd-journald-audit.socket \
$systemdsystemunitdir/systemd-ask-password-console.service \
$systemdsystemunitdir/systemd-modules-load.service \
$systemdsystemunitdir/systemd-halt.service \
$systemdsystemunitdir/systemd-poweroff.service \
$systemdsystemunitdir/systemd-reboot.service \
$systemdsystemunitdir/systemd-kexec.service \
$systemdsystemunitdir/systemd-fsck@.service \
$systemdsystemunitdir/systemd-udevd.service \
$systemdsystemunitdir/systemd-udev-trigger.service \
$systemdsystemunitdir/systemd-udev-settle.service \
$systemdsystemunitdir/systemd-ask-password-plymouth.service \
$systemdsystemunitdir/systemd-journald.service \
$systemdsystemunitdir/systemd-vconsole-setup.service \
$systemdsystemunitdir/systemd-random-seed-load.service \
$systemdsystemunitdir/systemd-random-seed.service \
$systemdsystemunitdir/systemd-sysctl.service \
\
$systemdsystemunitdir/sysinit.target.wants/systemd-modules-load.service \
$systemdsystemunitdir/sysinit.target.wants/systemd-ask-password-console.path \
$systemdsystemunitdir/sysinit.target.wants/systemd-journald.service \
$systemdsystemunitdir/sockets.target.wants/systemd-udevd-control.socket \
$systemdsystemunitdir/sockets.target.wants/systemd-udevd-kernel.socket \
$systemdsystemunitdir/sockets.target.wants/systemd-journald.socket \
$systemdsystemunitdir/sockets.target.wants/systemd-journald-audit.socket \
$systemdsystemunitdir/sockets.target.wants/systemd-journald-dev-log.socket \
$systemdsystemunitdir/sysinit.target.wants/systemd-udevd.service \
$systemdsystemunitdir/sysinit.target.wants/systemd-udev-trigger.service \
$systemdsystemunitdir/sysinit.target.wants/kmod-static-nodes.service \
$systemdsystemunitdir/sysinit.target.wants/systemd-tmpfiles-setup.service \
$systemdsystemunitdir/sysinit.target.wants/systemd-tmpfiles-setup-dev.service \
$systemdsystemunitdir/sysinit.target.wants/systemd-sysctl.service \
\
$systemdsystemunitdir/ctrl-alt-del.target \
$systemdsystemunitdir/reboot.target \
$systemdsystemunitdir/systemd-reboot.service \
$systemdsystemunitdir/syslog.socket \
\
$systemdsystemunitdir/slices.target \
$systemdsystemunitdir/system.slice \
$systemdsystemunitdir/-.slice \
\
$tmpfilesdir/systemd.conf \
\
journalctl systemctl \
echo swapoff \
kmod insmod rmmod modprobe modinfo depmod lsmod \
mount umount reboot poweroff \
systemd-run systemd-escape \
systemd-cgls systemd-tmpfiles \
/etc/udev/udev.hwdb \
${NULL}
inst_multiple -o \
/usr/lib/modules-load.d/*.conf \
/usr/lib/sysctl.d/*.conf
modules_load_get() {
local _line i
for i in "$1"/*.conf; do
[[ -f $i ]] || continue
while read _line || [ -n "$_line" ]; do
case $_line in
\#*)
;;
\;*)
;;
*)
echo $_line
esac
done < "$i"
done
}
_mods=$(modules_load_get /usr/lib/modules-load.d)
[[ $_mods ]] && hostonly='' instmods $_mods
if [[ $hostonly ]]; then
inst_multiple -H -o \
/etc/systemd/journald.conf \
/etc/systemd/journald.conf.d/*.conf \
/etc/systemd/system.conf \
/etc/systemd/system.conf.d/*.conf \
/etc/hostname \
/etc/machine-id \
/etc/machine-info \
/etc/vconsole.conf \
/etc/locale.conf \
/etc/modules-load.d/*.conf \
/etc/sysctl.d/*.conf \
/etc/sysctl.conf \
/etc/udev/udev.conf \
${NULL}
_mods=$(modules_load_get /etc/modules-load.d)
[[ $_mods ]] && hostonly='' instmods $_mods
fi
if ! [[ -e "$initdir/etc/machine-id" ]]; then
> "$initdir/etc/machine-id"
fi
# install adm user/group for journald
inst_multiple nologin
grep '^systemd-journal:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
grep '^adm:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
grep '^systemd-journal:' /etc/group >> "$initdir/etc/group"
grep '^wheel:' /etc/group >> "$initdir/etc/group"
grep '^adm:' /etc/group >> "$initdir/etc/group"
grep '^utmp:' /etc/group >> "$initdir/etc/group"
grep '^root:' /etc/group >> "$initdir/etc/group"
# we don't use systemd-networkd, but the user is in systemd.conf tmpfiles snippet
grep '^systemd-network:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
grep '^systemd-network:' /etc/group >> "$initdir/etc/group"
ln_r $systemdutildir/systemd "/init"
ln_r $systemdutildir/systemd "/sbin/init"
inst_binary true
ln_r $(type -P true) "/usr/bin/loginctl"
ln_r $(type -P true) "/bin/loginctl"
inst_rules \
70-uaccess.rules \
71-seat.rules \
73-seat-late.rules \
90-vconsole.rules \
99-systemd.rules \
${NULL}
for i in \
emergency.target \
rescue.target \
systemd-ask-password-console.service \
systemd-ask-password-plymouth.service \
; do
mkdir -p "${initdir}${systemdsystemunitdir}/${i}.wants"
ln_r "${systemdsystemunitdir}/systemd-vconsole-setup.service" \
"${systemdsystemunitdir}/${i}.wants/systemd-vconsole-setup.service"
done
mkdir -p "$initdir/etc/systemd"
# We must use a volatile journal, and we don't want rate-limiting
{
echo "[Journal]"
echo "Storage=volatile"
echo "RateLimitInterval=0"
echo "RateLimitBurst=0"
} >> "$initdir/etc/systemd/journald.conf"
ln_r "${systemdsystemunitdir}/multi-user.target" "${systemdsystemunitdir}/default.target"
}

View File

@@ -0,0 +1,29 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
# called by dracut
check() {
# hwclock does not exist on S390(x), bail out silently then
local _arch=$(uname -m)
[ "$_arch" = "s390" -o "$_arch" = "s390x" ] && return 1
[ -e /etc/localtime -a -e /etc/adjtime ] || return 1
require_binaries /sbin/hwclock || return 1
return 255
}
# called by dracut
depends() {
return 0
}
# called by dracut
install() {
inst /usr/share/zoneinfo/UTC
inst /etc/localtime
inst /etc/adjtime
inst_hook pre-trigger 00 "$moddir/warpclock.sh"
inst /sbin/hwclock
}

View File

@@ -0,0 +1,9 @@
#!/bin/sh
if test -e /etc/adjtime ; then
while read line ; do
if test "$line" = LOCAL ; then
hwclock --systz
fi
done < /etc/adjtime
fi

10
modules.d/01fips/fips-boot.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/sh
if ! fipsmode=$(getarg fips) || [ $fipsmode = "0" ]; then
rm -f -- /etc/modprobe.d/fips.conf >/dev/null 2>&1
elif getarg boot= >/dev/null; then
. /sbin/fips.sh
if mount_boot; then
do_fips || die "FIPS integrity test failed"
fi
fi

View File

@@ -0,0 +1,8 @@
#!/bin/sh
if ! fipsmode=$(getarg fips) || [ $fipsmode = "0" ]; then
rm -f -- /etc/modprobe.d/fips.conf >/dev/null 2>&1
else
. /sbin/fips.sh
fips_load_crypto || die "FIPS integrity test failed"
fi

View File

@@ -0,0 +1,9 @@
#!/bin/sh
if ! fipsmode=$(getarg fips) || [ $fipsmode = "0" ]; then
rm -f -- /etc/modprobe.d/fips.conf >/dev/null 2>&1
elif ! [ -f /tmp/fipsdone ]; then
. /sbin/fips.sh
mount_boot
do_fips || die "FIPS integrity test failed"
fi

152
modules.d/01fips/fips.sh Executable file
View File

@@ -0,0 +1,152 @@
#!/bin/sh
mount_boot()
{
boot=$(getarg boot=)
if [ -n "$boot" ]; then
case "$boot" in
LABEL=*)
boot="$(echo $boot | sed 's,/,\\x2f,g')"
boot="/dev/disk/by-label/${boot#LABEL=}"
;;
UUID=*)
boot="/dev/disk/by-uuid/${boot#UUID=}"
;;
PARTUUID=*)
boot="/dev/disk/by-partuuid/${boot#PARTUUID=}"
;;
PARTLABEL=*)
boot="/dev/disk/by-partlabel/${boot#PARTLABEL=}"
;;
/dev/*)
;;
*)
die "You have to specify boot=<boot device> as a boot option for fips=1" ;;
esac
if ! [ -e "$boot" ]; then
udevadm trigger --action=add >/dev/null 2>&1
[ -z "$UDEVVERSION" ] && UDEVVERSION=$(udevadm --version)
i=0
while ! [ -e $boot ]; do
if [ $UDEVVERSION -ge 143 ]; then
udevadm settle --exit-if-exists=$boot
else
udevadm settle --timeout=30
fi
[ -e $boot ] && break
sleep 0.5
i=$(($i+1))
[ $i -gt 40 ] && break
done
fi
[ -e "$boot" ] || return 1
mkdir /boot
info "Mounting $boot as /boot"
mount -oro "$boot" /boot || return 1
elif [ -d "$NEWROOT/boot" ]; then
rm -fr -- /boot
ln -sf "$NEWROOT/boot" /boot
fi
}
do_rhevh_check()
{
KERNEL=$(uname -r)
kpath=${1}
# If we're on RHEV-H, the kernel is in /run/initramfs/live/vmlinuz0
HMAC_SUM_ORIG=$(cat $NEWROOT/boot/.vmlinuz-${KERNEL}.hmac | while read a b || [ -n "$a" ]; do printf "%s\n" $a; done)
HMAC_SUM_CALC=$(sha512hmac $kpath | while read a b || [ -n "$a" ]; do printf "%s\n" $a; done || return 1)
if [ -z "$HMAC_SUM_ORIG" ] || [ -z "$HMAC_SUM_CALC" ] || [ "${HMAC_SUM_ORIG}" != "${HMAC_SUM_CALC}" ]; then
warn "HMAC sum mismatch"
return 1
fi
info "rhevh_check OK"
return 0
}
fips_load_crypto()
{
FIPSMODULES=$(cat /etc/fipsmodules)
info "Loading and integrity checking all crypto modules"
mv /etc/modprobe.d/fips.conf /etc/modprobe.d/fips.conf.bak
for _module in $FIPSMODULES; do
if [ "$_module" != "tcrypt" ]; then
if ! modprobe "${_module}"; then
# check if kernel provides generic algo
_found=0
while read _k _s _v || [ -n "$_k" ]; do
[ "$_k" != "name" -a "$_k" != "driver" ] && continue
[ "$_v" != "$_module" ] && continue
_found=1
break
done </proc/crypto
[ "$_found" = "0" ] && return 1
fi
fi
done
mv /etc/modprobe.d/fips.conf.bak /etc/modprobe.d/fips.conf
info "Self testing crypto algorithms"
modprobe tcrypt || return 1
rmmod tcrypt
}
do_fips()
{
local _v
local _s
local _v
local _module
KERNEL=$(uname -r)
info "Checking integrity of kernel"
if [ -e "/run/initramfs/live/vmlinuz0" ]; then
do_rhevh_check /run/initramfs/live/vmlinuz0 || return 1
elif [ -e "/run/initramfs/live/isolinux/vmlinuz0" ]; then
do_rhevh_check /run/initramfs/live/isolinux/vmlinuz0 || return 1
else
BOOT_IMAGE="$(getarg BOOT_IMAGE)"
# Trim off any leading GRUB boot device (e.g. ($root) )
BOOT_IMAGE="$(echo "${BOOT_IMAGE}" | sed 's/^(.*)//')"
BOOT_IMAGE_NAME="${BOOT_IMAGE##*/}"
BOOT_IMAGE_PATH="${BOOT_IMAGE%${BOOT_IMAGE_NAME}}"
if [ -z "$BOOT_IMAGE_NAME" ]; then
BOOT_IMAGE_NAME="vmlinuz-${KERNEL}"
elif ! [ -e "/boot/${BOOT_IMAGE_PATH}/${BOOT_IMAGE_NAME}" ]; then
#if /boot is not a separate partition BOOT_IMAGE might start with /boot
BOOT_IMAGE_PATH=${BOOT_IMAGE_PATH#"/boot"}
#on some achitectures BOOT_IMAGE does not contain path to kernel
#so if we can't find anything, let's treat it in the same way as if it was empty
if ! [ -e "/boot/${BOOT_IMAGE_PATH}/${BOOT_IMAGE_NAME}" ]; then
BOOT_IMAGE_NAME="vmlinuz-${KERNEL}"
BOOT_IMAGE_PATH=""
fi
fi
BOOT_IMAGE_HMAC="/boot/${BOOT_IMAGE_PATH}/.${BOOT_IMAGE_NAME}.hmac"
if ! [ -e "${BOOT_IMAGE_HMAC}" ]; then
warn "${BOOT_IMAGE_HMAC} does not exist"
return 1
fi
(cd "${BOOT_IMAGE_HMAC%/*}" && sha512hmac -c "${BOOT_IMAGE_HMAC}") || return 1
fi
info "All initrd crypto checks done"
> /tmp/fipsdone
umount /boot >/dev/null 2>&1
return 0
}

View File

@@ -0,0 +1,85 @@
#!/bin/bash
# called by dracut
check() {
return 255
}
# called by dracut
depends() {
return 0
}
# called by dracut
installkernel() {
local _fipsmodules _mod _bootfstype
if [[ -f "${srcmods}/modules.fips" ]]; then
_fipsmodules="$(cat "${srcmods}/modules.fips")"
else
_fipsmodules=""
# Hashes:
_fipsmodules+="sha1 sha224 sha256 sha384 sha512 "
_fipsmodules+="sha3-224 sha3-256 sha3-384 sha3-512 "
_fipsmodules+="crc32c crct10dif ghash "
# Ciphers:
_fipsmodules+="cipher_null des3_ede aes cfb "
# Modes/templates:
_fipsmodules+="ecb cbc ctr xts gcm ccm authenc hmac cmac "
# Compression algs:
_fipsmodules+="deflate lzo zlib "
# PRNG algs:
_fipsmodules+="ansi_cprng "
# Misc:
_fipsmodules+="aead cryptomgr tcrypt crypto_user "
fi
mkdir -m 0755 -p "${initdir}/etc/modprobe.d"
for _mod in $_fipsmodules; do
if hostonly='' instmods -c -s $_mod; then
echo $_mod >> "${initdir}/etc/fipsmodules"
echo "blacklist $_mod" >> "${initdir}/etc/modprobe.d/fips.conf"
fi
done
# with hostonly_default_device fs module for /boot is not installed by default
if [[ $hostonly ]] && [[ "$hostonly_default_device" == "no" ]]; then
_bootfstype=$(find_mp_fstype /boot)
if [[ -n "$_bootfstype" ]]; then
hostonly='' instmods $_bootfstype
else
dwarning "Can't determine fs type for /boot, FIPS check may fail."
fi
fi
}
# called by dracut
install() {
local _dir
inst_hook pre-trigger 01 "$moddir/fips-boot.sh"
inst_hook pre-pivot 01 "$moddir/fips-noboot.sh"
inst_hook pre-udev 01 "$moddir/fips-load-crypto.sh"
inst_script "$moddir/fips.sh" /sbin/fips.sh
inst_multiple sha512hmac rmmod insmod mount uname umount
inst_simple /etc/system-fips
[ -c ${initdir}/dev/random ] || mknod ${initdir}/dev/random c 1 8 \
|| {
dfatal "Cannot create /dev/random"
dfatal "To create an initramfs with fips support, dracut has to run as root"
return 1
}
[ -c ${initdir}/dev/urandom ] || mknod ${initdir}/dev/urandom c 1 9 \
|| {
dfatal "Cannot create /dev/random"
dfatal "To create an initramfs with fips support, dracut has to run as root"
return 1
}
}

View File

@@ -0,0 +1,68 @@
#!/bin/bash
# called by dracut
check() {
[[ $mount_needs ]] && return 1
if ! dracut_module_included "systemd"; then
derror "systemd-initrd needs systemd in the initramfs"
return 1
fi
return 0
}
# called by dracut
depends() {
echo "systemd"
}
installkernel() {
return 0
}
# called by dracut
install() {
local _mods
inst_multiple -o \
$systemdsystemunitdir/initrd.target \
$systemdsystemunitdir/initrd-fs.target \
$systemdsystemunitdir/initrd-root-device.target \
$systemdsystemunitdir/initrd-root-fs.target \
$systemdsystemunitdir/initrd-switch-root.target \
$systemdsystemunitdir/initrd-switch-root.service \
$systemdsystemunitdir/initrd-cleanup.service \
$systemdsystemunitdir/initrd-udevadm-cleanup-db.service \
$systemdsystemunitdir/initrd-parse-etc.service
ln_r "${systemdsystemunitdir}/initrd.target" "${systemdsystemunitdir}/default.target"
local VERSION=""
local PRETTY_NAME=""
if [ -e /etc/os-release ]; then
. /etc/os-release
[[ -n ${VERSION} ]] && VERSION+=" "
[[ -n ${PRETTY_NAME} ]] && PRETTY_NAME+=" "
fi
NAME=dracut
ID=dracut
VERSION+="dracut-$DRACUT_VERSION"
PRETTY_NAME+="dracut-$DRACUT_VERSION (Initramfs)"
VERSION_ID=$DRACUT_VERSION
ANSI_COLOR="0;34"
{
echo NAME=\"$NAME\"
echo VERSION=\"$VERSION\"
echo ID=$ID
echo VERSION_ID=$VERSION_ID
echo PRETTY_NAME=\"$PRETTY_NAME\"
echo ANSI_COLOR=\"$ANSI_COLOR\"
} > $initdir/usr/lib/initrd-release
echo dracut-$DRACUT_VERSION > $initdir/lib/dracut/dracut-$DRACUT_VERSION
ln -sf ../usr/lib/initrd-release $initdir/etc/initrd-release
ln -sf initrd-release $initdir/usr/lib/os-release
ln -sf initrd-release $initdir/etc/os-release
}

33
modules.d/02caps/README Normal file
View File

@@ -0,0 +1,33 @@
This adds the following parameters:
rd.caps=1
turn the caps module on/off
rd.caps.initdrop=cap_sys_module,cap_sys_rawio
drop the specified comma separated capabilities
rd.caps.disablemodules=1
turn off module loading
rd.caps.disablekexec=1
turn off the kexec functionality
If module loading is turned off, all modules have to be loaded in the
initramfs, which are used later on. This can be done with
"rd.driver.pre="
rd.driver.pre=autofs4,sunrpc,ipt_REJECT,nf_conntrack_ipv4,....
Because the kernel command line would get huge with all those drivers, I
recommend to make use of $initramfs/etc/cmdline.
So, all rd.caps.* and rd.driver.pre arguments are in caps.conf can be
copied to $initramfs/etc/cmdline with "-i caps.conf /etc/cmdline".
Also all modules have to be loaded in the initramfs via "--add-drivers".
The resulting initramfs creation would look like this:
--add-drivers "autofs4 sunrpc ipt_REJECT nf_conntrack_ipv4 \
nf_defrag_ipv4 iptable_filter ip_tables
ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack
ip6table_filter ip6_tables dm_mirror dm_region_hash dm_log uinput ppdev
parport_pc parport ipv6 sg 8139too 8139cp mii i2c_piix4 i2c_core ext3
jbd mbcache sd_mod crc_t10dif sr_mod cdrom ata_generic pata_acpi ata_piix
dm_mod" \
/boot/initramfs-caps.img

34
modules.d/02caps/caps.sh Executable file
View File

@@ -0,0 +1,34 @@
#!/bin/bash
capsmode=$(getarg rd.caps)
if [ "$capsmode" = "1" ]; then
CAPS_INIT_DROP=$(getarg rd.caps.initdrop=)
CAPS_USERMODEHELPER_BSET=$(capsh --drop="$CAPS_INIT_DROP" -- -c 'while read a b || [ -n "$a" ]; do [ "$a" = "CapBnd:" ] && echo $((0x${b:$((${#b}-8)):8})) $((0x${b:$((${#b}-16)):8})) && break; done < /proc/self/status')
CAPS_MODULES_DISABLED=$(getarg rd.caps.disablemodules=)
CAPS_KEXEC_DISABLED=$(getarg rd.caps.disablekexec=)
info "Loading CAPS_MODULES $CAPS_MODULES"
for i in $CAPS_MODULES;do modprobe $i 2>&1 >/dev/null | vinfo; done
if [ "$CAPS_MODULES_DISABLED" = "1" -a -e /proc/sys/kernel/modules_disabled ]; then
info "Disabling module loading."
echo $CAPS_MODULES_DISABLED > /proc/sys/kernel/modules_disabled
fi
if [ "$CAPS_KEXEC_DISABLED" = "1" -a -e /proc/sys/kernel/kexec_disabled ]; then
info "Disabling kexec."
echo $CAPS_KEXEC_DISABLED > /proc/sys/kernel/kexec_disabled
fi
info "CAPS_USERMODEHELPER_BSET=$CAPS_USERMODEHELPER_BSET"
if [ -e /proc/sys/kernel/usermodehelper/bset ]; then
info "Setting usermode helper bounding set."
echo $CAPS_USERMODEHELPER_BSET > /proc/sys/kernel/usermodehelper/bset
echo $CAPS_USERMODEHELPER_BSET > /proc/sys/kernel/usermodehelper/inheritable
fi
echo "CAPS_INIT_DROP=\"$CAPS_INIT_DROP\"" > /etc/capsdrop
info "Will drop capabilities $CAPS_INIT_DROP from init."
fi

View File

@@ -0,0 +1,25 @@
#!/bin/bash
# called by dracut
check() {
require_binaries capsh
return 255
}
# called by dracut
depends() {
return 0
}
# called by dracut
install() {
if ! dracut_module_included "systemd"; then
inst_hook pre-pivot 00 "$moddir/caps.sh"
inst $(type -P capsh 2>/dev/null) /usr/sbin/capsh
# capsh wants bash and we need bash also
inst /bin/bash
else
dwarning "caps: does not work with systemd in the initramfs"
fi
}

View File

@@ -0,0 +1,71 @@
#!/bin/bash
# called by dracut
check() {
[[ $mount_needs ]] && return 1
if ! dracut_module_included "systemd"; then
derror "systemd-networkd needs systemd in the initramfs"
return 1
fi
return 255
}
# called by dracut
depends() {
echo "systemd kernel-network-modules"
}
installkernel() {
return 0
}
# called by dracut
install() {
inst_multiple -o \
$systemdutildir/systemd-networkd \
$systemdutildir/systemd-networkd-wait-online \
$systemdsystemunitdir/systemd-networkd-wait-online.service \
$systemdsystemunitdir/systemd-networkd.service \
$systemdsystemunitdir/systemd-networkd.socket \
$systemdutildir/network/99-default.link \
networkctl ip
#hostnamectl timedatectl
# $systemdutildir/systemd-timesyncd \
# $systemdutildir/systemd-timedated \
# $systemdutildir/systemd-hostnamed \
# $systemdutildir/systemd-resolvd \
# $systemdutildir/systemd-resolve-host \
# $systemdsystemunitdir/systemd-resolved.service \
# $systemdsystemunitdir/systemd-hostnamed.service \
# $systemdsystemunitdir/systemd-timesyncd.service \
# $systemdsystemunitdir/systemd-timedated.service \
# $systemdsystemunitdir/time-sync.target \
# /etc/systemd/resolved.conf \
# inst_dir /var/lib/systemd/clock
grep '^systemd-network:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
grep '^systemd-network:' /etc/group >> "$initdir/etc/group"
# grep '^systemd-timesync:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd"
# grep '^systemd-timesync:' /etc/group >> "$initdir/etc/group"
_arch=$(uname -m)
inst_libdir_file {"tls/$_arch/",tls/,"$_arch/",}"libnss_dns.so.*" \
{"tls/$_arch/",tls/,"$_arch/",}"libnss_mdns4_minimal.so.*" \
{"tls/$_arch/",tls/,"$_arch/",}"libnss_myhostname.so.*" \
{"tls/$_arch/",tls/,"$_arch/",}"libnss_resolve.so.*"
for i in \
systemd-networkd-wait-online.service \
systemd-networkd.service \
systemd-networkd.socket
# systemd-timesyncd.service
do
systemctl --root "$initdir" enable "$i"
done
}

View File

@@ -0,0 +1,11 @@
#!/bin/sh
#
# Licensed under the GPLv2
#
# Copyright 2013 Red Hat, Inc.
# Peter Jones <pjones@redhat.com>
for x in /lib/modules/keys/* ; do
[ "${x}" = "/lib/modules/keys/*" ] && break
keyctl padd asymmetric "" @s < ${x}
done

View File

@@ -0,0 +1,38 @@
#!/bin/bash
#
# Licensed under the GPLv2
#
# Copyright 2013 Red Hat, Inc.
# Peter Jones <pjones@redhat.com>
# called by dracut
check() {
require_binaries keyctl || return 1
# do not include module in hostonly mode,
# if no keys are present
if [[ $hostonly ]]; then
x=$(echo /lib/modules/keys/*)
[[ "${x}" = "/lib/modules/keys/*" ]] && return 255
fi
return 0
}
# called by dracut
depends() {
return 0
}
# called by dracut
install() {
inst_dir /lib/modules/keys
inst_binary keyctl
inst_hook pre-trigger 01 "$moddir/load-modsign-keys.sh"
for x in /lib/modules/keys/* ; do
[[ "${x}" = "/lib/modules/keys/*" ]] && break
inst_simple "${x}"
done
}

View File

@@ -0,0 +1,20 @@
#!/bin/bash
# called by dracut
check() {
# do not add this module by default
return 255
}
# called by dracut
depends() {
return 0
}
# called by dracut
install() {
inst_multiple -o ps grep more cat rm strace free showmount \
ping netstat rpcinfo vi scp ping6 ssh \
fsck fsck.ext2 fsck.ext4 fsck.ext3 fsck.ext4dev fsck.f2fs fsck.vfat e2fsck
}

View File

@@ -0,0 +1,79 @@
#!/bin/bash
# called by dracut
check() {
return 255
}
# called by dracut
depends() {
return 0
}
# called by dracut
install() {
# Do not add watchdog hooks if systemd module is included
# In that case, systemd will manage watchdog kick
if ! dracut_module_included "systemd"; then
inst_hook cmdline 00 "$moddir/watchdog.sh"
inst_hook cmdline 50 "$moddir/watchdog.sh"
inst_hook pre-trigger 00 "$moddir/watchdog.sh"
inst_hook initqueue 00 "$moddir/watchdog.sh"
inst_hook mount 00 "$moddir/watchdog.sh"
inst_hook mount 50 "$moddir/watchdog.sh"
inst_hook mount 99 "$moddir/watchdog.sh"
inst_hook pre-pivot 00 "$moddir/watchdog.sh"
inst_hook pre-pivot 99 "$moddir/watchdog.sh"
inst_hook cleanup 00 "$moddir/watchdog.sh"
inst_hook cleanup 99 "$moddir/watchdog.sh"
fi
inst_hook emergency 02 "$moddir/watchdog-stop.sh"
inst_multiple -o wdctl
}
installkernel() {
local -A _drivers
local _alldrivers _active _wdtdrv _wdtppath _dir
[[ -d /sys/class/watchdog/ ]] || return
for _dir in /sys/class/watchdog/*; do
[[ -d "$_dir" ]] || continue
[[ -f "$_dir/state" ]] || continue
_active=$(< "$_dir/state")
! [[ $hostonly ]] || [[ "$_active" = "active" ]] || continue
# device/modalias will return driver of this device
_wdtdrv=$(< "$_dir/device/modalias")
# There can be more than one module represented by same
# modalias. Currently load all of them.
# TODO: Need to find a way to avoid any unwanted module
# represented by modalias
_wdtdrv=$(modprobe --set-version "$kernel" -R $_wdtdrv 2>/dev/null)
if [[ $_wdtdrv ]]; then
instmods $_wdtdrv
for i in $_wdtdrv; do
_drivers[$i]=1
done
fi
# however in some cases, we also need to check that if there is
# a specific driver for the parent bus/device. In such cases
# we also need to enable driver for parent bus/device.
_wdtppath=$(readlink -f "$_dir/device")
while [[ -d "$_wdtppath" ]] && [[ "$_wdtppath" != "/sys" ]]; do
_wdtppath=$(readlink -f "$_wdtppath/..")
[[ -f "$_wdtppath/modalias" ]] || continue
_wdtdrv=$(< "$_wdtppath/modalias")
_wdtdrv=$(modprobe --set-version "$kernel" -R $_wdtdrv 2>/dev/null)
if [[ $_wdtdrv ]]; then
instmods $_wdtdrv
for i in $_wdtdrv; do
_drivers[$i]=1
done
fi
done
done
# ensure that watchdog module is loaded as early as possible
_alldrivers="${!_drivers[*]}"
[[ $_alldrivers ]] && echo "rd.driver.pre=${_alldrivers// /,}" > ${initdir}/etc/cmdline.d/00-watchdog.conf
return 0
}

View File

@@ -0,0 +1,2 @@
#!/bin/sh
[ -c /dev/watchdog ] && printf 'V' > /dev/watchdog

View File

@@ -0,0 +1,12 @@
#!/bin/sh
if [ -e /dev/watchdog ]; then
if [ ! -e /tmp/watchdog_timeout ]; then
wdctl -s 60 /dev/watchdog >/dev/null 2>&1
> /tmp/watchdog_timeout
fi
info "Triggering watchdog"
>/dev/watchdog
else
modprobe ib700wdt
modprobe i6300esb
fi

Some files were not shown because too many files have changed in this diff Show More