Compare commits

..

3456 Commits
0.3 ... RHEL-7

Author SHA1 Message Date
Lukas Nykryn
6b82776107 net-lib: check if addr exists before checking for dad state
Before we check if dad is done we should first make sure,
that there is a link local address where we do the check.

Due to this issue, on ipv6 only setups sometimes dhclient started
asking for ip address, before the link local address was present
and failed immediately.
2019-10-29 14:47:26 +01:00
Harald Hoyer
57c3103a69 dracut.sh: quote sync file argument 2019-10-22 12:26:15 +02:00
Ankit Kumar
1126a69746 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>
2019-10-22 12:24:46 +02:00
Lukas Nykryn
6193b3a6e2 rootfs-generator: don't set JobRunningTimeoutSec
We don't have that in rhel7 systemd
2019-08-29 09:40:09 +02:00
Harald Hoyer
e8a7c2a152 network: skip already enslaved interfaces 2019-06-19 14:42:52 +02:00
Lukas Nykryn
65623826c1 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-05-14 10:10:33 +02:00
Lukas Nykryn
e42ab58a70 rootfs-generator: rebase to upstream version
Resolves: #1640866
2019-04-25 10:11:58 +02:00
Lukas Nykryn
937b808a0d 95iscsi/iscsiroot: synchronously wait until iscsistart finishes 2019-04-01 17:25:05 +02:00
Renaud Métrich
2ee1e96e1a fips: removed false-positive 'FATAL: Module xxx not found' error message when kernel provides a generic algo for module
Signed-off-by: Renaud Métrich <rmetrich@redhat.com>

Cherry-picked from: 01ffcf342a
Resolves: #1649743
2019-03-27 17:54:57 +01:00
Kairui Song
c6ccef8827 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>

Cherry-picked from: 8365177644
Resolves: #1672817
2019-03-27 17:51:07 +01:00
Renaud Métrich
97dd467e8e iscsi: always popd, even if there is no iscsi device
Cherry-picked from: 33cfad0b8f
Resolves: #1684474
2019-03-27 17:47:42 +01:00
Renaud Métrich
fc87cf0e7e 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>

Cherry-picked from: c1c78f8a91
Resolves: #1588483
2019-02-25 10:49:10 +01:00
Renaud Métrich
75d6e4366a fips: check fips integrity just before mounting local filesystems in /sysroot
Signed-off-by: Renaud Métrich <rmetrich@redhat.com>

Cherry-picked from: e54ab383f7
Resolves: #1640981
2019-02-25 10:44:50 +01:00
Ondrej Dubaj
d76ccd07bc added make rpm/srpm options 2019-02-12 13:40:19 +01:00
Kairui Song
e5c337c3b3 kernel-modules: add nfit
To support pmem devices, nfit module is required

Cherry-picked from: 09ba1b289f
Resolves: #1288619
2018-09-27 15:26:09 +02:00
Lukas Nykryn
e4034dcae3 dracut-functions: fix the word splitting
Cherry-picked from: dc4f0a40f8fbea23ccd1e0fcde48d5c6f7996021
Resolves: #1607744
2018-08-09 12:17:50 +02:00
Harald Hoyer
da6411f59c dracut.spec: remove 90multipath-hostonly
Cherry-picked from: ca77afdeb3
Resolves: #1599592
2018-07-30 14:49:39 +02:00
Lukas Nykryn
af97814e42 Revert "add 90multipath-hostonly module"
This reverts commit 6ef3173e86.

Cherry-picked from: 35e86ac117
Resolves: #1599592
2018-07-30 13:55:57 +02:00
Kairui Song
ecd196732f 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>

Cherry-picked from: a695250ec7
Resolves: #1599592
2018-07-30 13:55:57 +02:00
Christian Rodrigues
5f381a151f 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>

Cherry-picked from: b52cfbea
Resolves: #1608491
2018-07-30 13:55:57 +02:00
Kairui Song
8df75b1573 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

Cherry-picked from: 7047294617
Resolves: #1607744
2018-07-30 13:55:47 +02:00
Lukas Nykryn
013030d947 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

Cherry-picked from: 62b7920ed
Resolves: #1453907
2018-06-21 15:21:50 +02:00
Xunlei Pang
f055e5126f 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>

Cherry-picked from: 795256bbb
Resolves: #1442663
2018-06-20 12:04:47 +02:00
Harald Hoyer
c9e0ee2c91 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

Cherry-picked from: 3cea0658
Resolves: #1451660
2018-06-20 11:13:33 +02:00
NeilBrown
f421aa0f16 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>

Cherry-picked from: 3b82ac16
Resolves: #1451660
2018-06-20 11:13:24 +02:00
Thomas Renninger
125bb747c3 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.

Cherry-picked from: cea907f6bf
Resolves: #1577626
2018-06-20 10:55:59 +02:00
Derek Higgins
903d6fc2fc 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.

Cherry-picked from: 9408a2ac33
Resolves: #1513397
2018-06-20 10:53:44 +02:00
Fabian Vogt
249dcc61ea 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.

Cherry-picked from: 9fd3e045d
Resolves: #1547730
2018-06-20 10:23:22 +02:00
Pingfan Liu
26273649dc 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>

Cherry-picked from: 67354ee
Resolves: #1582398
2018-06-14 13:41:09 +02:00
Harald Hoyer
15384bcedb 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.

Cherry-picked from: 9ed6eb741
Resolves: #1531503
2018-06-14 10:29:19 +02:00
Harald Hoyer
dd235965dd 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

Cherry-picked from: e64dafd1f2
Resolves: #1549498
2018-06-11 12:37:37 +02:00
Lukas Nykryn
388c771a28 net-lib: bump carrier timeout to 15
df95b10 caused that dracut now waits only 5 seconds for carrier.
Let's bump this in downstream to avoid regressions in minor versions.

RHEL-only
Resolves: #1401811
2018-06-11 12:30:07 +02:00
Lukas Nykryn
f264cfbe8a dracut.sh: workaround broken read from /proc/modules
RHEL-only (upstream is using libkmod)
Resolves: #1578222
2018-06-11 12:17:20 +02:00
Lukas Nykryn
de688a407c 90lvm: always add dm-snapshot
Resolves: #1546577
2018-02-19 16:09:53 +01:00
Alexander Tsoy
58a5434f75 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'

Cherry-picked from: c41df7e1
Resolves: #1306640
2018-02-01 14:04:41 +01:00
Alexander Tsoy
9dfcc5f066 base/dracut-lib.sh: remove bashism
Cherry-picked from: 13efce5d
Resolves: #1306640
2018-02-01 14:04:41 +01:00
Thorsten Behrens
014a78261d 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>

Cherry-picked from: e3eec4b8
Resolves: #1306640
2018-02-01 14:04:41 +01:00
Harald Hoyer
e8ffd4b3d4 dracut-lib.sh:dev_unit_name(): use systemd-escape, if available
Cherry-picked from: 85752f0f
Resolves: #1306640
2018-02-01 14:04:41 +01:00
Lukas Nykryn
19da2dda22 90dmsquash-live-ntfs: fix depends()
Dependencies should not include module number.

Cherry-picked from: f3e09bf1cb
Resolves: #1449410
2018-02-01 12:48:55 +01:00
Lukas Nykryn
5aadb10791 90dmsquash-live: we don't have find_binary inside initramdisk
Cherry-picked from: c42c387cca
Resolves: #1449410
2018-02-01 12:48:05 +01:00
Erwan Velu
7812b7a7b0 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,

Cherry-picked from: c9364f6ea2
Resolves: #1489882
2018-01-11 16:11:08 +01:00
Lukas Nykryn
69a889ee67 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

Cherry-picked from: d818986db4
Resolves: #1415032
2018-01-03 10:57:10 +01:00
Lukas Nykryn
9b1d79993d 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

Cherry-picked from: 8f5c564cb3
Resolves: #1415032
2017-12-18 16:13:37 +01:00
Daniel Molkentin
a0e7bc11c8 Simplify microcode lookup for for AMD CPUs
Suggested by Tom Lendacky <thomas.lendacky@amd.com>

Cherry-picked from: 19453dc874
Resolves: #1476039
2017-12-18 09:52:39 +01:00
Daniel Molkentin
f93c34935f Support Microcode Updates for AMD CPU Family 0x17
Original-Patch-By: Tom Lendacky <thomas.lendacky@amd.com>

Cherry-picked from: 215fe58324
Resolves: #1476039
2017-12-18 09:52:34 +01:00
Harald Hoyer
e076279d38 dracut.sh: remove quotes from install_items and install_optional_items
Unfortunately these are lists with whitespaces.

Cherry-picked from: 3c00189988
Resolves: #1520721
2017-12-13 16:41:45 +01:00
Pingfan Liu
43d6b9d008 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>

Cherry-picked from: e6199960d9
Resolves: #1520721
2017-12-08 14:54:15 +01:00
Harald Hoyer
69b5de6251 guard ${arrays[@]} with ""
Cherry-picked from: 3721635b2c
Resolves: #1520721
2017-12-08 14:54:02 +01:00
Harald Hoyer
0259f1c246 network/ifup: don't arping for point-to-point connections
https://bugzilla.redhat.com/show_bug.cgi?id=1477339

Cherry-picked from: 5abd692fe4
Resolves: #1477339
2017-11-03 14:10:54 +01:00
Javier Martinez Canillas
240c2fea10 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>

Cherry-picked from: 1792759721
Resolves: #1480246
2017-11-03 14:03:43 +01:00
Harald Hoyer
75bf5df420 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

Cherry-picked from: e27ecc9ae8
Resolves: #1490777
2017-11-03 14:01:42 +01:00
Robert LeBlanc
50c3405ce0 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>

Cherry-picked from: d0eabcab43
Resolves: #1494265
2017-11-03 13:39:32 +01:00
Imran Haider
50d75a50fb add 'mtu' parameter for bond options
Signed-off-by: Imran Haider <imran1008@gmail.com>

Cherry-picked from: 292548be6e
Resolves: #1494265
2017-11-03 13:39:28 +01:00
Chad Dupuis
3d1c9a76e7 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>

Cherry-picked from: 3966a1e1ee
Resolves: #1378910
2017-11-03 13:30:53 +01:00
Bryn M. Reeves
0fe8ed5ccb 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'.

Cherry-picked from: cc4e507322
Resolves: #1489841
2017-11-03 13:16:57 +01:00
Yu Watanabe
fe89c8f9df spec: add missing modules
Cherry-picked from: ad3b209d40
Resolves: #1457311
2017-11-02 13:10:13 +01:00
Harald Hoyer
6ef3173e86 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

Cherry-picked from: 5ce7cc7337
Resolves: #1457311
2017-11-02 13:07:43 +01:00
Robert Scheck
015d5aee92 Add NTFS support to 90dmsquash-live module
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).

Backports 37437cac8a from dracut 046
2017-11-02 13:06:22 +01:00
Lukas Nykryn
0489607bf6 dracut.sh: gather host_modalias when "--no-hostonly-default-device" is set
rhel-only
Related: #1483838
2017-10-27 14:36:26 +02:00
Lukas Nykryn
e2afcc958b rootfs-block/module-setup.sh: check root_dev in cmdline_rootfs()
In case of "--no-hostonly-default-device", we do not need
the root device, thus add this check.

Reimplementation of upstream commit 5634a31156

Resolves: #1483838
2017-10-26 13:50:17 +02:00
Xunlei Pang
0e842c4b8b 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>

Cherry-picked from: 37f2fe55d
Resolves: #1483838
2017-10-26 12:25:37 +02:00
Harald Hoyer
063d6acb7b 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.

Cherry-picked from: 6c8fc6e377
Resolves: #1479325
2017-09-20 14:56:41 +02:00
Harald Hoyer
8131fd3c11 dracut.cmdline: remove extra ":" from ip= doc
Cherry-picked from: 0a7d7f6310
Resolves: #1469997
2017-09-20 14:44:26 +02:00
Harald Hoyer
744afe7531 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.

Cherry-picked from: 3d875f77f3
Resolves: #1415032
2017-09-20 10:34:17 +02:00
Harald Hoyer
17092b128c fips: honor $BOOT_IMAGE variable for HMAC check of the kernel
https://bugzilla.redhat.com/show_bug.cgi?id=1415032

Cherry-picked from: 4693daa5fa
Resolves: #1415032
2017-09-20 10:34:07 +02:00
Lukas Nykryn
7b9bbc2a82 01fips: add authenec module
Resolves: #1465946
2017-06-28 16:10:48 +02:00
Lukas Nykryn
994a6cdd88 95iscsi: run iscsistart with DefaultDependencies=no
In upstream part of 7e51a94f5b

Resolves: #1461234
2017-06-15 14:01:13 +02:00
Lukas Nykryn
3674e2e16f fips: add cmac kernel module
cmac is now marked as fips_allowed

Resolves: rhbz#1460865
2017-06-13 16:40:47 +02:00
Peter Robinson
436052a84b 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>

Cherry-picked from: 917e1b6b5b
Resolves: #1459277
2017-06-12 16:09:01 +02:00
Prarit Bhargava
784c92876b 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

Resolves: #1459277
2017-06-12 16:09:01 +02:00
Lukas Nykryn
fb008ce665 Revert "systemd/dracut-initqueue.sh: don't go into emergency"
This reverts commit 4c5f1b3b4a.

Resolves: #1396865
2017-06-12 16:09:01 +02:00
Michal Sekletar
02d0d0a208 udev-rules: pull in 40-redhat-cpu-hotplug.rules
Cpu hotplug policy was split off to separate file. Let's pull in the new
rules file by default.

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

Resolves: #1460707
2017-06-12 15:55:30 +02:00
Tong Li
5ae8333947 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.

Cherry-picked from: 32f5af2f5e
Resolves: #1360131
2017-04-20 10:08:06 +02:00
Lukas Nykryn
ea8bef9893 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-04-06 16:27:01 +02:00
Lukas Nykryn
3186abd76e 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-04-06 16:27:01 +02:00
Lukas Nykryn
a603e1f3a6 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-03-24 10:34:27 +01:00
Lidong Zhong
2877acadc0 dracut-functions.sh: remove duplicate declaratio of local variable 2017-03-16 12:22:13 +01:00
Xunlei Pang
414834306b 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>
2017-03-14 12:36:16 +01:00
Xunlei Pang
01e66d43d8 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>
2017-03-14 12:33:18 +01:00
Xunlei Pang
e186d99780 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>
2017-03-14 12:33:13 +01:00
Xunlei Pang
3ce2235abb 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>
2017-03-14 12:33:07 +01:00
Harald Hoyer
9301650e17 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.
2017-03-10 15:39:36 +01:00
Harald Hoyer
d971a570d0 add dracut.pc pkg-config file 2017-03-10 15:39:36 +01:00
Harald Hoyer
72ae0fd418 systemd/dracut-cmdline.sh: unset "UNSET" $root
https://bugzilla.redhat.com/show_bug.cgi?id=1365667
caused by commit 9aa224cc
2017-01-18 13:13:44 +01:00
Harald Hoyer
fa861e2cbf dracut.conf.5.asc: add Warning about leading and trailing spaces in lists 2017-01-11 13:47:24 +01:00
Harald Hoyer
b120b0c116 dracut.sh: skip empty lines in /proc/modules
https://bugzilla.redhat.com/show_bug.cgi?id=1405025
2017-01-11 13:40:13 +01:00
Harald Hoyer
1bb76cea72 fips/module-setup.sh: make tcrypt non-optional 2016-11-30 15:02:16 +01:00
Harald Hoyer
5fd8d27383 README.md: correct CentOS build job link 2016-11-30 14:15:37 +01:00
Harald Hoyer
d381343caa README.md: correct CentOS build job link 2016-11-30 14:06:58 +01:00
Harald Hoyer
11366030aa README.md: correct CentOS build job link 2016-11-30 14:01:03 +01:00
Harald Hoyer
455f87f41f fips/fips.sh: also check for crypto-$mod in /proc/crypto
if the module name is the alias crypto-<algo>, check if <algo> is in
/proc/crypto as "name : <algo>" or "driver: <algo>"
2016-11-30 13:56:23 +01:00
Harald Hoyer
73cf135d80 fips/module-setup.sh: also blacklist the alias resolved modules 2016-11-30 13:54:20 +01:00
Harald Hoyer
0ee8c37f39 Merge pull request #172 from haraldh/RHEL-7
RHEL-7: prepare testsuite for jenkins
2016-11-11 15:27:30 +01:00
Harald Hoyer
968eb46fce TEST-99-RPM: speedup test 2016-11-11 15:10:08 +01:00
Harald Hoyer
904c466cdb testsuite: guard against kernel panic
call qemu with --no-reboot and append "panic=1" to the kernel cmdline
2016-11-11 13:45:24 +01:00
Harald Hoyer
ba5efdcffa TEST-70-BONDBRIDGETEAMVLAN: fix server ip setup 2016-11-11 13:45:00 +01:00
Harald Hoyer
afeb39aa85 TEST-30-ISCSI/test.sh: set device timeout 2016-11-11 13:11:36 +01:00
Harald Hoyer
a081e072d8 test-rpms.txt: add dhcp 2016-11-11 12:34:00 +01:00
Harald Hoyer
aa40b82145 test/Makefile: proper return code for "make check" 2016-11-11 12:18:06 +01:00
Harald Hoyer
81bb61b525 TEST-99-RPM: ignore openldap leftovers 2016-11-11 11:42:54 +01:00
Harald Hoyer
7b4173d698 test/test-rpms.txt: add gzip 2016-11-11 11:40:58 +01:00
Harald Hoyer
13a61f82ba TEST-ISCSI: fix command check 2016-11-11 11:34:33 +01:00
Harald Hoyer
d2fd423a8d test: remove sudo calls
rather run:

$ sudo make check
2016-11-10 14:57:05 +01:00
Harald Hoyer
f432d367fc test/test-rpms.txt: add list of rpms to install 2016-11-10 14:42:01 +01:00
Harald Hoyer
6dcb4867ae README.md: update 2016-10-20 15:27:53 +02:00
Harald Hoyer
05a38caaf2 add README.md 2016-10-20 14:59:26 +02:00
Lukas Nykryn
443d167a95 network: do not check "firmware boot selected flag"
Apparently it is not set correctly on some setups
https://bugzilla.redhat.com/show_bug.cgi?id=1380581
2016-10-05 17:46:36 +02:00
Harald Hoyer
33710dfbfc 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.
2016-09-07 10:20:20 +02:00
Harald Hoyer
c87d489ca6 network/parse-ip-opts: be more liberal to multiple ip= options
Do not bail out early.

https://bugzilla.redhat.com/show_bug.cgi?id=1304069
2016-09-07 10:20:20 +02:00
Harald Hoyer
99e72a4b1c fcoe: only install /etc/hba.conf, it it exists
https://bugzilla.redhat.com/show_bug.cgi?id=1369342
2016-09-07 10:17:43 +02:00
Harald Hoyer
39c4892772 TEST-16-DMSQUASH: add sr_mod
otherwise no cdrom can be accessed on RHEL-7
2016-08-26 11:24:42 +02:00
Harald Hoyer
8c67fb9123 nfs: install more kernel modules
adds support for rpcrdma to support NFSROOT over NFSoRDMA

https://bugzilla.redhat.com/show_bug.cgi?id=1367374
2016-08-19 15:56:47 +02:00
Harald Hoyer
1d267fb82c dracut.cmdline.7.asc: document rd.shell=0 for rd.emergency 2016-08-17 16:49:00 +02:00
Harald Hoyer
91896ab68e dracut.sh: document --hostonly-i18n and --no-hostonly-i18n
show description in --help

https://bugzilla.redhat.com/show_bug.cgi?id=1266448
2016-08-17 16:48:07 +02:00
Harald Hoyer
1b23c6c65c 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
2016-08-17 16:41:21 +02:00
Harald Hoyer
b8e6c051c6 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
2016-08-17 16:26:13 +02:00
Harald Hoyer
fc77aca7dd systemd/dracut-cmdline.sh: unset "UNSET" $root
https://bugzilla.redhat.com/show_bug.cgi?id=1365667
caused by commit 9aa224cc
2016-08-12 13:29:31 +02:00
Harald Hoyer
7a7b8c1740 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
2016-08-12 12:33:10 +02:00
Harald Hoyer
8dd6ff8d6a fips: remove sha1-mb
This module should be loaded automatically, if the HW supports it.
2016-08-12 12:33:10 +02:00
Lukas Nykryn
10e6bf0e43 fips-module: add missing spaces
https://bugzilla.redhat.com/show_bug.cgi?id=1359677
2016-07-28 12:27:10 +02:00
Harald Hoyer
cd6679c716 add rd.emergency=[reboot|poweroff|halt]
specifies what action to execute in case of a critical failure

(cherry picked from commit c45e856a65)

https://bugzilla.redhat.com/show_bug.cgi?id=1359144
2016-07-22 15:26:32 +02:00
Harald Hoyer
20171c7519 lvm: include /etc/lvm/lvm_<host_tag>.conf
https://bugzilla.redhat.com/show_bug.cgi?id=1328778
2016-07-22 13:26:10 +02:00
Harald Hoyer
b7c7b16d4e dracut.sh: extend host_fs_types with $filesystems
Additional filesystems specified on the kernel command line or in the
configuration files, should trigger the inclusion of the corresponding
dracut modules, therefore host_fs_types is extended with these
filesystems.
2016-07-22 08:39:38 +02:00
Harald Hoyer
b077d18963 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.
2016-07-22 08:30:36 +02:00
Harald Hoyer
2f42cfcbeb fips: add "sha1-mb" to fips modules
https://bugzilla.redhat.com/show_bug.cgi?id=1357080
2016-07-21 15:08:59 +02:00
Harald Hoyer
0eb1afa9ea fips: use /lib/modules/$(uname -r)/modules.fips
if /lib/modules/$(uname -r)/modules.fips exists, use that list instead
of the dracut module list.
2016-07-21 15:07:52 +02:00
Harald Hoyer
2c9f267268 Merge pull request #141 from pratyushanand/for-RHEL-7
RHEL7: Install module for active watchdog
2016-07-21 11:12:01 +02:00
Harald Hoyer
038f142ef9 dracut.spec: remove trailing space 2016-07-06 09:17:36 +02:00
Harald Hoyer
1492490070 watchdog: start traversing the device tree from the right directory
start with the device subtree, not with the parent of it
2016-07-05 12:52:16 +05:30
Harald Hoyer
0eb1ee3db2 watchdog: clean return of installkernel()
return 0, otherwise if _alldrivers is empty, the return code is fail
2016-07-05 12:52:16 +05:30
Harald Hoyer
4c83fd10ab 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-07-05 12:52:16 +05:30
Pratyush Anand
f69cd051ab 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-07-05 12:52:16 +05:30
Pratyush Anand
0be17528e5 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-07-05 12:52:16 +05:30
Pratyush Anand
e5439c9b37 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-07-05 12:52:16 +05:30
Harald Hoyer
573e508554 dracut.spec: remove dd
dd is part of coreutils
2016-07-04 16:30:47 +02:00
Harald Hoyer
7b0ce59233 TEST-70-BONDBRIDGETEAMVLAN: add testcase for testsuite
multiple bonds
multiple bridges
multiple vlans
2016-07-04 16:28:08 +02:00
Harald Hoyer
7a90c8b343 network: support multiple vlan, team, bridge and bond 2016-07-04 16:28:08 +02:00
HATAYAMA Daisuke
84d845fc7d 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.

(cherry picked from commit 3ce142861d)

Conflicts:
	lsinitrd.sh
2016-07-01 13:17:18 +02:00
Harald Hoyer
aea64fe178 TEST-14-IMSM: add rd.device.timeout 2016-07-01 13:17:18 +02:00
Harald Hoyer
271a64bfd1 TEST-13-ENC-RAID-LVM: add rd.device.timeout=40 2016-07-01 12:29:16 +02:00
Harald Hoyer
fd8506b5da systemd: let booting work after exiting emergency
If the user managed to mount /sysroot, let it work
2016-07-01 12:29:16 +02:00
Harald Hoyer
4c5f1b3b4a systemd/dracut-initqueue.sh: don't go into emergency
let systemd go into emergency.target later on
2016-07-01 12:29:15 +02:00
Harald Hoyer
a95fe14581 99base/init.sh: break the initqueue, if emergency shell was successful 2016-07-01 12:29:15 +02:00
Harald Hoyer
6efee60f93 test/TEST-12-RAID-DEG: add rd.device.timeout 2016-07-01 12:29:15 +02:00
Harald Hoyer
22a907b383 test/TEST-04-systemd: fixup test
- fix find -perm
- add failme test cases
- remove journal output
2016-07-01 12:29:15 +02:00
Harald Hoyer
ca46c751d1 add rd.device.timeout=<seconds> parameter 2016-07-01 12:29:15 +02:00
Harald Hoyer
ca64eeec79 virtfs: use systemd generator
use a systemd generator, instead of a dracut hook to mount
2016-07-01 12:29:15 +02:00
Alexander Kurtz
9aa224cc19 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

(cherry picked from commit 016613c774)
2016-07-01 12:29:15 +02:00
Harald Hoyer
13264563a9 network:wait_for_ipv6_auto() wait for all tentative addresses 2016-07-01 12:29:15 +02:00
Harald Hoyer
cc3f588071 network: flush only IPv4 addresses on configuration
also flush on dhcp
2016-07-01 12:29:15 +02:00
Harald Hoyer
42dd8928a8 network: differ between ipv6 local and global tentative
For dhcpv6, only a non-tentative scope local address is needed.
2016-06-30 11:10:35 +02:00
Harald Hoyer
6d22a6860e network/net-lib.sh: auto6 wait for route ra
Wait for a router advertised route
2016-06-30 08:52:09 +02:00
Hannes Reinecke
bac74f05e3 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>
(cherry picked from commit c98d1756f7)
2016-06-29 18:26:58 +02:00
Xunlei Pang
a320422588 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>
(cherry picked from commit 4fa5c235a7)
2016-06-29 17:27:36 +02:00
Harald Hoyer
5bc318633f 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>

cherry-pick of commit cf376023e6
2016-06-29 17:26:17 +02:00
Michael Chapman
53310e44c9 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.

(cherry picked from commit 5dea430e08)
2016-06-29 17:21:56 +02:00
Harald Hoyer
a7805d1297 network/net-lib.sh(wait_for_ipv6_dad): simplify ip call
taken from initscripts
2016-06-29 17:19:06 +02:00
Harald Hoyer
435af39a00 network/net-lib.sh(parse_ifname_opts): support 21 byte MAC addrs
infiniband MAC addrs are 20 bytes long not 6

https://bugzilla.redhat.com/show_bug.cgi?id=1319270
2016-06-29 16:37:40 +02:00
Harald Hoyer
323093b621 test: add TEST-60-MTUMAC
test MTU and MACADDR setting
2016-06-29 15:51:42 +02:00
Harald Hoyer
61b5ee6d1d network: set MTU and MACADDR for dhcp and auto6 2016-06-29 15:13:35 +02:00
Harald Hoyer
55712f46c0 test: don't call ldconfig with -- path separator 2016-06-29 15:11:39 +02:00
Harald Hoyer
53e4ab7174 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]
2016-06-29 12:44:49 +02:00
Harald Hoyer
b7f5e42c57 network/net-lib.sh: correctly set mac address for ip=...:<mtu>:<mac>
if ip=...:<mtu>:<mac> was specified, macadress was not set

(cherry picked from commit efbc47b8e4)
2016-06-29 12:15:12 +02:00
Harald Hoyer
603a0fe0a3 fcoe-up: remove initlog logic
(cherry picked from commit f60b7d8655)
2016-06-29 12:06:20 +02:00
Hannes Reinecke
f105eaebb8 95fcoe: update fcoe interface check 2016-06-29 11:57:56 +02:00
Hannes Reinecke
f501c955e8 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>
(cherry picked from commit 8b257fcc86)
2016-06-29 11:54:19 +02:00
Hannes Reinecke
b9668f8f00 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>
(cherry picked from commit 0a68a26cff)
2016-06-29 11:51:05 +02:00
Hannes Reinecke
a4cbfd719b 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>
(cherry picked from commit 22e837b645)
2016-06-29 11:50:56 +02:00
Harald Hoyer
7335bd1e23 Defer modprobe of HW modules, until udev is running
Also honor blacklisting

(cherry picked from commit 437dad70e9)
2016-06-29 11:50:13 +02:00
Hannes Reinecke
26eeb4af8d 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>
(cherry picked from commit b8efaa0017)
2016-06-29 11:41:21 +02:00
Mike Gilbert
d6b9aac6d0 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.

(cherry picked from commit 5899f2f516)
2016-06-29 11:40:14 +02:00
Thomas Renninger
3186a0aa15 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>
(cherry picked from commit e683985d10)
2016-06-29 11:34:26 +02:00
Harald Hoyer
cc7d2eeb36 add "--install-optional" and install_optional_items
(cherry picked from commit 54b68829b6)
2016-06-29 11:28:23 +02:00
Harald Hoyer
b4ad021d34 dracut: only use one tmpdir
also remove any partial written initramfs images
2016-06-29 11:25:12 +02:00
Harald Hoyer
f45726652f fcoe: check if needed for hostonly 2016-06-29 10:50:58 +02:00
Harald Hoyer
ced0638e2c Disable early microcode for non-x86 architecures 2016-06-29 10:45:58 +02:00
Harald Hoyer
8175f5eb82 test/TEST-02-systemd: use marker disk for successfull boot marker 2016-06-27 10:28:09 +02:00
Harald Hoyer
017c16b97a systemd: add -.slice and make reboot work
-.slice and conflicting with emergency.target and shutdown.target
makes reboot work
2016-06-27 10:27:05 +02:00
Harald Hoyer
320b8d5c0c network/dhclient.conf: add missing commata
options need to be seperated by ,

(cherry picked from commit 7e51abc81f)
2016-06-24 11:10:19 +02:00
Harald Hoyer
0b7c2400c3 TEST-50-MULTINIC: add multiple bond tests 2016-06-22 14:03:12 +02:00
Harald Hoyer
fefb96f43f network/parse-bond.sh: handle multiple bond interfaces 2016-06-22 13:32:11 +02:00
Harald Hoyer
1472b5486b ifup: setup bridge, bonding and teaming only once
if those assembled interfaces use dhcp "$iface.up" is created too late
2016-06-10 16:24:24 +02:00
Harald Hoyer
e6ae0c6128 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
2016-06-10 16:24:24 +02:00
Harald Hoyer
ac422d577c base/dracut-lib.sh: add trim()
trim() to remove leading and trailing whitespace
2016-06-10 16:24:24 +02:00
Harald Hoyer
484aba4298 network: add 73-idrac.rules udev rules
idrac USB devices want a special network name
2016-06-08 16:19:12 +02:00
Harald Hoyer
b14e0fb826 more dash removal 2016-05-27 11:22:38 +02:00
Harald Hoyer
863105bce1 dracut.spec: add a tag with the current version 2016-05-27 11:22:38 +02:00
Harald Hoyer
15ec719501 test/NBD: add checks for needed binaries 2016-05-27 11:22:38 +02:00
Harald Hoyer
249a94ab04 test: remove dash module, as it is not available in RHEL 2016-05-27 11:22:38 +02:00
Harald Hoyer
6656e1547f dracut-functions.sh: add str_starts() and str_ends() 2016-05-25 14:49:34 +02:00
Daniel Drake
688afe0fc3 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.

(cherry picked from commit 6dcc5e1158)
2016-05-25 14:40:40 +02:00
Harald Hoyer
8fb06a0562 shutdown: guard against read-only /run
remount the switch rooted /run writeable again.

(cherry picked from commit 54e09dfb72)
2016-05-23 12:49:32 +02:00
Hannes Reinecke
68021e85c9 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>
2016-05-18 14:44:16 +02:00
Hannes Reinecke
12aa314819 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>
2016-05-18 14:44:16 +02:00
Hannes Reinecke
bff5416520 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>
2016-05-18 14:44:16 +02:00
Hannes Reinecke
9eab750787 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>
2016-05-18 14:44:16 +02:00
Hannes Reinecke
f31220ec88 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>
2016-05-18 14:44:16 +02:00
Harald Hoyer
043d61b542 url-lib/url-lib.sh:nfs_fetch_url(): pass file directory to query if nfs is already mounted
Otherwise the returned mount path includes the file with the directory

https://bugzilla.redhat.com/show_bug.cgi?id=1302764
2016-03-14 15:55:03 +01:00
Harald Hoyer
0d7b00a230 network: if rd.neednet=0 we don't need a bootdev
otherwise dracut would wait for the bootdev interface to appear and be
setup

(cherry picked from commit f4f8fb5c10)
2016-02-29 15:07:59 +01:00
Harald Hoyer
a48ea27deb network/dhclient-script.sh: add classless-static-routes support
https://bugzilla.redhat.com/show_bug.cgi?id=1260955
2016-02-29 15:00:46 +01:00
Harald Hoyer
9d030e4ef1 documentation: "--hostonly-i18n" "--no-hostonly-i18n" "i18n_install_all"
(cherry picked from commit fe6455a6e8)
2016-02-29 13:13:02 +01:00
Harald Hoyer
3a39dd027f dracut.sh: for microcode generation, skip gpg files
skip all ".asc" files for the AMD microcode generation

(cherry picked from commit c44d2252bb)
2016-02-29 11:56:05 +01:00
Harald Hoyer
de8cc25d70 dracut: add "tar" and "dd" requirement
https://bugzilla.redhat.com/show_bug.cgi?id=1285810
2016-02-29 11:55:25 +01:00
Harald Hoyer
ba977abe63 systemd: add "wheel" and "adm" to passwd and group
# LANG=C journalctl -b -u systemd-tmpfiles-setup-dev.service | grep
     # ACL
     Dec 01 13:56:59 localhost.localdomain systemd-tmpfiles[112]: Failed
to parse ACL "d:group:adm:r-x,d:group:wheel:r-x": Invalid argument.
Ignoring
     Dec 01 13:56:59 localhost.localdomain systemd-tmpfiles[112]: Failed
to parse ACL "group:adm:r-x,group🛞r-x": Invalid argument. Ignoring
     Dec 01 13:56:59 localhost.localdomain systemd-tmpfiles[112]: Failed
to parse ACL "d:group:adm:r-x,d:group:wheel:r-x": Invalid argument.
Ignoring
     Dec 01 13:56:59 localhost.localdomain systemd-tmpfiles[112]: Failed
to parse ACL "group:adm:r-x,group🛞r-x": Invalid argument. Ignoring

     # grep ^[aA] /usr/lib/tmpfiles.d/systemd.conf
     a+ /run/log/journal/%m - - - - d:group:adm:r-x,d:group:wheel:r-x
     A+ /run/log/journal/%m - - - - group:adm:r-x,group🛞r-x
     a+ /var/log/journal/%m - - - - d:group:adm:r-x,d:group:wheel:r-x
     A+ /var/log/journal/%m - - - - group:adm:r-x,group🛞r-x

https://bugzilla.redhat.com/show_bug.cgi?id=1287537
2016-02-29 11:52:37 +01:00
Thomas Renninger
69762959ae 90lvm: Install dm-snapshot module
bnc#888530

Signed-off-by: Thomas Renninger <trenn@suse.de>
(cherry picked from commit 5c84d51b3f)
2016-02-29 11:47:43 +01:00
Pekka Wallendahl
851946468a 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

(cherry picked from commit 28058a2e37)
2016-02-29 11:43:18 +01:00
Harald Hoyer
28665b4fa5 dracut-functions.sh:fix check_vol_slaves() volume group name stripping
commit 466a59984a removed whitespace
stripping from lvm volume group names.

(cherry picked from commit 2fd8588da5)
2016-02-29 11:41:42 +01:00
Harald Hoyer
17985b2575 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.

(cherry picked from commit df95b1003c)
2015-12-14 16:16:00 +01:00
Harald Hoyer
2f20797a40 iscsi/iscsiroot.sh: better put variables in quotes
first rule for a bash programmer
2015-11-26 10:10:40 +01:00
Harald Hoyer
d2380720db Don't call udevadm control --exit in systemd mode
This partly reverts commit a43f97c4e3.

(cherry picked from commit 765d8408e9)

https://bugzilla.redhat.com/show_bug.cgi?id=1276983
2015-11-26 10:10:40 +01:00
Harald Hoyer
19912dd3c5 Merge pull request #98 from lnykryn/RHEL-7-vlan
write-ifcfg: fix creating configuration for VLAN
2015-11-11 11:44:48 +01:00
Harald Hoyer
3dd6a30ec8 Merge pull request #99 from lnykryn/RHEL-7-ibmvscsi
90qemu: also add ibmvscsi on qemu
2015-11-11 11:44:23 +01:00
Lukas Nykryn
50a0070773 90qemu: also add ibmvscsi on qemu
Without this module following scenario does not work:
1. Install the guest with virtio-scsi-pci as system disk and no other
data disk.
2. Change the system disk from virtio-scsi to spapr-vscsi.
2015-10-20 15:30:12 +02:00
Fedora dracut team
32398e1525 write-ifcfg: fix creating configuration for VLAN
Currently the physdev is unset before it is somehow applied.
Also there is no DEVICE in the output.
2015-10-19 18:32:01 +02:00
Harald Hoyer
e658251173 network/ifup.sh: skip empty nameserver values 2015-10-09 11:35:43 +02:00
Harald Hoyer
3bce34dfd7 ifcfg/write-ifcfg.sh: don't bind interface, if physical device is set
If a physical device is defined, we don't need to bind the interface to
the MAC address or something else.
2015-10-09 11:31:28 +02:00
Harald Hoyer
d1f7f2ac04 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.
2015-10-09 11:30:03 +02:00
Harald Hoyer
7de064b57c ifcfg/write-ifcfg.sh: unset vlan
clear the vlan flag, if a previous interface in the loop
was a vlan interface

(cherry picked from commit 23446ef1e0)
2015-10-09 11:10:07 +02:00
Harald Hoyer
5f24e43401 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.

(cherry picked from commit 4135eea634)
2015-10-09 11:06:50 +02:00
Harald Hoyer
a594b4e357 dracut.sh: fixed typo in microcode generation 2015-09-25 14:10:20 -04:00
Lubomir Rintel
5263556ff3 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.

(cherry picked from commit c59779cf93)
2015-09-25 12:48:55 -04:00
Harald Hoyer
fe74a7069b base/dracut-lib.sh:info() be more quiet 2015-09-25 12:42:15 -04:00
Harald Hoyer
f059985b14 network:wait_for_ifup() handle "NO-CARRIER" output
if "NO-CARRIER" is one of the flags, we surely have no link yet.
2015-09-25 12:42:15 -04:00
Harald Hoyer
327d765512 dracut.sh: no microcode, if get_ucode_file returns empty file
check, if get_ucode_file() returned an empty string.
2015-09-17 20:07:26 +02:00
Harald Hoyer
7fd112f20e iscsi/parse-iscsiroot.sh: correct handling if netroot isn't set
corrects bfe65f913a
2015-09-17 15:41:12 +02:00
Harald Hoyer
bcc2132dab scsi/parse-iscsiroot.sh: call modprobe with "-b"
honor, if a module is blacklisted
2015-09-17 12:32:07 +02:00
Harald Hoyer
13b5c1d09e dracut.sh: do not create microcode, if no firmware is available 2015-09-15 16:10:00 +02:00
Harald Hoyer
34b551a1c4 dracut.sh: add command line option for install_i18_all
--no-hostonly-i18n -> install_i18n_all=yes
--hostonly-i18n -> install_i18n_all=no
2015-09-15 16:06:50 +02:00
Harald Hoyer
7c0b1d864d i18n: check for $i18n_install_all == "yes" rather than being set
i18n_install_all="no" does not have the expected effect without this
patch

(cherry picked from commit ae488efa5e)
2015-09-14 15:16:18 +02:00
Harald Hoyer
fd3eddf069 iscsi/iscsiroot.sh: handle iscsi_firmware in online and timeout queue
The return code of iscsi_firmware is broken, so set the marker
unconditionally.
2015-09-10 13:27:02 +02:00
Harald Hoyer
17cee31b11 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)
2015-09-10 13:23:32 +02:00
Harald Hoyer
7cddfbbadb iscsi/iscsiroot.sh: use all_ifaces_setup()
we want the route and gateway setup
2015-09-10 13:21:53 +02:00
Harald Hoyer
63e75dc4cd 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.
2015-09-10 13:20:18 +02:00
Harald Hoyer
52845b168d network/dhclient-script.sh: fix RENEW
Remove check, if interface is already up. It is for RENEW.

new_prefix is apparently new_subnet_mask
2015-09-08 11:44:13 +02:00
Harald Hoyer
c850879b86 dracut.usage.asc: update man page
- clarify grub2 config for debugging
- clarify hostonly mode
2015-09-03 16:25:23 +02:00
Harald Hoyer
b334c83e4a network: move "ip=ibft" handling to network module 2015-09-03 12:41:44 +02:00
Harald Hoyer
eb87dc91d0 iscsi/parse-iscsiroot.sh: only set initiator-name, if not empty 2015-09-03 12:41:06 +02:00
Harald Hoyer
b813b1b306 livenet/livenetroot.sh: fixed error condition
copy&paste error
2015-09-02 09:47:35 +02:00
Harald Hoyer
2182945a9e qemu: add spapr-vscsi kernel module 2015-09-01 20:27:13 +02:00
Harald Hoyer
7316d68353 network/ifup: do DHCP for BOOTDEV 2015-09-01 19:05:37 +02:00
Harald Hoyer
a4c47ce0dd network/net-lib.sh: fix IPv6 route parsing 2015-09-01 17:25:34 +02:00
Harald Hoyer
d8572e0bf4 network/net-lib.sh: fix wait_for_if_up()
wait for <*UP*> and not "state UP"

state can be UNKNOWN
2015-09-01 17:23:33 +02:00
Harald Hoyer
70f3c07846 network/ifup: fix warning about not bringing interface up 2015-09-01 17:22:37 +02:00
Harald Hoyer
0852c38b7a cms/cmsifup.sh: do not use ifup -m
we don't want to bring the interface up several times
2015-09-01 17:21:53 +02:00
Harald Hoyer
3d1bd59eb0 multipath: add hostonly multipath.conf
Resolves: rhbz#994702
2015-08-25 13:49:10 +02:00
Harald Hoyer
7c24815034 network/ifup.sh: only use dhcp on unknown interfaces for ip=dhcp 2015-08-25 11:37:16 +02:00
Harald Hoyer
53537f4d23 network: also mark interfaces up with their MAC 2015-08-25 11:30:00 +02:00
Harald Hoyer
b4006781e8 network/ifup.sh: save return value of ifup 2015-08-25 11:20:30 +02:00
Harald Hoyer
a6befb52eb iscsi/parse-iscsiroot.sh: restart iscsid with try-restart 2015-08-25 11:16:46 +02:00
Harald Hoyer
7f59cbd318 iscsi/parse-iscsiroot.sh: handle firmware in online queue 2015-08-25 11:16:29 +02:00
Harald Hoyer
197e4c90b9 iscsi/parse-iscsiroot.sh: do not modify netroot 2015-08-25 11:15:59 +02:00
Harald Hoyer
3bd3bbec31 iscsi/iscsiroot.sh: handle firmware in online queue
otherwise it does not get called, if no netroot is set
2015-08-25 11:14:38 +02:00
Harald Hoyer
35f40b75e4 dracut.spec: raise systemd requirement to >= 219
needs systemd-escape
2015-08-25 11:13:38 +02:00
Harald Hoyer
d3f61fb5cd initqueue: add online queue 2015-08-25 11:13:23 +02:00
Harald Hoyer
310574f7ea TEST-30-ISCSI: add rd.scsi.firmware 2015-08-25 11:12:59 +02:00
Harald Hoyer
b70b81f1c4 crypt/module-setup.sh: fixed parsing crypttab with no ending newline 2015-08-19 16:19:31 +02:00
Harald Hoyer
32770ca79a network/ifup.sh:do_static(): error out, if IP is already assigned 2015-08-19 14:00:28 +02:00
Harald Hoyer
77f46adf5e network/ifup.sh:do_static(): error out, if interface could not be brought up 2015-08-19 13:59:40 +02:00
Harald Hoyer
d9b5a98532 TEST-15-BTRFS: load btrfs module 2015-08-18 15:26:37 +02:00
Harald Hoyer
65977ef1d1 test/TEST-04-FULL-SYSTEMD/create-root.sh: modprobe btrfs
why so ever... it used to load automatically
2015-08-18 15:05:11 +02:00
Harald Hoyer
80153acc0f dmraid: only scan once because of one device 2015-08-18 15:04:31 +02:00
Harald Hoyer
d6bfa7052a network/dhclient: exit arping immediatly, if we get an answer 2015-08-18 12:41:12 +02:00
Harald Hoyer
942d60d8af network/net-lib.sh:ibft unset gateway or dns, if set to 0.0.0.0 2015-08-18 12:40:01 +02:00
Harald Hoyer
69c437dd1c fcoe: cleanup lldpad
Resolves: rhbz#1246217
2015-08-18 12:27:32 +02:00
Harald Hoyer
0c0abf97cc udev-rules: install 40-redhat.rules 2015-08-18 12:25:53 +02:00
Harald Hoyer
2eb3b00133 network/parse-ip-opts.sh: bind enx* interface to the MAC
do it automatically for the persistent naming scheme
2015-08-18 12:13:55 +02:00
Harald Hoyer
38180271c5 network/ifup.sh: arping for static IPv4 addresses 2015-08-18 12:07:41 +02:00
Harald Hoyer
fb2d643a38 network/ifup.sh: let dhcp client run in the background
we need to renew the lease
2015-08-18 11:55:05 +02:00
Harald Hoyer
93a5a3d3ca systemd/dracut-cmdline.sh: print out cmdline in one line 2015-08-18 11:55:05 +02:00
Harald Hoyer
ad565584a3 base/dracut-lib.sh:vinfo/vwarn handle lines without newline 2015-08-18 11:55:05 +02:00
Harald Hoyer
bfe65f913a iscsi: handle timeout case better 2015-08-18 11:55:05 +02:00
Harald Hoyer
415d0c68ab dracut-logger.sh: log also rest of line without return 2015-08-18 11:55:05 +02:00
Harald Hoyer
836ca3f47e TEST-30-ISCSI: fix test to run with new iscsi 2015-08-18 11:55:00 +02:00
Harald Hoyer
f74b0a9f38 iscsi/module-setup.sh: iscsid need /var/lib/iscsi 2015-08-15 13:22:07 +02:00
Harald Hoyer
88329f6b4f iscsi/iscsiroot.sh: systemd-run does not understand --no-block
not yet on RHEL-7
2015-08-15 13:21:29 +02:00
Harald Hoyer
1a2c9bbd2d 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.

(cherry picked from commit c22c43f81a)
2015-08-13 15:31:59 +02:00
Harald Hoyer
99b9b4896e TEST-30-ISCSI/dhcpd.conf: set the LUN
set the LUN, so the udev rule to mount the disk matches

(cherry picked from commit 52b91b6698)
2015-08-13 15:29:11 +02:00
Harald Hoyer
543a6d5cab iscsi/iscsiroot.sh: handle timeout with all interfaces up
restart iscsid, because it may disbehaved

(cherry picked from commit 6802cf2349)
2015-08-13 15:29:03 +02:00
Harald Hoyer
d9b00731c8 iscsi/parse-iscsiroot.sh: use iBFT initiator name
(cherry picked from commit feb8dc685d)
2015-08-13 15:28:54 +02:00
Harald Hoyer
a9a38f9f60 dracut.cmdline.7.asc: document rd.iscsi.waitnet and rd.iscsi.testroute
(cherry picked from commit 69171aa8fa)
2015-08-13 15:28:48 +02:00
Harald Hoyer
e25c3dbb6f 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.

(cherry picked from commit d94050ddae)
2015-08-13 15:28:16 +02:00
Harald Hoyer
d544733084 network/net-lib.sh: add is_ip()
add function to test if string is a valid IP

(cherry picked from commit 01b23b6900)
2015-08-13 15:25:24 +02:00
Harald Hoyer
fc0ead21c9 systemd: add systemd-run and systemd-escape 2015-08-13 15:24:53 +02:00
Harald Hoyer
53ecce179b network/parse-ip-opts.sh: assume rd.neednet for multiple ip options
set rd.neednet on the kernel cmdline to disable this behaviour

(cherry picked from commit 4e9ba952bf)
2015-08-13 15:23:28 +02:00
Harald Hoyer
2bb564073b nfs/parse-nfsroot.sh: silence useless warning if netroot is not nfs
(cherry picked from commit 50e86bf02b)
2015-08-13 15:23:23 +02:00
Harald Hoyer
c643f4e8ab dracut-systemd/dracut-initqueue.sh: be verbose about timeout
Issue a warning, if timeout scripts are executed

(cherry picked from commit 8ba684be1c)
2015-08-13 15:23:17 +02:00
Harald Hoyer
1db0d1f78b 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.

(cherry picked from commit 0fa5dbedc5)
2015-07-16 09:43:05 +02:00
Harald Hoyer
a6470f332f dracut-functions.sh: degrade info about missing binaries to info
(cherry picked from commit 83a3cba777)
2015-07-16 09:42:50 +02:00
Harald Hoyer
89948e58fd crypt: install drbg unconditionally in hostonly mode
older kernels had the drbg kernel module and didn't need it
2015-07-09 16:14:50 +02:00
Harald Hoyer
77ffc465b9 lvm: add cache tools for dm-cache usage
(cherry picked from commit 70598ac292)
2015-07-03 14:40:08 +02:00
Gerd von Egidy
28be8992c3 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>
(cherry picked from commit 99ccbc30df)
2015-07-03 14:37:37 +02:00
Harald Hoyer
968c66b609 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

(cherry picked from commit 0b7bfacfea)
2015-07-03 14:36:12 +02:00
Harald Hoyer
3cf4ec08e5 lsinitrd.sh: ignore "cat: write error: Broken pipe" 2015-07-03 14:35:25 +02:00
Harald Hoyer
77c0b30825 man page: changed grub.conf to grub2.cfg 2015-07-03 14:28:55 +02:00
Harald Hoyer
f11d7a81e2 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
2015-07-03 14:25:40 +02:00
Harald Hoyer
34b49be882 base/dracut-lib.sh: read /proc/cmdline with multiple lines
also parse cmdline files without an ending newline

(cherry picked from commit 9f0878540b)
2015-07-03 14:17:51 +02:00
Radek Vykydal
ccebb4c045 Add rd.live.overlay.size option
(cherry picked from commit 18423f7951)
2015-07-03 14:16:48 +02:00
Harald Hoyer
2af6708641 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.

(cherry picked from commit 370035d561)
2015-07-03 14:08:35 +02:00
Harald Hoyer
900550c4e0 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
(cherry picked from commit 26d14fb3d3)
2015-07-03 14:08:07 +02:00
Colin Guthrie
589b4e61e2 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

(cherry picked from commit 3e3ed34f03)
2015-07-03 14:06:29 +02:00
Hannes Reinecke
7b3178d9ad 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>
(cherry picked from commit 6755c20855)
2015-07-03 14:04:19 +02:00
Harald Hoyer
e5f4bbd804 livenet: don't attempt to download the image for every interface
https://bugzilla.redhat.com/show_bug.cgi?id=1152485
2015-07-03 14:01:01 +02:00
Harald Hoyer
34203d03c0 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
2015-07-03 13:53:44 +02:00
Chris Leech
4031a2fa64 fcoe: EDD parsing patch for i40e 2015-07-03 13:44:16 +02:00
Chris Leech
d02f522089 fcoe: start with fcoemon instead of fipvlan 2015-07-03 13:40:34 +02:00
Harald Hoyer
d8ad687e1a 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.
2015-07-03 13:33:27 +02:00
Harald Hoyer
b34bd60c3b 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.

(cherry picked from commit 180e9d7851)
2015-07-02 19:47:46 +02:00
Harald Hoyer
afbff20e51 50drm: add hyperv_fb kernel module
https://bugzilla.redhat.com/show_bug.cgi?id=1192035
(cherry picked from commit 81b67232dc)
2015-07-02 19:47:46 +02:00
Fabian Deutsch
55473e86b6 doc: Add a minimal rd.live.overlay documentation
Signed-off-by: Fabian Deutsch <fabiand@fedoraproject.org>
(cherry picked from commit a1b4efe6a7)
2015-07-02 19:47:46 +02:00
Fabian Deutsch
70b7ec9492 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>
(cherry picked from commit b0472eac11)
2015-07-02 19:47:46 +02:00
Harald Hoyer
23e3c7f95f 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

(cherry picked from commit 1f8abe81a9)
2015-07-02 19:47:46 +02:00
Fabian Deutsch
db1e692c13 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>
(cherry picked from commit d6e34d362a)
2015-07-02 19:47:46 +02:00
Major Hayden
b9c6d2b2af 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>
(cherry picked from commit 504c0a8fec)
2015-07-02 19:47:46 +02:00
Harald Hoyer
1211a10b95 splitup dracut-init.sh from dracut-functions.sh
other tools want to source dracut-functions.sh without any mkdir side
effects.

(cherry picked from commit 777f2db037)
2015-07-02 19:47:46 +02:00
Harald Hoyer
4350c73199 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
(cherry picked from commit ba665de454)
2015-07-02 19:47:46 +02:00
Chao Fan
a218f3253c 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>
(cherry picked from commit 3586a7aa77)
2015-07-02 19:47:46 +02:00
Harald Hoyer
fe15c6b6cb nfs/parse-nfsroot.sh: don't unset netroot, if not nfs
(cherry picked from commit afcc697cb8)
2015-07-02 19:47:46 +02:00
Harald Hoyer
00c118a93a 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.

(cherry picked from commit 7cca5efdce)
2015-07-02 19:47:46 +02:00
Harald Hoyer
4ec362ce0b 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.

(cherry picked from commit 0f89ec314b)
2015-07-02 19:47:46 +02:00
Harald Hoyer
efe5301ab9 network/dhclient-script.sh: add RENEW/REBIND
(cherry picked from commit cf627b20d0)
2015-07-02 15:16:06 +02:00
Harald Hoyer
da3dacfa5e 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.

(cherry picked from commit 30e6e809ed)
2015-07-02 15:16:06 +02:00
Harald Hoyer
e2b5b450e7 dracut-lib.sh:info() output info to stderr
otherwise it might collide with stdout redirection

(cherry picked from commit 57fb6e67de)
2015-07-02 15:16:06 +02:00
Harald Hoyer
bd98c4def1 crypt: add drbg kernel module 2015-07-02 15:16:06 +02:00
Harald Hoyer
90b5b48734 dracut.sh: add devices with x-initrd.mount in /etc/fstab to host_devs
otherwise dracut might not even be able to mount those.

(cherry picked from commit 916559e073)
2015-07-02 15:16:06 +02:00
Harald Hoyer
1ad2884d82 dracut-pre-pivot: call udevadm settle one last time
Some Hardware needs initialization and killing modprobe or modprobe
scripts would harm the process.
2015-06-16 13:58:05 +02:00
Harald Hoyer
e863891c15 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:47:58 +02:00
Harald Hoyer
10e5b14705 network:dhcp:wait_for_ipv6_dad() in PREINIT6 2015-05-07 14:42:49 +02:00
Harald Hoyer
a503d1dda9 rearrange fips module ordering due to zlib
[    1.220106] alg: pcomp: Failed to load transform for zlib: -2
[    1.221346] alg: pcomp: Failed to load transform for zlib: -2
2015-05-07 14:29:22 +02:00
Harald Hoyer
8f1febc874 fips: add some s390 kernel modules
(cherry picked from commit 822a7ae504)
2015-05-05 18:16:47 +02:00
Harald Hoyer
cf3098064c dracut.sh: add $tmpfilesdir to install files to /usr/lib/tmpfiles.d
(cherry picked from commit 3a04bddeed)
2015-04-02 16:13:24 +02:00
Harald Hoyer
9eb6db5b9a 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.

(cherry picked from commit 99d4fd6bb7)
2015-04-02 16:11:31 +02:00
Harald Hoyer
3f7d943141 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".

(cherry picked from commit 2a12e97475)
2015-02-19 12:33:33 +01:00
Harald Hoyer
f2558ddcc1 fips: add drbg kernel module
(cherry picked from commit 7e9341434f)
2015-02-19 11:05:59 +01:00
Harald Hoyer
b9372137fd network:ifup source team info if present 2015-01-21 13:39:28 +01:00
Harald Hoyer
4f992675ae network/net-lib.sh:parse_iscsi_root(): fix c&p bug
fix iscsi_target_name for eui.* and naa.* target names

(cherry picked from commit 7cddd7b838)
2015-01-15 10:37:56 +01:00
Harald Hoyer
6914b67545 dracut: fixed module dependency handling
Fail for "--modules" and "--force-add" dracut modules, if they or their
dependencies cannot be included.

(cherry picked from commit ab2f95e45e)
2015-01-14 11:46:39 +01:00
Harald Hoyer
4c88c2859e 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.
2015-01-14 11:41:21 +01:00
Harald Hoyer
c984ddda6a test: add "fs-lib" to dracut module list
(cherry picked from commit eda73c0ad2)
2015-01-14 11:41:21 +01:00
Harald Hoyer
368f08cb7e network: add support for comma separated autoconf options
ip=eth0:auto6,dhcp

might work now
2015-01-14 11:41:21 +01:00
Harald Hoyer
7bbee6ac49 systemd: add 90-vconsole.rules
run systemd-vconsole-setup if fbcon device shows up

(cherry picked from commit 027565d023)
2015-01-13 15:10:35 +01:00
Minfei Huang
0b7fad2837 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>
(cherry picked from commit c440d302f1)
2015-01-13 12:49:32 +01:00
Harald Hoyer
b96ce4a6fd cms/cms-write-ifcfg.sh: turn SUBCHANNELS into lowercase
(cherry picked from commit 3ae03005b8)
2015-01-13 12:48:23 +01:00
Harald Hoyer
509a3b2c33 ssh-client: s/key/$key
GlobalKnownHostsFile was not installed, because key was not $key

Thanks Jan Stodola!

(cherry picked from commit 4ba44e899c)
2015-01-12 14:22:41 +01:00
Harald Hoyer
20700e3dea 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.

(cherry picked from commit 36e8ce4fb0)
2015-01-12 14:11:23 +01:00
Harald Hoyer
8964abbd40 fips: remove c&p "and"
(cherry picked from commit 4089949033)
2015-01-09 14:55:32 +01:00
Harald Hoyer
eeb68f0a16 fips: add libfreeblpriv3.so and libfreeblpriv3.chk
(cherry picked from commit 3659d64df3)
2014-11-28 15:42:56 +01:00
Harald Hoyer
c4c24171bf 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.

(cherry picked from commit 3947f07d93)
2014-10-29 14:07:39 +01:00
Harald Hoyer
0630273048 network/net-lib.sh:is_persistent_ethernet_name() eth* is not
eth* is _not_ a persistent ethernet name... tsk, tsk, tsk

(cherry picked from commit 05065741f0)
2014-10-23 14:38:25 +02:00
Will Woods
aa5313ca0e 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:13 +02:00
Harald Hoyer
815ab93fe9 dracut-functions.sh: exit for missing --force-add or --add dracut modules
Better exit with fail early, so there is no surprise on reboot.

(cherry picked from commit a49cac2e65)
2014-09-12 10:20:45 +02:00
Harald Hoyer
c5c57f3f19 qemu: install virtio_console kernel module
https://bugzilla.redhat.com/show_bug.cgi?id=1097999
(cherry picked from commit 5058ae2d29)
2014-09-12 10:04:30 +02:00
Harald Hoyer
b44b3ed036 cms/cmssetup.sh: understand DASD="none"
Treat DASD="none" as unset.

https://bugzilla.redhat.com/show_bug.cgi?id=1096979
(cherry picked from commit 2f954621cc)
2014-09-12 10:00:23 +02:00
Harald Hoyer
49a23aa426 cms/cmssetup.sh: fixed indention
(cherry picked from commit d681635512)
2014-09-12 10:00:19 +02:00
Harald Hoyer
efaa5b05df 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.

(cherry picked from commit 80043e21c1)
2014-09-12 09:53:20 +02:00
Alex Harpin
4fa660ba8f 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

(cherry picked from commit 32125a976b)
2014-09-12 09:53:13 +02:00
Harald Hoyer
19bb8937ed fixed bridge setup
renamed "ethnames" in bridge.info to "bridgeslaves"

fixed ifcfg generation

(cherry picked from commit 2db6d71118)
2014-09-12 09:53:04 +02:00
Brian C. Lane
17c1f640fa 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
(cherry picked from commit 7e692cfd43)
2014-09-10 11:09:07 +02:00
Harald Hoyer
e03b09212a replaced ip=auto with ip=dhcp in the documentation
https://bugzilla.redhat.com/show_bug.cgi?id=1086931
2014-09-09 13:35:13 +02:00
Harald Hoyer
f86fa29cda network/net-lib.sh:parse_iscsi_root() do not enforce target name
https://bugzilla.redhat.com/show_bug.cgi?id=1078867

cherry-picked from 29763cb72d
2014-09-09 13:33:16 +02:00
Hari Bathini
f2c5c5c961 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'.

(cherry picked from commit 659dc319d9)
2014-09-04 12:57:43 +02:00
Hannes Reinecke
81a6e87f0f Make logfile configurable
Add '--logfile' option to make the log file configurable during
runtime.

Signed-off-by: Hannes Reinecke <hare@suse.de>
(cherry picked from commit ee54b8404c)
2014-09-04 12:47:36 +02:00
Harald Hoyer
52923f5f2a dracut-functions.sh: do not force require modules.builtin*
(cherry picked from commit b29cb51654)
2014-09-04 12:47:31 +02:00
Harald Hoyer
c46be83492 dracut.sh: no need to make subdirs in run
(cherry picked from commit 8d89fc6bb1)
2014-09-04 12:47:27 +02:00
Harald Hoyer
c2ce987e38 dracut.sh: also mkdir /run/lock, which is copied to
(cherry picked from commit 68b736b50f)
2014-09-04 12:47:23 +02:00
Hari Bathini
564c0c4577 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>
(cherry picked from commit 05d2a14526)
2014-09-04 12:26:35 +02:00
Harald Hoyer
5648ff27e2 Do not reload systemd with wait_for_dev 2014-08-29 14:15:18 +02:00
Harald Hoyer
8715aa00a9 dracut-lib.sh:cancel_wait_for_dev() fixed double escape 2014-08-29 14:14:59 +02:00
Harald Hoyer
828fd83bc1 ssh-client: handle /etc/ssh/ssh_config
- disable ProxyCommand
- install the GlobalKnownHostsFile

https://bugzilla.redhat.com/show_bug.cgi?id=1086778
2014-08-29 14:14:10 +02:00
Harald Hoyer
4de30f02c8 add kate and emacs per directory config files 2014-08-29 13:51:39 +02:00
Harald Hoyer
1e03d8eb64 testsuite mods for kvm nested in kvm 2014-07-29 16:27:35 +02:00
Harald Hoyer
2a1bdab6e8 udev-rules: add uaccess and seat rules
plymouth needs the seat rules, also without systemd
2014-07-29 14:39:38 +02:00
Harald Hoyer
c504204de5 network: add rd.route parameter
(cherry picked from commit 7b46244bb9)
2014-07-29 12:06:48 +02:00
Harald Hoyer
e502fd3099 base/dracut-lib:pidof() turn off debugging
(cherry picked from commit ad8638e04e)
2014-07-29 12:06:46 +02:00
Peter Robinson
1e9926c12d ARM: update modules for ARM host only options
(cherry picked from commit 611c895772)
2014-07-29 12:06:42 +02:00
Praveen_Paladugu@Dell.com
7b8f2e7a7b 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):

(cherry picked from commit f4eb0d9804)
2014-07-29 12:06:32 +02:00
Harald Hoyer
8bf70609de dracut-functions.sh: speed up ldconfig_paths()
(cherry picked from commit 5ea0be0a8c)
2014-07-29 12:06:19 +02:00
Harald Hoyer
bb232c88fa dracut.sh: always copy prelink files in FIPS mode
regardless of the the prelink={yes|no} switch

(cherry picked from commit 6cd7001b35)
2014-07-29 12:06:13 +02:00
Harald Hoyer
0c81abbe79 lvm:module-setup.sh: check for existance of 69-dm-lvm-metad.rules
fixup for 12819a5799

(cherry picked from commit fecc1d69e5)
2014-07-29 12:06:09 +02:00
Harald Hoyer
17e74416c8 TEST-15-BTRFSRAID: install /etc/os-release
makes systemd switch-root happy

(cherry picked from commit 44537b7bf8)
2014-07-29 12:06:01 +02:00
Harald Hoyer
932169bc34 test: add udev settle after sfdisk
(cherry picked from commit e54d961160)
2014-07-29 12:05:58 +02:00
Harald Hoyer
b201a3f405 ifcfg: depends on network
(cherry picked from commit f1a38e5294)
2014-07-29 12:05:42 +02:00
Harald Hoyer
ef6665ec41 base/init.sh: use loop counter with unique varname
$i can be polluted too easily

(cherry picked from commit 6525182bfc)
2014-07-29 12:05:38 +02:00
Harald Hoyer
9c2daa5d3a Add "rd.cmdline=ask" kernel command line parameter
prompts the user for additional kernel command line parameters

(cherry picked from commit f232f6623d)

Conflicts:
	dracut.cmdline.7.asc
	modules.d/98systemd/dracut-cmdline.sh
	modules.d/99base/init.sh
2014-07-29 12:04:22 +02:00
Harald Hoyer
f679f53b2a kernel-modules: add tegra arm modules
(cherry picked from commit 54483dd773)
2014-07-29 12:02:25 +02:00
Harald Hoyer
6a9d47ce27 print out, what kernel command line parameters are used
(cherry picked from commit fbc4620f05)

Conflicts:
	modules.d/98systemd/dracut-cmdline.sh
2014-07-29 12:02:06 +02:00
Harald Hoyer
49fe9bc014 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

(cherry picked from commit 7e59d55042)
2014-07-29 12:01:33 +02:00
Tobias Geerinckx
491dbfe072 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.

(cherry picked from commit 773d6a7ded)
2014-07-29 12:01:08 +02:00
Daniel Schaal
8c1807bc97 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.

(cherry picked from commit 7eb0bc7bc4)
2014-07-29 12:01:04 +02:00
Cristian Rodríguez
7cab5fbf59 systemd: Optionally, include efivarsfs module
It is, however not an error if this module can't be found.

(cherry picked from commit f46c2fff71)
2014-07-29 12:00:58 +02:00
Harald Hoyer
6db59a1630 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"

(cherry picked from commit 5580e4c176)
2014-07-29 12:00:51 +02:00
Harald Hoyer
98b104e887 iscsi: correctly install the settled iscsiroot dummy call
initqueue parses $1 as the executable command

(cherry picked from commit bb8c16d121)
2014-07-29 12:00:45 +02:00
Harald Hoyer
b66bfd5b98 iscsi: correctly install the timeout iscsiroot dummy call
initqueue parses $1 as the executable command

(cherry picked from commit 486a8f33e2)
2014-07-29 12:00:42 +02:00
Vasiliy Tolstov
962bb11663 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.

(cherry picked from commit 28f3f537c4)
2014-07-29 12:00:37 +02:00
Alex Harpin
5f5c07eca2 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.

(cherry picked from commit 83c9ff7dbb)
2014-07-29 12:00:33 +02:00
Peter Robinson
9c45cb9c11 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>
(cherry picked from commit 827ec27a9c)
2014-07-29 12:00:29 +02:00
WANG Chao
2fed6038bb 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>
(cherry picked from commit ce7f408dfd)
2014-07-29 12:00:25 +02:00
Hannes Reinecke
e23057d537 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>
(cherry picked from commit ed2005fa5b)
2014-07-29 12:00:06 +02:00
Harald Hoyer
40a5d2c029 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!

(cherry picked from commit 7a94a4326f)
2014-07-29 12:00:03 +02:00
Harald Hoyer
e92a7a2532 fcoe-uefi/parse-uefifcoe.sh: fixed parameter generation from UEFI
"fcoe=" was missing for the parameter specifying the interface

(cherry picked from commit 1427102692)
2014-07-29 11:59:56 +02:00
Harald Hoyer
1175816c30 nbd/nbdroot.sh: call nbd-client with "--systemd-mark"
otherwise nbd-client will get killed by systemd

(cherry picked from commit 056a3f2427)
2014-07-29 11:59:52 +02:00
Harald Hoyer
2a20064e44 ifcfg/write-ifcfg.sh: include net-lib.sh
otherwise is_persistent_ethernet_name() is missing

(cherry picked from commit 8fa1afb65c)
2014-07-29 11:59:49 +02:00
Harald Hoyer
ec158d758b 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!

(cherry picked from commit 19bb14c346)
2014-07-29 11:59:46 +02:00
Harald Hoyer
705c84321d cms/cmssetup.sh: convert SUBCHANNELS to lowercase
In udev rules, the channels need to be expressed in lower case.

(cherry picked from commit 56d57a70ec)
2014-07-29 11:59:40 +02:00
Harald Hoyer
d38488e8d5 ifcfg/write-ifcfg.sh: "IPV6INIT=yes" check also for non-dhcp
(cherry picked from commit 1230f3bcff)
2014-07-29 11:59:36 +02:00
Harald Hoyer
a2a9a17cc6 Do not log to kmsg/syslog and files for "--print-cmdline"
(cherry picked from commit 535f61ca4a)
2014-07-29 11:59:33 +02:00
Harald Hoyer
e5f6899a55 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!

(cherry picked from commit 4e58a1ffc7)
2014-07-29 11:59:29 +02:00
Harald Hoyer
0506080aee ifcfg: only bind to HWADDR, if addr_assign_type == 0
/sys/class/net/$netif/addr_assign_type is != 0 for random MAC address
interfaces

(cherry picked from commit 2e094b20a6)
2014-07-29 11:58:25 +02:00
Harald Hoyer
b990775b6f ifcfg: do not bind persistent interface names to HWADDR
(cherry picked from commit fb0e5184a6)
2014-07-29 11:58:19 +02:00
WANG Chao
251d5b65e3 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>
(cherry picked from commit b31250e7e6)
2014-07-29 11:58:13 +02:00
Harald Hoyer
915618bc4f 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.

(cherry picked from commit 12819a5799)
2014-07-29 11:57:48 +02:00
WANG Chao
f077a20056 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>
(cherry picked from commit e920bfb1e8)
2014-07-29 11:54:47 +02:00
Harald Hoyer
e1021bd2c1 dracut-functions.sh: add /lib/modules/*/{extras|weak-updates} for kernel modules
https://bugzilla.redhat.com/show_bug.cgi?id=1086291
2014-07-29 11:52:07 +02:00
Harald Hoyer
f1ea5376ed 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-07-29 11:52:07 +02:00
Harald Hoyer
4b07c26d33 fs-lib: always install fsck.$fs, if present 2014-07-29 11:52:07 +02:00
Alexander Tsoy
07c4a2fce5 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-07-29 11:52:07 +02:00
Harald Hoyer
4c2d48d5c4 fcoe: workaround fcoe timing issues 2014-07-29 11:52:07 +02:00
Harald Hoyer
db1b5a38e9 dm: add dm-cache modules
https://bugzilla.redhat.com/show_bug.cgi?id=1081435
2014-07-29 11:52:07 +02:00
Harald Hoyer
69acbc4735 network: DCHPv6: set valid_lft and preferred_lft
https://bugzilla.redhat.com/show_bug.cgi?id=1064365
2014-07-29 11:52:07 +02:00
Harald Hoyer
7031115695 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-07-29 11:52:07 +02:00
Harald Hoyer
42896820ba network: handle "ip=dhcp6" for all interfaces
https://bugzilla.redhat.com/show_bug.cgi?id=1064365
2014-07-29 11:52:07 +02:00
Harald Hoyer
bdb6683d6f fcoe: wait for lldpad to be ready
https://bugzilla.redhat.com/show_bug.cgi?id=1080353
2014-07-29 11:52:07 +02:00
Harald Hoyer
c2196a25b7 dracut-initramfs-restore: fix unpacking with early microcode
(cherry picked from commit 0626cbe923)
2014-07-29 11:52:07 +02:00
Harald Hoyer
9d75fd3b62 shutdown: if kexec failed, do a simple reboot 2014-07-29 11:52:07 +02:00
Harald Hoyer
89f2586ae9 network:dhclient-script do PREINIT6 for DHCP6 2014-07-29 11:52:07 +02:00
Harald Hoyer
af1154fdce systemd/dracut-shutdown.service: make failure non-fatal 2014-07-29 11:52:07 +02:00
Harald Hoyer
84c66ac857 Do not wait_for_dev if hostonly_cmdline not set 2014-07-29 11:52:07 +02:00
Harald Hoyer
711030d61d dracut: don't let devices timeout
https://bugzilla.redhat.com/show_bug.cgi?id=949697
2014-07-29 11:52:06 +02:00
WANG Chao
e2e32cd02f 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-07-29 11:52:06 +02:00
Harald Hoyer
dccf47fd55 test/TEST-50-MULTINIC/client-init.sh: skip MAC marker files 2014-07-29 11:52:06 +02:00
Harald Hoyer
e96c010011 test/Makefile: add SKIP env to skip certain tests 2014-07-29 11:52:06 +02:00
Harald Hoyer
8482be832c test: add missing Makefile.testdir 2014-07-29 11:52:06 +02:00
Dave Young
d52c4a761a 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-07-29 11:52:06 +02:00
Harald Hoyer
61bad12d44 systemd: add systemd-sysctl service
https://bugzilla.redhat.com/show_bug.cgi?id=1070086
2014-07-29 11:52:06 +02:00
Harald Hoyer
853897808a network: merge setup_net_$netif.ok and net.$netif.did-setup
one marker per interface is enough
2014-07-29 11:52:06 +02:00
Harald Hoyer
30e2074447 network: IPv6 status, wait for tentative flag to be cleared
also do not arping the IPv6 address.
2014-07-29 11:52:06 +02:00
Harald Hoyer
54c9094e2e network/dhclient-script.sh:DHCP IPv6 interface setup
configure IPv6 interface for DHCP6

https://bugzilla.redhat.com/show_bug.cgi?id=1064365
2014-07-29 11:52:06 +02:00
Harald Hoyer
61fe003168 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-07-29 11:52:06 +02:00
Harald Hoyer
ea6bc75ccb 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-07-29 11:52:06 +02:00
Harald Hoyer
5a3b267d06 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-07-29 11:52:06 +02:00
Harald Hoyer
c2c437edba default conf: set hostonly_cmdline == "no" 2014-07-29 11:52:06 +02:00
Harald Hoyer
81c9e22482 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-07-29 11:52:06 +02:00
Harald Hoyer
da41507de9 systemd: add 70-uaccess.rules 2014-07-29 11:52:06 +02:00
Harald Hoyer
a367bed836 systemd: add sys-kernel-config.mount 2014-07-29 11:52:06 +02:00
Harald Hoyer
6381b94459 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-07-29 11:52:06 +02:00
Harald Hoyer
346fab9500 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-07-29 11:52:06 +02:00
Harald Hoyer
84dfea4d2a 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-07-29 11:52:06 +02:00
Harald Hoyer
64c88c2f1d dracut-functions.sh:find_kernel_modules_by_path() fixed updates search
"updates/*" path does not start with "/"
2014-07-29 11:52:06 +02:00
Harald Hoyer
9bbea8caf8 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-07-29 11:52:06 +02:00
Colin Guthrie
361eaeaf07 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-07-29 11:52:06 +02:00
Brian C. Lane
99ed45c218 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-07-29 11:52:06 +02:00
Harald Hoyer
80f75fed99 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-07-29 11:52:06 +02:00
Harald Hoyer
37a09c9cb6 nfs/nfsroot: symlink /dev/null to /dev/nfs, as a marker for root=/dev/nfs 2014-07-29 11:52:06 +02:00
Harald Hoyer
054447fa23 network/ifup: do not run dhclient twice on the same interface 2014-07-29 11:52:06 +02:00
Harald Hoyer
0c0ca2d9bc network/ifup: do not ifup an already setup network interface 2014-07-29 11:52:06 +02:00
Harald Hoyer
226004e007 skipcpio: fixed signatured check 2014-07-29 11:52:06 +02:00
Cristian Rodríguez
dc662386dc skipcpio: return something at end of program
Otherwise the compiler emits a warning and the return vale is
in theory undefined.
2014-07-29 11:52:06 +02:00
Harald Hoyer
36d3274050 network:fix dns parsing in ip= parameter 2014-07-29 11:52:05 +02:00
Harald Hoyer
d802e985ae fcoe-uefi: do not include, if fcoe utils not installed 2014-07-29 11:52:05 +02:00
Harald Hoyer
3bb36e4512 dracut.spec: add 95fcoe-uefi and 99uefi-lib 2014-07-29 11:52:05 +02:00
Harald Hoyer
c26eb3eb3a move uefi-lib to a seperate module 2014-07-29 11:52:05 +02:00
Harald Hoyer
8bde20bc65 fcoe: move uefi parsing to fcoe-uefi module 2014-07-29 11:52:05 +02:00
Harald Hoyer
c127eb8021 base/rdsosreport.sh: add dracut version to rdsosreport 2014-07-29 11:52:05 +02:00
Harald Hoyer
5676a6d877 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-07-29 11:52:05 +02:00
Harald Hoyer
3d47b5124c network/net-lib.sh: parse ibft nameserver settings 2014-07-29 11:52:05 +02:00
Harald Hoyer
b397bb7c19 network/ifup.sh: handle $dns1 and $dns2 from "ip=" settings 2014-07-29 11:52:05 +02:00
Harald Hoyer
b4b60da8dc network: understand ip=.....:<dns1>:<dns2> 2014-07-29 11:52:05 +02:00
Harald Hoyer
c6fe81559e dracut.conf.d/fedora.conf.example: turn on early_microcode by default 2014-07-29 11:52:05 +02:00
Harald Hoyer
286fbebdaf 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-07-29 11:52:05 +02:00
Harald Hoyer
27acb483e8 dracut-functions.sh: also search in the updates directory 2014-07-29 11:52:05 +02:00
Cristian Rodríguez
657e832da0 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-07-29 11:52:05 +02:00
Harald Hoyer
40cf35ef4e dracut.spec: add skipcpio 2014-07-29 11:52:05 +02:00
Harald Hoyer
f812e271cb iscsi/iscsiroot.sh: beautify warning 2014-07-29 11:52:05 +02:00
Stig Telfer
2f117f4db3 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-07-29 11:52:05 +02:00
Stig Telfer
37a18fda11 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-07-29 11:52:05 +02:00
Harald Hoyer
ade113d75b 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-07-29 11:52:05 +02:00
Harald Hoyer
815b9c16a4 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-07-29 11:52:05 +02:00
Harald Hoyer
eb7c58eced dracut.sh: add early_cpio marker file to the early cpio 2014-07-29 11:52:05 +02:00
Harald Hoyer
a3dc6a7218 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-07-29 11:52:05 +02:00
Harald Hoyer
87862728da dracut.sh: set file owners of early cpio files to 0:0 2014-07-29 11:52:05 +02:00
Harald Hoyer
0d4bb7ce89 dracut.sh: create early cpio dir for acpi tables 2014-07-29 11:52:05 +02:00
Harald Hoyer
b1cdf7c5d4 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-07-29 11:52:05 +02:00
Koen Kooi
a0b85db18e 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-07-29 11:52:05 +02:00
Koen Kooi
dfaeee7341 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-07-29 11:52:05 +02:00
Harald Hoyer
74c9df58f2 dracut-logger.sh: systemd-cat only understands prio 0-7 2014-07-29 11:52:05 +02:00
Harald Hoyer
3c4e663251 lvm:lvm_scan.sh handle one LV at a time with lvchange 2014-07-29 11:52:05 +02:00
Harald Hoyer
56a5975f91 iscsiroot: touch the right marker file 2014-07-29 11:52:04 +02:00
Harald Hoyer
6c7c8d8a07 iscsi: more iscsiroot fixes
handle iscsiroot with firmware more gracefully
2014-07-29 11:52:04 +02:00
Harald Hoyer
d110129695 dracut-lib.sh: fixed shebang 2014-07-29 11:52:04 +02:00
Harald Hoyer
0ab5e8adc8 systemd/rootfs-generator.sh: ignore legacy root=/dev/nfs 2014-07-29 11:52:04 +02:00
Harald Hoyer
9d47a90b12 systemd/rootfs-generator.sh: exit 0 2014-07-29 11:52:04 +02:00
Harald Hoyer
779f980658 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-07-29 11:52:04 +02:00
Harald Hoyer
9bdbbe90ef iscsi: call "iscsistart -b" until it succeeds 2014-07-29 11:52:04 +02:00
Harald Hoyer
5183c9a588 network: add rd.bootif=0 to ignore BOOTIF
https://bugzilla.redhat.com/show_bug.cgi?id=1044623
2014-07-29 11:52:04 +02:00
Harald Hoyer
834f33440f systemd/module-setup.sh: make use of "ln_r" 2014-07-29 11:52:04 +02:00
Harald Hoyer
254f437848 systemd: add seat udev rules and mask loginctl 2014-07-29 11:52:04 +02:00
Harald Hoyer
aa6ab27471 systemd: add 71-seat.rules 73-seat-late.rules
otherwise plymouth does not work
2014-07-29 11:52:04 +02:00
Harald Hoyer
cb97abc7bb 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-07-29 11:52:04 +02:00
Harald Hoyer
d1e9a5e384 network: include all ethernet drivers 2014-07-29 11:52:04 +02:00
Harald Hoyer
81564fcefc documentation: line wrap 2014-07-29 11:52:04 +02:00
Harald Hoyer
82286609c9 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-07-29 11:52:04 +02:00
Harald Hoyer
ea9b961e8c dracut.sh: add missing piece for option --add-device 2014-07-29 11:52:04 +02:00
Harald Hoyer
7faae1264d iscsi/iscsiroot.sh: do not trust iscsistart return value 2014-07-29 11:52:04 +02:00
Harald Hoyer
866e663fbd systemd/dracut-initqueue.sh: fstab is not a directory 2014-07-29 11:52:04 +02:00
Harald Hoyer
9a177f8d51 network: include usbnet drivers 2014-07-29 11:52:04 +02:00
Harald Hoyer
04220f9aff kernel-modules: add more block driver
e.g. nvme
2014-07-29 11:52:04 +02:00
Harald Hoyer
db110a036a dracut-lib/wait_for_dev(): prevent systemd daemon-reload
prevent a systemd daemon-reload, if it is not necessary to do.
2014-07-29 11:52:04 +02:00
Harald Hoyer
937456c65b 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
2014-07-29 11:52:04 +02:00
Harald Hoyer
998f4bb720 test/TEST-17-LVM-THIN: remove .testdir 2014-07-29 11:52:04 +02:00
Harald Hoyer
a34d3dcaa8 test/TEST-17-LVM-THIN: add test case for lvm thin pools 2014-07-29 11:52:04 +02:00
Harald Hoyer
793beab60c lvm: fixed lvm thin check 2014-07-29 11:52:04 +02:00
Harald Hoyer
be10aecb17 base/rdsosreport.sh: add "ip a" output 2014-07-29 11:52:04 +02:00
Harald Hoyer
a1e9e9364a 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
2014-07-29 11:52:04 +02:00
Harald Hoyer
53b20afabb lvm: install thin tools, only when needed in hostonly 2014-07-29 11:52:04 +02:00
Harald Hoyer
5a36d29f8a dracut.modules.7.asc: removed empty section 2014-07-29 11:52:04 +02:00
Harald Hoyer
8d7bd6af19 dracut.sh: fixed PATH shortener 2014-07-29 11:52:03 +02:00
Harald Hoyer
d014032c62 iscsi,nbd: do not fail in hostonly mode 2014-07-29 11:52:03 +02:00
Vratislav Podzimek
90441c4476 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]
2014-07-29 11:52:03 +02:00
Harald Hoyer
dac45f997e 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.
2014-07-29 11:52:03 +02:00
Hannes Reinecke
ff3d291a68 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>
2014-07-29 11:52:03 +02:00
Hannes Reinecke
411d2aedd6 Fixup script permissions
Scripts with a shebang should be marked as executable.

Signed-off-by: Hannes Reinecke <hare@suse.de>
2014-07-29 11:52:03 +02:00
Harald Hoyer
7f61e2c895 dracut.sh: skip crypt swaps with password files 2014-07-29 11:52:03 +02:00
Harald Hoyer
32c431bb48 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
2014-07-29 11:52:03 +02:00
Harald Hoyer
7aa989a4fd network/ifup.sh: before doing dhcp, check, if the link has a carrier 2014-07-29 11:52:03 +02:00
Harald Hoyer
34397fe702 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.
2014-07-29 11:52:03 +02:00
Harald Hoyer
243b8e14a2 network/net-lib.sh:wait_for_if_up() wait for "state UP"
really wait for "state UP", otherwise it returns earlier than we want
2014-07-29 11:52:03 +02:00
Harald Hoyer
fb67162559 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
2014-07-29 11:52:03 +02:00
Harald Hoyer
15962471fe dracut.cmdline.7.asc: document "server-ip" of "ip=" parameter 2014-07-29 11:52:03 +02:00
Harald Hoyer
e590f5beec fips: fix RHEV vmlinuz check 2014-07-29 11:52:03 +02:00
Peter Rajnoha
05b79aaa9d 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!
2014-07-29 11:52:03 +02:00
Harald Hoyer
1dd604efb1 kernel-modules: add ohci-pci to the list of forced module installs 2014-07-29 11:52:03 +02:00
Harald Hoyer
52592ce022 systemd: do not exit the initqueue, if systemd asks a password
this prevents bailing out the initqueue, while passwords are still to be
asked
2014-07-29 11:52:03 +02:00
Colin Guthrie
03bf7758aa 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.
2014-07-29 11:52:03 +02:00
Harald Hoyer
20ff2d37cc fips: also install /etc/system-fips in the initramfs 2014-07-29 11:52:03 +02:00
Harald Hoyer
65ba6c44d8 iscsi/nbd: do not try to mount the whole disk, if root= is missing
only mount the whole disk for root=dhcp
2014-07-29 11:52:03 +02:00
Alexander Tsoy
c35826c0e7 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
2014-07-29 11:52:03 +02:00
Alexander Tsoy
ccad388c25 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.
2014-07-29 11:52:03 +02:00
Kyle McMartin
eb27e4cc31 fips: include crct10dif_generic
Resolves: rhbz#1024455
2014-07-29 11:52:03 +02:00
Harald Hoyer
ee916b72cc 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.
2014-07-29 11:52:03 +02:00
Alexander Tsoy
352a49a21d usrmount/module-setup.sh: fixed typo 2014-07-29 11:52:03 +02:00
Harald Hoyer
8eee542b40 dracut.spec: move /sbin/dracut to /usr/sbin/dracut 2014-07-29 11:52:03 +02:00
Harald Hoyer
37e899aad1 lvm: always install thin utils for lvm 2014-07-29 11:52:03 +02:00
Harald Hoyer
88fc0b8750 kernel-modules(ARM): add mmc_block usb_storage to statis list of kernel mods 2014-07-29 11:52:03 +02:00
Harald Hoyer
9bd3573ddb git2spec.pl: remove ".git$(date)" from release string 2014-07-29 11:52:03 +02:00
P J P
123feea1fa 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]
2014-07-29 11:52:02 +02:00
Marian Csontos
8e3620568c 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.
2014-07-29 11:52:02 +02:00
Harald Hoyer
1a21ed8d1d 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.
2014-07-29 11:52:02 +02:00
Harald Hoyer
84fe197fac Doc: cleanup, extend and split and reuse 2014-07-29 11:52:02 +02:00
Brian C. Lane
86fff83927 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.
2014-07-29 11:52:02 +02:00
Harald Hoyer
f0df0f3fcd dracut.sh: do not bail out, if kernel modules dir is missing
and only print a warning message
2014-07-29 11:52:02 +02:00
Harald Hoyer
52d3c1b726 lvm: install thin utils for non-hostonly 2014-07-29 11:52:02 +02:00
Harald Hoyer
6ea78f9f4e btrfs: use inst_hook to install the timeout hook 2014-07-29 11:52:02 +02:00
Harald Hoyer
4584826e9a rootfs-block: add support for the rootfallback= kernel cmdline option 2014-07-29 11:52:02 +02:00
Harald Hoyer
1b827040f8 fcoe: add FCoE UEFI boot device support 2014-07-29 11:52:02 +02:00
Alexander Tsoy
4fde4d0647 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.
2014-07-29 11:52:02 +02:00
Alexander Tsoy
fdaa69db20 mdraid/module-setup.sh: install configs from /etc/mdadm.conf.d
/etc/mdadm.conf.d directory is supported since mdadm-3.3
2014-07-29 11:52:02 +02:00
Harald Hoyer
31b89c8c2b dracut-functions.sh:inst_rules() do not install rules in CWD 2014-07-29 11:52:02 +02:00
Harald Hoyer
a5659901e8 bcache: optionally install the tools and rules 2014-07-29 11:52:02 +02:00
Peter Rajnoha
32b970339f 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.
2014-07-29 11:52:02 +02:00
Harald Hoyer
d87da4c777 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.
2014-07-29 11:52:02 +02:00
Harald Hoyer
cf9f56be9c dracut.sh: bail out early, if destination dir is not writeable 2014-07-29 11:52:02 +02:00
Harald Hoyer
eaa4d30d5a dracut-bash-completion.sh: add --prelink --noprelink 2014-07-29 11:52:02 +02:00
Thomas Renninger
54011e3591 dracut.conf.5.asc: Add ACPI table override and uncompressed cpio doc
Signed-off-by: Thomas Renninger <trenn@suse.de>
2014-07-29 11:52:02 +02:00
Thomas Renninger
ebc7f823c0 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>
2014-07-29 11:52:02 +02:00
Thomas Renninger
ff33b57676 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>
2014-07-29 11:52:02 +02:00
Thomas Renninger
4b1aa19fa0 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>
2014-07-29 11:52:02 +02:00
Harald Hoyer
764b520994 add /etc/system-fips for dracut-fips subpackage 2014-07-29 11:52:02 +02:00
Harald Hoyer
96f48da50c Add option to turn on/off prelinking
--prelink, --noprelink

do_prelink=[yes|no]
2014-07-29 11:52:02 +02:00
Harald Hoyer
72ce014bc7 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.
2014-07-29 11:52:02 +02:00
Harald Hoyer
af34b26047 dracut.sh: also search uevent's for MODALIAS 2014-07-29 11:52:02 +02:00
WANG Chao
da63c0de56 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.
2014-07-29 11:52:02 +02:00
Harald Hoyer
ffecc45232 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
2014-07-29 11:52:02 +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
Harald Hoyer
21007cb6ec version 0.7 2009-07-25 11:09:35 +02:00
Harald Hoyer
31f7db66a8 strip binaries in initramfs
--strip
              strip binaries in the initramfs (default)

       --nostrip
              do not strip binaries in the initramfs
2009-07-25 11:09:35 +02:00
Harald Hoyer
4f18fe8296 dracut/dracut-gencmdline: fixed copyright header 2009-07-25 11:09:35 +02:00
Harald Hoyer
5494f08cc5 add dracut-catimages
Usage: ./dracut-catimages [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
                        (default: /boot/dracut/)
  -o, --overlaydir      Overlay directory, which contains 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            This message
  --debug               Output debug information of the build process
  -v, --verbose         Verbose output during the build process
2009-07-25 11:09:35 +02:00
Harald Hoyer
c1a37d928f dracut-lib: getarg(), getargs() read command line also from /etc/cmdline
Also honor parameters in /etc/cmdline.

getarg(): If the argument is first fround in /proc/cmdline, then it is
used
2009-07-25 11:09:35 +02:00
Harald Hoyer
0375106c78 add source_conf for static configuration variables
source_conf sources all *.conf files of a directory

init will now source all /etc/conf.d/*.conf files
2009-07-25 11:09:34 +02:00
Harald Hoyer
2b9dfbbeae dracut: usage(): break line for 80 chars 2009-07-25 11:09:34 +02:00
Warren Togami
47b5c0f290 With NFS root, it is possible /tmp/net.ifaces might not exist during pre-pivot.
- udevadm settle will wait for it if necessary.
- Move write-ifcfg.sh later during pre-pivot to reduce likelihood of settling being necessary.
2009-07-24 15:26:33 -04:00
Harald Hoyer
4e6d8fd691 dracut.8: correct manpage entry for ip= 2009-07-24 12:06:12 +02:00
Harald Hoyer
34a369ed2d dracut.8: corrections of parameters and fixed typos 2009-07-24 11:54:08 +02:00
Harald Hoyer
3e6d2b31ea removed all direct references to /proc/cmdline
use getarg() and getargs() from /lib/dracut-lib.sh instead of
reinventing the wheel
2009-07-24 11:54:08 +02:00
Harald Hoyer
13beb248bc dracut: print help for unknow options 2009-07-24 11:54:08 +02:00
Harald Hoyer
b03edf372f 40network/parse-bridge: add bridge to $initrdargs 2009-07-24 11:54:08 +02:00
David Dillow
e663608c40 dash compatible substitution 2009-07-23 23:16:31 -04:00
Warren Togami
ef380e9de8 Turns out this is really a misconfigured DHCP server, apply the same workaround as Debian and upstream dhclient-script. 2009-07-23 16:22:00 -04:00
Warren Togami
39f3a51d65 Fix multiple search domains with proper quoting (thanks dcbw)
Otherwise \032 appears instead of spaces.
2009-07-23 14:31:58 -04:00
Harald Hoyer
4809126378 99base/init: fix argument stripping 2009-07-23 18:57:20 +02:00
Harald Hoyer
6c4b24afb0 nfsroot-cleanup: don't try to read from nonexistant /tmp/nfs.rpc_pipefs_path 2009-07-23 18:27:33 +02:00
Harald Hoyer
c1b2cc48d6 40network/check: source dracut-functions over exported variable 2009-07-23 18:20:11 +02:00
Michael Ploujnikov
fdb3d52d59 use a variable to hold the regex
single quote regexps in variables to make it work with bash-3.1
2009-07-23 15:33:40 +02:00
Michael Ploujnikov
d726d811f1 fix spelling use the modules.d directory name 2009-07-23 15:21:18 +02:00
Marc Grimme
2fe2945869 nfsroot-cleanup: make /var/lib/nfs/rpc_pipefs path configurable
/tmp/nfs.rpc_pipefs_path can contain the path where
/var/lib/nfs/rpc_pipefs will be moved before switch_root.

This is useful if /var is a separate partition in the real root.
2009-07-23 12:19:54 +02:00
Marc Grimme
f016dccc89 95debug: optionally install the debug tools 2009-07-23 12:19:17 +02:00
Marc Grimme
c993cfb32f 40network/check: output which binary is missing for the network module 2009-07-23 12:17:57 +02:00
Marc Grimme
9aaf7c3a33 dracut_install: add "-o" option
Calling dracut_install will optionally install the file. This is useful
for the debug module.
2009-07-23 12:15:54 +02:00
Harald Hoyer
0e77eb3782 dmraid/mdraid: only try to delete partition 1-1024
add "--nr 1-1024" to partx, otherwise partx will try to delete
partitions 1-INT_MAX, which takes a long time.
2009-07-23 11:58:24 +02:00
Harald Hoyer
93ce0a7a1c 95s390: add support to boot from s390 dasds
command line parameter:

DASD
       dasd=....
              same syntax as the kernel module parameter (s390 only)
2009-07-22 16:35:49 +02:00
Harald Hoyer
a8b15b36bf version 0.6 2009-07-22 15:07:47 +02:00
Harald Hoyer
33ee031c4a dracut: add --kernel-only and --no-kernel arguments
--kernel-only
              only install kernel drivers and firmware files

       --no-kernel
              do not install kernel drivers and firmware files

All kernel module related install commands moved from "install"
to "installkernel".

For "--kernel-only" all installkernel scripts of the specified
modules are used, regardless of any checks, so that all modules
which might be needed by any dracut generic image are in.

The basic idea is to create two images. One image with the kernel
modules and one without. So if the kernel changes, you only have
to replace one image.

Grub and the kernel can handle multiple images, so grub entry can
look like this:

title Fedora (2.6.29.5-191.fc11.i586)
        root (hd0,0)
        kernel /vmlinuz-2.6.29.5-191.fc11.i586 ro rhgb quiet
        initrd /initrd-20090722.img
        initrd /initrd-kernel-2.6.29.5-191.fc11.i586.img
        initrd /initrd-config.img

initrd-20090722.img
  the image provided by the initrd rpm
  one old backup version is kept like with the kernel

initrd-kernel-2.6.29.5-191.fc11.i586.img
  the image provided by the kernel rpm

initrd-config.img
  optional image with local configuration files
2009-07-22 15:07:11 +02:00
Harald Hoyer
f24a2d46b7 fix kernel modules dir handling 2009-07-21 18:26:47 +02:00
Harald Hoyer
6a389cfca8 dracut.spec: generic requires bridge-utils for brctl 2009-07-21 18:11:50 +02:00
Harald Hoyer
26537a5b79 add --fwdir parameter to dracut
--fwdir [DIR]
              specify additional directory, where to look for firmwares
2009-07-21 18:11:43 +02:00
Harald Hoyer
aae88014c7 do not BuildRequire kernel-firmware for dracut-generic 2009-07-21 17:50:49 +02:00
Harald Hoyer
441d31b927 use kernel module directory specified on command line in modules also 2009-07-21 17:37:41 +02:00
Harald Hoyer
04db5fdc15 dracut: add --kmoddir directory, where to look for kernel modules
-k, --kmoddir [DIR]
              specify the directory, where to look for kernel modules
2009-07-21 17:25:12 +02:00
Harald Hoyer
0592128b1e dracut-gencmdline: output root device and plymouth theme 2009-07-21 17:23:26 +02:00
Harald Hoyer
308b10311c mdraid: first remove the partitions, then add to the md raid 2009-07-21 15:40:11 +02:00
Harald Hoyer
7045d15460 dmraid/mdraid: use ENV{DEVTYPE} instead of ATTR{partition} 2009-07-21 15:01:41 +02:00
Harald Hoyer
6c034582d2 redhat-i18n: export LANG 2009-07-21 11:53:56 +02:00
Harald Hoyer
57b965ef4b dmraid/mdraid: install "partx" 2009-07-21 11:31:15 +02:00
Harald Hoyer
f4785648fb plymouth: also trigger dri subsystem 2009-07-21 11:30:40 +02:00
Harald Hoyer
e368513370 manpage: add docu for rd_NO_MDIMSM 2009-07-17 16:04:13 +02:00
Harald Hoyer
b54cac21c1 Makefile: make clean before rpm 2009-07-17 16:00:20 +02:00
Harald Hoyer
acff0cc10c version 0.5 2009-07-17 16:00:20 +02:00
Harald Hoyer
a6f8c08347 dracut-gencmdline - generate the kernel command line for the local host 2009-07-17 16:00:20 +02:00
Harald Hoyer
47e1402108 nfs: do not install whole passwd, grep for rpc user 2009-07-17 16:00:20 +02:00
Harald Hoyer
1336db4f1c lvm: output info on rd_NO_LVM 2009-07-17 16:00:20 +02:00
Harald Hoyer
6c1d16ad29 lvm: install lvm.conf in hostonly mode 2009-07-17 16:00:19 +02:00
Harald Hoyer
0de01de409 mdraid: do not handle isw_raid_member if rd_NO_MDIMSM is set in udev ENV
install md-noimsm.sh if mdadm does not support imsm.
2009-07-17 16:00:19 +02:00
Harald Hoyer
499befa692 mdraid: only install mdadm.conf in hostonly mode 2009-07-17 16:00:19 +02:00
Harald Hoyer
435185d7ab mdraid: do not install passwd/group 2009-07-17 16:00:19 +02:00
Harald Hoyer
e0fd2e2f74 dmraid: handle isw_raid_member if rd_NO_MDIMSM is set in udev ENV 2009-07-17 16:00:19 +02:00
Harald Hoyer
024cd021d4 dmraid: redirect error to vinfo 2009-07-17 16:00:19 +02:00
Harald Hoyer
87194701de output info on rd_NO_DM 2009-07-17 16:00:19 +02:00
Harald Hoyer
4578763326 crypt: output info, on rd_NO_LUKS handling 2009-07-17 16:00:19 +02:00
Harald Hoyer
7c00784e5c plymouth: install all themes and make them selectable by command line
Bootsplash - plymouth
       rd_plytheme=<theme name>
              specify the plymouth bootsplash theme (fallback is text)
2009-07-17 16:00:09 +02:00
Harald Hoyer
53e1c5b996 init: add "pre-trigger" and "initqueue" breakpoints 2009-07-17 14:47:49 +02:00
Harald Hoyer
835d568916 plymouth: removed console_init call
/lib/udev/console_init should be called from the udev rules already
2009-07-17 10:17:28 +02:00
Harald Hoyer
4f945a3932 dmraid.sh: activate all dmraids, if no rd_DM_UUID is specified 2009-07-17 10:16:46 +02:00
Harald Hoyer
20cfd14f41 dmraid.rules: cleanup 2009-07-17 10:16:16 +02:00
Harald Hoyer
376cfd1c27 lvm_scan: do not overwrite a preexisting /etc/lvm/lvm.conf 2009-07-17 10:13:33 +02:00
Harald Hoyer
c0dc4c5d1e dracut-lib: fixed quiet argument parsing 2009-07-17 10:13:01 +02:00
Harald Hoyer
532d7d9be4 dracut-lib: output warn() and die() to stderr 2009-07-17 10:12:52 +02:00
Warren Togami
beb097d9f1 Bridged network boot
* SYNTAX
bridge=<bridgename>:<ethname>
If bridge without parameters, assume bridge=br0:eth0
* When <ethname> would be configured by network scripts, instead create a bridge named <bridgename> then add <ethname> to that bridge.
* Then $netif becomes <bridgename> instead of <ethname> and all existing scripts process netroot mount via this new $netif instead of <ethname>.
* Include a few test cases in NFS and NBD
2009-07-16 16:58:19 -04:00
Warren Togami
44f1ab8285 Remove 63-luks.rules, it is no longer used 2009-07-16 09:34:07 -04:00
Warren Togami
81f83dab0a More informative failure messages or rdbreak. 2009-07-15 21:10:16 -04:00
Warren Togami
c3cd4c76d7 Standardize boot failed language. 2009-07-15 16:42:34 -04:00
Harald Hoyer
1702e6c660 dracut-lib: if "quiet" is specified, do not print info() to console 2009-07-15 18:40:56 +02:00
Harald Hoyer
e6df817525 install all /lib/kbd to initramfs, if not host only
KEYBOARDTYPE=sun|pc
   will be written to /etc/sysconfig/keyboard in the initramfs

KEYTABLE=<keytable file>
   will be written to /etc/sysconfig/keyboard in the initramfs

SYSFONT= Console font
   will be written to /etc/sysconfig/i18n in the initramfs

SYSFONTACM= Console map.
   will be written to /etc/sysconfig/i18n in the initramfs

UNIMAP= Unicode font map.
   will be written to /etc/sysconfig/i18n in the initramfs

LANG=<locale>
   will be written to /etc/sysconfig/i18n in the initramfs
   LANG= set locale for all categories, can be any two letter ISO
   language code
2009-07-15 18:37:44 +02:00
Harald Hoyer
f4da80735a Makefile: add debug module to the testimage target 2009-07-15 18:27:21 +02:00
Harald Hoyer
d34a6d07c1 extend TEST-12-RAID-DEG to check for UUID command line parameters 2009-07-15 18:27:21 +02:00
Harald Hoyer
f874872fc2 add command line parameters to specify exact actions for root assembly
LVM
       rd_NO_LVM
              disable LVM detection

       rd_LVM_VG=<volume group name>
              only activate the volume groups with the given name

crypto LUKS
       rd_NO_LUKS
              disable crypto LUKS detection

       rd_LUKS_UUID=<luks uuid>
              only activate the LUKS partitions with the given UUID

MD
       rd_NO_MD
              disable MD RAID detection

       rd_MD_UUID=<md uuid>
              only activate the raid sets with the given UUID

DMRAID
       rd_NO_DM
              disable DM RAID detection

       rd_DM_UUID=<dmraid uuid>
              only activate the raid sets with the given UUID
2009-07-15 18:27:21 +02:00
Hans de Goede
2240d47fe5 Fix lvm on top of dmraid
The lvm rules were failing to identify PV's on mdraid because
blkid/vol_id has not been run on md raidsets by previous rules.
2009-07-15 18:27:21 +02:00
Harald Hoyer
449adc611f add info() and vinfo() to dracut-lib
- corrected the loglevel for warn()
- prepended with "dracut: " for kmesg to seperate from kernel messages

you can pipe to vinfo() for informational messages
2009-07-15 18:27:21 +02:00
Harald Hoyer
584e55654c remove partitions from raid devices before they are used for something
else
2009-07-15 18:27:20 +02:00
Harald Hoyer
1adaf3372c limit the devices for which lvm vgscan will scan
Build the filter list and create /etc/lvm/lvm.conf for all LVM_member
devices found by udev.
2009-07-15 18:27:20 +02:00
Harald Hoyer
52c3715fd4 change the way init arguments are stripped from the command line
$initrdargs now holds all command line options we want to strip from the
command line. Command line parsers can extend this space separated list.
2009-07-15 18:27:20 +02:00
Harald Hoyer
dd1f72b3dd dmraid.rules changed comment in header 2009-07-15 18:27:20 +02:00
Hans de Goede
3564cb7c2c Make Intel BIOS raid use mdraid instead of dmraid when mdadm 3.0 is available
Intel BIOS raid is being shifted from dmraid to mdraid because mdraid offers
more features. So if an imsm metadata capable mdadm is present use mdraid
instead of dmraid for isw_raid_member's

This patch also adds code to mdraid_start.sh so that the raidsets
inside the imsm containers get started once udev is done probing
(doing this earlier leads to potentially degraded use of the sets and
 an unwanted resync).
2009-07-15 18:27:20 +02:00
Hans de Goede
3d2a316013 10redhat-i18n: Fix handling of kbd maps which are a symlink
Some keyboard maps are symlinks to others, we were not handling this
properly, this patch fixes this.
2009-07-15 18:27:20 +02:00
Harald Hoyer
da1c03c8a0 dracut-lib add getargs()
getargs returns a space seperated list with all values found for a key
on the kernel command line
2009-07-15 18:27:20 +02:00
Daniel Drake
f47478b336 switch_root: add subroot support
The current switch_root can only switch to a new root that is the root
of a mount point.

This patch adds support for "subroots", where the new root is somewhere
below a mount point. It does this by adding in a few extra steps to
chroot into the subroot after the enclosing partition has been moved
and entered.

This will be used by OLPC, who sort-of have 2 copies of Fedora stored
on a single partition under different directory trees, where the
initramfs decides which one to boot into.
2009-07-14 13:53:44 +02:00
Harald Hoyer
6281504d33 add testsuite for degraded RAID-5 array 2009-07-14 13:44:38 +02:00
Harald Hoyer
4a4c88236b modified test description for TEST-10-RAID 2009-07-14 13:44:07 +02:00
Harald Hoyer
3e26772cde run /bin/sh with the full path from the udev rules 2009-07-14 13:20:34 +02:00
Harald Hoyer
b2543662a1 add the final mdraid_start to the "blkid" rules also 2009-07-14 13:17:07 +02:00
Harald Hoyer
3076b67917 run a final "mdadm -IRs" after udev has settled 2009-07-13 18:19:32 +02:00
Harald Hoyer
21e033f8ef prevent LVM scan loops
lvm vgscan causes "change" events for all devices, to prevent a loop,
remember the devices, which trigger the scan of the devices.
2009-07-13 18:19:09 +02:00
Harald Hoyer
4fafddf78f add test for simple root on LVM 2009-07-13 16:41:05 +02:00
Harald Hoyer
c81a97d1a7 install "ln" per default 2009-07-13 16:24:41 +02:00
Harald Hoyer
9a139a430a let softlink to dmraid initqueue scan end with ".sh" 2009-07-13 16:24:41 +02:00
Harald Hoyer
e3b4125e83 delay lvm scan, until udev has settled 2009-07-13 16:24:41 +02:00
Harald Hoyer
aceddbe8a4 do not pass rdshell option to real init 2009-07-13 16:24:41 +02:00
Harald Hoyer
4286a25041 do not force to run the mdraid array for the incremental add 2009-07-13 16:24:41 +02:00
Harald Hoyer
00c5ab3e33 only install mount script, if nbd-client succeeded 2009-07-13 16:24:35 +02:00
Harald Hoyer
c094baa0fb install mount script if iscsistart succeeded and add iscsi udev rule 2009-07-13 15:03:11 +02:00
Harald Hoyer
1c709728ec removed warning "No ip= argument(s) for netroot provided..." 2009-07-13 15:03:11 +02:00
Harald Hoyer
2a652c0b95 add environment variables for different udev versions 2009-07-13 15:03:11 +02:00
Harald Hoyer
89056045f5 check for root after udevadm settle returns 2009-07-13 15:03:11 +02:00
Harald Hoyer
6aca2e0366 add kernel-modules module to iscsi server 2009-07-13 15:03:11 +02:00
Harald Hoyer
07253f00ca add documentation of the init hooks 2009-07-13 15:03:11 +02:00
Harald Hoyer
04f816de49 fixed LVM udev rules to run not only for dm-* devices 2009-07-13 15:03:10 +02:00
Harald Hoyer
14940c2a5c fixed typo in mdadm udev rule 2009-07-13 15:03:10 +02:00
Harald Hoyer
4d06c74ea6 only install one dmraid scan job once in the initqueue 2009-07-13 12:10:47 +02:00
Harald Hoyer
d72eec354a test for empty udev queue with timeout=1 instead of 0
older udev versions do not support timeout=0
2009-07-13 12:10:47 +02:00
Harald Hoyer
e60123c2ed removed bash check from md incremental rules 2009-07-13 12:10:46 +02:00
Warren Togami
19c258b689 NFSv4 rpcbind should need only the rpcbind user, not the entire /etc/passwd.
TODO: /etc/passwd and /etc/group are not removed yet due to 90mdraid.
      dledford said he'll go in and clean this up since he has the hardware
      to actually test the mdmon stuff.
2009-07-09 14:33:33 -04:00
Warren Togami
dacba77805 rdbreak should imply rdshell. If sleeping forever say so, so the user doesn't wonder. 2009-07-08 13:51:43 -04:00
Harald Hoyer
616f1557b1 version 0.4 2009-07-04 10:05:38 +02:00
Harald Hoyer
a75c29be45 remove redirection of output to /dev/kmesg
until we have a way to mark our messages to come from dracut.
2009-07-04 09:57:10 +02:00
Harald Hoyer
a3a3448d8c rdshell 2009-07-03 18:28:09 +02:00
Harald Hoyer
58dbb43eac initqueue now loops until /dev/root exists or root is mounted
init now has the following points to inject scripts:

/cmdline/*.sh
   scripts for command line parsing

/pre-udev/*.sh
   scripts to run before udev is started

/pre-trigger/*.sh
   scripts to run before the main udev trigger is pulled

/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 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
   scripts to run before the root filesystem is mounted
   NFS is an exception, because it has no device node to be created
   and mounts in the udev events

/mount/*.sh
   scripts to mount the root filesystem
   NFS is an exception, because it has no device node to be created
   and mounts in the udev events
   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
   scripts to run before the real init is executed and the initramfs
   disappears
   All processes started before should be killed here.

The behaviour of the dmraid module demonstrates how to use the new
mechanism. If it detects a device which is part of a raidmember from a
udev rule, it installs a job to scan for dmraid devices, if the udev
queue is empty. After a scan, it removes itsself from the queue.
2009-07-03 18:11:38 +02:00
Harald Hoyer
5b2db7d177 put back the nfs mount in the udev event
it solves the following case:

root=/dev/nfs nfsroot=server:/path

- the server could be reachable on any interface
- any interface can get an IP by dhcp
- only one IP is allowed to mount the root
2009-07-03 14:56:20 +02:00
Harald Hoyer
aa254c5596 fail iscsiroot, if iscsistart fails 2009-07-03 14:47:49 +02:00
Harald Hoyer
da04062e72 add rm to be installed for initqueue 2009-07-03 13:27:26 +02:00
Harald Hoyer
3b51f4f30b add firmware packages to be required by the dracut-generic package 2009-07-03 13:17:08 +02:00
Harald Hoyer
5cc26464e0 remove 50plymouth-pre0.7 module 2009-07-03 12:44:45 +02:00
Harald Hoyer
9719024132 Defer mount to the real mount loop
Udev rules set a /dev/root symlink to the real root and add
a mount script to /mount/. This enables the proper use of pre-mount
scripts and prevents mount being killed by a udev timeout.
2009-07-03 12:38:43 +02:00
Harald Hoyer
83701d66f6 output everything to /dev/kmesg and add dmesg for the emergency_shell 2009-07-03 12:34:51 +02:00
Harald Hoyer
f601799e94 add binutiles requirement to specfile (because of nm) 2009-07-03 12:06:16 +02:00
Harald Hoyer
e2dbd86f09 add kernel-modules module to testsuite images 2009-07-03 12:06:11 +02:00
Daniel Drake
1b9cae5cb2 Remove modules dependency
This makes it possible to build a dracut initramfs without modules,
where all needed kernel drivers are built into the kernel image.
2009-07-02 17:18:09 +02:00
Daniel Drake
259e58a904 Add firmware loading support 2009-07-02 17:13:07 +02:00
Seewer Philippe
a55711cd86 Don't use absolute paths for utilities 2009-07-02 17:13:06 +02:00
Harald Hoyer
a8e47195dd do not add debug module by default 2009-07-02 14:50:46 +02:00
Harald Hoyer
624b52c440 fixed adding modules via -a 2009-07-02 14:50:22 +02:00
Harald Hoyer
4f4454b61f add "--add" option to the manpage 2009-07-02 13:14:57 +02:00
558 changed files with 37431 additions and 3515 deletions

2
.dir-locals.el Normal file
View File

@@ -0,0 +1,2 @@
(setq sh-basic-offset: 4)
(setq indent-tabs-mode nil)

20
.gitignore vendored
View File

@@ -1,3 +1,19 @@
/Makefile.inc
/dracut.8
/dracut-catimages.8
/dracut.conf.5
/dracut.conf.d/*.conf
/dracut-gencmdline.8
/dracut.html
/dracut.kernel.7
/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/98systemd/*.service.8
/*.sign

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": "Kate"
, "files": [ { "git": 1 } ]
, "build": {
"directory": "build"
, "build": "make -j $(getconf _NPROCESSORS_ONLN) all"
, "clean": "make clean"
}
}

15
.mailmap Normal file
View File

@@ -0,0 +1,15 @@
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)>
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
Frederick Grose <fgrose@sugarlabs.org> <fgrose@gmail.com>
Frederic Crozat <fcrozat@suse.com> <fcrozat@mandriva.com>

33
50-dracut.install Executable file
View File

@@ -0,0 +1,33 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
if [[ -f /etc/kernel/cmdline ]]; then
readarray -t BOOT_OPTIONS < /etc/kernel/cmdline
fi
if ! [[ "${BOOT_OPTIONS[@]}" ]]; then
readarray -t 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
ret=0
case "$1" in
add)
dracut ${noimageifnotneeded:+--noimageifnotneeded} "$3"/initrd "$2"
ret=$?
;;
remove)
rm -f -- "$3"/initrd
ret=$?
;;
esac
exit $ret

70
51-dracut-rescue-postinst.sh Executable file
View File

@@ -0,0 +1,70 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
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

103
51-dracut-rescue.install Executable file
View File

@@ -0,0 +1,103 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
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 [[ ! -f /etc/machine-id ]] || [[ ! -s /etc/machine-id ]]; then
systemd-machine-id-setup
fi
[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
if [[ -f /etc/kernel/cmdline ]]; then
readarray -t BOOT_OPTIONS < /etc/kernel/cmdline
fi
if ! [[ "${BOOT_OPTIONS[@]}" ]]; then
readarray -t BOOT_OPTIONS < /proc/cmdline
fi
if ! [[ $BOOT_OPTIONS ]]; then
exit 1
fi
LOADER_ENTRY="/boot/loader/entries/${MACHINE_ID}-0-rescue.conf"
BOOT_DIR="/${MACHINE_ID}/0-rescue"
ret=0
case "$COMMAND" in
add)
for i in "/boot/loader/entries/${MACHINE_ID}-0-rescue.conf"; do
[[ -f $i ]] && exit 0
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
[[ -d "$BOOT_DIR_ABS" ]] || mkdir -p "$BOOT_DIR_ABS"
if ! cp "$KERNEL_IMAGE" "$BOOT_DIR_ABS"/linux; then
echo "Can't copy '$KERNEL_IMAGE to '$BOOT_DIR_ABS/linux'!" >&2
fi
dracut --no-hostonly -a "rescue" "$BOOT_DIR_ABS"/initrd "$2"
((ret+=$?))
{
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
((ret+=$?))
;;
remove)
exit 0
;;
*)
usage
ret=1;;
esac
((ret+=$?))
exit $ret

110
AUTHORS
View File

@@ -1,11 +1,105 @@
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>
Will Woods <wwoods@redhat.com>
Philippe Seewer <philippe.seewer@bfh.ch>
Warren Togami <wtogami@redhat.com>
Jeremy Katz <katzj@redhat.com>
Dave Young <dyoung@redhat.com>
David Dillow <dave@thedillows.org>
Michal Soltys <soltys@ziu.info>
Amerigo Wang <amwang@redhat.com>
Colin Guthrie <colin@mageia.org>
Andrey Borzenkov <arvidjaar@gmail.com>
Peter Jones <pjones@redhat.com>
Andreas Thienemann <andreas@bawue.net>
Hans de Goede <hdegoede@redhat.com>
John Reiser <jreiser@bitwagon.com>
Luca Berra <bluca@vodka.it>
WANG Chao <chaowang@redhat.com>
Daniel Drake <dsd@laptop.org>
Dan Horák <dhorak@redhat.com>
Baoquan He <bhe@redhat.com>
Leho Kraav <leho@kraav.com>
Brian C. Lane <bcl@redhat.com>
Kamil Rytarowski <n54@gmx.com>
Marc Grimme <grimme@atix.de>
Chao Wang <chaowang@redhat.com>
Frederic Crozat <fcrozat@suse.com>
Jesse Keating <jkeating@redhat.com>
Milan Broz <mbroz@redhat.com>
Radek Vykydal <rvykydal@redhat.com>
Roberto Sassu <roberto.sassu@polito.it>
Anton Blanchard <anton@samba.org>
Bill Nottingham <notting@redhat.com>
Colin Walters <walters@verbum.org>
David Cantrell <dcantrell@redhat.com>
Dennis Gilmore <dennis@ausil.us>
Jon Ander Hernandez <jonan.h@gmail.com>
Juan RP <xtraeme@gmail.com>
Lance Albertson <lance@osuosl.org>
Marian Ganisin <mganisin@redhat.com>
Michael Ploujnikov <plouj@somanetworks.com>
Peter Rajnoha <prajnoha@redhat.com>
Wim Muskee <wimmuskee@gmail.com>
Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Alan Pevec <apevec@redhat.com>
Frederick Grose <fgrose@sugarlabs.org>
Ian Dall <ian@beware.dropbear.id.au>
James Buren <ryuo@frugalware.org>
James Lee <jlee@thestaticvoid.com>
Joey Boggs <jboggs@redhat.com>
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Mike Snitzer <snitzer@redhat.com>
Przemysław Rudy <prudy1@o2.pl>
Stefan Reimer <it@startux.de>
Thomas Lange <lange@informatik.uni-koeln.de>
Vivek Goyal <vgoyal@redhat.com>
Vladislav Bogdanov <bubble@hoster-ok.com>
Adam Williamson <awilliam@redhat.com>
Alexander Todorov <atodorov@redhat.com>
Andy Lutomirski <luto@mit.edu>
Anssi Hannula <anssi@mageia.org>
Brandon Philips <brandon@ifup.co>
Canek Peláez Valdés <caneko@gmail.com>
Chris Leech <cleech@redhat.com>
Christian Heinz <christian.ch.heinz@gmail.com>
Cong Wang <amwang@redhat.com>
Daniel Schaal <farbing@web.de>
Dave Jones <davej@redhat.com>
Dave Young <dave@redhat.com>
Dennis Schridde <devurandom@gmx.net>
Duane Griffin <duaneg@dghda.com>
Glen Gray <slaine@slaine.org>
Hermann Gausterer <git-dracut-2012@mrq1.org>
James Laska <jlaska@redhat.com>
Jan Stodola <jstodola@redhat.com>
Jiri Pirko <jiri@resnulli.us>
Joe Lawrence <Joe.Lawrence@stratus.com>
Kevin Yung <Kevin.Yung@myob.com>
Kyle McMartin <kyle@redhat.com>
Lars R. Damerow <lars@pixar.com>
Lennert Buytenhek <buytenh@wantstofly.org>
Lubomir Rintel <lkundrak@v3.sk>
Matt <smoothsailing72@hotmail.com>
Matt Smith <shadowfax@gmx.com>
Michal Schmidt <mschmidt@redhat.com>
Mike Gorse <mgorse@suse.com>
Munehiro Matsuda <haro@kgt.co.jp>
Nicolas Chauvet <kwizart@gmail.com>
Nikoli <nikoli@lavabit.com>
Olivier Blin <dev@blino.org>
Paolo Bonzini <pbonzini@redhat.com>
Peter Robinson <pbrobinson@fedoraproject.org>
Pádraig Brady <P@draigBrady.com>
Quentin Armitage <quentin@armitage.org.uk>
Robert Buchholz <rbu@goodpoint.de>
Sergey Fionov <fionov@gmail.com>
Srinivasa T N <seenutn@linux.vnet.ibm.com>
Thilo Bangert <thilo.bangert@gmx.net>
Thomas Backlund <tmb@mageia.org>
Tomasz Torcz <tomek@pipebreaker.pl>
Vadim Kuznetsov <vadimk@gentoo.org>
Ville Skyttä <ville.skytta@iki.fi>
Yanko Kaneti <yaneti@declera.com>
maximilian attems <max@stro.at>

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:

276
Makefile
View File

@@ -1,65 +1,253 @@
VERSION=0.3
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 2>/dev/null || echo $(DRACUT_VERSION))
GITVERSION = $(shell [ -d .git ] && { v=$$(git describe --tags 2>/dev/null); [ $${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
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 \
modules.d/98systemd/dracut-cmdline.service.8 \
modules.d/98systemd/dracut-initqueue.service.8 \
modules.d/98systemd/dracut-mount.service.8 \
modules.d/98systemd/dracut-shutdown.service.8 \
modules.d/98systemd/dracut-pre-mount.service.8 \
modules.d/98systemd/dracut-pre-pivot.service.8 \
modules.d/98systemd/dracut-pre-trigger.service.8 \
modules.d/98systemd/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/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/dracut-install: $(DRACUT_INSTALL_OBJECTS)
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
xsltproc -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
%.xml: %.asc
asciidoc -d manpage -b docbook -o $@ $<
dracut.8: dracut.usage.asc dracut.8.asc
dracut.html: dracut.asc $(manpages) dracut.css dracut.usage.asc
asciidoc -a numbered -d book -b docbook -o dracut.xml dracut.asc
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 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/98systemd/dracut-shutdown.service $(DESTDIR)$(systemdsystemunitdir)/dracut-shutdown.service; \
mkdir -p $(DESTDIR)$(systemdsystemunitdir)/shutdown.target.wants; \
ln -s ../dracut-shutdown.service \
$(DESTDIR)$(systemdsystemunitdir)/shutdown.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/98systemd/$$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:
@echo "DRACUT_VERSION=$(VERSION)$(GITVERSION)" > dracut-version.sh
clean:
rm -f *~
rm -f modules.d/99base/switch_root
rm -f test-*.img
make -C test clean
archive: dracut-$(VERSION)-$(GITVERSION).tar.bz2
$(RM) *~
$(RM) */*~
$(RM) */*/*~
$(RM) $(manpages:%=%.xml) dracut.xml
$(RM) test-*.img
$(RM) dracut-*.rpm dracut-*.tar.bz2
$(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
dist: dracut-$(VERSION).tar.bz2
dracut-$(VERSION).tar.bz2:
git archive --format=tar $(VERSION) --prefix=dracut-$(VERSION)/ |bzip2 > dracut-$(VERSION).tar.bz2
dracut-$(VERSION).tar.bz2: 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.bz2 dracut-$(VERSION)
bzip2 -9 dracut-$(VERSION).tar
rm -f -- dracut-$(VERSION).tar
dracut-$(VERSION)-$(GITVERSION).tar.bz2:
git archive --format=tar HEAD --prefix=dracut-$(VERSION)-$(GITVERSION)/ |bzip2 > dracut-$(VERSION)-$(GITVERSION).tar.bz2
rpm: dracut-$(VERSION).tar.bz2 syncheck
rpmbuild=$$(mktemp -d -t rpmbuild-dracut.XXXXXX); src=$$(pwd); \
cp dracut-$(VERSION).tar.bz2 "$$rpmbuild"; \
LC_MESSAGES=C $$src/git2spec.pl $(VERSION) "$$rpmbuild" < dracut.spec > $$rpmbuild/dracut.spec; \
(cd "$$rpmbuild"; rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" \
--define "_specdir $$PWD" --define "_srcrpmdir $$PWD" \
--define "_rpmdir $$PWD" -ba dracut.spec; ) && \
( mv "$$rpmbuild"/$$(arch)/*.rpm $(DESTDIR).; mv "$$rpmbuild"/*.src.rpm $(DESTDIR).;rm -fr -- "$$rpmbuild"; ls $(DESTDIR)*.rpm )
srpm: dracut-$(VERSION).tar.bz2 syncheck
rpmbuild=$$(mktemp -d -t rpmbuild-dracut.XXXXXX); src=$$(pwd); \
cp dracut-$(VERSION).tar.bz2 "$$rpmbuild"; \
LC_MESSAGES=C $$src/git2spec.pl $(VERSION) "$$rpmbuild" < dracut.spec > $$rpmbuild/dracut.spec; \
(cd "$$rpmbuild"; \
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: 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 \
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 -f test-$(shell uname -r).img $(shell uname -r)
@echo wrote test-$(shell uname -r).img
./dracut.sh -l -a debug -f test-$(shell uname -r).img $(shell uname -r)
@echo wrote test-$(shell uname -r).img
testimages: all
./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
hostimage: all
./dracut.sh -H -l -f test-$(shell uname -r).img $(shell uname -r)
@echo wrote test-$(shell uname -r).img
AUTHORS:
git shortlog --numbered --summary -e |while read a rest; do echo $$rest;done > AUTHORS
dracut.html.sign: dracut-$(VERSION).tar.bz2
gpg-sign-all dracut-$(VERSION).tar.bz2 dracut.html
upload: dracut.html.sign
kup put dracut-$(VERSION).tar.bz2 dracut-$(VERSION).tar.sign /pub/linux/utils/boot/dracut/
kup put dracut.html dracut.html.sign /pub/linux/utils/boot/dracut/

841
NEWS Normal file
View File

@@ -0,0 +1,841 @@
dracut-033
==========
- improved hostonly device recognition
- improved hostonly module recognition
- add dracut.css for dracut.html
- do not install udev rules from /etc in generic mode
- fixed LABEL= parsing for swap devices
- fixed iBFT network setup
- url-lib.sh: handle 0-size files with curl
- dracut.asc: document debugging dracut on shutdown
- if rd.md=0, use dmraid for imsm and ddf
- skip empty dracut modules
- removed caching of kernel cmdline
- fixed iso-scan, if the loop device driver is a kernel module
- bcache: support new blkid
- fixed ifup udev rules
- ifup with dhcp, if no "ip=" specified for the interface
dracut-032
==========
- 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
- dracut.sh: add --persistent-policy option and persistent_policy conf 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"
- dracut now creates the initramfs without udevadm
that means the udev database does not have to populated
and the initramfs can be built in a chroot with
/sys /dev /proc mounted
- renamed dracut_install() to inst_multiple() for consistent naming
- if $libdirs is unset, fall back to ld.so.cache paths
- always assemble /usr device in initramfs
- bash module added (disable it, if you really want dash)
- continue to boot, if the main loop times out, in systemd mode
- removed inst*() shell pure versions, dracut-install binary is in charge now
- fixed ifcfg file generation for vlan
- do not include adjtime and localtime anymore
- fixed generation of zfcp.conf of CMS setups
- install vt102 terminfo
dracut_install() is still there for backwards compat
- do not strip files in FIPS mode
- fixed iBFT interface configuration
- fs-lib: install fsck and fsck.ext*
- shutdown: fixed killall_proc_mountpoint()
- network: also wait for ethernet interfaces to setup
- fixed checking for FIPS mode
Contributions from:
Harald Hoyer
WANG Chao
Baoquan He
Daniel Schaal
Dave Young
James Lee
Radek Vykydal
dracut-031
==========
- do not include the resume dracut module in hostonly mode,
if no swap is present
- don't warn twice about omitted modules
- use systemd-cat for logging on systemd systems, if logfile is unset
- fixed PARTUUID parsing
- support kernel module signing keys
- do not install the usrmount dracut module in hostonly mode,
if /sbin/init does not live in /usr
- add debian udev rule files
- add support for bcache
- network: handle bootif style interfaces
e.g. ip=77-77-6f-6f-64-73:dhcp
- add support for kmod static devnodes
- add vlan support for iBFT
Contributions from:
Harald Hoyer
Amadeusz Żołnowski
Brandon Philips
Colin Walters
James Lee
Kyle McMartin
Peter Jones
dracut-030
==========
- support new persistent network interface names
- fix findmnt calls, prevents hang on stale NFS mounts
- add systemd.slice and slice.target units
- major shell cleanup
- support root=PARTLABEL= and root=PARTUUID=
- terminfo: only install l/linux v/vt100 and v/vt220
- unset all LC_* and LANG, 10% faster
- fixed dependency loop for dracut-cmdline.service
- do not wait_for_dev for the root devices
- do not wait_for_dev for devices, if dracut-initqueue is not needed
- support early microcode loading with --early-microcode
- dmraid, let dmraid setup its own partitions
- sosreport renamed to rdsosreport
Contributions from:
Harald Hoyer
Konrad Rzeszutek Wilk
WANG Chao
dracut-029
==========
- wait for IPv6 autoconfiguration
- 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.
- proper handle "rd.break" in systemd mode before switch-root
- systemd: make unit files symlinks
- build without dash requirement
- add dracut-shutdown.service.8 manpage
- handle MACs for "ip="
"ip=77-77-6f-6f-64-73:dhcp"
- don't explode when mixing BOOTIF and ip=
- 90lvm/module-setup.sh: redirect error message of lvs to /dev/null
Contributions from:
Harald Hoyer
Will Woods
Baoquan He
dracut-028
==========
- full integration of crypto devs in systemd logic
- support for bridge over team and vlan tagged team
- support multiple bonding interfaces
- new kernel command line param "rd.action_on_fail"
to control the emergency action
- support for bridge over a vlan tagged interface
- support for "iso-scan/filename" kernel parameter
- lsinitrd got some love and does not use "file" anymore
- fixed issue with noexec mounted tmp dirs
- FIPS mode fixed
- dracut_install got some love
- fixed some /usr mounting problems
- ifcfg dracut module got some love and fixes
- default installed font is now latarcyrheb-sun16
- new parameters rd.live.dir and rd.live.squashimg
- lvm: add tools for thin provisioning
- also install non-hwcap libs
- setup correct system time and time zone in initrd
- s390: fixed cms setup
- add systemd-udevd persistent network interface naming
Contributions from:
Harald Hoyer
Kamil Rytarowski
WANG Chao
Baoquan He
Adam Williamson
Colin Guthrie
Dan Horák
Dave Young
Dennis Gilmore
Dennis Schridde
dracut-027
==========
- dracut now has bash-completion
- require bash version 4
- systemd module now requires systemd >= 199
- dracut makes use of native systemd initrd units
- added hooks for new-kernel-pkg and kernel-install
- hostonly is now default for fedora
- comply with the BootLoaderSpec paths
http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec
- added rescue module
- host_fs_types is now a hashmap
- new dracut argument "--regenerate-all"
- new dracut argument "--noimageifnotneeded"
- new man page dracut.bootup
- install all host filesystem drivers
- use -D_FILE_OFFSET_BITS=64 to build dracut-install
dracut-026
==========
- 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 for drop-in configuration files.
/etc/dracut.conf and /etc/dracut.conf.d belong to the system administrator.
- uses systemd-198 native initrd units
- totally rely on the fstab-generator in systemd mode for block devices
- dracut systemd now uses dracut.target rather than basic.target
- dracut systemd services optimize themselves away
- fixed hostonly parameter generation
- turn off curl globbing (fixes IPv6)
- modify the udev rules on install and not runtime time
- enable initramfs building without kernel modules (fixed regression)
- in the initqueue/timeout,
reset the main loop counter, as we see new udev events or initqueue/work
- fixed udev rule installation
dracut-025
==========
- do not strip signed kernel modules
- add sosreport script and generate /run/initramfs/sosreport.txt
- make short uuid specification for allow-discards work
- turn off RateLimit for the systemd journal
- fixed MAC address assignment
- add systemd checkisomd5 service
- splitout drm kernel modules from plymouth module
- add 'swapoff' to initramfs to fix shutdown/reboot
- add team device support
- add pre-shutdown hook
- kill all processes in shutdown and report remaining ones
- "--device" changed to "--add-device" and "add_device=" added for conf files
- add memory usage trace to different hook points
- cope with optional field #7 in /proc/self/mountinfo
- lots of small bugfixes
dracut-024
==========
- new dracut option "--device"
- new dracut kernel command line options "rd.auto"
- new dracut kernel command line options "rd.noverifyssl"
- new dracut option "--kernel-cmdline" and "kernel_cmdline" option for default parameters
- fixes for systemd and crypto
- fix for kexec in shutdown, if not included in initramfs
- create the initramfs non-world readable
- prelink/preunlink in the initramfs
- strip binaries in the initramfs by default now
- various FIPS fixes
- various dracut-install fixes
dracut-023
==========
- resume from hibernate fixes
- -N option for --no-hostonly
- support for systemd crypto handling
- new dracut module "crypt-loop"
- deprecate the old kernel command line options
- more documentation
- honor CFLAGS for dracut-install build
- multipath fixes
- / is mounted according to rootflags parameter but forced ro at first.
Later it is remounted according to /etc/fstab + rootflags parameter
and "ro"/"rw".
- support for xfs / reiserfs separate journal device
- new "ro_mnt" option to force ro mount of / and /usr
- root on cifs support
- dracut-install: fixed issue for /var/tmp containing a symlink
- only lazy resolve with ldd, if the /var/tmp partition is not mounted with "noexec"
- i18n: fixed inclusion of "include" keymaps
dracut-022
==========
- fixed host-only kernel module bug
dracut-021
==========
- fixed systemd in the initramfs (requires systemd >= 187)
- dracut-install: massive speedup with /var on the same filesystem with COW copy
- dracut-install: moved to /usr/lib/dracut until it becomes a general purpose tool
- new options: "rd.usrmount.ro" and "rd.skipfsck"
- less mount/umount
- apply "ro" on the kernel command line also to /usr
- mount according to fstab, if neither "ro" or "rw" is specified
- skip fsck for xfs and btrfs. remount is enough
- give emergency_shell if /usr mount failed
- dracut now uses getopt:
* options can be position independent now!!
* we can now use --option=<arg>
- added option "--kver=<kernel-version>", and the image location can be omitted
# dracut --kver 3.5.0-0.rc7.git1.2.fc18.x86_64
- dracut.sh: for --include copy also the symbolic links
- man pages: lsinitrd and mkinitrd added
- network: 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. !!!!!
- resume: moved the resume process to the initqueue.
This should prevent accidently mounting the root file system.
- testsuite: 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.
dracut-020
==========
- changed rd.dasd kernel parameter
- arm kernel modules added to kernel-modules
- 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
- kernel modules are now only handled with /sys/modules and modules.dep
- systemd fixups
- mdraid: wait for md devices to be clean, before shutdown
- ifup fixed for ipv6
- add PARTUUID as root=PARTUUID=<partition uuid> parameter
- fixed instmods() return code and set pipefail globally
- add 04watchdog dracut module
- dracut-shutdown.service: fixed ordering to be before shutdown.target
- make use of "ln -r" instead of shell functions, if new coreutils is installed
- network: support vlan tagged bonding
- new dracut module qemu and qemu-net to install all kernel driver
- fs-lib/fs-lib.sh: removed test mounting of btrfs and xfs
- no more "mknod" in the initramfs!!
- replaced all "tr" calls with "sed"
- speedup with lazy kernel module dependency resolving
- lots of speedup optimizations and last but not least
- dracut-install:
- new binary to significanlty speedup the installation process
- dracut-functions.sh makes use of it, if installed
dracut-019
==========
- initqueue/online hook
- fixes for ifcfg write out
- rootfs-block: avoid remount when options don't change
- Debian multiarch support
- virtfs root filesystem support
- cope with systemd-udevd
- mount tmpfs with strictatime
- include all kernel/drivers/net/phy drivers
- add debug_on() and debug_off() functions
- add arguments for source_hook() and source_all()
- cleanup hook
- plymouth: get consoledev from /sys/class/tty/console/active
- experimental systemd dracut module for systemd in the initramfs
- install xhci-hcd kernel module
- dracut: new "--mount" option
- lsinitrd: new option --printsize
- ARM storage kernel modules added
- s390 cms conf file support
- /etc/initrd-release in the initrd
- vlan support
- full bonding and bridge support
- removed scsi_wait_scan kernel module from standard install
- support rd.luks.allow-discards and honor options in crypttab
- lots of bugfixes
dracut-018
==========
- lvm: ignore lvm mirrors
- lsinitrd: handle LZMA images
- iscsi: add rd.iscsi.param
- iscsi: add iscsi interface binding
- new module cms to read and handle z-Series cms config files
- fixed fstab.sys handling
- new dracut option "--tmpdir"
- new dracut option "--no-hostonly"
- nbd: name based nbd connects
- converted manpage and documentation source to asciidoc
- write-ifcfg fixes and cleanups
- ifup is now done in the initqueue
- netroot cleanup
- initqueue/online is now for hooks, which require network
- no more /tmp/root.info
- 98pollcdrom: factored out the ugly cdrom polling in the main loop
- simplified rd.luks.uuid testing
- removed "egrep" and "ls" calls
- speedup kernel module installation
- make bzip2 optional
- lots of bugfixes
dracut-017
==========
- a _lot_ faster than dracut-016 in image creation
- systemd service dracut-shutdown.service
- livenet fixes
- ssh-client module install fix
- root=iscsi:... fixed
- lots of restructuring and optimizing in dracut-functions.sh
- usrmount: honor fs_passno in /etc/fstab
- renamed all shell scripts to .sh
- new option "--omit-drivers" and config option "omit_drivers"
- hostonly mode fixups
dracut-016
==========
- fixed lsinitrd
- honor binaries in sbin first
- fixed usrmount module
- added systemd service for shutdown
- fixed terminfo on distros with /usr/share/terminfo
- reload udev rules after "pre-trigger" hook
- improved test suite
- new parameter "--omit-drivers" and new conf param omit_drivers
- "--offroot" support for mdraid
- new libs: net-lib.sh, nfs-lib.sh, url-lib.sh, img-lib.sh
full of functions to use in your dracut module
dracut-015
==========
- hostonly mode automatically adds command line options for root and /usr
- --add-fstab --mount parameters
- ssh-client module
- --ctty option: add job control
- cleanup /run/initramfs
- convertfs module
- /sbin/ifup can be called directly
- support kernel modules compressed with xz
- s390 iscsi modules added
- terminfo module
- lsinitrd can handle concatened images
- lsinitrd can sort by size
dracut-014
==========
- new dracut arguments:
--lvmconf
--nolvmconf
--fscks [LIST]
--nofscks
- new .conf options:
install_items
fscks
nofscks
- new kernel options:
rd.md.ddf
rd.md.waitclean
plymouth.enable
- dracut move from /sbin to /usr/bin
- dracut modules dir moved from /usr/share/dracut to /usr/lib/dracut
- profiling with "dracut --profile"
- new TEST-16-DMSQUASH, test for Fedora LiveCDs
- speedup of initramfs creation
- ask_for_password fallback to CLI
- mdraid completely switched to incremental assembly
- no more cdrom polling
- "switch_root" breakpoint is now very late
- /dev/live is gone
- /dev/root is gone
- fs-lib dracut module for fscks added
- xen dracut module removed
- usb mass storage kernel drivers now included
- usrmount dracut module added:
mount /usr if found in /sysroot/etc/fstab
- only include fsck helper needed for hostonly
- fcoe: support for bnx2fc
- support iSCSI drivers: qla4xxx, cxgb3i, cxgb4i, bnx2i, be2iscsi
- fips-aesni dracut module added
- add install_items to dracut.conf
install_items+=" <file>[ <file> ...] "
- speedup internal testsuite
- internal testsuite: store temporary data in a temporary dir
dracut-013
==========
- speedup of initramfs creation
- fixed inst_dir for symbolic links
- add unix kernel module
dracut-012
==========
- better fsck handling
- fixed wait condition for LVM volumes
- fix for hardlinks (welcome Debian! :-)
- shutdown bugfixes
- automatic busybox symlink creation
- try to mount /usr, if init points to a path in /usr
- btrfs with multiple devices
- "--force-add" option for dracut, to force-add dracut modules,
without hostonly checks
- lsinitrd also display the initramfs size in human readable form
- livenet module, to mount live-isos over http
- masterkey,ecryptfs,integrity security modules
- initqueue/timeout queue e.g. for starting degraded raids
- "make rpm" creates an rpm with an increasing release number from any
git checkout
- support lvm mirrors
- start degraded lvm mirrors after a timeout
- start degraded md raids after a timeout
- getarg() now returns wildcards without file matching to the current fs
- lots of bugfixes
dracut-011
==========
- use udev-168 features for shutting down udev
- introduce "--prefix" to put all initramfs files in e.g "/run/initramfs"
- new shutdown script (called by systemd >= 030) to disassemble the root device
- lots of bugfixes
- new module for gpg-encrypted keys - 91crypt-gpg
dracut-010
==========
- lots of bugfixes
- plymouth: use /run/plymouth/pid instead of /run/initramfs/plymouth
- add "/lib/firmware/updates" to default firmware path
dracut-009
==========
- dracut generator
- dracut-logger
- xz compression
- better argument handling
- initramfs
- hooks moved to /lib/dracut/hooks in initramfs
- rd.driver.{blacklist|pre|post} accept comma separated driver list
- iSCSI: iSCSI Boot Firmware Table (iBFT) support
- support for /run
- live image: support for generic rootfs.img (instead of ext3fs.img)
- caps module
- FCoE: EDD support
dracut-008
==========
- removed --ignore-kernel-modules option (no longer necessary)
- renamed kernel command line arguments to follow the rd. naming scheme
- merged check, install, installkernel to module-setup.sh
- support for bzip2 and xz compressed initramfs images.
- source code beautification
- lots of documentation
- lsinitrd: "catinitrd" functionality
- dracut: --list-modules
- lvm: support for dynamic LVM SNAPSHOT root volume
- 95fstab-sys: mount all /etc/fstab.sys volumes before switch_root
- 96insmodpost dracut module
- rd.shell=1 per default
- rootfs-block:mount-root.sh add fsck
- busybox shell replacements module
- honor old "real_init="
- 97biosdevname dracut module
dracut-007
==========
- module i18n is no longer fedora/red hat specific (Amadeusz Żołnowski)
- distribution specific conf file
- bootchartd support
- debug module now has fsck
- use "hardlink", if available, to save some space
- /etc/dracut.conf can be overwritten by settings in /etc/dracut.conf.d/*.conf
- gentoo splash module
- --ignore-kernel-modules option
- crypto keys on external devices support
- bugfixes
dracut-006
==========
- fixed mdraid with IMSM
- fixed dracut manpages
- dmraid parse different error messages
- add cdrom polling mechanism for slow cdroms
- add module btrfs
- add btrfsctl scan for btrfs multi-devices (raid)
- teach dmsquash live-root to use rootflags
- trigger udev with action=add
- fixed add_drivers handling
- add sr_mod
- use pigz instead of gzip, if available
- boot from LVM mirrors and snapshots
- iscsi: add support for multiple netroot=iscsi:
- Support old version of module-init-tools
- got rid of rdnetdebug
- fixed "ip=auto6"
- dracut.conf: use "+=" as default for config variables
- bugfixes
dracut-005
==========
- dcb support to dracut's FCoE support
- add readonly overlay support for dmsquash
- add keyboard kernel modules
- dracut.conf: added add_dracutmodules
- add /etc/dracut.conf.d
- add preliminary IPv6 support
- bugfixes
dracut-004
==========
- dracut-lib: read multiple lines from $init/etc/cmdline
- lsinitrd and mkinitrd
- dmsquash: add support for loopmounted *.iso files
- lvm: add rd_LVM_LV and "--poll n"
- user suspend support
- add additional drivers in host-only mode, too
- improved emergency shell
- support for compressed kernel modules
- support for loading Xen modules
- rdloaddriver kernel command line parameter
- man pages for dracut-catimages and dracut-gencmdline
- bugfixes
dracut-003
==========
- add debian package modules
- add dracut.conf manpage
- add module 90multipath
- add module 01fips
- crypt: ignore devices in /etc/crypttab (root is not in there)
unless rd_NO_CRYPTTAB is specified
- kernel-modules: add scsi_dh scsi_dh_rdac scsi_dh_emc
- add multinic support
- add s390 zfcp support
- add s390 dasd support
- add s390 network support
- fixed dracut-gencmdline for root=UUID or LABEL
- do not destroy assembled raid arrays if mdadm.conf present
- mount /dev/shm
- let udevd not resolve group and user names
- moved network from udev to initqueue
- improved debug output: specifying "rdinitdebug" now logs
to dmesg, console and /init.log
- strip kernel modules which have no x bit set
- redirect stdin, stdout, stderr all RW to /dev/console
so the user can use "less" to view /init.log and dmesg
- add new device mapper udev rules and dmeventd
- fixed dracut-gencmdline for root=UUID or LABEL
- do not destroy assembled raid arrays if mdadm.conf present
- mount /dev/shm
- let udevd not resolve group and user names
- preserve timestamps of tools on initramfs generation
- generate symlinks for binaries correctly
- moved network from udev to initqueue
- mount nfs3 with nfsvers=3 option and retry with nfsvers=2
- fixed nbd initqueue-finished
- improved debug output: specifying "rdinitdebug" now logs
to dmesg, console and /init.log
- strip kernel modules which have no x bit set
- redirect stdin, stdout, stderr all RW to /dev/console
so the user can use "less" to view /init.log and dmesg
- make install of new dm/lvm udev rules optionally
- add new device mapper udev rules and dmeventd
- Fix LiveCD boot regression
- bail out if selinux policy could not be loaded and
selinux=0 not specified on kernel command line
- do not cleanup dmraids
- copy over lvm.conf
dracut-002
==========
- add ifname= argument for persistent netdev names
- new /initqueue-finished to check if the main loop can be left
- copy mdadm.conf if --mdadmconf set or mdadmconf in dracut.conf
- plymouth: use plymouth-populate-initrd
- add add_drivers for dracut and dracut.conf
- add modprobe scsi_wait_scan to be sure everything was scanned
- fix for several problems with md raid containers
- fix for selinux policy loading
- fix for mdraid for IMSM
- fix for bug, which prevents installing 61-persistent-storage.rules (bug #520109)
- fix for missing grep for md
dracut-001
==========
- better --hostonly checks
- better lvm/mdraid/dmraid handling
- 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
- 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.
dracut-0.9
==========
- let plymouth attach to the terminal (nice text output now)
- new kernel command line parameter "rdinfo" show dracut output, even when
"quiet" is specified
- rd_LUKS_UUID is now handled correctly
- dracut-gencmdline: rd_LUKS_UUID and rd_MD_UUID is now correctly generated
- now generates initrd-generic with around 15MB
- smaller bugfixes
dracut-0.8
==========
- iSCSI with username and password
- support for live images (dmsquashed live images)
- iscsi_firmware fixes
- smaller images
- bugfixes
dracut-0.7
==========
- dracut: strip binaries in initramfs
--strip
strip binaries in the initramfs (default)
--nostrip
do not strip binaries in the initramfs
- dracut-catimages
Usage: ./dracut-catimages [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
(default: /boot/dracut/)
-o, --overlaydir Overlay directory, which contains 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 This message
--debug Output debug information of the build process
-v, --verbose Verbose output during the build process
- s390 dasd support
dracut-0.6
==========
- dracut: add --kernel-only and --no-kernel arguments
--kernel-only
only install kernel drivers and firmware files
--no-kernel
do not install kernel drivers and firmware files
All kernel module related install commands moved from "install"
to "installkernel".
For "--kernel-only" all installkernel scripts of the specified
modules are used, regardless of any checks, so that all modules
which might be needed by any dracut generic image are in.
The basic idea is to create two images. One image with the kernel
modules and one without. So if the kernel changes, you only have
to replace one image.
Grub and the kernel can handle multiple images, so grub entry can
look like this:
title Fedora (2.6.29.5-191.fc11.i586)
root (hd0,0)
kernel /vmlinuz-2.6.29.5-191.fc11.i586 ro rhgb quiet
initrd /initrd-20090722.img /initrd-kernel-2.6.29.5-191.fc11.i586.img /initrd-config.img
initrd-20090722.img
the image provided by the initrd rpm
one old backup version is kept like with the kernel
initrd-kernel-2.6.29.5-191.fc11.i586.img
the image provided by the kernel rpm
initrd-config.img
optional image with local configuration files
- dracut: add --kmoddir directory, where to look for kernel modules
-k, --kmoddir [DIR]
specify the directory, where to look for kernel modules
dracut-0.5
==========
- more generic (all plymouth modules, all keyboards, all console fonts)
- more kernel command line parameters (see also man dracut(8))
- a helper tool, which generates the kernel command line (dracut-gencmdline)
- bridged network boot
- a lot of new command line parameter
dracut-0.4
==========
- bugfixes
- firmware loading support
- new internal queue (initqueue)
initqueue now loops until /dev/root exists or root is mounted
init now has the following points to inject scripts:
/cmdline/*.sh
scripts for command line parsing
/pre-udev/*.sh
scripts to run before udev is started
/pre-trigger/*.sh
scripts to run before the main udev trigger is pulled
/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 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
scripts to run before the root filesystem is mounted
NFS is an exception, because it has no device node to be created
and mounts in the udev events
/mount/*.sh
scripts to mount the root filesystem
NFS is an exception, because it has no device node to be created
and mounts in the udev events
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
scripts to run before the real init is executed and the initramfs
disappears
All processes started before should be killed here.
The behaviour of the dmraid module demonstrates how to use the new
mechanism. If it detects a device which is part of a raidmember from a
udev rule, it installs a job to scan for dmraid devices, if the udev
queue is empty. After a scan, it removes itsself from the queue.
dracut-0.3
==========
- first public version

21
PKGBUILD Normal file
View File

@@ -0,0 +1,21 @@
pkgname=dracut-git
pkgver=$(date +%s)
pkgrel=$(git log --pretty=format:%h |head -n 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=()
build() {
cd ..
make sysconfdir=/etc || return 1
make DESTDIR="${pkgdir}" sysconfdir=/etc install || return 1
}

74
README
View File

@@ -1,9 +1,9 @@
Dracut
dracut
------
Dracut is a new initramfs infrastructure.
dracut is a new initramfs infrastructure.
Information about the initial goals and aims can be found at
https://fedoraproject.org/wiki/Initrdrewrite
Information about the initial goals and aims can be found at
https://fedoraproject.org/wiki/Initrdrewrite
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 +19,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 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 +44,49 @@ 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 kernel.org.
The tarballs can be found here:
http://www.kernel.org/pub/linux/utils/boot/dracut/
ftp://ftp.kernel.org/pub/linux/utils/boot/dracut/
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://github.com/haraldh/dracut.git
git://dracut.git.sourceforge.net/gitroot/dracut/dracut
Git Web:
http://git.kernel.org/?p=boot/dracut/dracut.git
https://haraldh@github.com/haraldh/dracut.git
http://dracut.git.sourceforge.net/git/gitweb.cgi?p=dracut/dracut
Git Web RSS Feed:
http://git.kernel.org/?p=boot/dracut/dracut.git;a=rss
Project Page:
https://sourceforge.net/projects/dracut/
http://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html
Drop Harald Hoyer <harald@redhat.com> a mail, if you want to help with
the documentation, git access, etc.
Project Wiki:
http://dracut.wiki.kernel.org
Git Repository:
http://dracut.git.sourceforge.net/
git://dracut.git.sourceforge.net/gitroot/dracut
Trac Instance:
http://apps.sourceforge.net/trac/dracut/
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'
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.)

3
README.kernel Normal file
View File

@@ -0,0 +1,3 @@
"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.

5
README.md Normal file
View File

@@ -0,0 +1,5 @@
# dracut RHEL-7 branch
dracut is an initramfs infrastructure.
CentOS CI Status: [![Build Status](https://ci.centos.org/buildStatus/icon?job=dracut-push-rhel-7)](https://ci.centos.org/job/dracut-push-rhel-7/)

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,41 +12,101 @@ 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 mode 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.
HOOKS
=====
init has the following hook points to inject scripts:
/lib/dracut/hooks/cmdline/*.sh
scripts for command line parsing
/lib/dracut/hooks/pre-udev/*.sh
scripts to run before udev is started
/lib/dracut/hooks/pre-trigger/*.sh
scripts to run before the main udev trigger is pulled
/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 /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".
/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
exception. Root can be mounted already at this point.
/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.
/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.
You are encouraged to provide a README that descrobes what the module is for.

32
README.testsuite Normal file
View File

@@ -0,0 +1,32 @@
For the testsuite to work, you will have to install at least the following software packages:
dash \
bridge-utils \
asciidoc \
mdadm \
lvm2 \
cryptsetup \
nfs-utils \
nbd \
dhcp-server \
scsi-target-utils \
iscsi-initiator-utils
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

44
TODO
View File

@@ -1,2 +1,44 @@
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
- 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
- bridging/bonding without "netroot=" https://bugzilla.redhat.com/show_bug.cgi?id=822750
- progress indication for fsck https://bugzilla.redhat.com/show_bug.cgi?id=827118
- domain, searchdomain https://bugzilla.redhat.com/show_bug.cgi?id=840778
- disable write-ifcfg https://bugzilla.redhat.com/show_bug.cgi?id=840784
- check for /var to be mounted in convertfs https://bugzilla.redhat.com/show_bug.cgi?id=848172
- probably fix "--include" https://bugzilla.redhat.com/show_bug.cgi?id=849338
GENERATOR TODO
- remove wait for swap devs, if no "resume=" is given on the kernel command line
- 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

78
configure vendored Executable file
View File

@@ -0,0 +1,78 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
# We don't support srcdir != builddir
echo \#buildapi-variable-no-builddir >/dev/null
prefix=/usr
enable_documentation=yes
# 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
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}
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

166
dracut
View File

@@ -1,166 +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 2008, Red Hat, Inc. Jeremy Katz <katzj@redhat.com>
# GPLv2 header here
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.
-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;;
-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;;
*) break ;;
esac
shift
done
[[ $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
[[ $dracutbasedir ]] || dracutbasedir=/usr/share/dracut
[[ $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"
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 debug beverbose
# 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
# 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
. "$moddir/install"
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 ! /sbin/depmod -a -b "$initdir" $kernel; then
echo "\"/sbin/depmod -a $kernel\" failed."
exit 1
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)
( cd "$initdir"; find . |cpio -H newc -o |gzip -9 > "$outfile"; )
[[ "$beverbose" = "yes" ]] && ls -lh "$outfile"
exit 0

79
dracut-bash-completion.sh Normal file
View File

@@ -0,0 +1,79 @@
#
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
#
# 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 --no-compress --gzip --list-modules --show-modules --keep
--printsize --regenerate-all --noimageifnotneeded --early-microcode
--no-early-microcode --print-cmdline --prelink --noprelink'
[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'
)
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)

130
dracut-catimages.sh Executable file
View File

@@ -0,0 +1,130 @@
#!/bin/bash --norc
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
#
# Copyright 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/>.
#
dwarning() {
echo "Warning: $@" >&2
}
dinfo() {
[[ $beverbose ]] && echo "$@" >&2
}
derror() {
echo "Error: $@" >&2
}
usage() {
# 80x25 linebreak here ^
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
(default: /boot/dracut/)
-o, --overlaydir Overlay directory, which contains 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 This message
--debug Output debug information of the build process
-v, --verbose Verbose output during the build process
EOF
}
imagedir=/boot/dracut/
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 ;;
esac
shift
done
outfile=$1; shift
if [[ -z $outfile ]]; then
derror "No output file specified."
usage
exit 1
fi
baseimage=$1; shift
if [[ -z $baseimage ]]; then
derror "No base image specified."
usage
exit 1
fi
if [[ -f $outfile && ! $force ]]; then
derror "Will not override existing initramfs ($outfile) without --force"
exit 1
fi
if [[ ! $no_imagedir && ! -d $imagedir ]]; then
derror "Image directory $overlay is not a directory"
exit 1
fi
if [[ ! $no_overlay && ! -d $overlay ]]; then
derror "Overlay $overlay is not a directory"
exit 1
fi
if [[ ! $no_overlay ]]; then
ofile="$imagedir/90-overlay.img"
dinfo "Creating image $ofile from directory $overlay"
type pigz &>/dev/null && gzip=pigz || gzip=gzip
( cd "$overlay"; find . |cpio --quiet -H newc -o |$gzip -9 > "$ofile"; )
fi
if [[ ! $no_imagedir ]]; then
for i in "$imagedir/"*.img; do
[[ -f $i ]] && images+=("$i")
done
fi
images+=($@)
dinfo "Using base image $baseimage"
cat -- "$baseimage" > "$outfile"
for i in "${images[@]}"; do
dinfo "Appending $i"
cat -- "$i" >> "$outfile"
done
dinfo "Created $outfile"
exit 0

View File

@@ -1,323 +0,0 @@
#!/bin/bash
#
# functions used by mkinitrd and other tools.
#
# Copyright 2005-2008 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/>.
#
# Authors:
# Peter Jones <pjones@redhat.com>
# Jeremy Katz <katzj@redhat.com>
# Jakub Jelinek <jakub@redhat.com>
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
[[ $line =~ ([^ ]*/lib[^/]*/[^ ]*\.so[^ ]*) ]] || continue
FILE=${BASH_REMATCH[1]}
[[ -f ${initdir}$FILE ]] && continue
# see if we are loading an optimized version of a shared lib.
if [[ $FILE =~ ^(/lib[^/]*).* ]]; 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:]')
[[ $line =~ (#! *)(/[^ ]+).* ]] || 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() {
while (($# > 0)); do
if inst "$1" ; then
shift
continue
fi
derror "Failed to install $1"; exit 1
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
[[ -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() {
local mod mpargs modpath modname cmd
local srcmods="/lib/modules/$kernel/"
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 \
--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"
done
for fw in $(/sbin/modinfo -F firmware $mod 2>/dev/null); do
if [[ -f /lib/firmware/$fw ]]; then
inst_simple "/lib/firmware/$fw"
else
dwarning "Possible missing firmware /lib/firmware/${fw} for module ${mod}.ko"
fi
done
;;
esac
shift
done
}
# vim:ts=8:sw=4:sts=4:et

1783
dracut-functions.sh Executable file

File diff suppressed because it is too large Load Diff

34
dracut-init.sh Normal file
View File

@@ -0,0 +1,34 @@
#!/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
if [[ $DRACUT_KERNEL_LAZY ]] && ! [[ $DRACUT_KERNEL_LAZY_HASHDIR ]]; then
if ! [[ -d "$initdir/.kernelmodseen" ]]; then
mkdir -p "$initdir/.kernelmodseen"
fi
DRACUT_KERNEL_LAZY_HASHDIR="$initdir/.kernelmodseen"
fi
if [[ $initdir ]] && ! [[ -d $initdir ]]; then
mkdir -p "$initdir"
fi
[[ $dracutbasedir ]] || export dracutbasedir=${BASH_SOURCE%/*}
. $dracutbasedir/dracut-functions.sh

View File

@@ -0,0 +1,36 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
set -e
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
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
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

443
dracut-logger.sh Executable file
View File

@@ -0,0 +1,443 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 et filetype=sh
#
# 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>
# FATAL(1) -> LOG_EMERG (0)
# none -> LOG_ALERT (1)
# none -> 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=0;;
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 )) && echo "$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 || :
}

206
dracut.8
View File

@@ -1,206 +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 \-d ", " \-\-drivers " \fILIST\fR"
specify a space-separated list of kernel modules to include 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 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>:<gateway-IP-number>:<netmask>:<client-hostname>:<interface>:[dhcp|on|any|]
explicit network configuration
.SH Misc
.TP
.B rdblacklist=<drivername>
do not load kernel module <drivername>
.SH Debug
.TP
.B rdinitdebug
set -x for the dracut shell
.TP
.B rdbreak=[pre-udev|pre-mount|mount|pre-pivot|]
drop the 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

529
dracut.8.asc Normal file
View File

@@ -0,0 +1,529 @@
DRACUT(8)
=========
:doctype: manpage
:man source: dracut
:man manual: dracut
NAME
----
dracut - low-level tool for generating an initramfs 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.
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 safed 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.
**-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.
+
[NOTE]
===============================
If [LIST] has multiple arguments, then you have to put these in quotes. For
example:
----
# dracut --modules "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" ...
----
===============================
**-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" ...
----
===============================
**-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
**--prelink**::
prelink binaries in the initramfs (default)
**--noprelink**::
do not prelink 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".
**--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.
====
**--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.
**--no-compress**::
Do not compress the generated initramfs. This will override any other
compression options.
**--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.
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)

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
/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)

1076
dracut.cmdline.7.asc Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,10 +1,51 @@
# PUT YOUR CONFIG HERE OR IN separate files named *.conf
# in /etc/dracut.conf.d
# SEE man dracut.conf(5)
# Sample dracut config file
# Specific list of dracut modules to use
#dracutmodules=""
#logfile=/var/log/dracut.log
#fileloglvl=6
# Dracut modules to omit
#omit_dracutmodules=""
# Exact list of dracut modules to use. Modules not listed here are not going
# to be included. If you only want to add some optional modules use
# add_dracutmodules option instead.
#dracutmodules+=""
# Additional kernel modules to install
#drivers=""
# dracut modules to omit
#omit_dracutmodules+=""
# dracut modules to add to the default
#add_dracutmodules+=""
# additional kernel modules to the default
#add_drivers+=""
# list of kernel filesystem modules to be included in the generic initramfs
#filesystems+=""
# build initrd only to boot current hardware
#hostonly="yes"
#
# install local /etc/mdadm.conf
#mdadmconf="no"
# install local /etc/lvm/lvm.conf
#lvmconf="no"
# A list of fsck tools to install. If it's not specified, module's hardcoded
# default is used, currently: "umount mount /sbin/fsck* xfs_db xfs_check
# xfs_repair e2fsck jfs_fsck reiserfsck btrfsck". The installation is
# opportunistic, so non-existing tools are just ignored.
#fscks=""
# inhibit installation of any fsck tools
#nofscks="yes"
# mount / and /usr read-only by default
#ro_mnt="no"
# set the directory for temporary files
# default: /var/tmp
#tmpdir=/tmp

212
dracut.conf.5.asc Normal file
View File

@@ -0,0 +1,212 @@
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 overwrite 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 overwrite 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 overwrite any values set here.
Configuration files must have the extension .conf; other extensions are ignored.
[WARNING]
====
Space-separated lists have to have a leading and trailing space!
====
*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_.
*omit_dracutmodules+=*" __<dracut modules>__ "::
Omit a space-separated list of dracut modules.
*add_dracutmodules+=*" __<dracut modules>__ "::
Add a space-separated list of dracut modules.
*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.
*do_strip=*"__{yes|no}__"::
Strip binaries in the initramfs (default=yes)
*do_prelink=*"__{yes|no}__"::
Prelink 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, store the kernel command line arguments needed in the initramfs
*i18n_install_all=*"__{yes|no}__"::
If set to yes, install all available fonts and keyboard files.
*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=no)
*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.
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 overwrite 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,17 @@
# 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="latarcyrheb-sun16"
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"

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,3 @@
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"

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
}

299
dracut.modules.7.asc Normal file
View File

@@ -0,0 +1,299 @@
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 itsself. 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 _pase-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 fullfilled
(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_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: 7.2 KiB

1713
dracut.sh Executable file

File diff suppressed because it is too large Load Diff

View File

@@ -1,115 +1,461 @@
%if 0%{?fedora} < 12
%define with_switch_root 1
%else
%define with_switch_root 1
%endif
%define dracutlibdir %{_prefix}/lib/dracut
%if %{defined gittag}
%define rdist 1.git%{gittag}%{?dist}
%define dashgittag -%{gittag}
%else
%define rdist %{?dist}
%endif
# Variables must be defined
%define with_nbd 1
# nbd in Fedora only
%if 0%{?rhel} >= 6
%define with_nbd 0
%endif
Name: dracut
Version: 0.3
Release: 1%{?rdist}
Version: xxx
Release: xxx
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
%if 0%{?fedora} || 0%{?rhel}
Group: System Environment/Base
%endif
%if 0%{?suse_version}
Group: System/Base
%endif
# 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.bz2
BuildRequires: bash git
%if 0%{?fedora} || 0%{?rhel}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: udev
Requires: util-linux-ng
Requires: module-init-tools
Requires: cpio
BuildRequires: pkgconfig
%endif
%if 0%{?fedora}
BuildRequires: bash-completion
BuildRequires: pkgconfig
%endif
%if 0%{?suse_version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%endif
%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
%if 0%{?fedora} > 12 || 0%{?rhel}
# no "provides", because dracut does not offer
# all functionality of the obsoleted packages
Obsoletes: mkinitrd <= 6.0.93
Obsoletes: mkinitrd-devel <= 6.0.93
Obsoletes: nash <= 6.0.93
Obsoletes: libbdevid-python <= 6.0.93
%endif
%if 0%{?fedora} > 16 || 0%{?rhel} > 6
BuildRequires: systemd-units
%endif
%if 0%{?suse_version} > 9999
Obsoletes: mkinitrd < 2.6.1
Provides: mkinitrd = 2.6.1
%endif
Obsoletes: dracut-kernel < 005
Provides: dracut-kernel = %{version}-%{release}
Obsoletes: dracut <= 029
Obsoletes: dracut-norescue
Provides: dracut-norescue
Requires: bash >= 4
Requires: coreutils
Requires: cpio
Requires: filesystem >= 2.1.0
Requires: findutils
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
%ifnarch s390 s390x
Requires: dmraid
Requires: kbd
Requires: hardlink
Requires: gzip xz
Requires: kmod
Requires: sed
Requires: kpartx
Requires: tar
%if 0%{?fedora} || 0%{?rhel} > 6
Requires: util-linux >= 2.21
Requires: systemd >= 219
Requires: procps-ng
Conflicts: grubby < 8.23
%else
Requires: udev > 166
Requires: util-linux-ng >= 2.21
%endif
%if ! 0%{?with_switch_root}
Requires: /sbin/switch_root
BuildArch: noarch
%if 0%{?fedora} || 0%{?rhel} > 6
Conflicts: initscripts < 8.63-1
Conflicts: plymouth < 0.8.0-0.2009.29.09.19.1
%endif
Conflicts: mdadm < 3.2.6-14
%description
dracut is a new, event-driven initramfs infrastructure based around udev.
dracut contains tools to create a bootable initramfs for 2.6 Linux kernels.
Unlike existing implementations, dracut does hard-code 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
%package network
Summary: dracut modules to build a dracut initramfs with network support
Requires: %{name} = %{version}-%{release}
Requires: rpcbind nfs-utils
Requires: iscsi-initiator-utils
Requires: nbd
Requires: net-tools iproute
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.
all purpose initramfs with network support with dracut.
%if 0%{?fedora} || 0%{?rhel} >= 6 || 0%{?suse_version}
%package fips
Summary: dracut modules to build a dracut initramfs with an integrity check
Requires: %{name} = %{version}-%{release}
Requires: hmaccalc
%if 0%{?rhel} > 5
# For Alpha 3, we want nss instead of nss-softokn
Requires: nss
%else
Requires: nss-softokn
%endif
Requires: nss-softokn-freebl
%prep
%setup -q -n %{name}-%{version}%{?dashgittag}
%build
make
%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT sbindir=/sbin sysconfdir=/etc mandir=%{_mandir}
%if ! 0%{?with_switch_root}
rm -f $RPM_BUILD_ROOT/sbin/switch_root
%description fips
This package requires everything which is needed to build an
initramfs with dracut, which does an integrity check.
%endif
%package fips-aesni
Summary: dracut modules to build a dracut initramfs with an integrity check with aesni-intel
Requires: %{name}-fips = %{version}-%{release}
%description fips-aesni
This package requires everything which is needed to build an
initramfs with dracut, which does an integrity check and adds the aesni-intel kernel module.
%package caps
Summary: dracut modules to build a dracut initramfs which drops capabilities
Requires: %{name} = %{version}-%{release}
Requires: libcap
%description caps
This package requires everything which is needed to build an
initramfs with dracut, which drops capabilities.
%package config-generic
Summary: dracut configuration to turn off hostonly image generation
Requires: %{name} = %{version}-%{release}
Obsoletes: dracut-nohostonly
Provides: dracut-nohostonly
%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 <= 029
%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}
%description tools
This package contains tools to assemble the local initrd and host configuration.
%prep
%setup -q -n %{name}-%{version}
%if %{defined PATCH1}
git init
git config user.email "dracut-maint@redhat.com"
git config user.name "Fedora dracut team"
git add .
git commit -a -q -m "%{version} baseline."
# Apply all the patches.
git am -p1 %{patches}
git tag %{version}
%endif
%build
%configure --systemdsystemunitdir=%{_unitdir} --bashcompletiondir=$(pkg-config --variable=completionsdir bash-completion) --libdir=%{_prefix}/lib
make %{?_smp_mflags}
%install
%if 0%{?fedora} || 0%{?rhel}
rm -rf -- $RPM_BUILD_ROOT
%endif
make %{?_smp_mflags} install \
DESTDIR=$RPM_BUILD_ROOT \
libdir=%{_prefix}/lib
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
rm -fr -- $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/02fips-aesni
%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
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
%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version}
install -m 0644 dracut.conf.d/fedora.conf.example $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/01-dist.conf
install -m 0644 dracut.conf.d/fips.conf.example $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/40-fips.conf
%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} <= 12 && 0%{?rhel} < 6 && 0%{?suse_version} <= 9999
rm -f -- $RPM_BUILD_ROOT%{_bindir}/mkinitrd
rm -f -- $RPM_BUILD_ROOT%{_bindir}/lsinitrd
%endif
%if 0%{?fedora} || 0%{?rhel} > 6
# FIXME: remove after F19
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
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
%endif
%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version}
> $RPM_BUILD_ROOT/etc/system-fips
%endif
# create compat symlink
mkdir -p $RPM_BUILD_ROOT%{_sbindir}
ln -sr $RPM_BUILD_ROOT%{_bindir}/dracut $RPM_BUILD_ROOT%{_sbindir}/dracut
%clean
rm -rf $RPM_BUILD_ROOT
rm -rf -- $RPM_BUILD_ROOT
%files
%defattr(-,root,root,0755)
%doc README HACKING TODO COPYING AUTHORS
/sbin/dracut
%if 0%{?with_switch_root}
/sbin/switch_root
%doc README HACKING TODO COPYING AUTHORS NEWS dracut.html dracut.png dracut.svg
%{_bindir}/dracut
# compat symlink
%{_sbindir}/dracut
%{_datadir}/bash-completion/completions/dracut
%{_datadir}/bash-completion/completions/lsinitrd
%if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 0%{?suse_version} > 9999
%{_bindir}/mkinitrd
%{_bindir}/lsinitrd
%endif
%dir %{_datadir}/dracut
%{_datadir}/dracut/dracut-functions
%{_datadir}/dracut/modules.d
%config(noreplace) /etc/dracut.conf
%dir %{dracutlibdir}
%dir %{dracutlibdir}/modules.d
%{dracutlibdir}/dracut-init.sh
%{dracutlibdir}/dracut-functions.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
%{_datadir}/pkgconfig/dracut.pc
%{_mandir}/man8/dracut.8*
%{_mandir}/man8/*service.8*
%if 0%{?fedora} > 12 || 0%{?rhel} >= 6 || 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*
%if %{defined _unitdir}
%{dracutlibdir}/modules.d/00systemd-bootchart
%else
%{dracutlibdir}/modules.d/00bootchart
%endif
%{dracutlibdir}/modules.d/00bash
%{dracutlibdir}/modules.d/03modsign
%{dracutlibdir}/modules.d/03rescue
%{dracutlibdir}/modules.d/04watchdog
%{dracutlibdir}/modules.d/05busybox
%{dracutlibdir}/modules.d/10i18n
%{dracutlibdir}/modules.d/30convertfs
%{dracutlibdir}/modules.d/45url-lib
%{dracutlibdir}/modules.d/50drm
%{dracutlibdir}/modules.d/50plymouth
%{dracutlibdir}/modules.d/80cms
%{dracutlibdir}/modules.d/90bcache
%{dracutlibdir}/modules.d/90btrfs
%{dracutlibdir}/modules.d/90crypt
%{dracutlibdir}/modules.d/90dm
%{dracutlibdir}/modules.d/90dmraid
%{dracutlibdir}/modules.d/90dmsquash-live
%{dracutlibdir}/modules.d/90dmsquash-live-ntfs
%{dracutlibdir}/modules.d/90kernel-modules
%{dracutlibdir}/modules.d/90lvm
%{dracutlibdir}/modules.d/90mdraid
%{dracutlibdir}/modules.d/90multipath
%{dracutlibdir}/modules.d/90qemu
%{dracutlibdir}/modules.d/91crypt-gpg
%{dracutlibdir}/modules.d/91crypt-loop
%{dracutlibdir}/modules.d/95debug
%{dracutlibdir}/modules.d/95resume
%{dracutlibdir}/modules.d/95rootfs-block
%{dracutlibdir}/modules.d/95dasd
%{dracutlibdir}/modules.d/95dasd_mod
%{dracutlibdir}/modules.d/95fstab-sys
%{dracutlibdir}/modules.d/95zfcp
%{dracutlibdir}/modules.d/95terminfo
%{dracutlibdir}/modules.d/95udev-rules
%{dracutlibdir}/modules.d/95virtfs
%if %{undefined _unitdir}
%{dracutlibdir}/modules.d/96securityfs
%{dracutlibdir}/modules.d/97masterkey
%{dracutlibdir}/modules.d/98integrity
%endif
%{dracutlibdir}/modules.d/97biosdevname
%{dracutlibdir}/modules.d/98ecryptfs
%{dracutlibdir}/modules.d/98pollcdrom
%{dracutlibdir}/modules.d/98selinux
%{dracutlibdir}/modules.d/98syslog
%{dracutlibdir}/modules.d/98systemd
%{dracutlibdir}/modules.d/98usrmount
%{dracutlibdir}/modules.d/99base
%{dracutlibdir}/modules.d/99fs-lib
%{dracutlibdir}/modules.d/99img-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}/shutdown.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 generic
%endif
%if 0%{?fedora} || 0%{?rhel} > 6
%{_prefix}/lib/kernel/install.d/50-dracut.install
%endif
%files network
%defattr(-,root,root,0755)
%doc README.generic
%{dracutlibdir}/modules.d/40network
%{dracutlibdir}/modules.d/95fcoe
%{dracutlibdir}/modules.d/95iscsi
%{dracutlibdir}/modules.d/90livenet
%{dracutlibdir}/modules.d/90qemu-net
%{dracutlibdir}/modules.d/95cifs
%{dracutlibdir}/modules.d/95nbd
%{dracutlibdir}/modules.d/95nfs
%{dracutlibdir}/modules.d/95ssh-client
%{dracutlibdir}/modules.d/45ifcfg
%{dracutlibdir}/modules.d/95znet
%{dracutlibdir}/modules.d/95fcoe-uefi
%{dracutlibdir}/modules.d/99uefi-lib
%if 0%{?fedora} || 0%{?rhel} || 0%{?suse_version}
%files fips
%defattr(-,root,root,0755)
%{dracutlibdir}/modules.d/01fips
%{dracutlibdir}/dracut.conf.d/40-fips.conf
%config(missingok) /etc/system-fips
%endif
%files fips-aesni
%defattr(-,root,root,0755)
%doc COPYING
%{dracutlibdir}/modules.d/02fips-aesni
%files caps
%defattr(-,root,root,0755)
%{dracutlibdir}/modules.d/02caps
%files tools
%defattr(-,root,root,0755)
%{_mandir}/man8/dracut-catimages.8*
%{_bindir}/dracut-catimages
%dir /boot/dracut
%dir /var/lib/dracut
%dir /var/lib/dracut/overlay
%files config-generic
%defattr(-,root,root,0755)
%{dracutlibdir}/dracut.conf.d/02-generic-image.conf
%files config-rescue
%defattr(-,root,root,0755)
%{dracutlibdir}/dracut.conf.d/02-rescue.conf
%if 0%{?fedora} || 0%{?rhel} > 6
%{_prefix}/lib/kernel/install.d/51-dracut-rescue.install
%{_sysconfdir}/kernel/postinst.d/51-dracut-rescue-postinst.sh
%endif
%changelog
* 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

509
dracut.usage.asc Normal file
View File

@@ -0,0 +1,509 @@
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.
[NOTE]
===============================
On RHEL-7 the hostonly mode is the default mode. Generic "non-hostonly" images
are created, if the dracut-config-generic rpm is installed. The rescue kernel
entry in the bootloader menu is also a generic image.
===============================
=== 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 usually can be configured in _/boot/grub2/grub.cfg_
(or _/boot/efi/EFI/redhat/grub.cfg_ for EFI systems), if
grub2 is your bootloader and it also can be edited in the real boot process in
the grub menu.
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.
On a Red Hat Enterprise Linux or Fedora system, this means, you have to install
the _dracut-network_ rpm package:
----
# yum install dracut-network
----
The resulting initramfs image can be served by a boot manager residing on your
local hard drive or it can be served by a PXE/TFTP server.
How to setup your PXE/TFTP server can be found in the
http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/[Red
Hat Enterprise Linux Storage Administration Guide].
If you specify ip=dhcp on the kernel command line, then dracut asks a dhcp
server about the ip adress 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 ommitting 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:
http://fedoraproject.org/wiki/How_to_debug_Dracut_problems
[[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 _/boot/efi/EFI/redhat/grub.cfg_ for EFI systems))
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.
. In _/boot/grub2/grub.cfg_ (or _/boot/efi/EFI/redhat/grub.cfg_ for EFI systems),
add the following boot arguments to the ''linux16''
line:
+
----
console=tty0 console=ttyS0,9600
----
+
. 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.
[[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_ (or _/boot/efi/EFI/redhat/grub.cfg_ for EFI systems))
. Remove the boot arguments ''rhgb'' and ''quiet''
+
A sample _grub.cfg_ bootloader configuration file snippet is listed below.
+
----
menuentry 'Red Hat Enterprise Linux Server (3.10.0-308.el7.x86_64) 7.0 (Maipo)' […] {
[…]
linux16 /vmlinuz-3.10.0-308.el7.x86_64 ro root=/dev/mapper/vg_uc1-lv_root console=tty0 rd.shell
initrd16 /initramfs-3.10.0-308.el7.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.break=pre-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.

45
git2spec.pl Executable file
View File

@@ -0,0 +1,45 @@
#!/usr/bin/perl
sub create_patches {
my $tag=shift;
my $pdir=shift;
my $num=0;
open( GIT, 'git format-patch -M -N --no-signature -o "'.$pdir.'" '.$tag.' |');
@lines=<GIT>;
close GIT; # be done
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/;
my $release="$num";
while(<>) {
if (/^Version:/) {
print "Version: $tag\n";
}
elsif (/^Release:/) {
print "Release: $release%{?dist}\n";
}
elsif ((/^Source0:/) || (/^Source:/)) {
print $_;
$num=1;
for(@patches) {
s/.*\///g;
print "Patch$num: $_";
$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

1004
install/dracut-install.c Normal file

File diff suppressed because it is too large Load Diff

731
install/hashmap.c Normal file
View File

@@ -0,0 +1,731 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
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;
}

91
install/hashmap.h Normal file
View File

@@ -0,0 +1,91 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#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'

294
install/log.c Normal file
View File

@@ -0,0 +1,294 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
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,
int line,
const char *func,
const char *buffer) {
char location[64];
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) {
snprintf(location, sizeof(location), "(%s:%u) ", file, line);
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);

115
install/log.h Normal file
View File

@@ -0,0 +1,115 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#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

284
install/macro.h Normal file
View File

@@ -0,0 +1,284 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#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"

279
install/util.c Normal file
View File

@@ -0,0 +1,279 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
/***
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, *p;
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) {
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;
}

565
install/util.h Normal file
View File

@@ -0,0 +1,565 @@
/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
#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/>.
***/
#include <inttypes.h>
#include <time.h>
#include <sys/time.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.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];
}
bool endswith(const char *s, const char *postfix);
bool startswith(const char *s, const char *prefix);
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 __WORDSIZE == 32
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_;
#endif

View File

@@ -0,0 +1,63 @@
#
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
#
# 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

52
lsinitrd.1.asc Normal file
View File

@@ -0,0 +1,52 @@
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>.
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)

235
lsinitrd.sh Executable file
View File

@@ -0,0 +1,235 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
#
# 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 "-k, --kver <kernel version> inspect the initramfs of <kernel version>."
echo
} >&2
}
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
sorted=0
modules=0
declare -A filenames
unset POSIXLY_CORRECT
TEMP=$(getopt \
-o "shmf:k:" \
--long kver: \
--long file: \
--long mod \
--long help \
--long size \
-- "$@")
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;;
--) 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
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" 2>/dev/null | cpio --extract --verbose --quiet --to-stdout -- 'lib/dracut/modules.txt' 'usr/lib/dracut/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 "========================================================================"
}
if (( ${#filenames[@]} <= 0 )); then
echo "Image: $image: $(du -h $image | while read a b; 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 (( ${#filenames[@]} > 0 )); then
extract_files
else
echo "Early CPIO image"
list_files
fi
SKIP="$dracutbasedir/skipcpio"
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"
;;
*)
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
ret=0
if (( ${#filenames[@]} > 0 )); then
extract_files
else
version=$($CAT "$image" 2>/dev/null | cpio --extract --verbose --quiet --to-stdout -- 'lib/dracut/dracut-*' 'usr/lib/dracut/dracut-*' 2>/dev/null)
((ret+=$?))
echo "Version: $version"
echo
if [ "$modules" -eq 1 ]; then
list_modules
echo "========================================================================"
else
echo -n "Arguments: "
$CAT "$image" 2>/dev/null | cpio --extract --verbose --quiet --to-stdout -- 'lib/dracut/build-parameter.txt' 'usr/lib/dracut/build-parameter.txt' 2>/dev/null
echo
list_modules
list_files
fi
fi
exit $ret

101
mkinitrd-dracut.sh Normal file
View File

@@ -0,0 +1,101 @@
#!/bin/bash --norc
kver=$(uname -r)
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
local rematch='^[^=]*=(.*)$'
if [[ $2 =~ $rematch ]]; then
read "$1" <<< "${BASH_REMATCH[1]}"
elif [[ $3 != -* ]]; then
# Only read next arg if it not an arg itself.
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
}
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) dracut_args="${dracut_args} -f";;
--preload) read_arg modname "$@" || shift
basicmodules="$basicmodules $modname";;
--image-version) img_vers=yes;;
--rootfs) 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) ;;
*) if [[ ! $target ]]; then
target=$1
elif [[ ! $kernel ]]; then
kernel=$1
else
usage
fi;;
esac
shift
done
[[ $target && $kernel ]] || usage
[[ $img_vers ]] && target="$target-$kernel"
if [[ $basicmodules ]]; then
dracut $dracut_args --add-drivers "$basicmodules" "$target" "$kernel"
else
dracut $dracut_args "$target" "$kernel"
fi

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,20 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
check() {
require_binaries /bin/bash
}
depends() {
return 0
}
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,29 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
check() {
[[ "$mount_needs" ]] && return 1
require_binaries /sbin/bootchartd || return 1
return 255
}
depends() {
return 0
}
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,20 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
check() {
require_binaries /bin/dash
}
depends() {
return 0
}
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,18 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
check() {
[[ "$mount_needs" ]] && return 1
require_binaries $systemdutildir/systemd-bootchart || return 1
return 255
}
depends() {
return 0
}
install() {
inst_symlink /init /sbin/init
inst_multiple $systemdutildir/systemd-bootchart
}

12
modules.d/01fips/fips-boot.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=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

11
modules.d/01fips/fips-noboot.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=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

150
modules.d/01fips/fips.sh Executable file
View File

@@ -0,0 +1,150 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=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; do printf "%s\n" $a; done)
HMAC_SUM_CALC=$(sha512hmac $kpath | while read a b; 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}" 2>/tmp/fips.modprobe_err; then
# check if kernel provides generic algo
_found=0
while read _k _s _v; do
[ "$_k" != "name" -a "$_k" != "driver" ] && continue
[ "$_v" != "$_module" ] && [ "crypto-$_v" != "$_module" ] && continue
_found=1
break
done </proc/crypto
[ "$_found" = "0" ] && cat /tmp/fips.modprobe_err >&2 && 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)"
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}" ]; 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
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,68 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
check() {
return 255
}
depends() {
return 0
}
installkernel() {
local _fipsmodules _mod i _bootfstype
if [[ -f "${srcmods}/modules.fips" ]]; then
_fipsmodules="$(cat "${srcmods}/modules.fips")"
else
_fipsmodules="aead aes_generic aes-x86_64 ansi_cprng arc4 blowfish camellia cast6 cbc ccm "
_fipsmodules+="chainiv crc32c crct10dif_generic cryptomgr crypto_null ctr cts deflate des des3_ede dm-crypt dm-mod drbg "
_fipsmodules+="ecb eseqiv fcrypt gcm ghash_generic hmac khazad lzo md4 md5 michael_mic rmd128 "
_fipsmodules+="rmd160 rmd256 rmd320 rot13 salsa20 seed seqiv serpent sha1 sha224 sha256 sha256_generic "
_fipsmodules+="aes_s390 des_s390 prng sha256_s390 sha_common des_check_key sha1_s390 sha512_s390 "
_fipsmodules+="sha384 sha512 sha512_generic tea tnepres twofish wp256 wp384 wp512 xeta xtea xts zlib cmac authenc "
fi
mkdir -m 0755 -p "${initdir}/etc/modprobe.d"
for _mod in $_fipsmodules tcrypt; do
if hostonly='' instmods -c -s $_mod; then
echo $_mod >> "${initdir}/etc/fipsmodules"
echo "blacklist $_mod" >> "${initdir}/etc/modprobe.d/fips.conf"
for i in $(modprobe --resolve-alias $_mod 2>/dev/null); do
[[ $i == $_mod ]] && continue
echo "blacklist $i" >> "${initdir}/etc/modprobe.d/fips.conf"
done
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
}
install() {
local _dir
inst_hook pre-mount 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 fipscheck
inst_libdir_file libsoftokn3.so libsoftokn3.so \
libsoftokn3.chk libfreebl3.so libfreebl3.chk \
libssl.so 'hmaccalc/sha512hmac.hmac' libssl.so.10 \
libfreeblpriv3.so libfreeblpriv3.chk
inst_multiple -o prelink
inst_simple /etc/system-fips
}

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

36
modules.d/02caps/caps.sh Executable file
View File

@@ -0,0 +1,36 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
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 ; 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,23 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
check() {
require_binaries capsh
}
depends() {
return 0
}
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,30 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
check() {
return 255
}
depends() {
return 0
}
installkernel() {
local _fipsmodules _mod
_fipsmodules="aesni-intel ghash_clmulni_intel"
mkdir -m 0755 -p "${initdir}/etc/modprobe.d"
for _mod in $_fipsmodules; do
if instmods $_mod; then
echo $_mod >> "${initdir}/etc/fipsmodules"
echo "blacklist $_mod" >> "${initdir}/etc/modprobe.d/fips.conf"
fi
done
}
install() {
return 0
}

View File

@@ -0,0 +1,13 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=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,37 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
#
# Licensed under the GPLv2
#
# Copyright 2013 Red Hat, Inc.
# Peter Jones <pjones@redhat.com>
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
}
depends() {
return 0
}
install() {
inst_dir /lib/modules/keys
inst_binary /usr/bin/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,19 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
check() {
# do not add this module by default
return 255
}
depends() {
return 0
}
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.vfat e2fsck
}

View File

@@ -0,0 +1,78 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
check() {
return 255
}
depends() {
return 0
}
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

View File

@@ -0,0 +1,33 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
check() {
require_binaries busybox || return 1
return 255
}
depends() {
return 0
}
install() {
local _i _progs _path _busybox
_busybox=$(type -P busybox)
inst $_busybox /usr/bin/busybox
for _i in $($_busybox | sed -ne '1,/Currently/!{s/,//g; s/busybox//g; p}')
do
_progs="$_progs $_i"
done
# FIXME: switch_root should be in the above list, but busybox version hangs
# (using busybox-1.15.1-7.fc14.i686 at the time of writing)
for _i in $_progs; do
_path=$(find_binary "$_i")
[ -z "$_path" ] && continue
ln_r /usr/bin/busybox $_path
done
}

View File

@@ -0,0 +1,2 @@
# Console initialization - keyboard, font, etc.
KERNEL=="tty0", RUN+="/sbin/initqueue --onetime --unique --name console_init_$name /lib/udev/console_init $root/$name"

124
modules.d/10i18n/README Normal file
View File

@@ -0,0 +1,124 @@
dracut i18n module
------------------
INDEX
0. Introduction
1. Hostonly vs Generic
2. Configuration
2.1. Variables
2.2. Setting up mappings
2.3. Additional settings
3. Kernel parameters
~
0. Introduction
i18n module provides internationalization for initramfs at runtime. It
is intended to be generic across different GNU/Linux distributions.
i18n and keyboard settings are stored in different files among
distributions. To deal with it avoiding hardcoding those differences in
the installation script we handle it by mappings between variables used
by dracut and the ones in the system. Package maintainer is expected to
create those for his/her distribution and it's appreciated to share it
with us, so we can include it in source package.
1. Hostonly vs Generic
If you invoke dracut with '-H' option, i18n module install script will
gather variables values from your configuration files using mappings
provided in "/etc/dracut.conf.d/<foo>.conf". Those variables will be
put in "etc/vconsole.conf" and "etc/locale.conf" files inside initramfs
image. Next it will install only declared font, keymaps and so.
When building generic image (dracut without '-H' option), install script
copies all content of directories: consolefonts, consoletrans, unimaps
and keymaps to image. Take into account that's about 4 MiB.
2. Configuration
2.1. Variables
The following variables are used by i18n install script and at initramfs
runtime:
KEYMAP - keyboard translation table loaded by loadkeys
KEYTABLE - base name for keyboard translation table; if UNICODE is
true, Unicode version will be loaded. Overrides KEYMAP.
EXT_KEYMAPS - list of extra keymaps to bo loaded (sep. by space)
UNICODE - boolean, indicating UTF-8 mode
FONT - console font
FONT_MAP - see description of '-m' parameter in setfont manual
FONT_UNIMAP - see description of '-u' parameter in setfont manual
The following are appended to EXT_KEYMAPS only during build time:
UNIKEYMAP
GRP_TOGGLE
They were used in 10redhat-i18n module, but not sure of its purpose.
I'm leaving it in case... The following are taken from the environment:
LANG
LC_ALL
If UNICODE variable is not provided, script indicates if UTF-8 should be
used on the basis of LANG value (if it ends with ".utf8" or similar).
2.2. Setting up mappings
Mappings between variables listed in 2.1. and the ones spread around
your system are set up in /etc/dracut.conf.d/<foo>.conf. You need to
assign mappings to i18n_vars. Here's an example:
i18n_vars="/etc/conf.d/keymaps:KEYMAP,EXTENDED_KEYMAPS-EXT_KEYMAPS /etc/conf.d/consolefont:CONSOLEFONT-FONT,CONSOLETRANSLATION-FONT_MAP /etc/rc.conf:UNICODE"
First we've got name of file in host file system tree. After colon
there's mapping: <from>-<to>. If both variables have the same name you
can enter just a single, but it's important to specify it! The module
will source only variables you've listed.
Below there's detailed description in BNF:
<list> ::= <element> | <element> " " <list>
<element> ::= <conf-file-name> ":" <map-list>
<map-list> ::= <mapping> | <mapping> "," <map-list>
<mapping> ::= <src-var> "-" <dst-var> | <src-var>
We assume no whitespace are allowed between symbols.
<conf-file-name> is a file holding <src-var> in your system.
<src-var> is a variable holding value of meaning the same as <dst-var>.
<dst-var> is a variable which will be set up inside initramfs.
If <dst-var> has the same name as <src-var> we can omit <dst-var>.
Example:
/etc/conf.d/keymaps:KEYMAP,extended_keymaps-EXT_KEYMAPS
<list> = /etc/conf.d/keymaps:KEYMAP,extended_keymaps-EXT_KEYMAPS
<element> = /etc/conf.d/keymaps:KEYMAP,extended_keymaps-EXT_KEYMAPS
<conf-file-name> = /etc/conf.d/keymaps
<map-list> = KEYMAP,extended_keymaps-EXT_KEYMAPS
<mapping> = KEYMAP
<src-var> = KEYMAP
<mapping> = extended_keymaps-EXT_KEYMAPS
<src-var> = extended_keymaps
<dst-var> = EXT_KEYMAPS
2.3. Additional settings
If you encounter following error message: "Directories consolefonts,
consoletrans, keymaps, unimaps not found.", you can provide path where
those directories lie in your system by setting kbddir in configuration
file (the same where you put mappings).
3. Kernel parameters
If you create generic initramfs you can set up i18n by kernel
parameters using variables listed in 2.1. (except of UNIKEYMAP
and GRP_TOGGLE) The recommended minimum is: FONT and KEYMAP.

View File

@@ -0,0 +1,95 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
[ -n "$DRACUT_SYSTEMD" ] && exit 0
if [ -x $systemdutildir/systemd-vconsole-setup ]; then
$systemdutildir/systemd-vconsole-setup "$@"
fi
[ -e /etc/vconsole.conf ] && . /etc/vconsole.conf
DEFAULT_FONT=LatArCyrHeb-16
DEFAULT_KEYMAP=/etc/sysconfig/console/default.kmap
set_keyboard() {
local param
[ "${UNICODE}" = 1 ] && param=-u || param=-a
kbd_mode ${param}
}
set_terminal() {
local dev=$1
if [ "${UNICODE}" = 1 ]; then
printf '\033%%G' >&7
stty -F ${dev} iutf8
else
printf '\033%%@' >&7
stty -F ${dev} -iutf8
fi
}
set_keymap() {
local utf_switch
if [ -z "${KEYMAP}" ]; then
[ -f "${DEFAULT_KEYMAP}" ] && KEYMAP=${DEFAULT_KEYMAP}
fi
[ -n "${KEYMAP}" ] || return 1
[ "${UNICODE}" = 1 ] && utf_switch=-u
loadkeys -q ${utf_switch} ${KEYMAP} ${EXT_KEYMAPS}
}
set_font() {
local dev=$1; local trans=''; local uni=''
[ -z "${FONT}" ] && FONT=${DEFAULT_FONT}
[ -n "${FONT_MAP}" ] && trans="-m ${FONT_MAP}"
[ -n "${FONT_UNIMAP}" ] && uni="-u ${FONT_UNIMAP}"
setfont ${FONT} -C ${dev} ${trans} ${uni}
}
dev_close() {
exec 6>&-
exec 7>&-
}
dev_open() {
local dev=$1
exec 6<${dev} && \
exec 7>>${dev}
}
dev=/dev/${1#/dev/}
devname=${dev#/dev/}
[ -c "${dev}" ] || {
echo "Usage: $0 device" >&2
exit 1
}
dev_open ${dev}
for fd in 6 7; do
if ! [ -t ${fd} ]; then
echo "ERROR: File descriptor not opened: ${fd}" >&2
dev_close
exit 1
fi
done
set_keyboard
set_terminal ${dev}
set_font ${dev}
set_keymap
dev_close

250
modules.d/10i18n/module-setup.sh Executable file
View File

@@ -0,0 +1,250 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
check() {
[[ "$mount_needs" ]] && return 1
require_binaries setfont loadkeys kbd_mode || return 1
return 0
}
depends() {
return 0
}
install() {
if dracut_module_included "systemd"; then
unset FONT
unset KEYMAP
[[ -f /etc/vconsole.conf ]] && . /etc/vconsole.conf
fi
KBDSUBDIRS=consolefonts,consoletrans,keymaps,unimaps
DEFAULT_FONT="${i18n_default_font:-LatArCyrHeb-16}"
I18N_CONF="/etc/locale.conf"
VCONFIG_CONF="/etc/vconsole.conf"
# This is from 10redhat-i18n.
findkeymap () {
local MAP=$1
[[ ! -f $MAP ]] && \
MAP=$(find ${kbddir}/keymaps -type f -name $MAP -o -name $MAP.\* | head -n1)
[[ " $KEYMAPS " = *" $MAP "* ]] && return
KEYMAPS="$KEYMAPS $MAP"
case $MAP in
*.gz) cmd=zgrep;;
*.bz2) cmd=bzgrep;;
*) cmd=grep ;;
esac
for INCL in $($cmd "^include " $MAP | while read a a b; do echo ${a//\"/}; done); do
for FN in $(find ${kbddir}/keymaps -type f -name $INCL\*); do
findkeymap $FN
done
done
}
# Function gathers variables from distributed files among the tree, maps to
# specified names and prints the result in format "new-name=value".
#
# $@ = list in format specified below (BNF notation)
#
# <list> ::= <element> | <element> " " <list>
# <element> ::= <conf-file-name> ":" <map-list>
# <map-list> ::= <mapping> | <mapping> "," <map-list>
# <mapping> ::= <src-var> "-" <dst-var> | <src-var>
#
# We assume no whitespace are allowed between symbols.
# <conf-file-name> is a file holding <src-var> in your system.
# <src-var> is a variable holding value of meaning the same as <dst-var>.
# <dst-var> is a variable which will be set up inside initramfs.
# If <dst-var> has the same name as <src-var> we can omit <dst-var>.
#
# Example:
# /etc/conf.d/keymaps:KEYMAP,extended_keymaps-EXT_KEYMAPS
# <list> = /etc/conf.d/keymaps:KEYMAP,extended_keymaps-EXT_KEYMAPS
# <element> = /etc/conf.d/keymaps:KEYMAP,extended_keymaps-EXT_KEYMAPS
# <conf-file-name> = /etc/conf.d/keymaps
# <map-list> = KEYMAP,extended_keymaps-EXT_KEYMAPS
# <mapping> = KEYMAP
# <src-var> = KEYMAP
# <mapping> = extended_keymaps-EXT_KEYMAPS
# <src-var> = extended_keymaps
# <dst-var> = EXT_KEYMAPS
gather_vars() {
local item map value
for item in $@
do
item=(${item/:/ })
for map in ${item[1]//,/ }
do
map=(${map//-/ })
if [[ -f "${item[0]}" ]]; then
value=$(grep "^${map[0]}=" "${item[0]}")
value=${value#*=}
echo "${map[1]:-${map[0]}}=${value}"
fi
done
done
}
install_base() {
inst_multiple setfont loadkeys kbd_mode stty
if ! dracut_module_included "systemd"; then
inst ${moddir}/console_init.sh /lib/udev/console_init
inst_rules ${moddir}/10-console.rules
inst_hook cmdline 20 "${moddir}/parse-i18n.sh"
fi
}
install_all_kbd() {
local rel f
for _src in $(eval echo ${kbddir}/{${KBDSUBDIRS}}); do
inst_dir "$_src"
cp --reflink=auto --sparse=auto -prfL -t "${initdir}/${_src}" "$_src"/*
done
# remove unnecessary files
rm -f -- "${initdir}${kbddir}/consoletrans/utflist"
find "${initdir}${kbddir}/" -name README\* -delete
find "${initdir}${kbddir}/" -name '*.gz' -print -quit \
| while read line; do
inst_multiple gzip
done
find "${initdir}${kbddir}/" -name '*.bz2' -print -quit \
| while read line; do
inst_multiple bzip2
done
}
install_local_i18n() {
local map
eval $(gather_vars ${i18n_vars})
[ -f $I18N_CONF ] && . $I18N_CONF
[ -f $VCONFIG_CONF ] && . $VCONFIG_CONF
shopt -q -s nocasematch
if [[ ${UNICODE} ]]
then
if [[ ${UNICODE} = YES || ${UNICODE} = 1 ]]
then
UNICODE=1
elif [[ ${UNICODE} = NO || ${UNICODE} = 0 ]]
then
UNICODE=0
else
UNICODE=''
fi
fi
if [[ ! ${UNICODE} && ${LANG} =~ .*\.UTF-?8 ]]
then
UNICODE=1
fi
shopt -q -u nocasematch
# Gentoo user may have KEYMAP set to something like "-u pl2",
KEYMAP=${KEYMAP#-* }
# KEYTABLE is a bit special - it defines base keymap name and UNICODE
# determines whether non-UNICODE or UNICODE version is used
if [[ ${KEYTABLE} ]]; then
if [[ ${UNICODE} == 1 ]]; then
[[ ${KEYTABLE} =~ .*\.uni.* ]] || KEYTABLE=${KEYTABLE%.map*}.uni
fi
KEYMAP=${KEYTABLE}
fi
# I'm not sure of the purpose of UNIKEYMAP and GRP_TOGGLE. They were in
# original redhat-i18n module. Anyway it won't hurt.
EXT_KEYMAPS+=\ ${UNIKEYMAP}\ ${GRP_TOGGLE}
[[ ${KEYMAP} ]] || {
dinfo 'No KEYMAP configured.'
return 1
}
findkeymap ${KEYMAP}
for map in ${EXT_KEYMAPS}
do
ddebug "Adding extra map: ${map}"
findkeymap ${map}
done
inst_opt_decompress ${KEYMAPS}
inst_opt_decompress ${kbddir}/consolefonts/${DEFAULT_FONT}.*
if [[ ${FONT} ]] && [[ ${FONT} != ${DEFAULT_FONT} ]]
then
FONT=${FONT%.psf*}
inst_opt_decompress ${kbddir}/consolefonts/${FONT}.*
fi
if [[ ${FONT_MAP} ]]
then
FONT_MAP=${FONT_MAP%.trans}
inst_simple ${kbddir}/consoletrans/${FONT_MAP}.trans
fi
if [[ ${FONT_UNIMAP} ]]
then
FONT_UNIMAP=${FONT_UNIMAP%.uni}
inst_simple ${kbddir}/unimaps/${FONT_UNIMAP}.uni
fi
if dracut_module_included "systemd" && [[ -f ${I18N_CONF} ]]; then
inst_simple ${I18N_CONF}
else
mksubdirs ${initdir}${I18N_CONF}
print_vars LC_ALL LANG >> ${initdir}${I18N_CONF}
fi
if dracut_module_included "systemd" && [[ -f ${VCONFIG_CONF} ]]; then
inst_simple ${VCONFIG_CONF}
else
mksubdirs ${initdir}${VCONFIG_CONF}
print_vars KEYMAP EXT_KEYMAPS UNICODE FONT FONT_MAP FONT_UNIMAP >> ${initdir}${VCONFIG_CONF}
fi
return 0
}
checks() {
for kbddir in ${kbddir} /usr/lib/kbd /lib/kbd /usr/share /usr/share/kbd
do
[[ -d "${kbddir}" ]] && \
for dir in ${KBDSUBDIRS//,/ }
do
[[ -d "${kbddir}/${dir}" ]] && continue
false
done && break
kbddir=''
done
[[ -f $I18N_CONF && -f $VCONFIG_CONF ]] || \
[[ ! ${hostonly} || ${i18n_vars} ]] || {
derror 'i18n_vars not set! Please set up i18n_vars in ' \
'configuration file.'
}
return 0
}
if checks; then
install_base
if [[ ${hostonly} ]] && ! [[ ${i18n_install_all} == "yes" ]]; then
install_local_i18n || install_all_kbd
else
install_all_kbd
fi
fi
}

36
modules.d/10i18n/parse-i18n.sh Executable file
View File

@@ -0,0 +1,36 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
inst_key_val() {
local _value
local _file
local _default
_default=$1
shift
_file=$1
shift
_value=$(getarg $@)
[ -z "${_value}" ] && _value=$_default
if [ -n "${_value}" ]; then
printf '%s="%s"\n' $2 ${_value} >> $_file
fi
unset _file
unset _value
}
inst_key_val '' /etc/vconsole.conf rd.vconsole.keymap vconsole.keymap KEYMAP -d KEYTABLE
inst_key_val '' /etc/vconsole.conf rd.vconsole.font vconsole.font FONT -d SYSFONT
inst_key_val '' /etc/vconsole.conf rd.vconsole.font.map vconsole.font.map FONT_MAP -d CONTRANS
inst_key_val '' /etc/vconsole.conf rd.vconsole.font.unimap vconsole.font.unimap FONT_UNIMAP -d UNIMAP
inst_key_val 1 /etc/vconsole.conf rd.vconsole.font.unicode vconsole.font.unicode UNICODE vconsole.unicode
inst_key_val '' /etc/vconsole.conf rd.vconsole.keymap.ext vconsole.keymap.ext EXT_KEYMAP
inst_key_val '' /etc/locale.conf rd.locale.LANG locale.LANG LANG
inst_key_val '' /etc/locale.conf rd.locale.LC_ALL locale.LC_ALL LC_ALL
if [ -f /etc/locale.conf ]; then
. /etc/locale.conf
export LANG
export LC_ALL
fi

View File

@@ -1,2 +0,0 @@
#!/bin/sh
[ -f /etc/redhat-release ]

View File

@@ -1,63 +0,0 @@
#!/bin/bash
findkeymap () {
local MAP=$1
[[ ! -f $MAP ]] && \
MAP=$(find /lib/kbd/keymaps -type f -name $MAP -o -name $MAP.\* | head -n1)
[[ " $KEYMAPS " = *" $MAP "* ]] && return
KEYMAPS="$KEYMAPS $MAP"
case $MAP in
*.gz) cmd=zgrep;;
*.bz2) cmd=bzgrep;;
*) cmd=grep ;;
esac
for INCL in $($cmd "^include " $MAP | cut -d' ' -f2 | tr -d '"'); do
for FN in $(find /lib/kbd/keymaps -type f -name $INCL\*); do
findkeymap $FN
done
done
}
# FIXME: i18n stuff isn't really distro-independent :/
if [[ -f /etc/sysconfig/keyboard || -f /etc/sysconfig/console/default.kmap ]]; then
if [ -f /etc/sysconfig/console/default.kmap ]; then
KEYMAP=/etc/sysconfig/console/default.kmap
else
. /etc/sysconfig/keyboard
[[ $KEYTABLE && -d /lib/kbd/keymaps ]] && KEYMAP="$KEYTABLE.map"
fi
if [[ $KEYMAP ]]; then
[ -f /etc/sysconfig/keyboard ] && inst /etc/sysconfig/keyboard
inst loadkeys
findkeymap $KEYMAP
for FN in $KEYMAPS; do
inst $FN
case $FN in
*.gz) gzip -d "$initdir$FN" ;;
*.bz2) bzip2 -d "$initdir$FN" ;;
esac
done
fi
fi
if [ -f /etc/sysconfig/i18n ]; then
. /etc/sysconfig/i18n
inst /etc/sysconfig/i18n
[[ $SYSFONT ]] || SYSFONT=latarcyrheb-sun16
inst setfont
for FN in /lib/kbd/consolefonts/$SYSFONT.* ; do
inst "$FN"
case $FN in
*.gz) gzip -d "$initdir$FN" ;;
*.bz2) bzip2 -d "$initdir$FN" ;;
esac
done
[[ $SYSFONTACM ]] && inst /lib/kbd/consoletrans/$SYSFONTACM
[[ $UNIMAP ]] && inst /lib/kbd/unimaps/$UNIMAP
fi
dracut_install /lib/udev/console_*
inst_rules 10-console.rules

View File

@@ -0,0 +1,206 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
ROOT="$1"
if [[ ! -d "$ROOT" ]]; then
echo "Usage: $0 <rootdir>"
exit 1
fi
if [[ "$ROOT" -ef / ]]; then
echo "Can't convert the running system."
echo "Please boot with 'rd.convertfs' on the kernel command line,"
echo "to update with the help of the initramfs,"
echo "or run this script from a rescue system."
exit 1
fi
while [[ "$ROOT" != "${ROOT%/}" ]]; do
ROOT=${ROOT%/}
done
if [ ! -L $ROOT/var/run -a -e $ROOT/var/run ]; then
echo "Converting /var/run to symlink"
mv -f $ROOT/var/run $ROOT/var/run.runmove~
ln -sfn ../run $ROOT/var/run
fi
if [ ! -L $ROOT/var/lock -a -e $ROOT/var/lock ]; then
echo "Converting /var/lock to symlink"
mv -f $ROOT/var/lock $ROOT/var/lock.lockmove~
ln -sfn ../run/lock $ROOT/var/lock
fi
needconvert() {
for dir in "$ROOT/bin" "$ROOT/sbin" "$ROOT/lib" "$ROOT/lib64"; do
if [[ -e "$dir" ]]; then
[[ -L "$dir" ]] || return 0
fi
done
return 1
}
if ! [ -e "$ROOT/usr/bin" ]; then
echo "$ROOT/usr/bin does not exist!"
echo "Make sure, the kernel command line has enough information"
echo "to mount /usr (man dracut.cmdline)"
exit 1
fi
if ! needconvert; then
echo "Your system is already converted."
exit 0
fi
testfile="$ROOT/.usrmovecheck$$"
rm -f -- "$testfile"
> "$testfile"
if [[ ! -e "$testfile" ]]; then
echo "Cannot write to $ROOT/"
exit 1
fi
rm -f -- "$testfile"
testfile="$ROOT/usr/.usrmovecheck$$"
rm -f -- "$testfile"
> "$testfile"
if [[ ! -e "$testfile" ]]; then
echo "Cannot write to $ROOT/usr/"
exit 1
fi
rm -f -- "$testfile"
find_mount() {
local dev mnt etc wanted_dev
wanted_dev="$(readlink -e -q $1)"
while read dev mnt etc; do
[ "$dev" = "$wanted_dev" ] && echo "$dev" && return 0
done < /proc/mounts
return 1
}
# usage: ismounted <mountpoint>
# usage: ismounted /dev/<device>
if command -v findmnt >/dev/null; then
ismounted() {
findmnt "$1" > /dev/null 2>&1
}
else
ismounted() {
if [ -b "$1" ]; then
find_mount "$1" > /dev/null && return 0
return 1
fi
while read a m a; do
[ "$m" = "$1" ] && return 0
done < /proc/mounts
return 1
}
fi
# clean up after ourselves no matter how we die.
cleanup() {
echo "Something failed. Move back to the original state"
for dir in "$ROOT/bin" "$ROOT/sbin" "$ROOT/lib" "$ROOT/lib64" \
"$ROOT/usr/bin" "$ROOT/usr/sbin" "$ROOT/usr/lib" \
"$ROOT/usr/lib64"; do
[[ -d "${dir}.usrmove-new" ]] && rm -fr -- "${dir}.usrmove-new"
if [[ -d "${dir}.usrmove-old" ]]; then
mv "$dir" "${dir}.del~"
mv "${dir}.usrmove-old" "$dir"
rm -fr -- "${dir}.del~"
fi
done
}
trap 'ret=$?; [[ $ret -ne 0 ]] && cleanup;exit $ret;' EXIT
trap 'exit 1;' SIGINT
ismounted "$ROOT/usr" || CP_HARDLINK="-l"
set -e
# merge / and /usr in new dir in /usr
for dir in bin sbin lib lib64; do
rm -rf -- "$ROOT/usr/${dir}.usrmove-new"
[[ -L "$ROOT/$dir" ]] && continue
[[ -d "$ROOT/$dir" ]] || continue
echo "Make a copy of \`$ROOT/usr/$dir'."
[[ -d "$ROOT/usr/$dir" ]] \
&& cp -ax -l "$ROOT/usr/$dir" "$ROOT/usr/${dir}.usrmove-new"
echo "Merge the copy with \`$ROOT/$dir'."
[[ -d "$ROOT/usr/${dir}.usrmove-new" ]] \
|| mkdir -p "$ROOT/usr/${dir}.usrmove-new"
cp -axT $CP_HARDLINK --backup --suffix=.usrmove~ "$ROOT/$dir" "$ROOT/usr/${dir}.usrmove-new"
echo "Clean up duplicates in \`$ROOT/usr/$dir'."
# delete all symlinks that have been backed up
find "$ROOT/usr/${dir}.usrmove-new" -type l -name '*.usrmove~' -delete || :
# replace symlink with backed up binary
find "$ROOT/usr/${dir}.usrmove-new" \
-name '*.usrmove~' \
-type f \
-exec bash -c 'p="{}";o=${p%%%%.usrmove~};
[[ -L "$o" ]] && mv -f "$p" "$o"' ';' || :
done
# switch over merged dirs in /usr
for dir in bin sbin lib lib64; do
[[ -d "$ROOT/usr/${dir}.usrmove-new" ]] || continue
echo "Switch to new \`$ROOT/usr/$dir'."
rm -fr -- "$ROOT/usr/${dir}.usrmove-old"
mv "$ROOT/usr/$dir" "$ROOT/usr/${dir}.usrmove-old"
mv "$ROOT/usr/${dir}.usrmove-new" "$ROOT/usr/$dir"
done
# replace dirs in / with links to /usr
for dir in bin sbin lib lib64; do
[[ -L "$ROOT/$dir" ]] && continue
[[ -d "$ROOT/$dir" ]] || continue
echo "Create \`$ROOT/$dir' symlink."
rm -fr -- "$ROOT/${dir}.usrmove-old" || :
mv "$ROOT/$dir" "$ROOT/${dir}.usrmove-old"
ln -sfn usr/$dir "$ROOT/$dir"
done
echo "Clean up backup files."
# everything seems to work; cleanup
for dir in bin sbin lib lib64; do
# if we get killed in the middle of "rm -rf", ensure not to leave
# an incomplete directory, which is moved back by cleanup()
[[ -d "$ROOT/usr/${dir}.usrmove-old" ]] \
&& mv "$ROOT/usr/${dir}.usrmove-old" "$ROOT/usr/${dir}.usrmove-old~"
[[ -d "$ROOT/${dir}.usrmove-old" ]] \
&& mv "$ROOT/${dir}.usrmove-old" "$ROOT/${dir}.usrmove-old~"
done
for dir in bin sbin lib lib64; do
[[ -d "$ROOT/usr/${dir}.usrmove-old~" ]] \
&& rm -rf -- "$ROOT/usr/${dir}.usrmove-old~" || :
[[ -d "$ROOT/${dir}.usrmove-old~" ]] \
&& rm -rf -- "$ROOT/${dir}.usrmove-old~" || :
done
for dir in lib lib64; do
[[ -d "$ROOT/$dir" ]] || continue
for lib in "$ROOT"/usr/${dir}/lib*.so*.usrmove~; do
[[ -f $lib ]] || continue
mv $lib ${lib/.so/_so}
done
done
set +e
echo "Run ldconfig."
ldconfig -r "$ROOT"
. $ROOT/etc/selinux/config
if [ -n "$(command -v setfiles)" ] && [ "$SELINUX" != "disabled" ] && [ -f /etc/selinux/${SELINUXTYPE}/contexts/files/file_contexts ]; then
echo "Fixing SELinux labels"
setfiles -r $ROOT -p /etc/selinux/${SELINUXTYPE}/contexts/files/file_contexts $ROOT/sbin $ROOT/bin $ROOT/lib $ROOT/lib64 $ROOT/usr/lib $ROOT/usr/lib64 $ROOT/etc/ld.so.cache $ROOT/var/cache/ldconfig || :
fi
echo "Done."
exit 0

View File

@@ -0,0 +1,11 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
if getargbool 0 rd.convertfs; then
if getargbool 0 rd.debug; then
bash -x convertfs "$NEWROOT" 2>&1 | vinfo
else
convertfs "$NEWROOT" 2>&1 | vinfo
fi
fi

View File

@@ -0,0 +1,19 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
check() {
[[ $mount_needs ]] && return 1
return 255
}
depends() {
return 0
}
install() {
inst_multiple bash find ldconfig mv rm cp ln
inst_hook pre-pivot 99 "$moddir/do-convertfs.sh"
inst_script "$moddir/convertfs.sh" /usr/bin/convertfs
}

Some files were not shown because too many files have changed in this diff Show More