removed trailing whitespaces
parent
e2cdb570ae
commit
3b403b32fc
6
HACKING
6
HACKING
|
|
@ -1,11 +1,11 @@
|
||||||
Right now, most of the testing is done using a qemu/kvm guest and
|
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
|
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
|
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
|
dracut exists and will build an image. It is command-line equivalent
|
||||||
to most mkinitrd implementations and should be pretty straight-forward
|
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
|
To use, just run dracut with an output file name and, optionally, a
|
||||||
kernel version (it defaults to using the current). The appropriate
|
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
|
and set
|
||||||
dracutmodules="foo bar baz"
|
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".
|
while kernel modules are called "drivers".
|
||||||
|
|
||||||
Requirements:
|
Requirements:
|
||||||
|
|
|
||||||
64
NEWS
64
NEWS
|
|
@ -67,7 +67,7 @@ dracut-006
|
||||||
- add btrfsctl scan for btrfs multi-devices (raid)
|
- add btrfsctl scan for btrfs multi-devices (raid)
|
||||||
- teach dmsquash live-root to use rootflags
|
- teach dmsquash live-root to use rootflags
|
||||||
- trigger udev with action=add
|
- trigger udev with action=add
|
||||||
- fixed add_drivers handling
|
- fixed add_drivers handling
|
||||||
- add sr_mod
|
- add sr_mod
|
||||||
- use pigz instead of gzip, if available
|
- use pigz instead of gzip, if available
|
||||||
- boot from LVM mirrors and snapshots
|
- boot from LVM mirrors and snapshots
|
||||||
|
|
@ -80,7 +80,7 @@ dracut-006
|
||||||
|
|
||||||
dracut-005
|
dracut-005
|
||||||
==========
|
==========
|
||||||
- dcb support to dracut's FCoE support
|
- dcb support to dracut's FCoE support
|
||||||
- add readonly overlay support for dmsquash
|
- add readonly overlay support for dmsquash
|
||||||
- add keyboard kernel modules
|
- add keyboard kernel modules
|
||||||
- dracut.conf: added add_dracutmodules
|
- dracut.conf: added add_dracutmodules
|
||||||
|
|
@ -118,7 +118,7 @@ dracut-003
|
||||||
- add s390 network support
|
- add s390 network support
|
||||||
- fixed dracut-gencmdline for root=UUID or LABEL
|
- fixed dracut-gencmdline for root=UUID or LABEL
|
||||||
- do not destroy assembled raid arrays if mdadm.conf present
|
- do not destroy assembled raid arrays if mdadm.conf present
|
||||||
- mount /dev/shm
|
- mount /dev/shm
|
||||||
- let udevd not resolve group and user names
|
- let udevd not resolve group and user names
|
||||||
- moved network from udev to initqueue
|
- moved network from udev to initqueue
|
||||||
- improved debug output: specifying "rdinitdebug" now logs
|
- improved debug output: specifying "rdinitdebug" now logs
|
||||||
|
|
@ -126,7 +126,7 @@ dracut-003
|
||||||
- strip kernel modules which have no x bit set
|
- strip kernel modules which have no x bit set
|
||||||
- redirect stdin, stdout, stderr all RW to /dev/console
|
- redirect stdin, stdout, stderr all RW to /dev/console
|
||||||
so the user can use "less" to view /init.log and dmesg
|
so the user can use "less" to view /init.log and dmesg
|
||||||
- add new device mapper udev rules and dmeventd
|
- add new device mapper udev rules and dmeventd
|
||||||
- fixed dracut-gencmdline for root=UUID or LABEL
|
- fixed dracut-gencmdline for root=UUID or LABEL
|
||||||
- do not destroy assembled raid arrays if mdadm.conf present
|
- do not destroy assembled raid arrays if mdadm.conf present
|
||||||
- mount /dev/shm
|
- mount /dev/shm
|
||||||
|
|
@ -171,17 +171,17 @@ dracut-001
|
||||||
Supported cmdline formats:
|
Supported cmdline formats:
|
||||||
fcoe=<networkdevice>:<dcb|nodcb>
|
fcoe=<networkdevice>:<dcb|nodcb>
|
||||||
fcoe=<macaddress>:<dcb|nodcb>
|
fcoe=<macaddress>:<dcb|nodcb>
|
||||||
|
|
||||||
Note currently only nodcb is supported, the dcb option is reserved for
|
Note currently only nodcb is supported, the dcb option is reserved for
|
||||||
future use.
|
future use.
|
||||||
|
|
||||||
Note letters in the macaddress must be lowercase!
|
Note letters in the macaddress must be lowercase!
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
fcoe=eth0:nodcb
|
fcoe=eth0:nodcb
|
||||||
fcoe=4A:3F:4C:04:F8:D7:nodcb
|
fcoe=4A:3F:4C:04:F8:D7:nodcb
|
||||||
|
|
||||||
- Syslog support for dracut
|
- Syslog support for dracut
|
||||||
This module provides syslog functionality in the initrd.
|
This module provides syslog functionality in the initrd.
|
||||||
This is especially interesting when complex configuration being
|
This is especially interesting when complex configuration being
|
||||||
used to provide access to the device the rootfs resides on.
|
used to provide access to the device the rootfs resides on.
|
||||||
|
|
@ -208,20 +208,20 @@ dracut-0.8
|
||||||
dracut-0.7
|
dracut-0.7
|
||||||
==========
|
==========
|
||||||
- dracut: strip binaries in initramfs
|
- dracut: strip binaries in initramfs
|
||||||
|
|
||||||
--strip
|
--strip
|
||||||
strip binaries in the initramfs (default)
|
strip binaries in the initramfs (default)
|
||||||
|
|
||||||
--nostrip
|
--nostrip
|
||||||
do not strip binaries in the initramfs
|
do not strip binaries in the initramfs
|
||||||
- dracut-catimages
|
- dracut-catimages
|
||||||
|
|
||||||
Usage: ./dracut-catimages [OPTION]... <initramfs> <base image>
|
Usage: ./dracut-catimages [OPTION]... <initramfs> <base image>
|
||||||
[<image>...]
|
[<image>...]
|
||||||
Creates initial ramdisk image by concatenating several images from the
|
Creates initial ramdisk image by concatenating several images from the
|
||||||
command
|
command
|
||||||
line and /boot/dracut/
|
line and /boot/dracut/
|
||||||
|
|
||||||
-f, --force Overwrite existing initramfs file.
|
-f, --force Overwrite existing initramfs file.
|
||||||
-i, --imagedir Directory with additional images to add
|
-i, --imagedir Directory with additional images to add
|
||||||
(default: /boot/dracut/)
|
(default: /boot/dracut/)
|
||||||
|
|
@ -238,44 +238,44 @@ dracut-0.7
|
||||||
dracut-0.6
|
dracut-0.6
|
||||||
==========
|
==========
|
||||||
- dracut: add --kernel-only and --no-kernel arguments
|
- dracut: add --kernel-only and --no-kernel arguments
|
||||||
|
|
||||||
--kernel-only
|
--kernel-only
|
||||||
only install kernel drivers and firmware files
|
only install kernel drivers and firmware files
|
||||||
|
|
||||||
--no-kernel
|
--no-kernel
|
||||||
do not install kernel drivers and firmware files
|
do not install kernel drivers and firmware files
|
||||||
|
|
||||||
All kernel module related install commands moved from "install"
|
All kernel module related install commands moved from "install"
|
||||||
to "installkernel".
|
to "installkernel".
|
||||||
|
|
||||||
For "--kernel-only" all installkernel scripts of the specified
|
For "--kernel-only" all installkernel scripts of the specified
|
||||||
modules are used, regardless of any checks, so that all modules
|
modules are used, regardless of any checks, so that all modules
|
||||||
which might be needed by any dracut generic image are in.
|
which might be needed by any dracut generic image are in.
|
||||||
|
|
||||||
The basic idea is to create two images. One image with the kernel
|
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
|
modules and one without. So if the kernel changes, you only have
|
||||||
to replace one image.
|
to replace one image.
|
||||||
|
|
||||||
Grub and the kernel can handle multiple images, so grub entry can
|
Grub and the kernel can handle multiple images, so grub entry can
|
||||||
look like this:
|
look like this:
|
||||||
|
|
||||||
title Fedora (2.6.29.5-191.fc11.i586)
|
title Fedora (2.6.29.5-191.fc11.i586)
|
||||||
root (hd0,0)
|
root (hd0,0)
|
||||||
kernel /vmlinuz-2.6.29.5-191.fc11.i586 ro rhgb quiet
|
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 /initrd-20090722.img /initrd-kernel-2.6.29.5-191.fc11.i586.img /initrd-config.img
|
||||||
|
|
||||||
initrd-20090722.img
|
initrd-20090722.img
|
||||||
the image provided by the initrd rpm
|
the image provided by the initrd rpm
|
||||||
one old backup version is kept like with the kernel
|
one old backup version is kept like with the kernel
|
||||||
|
|
||||||
initrd-kernel-2.6.29.5-191.fc11.i586.img
|
initrd-kernel-2.6.29.5-191.fc11.i586.img
|
||||||
the image provided by the kernel rpm
|
the image provided by the kernel rpm
|
||||||
|
|
||||||
initrd-config.img
|
initrd-config.img
|
||||||
optional image with local configuration files
|
optional image with local configuration files
|
||||||
|
|
||||||
- dracut: add --kmoddir directory, where to look for kernel modules
|
- dracut: add --kmoddir directory, where to look for kernel modules
|
||||||
|
|
||||||
-k, --kmoddir [DIR]
|
-k, --kmoddir [DIR]
|
||||||
specify the directory, where to look for kernel modules
|
specify the directory, where to look for kernel modules
|
||||||
|
|
||||||
|
|
@ -295,18 +295,18 @@ dracut-0.4
|
||||||
- firmware loading support
|
- firmware loading support
|
||||||
- new internal queue (initqueue)
|
- new internal queue (initqueue)
|
||||||
initqueue now loops until /dev/root exists or root is mounted
|
initqueue now loops until /dev/root exists or root is mounted
|
||||||
|
|
||||||
init now has the following points to inject scripts:
|
init now has the following points to inject scripts:
|
||||||
|
|
||||||
/cmdline/*.sh
|
/cmdline/*.sh
|
||||||
scripts for command line parsing
|
scripts for command line parsing
|
||||||
|
|
||||||
/pre-udev/*.sh
|
/pre-udev/*.sh
|
||||||
scripts to run before udev is started
|
scripts to run before udev is started
|
||||||
|
|
||||||
/pre-trigger/*.sh
|
/pre-trigger/*.sh
|
||||||
scripts to run before the main udev trigger is pulled
|
scripts to run before the main udev trigger is pulled
|
||||||
|
|
||||||
/initqueue/*.sh
|
/initqueue/*.sh
|
||||||
runs in parallel to the udev trigger
|
runs in parallel to the udev trigger
|
||||||
Udev events can add scripts here with /sbin/initqueue.
|
Udev events can add scripts here with /sbin/initqueue.
|
||||||
|
|
@ -318,12 +318,12 @@ dracut-0.4
|
||||||
filesystem was mounted, the user will be dropped to a shell after
|
filesystem was mounted, the user will be dropped to a shell after
|
||||||
a timeout.
|
a timeout.
|
||||||
Scripts can remove themselves from the initqueue by "rm $job".
|
Scripts can remove themselves from the initqueue by "rm $job".
|
||||||
|
|
||||||
/pre-mount/*.sh
|
/pre-mount/*.sh
|
||||||
scripts to run before the root filesystem is mounted
|
scripts to run before the root filesystem is mounted
|
||||||
NFS is an exception, because it has no device node to be created
|
NFS is an exception, because it has no device node to be created
|
||||||
and mounts in the udev events
|
and mounts in the udev events
|
||||||
|
|
||||||
/mount/*.sh
|
/mount/*.sh
|
||||||
scripts to mount the root filesystem
|
scripts to mount the root filesystem
|
||||||
NFS is an exception, because it has no device node to be created
|
NFS is an exception, because it has no device node to be created
|
||||||
|
|
@ -331,12 +331,12 @@ dracut-0.4
|
||||||
If the udev queue is empty and no root device is found or no root
|
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
|
filesystem was mounted, the user will be dropped to a shell after
|
||||||
a timeout.
|
a timeout.
|
||||||
|
|
||||||
/pre-pivot/*.sh
|
/pre-pivot/*.sh
|
||||||
scripts to run before the real init is executed and the initramfs
|
scripts to run before the real init is executed and the initramfs
|
||||||
disappears
|
disappears
|
||||||
All processes started before should be killed here.
|
All processes started before should be killed here.
|
||||||
|
|
||||||
The behaviour of the dmraid module demonstrates how to use the new
|
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
|
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
|
udev rule, it installs a job to scan for dmraid devices, if the udev
|
||||||
|
|
|
||||||
16
README
16
README
|
|
@ -2,8 +2,8 @@ Dracut
|
||||||
------
|
------
|
||||||
Dracut is a new initramfs infrastructure.
|
Dracut is a new initramfs infrastructure.
|
||||||
|
|
||||||
Information about the initial goals and aims can be found at
|
Information about the initial goals and aims can be found at
|
||||||
https://fedoraproject.org/wiki/Initrdrewrite
|
https://fedoraproject.org/wiki/Initrdrewrite
|
||||||
|
|
||||||
Unlike existing initramfs's, this is an attempt at having as little as
|
Unlike existing initramfs's, this is an attempt at having as little as
|
||||||
possible hard-coded into the initramfs as possible. The initramfs has
|
possible hard-coded into the initramfs as possible. The initramfs has
|
||||||
|
|
@ -21,8 +21,8 @@ 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 initrd generation functionality in dracut is provided by a bunch
|
||||||
of generator modules that are sourced by the main dracut script to install
|
of generator modules that are sourced by the main dracut script to install
|
||||||
specific functionality into the initrd. They live in the modules.d
|
specific functionality into the initrd. They live in the modules.d
|
||||||
subdirectory, and use functionality provided by dracut-functions to do their
|
subdirectory, and use functionality provided by dracut-functions to do their
|
||||||
work.
|
work.
|
||||||
|
|
||||||
Some general rules for writing modules:
|
Some general rules for writing modules:
|
||||||
|
|
@ -44,7 +44,7 @@ Some general rules for writing modules:
|
||||||
* We have some breakpoints for debugging your hooks. If you pass 'rdbreak'
|
* 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
|
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
|
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
|
Also, there is an attempt to keep things as distribution-agnostic as
|
||||||
possible. Every distribution has their own tool here and it's not
|
possible. Every distribution has their own tool here and it's not
|
||||||
|
|
@ -56,7 +56,7 @@ Currently dracut lives on sourceforge.
|
||||||
Project Page:
|
Project Page:
|
||||||
https://sourceforge.net/projects/dracut/
|
https://sourceforge.net/projects/dracut/
|
||||||
|
|
||||||
Drop Harald Hoyer <harald@redhat.com> a mail, if you want to help with
|
Drop Harald Hoyer <harald@redhat.com> a mail, if you want to help with
|
||||||
the documentation, git access, etc.
|
the documentation, git access, etc.
|
||||||
|
|
||||||
Git Repository:
|
Git Repository:
|
||||||
|
|
@ -64,7 +64,7 @@ http://dracut.git.sourceforge.net/
|
||||||
git://dracut.git.sourceforge.net/gitroot/dracut/dracut
|
git://dracut.git.sourceforge.net/gitroot/dracut/dracut
|
||||||
|
|
||||||
Trac Instance:
|
Trac Instance:
|
||||||
http://apps.sourceforge.net/trac/dracut/
|
http://apps.sourceforge.net/trac/dracut/
|
||||||
|
|
||||||
The git tree can be found at
|
The git tree can be found at
|
||||||
git://dracut.git.sourceforge.net/gitroot/dracut/dracut for now. See the TODO
|
git://dracut.git.sourceforge.net/gitroot/dracut/dracut for now. See the TODO
|
||||||
|
|
@ -72,7 +72,7 @@ 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
|
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
|
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
|
a typical vger list, send mail to majordomo@vger.kernel.org with body
|
||||||
of 'subscribe initramfs email@host.com'
|
of 'subscribe initramfs email@host.com'
|
||||||
|
|
||||||
|
|
||||||
Licensed under the GPLv2
|
Licensed under the GPLv2
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
To build a generic initramfs, you have to install the following software packages:
|
To build a generic initramfs, you have to install the following software packages:
|
||||||
* device-mapper
|
* device-mapper
|
||||||
* cryptsetup-luks
|
* cryptsetup-luks
|
||||||
* rpcbind nfs-utils
|
* rpcbind nfs-utils
|
||||||
* lvm2
|
* lvm2
|
||||||
* iscsi-initiator-utils
|
* iscsi-initiator-utils
|
||||||
* nbd
|
* nbd
|
||||||
|
|
|
||||||
|
|
@ -12,20 +12,20 @@ dracut_install_dir/modules.d/
|
||||||
The numeric code must be present and in the range of 00 - 99.
|
The numeric code must be present and in the range of 00 - 99.
|
||||||
Modules with lower numbers are installed first. This is important
|
Modules with lower numbers are installed first. This is important
|
||||||
because the dracut install functions (which install files onto
|
because the dracut install functions (which install files onto
|
||||||
the initrd) refuse to overwrite already installed files. This makes
|
the initrd) refuse to overwrite already installed files. This makes
|
||||||
it easy for an earlier module to override the functionality of a
|
it easy for an earlier module to override the functionality of a
|
||||||
later module, so that you can have a distro or system specific
|
later module, so that you can have a distro or system specific
|
||||||
module override or modify the functionality of a generic module
|
module override or modify the functionality of a generic module
|
||||||
without having to patch the more generic module.
|
without having to patch the more generic module.
|
||||||
|
|
||||||
module-setup.sh:
|
module-setup.sh:
|
||||||
dracut sources this script to install the functionality that a
|
dracut sources this script to install the functionality that a
|
||||||
module implements onto the initrd. For the most part, this amounts
|
module implements onto the initrd. For the most part, this amounts
|
||||||
to copying files from the host system onto the initrd in a controlled
|
to copying files from the host system onto the initrd in a controlled
|
||||||
manner.
|
manner.
|
||||||
|
|
||||||
install():
|
install():
|
||||||
This function of module-setup.sh is called to install all
|
This function of module-setup.sh is called to install all
|
||||||
non-kernel files. dracut supplies several install functions that are
|
non-kernel files. dracut supplies several install functions that are
|
||||||
specialized for different file types. Browse through dracut-functions
|
specialized for different file types. Browse through dracut-functions
|
||||||
fore more details. dracut also provides a $moddir variable if you
|
fore more details. dracut also provides a $moddir variable if you
|
||||||
|
|
@ -33,21 +33,21 @@ install():
|
||||||
hook, a udev rule, or a specialized executable.
|
hook, a udev rule, or a specialized executable.
|
||||||
|
|
||||||
installkernel():
|
installkernel():
|
||||||
This function of module-setup.sh is called to install all
|
This function of module-setup.sh is called to install all
|
||||||
kernel related files.
|
kernel related files.
|
||||||
|
|
||||||
|
|
||||||
check():
|
check():
|
||||||
Dracut calls this function to check and see if a module can be installed
|
Dracut calls this function to check and see if a module can be installed
|
||||||
on the initrd.
|
on the initrd.
|
||||||
|
|
||||||
When called without options, check should check to make sure that
|
When called without options, check should check to make sure that
|
||||||
any files it needs to install into the initrd from the host system
|
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
|
are present. It should exit with a 0 if they are, and a 1 if they are
|
||||||
not.
|
not.
|
||||||
|
|
||||||
When called with $hostonly set, it should perform the same check
|
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
|
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.
|
functionality the module implements is being used on the host system.
|
||||||
For example, if this module handles installing support for LUKS
|
For example, if this module handles installing support for LUKS
|
||||||
encrypted volumes, it should return 0 if all the tools to handle
|
encrypted volumes, it should return 0 if all the tools to handle
|
||||||
|
|
@ -60,7 +60,7 @@ depends():
|
||||||
which rely on the network module to detect and configure network
|
which rely on the network module to detect and configure network
|
||||||
interfaces.
|
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.
|
You are encouraged to provide a README that describes what the module is for.
|
||||||
|
|
||||||
|
|
@ -84,7 +84,7 @@ init has the following hook points to inject scripts:
|
||||||
Udev events can add scripts here with /sbin/initqueue.
|
Udev events can add scripts here with /sbin/initqueue.
|
||||||
If /sbin/initqueue is called with the "--onetime" option, the script
|
If /sbin/initqueue is called with the "--onetime" option, the script
|
||||||
will be removed after it was run.
|
will be removed after it was run.
|
||||||
If /lib/dracut/hooks/initqueue/work is created and udev >= 143 then
|
If /lib/dracut/hooks/initqueue/work is created and udev >= 143 then
|
||||||
this loop can process the jobs in parallel to the udevtrigger.
|
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
|
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
|
filesystem was mounted, the user will be dropped to a shell after
|
||||||
|
|
@ -93,7 +93,7 @@ init has the following hook points to inject scripts:
|
||||||
|
|
||||||
/lib/dracut/hooks/pre-mount/*.sh
|
/lib/dracut/hooks/pre-mount/*.sh
|
||||||
scripts to run before the root filesystem is mounted
|
scripts to run before the root filesystem is mounted
|
||||||
Network filesystems like NFS that do not use device files are an
|
Network filesystems like NFS that do not use device files are an
|
||||||
exception. Root can be mounted already at this point.
|
exception. Root can be mounted already at this point.
|
||||||
|
|
||||||
/lib/dracut/hooks/mount/*.sh
|
/lib/dracut/hooks/mount/*.sh
|
||||||
|
|
|
||||||
50
dracut
50
dracut
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||||
#
|
#
|
||||||
# Generator script for a dracut initramfs
|
# Generator script for a dracut initramfs
|
||||||
# Tries to retain some degree of compatibility with the command line
|
# Tries to retain some degree of compatibility with the command line
|
||||||
# of the various mkinitrd implementations out there
|
# of the various mkinitrd implementations out there
|
||||||
|
|
@ -40,14 +40,14 @@ Creates initial ramdisk images for preloading modules
|
||||||
-a, --add [LIST] Add 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
|
-d, --drivers [LIST] Specify a space-separated list of kernel modules to
|
||||||
exclusively include in the initramfs.
|
exclusively include in the initramfs.
|
||||||
--add-drivers [LIST] Specify a space-separated list of kernel
|
--add-drivers [LIST] Specify a space-separated list of kernel
|
||||||
modules to add to the initramfs.
|
modules to add to the initramfs.
|
||||||
--filesystems [LIST] Specify a space-separated list of kernel filesystem
|
--filesystems [LIST] Specify a space-separated list of kernel filesystem
|
||||||
modules to exclusively include in the generic
|
modules to exclusively include in the generic
|
||||||
initramfs.
|
initramfs.
|
||||||
-k, --kmoddir [DIR] Specify the directory, where to look for kernel
|
-k, --kmoddir [DIR] Specify the directory, where to look for kernel
|
||||||
modules
|
modules
|
||||||
--fwdir [DIR] Specify additional directories, where to look for
|
--fwdir [DIR] Specify additional directories, where to look for
|
||||||
firmwares, separated by :
|
firmwares, separated by :
|
||||||
--kernel-only Only install kernel drivers and firmware files
|
--kernel-only Only install kernel drivers and firmware files
|
||||||
--no-kernel Do not install kernel drivers and firmware files
|
--no-kernel Do not install kernel drivers and firmware files
|
||||||
|
|
@ -73,7 +73,7 @@ Creates initial ramdisk images for preloading modules
|
||||||
-q, --quiet Decrease verbosity level (default is info(4))
|
-q, --quiet Decrease verbosity level (default is info(4))
|
||||||
-c, --conf [FILE] Specify configuration file to use.
|
-c, --conf [FILE] Specify configuration file to use.
|
||||||
Default: /etc/dracut.conf
|
Default: /etc/dracut.conf
|
||||||
--confdir [DIR] Specify configuration directory to use *.conf files
|
--confdir [DIR] Specify configuration directory to use *.conf files
|
||||||
from. Default: /etc/dracut.conf.d
|
from. Default: /etc/dracut.conf.d
|
||||||
-l, --local Local mode. Use modules from the current working
|
-l, --local Local mode. Use modules from the current working
|
||||||
directory instead of the system-wide installed in
|
directory instead of the system-wide installed in
|
||||||
|
|
@ -85,7 +85,7 @@ Creates initial ramdisk images for preloading modules
|
||||||
-i, --include [SOURCE] [TARGET]
|
-i, --include [SOURCE] [TARGET]
|
||||||
Include the files in the SOURCE directory into the
|
Include the files in the SOURCE directory into the
|
||||||
Target directory in the final initramfs.
|
Target directory in the final initramfs.
|
||||||
If SOURCE is a file, it will be installed to TARGET
|
If SOURCE is a file, it will be installed to TARGET
|
||||||
in the final initramfs.
|
in the final initramfs.
|
||||||
-I, --install [LIST] Install the space separated list of files into the
|
-I, --install [LIST] Install the space separated list of files into the
|
||||||
initramfs.
|
initramfs.
|
||||||
|
|
@ -96,14 +96,14 @@ Creates initial ramdisk images for preloading modules
|
||||||
Make sure your kernel has bzip2 decompression support
|
Make sure your kernel has bzip2 decompression support
|
||||||
compiled in, otherwise you will not be able to boot.
|
compiled in, otherwise you will not be able to boot.
|
||||||
--lzma Compress the generated initramfs using lzma.
|
--lzma Compress the generated initramfs using lzma.
|
||||||
Make sure your kernel has lzma support compiled in,
|
Make sure your kernel has lzma support compiled in,
|
||||||
otherwise you will not be able to boot.
|
otherwise you will not be able to boot.
|
||||||
--xz Compress the generated initramfs using xz.
|
--xz Compress the generated initramfs using xz.
|
||||||
Make sure that your kernel has xz support compiled
|
Make sure that your kernel has xz support compiled
|
||||||
in, otherwise you will not be able to boot.
|
in, otherwise you will not be able to boot.
|
||||||
--compress [COMPRESSION] Compress the generated initramfs with the
|
--compress [COMPRESSION] Compress the generated initramfs with the
|
||||||
passed compression program. Make sure your kernel
|
passed compression program. Make sure your kernel
|
||||||
knows how to decompress the generated initramfs,
|
knows how to decompress the generated initramfs,
|
||||||
otherwise you will not be able to boot.
|
otherwise you will not be able to boot.
|
||||||
--no-compress Do not compress the generated initramfs. This will
|
--no-compress Do not compress the generated initramfs. This will
|
||||||
override any other compression options.
|
override any other compression options.
|
||||||
|
|
@ -137,7 +137,7 @@ push() {
|
||||||
# val=$(pop stack)
|
# val=$(pop stack)
|
||||||
pop() {
|
pop() {
|
||||||
local __stack=$1; shift
|
local __stack=$1; shift
|
||||||
local __resultvar=$1
|
local __resultvar=$1
|
||||||
local myresult;
|
local myresult;
|
||||||
# check for empty stack
|
# check for empty stack
|
||||||
eval '[[ ${#'${__stack}'[@]} -eq 0 ]] && return 1'
|
eval '[[ ${#'${__stack}'[@]} -eq 0 ]] && return 1'
|
||||||
|
|
@ -241,7 +241,7 @@ while (($# > 0)); do
|
||||||
show_modules_l="yes"
|
show_modules_l="yes"
|
||||||
;;
|
;;
|
||||||
-*) printf "\nUnknown option: %s\n\n" "$1" >&2; usage; exit 1;;
|
-*) printf "\nUnknown option: %s\n\n" "$1" >&2; usage; exit 1;;
|
||||||
*)
|
*)
|
||||||
if ! [[ ${outfile+x} ]]; then
|
if ! [[ ${outfile+x} ]]; then
|
||||||
outfile=$1
|
outfile=$1
|
||||||
elif ! [[ ${kernel+x} ]]; then
|
elif ! [[ ${kernel+x} ]]; then
|
||||||
|
|
@ -261,7 +261,7 @@ fi
|
||||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||||
export PATH
|
export PATH
|
||||||
|
|
||||||
[[ $debug ]] && {
|
[[ $debug ]] && {
|
||||||
export PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): ';
|
export PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): ';
|
||||||
set -x
|
set -x
|
||||||
}
|
}
|
||||||
|
|
@ -269,7 +269,7 @@ export PATH
|
||||||
[[ $dracutbasedir ]] || dracutbasedir=/usr/share/dracut
|
[[ $dracutbasedir ]] || dracutbasedir=/usr/share/dracut
|
||||||
|
|
||||||
[[ $allowlocal && -f "$(readlink -f ${0%/*})/dracut-functions" ]] && \
|
[[ $allowlocal && -f "$(readlink -f ${0%/*})/dracut-functions" ]] && \
|
||||||
dracutbasedir="$(readlink -f ${0%/*})"
|
dracutbasedir="$(readlink -f ${0%/*})"
|
||||||
|
|
||||||
# if we were not passed a config file, try the default one
|
# if we were not passed a config file, try the default one
|
||||||
if [[ ! -f $conffile ]]; then
|
if [[ ! -f $conffile ]]; then
|
||||||
|
|
@ -287,7 +287,7 @@ fi
|
||||||
|
|
||||||
# source our config dir
|
# source our config dir
|
||||||
if [[ $confdir && -d $confdir ]]; then
|
if [[ $confdir && -d $confdir ]]; then
|
||||||
for f in "$confdir"/*.conf; do
|
for f in "$confdir"/*.conf; do
|
||||||
[[ -e $f ]] && . "$f"
|
[[ -e $f ]] && . "$f"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
@ -455,9 +455,9 @@ fi
|
||||||
readonly initdir=$(mktemp --tmpdir=/var/tmp/ -d -t initramfs.XXXXXX)
|
readonly initdir=$(mktemp --tmpdir=/var/tmp/ -d -t initramfs.XXXXXX)
|
||||||
|
|
||||||
# clean up after ourselves no matter how we die.
|
# clean up after ourselves no matter how we die.
|
||||||
trap 'ret=$?;rm -rf "$initdir";exit $ret;' EXIT
|
trap 'ret=$?;rm -rf "$initdir";exit $ret;' EXIT
|
||||||
# clean up after ourselves no matter how we die.
|
# clean up after ourselves no matter how we die.
|
||||||
trap 'exit 1;' SIGINT
|
trap 'exit 1;' SIGINT
|
||||||
|
|
||||||
# Need to be able to have non-root users read stuff (rpcbind etc)
|
# Need to be able to have non-root users read stuff (rpcbind etc)
|
||||||
chmod 755 "$initdir"
|
chmod 755 "$initdir"
|
||||||
|
|
@ -476,14 +476,14 @@ mkdir -m 0755 -p "${initdir}${prefix}/lib"
|
||||||
[[ $prefix ]] && ln -sfn "${prefix#/}/lib" "$initdir/lib"
|
[[ $prefix ]] && ln -sfn "${prefix#/}/lib" "$initdir/lib"
|
||||||
|
|
||||||
if [[ $kernel_only != yes ]]; then
|
if [[ $kernel_only != yes ]]; then
|
||||||
for d in bin etc lib "$libdir" sbin tmp usr var; do
|
for d in bin etc lib "$libdir" sbin tmp usr var; do
|
||||||
[[ -e "${initdir}${prefix}/$d" ]] && continue
|
[[ -e "${initdir}${prefix}/$d" ]] && continue
|
||||||
mkdir -m 0755 -p "${initdir}${prefix}/$d"
|
mkdir -m 0755 -p "${initdir}${prefix}/$d"
|
||||||
[[ $prefix ]] && ln -sfn "${prefix#/}/${d#/}" "$initdir/$d"
|
[[ $prefix ]] && ln -sfn "${prefix#/}/${d#/}" "$initdir/$d"
|
||||||
done
|
done
|
||||||
|
|
||||||
for d in proc sys sysroot root run run/lock run/initramfs; do
|
for d in proc sys sysroot root run run/lock run/initramfs; do
|
||||||
mkdir -m 0755 -p "$initdir/$d";
|
mkdir -m 0755 -p "$initdir/$d";
|
||||||
done
|
done
|
||||||
|
|
||||||
ln -sfn /run "$initdir/var/run"
|
ln -sfn /run "$initdir/var/run"
|
||||||
|
|
@ -529,7 +529,7 @@ while pop include_src src && pop include_target tgt; do
|
||||||
if [[ -f $src ]]; then
|
if [[ -f $src ]]; then
|
||||||
inst $src $tgt
|
inst $src $tgt
|
||||||
else
|
else
|
||||||
ddebug "Including directory: $src"
|
ddebug "Including directory: $src"
|
||||||
mkdir -p "${initdir}/${tgt}"
|
mkdir -p "${initdir}/${tgt}"
|
||||||
# check for preexisting symlinks, so we can cope with the
|
# check for preexisting symlinks, so we can cope with the
|
||||||
# symlinks to $prefix
|
# symlinks to $prefix
|
||||||
|
|
@ -544,7 +544,7 @@ while pop include_src src && pop include_target tgt; do
|
||||||
cp -a -t "$s" "$i"/*
|
cp -a -t "$s" "$i"/*
|
||||||
else
|
else
|
||||||
cp -a -t "$s" "$i"
|
cp -a -t "$s" "$i"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
@ -577,9 +577,9 @@ if (($maxloglvl >= 5)); then
|
||||||
du -c "$initdir" | sort -n | ddebug
|
du -c "$initdir" | sort -n | ddebug
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# strip binaries
|
# strip binaries
|
||||||
if [[ $do_strip = yes ]] ; then
|
if [[ $do_strip = yes ]] ; then
|
||||||
for p in strip grep find; do
|
for p in strip grep find; do
|
||||||
if ! type -P $p >/dev/null; then
|
if ! type -P $p >/dev/null; then
|
||||||
derror "Could not find '$p'. You should run $0 with '--nostrip'."
|
derror "Could not find '$p'. You should run $0 with '--nostrip'."
|
||||||
do_strip=no
|
do_strip=no
|
||||||
|
|
@ -610,10 +610,10 @@ if strstr "$modules_loaded" " fips " && command -v prelink >/dev/null; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! ( cd "$initdir"; find . |cpio -R 0:0 -H newc -o --quiet | \
|
if ! ( cd "$initdir"; find . |cpio -R 0:0 -H newc -o --quiet | \
|
||||||
$compress > "$outfile"; ); then
|
$compress > "$outfile"; ); then
|
||||||
dfatal "dracut: creation of $outfile failed"
|
dfatal "dracut: creation of $outfile failed"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dinfo "Wrote $outfile:"
|
dinfo "Wrote $outfile:"
|
||||||
dinfo "$(ls -l "$outfile")"
|
dinfo "$(ls -l "$outfile")"
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ Creates initial ramdisk image by concatenating several images from the command
|
||||||
line and /boot/dracut/
|
line and /boot/dracut/
|
||||||
|
|
||||||
-f, --force Overwrite existing initramfs file.
|
-f, --force Overwrite existing initramfs file.
|
||||||
-i, --imagedir Directory with additional images to add
|
-i, --imagedir Directory with additional images to add
|
||||||
(default: /boot/dracut/)
|
(default: /boot/dracut/)
|
||||||
-o, --overlaydir Overlay directory, which contains files that
|
-o, --overlaydir Overlay directory, which contains files that
|
||||||
will be used to create an additional image
|
will be used to create an additional image
|
||||||
|
|
@ -120,7 +120,7 @@ images+=($@)
|
||||||
dinfo "Using base image $baseimage"
|
dinfo "Using base image $baseimage"
|
||||||
cat "$baseimage" > "$outfile"
|
cat "$baseimage" > "$outfile"
|
||||||
|
|
||||||
for i in "${images[@]}"; do
|
for i in "${images[@]}"; do
|
||||||
dinfo "Appending $i"
|
dinfo "Appending $i"
|
||||||
cat "$i" >> "$outfile"
|
cat "$i" >> "$outfile"
|
||||||
done
|
done
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ line and /boot/dracut/*.img</para>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><option>-h</option>, <option>--help</option></term>
|
<term><option>-h</option>, <option>--help</option></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>display help text and exit.</para>
|
<para>display help text and exit.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
|
|
||||||
|
|
@ -253,7 +253,7 @@ inst_simple() {
|
||||||
if [[ -e "${src%/*}/.${src##*/}.hmac" ]]; then
|
if [[ -e "${src%/*}/.${src##*/}.hmac" ]]; then
|
||||||
inst "${src%/*}/.${src##*/}.hmac" "${target%/*}/.${target##*/}.hmac"
|
inst "${src%/*}/.${src##*/}.hmac" "${target%/*}/.${target##*/}.hmac"
|
||||||
fi
|
fi
|
||||||
ddebug "Installing $src"
|
ddebug "Installing $src"
|
||||||
cp -pfL "$src" "${initdir}$target"
|
cp -pfL "$src" "${initdir}$target"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -409,17 +409,17 @@ inst_rules() {
|
||||||
|
|
||||||
inst_dir "/lib/udev/rules.d"
|
inst_dir "/lib/udev/rules.d"
|
||||||
inst_dir "$target"
|
inst_dir "$target"
|
||||||
for rule in "$@"; do
|
for rule in "$@"; do
|
||||||
for r in /lib/udev/rules.d /etc/udev/rules.d; do
|
for r in /lib/udev/rules.d /etc/udev/rules.d; do
|
||||||
if [[ -f $r/$rule ]]; then
|
if [[ -f $r/$rule ]]; then
|
||||||
found="$r/$rule"
|
found="$r/$rule"
|
||||||
inst_simple "$found"
|
inst_simple "$found"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
for r in '' ./ $dracutbasedir/rules.d/; do
|
for r in '' ./ $dracutbasedir/rules.d/; do
|
||||||
if [[ -f ${r}$rule ]]; then
|
if [[ -f ${r}$rule ]]; then
|
||||||
found="${r}$rule"
|
found="${r}$rule"
|
||||||
inst_simple "$found" "$target/${found##*/}"
|
inst_simple "$found" "$target/${found##*/}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
[[ $found ]] || dinfo "Skipping udev rule: $rule"
|
[[ $found ]] || dinfo "Skipping udev rule: $rule"
|
||||||
|
|
@ -459,7 +459,7 @@ inst_hook() {
|
||||||
dfatal "Aborting initrd creation."
|
dfatal "Aborting initrd creation."
|
||||||
exit 1
|
exit 1
|
||||||
elif ! strstr "$hookdirs" "$1"; then
|
elif ! strstr "$hookdirs" "$1"; then
|
||||||
dfatal "No such hook type $1. Aborting initrd creation."
|
dfatal "No such hook type $1. Aborting initrd creation."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
inst_simple "$3" "/lib/dracut/hooks/${1}/${2}${3##*/}"
|
inst_simple "$3" "/lib/dracut/hooks/${1}/${2}${3##*/}"
|
||||||
|
|
|
||||||
|
|
@ -168,7 +168,7 @@ resolve_device_name() {
|
||||||
real=$(freadlink /dev/disk/by-label/${1##LABEL=})
|
real=$(freadlink /dev/disk/by-label/${1##LABEL=})
|
||||||
[ -b $real ] && { echo $real; return; }
|
[ -b $real ] && { echo $real; return; }
|
||||||
fi
|
fi
|
||||||
echo "$1"
|
echo "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
finddevnoinsys() {
|
finddevnoinsys() {
|
||||||
|
|
@ -308,7 +308,7 @@ iscsi_set_parameters() {
|
||||||
chap=${result}
|
chap=${result}
|
||||||
if [ -n "${chap}" -a "${chap}" != "<empty>" ]; then
|
if [ -n "${chap}" -a "${chap}" != "<empty>" ]; then
|
||||||
chap="-u ${chap}"
|
chap="-u ${chap}"
|
||||||
iscsi_get_rec_val $tmpfile "node.session.auth.password"
|
iscsi_get_rec_val $tmpfile "node.session.auth.password"
|
||||||
chap_pw="-w ${result}"
|
chap_pw="-w ${result}"
|
||||||
else
|
else
|
||||||
chap=""
|
chap=""
|
||||||
|
|
@ -318,7 +318,7 @@ iscsi_set_parameters() {
|
||||||
chap_in=${result}
|
chap_in=${result}
|
||||||
if [ -n "${chap_in}" -a "${chap_in}" != "<empty>" ]; then
|
if [ -n "${chap_in}" -a "${chap_in}" != "<empty>" ]; then
|
||||||
chap_in="-U ${chap_in}"
|
chap_in="-U ${chap_in}"
|
||||||
iscsi_get_rec_val $tmpfile "node.session.auth.password_in"
|
iscsi_get_rec_val $tmpfile "node.session.auth.password_in"
|
||||||
chap_in_pw="-W ${result}"
|
chap_in_pw="-W ${result}"
|
||||||
else
|
else
|
||||||
chap_in=""
|
chap_in=""
|
||||||
|
|
@ -343,7 +343,7 @@ is_iscsi() {
|
||||||
path=$1
|
path=$1
|
||||||
if echo $path | grep -q "/platform/host[0-9]*/session[0-9]*/target[0-9]*:[0-9]*:[0-9]*/[0-9]*:[0-9]*:[0-9]*:[0-9]*"; then
|
if echo $path | grep -q "/platform/host[0-9]*/session[0-9]*/target[0-9]*:[0-9]*:[0-9]*/[0-9]*:[0-9]*:[0-9]*:[0-9]*"; then
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
@ -399,7 +399,7 @@ handledm() {
|
||||||
EOF
|
EOF
|
||||||
local name=$(dmsetup info --noheadings -c -j $major -m $minor -o name)
|
local name=$(dmsetup info --noheadings -c -j $major -m $minor -o name)
|
||||||
local vg=$(lvshow "/dev/mapper/$name")
|
local vg=$(lvshow "/dev/mapper/$name")
|
||||||
local raids=$(/sbin/dmraid -s -craidname 2>/dev/null | grep -vi "no raid disks")
|
local raids=$(/sbin/dmraid -s -craidname 2>/dev/null | grep -vi "no raid disks")
|
||||||
if [ -n "$vg" ]; then
|
if [ -n "$vg" ]; then
|
||||||
vg=`echo $vg` # strip whitespace
|
vg=`echo $vg` # strip whitespace
|
||||||
case " $vg_list " in
|
case " $vg_list " in
|
||||||
|
|
@ -630,7 +630,7 @@ fi
|
||||||
|
|
||||||
cemit()
|
cemit()
|
||||||
{
|
{
|
||||||
cat
|
cat
|
||||||
}
|
}
|
||||||
|
|
||||||
emit()
|
emit()
|
||||||
|
|
@ -640,7 +640,7 @@ emit()
|
||||||
NONL="-n"
|
NONL="-n"
|
||||||
shift
|
shift
|
||||||
fi
|
fi
|
||||||
echo $NONL "$@"
|
echo $NONL "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
emitdmraids()
|
emitdmraids()
|
||||||
|
|
@ -678,8 +678,8 @@ else
|
||||||
echo -n "rd_NO_MD "
|
echo -n "rd_NO_MD "
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$nolvm" -a -n "$vg_list" ]; then
|
if [ -z "$nolvm" -a -n "$vg_list" ]; then
|
||||||
for vg in $vg_list; do
|
for vg in $vg_list; do
|
||||||
echo -n "rd_LVM_VG=$vg "
|
echo -n "rd_LVM_VG=$vg "
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
<!-- body begins here -->
|
<!-- body begins here -->
|
||||||
<refsynopsisdiv id='synopsis'>
|
<refsynopsisdiv id='synopsis'>
|
||||||
<cmdsynopsis>
|
<cmdsynopsis>
|
||||||
<command>dracut-gencmdline</command>
|
<command>dracut-gencmdline</command>
|
||||||
<sbr/>
|
<sbr/>
|
||||||
</cmdsynopsis>
|
</cmdsynopsis>
|
||||||
</refsynopsisdiv>
|
</refsynopsisdiv>
|
||||||
|
|
|
||||||
18
dracut.8.xml
18
dracut.8.xml
|
|
@ -108,9 +108,9 @@ For a complete list of kernel command line options see
|
||||||
<option>--modules <replaceable><list of dracut modules></replaceable></option>
|
<option>--modules <replaceable><list of dracut modules></replaceable></option>
|
||||||
</term>
|
</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>specify a space-separated list of dracut modules to call
|
<para>specify a space-separated list of dracut modules to call
|
||||||
when building the initramfs.
|
when building the initramfs.
|
||||||
Modules are located in
|
Modules are located in
|
||||||
<filename>/usr/share/dracut/modules.d</filename>. This parameter can be specified multiple times.</para>
|
<filename>/usr/share/dracut/modules.d</filename>. This parameter can be specified multiple times.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
@ -163,7 +163,7 @@ The kernel modules have to be specified without the ".ko" suffix. This
|
||||||
<option>--filesystems <replaceable><list of filesystems></replaceable></option>
|
<option>--filesystems <replaceable><list of filesystems></replaceable></option>
|
||||||
</term>
|
</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>specify a space-separated list of kernel filesystem modules to exclusively
|
<para>specify a space-separated list of kernel filesystem modules to exclusively
|
||||||
include in the generic initramfs. This parameter can be specified multiple times.</para>
|
include in the generic initramfs. This parameter can be specified multiple times.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
@ -300,7 +300,7 @@ include in the generic initramfs. This parameter can be specified multiple times
|
||||||
</term>
|
</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>specify configuration file to use.
|
<para>specify configuration file to use.
|
||||||
Default:
|
Default:
|
||||||
<filename>/etc/dracut.conf</filename></para>
|
<filename>/etc/dracut.conf</filename></para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
@ -310,7 +310,7 @@ Default:
|
||||||
</term>
|
</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>specify configuration directory to use.
|
<para>specify configuration directory to use.
|
||||||
Default:
|
Default:
|
||||||
<filename>/etc/dracut.conf.d</filename></para>
|
<filename>/etc/dracut.conf.d</filename></para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
@ -336,8 +336,8 @@ This is useful when running dracut from a git checkout.</para>
|
||||||
<option>--hostonly</option>
|
<option>--hostonly</option>
|
||||||
</term>
|
</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Host-Only mode: Install only what is needed for booting
|
<para>Host-Only mode: Install only what is needed for booting
|
||||||
the local host instead of a generic host.
|
the local host instead of a generic host.
|
||||||
<warning>
|
<warning>
|
||||||
<para>If chrooted to another root other than the real root device, use "--fstab" and provide a valid <filename>/etc/fstab</filename>.</para>
|
<para>If chrooted to another root other than the real root device, use "--fstab" and provide a valid <filename>/etc/fstab</filename>.</para>
|
||||||
</warning></para>
|
</warning></para>
|
||||||
|
|
@ -505,7 +505,7 @@ TARGET directory in the final initramfs. If SOURCE is a file, it will be install
|
||||||
</term>
|
</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Any files found in <filename>/etc/conf.d/</filename> will be sourced in the initramfs to
|
<para>Any files found in <filename>/etc/conf.d/</filename> will be sourced in the initramfs to
|
||||||
set initial values. Command line options will override these values
|
set initial values. Command line options will override these values
|
||||||
set in the configuration files.</para>
|
set in the configuration files.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ The kernel modules have to be specified without the ".ko" suffix.</par
|
||||||
<envar>add_drivers+=" <replaceable><kernel modules></replaceable> "</envar>
|
<envar>add_drivers+=" <replaceable><kernel modules></replaceable> "</envar>
|
||||||
</term>
|
</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Specify a space-separated list of kernel
|
<para>Specify a space-separated list of kernel
|
||||||
modules to add to the initramfs.
|
modules to add to the initramfs.
|
||||||
The kernel modules have to be specified without the ".ko" suffix.</para>
|
The kernel modules have to be specified without the ".ko" suffix.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
@ -123,7 +123,7 @@ initramfs.</para>
|
||||||
<envar>hostonly="<replaceable>{yes|no}</replaceable>"</envar>
|
<envar>hostonly="<replaceable>{yes|no}</replaceable>"</envar>
|
||||||
</term>
|
</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Host-Only mode: Install only what is needed for booting
|
<para>Host-Only mode: Install only what is needed for booting
|
||||||
the local host instead of a generic host.
|
the local host instead of a generic host.
|
||||||
<warning><para>If chrooted to another root other than the real root device, use <option>--fstab</option> and provide a valid <filename>/etc/fstab</filename>.</para>
|
<warning><para>If chrooted to another root other than the real root device, use <option>--fstab</option> and provide a valid <filename>/etc/fstab</filename>.</para>
|
||||||
</warning>
|
</warning>
|
||||||
|
|
|
||||||
|
|
@ -25,11 +25,11 @@
|
||||||
<refsect1>
|
<refsect1>
|
||||||
<title>Description</title>
|
<title>Description</title>
|
||||||
<para>The root filesystem used by the kernel is specified in the boot configuration
|
<para>The root filesystem used by the kernel is specified in the boot configuration
|
||||||
file, as always. The traditional <emphasis remap="B">root=/dev/hda1</emphasis> style device
|
file, as always. The traditional <emphasis remap="B">root=/dev/hda1</emphasis> style device
|
||||||
specification is allowed. If a label is used, as in <emphasis remap="B">root=LABEL=rootPart</emphasis>
|
specification is allowed. If a label is used, as in <emphasis remap="B">root=LABEL=rootPart</emphasis>
|
||||||
the initramfs will search all available devices for an ext2 or ext3 filesystem
|
the initramfs will search all available devices for an ext2 or ext3 filesystem
|
||||||
with the appropriate label, and mount that device as the root filesystem.
|
with the appropriate label, and mount that device as the root filesystem.
|
||||||
<emphasis remap="B">root=UUID=uuidnumber</emphasis> will mount the partition with that UUID as the
|
<emphasis remap="B">root=UUID=uuidnumber</emphasis> will mount the partition with that UUID as the
|
||||||
root filesystem.</para>
|
root filesystem.</para>
|
||||||
<refsect2>
|
<refsect2>
|
||||||
<title>Standard</title>
|
<title>Standard</title>
|
||||||
|
|
@ -47,7 +47,7 @@ root filesystem.</para>
|
||||||
<envar>root=<replaceable><path to blockdevice></replaceable></envar>
|
<envar>root=<replaceable><path to blockdevice></replaceable></envar>
|
||||||
</term>
|
</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>specify blockdevice to use as root filesystem.
|
<para>specify blockdevice to use as root filesystem.
|
||||||
e.g.: <programlisting>root=/dev/sda1
|
e.g.: <programlisting>root=/dev/sda1
|
||||||
root=/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1 </programlisting></para>
|
root=/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1 </programlisting></para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
@ -66,14 +66,14 @@ root=/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1 </programlisting>
|
||||||
</term>
|
</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>specify additional mount options for the root filesystem. If not set, <filename>/etc/fstab</filename>
|
<para>specify additional mount options for the root filesystem. If not set, <filename>/etc/fstab</filename>
|
||||||
of the real root will be parsed for special mount options and mounted
|
of the real root will be parsed for special mount options and mounted
|
||||||
accordingly.</para>
|
accordingly.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><envar>rd.fstab</envar>=0</term>
|
<term><envar>rd.fstab</envar>=0</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>do not honor special mount options for the root filesystem found in
|
<para>do not honor special mount options for the root filesystem found in
|
||||||
<filename>/etc/fstab</filename> of the real root.</para>
|
<filename>/etc/fstab</filename> of the real root.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
@ -294,7 +294,7 @@ This parameter can be specified multiple times.</para>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>only activate the LUKS partitions with the given UUID
|
<para>only activate the LUKS partitions with the given UUID
|
||||||
Any "luks-" of the LUKS UUID is removed before comparing to <replaceable><luks uuid></replaceable>.
|
Any "luks-" of the LUKS UUID is removed before comparing to <replaceable><luks uuid></replaceable>.
|
||||||
The comparisons also matches, if <replaceable><luks uuid></replaceable> is only the beginning of the
|
The comparisons also matches, if <replaceable><luks uuid></replaceable> is only the beginning of the
|
||||||
LUKS UUID, so you don't have to specify the full UUID.
|
LUKS UUID, so you don't have to specify the full UUID.
|
||||||
This parameter can be specified multiple times.</para>
|
This parameter can be specified multiple times.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
@ -420,8 +420,8 @@ e.g.
|
||||||
<envar>ip=</envar><replaceable>{dhcp|on|any|dhcp6|auto6|ibft}</replaceable>
|
<envar>ip=</envar><replaceable>{dhcp|on|any|dhcp6|auto6|ibft}</replaceable>
|
||||||
</term>
|
</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>dhcp|on|any: get ip from dhcp server from all interfaces. If root=dhcp,
|
<para>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
|
loop sequentially through all interfaces (eth0, eth1, ...) and use the first
|
||||||
with a valid DHCP root-path.</para>
|
with a valid DHCP root-path.</para>
|
||||||
<para><constant>auto6</constant>: IPv6 autoconfiguration</para>
|
<para><constant>auto6</constant>: IPv6 autoconfiguration</para>
|
||||||
<para><constant>dhcp6</constant>: IPv6 DHCP</para>
|
<para><constant>dhcp6</constant>: IPv6 DHCP</para>
|
||||||
|
|
@ -459,7 +459,7 @@ This parameter can be specified multiple times.</para>
|
||||||
<envar>bootdev=</envar><replaceable><interface></replaceable>
|
<envar>bootdev=</envar><replaceable><interface></replaceable>
|
||||||
</term>
|
</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>specify network interface to use routing and netroot information from.
|
<para>specify network interface to use routing and netroot information from.
|
||||||
Required if multiple ip= lines are used.</para>
|
Required if multiple ip= lines are used.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
@ -501,7 +501,7 @@ NFS options can be appended with the prefix ":" or "," and a
|
||||||
<envar>root=</envar><replaceable>{dhcp|dhcp6}</replaceable>
|
<envar>root=</envar><replaceable>{dhcp|dhcp6}</replaceable>
|
||||||
</term>
|
</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>root=dhcp alone directs initrd to look at the DHCP root-path where NFS
|
<para>root=dhcp alone directs initrd to look at the DHCP root-path where NFS
|
||||||
options can be specified.
|
options can be specified.
|
||||||
root-path=<server-ip>:<root-dir>[,<nfs-options>]
|
root-path=<server-ip>:<root-dir>[,<nfs-options>]
|
||||||
root-path=nfs:<server-ip>:<root-dir>[,<nfs-options>]
|
root-path=nfs:<server-ip>:<root-dir>[,<nfs-options>]
|
||||||
|
|
@ -514,8 +514,8 @@ options can be specified.
|
||||||
<envar> nfsroot=</envar><optional><replaceable><server-ip></replaceable>:</optional><replaceable><root-dir></replaceable><optional>:<replaceable><nfs-options></replaceable></optional>
|
<envar> nfsroot=</envar><optional><replaceable><server-ip></replaceable>:</optional><replaceable><root-dir></replaceable><optional>:<replaceable><nfs-options></replaceable></optional>
|
||||||
</term>
|
</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para><emphasis remap="B">Deprecated!</emphasis> kernel Documentation<filename>/filesystems/nfsroot.txt</filename> defines
|
<para><emphasis remap="B">Deprecated!</emphasis> kernel Documentation<filename>/filesystems/nfsroot.txt</filename> defines
|
||||||
this method.
|
this method.
|
||||||
This is supported by dracut, but not recommended.</para>
|
This is supported by dracut, but not recommended.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
@ -553,7 +553,7 @@ then used in the Discovery Service stage in conjunction with other
|
||||||
associated fields.</para>
|
associated fields.</para>
|
||||||
<para>See <ulink url="http://tools.ietf.org/html/rfc4173#section-5">http://tools.ietf.org/html/rfc4173</ulink>.</para>
|
<para>See <ulink url="http://tools.ietf.org/html/rfc4173#section-5">http://tools.ietf.org/html/rfc4173</ulink>.</para>
|
||||||
<para>e.g.:<programlisting>root=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0 </programlisting></para>
|
<para>e.g.:<programlisting>root=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0 </programlisting></para>
|
||||||
<para>If servername is an IPv6 address, it has to be put in brackets. e.g.:
|
<para>If servername is an IPv6 address, it has to be put in brackets. e.g.:
|
||||||
<programlisting>root=iscsi:[2001:DB8::1]::::iqn.2009-06.dracut:target0 </programlisting></para>
|
<programlisting>root=iscsi:[2001:DB8::1]::::iqn.2009-06.dracut:target0 </programlisting></para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
@ -568,7 +568,7 @@ associated fields.</para>
|
||||||
<replaceable><LUN></replaceable>
|
<replaceable><LUN></replaceable>
|
||||||
</optional>:<replaceable><targetname></replaceable> ...</term>
|
</optional>:<replaceable><targetname></replaceable> ...</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>multiple netroot options allow setting up multiple iscsi disks. e.g.:
|
<para>multiple netroot options allow setting up multiple iscsi disks. e.g.:
|
||||||
<programlisting>root=UUID=12424547
|
<programlisting>root=UUID=12424547
|
||||||
netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0
|
netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0
|
||||||
netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target1 </programlisting></para>
|
netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target1 </programlisting></para>
|
||||||
|
|
@ -631,9 +631,9 @@ For the second argument, currently only nodcb is supported. This parameter can b
|
||||||
</term>
|
</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>with dhcp root-path=nbd:<server>:<port>[:<fstype>][:<mountopts>]
|
<para>with dhcp root-path=nbd:<server>:<port>[:<fstype>][:<mountopts>]
|
||||||
root=dhcp alone directs initrd to look at the DHCP root-path where NBD
|
root=dhcp alone directs initrd to look at the DHCP root-path where NBD
|
||||||
options can be specified.
|
options can be specified.
|
||||||
This syntax is only usable in cases where you are directly mounting the volume
|
This syntax is only usable in cases where you are directly mounting the volume
|
||||||
as the rootfs.</para>
|
as the rootfs.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
@ -1215,7 +1215,7 @@ rd.znet=ctc,0.0.0600,0.0.0601,0.0.0602,protocol=bar</programlisting></para>
|
||||||
</term>
|
</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Any files found in <filename>/etc/conf.d/</filename> will be sourced in the initramfs to
|
<para>Any files found in <filename>/etc/conf.d/</filename> will be sourced in the initramfs to
|
||||||
set initial values. Command line options will override these values
|
set initial values. Command line options will override these values
|
||||||
set in the configuration files.</para>
|
set in the configuration files.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
|
||||||
24
dracut.spec
24
dracut.spec
|
|
@ -20,14 +20,14 @@ Release: %{release_prefix}
|
||||||
|
|
||||||
Summary: Initramfs generator using udev
|
Summary: Initramfs generator using udev
|
||||||
%if 0%{?fedora}
|
%if 0%{?fedora}
|
||||||
Group: System Environment/Base
|
Group: System Environment/Base
|
||||||
%endif
|
%endif
|
||||||
%if 0%{?suse_version}
|
%if 0%{?suse_version}
|
||||||
Group: System/Base
|
Group: System/Base
|
||||||
%endif
|
%endif
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
URL: https://dracut.wiki.kernel.org/
|
URL: https://dracut.wiki.kernel.org/
|
||||||
# Source can be generated by
|
# Source can be generated by
|
||||||
# http://git.kernel.org/?p=boot/dracut/dracut.git;a=snapshot;h=%{?dashgittag};sf=tgz
|
# http://git.kernel.org/?p=boot/dracut/dracut.git;a=snapshot;h=%{?dashgittag};sf=tgz
|
||||||
Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}%{?dashgittag}.tar.bz2
|
Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}%{?dashgittag}.tar.bz2
|
||||||
|
|
||||||
|
|
@ -93,16 +93,16 @@ Requires: util-linux >= 2.16
|
||||||
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Dracut contains tools to create a bootable initramfs for 2.6 Linux kernels.
|
Dracut contains tools to create a bootable initramfs for 2.6 Linux kernels.
|
||||||
Unlike existing implementations, dracut does hard-code as little as possible
|
Unlike existing implementations, dracut does hard-code as little as possible
|
||||||
into the initramfs. Dracut contains various modules which are driven by the
|
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
|
event-based udev. Having root on MD, DM, LVM2, LUKS is supported as well as
|
||||||
NFS, iSCSI, NBD, FCoE with the dracut-network package.
|
NFS, iSCSI, NBD, FCoE with the dracut-network package.
|
||||||
|
|
||||||
%package network
|
%package network
|
||||||
Summary: Dracut modules to build a dracut initramfs with network support
|
Summary: Dracut modules to build a dracut initramfs with network support
|
||||||
Requires: %{name} = %{version}-%{release}
|
Requires: %{name} = %{version}-%{release}
|
||||||
Requires: rpcbind
|
Requires: rpcbind
|
||||||
%if %{with_nbd}
|
%if %{with_nbd}
|
||||||
Requires: nbd
|
Requires: nbd
|
||||||
%endif
|
%endif
|
||||||
|
|
@ -111,7 +111,7 @@ Requires: bridge-utils
|
||||||
|
|
||||||
%if 0%{?fedora}
|
%if 0%{?fedora}
|
||||||
Requires: iscsi-initiator-utils
|
Requires: iscsi-initiator-utils
|
||||||
Requires: nfs-utils
|
Requires: nfs-utils
|
||||||
Requires: dhclient
|
Requires: dhclient
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
|
@ -165,14 +165,14 @@ This package contains tools to assemble the local initrd and host configuration.
|
||||||
%setup -q -n %{name}-%{version}%{?dashgittag}
|
%setup -q -n %{name}-%{version}%{?dashgittag}
|
||||||
|
|
||||||
%build
|
%build
|
||||||
make
|
make
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%if 0%{?fedora}
|
%if 0%{?fedora}
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
%endif
|
%endif
|
||||||
make install DESTDIR=$RPM_BUILD_ROOT sbindir=/sbin \
|
make install DESTDIR=$RPM_BUILD_ROOT sbindir=/sbin \
|
||||||
sysconfdir=/etc mandir=%{_mandir}
|
sysconfdir=/etc mandir=%{_mandir}
|
||||||
|
|
||||||
echo %{name}-%{version}-%{release} > $RPM_BUILD_ROOT/%{_datadir}/dracut/modules.d/10rpmversion/dracut-version
|
echo %{name}-%{version}-%{release} > $RPM_BUILD_ROOT/%{_datadir}/dracut/modules.d/10rpmversion/dracut-version
|
||||||
|
|
||||||
|
|
@ -285,7 +285,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||||
%defattr(-,root,root,0755)
|
%defattr(-,root,root,0755)
|
||||||
%{_datadir}/dracut/modules.d/02caps
|
%{_datadir}/dracut/modules.d/02caps
|
||||||
|
|
||||||
%files tools
|
%files tools
|
||||||
%defattr(-,root,root,0755)
|
%defattr(-,root,root,0755)
|
||||||
%{_mandir}/man8/dracut-gencmdline.8*
|
%{_mandir}/man8/dracut-gencmdline.8*
|
||||||
%{_mandir}/man8/dracut-catimages.8*
|
%{_mandir}/man8/dracut-catimages.8*
|
||||||
|
|
|
||||||
12
dracut.xml
12
dracut.xml
|
|
@ -74,7 +74,7 @@
|
||||||
<para>A <acronym>TFTP</acronym> server (on systems that can boot from Ethernet) </para>
|
<para>A <acronym>TFTP</acronym> server (on systems that can boot from Ethernet) </para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</itemizedlist>
|
</itemizedlist>
|
||||||
<para>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.
|
<para>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.
|
||||||
</para>
|
</para>
|
||||||
<para>Depending on which algorithms were compiled statically into it, the kernel can currently unpack initrd/initramfs images compressed with gzip, bzip2 and <acronym>LZMA</acronym>. </para>
|
<para>Depending on which algorithms were compiled statically into it, the kernel can currently unpack initrd/initramfs images compressed with gzip, bzip2 and <acronym>LZMA</acronym>. </para>
|
||||||
</section>
|
</section>
|
||||||
|
|
@ -431,7 +431,7 @@ title Fedora (2.6.29.5-191.fc11.x86_64)
|
||||||
<para>Remove the boot arguments ''rhgb'' and ''quiet''
|
<para>Remove the boot arguments ''rhgb'' and ''quiet''
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
A sample <filename>/etc/grub.conf</filename> bootloader configuration file is listed below.
|
A sample <filename>/etc/grub.conf</filename> bootloader configuration file is listed below.
|
||||||
</para>
|
</para>
|
||||||
<para><screen>default=0
|
<para><screen>default=0
|
||||||
timeout=5
|
timeout=5
|
||||||
|
|
@ -439,12 +439,12 @@ serial --unit=0 --speed=9600
|
||||||
terminal --timeout=5 serial console
|
terminal --timeout=5 serial console
|
||||||
title Fedora (2.6.29.5-191.fc11.x86_64)
|
title Fedora (2.6.29.5-191.fc11.x86_64)
|
||||||
root (hd0,0)
|
root (hd0,0)
|
||||||
kernel /vmlinuz-2.6.29.5-191.fc11.x86_64 ro root=/dev/mapper/vg_uc1-lv_root console=tty0 rd.shell
|
kernel /vmlinuz-2.6.29.5-191.fc11.x86_64 ro root=/dev/mapper/vg_uc1-lv_root console=tty0 rd.shell
|
||||||
initrd /dracut-2.6.29.5-191.fc11.x86_64.img</screen></para>
|
initrd /dracut-2.6.29.5-191.fc11.x86_64.img</screen></para>
|
||||||
</listitem>
|
</listitem>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>If system boot fails, you will be dropped into a shell as seen in the example below.
|
<para>If system boot fails, you will be dropped into a shell as seen in the example below.
|
||||||
<screen>No root device found
|
<screen>No root device found
|
||||||
Dropping to debug shell.
|
Dropping to debug shell.
|
||||||
|
|
||||||
sh: can't access tty; job control turned off
|
sh: can't access tty; job control turned off
|
||||||
|
|
@ -623,7 +623,7 @@ Common used functions are in <filename>dracut-lib.sh</filename>, which can be so
|
||||||
inst_simple "$moddir/insmodpost.sh" /sbin/insmodpost.sh</programlisting>
|
inst_simple "$moddir/insmodpost.sh" /sbin/insmodpost.sh</programlisting>
|
||||||
<para>The <filename>pase-instmodpost.sh</filename> parses the kernel command line for a argument <envar>rd.driver.post</envar>, blacklists the module from being autoloaded and installs the hook <filename>insmodpost.sh</filename> in the <filename>initqueue-settled</filename>.</para>
|
<para>The <filename>pase-instmodpost.sh</filename> parses the kernel command line for a argument <envar>rd.driver.post</envar>, blacklists the module from being autoloaded and installs the hook <filename>insmodpost.sh</filename> in the <filename>initqueue-settled</filename>.</para>
|
||||||
<para><filename>parse-insmodpost.sh</filename>:</para>
|
<para><filename>parse-insmodpost.sh</filename>:</para>
|
||||||
<programlisting>for p in $(getargs rd.driver.post=); do
|
<programlisting>for p in $(getargs rd.driver.post=); do
|
||||||
echo "blacklist $p" >> /etc/modprobe.d/initramfsblacklist.conf
|
echo "blacklist $p" >> /etc/modprobe.d/initramfsblacklist.conf
|
||||||
_do_insmodpost=1
|
_do_insmodpost=1
|
||||||
done
|
done
|
||||||
|
|
@ -635,7 +635,7 @@ unset _do_insmodpost
|
||||||
<para><filename>insmodpost.sh</filename>:</para>
|
<para><filename>insmodpost.sh</filename>:</para>
|
||||||
<programlisting>. /lib/dracut-lib.sh
|
<programlisting>. /lib/dracut-lib.sh
|
||||||
|
|
||||||
for p in $(getargs rd.driver.post=); do
|
for p in $(getargs rd.driver.post=); do
|
||||||
modprobe $p
|
modprobe $p
|
||||||
done
|
done
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
|
||||||
4
lsinitrd
4
lsinitrd
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||||
#
|
#
|
||||||
|
|
@ -41,7 +41,7 @@ fi
|
||||||
|
|
||||||
echo "$image:"
|
echo "$image:"
|
||||||
echo "========================================================================"
|
echo "========================================================================"
|
||||||
$CAT "$image" | cpio --extract --verbose --quiet --to-stdout 'lib/dracut/dracut-*' 2>/dev/null
|
$CAT "$image" | cpio --extract --verbose --quiet --to-stdout 'lib/dracut/dracut-*' 2>/dev/null
|
||||||
echo "========================================================================"
|
echo "========================================================================"
|
||||||
$CAT "$image" | cpio --extract --verbose --quiet --list
|
$CAT "$image" | cpio --extract --verbose --quiet --list
|
||||||
echo "========================================================================"
|
echo "========================================================================"
|
||||||
|
|
|
||||||
|
|
@ -12,16 +12,16 @@ depends() {
|
||||||
}
|
}
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
inst /sbin/bootchartd
|
inst /sbin/bootchartd
|
||||||
inst /bin/bash
|
inst /bin/bash
|
||||||
inst_symlink /init /sbin/init
|
inst_symlink /init /sbin/init
|
||||||
inst_dir /lib/bootchart/tmpfs
|
inst_dir /lib/bootchart/tmpfs
|
||||||
inst /lib/bootchart/bootchart-collector
|
inst /lib/bootchart/bootchart-collector
|
||||||
inst /etc/bootchartd.conf
|
inst /etc/bootchartd.conf
|
||||||
inst /sbin/accton
|
inst /sbin/accton
|
||||||
inst /usr/bin/pkill /bin/pkill
|
inst /usr/bin/pkill /bin/pkill
|
||||||
inst /bin/echo
|
inst /bin/echo
|
||||||
inst /bin/grep
|
inst /bin/grep
|
||||||
inst /bin/usleep
|
inst /bin/usleep
|
||||||
inst /usr/bin/[ /bin/[
|
inst /usr/bin/[ /bin/[
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,11 @@ depends() {
|
||||||
installkernel() {
|
installkernel() {
|
||||||
FIPSMODULES="aead aes_generici aes-xts aes-x86_64 ansi_cprng cbc ccm chainiv ctr"
|
FIPSMODULES="aead aes_generici aes-xts aes-x86_64 ansi_cprng cbc ccm chainiv ctr"
|
||||||
FIPSMODULES="$FIPSMODULES des deflate ecb eseqiv hmac seqiv sha256 sha512"
|
FIPSMODULES="$FIPSMODULES des deflate ecb eseqiv hmac seqiv sha256 sha512"
|
||||||
FIPSMODULES="$FIPSMODULES cryptomgr crypto_null tcrypt"
|
FIPSMODULES="$FIPSMODULES cryptomgr crypto_null tcrypt"
|
||||||
|
|
||||||
mkdir -m 0755 -p "${initdir}/etc/modprobe.d"
|
mkdir -m 0755 -p "${initdir}/etc/modprobe.d"
|
||||||
|
|
||||||
for mod in $FIPSMODULES; do
|
for mod in $FIPSMODULES; do
|
||||||
if instmods $mod; then
|
if instmods $mod; then
|
||||||
echo $mod >> "${initdir}/etc/fipsmodules"
|
echo $mod >> "${initdir}/etc/fipsmodules"
|
||||||
echo "blacklist $mod" >> "${initdir}/etc/modprobe.d/fips.conf"
|
echo "blacklist $mod" >> "${initdir}/etc/modprobe.d/fips.conf"
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ if [ "$capsmode" = "1" ]; then
|
||||||
|
|
||||||
info "Loading CAPS_MODULES $CAPS_MODULES"
|
info "Loading CAPS_MODULES $CAPS_MODULES"
|
||||||
for i in $CAPS_MODULES;do modprobe $i 2>&1 >/dev/null | vinfo; done
|
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
|
if [ "$CAPS_MODULES_DISABLED" = "1" -a -e /proc/sys/kernel/modules_disabled ]; then
|
||||||
info "Disabling module loading."
|
info "Disabling module loading."
|
||||||
echo $CAPS_MODULES_DISABLED > /proc/sys/kernel/modules_disabled
|
echo $CAPS_MODULES_DISABLED > /proc/sys/kernel/modules_disabled
|
||||||
|
|
@ -29,7 +29,7 @@ if [ "$capsmode" = "1" ]; then
|
||||||
echo $CAPS_USERMODEHELPER_BSET > /proc/sys/kernel/usermodehelper/bset
|
echo $CAPS_USERMODEHELPER_BSET > /proc/sys/kernel/usermodehelper/bset
|
||||||
echo $CAPS_USERMODEHELPER_BSET > /proc/sys/kernel/usermodehelper/inheritable
|
echo $CAPS_USERMODEHELPER_BSET > /proc/sys/kernel/usermodehelper/inheritable
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "CAPS_INIT_DROP=\"$CAPS_INIT_DROP\"" > /etc/capsdrop
|
echo "CAPS_INIT_DROP=\"$CAPS_INIT_DROP\"" > /etc/capsdrop
|
||||||
info "Will drop capabilities $CAPS_INIT_DROP from init."
|
info "Will drop capabilities $CAPS_INIT_DROP from init."
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ distributions. To deal with it avoiding hardcoding those differences in
|
||||||
the installation script we handle it by mappings between variables used
|
the installation script we handle it by mappings between variables used
|
||||||
by Dracut and the ones in the system. Package maintainer is expected to
|
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
|
create those for his/her distribution and it's appreciated to share it
|
||||||
with us, so we can include it in source package.
|
with us, so we can include it in source package.
|
||||||
|
|
||||||
|
|
||||||
1. Hostonly vs Generic
|
1. Hostonly vs Generic
|
||||||
|
|
|
||||||
|
|
@ -178,12 +178,12 @@ install() {
|
||||||
for kbddir in ${kbddir} /usr/lib/kbd /lib/kbd /usr/share /usr/share/kbd
|
for kbddir in ${kbddir} /usr/lib/kbd /lib/kbd /usr/share /usr/share/kbd
|
||||||
do
|
do
|
||||||
[[ -d "${kbddir}" ]] && \
|
[[ -d "${kbddir}" ]] && \
|
||||||
for dir in ${KBDSUBDIRS//,/ }
|
for dir in ${KBDSUBDIRS//,/ }
|
||||||
do
|
do
|
||||||
[[ -d "${kbddir}/${dir}" ]] && continue
|
[[ -d "${kbddir}/${dir}" ]] && continue
|
||||||
false
|
false
|
||||||
done && break
|
done && break
|
||||||
kbddir=''
|
kbddir=''
|
||||||
done
|
done
|
||||||
|
|
||||||
[[ ${kbddir} ]] || {
|
[[ ${kbddir} ]] || {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||||
|
|
||||||
|
|
@ -37,7 +37,7 @@ setup_interface() {
|
||||||
[ -n "${search}${domain}" ] && echo "search $search $domain" > /tmp/net.$netif.resolv.conf
|
[ -n "${search}${domain}" ] && echo "search $search $domain" > /tmp/net.$netif.resolv.conf
|
||||||
if [ -n "$namesrv" ] ; then
|
if [ -n "$namesrv" ] ; then
|
||||||
for s in $namesrv; do
|
for s in $namesrv; do
|
||||||
echo nameserver $s
|
echo nameserver $s
|
||||||
done
|
done
|
||||||
fi >> /tmp/net.$netif.resolv.conf
|
fi >> /tmp/net.$netif.resolv.conf
|
||||||
|
|
||||||
|
|
@ -68,13 +68,13 @@ case $reason in
|
||||||
warn "Duplicate address detected for $new_ip_address while doing dhcp. retrying"
|
warn "Duplicate address detected for $new_ip_address while doing dhcp. retrying"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
setup_interface
|
setup_interface
|
||||||
set | while read line; do
|
set | while read line; do
|
||||||
[ "${line#new_}" = "$line" ] && continue
|
[ "${line#new_}" = "$line" ] && continue
|
||||||
echo "$line"
|
echo "$line"
|
||||||
done >/tmp/dhclient.$netif.dhcpopts
|
done >/tmp/dhclient.$netif.dhcpopts
|
||||||
echo online > /sys/class/net/$netif/uevent
|
echo online > /sys/class/net/$netif/uevent
|
||||||
initqueue --onetime --name netroot-$netif netroot $netif
|
initqueue --onetime --name netroot-$netif netroot $netif
|
||||||
;;
|
;;
|
||||||
*) echo "dhcp: $reason";;
|
*) echo "dhcp: $reason";;
|
||||||
esac
|
esac
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
request subnet-mask, broadcast-address, time-offset, routers,
|
request subnet-mask, broadcast-address, time-offset, routers,
|
||||||
domain-name, domain-name-servers, domain-search, host-name,
|
domain-name, domain-name-servers, domain-search, host-name,
|
||||||
root-path, interface-mtu;
|
root-path, interface-mtu;
|
||||||
|
|
|
||||||
|
|
@ -32,10 +32,10 @@ load_ipv6() {
|
||||||
do_ipv6auto() {
|
do_ipv6auto() {
|
||||||
load_ipv6
|
load_ipv6
|
||||||
{
|
{
|
||||||
echo 0 > /proc/sys/net/ipv6/conf/$netif/forwarding
|
echo 0 > /proc/sys/net/ipv6/conf/$netif/forwarding
|
||||||
echo 1 > /proc/sys/net/ipv6/conf/$netif/accept_ra
|
echo 1 > /proc/sys/net/ipv6/conf/$netif/accept_ra
|
||||||
echo 1 > /proc/sys/net/ipv6/conf/$netif/accept_redirects
|
echo 1 > /proc/sys/net/ipv6/conf/$netif/accept_redirects
|
||||||
echo ip link set $netif up
|
echo ip link set $netif up
|
||||||
echo wait_for_if_up $netif
|
echo wait_for_if_up $netif
|
||||||
} > /tmp/net.$netif.up
|
} > /tmp/net.$netif.up
|
||||||
|
|
||||||
|
|
@ -44,13 +44,13 @@ do_ipv6auto() {
|
||||||
namesrv=$(getargs nameserver)
|
namesrv=$(getargs nameserver)
|
||||||
if [ -n "$namesrv" ] ; then
|
if [ -n "$namesrv" ] ; then
|
||||||
for s in $namesrv; do
|
for s in $namesrv; do
|
||||||
echo nameserver $s
|
echo nameserver $s
|
||||||
done
|
done
|
||||||
fi >> /tmp/net.$netif.resolv.conf
|
fi >> /tmp/net.$netif.resolv.conf
|
||||||
|
|
||||||
|
|
||||||
echo online > /sys/class/net/$netif/uevent
|
echo online > /sys/class/net/$netif/uevent
|
||||||
initqueue --onetime --name netroot-$netif netroot $netif
|
initqueue --onetime --name netroot-$netif netroot $netif
|
||||||
}
|
}
|
||||||
|
|
||||||
# Handle static ip configuration
|
# Handle static ip configuration
|
||||||
|
|
@ -58,7 +58,7 @@ do_static() {
|
||||||
strstr $ip '*:*:*' && load_ipv6
|
strstr $ip '*:*:*' && load_ipv6
|
||||||
|
|
||||||
{
|
{
|
||||||
echo ip link set $netif up
|
echo ip link set $netif up
|
||||||
echo wait_for_if_up $netif
|
echo wait_for_if_up $netif
|
||||||
# do not flush addr for ipv6
|
# do not flush addr for ipv6
|
||||||
strstr $ip '*:*:*' || \
|
strstr $ip '*:*:*' || \
|
||||||
|
|
@ -72,12 +72,12 @@ do_static() {
|
||||||
namesrv=$(getargs nameserver)
|
namesrv=$(getargs nameserver)
|
||||||
if [ -n "$namesrv" ] ; then
|
if [ -n "$namesrv" ] ; then
|
||||||
for s in $namesrv; do
|
for s in $namesrv; do
|
||||||
echo nameserver $s
|
echo nameserver $s
|
||||||
done
|
done
|
||||||
fi >> /tmp/net.$netif.resolv.conf
|
fi >> /tmp/net.$netif.resolv.conf
|
||||||
|
|
||||||
echo online > /sys/class/net/$netif/uevent
|
echo online > /sys/class/net/$netif/uevent
|
||||||
initqueue --onetime --name netroot-$netif netroot $netif
|
initqueue --onetime --name netroot-$netif netroot $netif
|
||||||
}
|
}
|
||||||
|
|
||||||
export PS4="ifup.$1.$$ + "
|
export PS4="ifup.$1.$$ + "
|
||||||
|
|
@ -223,7 +223,7 @@ for p in $(getargs ip=); do
|
||||||
do_dhcp -6 ;;
|
do_dhcp -6 ;;
|
||||||
auto6)
|
auto6)
|
||||||
do_ipv6auto ;;
|
do_ipv6auto ;;
|
||||||
*)
|
*)
|
||||||
do_static ;;
|
do_static ;;
|
||||||
esac
|
esac
|
||||||
break
|
break
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
check() {
|
check() {
|
||||||
. $dracutfunctions
|
. $dracutfunctions
|
||||||
|
|
||||||
for program in ip arping dhclient ; do
|
for program in ip arping dhclient ; do
|
||||||
if ! type -P $program >/dev/null; then
|
if ! type -P $program >/dev/null; then
|
||||||
derror "Could not find program \"$program\" required by network."
|
derror "Could not find program \"$program\" required by network."
|
||||||
return 1
|
return 1
|
||||||
|
|
@ -42,12 +42,12 @@ installkernel() {
|
||||||
}
|
}
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
dracut_install ip arping tr dhclient
|
dracut_install ip arping tr dhclient
|
||||||
dracut_install -o brctl ifenslave
|
dracut_install -o brctl ifenslave
|
||||||
inst "$moddir/ifup" "/sbin/ifup"
|
inst "$moddir/ifup" "/sbin/ifup"
|
||||||
inst "$moddir/netroot" "/sbin/netroot"
|
inst "$moddir/netroot" "/sbin/netroot"
|
||||||
inst "$moddir/dhclient-script" "/sbin/dhclient-script"
|
inst "$moddir/dhclient-script" "/sbin/dhclient-script"
|
||||||
inst "$moddir/dhclient.conf" "/etc/dhclient.conf"
|
inst "$moddir/dhclient.conf" "/etc/dhclient.conf"
|
||||||
inst_hook pre-udev 50 "$moddir/ifname-genrules.sh"
|
inst_hook pre-udev 50 "$moddir/ifname-genrules.sh"
|
||||||
inst_hook pre-udev 60 "$moddir/net-genrules.sh"
|
inst_hook pre-udev 60 "$moddir/net-genrules.sh"
|
||||||
inst_hook cmdline 91 "$moddir/dhcp-root.sh"
|
inst_hook cmdline 91 "$moddir/dhcp-root.sh"
|
||||||
|
|
|
||||||
|
|
@ -20,18 +20,18 @@ type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||||
[ -z "$netroot" ] && exit 1
|
[ -z "$netroot" ] && exit 1
|
||||||
|
|
||||||
# Let's see if we have to wait for other interfaces
|
# Let's see if we have to wait for other interfaces
|
||||||
# Note: exit works just fine, since the last interface to be
|
# Note: exit works just fine, since the last interface to be
|
||||||
# online'd should see all files
|
# online'd should see all files
|
||||||
[ -e "/tmp/net.ifaces" ] && read IFACES < /tmp/net.ifaces
|
[ -e "/tmp/net.ifaces" ] && read IFACES < /tmp/net.ifaces
|
||||||
for iface in $IFACES ; do
|
for iface in $IFACES ; do
|
||||||
[ -e /tmp/net.$iface.up ] || exit 1
|
[ -e /tmp/net.$iface.up ] || exit 1
|
||||||
done
|
done
|
||||||
|
|
||||||
# Set or override primary interface
|
# Set or override primary interface
|
||||||
netif=$1
|
netif=$1
|
||||||
[ -e "/tmp/net.bootdev" ] && read netif < /tmp/net.bootdev
|
[ -e "/tmp/net.bootdev" ] && read netif < /tmp/net.bootdev
|
||||||
|
|
||||||
# Figure out the handler for root=dhcp by recalling all netroot cmdline
|
# Figure out the handler for root=dhcp by recalling all netroot cmdline
|
||||||
# handlers
|
# handlers
|
||||||
if [ "$netroot" = "dhcp" ] || [ "$netroot" = "dhcp6" ] ; then
|
if [ "$netroot" = "dhcp" ] || [ "$netroot" = "dhcp6" ] ; then
|
||||||
# Unset root so we can check later
|
# Unset root so we can check later
|
||||||
|
|
@ -40,7 +40,7 @@ if [ "$netroot" = "dhcp" ] || [ "$netroot" = "dhcp6" ] ; then
|
||||||
# Load dhcp options
|
# Load dhcp options
|
||||||
[ -e /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts
|
[ -e /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts
|
||||||
|
|
||||||
# If we have a specific bootdev with no dhcpoptions or empty root-path,
|
# If we have a specific bootdev with no dhcpoptions or empty root-path,
|
||||||
# we die. Otherwise we just warn
|
# we die. Otherwise we just warn
|
||||||
if [ -z "$new_root_path" ] ; then
|
if [ -z "$new_root_path" ] ; then
|
||||||
[ -n "$BOOTDEV" ] && die "No dhcp root-path received for '$BOOTDEV'"
|
[ -n "$BOOTDEV" ] && die "No dhcp root-path received for '$BOOTDEV'"
|
||||||
|
|
@ -55,7 +55,7 @@ if [ "$netroot" = "dhcp" ] || [ "$netroot" = "dhcp6" ] ; then
|
||||||
for f in $hookdir/cmdline/90*.sh; do
|
for f in $hookdir/cmdline/90*.sh; do
|
||||||
[ -f "$f" ] && . "$f";
|
[ -f "$f" ] && . "$f";
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
rootok="1"
|
rootok="1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -89,7 +89,7 @@ done
|
||||||
# Note: This assumes that if no router is present the
|
# Note: This assumes that if no router is present the
|
||||||
# root server is on the same subnet.
|
# root server is on the same subnet.
|
||||||
#
|
#
|
||||||
# TODO There's some netroot variants that don't (yet) have their
|
# TODO There's some netroot variants that don't (yet) have their
|
||||||
# server-ip netroot
|
# server-ip netroot
|
||||||
|
|
||||||
# Get router IP if set
|
# Get router IP if set
|
||||||
|
|
@ -136,7 +136,7 @@ if $handler $netif $netroot $NEWROOT; then
|
||||||
|
|
||||||
# Save used netif for later use
|
# Save used netif for later use
|
||||||
[ ! -f /tmp/net.ifaces ] && echo $netif > /tmp/net.ifaces
|
[ ! -f /tmp/net.ifaces ] && echo $netif > /tmp/net.ifaces
|
||||||
else
|
else
|
||||||
warn "Mounting root via '$netif' failed"
|
warn "Mounting root via '$netif' failed"
|
||||||
# If we're trying with multiple interfaces, put that one down.
|
# If we're trying with multiple interfaces, put that one down.
|
||||||
# ip down/flush ensures that routeing info goes away as well
|
# ip down/flush ensures that routeing info goes away as well
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
# return if bond already parsed
|
# return if bond already parsed
|
||||||
[ -n "$bondname" ] && return
|
[ -n "$bondname" ] && return
|
||||||
|
|
||||||
# Check if bond parameter is valid
|
# Check if bond parameter is valid
|
||||||
if getarg bond= >/dev/null ; then
|
if getarg bond= >/dev/null ; then
|
||||||
if [ -z "$netroot" ] ; then
|
if [ -z "$netroot" ] ; then
|
||||||
die "No netboot configured, bond is invalid"
|
die "No netboot configured, bond is invalid"
|
||||||
|
|
@ -46,7 +46,7 @@ unset bondname bondslaves bondoptions
|
||||||
if getarg bond >/dev/null; then
|
if getarg bond >/dev/null; then
|
||||||
# Read bond= parameters if they exist
|
# Read bond= parameters if they exist
|
||||||
bond="$(getarg bond=)"
|
bond="$(getarg bond=)"
|
||||||
if [ ! "$bond" = "bond" ]; then
|
if [ ! "$bond" = "bond" ]; then
|
||||||
parsebond "$(getarg bond=)"
|
parsebond "$(getarg bond=)"
|
||||||
fi
|
fi
|
||||||
# Simple default bond
|
# Simple default bond
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
# return if bridge already parsed
|
# return if bridge already parsed
|
||||||
[ -n "$bridgename" ] && return
|
[ -n "$bridgename" ] && return
|
||||||
|
|
||||||
# Check if bridge parameter is valid
|
# Check if bridge parameter is valid
|
||||||
if getarg bridge= >/dev/null ; then
|
if getarg bridge= >/dev/null ; then
|
||||||
if [ -z "$netroot" ] ; then
|
if [ -z "$netroot" ] ; then
|
||||||
die "No netboot configured, bridge is invalid"
|
die "No netboot configured, bridge is invalid"
|
||||||
|
|
@ -49,7 +49,7 @@ fi
|
||||||
if getarg bridge >/dev/null; then
|
if getarg bridge >/dev/null; then
|
||||||
# Read bridge= parameters if they exist
|
# Read bridge= parameters if they exist
|
||||||
bridge="$(getarg bridge=)"
|
bridge="$(getarg bridge=)"
|
||||||
if [ ! "$bridge" = "bridge" ]; then
|
if [ ! "$bridge" = "bridge" ]; then
|
||||||
parsebridge "$(getarg bridge=)"
|
parsebridge "$(getarg bridge=)"
|
||||||
fi
|
fi
|
||||||
# Simple default bridge
|
# Simple default bridge
|
||||||
|
|
|
||||||
|
|
@ -156,7 +156,7 @@ for p in $(getargs ip=); do
|
||||||
done
|
done
|
||||||
|
|
||||||
# This ensures that BOOTDEV is always first in IFACES
|
# This ensures that BOOTDEV is always first in IFACES
|
||||||
if [ -n "$BOOTDEV" ] && [ -n "$IFACES" ] ; then
|
if [ -n "$BOOTDEV" ] && [ -n "$IFACES" ] ; then
|
||||||
IFACES="${IFACES%$BOOTDEV*} ${IFACES#*$BOOTDEV}"
|
IFACES="${IFACES%$BOOTDEV*} ${IFACES#*$BOOTDEV}"
|
||||||
IFACES="$BOOTDEV $IFACES"
|
IFACES="$BOOTDEV $IFACES"
|
||||||
fi
|
fi
|
||||||
|
|
@ -165,5 +165,5 @@ fi
|
||||||
[ -n "$BOOTDEV" ] && echo $BOOTDEV > /tmp/net.bootdev
|
[ -n "$BOOTDEV" ] && echo $BOOTDEV > /tmp/net.bootdev
|
||||||
[ -n "$IFACES" ] && echo $IFACES > /tmp/net.ifaces
|
[ -n "$IFACES" ] && echo $IFACES > /tmp/net.ifaces
|
||||||
|
|
||||||
# We need a ip= line for the configured bootdev=
|
# We need a ip= line for the configured bootdev=
|
||||||
[ -n "$NEEDBOOTDEV" ] && [ -z "$BOOTDEVOK" ] && die "Bootdev Argument '$BOOTDEV' not found"
|
[ -n "$NEEDBOOTDEV" ] && [ -z "$BOOTDEVOK" ] && die "Bootdev Argument '$BOOTDEV' not found"
|
||||||
|
|
|
||||||
|
|
@ -31,18 +31,18 @@ for netif in $IFACES ; do
|
||||||
fi
|
fi
|
||||||
cat /sys/class/net/$netif/address > /tmp/net.$netif.hwaddr
|
cat /sys/class/net/$netif/address > /tmp/net.$netif.hwaddr
|
||||||
{
|
{
|
||||||
echo "# Generated by dracut initrd"
|
echo "# Generated by dracut initrd"
|
||||||
echo "DEVICE=$netif"
|
echo "DEVICE=$netif"
|
||||||
echo "ONBOOT=yes"
|
echo "ONBOOT=yes"
|
||||||
echo "NETBOOT=yes"
|
echo "NETBOOT=yes"
|
||||||
if [ -f /tmp/net.$netif.lease ]; then
|
if [ -f /tmp/net.$netif.lease ]; then
|
||||||
strstr "$ip" '*:*:*' &&
|
strstr "$ip" '*:*:*' &&
|
||||||
echo "DHCPV6C=yes"
|
echo "DHCPV6C=yes"
|
||||||
echo "BOOTPROTO=dhcp"
|
echo "BOOTPROTO=dhcp"
|
||||||
else
|
else
|
||||||
echo "BOOTPROTO=none"
|
echo "BOOTPROTO=none"
|
||||||
# If we've booted with static ip= lines, the override file is there
|
# If we've booted with static ip= lines, the override file is there
|
||||||
[ -e /tmp/net.$netif.override ] && . /tmp/net.$netif.override
|
[ -e /tmp/net.$netif.override ] && . /tmp/net.$netif.override
|
||||||
echo "IPADDR=$ip"
|
echo "IPADDR=$ip"
|
||||||
echo "NETMASK=$mask"
|
echo "NETMASK=$mask"
|
||||||
[ -n "$gw" ] && echo "GATEWAY=$gw"
|
[ -n "$gw" ] && echo "GATEWAY=$gw"
|
||||||
|
|
@ -55,7 +55,7 @@ for netif in $IFACES ; do
|
||||||
{
|
{
|
||||||
echo "HWADDR=$(cat /sys/class/net/$netif/address)"
|
echo "HWADDR=$(cat /sys/class/net/$netif/address)"
|
||||||
echo "TYPE=Ethernet"
|
echo "TYPE=Ethernet"
|
||||||
echo "NAME=\"Boot Disk\""
|
echo "NAME=\"Boot Disk\""
|
||||||
} >> /tmp/ifcfg/ifcfg-$netif
|
} >> /tmp/ifcfg/ifcfg-$netif
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -88,7 +88,7 @@ for netif in $IFACES ; do
|
||||||
# bridge
|
# bridge
|
||||||
{
|
{
|
||||||
echo "TYPE=Bridge"
|
echo "TYPE=Bridge"
|
||||||
echo "NAME=\"Boot Disk\""
|
echo "NAME=\"Boot Disk\""
|
||||||
} >> /tmp/ifcfg/ifcfg-$netif
|
} >> /tmp/ifcfg/ifcfg-$netif
|
||||||
if [ "$ethname" = "$bondname" ] ; then
|
if [ "$ethname" = "$bondname" ] ; then
|
||||||
{
|
{
|
||||||
|
|
@ -100,7 +100,7 @@ for netif in $IFACES ; do
|
||||||
# This variable is an indicator of a bond interface for initscripts
|
# This variable is an indicator of a bond interface for initscripts
|
||||||
echo "BONDING_OPTS=\"$bondoptions\""
|
echo "BONDING_OPTS=\"$bondoptions\""
|
||||||
echo "BRIDGE=$netif"
|
echo "BRIDGE=$netif"
|
||||||
echo "NAME=\"$bondname\""
|
echo "NAME=\"$bondname\""
|
||||||
} >> /tmp/ifcfg/ifcfg-$bondname
|
} >> /tmp/ifcfg/ifcfg-$bondname
|
||||||
for slave in $bondslaves ; do
|
for slave in $bondslaves ; do
|
||||||
# write separate ifcfg file for the raw eth interface
|
# write separate ifcfg file for the raw eth interface
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ depends() {
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
call_splash_geninitramfs() {
|
call_splash_geninitramfs() {
|
||||||
local out ret
|
local out ret
|
||||||
|
|
||||||
out=$(splash_geninitramfs -c "$1" ${@:2} 2>&1)
|
out=$(splash_geninitramfs -c "$1" ${@:2} 2>&1)
|
||||||
ret=$?
|
ret=$?
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,11 @@ PLYMOUTH_THEME=$(plymouth-set-default-theme)
|
||||||
inst /sbin/plymouthd /bin/plymouthd
|
inst /sbin/plymouthd /bin/plymouthd
|
||||||
dracut_install /bin/plymouth \
|
dracut_install /bin/plymouth \
|
||||||
"${PLYMOUTH_LOGO_FILE}" \
|
"${PLYMOUTH_LOGO_FILE}" \
|
||||||
/etc/system-release
|
/etc/system-release
|
||||||
|
|
||||||
mkdir -m 0755 -p "${initdir}/usr/share/plymouth"
|
mkdir -m 0755 -p "${initdir}/usr/share/plymouth"
|
||||||
|
|
||||||
if [[ $hostonly ]]; then
|
if [[ $hostonly ]]; then
|
||||||
dracut_install "${usrlibdir}/plymouth/text.so" \
|
dracut_install "${usrlibdir}/plymouth/text.so" \
|
||||||
"${usrlibdir}/plymouth/details.so" \
|
"${usrlibdir}/plymouth/details.so" \
|
||||||
"/usr/share/plymouth/themes/details/details.plymouth" \
|
"/usr/share/plymouth/themes/details/details.plymouth" \
|
||||||
|
|
@ -44,6 +44,6 @@ else
|
||||||
done
|
done
|
||||||
(
|
(
|
||||||
cd ${initdir}/usr/share/plymouth/themes;
|
cd ${initdir}/usr/share/plymouth/themes;
|
||||||
ln -s text/text.plymouth default.plymouth 2>&1;
|
ln -s text/text.plymouth default.plymouth 2>&1;
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -215,7 +215,7 @@ readkey() {
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*) cat "$mntp/$keypath" ;;
|
*) cat "$mntp/$keypath" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
umount "$mntp"
|
umount "$mntp"
|
||||||
rmdir "$mntp"
|
rmdir "$mntp"
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ if [ -f /etc/crypttab ] && getargbool 1 rd.luks.crypttab -n rd_NO_CRYPTTAB; then
|
||||||
luksname="$name"
|
luksname="$name"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# path used in crypttab
|
# path used in crypttab
|
||||||
else
|
else
|
||||||
cdev=$(readlink -f $dev)
|
cdev=$(readlink -f $dev)
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ check() {
|
||||||
[[ $hostonly ]] && {
|
[[ $hostonly ]] && {
|
||||||
rootdev=$(find_root_block_device)
|
rootdev=$(find_root_block_device)
|
||||||
if [[ $rootdev ]]; then
|
if [[ $rootdev ]]; then
|
||||||
# root lives on a block device, so we can be more precise about
|
# root lives on a block device, so we can be more precise about
|
||||||
# hostonly checking
|
# hostonly checking
|
||||||
check_block_and_slaves is_crypt "$rootdev" || return 1
|
check_block_and_slaves is_crypt "$rootdev" || return 1
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ else
|
||||||
LUKS=$(getargs rd.luks.uuid rd_LUKS_UUID)
|
LUKS=$(getargs rd.luks.uuid rd_LUKS_UUID)
|
||||||
|
|
||||||
if [ -n "$LUKS" ]; then
|
if [ -n "$LUKS" ]; then
|
||||||
for luksid in $LUKS; do
|
for luksid in $LUKS; do
|
||||||
luksid=${luksid##luks-}
|
luksid=${luksid##luks-}
|
||||||
{
|
{
|
||||||
printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", '
|
printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", '
|
||||||
|
|
@ -34,7 +34,7 @@ else
|
||||||
{
|
{
|
||||||
printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="%s ' $(command -v initqueue)
|
printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="%s ' $(command -v initqueue)
|
||||||
printf -- '--unique --onetime --name cryptroot-ask-%%k '
|
printf -- '--unique --onetime --name cryptroot-ask-%%k '
|
||||||
printf -- '%s $env{DEVNAME} luks-$env{ID_FS_UUID}"\n' $(command -v cryptroot-ask)
|
printf -- '%s $env{DEVNAME} luks-$env{ID_FS_UUID}"\n' $(command -v cryptroot-ask)
|
||||||
} >> /etc/udev/rules.d/70-luks.rules.new
|
} >> /etc/udev/rules.d/70-luks.rules.new
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||||
strstr "$(cat /proc/misc)" device-mapper || modprobe dm_mod
|
strstr "$(cat /proc/misc)" device-mapper || modprobe dm_mod
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,8 @@ echo $SETS|vinfo
|
||||||
|
|
||||||
if [ -n "$DM_RAIDS" ]; then
|
if [ -n "$DM_RAIDS" ]; then
|
||||||
# only activate specified DM RAIDS
|
# only activate specified DM RAIDS
|
||||||
for r in $DM_RAIDS; do
|
for r in $DM_RAIDS; do
|
||||||
for s in $SETS; do
|
for s in $SETS; do
|
||||||
if [ "${s##$r}" != "$s" ]; then
|
if [ "${s##$r}" != "$s" ]; then
|
||||||
info "Activating $s"
|
info "Activating $s"
|
||||||
dmraid -ay -i -p --rm_partitions "$s" 2>&1 | vinfo
|
dmraid -ay -i -p --rm_partitions "$s" 2>&1 | vinfo
|
||||||
|
|
@ -31,7 +31,7 @@ if [ -n "$DM_RAIDS" ]; then
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
# scan and activate all DM RAIDS
|
# scan and activate all DM RAIDS
|
||||||
for s in $SETS; do
|
for s in $SETS; do
|
||||||
info "Activating $s"
|
info "Activating $s"
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ check() {
|
||||||
[[ $hostonly ]] && {
|
[[ $hostonly ]] && {
|
||||||
rootdev=$(find_root_block_device)
|
rootdev=$(find_root_block_device)
|
||||||
if [[ $rootdev ]]; then
|
if [[ $rootdev ]]; then
|
||||||
# root lives on a block device, so we can be more precise about
|
# root lives on a block device, so we can be more precise about
|
||||||
# hostonly checking
|
# hostonly checking
|
||||||
check_block_and_slaves is_dmraid "$rootdev" || return 1
|
check_block_and_slaves is_dmraid "$rootdev" || return 1
|
||||||
else
|
else
|
||||||
|
|
@ -34,7 +34,7 @@ depends() {
|
||||||
}
|
}
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
dracut_install dmraid partx kpartx
|
dracut_install dmraid partx kpartx
|
||||||
|
|
||||||
inst dmeventd
|
inst dmeventd
|
||||||
|
|
||||||
|
|
@ -42,7 +42,7 @@ install() {
|
||||||
[ -e "$i" ] && dracut_install "$i"
|
[ -e "$i" ] && dracut_install "$i"
|
||||||
done
|
done
|
||||||
|
|
||||||
inst_rules 10-dm.rules 13-dm-disk.rules 95-dm-notify.rules
|
inst_rules 10-dm.rules 13-dm-disk.rules 95-dm-notify.rules
|
||||||
# Gentoo ebuild for LVM2 prior to 2.02.63-r1 doesn't install above rules
|
# Gentoo ebuild for LVM2 prior to 2.02.63-r1 doesn't install above rules
|
||||||
# files, but provides the one below:
|
# files, but provides the one below:
|
||||||
inst_rules 64-device-mapper.rules
|
inst_rules 64-device-mapper.rules
|
||||||
|
|
|
||||||
|
|
@ -5,15 +5,15 @@ case "$root" in
|
||||||
live:/dev/*)
|
live:/dev/*)
|
||||||
{
|
{
|
||||||
printf 'KERNEL=="%s", SYMLINK+="live"\n' \
|
printf 'KERNEL=="%s", SYMLINK+="live"\n' \
|
||||||
${root#live:/dev/}
|
${root#live:/dev/}
|
||||||
printf 'SYMLINK=="%s", SYMLINK+="live"\n' \
|
printf 'SYMLINK=="%s", SYMLINK+="live"\n' \
|
||||||
${root#live:/dev/}
|
${root#live:/dev/}
|
||||||
} >> $UDEVRULESD/99-live-mount.rules
|
} >> $UDEVRULESD/99-live-mount.rules
|
||||||
{
|
{
|
||||||
printf 'KERNEL=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root $env{DEVNAME}"\n' \
|
printf 'KERNEL=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root $env{DEVNAME}"\n' \
|
||||||
${root#live:/dev/}
|
${root#live:/dev/}
|
||||||
printf 'SYMLINK=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root $env{DEVNAME}"\n' \
|
printf 'SYMLINK=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root $env{DEVNAME}"\n' \
|
||||||
${root#live:/dev/}
|
${root#live:/dev/}
|
||||||
} >> $UDEVRULESD/99-live-squash.rules
|
} >> $UDEVRULESD/99-live-squash.rules
|
||||||
echo '[ -e /dev/root ]' > $hookdir/initqueue/finished/dmsquash.sh
|
echo '[ -e /dev/root ]' > $hookdir/initqueue/finished/dmsquash.sh
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ check() {
|
||||||
}
|
}
|
||||||
|
|
||||||
depends() {
|
depends() {
|
||||||
# if dmsetup is not installed, then we cannot support fedora/red hat
|
# if dmsetup is not installed, then we cannot support fedora/red hat
|
||||||
# style live images
|
# style live images
|
||||||
echo dm rootfs-block
|
echo dm rootfs-block
|
||||||
return 0
|
return 0
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,10 @@
|
||||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||||
|
|
||||||
for p in $(getargs rd.driver.post rdinsmodpost=); do
|
for p in $(getargs rd.driver.post rdinsmodpost=); do
|
||||||
(
|
(
|
||||||
IFS=,
|
IFS=,
|
||||||
for p in $i; do
|
for p in $i; do
|
||||||
modprobe $p
|
modprobe $p
|
||||||
done
|
done
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ installkernel() {
|
||||||
hostonly='' instmods atkbd i8042 usbhid hid-apple hid-sunplus hid-cherry hid-logitech hid-microsoft ehci-hcd ohci-hcd uhci-hcd
|
hostonly='' instmods atkbd i8042 usbhid hid-apple hid-sunplus hid-cherry hid-logitech hid-microsoft ehci-hcd ohci-hcd uhci-hcd
|
||||||
|
|
||||||
instmods "=drivers/pcmcia" =ide "=drivers/usb/storage"
|
instmods "=drivers/pcmcia" =ide "=drivers/usb/storage"
|
||||||
instmods $(filter_kernel_modules block_module_test)
|
instmods $(filter_kernel_modules block_module_test)
|
||||||
# if not on hostonly mode, install all known filesystems,
|
# if not on hostonly mode, install all known filesystems,
|
||||||
# if the required list is not set via the filesystems variable
|
# if the required list is not set via the filesystems variable
|
||||||
if ! [[ $hostonly ]]; then
|
if ! [[ $hostonly ]]; then
|
||||||
|
|
|
||||||
|
|
@ -2,25 +2,25 @@
|
||||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||||
|
|
||||||
for i in $(getargs rd.driver.pre rdloaddriver=); do
|
for i in $(getargs rd.driver.pre rdloaddriver=); do
|
||||||
(
|
(
|
||||||
IFS=,
|
IFS=,
|
||||||
for p in $i; do
|
for p in $i; do
|
||||||
modprobe $p 2>&1 | vinfo
|
modprobe $p 2>&1 | vinfo
|
||||||
done
|
done
|
||||||
)
|
)
|
||||||
done
|
done
|
||||||
|
|
||||||
for i in $(getargs rd.driver.blacklist rdblacklist=); do
|
for i in $(getargs rd.driver.blacklist rdblacklist=); do
|
||||||
(
|
(
|
||||||
IFS=,
|
IFS=,
|
||||||
for p in $i; do
|
for p in $i; do
|
||||||
echo "blacklist $p" >> /etc/modprobe.d/initramfsblacklist.conf
|
echo "blacklist $p" >> /etc/modprobe.d/initramfsblacklist.conf
|
||||||
done
|
done
|
||||||
)
|
)
|
||||||
done
|
done
|
||||||
|
|
||||||
for p in $(getargs rd.driver.post rdinsmodpost=); do
|
for p in $(getargs rd.driver.post rdinsmodpost=); do
|
||||||
echo "blacklist $p" >> /etc/modprobe.d/initramfsblacklist.conf
|
echo "blacklist $p" >> /etc/modprobe.d/initramfsblacklist.conf
|
||||||
_do_insmodpost=1
|
_do_insmodpost=1
|
||||||
done
|
done
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ lvmdevs=$(
|
||||||
done
|
done
|
||||||
)
|
)
|
||||||
|
|
||||||
if [ ! -e /etc/lvm/lvm.conf ]; then
|
if [ ! -e /etc/lvm/lvm.conf ]; then
|
||||||
{
|
{
|
||||||
echo 'devices {';
|
echo 'devices {';
|
||||||
echo -n ' filter = [ '
|
echo -n ' filter = [ '
|
||||||
|
|
@ -28,7 +28,7 @@ if [ ! -e /etc/lvm/lvm.conf ]; then
|
||||||
printf '"a|^/dev/%s$|", ' $dev;
|
printf '"a|^/dev/%s$|", ' $dev;
|
||||||
done;
|
done;
|
||||||
echo '"r/.*/" ]';
|
echo '"r/.*/" ]';
|
||||||
echo '}';
|
echo '}';
|
||||||
|
|
||||||
# establish LVM locking
|
# establish LVM locking
|
||||||
if [ -n $SNAPSHOT ]; then
|
if [ -n $SNAPSHOT ]; then
|
||||||
|
|
@ -66,7 +66,7 @@ IFS=$OLDIFS
|
||||||
maj=${1##*:}
|
maj=${1##*:}
|
||||||
min=$2
|
min=$2
|
||||||
sub=${3%% *}
|
sub=${3%% *}
|
||||||
sub=${sub%%\(*};
|
sub=${sub%%\(*};
|
||||||
|
|
||||||
check_lvm_ver 2 2 57 $maj $min $sub && \
|
check_lvm_ver 2 2 57 $maj $min $sub && \
|
||||||
nopoll="--poll n"
|
nopoll="--poll n"
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ check() {
|
||||||
[[ $hostonly ]] && {
|
[[ $hostonly ]] && {
|
||||||
rootdev=$(find_root_block_device)
|
rootdev=$(find_root_block_device)
|
||||||
if [[ $rootdev ]]; then
|
if [[ $rootdev ]]; then
|
||||||
# root lives on a block device, so we can be more precise about
|
# root lives on a block device, so we can be more precise about
|
||||||
# hostonly checking
|
# hostonly checking
|
||||||
check_block_and_slaves is_lvm "$rootdev" || return 1
|
check_block_and_slaves is_lvm "$rootdev" || return 1
|
||||||
else
|
else
|
||||||
|
|
@ -35,9 +35,9 @@ depends() {
|
||||||
install() {
|
install() {
|
||||||
inst lvm
|
inst lvm
|
||||||
|
|
||||||
inst_rules "$moddir/64-lvm.rules"
|
inst_rules "$moddir/64-lvm.rules"
|
||||||
|
|
||||||
if [[ $hostonly ]] || [[ $lvmconf = "yes" ]]; then
|
if [[ $hostonly ]] || [[ $lvmconf = "yes" ]]; then
|
||||||
if [ -f /etc/lvm/lvm.conf ]; then
|
if [ -f /etc/lvm/lvm.conf ]; then
|
||||||
inst /etc/lvm/lvm.conf
|
inst /etc/lvm/lvm.conf
|
||||||
# FIXME: near-term hack to establish read-only locking;
|
# FIXME: near-term hack to establish read-only locking;
|
||||||
|
|
|
||||||
|
|
@ -22,10 +22,10 @@ KERNEL!="md*", IMPORT{program}="/sbin/mdadm --examine --export $tempnode"
|
||||||
|
|
||||||
LABEL="do_md_inc"
|
LABEL="do_md_inc"
|
||||||
|
|
||||||
#
|
#
|
||||||
# if rd_MDADMCONF do not assemble incrementally
|
# if rd_MDADMCONF do not assemble incrementally
|
||||||
# defer auto assembly until the udev queue is settled
|
# defer auto assembly until the udev queue is settled
|
||||||
#
|
#
|
||||||
ENV{rd_MDADMCONF}!="?*", GOTO="md_auto_end"
|
ENV{rd_MDADMCONF}!="?*", GOTO="md_auto_end"
|
||||||
|
|
||||||
RUN+="/bin/sh -c 'ln -s /sbin/md_finished.sh $hookdir/initqueue/finished/md_finished.sh;/sbin/initqueue --settled --onetime --unique /sbin/mdadm_auto'"
|
RUN+="/bin/sh -c 'ln -s /sbin/md_finished.sh $hookdir/initqueue/finished/md_finished.sh;/sbin/initqueue --settled --onetime --unique /sbin/mdadm_auto'"
|
||||||
|
|
|
||||||
|
|
@ -3,5 +3,5 @@
|
||||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||||
|
|
||||||
info "Autoassembling MD Raid"
|
info "Autoassembling MD Raid"
|
||||||
mdadm -As --auto=yes --run 2>&1 | vinfo
|
mdadm -As --auto=yes --run 2>&1 | vinfo
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,8 @@ for i in /dev/md* /dev/md/*; do
|
||||||
[ -b $i ] || continue
|
[ -b $i ] || continue
|
||||||
|
|
||||||
mddetail=$(udevadm info --query=property --name=$i)
|
mddetail=$(udevadm info --query=property --name=$i)
|
||||||
case "$mddetail" in
|
case "$mddetail" in
|
||||||
*MD_LEVEL=container*)
|
*MD_LEVEL=container*)
|
||||||
;;
|
;;
|
||||||
*DEVTYPE=partition*)
|
*DEVTYPE=partition*)
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ mdadm -Is --run 2>&1 | vinfo
|
||||||
|
|
||||||
# there could still be some leftover devices
|
# there could still be some leftover devices
|
||||||
# which have had a container added
|
# which have had a container added
|
||||||
for md in /dev/md[0-9]* /dev/md/*; do
|
for md in /dev/md[0-9]* /dev/md/*; do
|
||||||
[ -b "$md" ] || continue
|
[ -b "$md" ] || continue
|
||||||
udevinfo="$(udevadm info --query=env --name=$md)"
|
udevinfo="$(udevadm info --query=env --name=$md)"
|
||||||
strstr "$udevinfo" "MD_UUID=" && continue
|
strstr "$udevinfo" "MD_UUID=" && continue
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ check() {
|
||||||
[[ $hostonly ]] && {
|
[[ $hostonly ]] && {
|
||||||
rootdev=$(find_root_block_device)
|
rootdev=$(find_root_block_device)
|
||||||
if [[ $rootdev ]]; then
|
if [[ $rootdev ]]; then
|
||||||
# root lives on a block device, so we can be more precise about
|
# root lives on a block device, so we can be more precise about
|
||||||
# hostonly checking
|
# hostonly checking
|
||||||
check_block_and_slaves is_mdraid "$rootdev" || return 1
|
check_block_and_slaves is_mdraid "$rootdev" || return 1
|
||||||
else
|
else
|
||||||
|
|
@ -36,12 +36,12 @@ installkernel() {
|
||||||
}
|
}
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
dracut_install mdadm partx
|
dracut_install mdadm partx
|
||||||
|
|
||||||
|
|
||||||
# XXX: mdmon really needs to run as non-root?
|
# XXX: mdmon really needs to run as non-root?
|
||||||
# If so, write only the user it needs in the initrd's /etc/passwd (and maybe /etc/group)
|
# If so, write only the user it needs in the initrd's /etc/passwd (and maybe /etc/group)
|
||||||
# in a similar fashion to modules.d/95nfs. Do not copy /etc/passwd and /etc/group from
|
# in a similar fashion to modules.d/95nfs. Do not copy /etc/passwd and /etc/group from
|
||||||
# the system into the initrd.
|
# the system into the initrd.
|
||||||
# dledford has hardware to test this, so he should be able to clean this up.
|
# dledford has hardware to test this, so he should be able to clean this up.
|
||||||
# inst /etc/passwd
|
# inst /etc/passwd
|
||||||
|
|
@ -53,11 +53,11 @@ install() {
|
||||||
|
|
||||||
inst_rules "$moddir/65-md-incremental-imsm.rules"
|
inst_rules "$moddir/65-md-incremental-imsm.rules"
|
||||||
|
|
||||||
if ! mdadm -Q -e imsm /dev/null &> /dev/null; then
|
if ! mdadm -Q -e imsm /dev/null &> /dev/null; then
|
||||||
inst_hook pre-trigger 30 "$moddir/md-noimsm.sh"
|
inst_hook pre-trigger 30 "$moddir/md-noimsm.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $hostonly ]] || [[ $mdadmconf = "yes" ]]; then
|
if [[ $hostonly ]] || [[ $mdadmconf = "yes" ]]; then
|
||||||
if [ -f /etc/mdadm.conf ]; then
|
if [ -f /etc/mdadm.conf ]; then
|
||||||
inst /etc/mdadm.conf
|
inst /etc/mdadm.conf
|
||||||
else
|
else
|
||||||
|
|
@ -67,7 +67,7 @@ install() {
|
||||||
|
|
||||||
if [ -x /sbin/mdmon ] ; then
|
if [ -x /sbin/mdmon ] ; then
|
||||||
dracut_install mdmon
|
dracut_install mdmon
|
||||||
fi
|
fi
|
||||||
inst_hook pre-udev 30 "$moddir/mdmon-pre-udev.sh"
|
inst_hook pre-udev 30 "$moddir/mdmon-pre-udev.sh"
|
||||||
|
|
||||||
inst "$moddir/mdraid_start.sh" /sbin/mdraid_start
|
inst "$moddir/mdraid_start.sh" /sbin/mdraid_start
|
||||||
|
|
|
||||||
|
|
@ -11,17 +11,17 @@ else
|
||||||
if [ -n "$MD_UUID" ]; then
|
if [ -n "$MD_UUID" ]; then
|
||||||
for f in /etc/udev/rules.d/65-md-incremental*.rules; do
|
for f in /etc/udev/rules.d/65-md-incremental*.rules; do
|
||||||
[ -e "$f" ] || continue
|
[ -e "$f" ] || continue
|
||||||
while read line; do
|
while read line; do
|
||||||
if [ "${line%%UUID CHECK}" != "$line" ]; then
|
if [ "${line%%UUID CHECK}" != "$line" ]; then
|
||||||
for uuid in $MD_UUID; do
|
for uuid in $MD_UUID; do
|
||||||
printf 'ENV{MD_UUID}=="%s", GOTO="do_md_inc"\n' $uuid
|
printf 'ENV{MD_UUID}=="%s", GOTO="do_md_inc"\n' $uuid
|
||||||
done;
|
done;
|
||||||
printf 'GOTO="md_inc_end"\n';
|
printf 'GOTO="md_inc_end"\n';
|
||||||
else
|
else
|
||||||
echo $line;
|
echo $line;
|
||||||
fi
|
fi
|
||||||
done < "${f}" > "${f}.new"
|
done < "${f}" > "${f}.new"
|
||||||
mv "${f}.new" "$f"
|
mv "${f}.new" "$f"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
if [ -e /etc/multipath.conf ]; then
|
if [ -e /etc/multipath.conf ]; then
|
||||||
HARD=""
|
HARD=""
|
||||||
while pidof multipathd >/dev/null 2>&1; do
|
while pidof multipathd >/dev/null 2>&1; do
|
||||||
for pid in $(pidof multipathd); do
|
for pid in $(pidof multipathd); do
|
||||||
kill $HARD $pid >/dev/null 2>&1
|
kill $HARD $pid >/dev/null 2>&1
|
||||||
done
|
done
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,6 @@ if [ -e /etc/multipath.conf ]; then
|
||||||
modprobe dm-multipath
|
modprobe dm-multipath
|
||||||
multipathd -B || multipathd
|
multipathd -B || multipathd
|
||||||
else
|
else
|
||||||
rm /etc/udev/rules.d/??-multipath.rules 2>/dev/null
|
rm /etc/udev/rules.d/??-multipath.rules 2>/dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
check() {
|
check() {
|
||||||
arch=$(uname -m)
|
arch=$(uname -m)
|
||||||
[ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1
|
[ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ depends() {
|
||||||
}
|
}
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
dracut_install -o ps grep more cat rm strace free showmount
|
dracut_install -o ps grep more cat rm strace free showmount
|
||||||
dracut_install -o ping netstat rpcinfo vi scp ping6 ssh
|
dracut_install -o ping netstat rpcinfo vi scp ping6 ssh
|
||||||
dracut_install -o fsck fsck.ext2 fsck.ext4 fsck.ext3 fsck.ext4dev fsck.vfat e2fsck
|
dracut_install -o fsck fsck.ext2 fsck.ext4 fsck.ext3 fsck.ext4dev fsck.vfat e2fsck
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,8 @@ installkernel() {
|
||||||
}
|
}
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
dracut_install ip
|
dracut_install ip
|
||||||
inst dcbtool
|
inst dcbtool
|
||||||
inst fipvlan
|
inst fipvlan
|
||||||
inst lldpad
|
inst lldpad
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
#
|
#
|
||||||
# This implementation is incomplete: Discovery mode is not implemented and
|
# This implementation is incomplete: Discovery mode is not implemented and
|
||||||
# the argument handling doesn't follow currently agreed formats. This is mainly
|
# the argument handling doesn't follow currently agreed formats. This is mainly
|
||||||
# because rfc4173 does not say anything about iscsi_initiator but open-iscsi's
|
# because rfc4173 does not say anything about iscsi_initiator but open-iscsi's
|
||||||
# iscsistart needs this.
|
# iscsistart needs this.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
@ -18,7 +18,7 @@ PATH=/usr/sbin:/usr/bin:/sbin:/bin
|
||||||
# Huh? Empty $2?
|
# Huh? Empty $2?
|
||||||
[ -z "$2" ] && exit 1
|
[ -z "$2" ] && exit 1
|
||||||
|
|
||||||
# Huh? Empty $3? This isn't really necessary, since NEWROOT isn't
|
# Huh? Empty $3? This isn't really necessary, since NEWROOT isn't
|
||||||
# used here. But let's be consistent
|
# used here. But let's be consistent
|
||||||
[ -z "$3" ] && exit 1
|
[ -z "$3" ] && exit 1
|
||||||
|
|
||||||
|
|
@ -69,7 +69,7 @@ arg=$(getargs rd.iscsi.in.username iscsi_in_username=)
|
||||||
arg=$(getargs rd.iscsi.in.password iscsi_in_password=)
|
arg=$(getargs rd.iscsi.in.password iscsi_in_password=)
|
||||||
[ -n "$arg" ] && iscsi_in_password=$arg
|
[ -n "$arg" ] && iscsi_in_password=$arg
|
||||||
|
|
||||||
handle_netroot()
|
handle_netroot()
|
||||||
{
|
{
|
||||||
iroot=$1
|
iroot=$1
|
||||||
# override conf/commandline options by dhcp root_path
|
# override conf/commandline options by dhcp root_path
|
||||||
|
|
@ -78,7 +78,7 @@ handle_netroot()
|
||||||
IFS=@
|
IFS=@
|
||||||
set $iroot
|
set $iroot
|
||||||
if [ $# -gt 1 ]; then
|
if [ $# -gt 1 ]; then
|
||||||
authinfo=$1; shift
|
authinfo=$1; shift
|
||||||
iroot=$*
|
iroot=$*
|
||||||
# allow empty authinfo to allow having an @ in iscsi_target_name like this:
|
# allow empty authinfo to allow having an @ in iscsi_target_name like this:
|
||||||
# netroot=iscsi:@192.168.1.100::3260::iqn.2009-01.com.example:testdi@sk
|
# netroot=iscsi:@192.168.1.100::3260::iqn.2009-01.com.example:testdi@sk
|
||||||
|
|
@ -92,13 +92,13 @@ handle_netroot()
|
||||||
iscsi_in_password=$4
|
iscsi_in_password=$4
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
IFS="$OLDIFS"
|
IFS="$OLDIFS"
|
||||||
|
|
||||||
local v=${iroot}:
|
local v=${iroot}:
|
||||||
local i
|
local i
|
||||||
set --
|
set --
|
||||||
while [ -n "$v" ]; do
|
while [ -n "$v" ]; do
|
||||||
if [ "${v#\[*:*:*\]:}" != "$v" ]; then
|
if [ "${v#\[*:*:*\]:}" != "$v" ]; then
|
||||||
# handle IPv6 address
|
# handle IPv6 address
|
||||||
|
|
@ -106,7 +106,7 @@ handle_netroot()
|
||||||
i="${i##\[}"
|
i="${i##\[}"
|
||||||
set -- "$@" "$i"
|
set -- "$@" "$i"
|
||||||
v=${v#\[$i\]:}
|
v=${v#\[$i\]:}
|
||||||
else
|
else
|
||||||
set -- "$@" "${v%%:*}"
|
set -- "$@" "${v%%:*}"
|
||||||
v=${v#*:}
|
v=${v#*:}
|
||||||
fi
|
fi
|
||||||
|
|
@ -183,8 +183,8 @@ handle_netroot()
|
||||||
}
|
}
|
||||||
|
|
||||||
# loop over all netroot parameter
|
# loop over all netroot parameter
|
||||||
if getarg netroot; then
|
if getarg netroot; then
|
||||||
for nroot in $(getargs netroot); do
|
for nroot in $(getargs netroot); do
|
||||||
[ "${netroot%%:*}" = "iscsi" ] || continue
|
[ "${netroot%%:*}" = "iscsi" ] || continue
|
||||||
handle_netroot ${nroot##iscsi:}
|
handle_netroot ${nroot##iscsi:}
|
||||||
done
|
done
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ installkernel() {
|
||||||
local iscsifuncs='iscsi_register_transport'
|
local iscsifuncs='iscsi_register_transport'
|
||||||
fgrep -q "$iscsifuncs" "$1"
|
fgrep -q "$iscsifuncs" "$1"
|
||||||
}
|
}
|
||||||
instmods $(filter_kernel_modules iscsi_module_test)
|
instmods $(filter_kernel_modules iscsi_module_test)
|
||||||
}
|
}
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ check() {
|
||||||
# If our prerequisites are not met, fail.
|
# If our prerequisites are not met, fail.
|
||||||
type -P nbd-client >/dev/null || return 1
|
type -P nbd-client >/dev/null || return 1
|
||||||
|
|
||||||
# if an nbd device is not somewhere in the chain of devices root is
|
# if an nbd device is not somewhere in the chain of devices root is
|
||||||
# mounted on, fail the hostonly check.
|
# mounted on, fail the hostonly check.
|
||||||
[[ $hostonly ]] && {
|
[[ $hostonly ]] && {
|
||||||
is_nbd() { [[ -b /dev/block/$1 && $1 == 43:* ]] ;}
|
is_nbd() { [[ -b /dev/block/$1 && $1 == 43:* ]] ;}
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ netroot_to_var() {
|
||||||
v=${v#*:}
|
v=${v#*:}
|
||||||
done
|
done
|
||||||
|
|
||||||
unset server port
|
unset server port
|
||||||
server=$2; port=$3;
|
server=$2; port=$3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,9 @@ install() {
|
||||||
type -P portmap >/dev/null && dracut_install portmap
|
type -P portmap >/dev/null && dracut_install portmap
|
||||||
type -P rpcbind >/dev/null && dracut_install rpcbind
|
type -P rpcbind >/dev/null && dracut_install rpcbind
|
||||||
|
|
||||||
dracut_install rpc.statd mount.nfs mount.nfs4 umount
|
dracut_install rpc.statd mount.nfs mount.nfs4 umount
|
||||||
[ -f /etc/netconfig ] && dracut_install /etc/netconfig
|
[ -f /etc/netconfig ] && dracut_install /etc/netconfig
|
||||||
dracut_install /etc/services
|
dracut_install /etc/services
|
||||||
dracut_install /etc/nsswitch.conf /etc/rpc /etc/protocols
|
dracut_install /etc/nsswitch.conf /etc/rpc /etc/protocols
|
||||||
dracut_install rpc.idmapd /etc/idmapd.conf
|
dracut_install rpc.idmapd /etc/idmapd.conf
|
||||||
dracut_install sed
|
dracut_install sed
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ if [ -z "$server" ] ; then
|
||||||
[ -n "$var" ] && server=$var && break;
|
[ -n "$var" ] && server=$var && break;
|
||||||
done
|
done
|
||||||
|
|
||||||
# XXX This blindly assumes that if new_root_path has to used that
|
# XXX This blindly assumes that if new_root_path has to used that
|
||||||
# XXX it really can be used as server
|
# XXX it really can be used as server
|
||||||
server=${server%%:*}
|
server=${server%%:*}
|
||||||
fi
|
fi
|
||||||
|
|
@ -113,7 +113,7 @@ else
|
||||||
# XXX Should we loop here?
|
# XXX Should we loop here?
|
||||||
{ mount -t nfs -o$options${options:+,}nolock,nfsvers=3 $server:$path $NEWROOT || \
|
{ mount -t nfs -o$options${options:+,}nolock,nfsvers=3 $server:$path $NEWROOT || \
|
||||||
mount -t nfs -o$options${options:+,}nolock,nfsvers=2 $server:$path $NEWROOT ; } \
|
mount -t nfs -o$options${options:+,}nolock,nfsvers=2 $server:$path $NEWROOT ; } \
|
||||||
&& { [ -e /dev/root ] || >/dev/root ; }
|
&& { [ -e /dev/root ] || >/dev/root ; }
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# inject new exit_if_exists
|
# inject new exit_if_exists
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ pid=$(pidof rpc.idmapd)
|
||||||
pid=$(pidof rpcbind)
|
pid=$(pidof rpcbind)
|
||||||
[ -n "$pid" ] && kill $pid
|
[ -n "$pid" ] && kill $pid
|
||||||
|
|
||||||
if incol2 /proc/mounts /var/lib/nfs/rpc_pipefs; then
|
if incol2 /proc/mounts /var/lib/nfs/rpc_pipefs; then
|
||||||
# try to create the destination directory
|
# try to create the destination directory
|
||||||
[ -d $NEWROOT/$rpcpipefspath ] || \
|
[ -d $NEWROOT/$rpcpipefspath ] || \
|
||||||
mkdir -m 0755 -p $NEWROOT/$rpcpipefspath 2>/dev/null
|
mkdir -m 0755 -p $NEWROOT/$rpcpipefspath 2>/dev/null
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
# root=/dev/nfs nfsroot=[server:]path[,options]
|
# root=/dev/nfs nfsroot=[server:]path[,options]
|
||||||
#
|
#
|
||||||
# In Legacy root=/dev/nfs mode, if the 'nfsroot' parameter is not given
|
# In Legacy root=/dev/nfs mode, if the 'nfsroot' parameter is not given
|
||||||
# on the command line or is empty, the dhcp root-path is used as
|
# on the command line or is empty, the dhcp root-path is used as
|
||||||
# [server:]path[:options] or the default "/tftpboot/%s" will be used.
|
# [server:]path[:options] or the default "/tftpboot/%s" will be used.
|
||||||
#
|
#
|
||||||
# If server is unspecified it will be pulled from one of the following
|
# If server is unspecified it will be pulled from one of the following
|
||||||
|
|
@ -44,7 +44,7 @@ if [ -n "$netroot" ] ; then
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
netroot=$root;
|
netroot=$root;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# LEGACY: nfsroot= is valid only if root=/dev/nfs
|
# LEGACY: nfsroot= is valid only if root=/dev/nfs
|
||||||
if [ -n "$nfsroot" ] ; then
|
if [ -n "$nfsroot" ] ; then
|
||||||
|
|
@ -106,7 +106,7 @@ fi;
|
||||||
# Done, all good!
|
# Done, all good!
|
||||||
rootok=1
|
rootok=1
|
||||||
|
|
||||||
# Shut up init error check or make sure that block parser wont get
|
# Shut up init error check or make sure that block parser wont get
|
||||||
# confused by having /dev/nfs[4]
|
# confused by having /dev/nfs[4]
|
||||||
root="$fstype"
|
root="$fstype"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ install() {
|
||||||
[[ -x "${bin}" ]] && {
|
[[ -x "${bin}" ]] && {
|
||||||
inst "${bin}" /usr/sbin/resume
|
inst "${bin}" /usr/sbin/resume
|
||||||
[[ -f /etc/suspend.conf ]] && inst /etc/suspend.conf
|
[[ -f /etc/suspend.conf ]] && inst /etc/suspend.conf
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||||
|
|
||||||
if resume=$(getarg resume=) && ! getarg noresume; then
|
if resume=$(getarg resume=) && ! getarg noresume; then
|
||||||
export resume
|
export resume
|
||||||
echo "$resume" >/.resume
|
echo "$resume" >/.resume
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ PATH=/usr/sbin:/usr/bin:/sbin:/bin
|
||||||
[ -x $(command -v resume) ] && command resume $a_splash "$resume"
|
[ -x $(command -v resume) ] && command resume $a_splash "$resume"
|
||||||
|
|
||||||
# parsing the output of ls is Bad, but until there is a better way...
|
# parsing the output of ls is Bad, but until there is a better way...
|
||||||
ls -lH "$resume" | (
|
ls -lH "$resume" | (
|
||||||
read x x x x maj min x;
|
read x x x x maj min x;
|
||||||
echo "${maj%,}:$min"> /sys/power/resume)
|
echo "${maj%,}:$min"> /sys/power/resume)
|
||||||
>/.resume
|
>/.resume
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,11 @@
|
||||||
if [ "${root%%:*}" = "block" ]; then
|
if [ "${root%%:*}" = "block" ]; then
|
||||||
{
|
{
|
||||||
printf 'KERNEL=="%s", SYMLINK+="root"\n' \
|
printf 'KERNEL=="%s", SYMLINK+="root"\n' \
|
||||||
${root#block:/dev/}
|
${root#block:/dev/}
|
||||||
printf 'SYMLINK=="%s", SYMLINK+="root"\n' \
|
printf 'SYMLINK=="%s", SYMLINK+="root"\n' \
|
||||||
${root#block:/dev/}
|
${root#block:/dev/}
|
||||||
} >> $UDEVRULESD/99-root.rules
|
} >> $UDEVRULESD/99-root.rules
|
||||||
|
|
||||||
printf '[ -e "%s" ] && { ln -s "%s" /dev/root 2>/dev/null; rm "$job"; }\n' \
|
printf '[ -e "%s" ] && { ln -s "%s" /dev/root 2>/dev/null; rm "$job"; }\n' \
|
||||||
"${root#block:}" "${root#block:}" >> $hookdir/initqueue/settled/blocksymlink.sh
|
"${root#block:}" "${root#block:}" >> $hookdir/initqueue/settled/blocksymlink.sh
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ filter_rootopts() {
|
||||||
|
|
||||||
if [ -n "$root" -a -z "${root%%block:*}" ]; then
|
if [ -n "$root" -a -z "${root%%block:*}" ]; then
|
||||||
mount -t ${fstype:-auto} -o "$rflags",ro "${root#block:}" "$NEWROOT" \
|
mount -t ${fstype:-auto} -o "$rflags",ro "${root#block:}" "$NEWROOT" \
|
||||||
&& ROOTFS_MOUNTED=yes
|
&& ROOTFS_MOUNTED=yes
|
||||||
|
|
||||||
READONLY=
|
READONLY=
|
||||||
fsckoptions=
|
fsckoptions=
|
||||||
|
|
@ -77,14 +77,14 @@ if [ -n "$root" -a -z "${root%%block:*}" ]; then
|
||||||
&& ! getarg rootflags \
|
&& ! getarg rootflags \
|
||||||
&& [ -f "$NEWROOT/etc/fstab" ] \
|
&& [ -f "$NEWROOT/etc/fstab" ] \
|
||||||
&& ! [ -L "$NEWROOT/etc/fstab" ]; then
|
&& ! [ -L "$NEWROOT/etc/fstab" ]; then
|
||||||
# if $NEWROOT/etc/fstab contains special mount options for
|
# if $NEWROOT/etc/fstab contains special mount options for
|
||||||
# the root filesystem,
|
# the root filesystem,
|
||||||
# remount it with the proper options
|
# remount it with the proper options
|
||||||
rootopts="defaults"
|
rootopts="defaults"
|
||||||
while read dev mp fs opts rest; do
|
while read dev mp fs opts rest; do
|
||||||
# skip comments
|
# skip comments
|
||||||
[ "${dev%%#*}" != "$dev" ] && continue
|
[ "${dev%%#*}" != "$dev" ] && continue
|
||||||
|
|
||||||
if [ "$mp" = "/" ]; then
|
if [ "$mp" = "/" ]; then
|
||||||
rootfs=$fs
|
rootfs=$fs
|
||||||
rootopts=$opts
|
rootopts=$opts
|
||||||
|
|
@ -115,10 +115,10 @@ if [ -n "$root" -a -z "${root%%block:*}" ]; then
|
||||||
if [ -z "$fastboot" -a "$READONLY" != "yes" ]; then
|
if [ -z "$fastboot" -a "$READONLY" != "yes" ]; then
|
||||||
info "Checking filesystems"
|
info "Checking filesystems"
|
||||||
info fsck -T -t noopts=_netdev -A $fsckoptions
|
info fsck -T -t noopts=_netdev -A $fsckoptions
|
||||||
out=$(fsck -T -t noopts=_netdev -A $fsckoptions)
|
out=$(fsck -T -t noopts=_netdev -A $fsckoptions)
|
||||||
export RD_ROOTFS_FSCK=$?
|
export RD_ROOTFS_FSCK=$?
|
||||||
echo $RD_ROOTFS_FSCK > /run/initramfs/root-fsck
|
echo $RD_ROOTFS_FSCK > /run/initramfs/root-fsck
|
||||||
|
|
||||||
# A return of 4 or higher means there were serious problems.
|
# A return of 4 or higher means there were serious problems.
|
||||||
if [ $RD_ROOTFS_FSCK -gt 3 ]; then
|
if [ $RD_ROOTFS_FSCK -gt 3 ]; then
|
||||||
warn $out
|
warn $out
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ install() {
|
||||||
for TERMINFODIR in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
|
for TERMINFODIR in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
|
||||||
[ -d ${TERMINFODIR} ] && break
|
[ -d ${TERMINFODIR} ] && break
|
||||||
done
|
done
|
||||||
|
|
||||||
[ -d ${TERMINFODIR} ] && \
|
[ -d ${TERMINFODIR} ] && \
|
||||||
dracut_install $(find ${TERMINFODIR} -type f)
|
dracut_install $(find ${TERMINFODIR} -type f)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ install() {
|
||||||
dracut_install basename
|
dracut_install basename
|
||||||
inst_rules 50-udev-default.rules 60-persistent-storage.rules \
|
inst_rules 50-udev-default.rules 60-persistent-storage.rules \
|
||||||
61-persistent-storage-edd.rules 80-drivers.rules 95-udev-late.rules \
|
61-persistent-storage-edd.rules 80-drivers.rules 95-udev-late.rules \
|
||||||
60-pcmcia.rules
|
60-pcmcia.rules
|
||||||
#Some debian udev rules are named differently
|
#Some debian udev rules are named differently
|
||||||
inst_rules 50-udev.rules 95-late.rules
|
inst_rules 50-udev.rules 95-late.rules
|
||||||
|
|
||||||
|
|
@ -22,8 +22,8 @@ install() {
|
||||||
dracut_install cat uname
|
dracut_install cat uname
|
||||||
|
|
||||||
|
|
||||||
inst_dir /run/udev
|
inst_dir /run/udev
|
||||||
inst_dir /run/udev/rules.d
|
inst_dir /run/udev/rules.d
|
||||||
|
|
||||||
if [ ! -x /lib/udev/vol_id ]; then
|
if [ ! -x /lib/udev/vol_id ]; then
|
||||||
dracut_install blkid
|
dracut_install blkid
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,14 @@
|
||||||
|
|
||||||
check() {
|
check() {
|
||||||
arch=$(uname -m)
|
arch=$(uname -m)
|
||||||
[ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1
|
[ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
depends() {
|
depends() {
|
||||||
arch=$(uname -m)
|
arch=$(uname -m)
|
||||||
[ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1
|
[ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
getargbool 1 rd.zfcp.conf -n rd_NO_ZFCPCONF || rm /etc/zfcp.conf
|
getargbool 1 rd.zfcp.conf -n rd_NO_ZFCPCONF || rm /etc/zfcp.conf
|
||||||
|
|
||||||
for zfcp_arg in $(getargs rd.zfcp 'rd_ZFCP='); do
|
for zfcp_arg in $(getargs rd.zfcp 'rd_ZFCP='); do
|
||||||
(
|
(
|
||||||
IFS=","
|
IFS=","
|
||||||
set $zfcp_arg
|
set $zfcp_arg
|
||||||
echo "$@" >> /etc/zfcp.conf
|
echo "$@" >> /etc/zfcp.conf
|
||||||
|
|
|
||||||
|
|
@ -6,15 +6,15 @@
|
||||||
# deviceno WWPN FCPLUN
|
# deviceno WWPN FCPLUN
|
||||||
#
|
#
|
||||||
# Example:
|
# Example:
|
||||||
# 0.0.4000 0x5005076300C213e9 0x5022000000000000
|
# 0.0.4000 0x5005076300C213e9 0x5022000000000000
|
||||||
# 0.0.4001 0x5005076300c213e9 0x5023000000000000
|
# 0.0.4001 0x5005076300c213e9 0x5023000000000000
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# manual setup:
|
# manual setup:
|
||||||
# modprobe zfcp
|
# modprobe zfcp
|
||||||
# echo 1 > /sys/bus/ccw/drivers/zfcp/0.0.4000/online
|
# echo 1 > /sys/bus/ccw/drivers/zfcp/0.0.4000/online
|
||||||
# echo LUN > /sys/bus/ccw/drivers/zfcp/0.0.4000/WWPN/unit_add
|
# echo LUN > /sys/bus/ccw/drivers/zfcp/0.0.4000/WWPN/unit_add
|
||||||
#
|
#
|
||||||
# Example:
|
# Example:
|
||||||
# modprobe zfcp
|
# modprobe zfcp
|
||||||
# echo 1 > /sys/bus/ccw/drivers/zfcp/0.0.4000/online
|
# echo 1 > /sys/bus/ccw/drivers/zfcp/0.0.4000/online
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
check() {
|
check() {
|
||||||
arch=$(uname -m)
|
arch=$(uname -m)
|
||||||
[ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1
|
[ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,11 @@
|
||||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||||
|
|
||||||
# FIXME: load selinux policy. this should really be done after we switchroot
|
# FIXME: load selinux policy. this should really be done after we switchroot
|
||||||
|
|
||||||
rd_load_policy()
|
rd_load_policy()
|
||||||
{
|
{
|
||||||
# If SELinux is disabled exit now
|
# If SELinux is disabled exit now
|
||||||
getarg "selinux=0" > /dev/null && return 0
|
getarg "selinux=0" > /dev/null && return 0
|
||||||
|
|
||||||
SELINUX="enforcing"
|
SELINUX="enforcing"
|
||||||
|
|
@ -14,7 +14,7 @@ rd_load_policy()
|
||||||
|
|
||||||
# Check whether SELinux is in permissive mode
|
# Check whether SELinux is in permissive mode
|
||||||
permissive=0
|
permissive=0
|
||||||
getarg "enforcing=0" > /dev/null
|
getarg "enforcing=0" > /dev/null
|
||||||
if [ $? -eq 0 -o "$SELINUX" = "permissive" ]; then
|
if [ $? -eq 0 -o "$SELINUX" = "permissive" ]; then
|
||||||
permissive=1
|
permissive=1
|
||||||
fi
|
fi
|
||||||
|
|
@ -24,7 +24,7 @@ rd_load_policy()
|
||||||
local ret=0
|
local ret=0
|
||||||
local out
|
local out
|
||||||
info "Loading SELinux policy"
|
info "Loading SELinux policy"
|
||||||
# load_policy does mount /proc and /selinux in
|
# load_policy does mount /proc and /selinux in
|
||||||
# libselinux,selinux_init_load_policy()
|
# libselinux,selinux_init_load_policy()
|
||||||
if [ -x "$NEWROOT/sbin/load_policy" ]; then
|
if [ -x "$NEWROOT/sbin/load_policy" ]; then
|
||||||
out=$(chroot "$NEWROOT" /sbin/load_policy -i 2>&1)
|
out=$(chroot "$NEWROOT" /sbin/load_policy -i 2>&1)
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
Syslog support for dracut
|
Syslog support for dracut
|
||||||
|
|
||||||
This module provides syslog functionality in the initrd.
|
This module provides syslog functionality in the initrd.
|
||||||
This is especially interesting when complex configuration being
|
This is especially interesting when complex configuration being
|
||||||
used to provide access to the device the rootfs resides on.
|
used to provide access to the device the rootfs resides on.
|
||||||
|
|
||||||
When this module is installed into the ramfs it is triggered by
|
When this module is installed into the ramfs it is triggered by
|
||||||
the udev event from the nic being setup (online).
|
the udev event from the nic being setup (online).
|
||||||
|
|
||||||
Then if syslog is configured it is started and will forward all
|
Then if syslog is configured it is started and will forward all
|
||||||
kernel messages to the given syslog server.
|
kernel messages to the given syslog server.
|
||||||
|
|
||||||
The syslog implementation is detected automatically by finding the
|
The syslog implementation is detected automatically by finding the
|
||||||
apropriate binary with the following order:
|
apropriate binary with the following order:
|
||||||
rsyslogd
|
rsyslogd
|
||||||
syslogd
|
syslogd
|
||||||
|
|
@ -20,5 +20,5 @@ Then if detected the syslog.conf is generated and syslog is started.
|
||||||
Bootparameters:
|
Bootparameters:
|
||||||
syslogserver=ip Where to syslog to
|
syslogserver=ip Where to syslog to
|
||||||
sysloglevel=level What level has to be logged
|
sysloglevel=level What level has to be logged
|
||||||
syslogtype=rsyslog|syslog|syslogng
|
syslogtype=rsyslog|syslog|syslogng
|
||||||
Don't auto detect syslog but set it
|
Don't auto detect syslog but set it
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
#Bootparameters:
|
#Bootparameters:
|
||||||
#syslogserver=ip Where to syslog to
|
#syslogserver=ip Where to syslog to
|
||||||
#sysloglevel=level What level has to be logged
|
#sysloglevel=level What level has to be logged
|
||||||
#syslogtype=rsyslog|syslog|syslogng
|
#syslogtype=rsyslog|syslog|syslogng
|
||||||
# Don't auto detect syslog but set it
|
# Don't auto detect syslog but set it
|
||||||
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ rsyslog_config() {
|
||||||
shift
|
shift
|
||||||
local filters=$*
|
local filters=$*
|
||||||
local filter=
|
local filter=
|
||||||
|
|
||||||
cat $syslog_template
|
cat $syslog_template
|
||||||
|
|
||||||
for filter in $filters; do
|
for filter in $filters; do
|
||||||
|
|
@ -32,4 +32,4 @@ template=/etc/templates/rsyslog.conf
|
||||||
if [ -n "$server" ]; then
|
if [ -n "$server" ]; then
|
||||||
rsyslog_config "$server" "$template" "$filters" > $conf
|
rsyslog_config "$server" "$template" "$filters" > $conf
|
||||||
rsyslogd -c3
|
rsyslogd -c3
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ detect_syslog() {
|
||||||
fi
|
fi
|
||||||
echo "$syslogtype"
|
echo "$syslogtype"
|
||||||
[ -n "$syslogtype" ]
|
[ -n "$syslogtype" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
read syslogtype < /tmp/syslog.type
|
read syslogtype < /tmp/syslog.type
|
||||||
if [ -z "$syslogtype" ]; then
|
if [ -z "$syslogtype" ]; then
|
||||||
|
|
|
||||||
|
|
@ -52,12 +52,12 @@ _dogetarg() {
|
||||||
|
|
||||||
for _o in $CMDLINE; do
|
for _o in $CMDLINE; do
|
||||||
if [ "$_o" = "$1" ]; then
|
if [ "$_o" = "$1" ]; then
|
||||||
return 0;
|
return 0;
|
||||||
fi
|
fi
|
||||||
[ "${_o%%=*}" = "${1%=}" ] && _val=${_o#*=};
|
[ "${_o%%=*}" = "${1%=}" ] && _val=${_o#*=};
|
||||||
done
|
done
|
||||||
if [ -n "$_val" ]; then
|
if [ -n "$_val" ]; then
|
||||||
echo $_val;
|
echo $_val;
|
||||||
return 0;
|
return 0;
|
||||||
fi
|
fi
|
||||||
return 1;
|
return 1;
|
||||||
|
|
@ -86,7 +86,7 @@ getarg() {
|
||||||
shift;;
|
shift;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
[ "$RD_DEBUG" = "yes" ] && set -x
|
[ "$RD_DEBUG" = "yes" ] && set -x
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -105,7 +105,7 @@ getargbool() {
|
||||||
}
|
}
|
||||||
|
|
||||||
_dogetargs() {
|
_dogetargs() {
|
||||||
set +x
|
set +x
|
||||||
local _o _found
|
local _o _found
|
||||||
unset _o
|
unset _o
|
||||||
unset _found
|
unset _found
|
||||||
|
|
@ -116,7 +116,7 @@ _dogetargs() {
|
||||||
return 0;
|
return 0;
|
||||||
fi
|
fi
|
||||||
if [ "${_o%%=*}" = "${1%=}" ]; then
|
if [ "${_o%%=*}" = "${1%=}" ]; then
|
||||||
echo -n "${_o#*=} ";
|
echo -n "${_o#*=} ";
|
||||||
_found=1;
|
_found=1;
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
@ -134,10 +134,10 @@ getargs() {
|
||||||
done
|
done
|
||||||
if [ -n "$_val" ]; then
|
if [ -n "$_val" ]; then
|
||||||
echo -n $_val
|
echo -n $_val
|
||||||
[ "$RD_DEBUG" = "yes" ] && set -x
|
[ "$RD_DEBUG" = "yes" ] && set -x
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
[ "$RD_DEBUG" = "yes" ] && set -x
|
[ "$RD_DEBUG" = "yes" ] && set -x
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -146,7 +146,7 @@ getargs() {
|
||||||
# it just returns 0. Otherwise 1 is returned.
|
# it just returns 0. Otherwise 1 is returned.
|
||||||
# $1 = options separated by commas
|
# $1 = options separated by commas
|
||||||
# $2 = option we are interested in
|
# $2 = option we are interested in
|
||||||
#
|
#
|
||||||
# Example:
|
# Example:
|
||||||
# $1 = cipher=aes-cbc-essiv:sha256,hash=sha256,verify
|
# $1 = cipher=aes-cbc-essiv:sha256,hash=sha256,verify
|
||||||
# $2 = hash
|
# $2 = hash
|
||||||
|
|
@ -199,14 +199,14 @@ setdebug() {
|
||||||
if [ -e /proc/cmdline ]; then
|
if [ -e /proc/cmdline ]; then
|
||||||
RD_DEBUG=no
|
RD_DEBUG=no
|
||||||
if getargbool 0 rd.debug -y rdinitdebug -y rdnetdebug; then
|
if getargbool 0 rd.debug -y rdinitdebug -y rdnetdebug; then
|
||||||
RD_DEBUG=yes
|
RD_DEBUG=yes
|
||||||
[ -n "$BASH" ] && \
|
[ -n "$BASH" ] && \
|
||||||
export PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): ';
|
export PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): ';
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
export RD_DEBUG
|
export RD_DEBUG
|
||||||
fi
|
fi
|
||||||
[ "$RD_DEBUG" = "yes" ] && set -x
|
[ "$RD_DEBUG" = "yes" ] && set -x
|
||||||
}
|
}
|
||||||
|
|
||||||
setdebug
|
setdebug
|
||||||
|
|
@ -242,7 +242,7 @@ die() {
|
||||||
echo "<24>dracut: Refusing to continue";
|
echo "<24>dracut: Refusing to continue";
|
||||||
} > /dev/kmsg
|
} > /dev/kmsg
|
||||||
|
|
||||||
{
|
{
|
||||||
echo "warn dracut: FATAL: \"$@\"";
|
echo "warn dracut: FATAL: \"$@\"";
|
||||||
echo "warn dracut: Refusing to continue";
|
echo "warn dracut: Refusing to continue";
|
||||||
echo "exit 1"
|
echo "exit 1"
|
||||||
|
|
@ -271,11 +271,11 @@ info() {
|
||||||
check_quiet
|
check_quiet
|
||||||
echo "<30>dracut: $@" > /dev/kmsg
|
echo "<30>dracut: $@" > /dev/kmsg
|
||||||
[ "$DRACUT_QUIET" != "yes" ] && \
|
[ "$DRACUT_QUIET" != "yes" ] && \
|
||||||
echo "dracut: $@"
|
echo "dracut: $@"
|
||||||
}
|
}
|
||||||
|
|
||||||
vinfo() {
|
vinfo() {
|
||||||
while read line; do
|
while read line; do
|
||||||
info $line;
|
info $line;
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
@ -339,16 +339,16 @@ ismounted() {
|
||||||
|
|
||||||
wait_for_if_up() {
|
wait_for_if_up() {
|
||||||
local cnt=0
|
local cnt=0
|
||||||
while [ $cnt -lt 20 ]; do
|
while [ $cnt -lt 20 ]; do
|
||||||
li=$(ip link show $1)
|
li=$(ip link show $1)
|
||||||
[ -z "${li##*state UP*}" ] && return 0
|
[ -z "${li##*state UP*}" ] && return 0
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
cnt=$(($cnt+1))
|
cnt=$(($cnt+1))
|
||||||
done
|
done
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# root=nfs:[<server-ip>:]<root-dir>[:<nfs-options>]
|
# root=nfs:[<server-ip>:]<root-dir>[:<nfs-options>]
|
||||||
# root=nfs4:[<server-ip>:]<root-dir>[:<nfs-options>]
|
# root=nfs4:[<server-ip>:]<root-dir>[:<nfs-options>]
|
||||||
nfsroot_to_var() {
|
nfsroot_to_var() {
|
||||||
# strip nfs[4]:
|
# strip nfs[4]:
|
||||||
|
|
@ -370,10 +370,10 @@ nfsroot_to_var() {
|
||||||
options="${options##:}"
|
options="${options##:}"
|
||||||
# strip ":"
|
# strip ":"
|
||||||
options="${options%%:}"
|
options="${options%%:}"
|
||||||
|
|
||||||
# Does it really start with '/'?
|
# Does it really start with '/'?
|
||||||
[ -n "${path%%/*}" ] && path="error";
|
[ -n "${path%%/*}" ] && path="error";
|
||||||
|
|
||||||
#Fix kernel legacy style separating path and options with ','
|
#Fix kernel legacy style separating path and options with ','
|
||||||
if [ "$path" != "${path#*,}" ] ; then
|
if [ "$path" != "${path#*,}" ] ; then
|
||||||
options=${path#*,}
|
options=${path#*,}
|
||||||
|
|
@ -384,7 +384,7 @@ nfsroot_to_var() {
|
||||||
ip_to_var() {
|
ip_to_var() {
|
||||||
local v=${1}:
|
local v=${1}:
|
||||||
local i
|
local i
|
||||||
set --
|
set --
|
||||||
while [ -n "$v" ]; do
|
while [ -n "$v" ]; do
|
||||||
if [ "${v#\[*:*:*\]:}" != "$v" ]; then
|
if [ "${v#\[*:*:*\]:}" != "$v" ]; then
|
||||||
# handle IPv6 address
|
# handle IPv6 address
|
||||||
|
|
@ -392,7 +392,7 @@ ip_to_var() {
|
||||||
i="${i##\[}"
|
i="${i##\[}"
|
||||||
set -- "$@" "$i"
|
set -- "$@" "$i"
|
||||||
v=${v#\[$i\]:}
|
v=${v#\[$i\]:}
|
||||||
else
|
else
|
||||||
set -- "$@" "${v%%:*}"
|
set -- "$@" "${v%%:*}"
|
||||||
v=${v#*:}
|
v=${v#*:}
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ wait_for_loginit()
|
||||||
exec 0<>/dev/console 1<>/dev/console 2<>/dev/console
|
exec 0<>/dev/console 1<>/dev/console 2<>/dev/console
|
||||||
# wait for loginit
|
# wait for loginit
|
||||||
i=0
|
i=0
|
||||||
while [ $i -lt 10 ]; do
|
while [ $i -lt 10 ]; do
|
||||||
if [ ! -e /run/initramfs/loginit.pipe ]; then
|
if [ ! -e /run/initramfs/loginit.pipe ]; then
|
||||||
j=$(jobs)
|
j=$(jobs)
|
||||||
[ -z "$j" ] && break
|
[ -z "$j" ] && break
|
||||||
|
|
@ -25,7 +25,7 @@ wait_for_loginit()
|
||||||
fi
|
fi
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
i=$(($i+1))
|
i=$(($i+1))
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ $i -eq 10 ]; then
|
if [ $i -eq 10 ]; then
|
||||||
kill %1 >/dev/null 2>&1
|
kill %1 >/dev/null 2>&1
|
||||||
|
|
@ -41,7 +41,7 @@ emergency_shell()
|
||||||
set +e
|
set +e
|
||||||
if [ "$1" = "-n" ]; then
|
if [ "$1" = "-n" ]; then
|
||||||
_rdshell_name=$2
|
_rdshell_name=$2
|
||||||
shift 2
|
shift 2
|
||||||
else
|
else
|
||||||
_rdshell_name=dracut
|
_rdshell_name=dracut
|
||||||
fi
|
fi
|
||||||
|
|
@ -105,7 +105,7 @@ if ! ismounted /dev; then
|
||||||
# try to mount devtmpfs
|
# try to mount devtmpfs
|
||||||
if ! mount -t devtmpfs -o mode=0755,nosuid,noexec udev /dev >/dev/null 2>&1; then
|
if ! mount -t devtmpfs -o mode=0755,nosuid,noexec udev /dev >/dev/null 2>&1; then
|
||||||
# if it failed fall back to normal tmpfs
|
# if it failed fall back to normal tmpfs
|
||||||
mount -t tmpfs -o mode=0755,nosuid udev /dev >/dev/null 2>&1
|
mount -t tmpfs -o mode=0755,nosuid udev /dev >/dev/null 2>&1
|
||||||
# Make some basic devices first, let udev handle the rest
|
# Make some basic devices first, let udev handle the rest
|
||||||
mknod -m 0666 /dev/null c 1 3
|
mknod -m 0666 /dev/null c 1 3
|
||||||
mknod -m 0666 /dev/ptmx c 5 2
|
mknod -m 0666 /dev/ptmx c 5 2
|
||||||
|
|
@ -143,7 +143,7 @@ if [ $UDEVVERSION -gt 166 ]; then
|
||||||
# newer versions of udev use /run/udev/rules.d
|
# newer versions of udev use /run/udev/rules.d
|
||||||
export UDEVRULESD=/run/udev/rules.d
|
export UDEVRULESD=/run/udev/rules.d
|
||||||
else
|
else
|
||||||
mkdir -m 0755 /dev/.udev /dev/.udev/rules.d
|
mkdir -m 0755 /dev/.udev /dev/.udev/rules.d
|
||||||
export UDEVRULESD=/dev/.udev/rules.d
|
export UDEVRULESD=/dev/.udev/rules.d
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -209,7 +209,7 @@ i=0
|
||||||
while :; do
|
while :; do
|
||||||
|
|
||||||
check_finished && break
|
check_finished && break
|
||||||
|
|
||||||
udevsettle
|
udevsettle
|
||||||
|
|
||||||
check_finished && break
|
check_finished && break
|
||||||
|
|
@ -217,7 +217,7 @@ while :; do
|
||||||
if [ -f $hookdir/initqueue/work ]; then
|
if [ -f $hookdir/initqueue/work ]; then
|
||||||
rm $hookdir/initqueue/work
|
rm $hookdir/initqueue/work
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for job in $hookdir/initqueue/*.sh; do
|
for job in $hookdir/initqueue/*.sh; do
|
||||||
[ -e "$job" ] || break
|
[ -e "$job" ] || break
|
||||||
job=$job . $job
|
job=$job . $job
|
||||||
|
|
@ -241,7 +241,7 @@ while :; do
|
||||||
# which report no medium for quiet
|
# which report no medium for quiet
|
||||||
# some time.
|
# some time.
|
||||||
for cdrom in /sys/block/sr*; do
|
for cdrom in /sys/block/sr*; do
|
||||||
[ -e "$cdrom" ] || continue
|
[ -e "$cdrom" ] || continue
|
||||||
# skip, if cdrom medium was already found
|
# skip, if cdrom medium was already found
|
||||||
strstr "$(udevadm info --query=env --path=${cdrom##/sys})" \
|
strstr "$(udevadm info --query=env --path=${cdrom##/sys})" \
|
||||||
ID_CDROM_MEDIA && continue
|
ID_CDROM_MEDIA && continue
|
||||||
|
|
@ -256,7 +256,7 @@ while :; do
|
||||||
echo change > "$cdrom/uevent"
|
echo change > "$cdrom/uevent"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
i=$(($i+1))
|
i=$(($i+1))
|
||||||
[ $i -gt $RDRETRY ] \
|
[ $i -gt $RDRETRY ] \
|
||||||
&& { flock -s 9 ; emergency_shell "No root device \"$root\" found"; } 9>/.console_lock
|
&& { flock -s 9 ; emergency_shell "No root device \"$root\" found"; } 9>/.console_lock
|
||||||
|
|
@ -266,7 +266,7 @@ unset queuetriggered
|
||||||
|
|
||||||
# reset cdrom polling
|
# reset cdrom polling
|
||||||
for cdrom in /sys/block/sr*; do
|
for cdrom in /sys/block/sr*; do
|
||||||
[ -e "$cdrom" ] || continue
|
[ -e "$cdrom" ] || continue
|
||||||
if [ -e "$cdrom"/events_poll_msecs ]; then
|
if [ -e "$cdrom"/events_poll_msecs ]; then
|
||||||
echo -1 > "$cdrom"/events_poll_msecs
|
echo -1 > "$cdrom"/events_poll_msecs
|
||||||
fi
|
fi
|
||||||
|
|
@ -296,7 +296,7 @@ done
|
||||||
|
|
||||||
{
|
{
|
||||||
echo -n "Mounted root filesystem "
|
echo -n "Mounted root filesystem "
|
||||||
while read dev mp rest; do [ "$mp" = "$NEWROOT" ] && echo $dev; done < /proc/mounts
|
while read dev mp rest; do [ "$mp" = "$NEWROOT" ] && echo $dev; done < /proc/mounts
|
||||||
} | vinfo
|
} | vinfo
|
||||||
|
|
||||||
# pre pivot scripts are sourced just before we switch over to the new root.
|
# pre pivot scripts are sourced just before we switch over to the new root.
|
||||||
|
|
@ -326,7 +326,7 @@ if [ $UDEVVERSION -lt 168 ]; then
|
||||||
udevadm control --stop-exec-queue
|
udevadm control --stop-exec-queue
|
||||||
|
|
||||||
HARD=""
|
HARD=""
|
||||||
while pidof udevd >/dev/null 2>&1; do
|
while pidof udevd >/dev/null 2>&1; do
|
||||||
for pid in $(pidof udevd); do
|
for pid in $(pidof udevd); do
|
||||||
kill $HARD $pid >/dev/null 2>&1
|
kill $HARD $pid >/dev/null 2>&1
|
||||||
done
|
done
|
||||||
|
|
@ -364,7 +364,7 @@ if getarg init= >/dev/null ; then
|
||||||
set $CLINE
|
set $CLINE
|
||||||
shift
|
shift
|
||||||
for x in "$@"; do
|
for x in "$@"; do
|
||||||
for s in $ignoreargs; do
|
for s in $ignoreargs; do
|
||||||
[ "${x%%=*}" = $s ] && continue 2
|
[ "${x%%=*}" = $s ] && continue 2
|
||||||
done
|
done
|
||||||
initargs="$initargs $x"
|
initargs="$initargs $x"
|
||||||
|
|
@ -383,14 +383,14 @@ else
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
[ "$RD_DEBUG" = "yes" ] && set -x
|
[ "$RD_DEBUG" = "yes" ] && set -x
|
||||||
|
|
||||||
if [ -d "$NEWROOT"/run ]; then
|
if [ -d "$NEWROOT"/run ]; then
|
||||||
NEWRUN="${NEWROOT}/run"
|
NEWRUN="${NEWROOT}/run"
|
||||||
mount --bind /run "$NEWRUN"
|
mount --bind /run "$NEWRUN"
|
||||||
NEWINITRAMFSROOT="$NEWRUN/initramfs"
|
NEWINITRAMFSROOT="$NEWRUN/initramfs"
|
||||||
|
|
||||||
if [ "$NEWINITRAMFSROOT/lib" -ef "/lib" ]; then
|
if [ "$NEWINITRAMFSROOT/lib" -ef "/lib" ]; then
|
||||||
for d in bin etc lib lib64 sbin tmp usr var; do
|
for d in bin etc lib lib64 sbin tmp usr var; do
|
||||||
[ -h /$d ] && ln -fsn $NEWINITRAMFSROOT/$d /$d
|
[ -h /$d ] && ln -fsn $NEWINITRAMFSROOT/$d /$d
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
@ -401,9 +401,9 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
wait_for_loginit
|
wait_for_loginit
|
||||||
|
|
||||||
info "Switching root"
|
info "Switching root"
|
||||||
|
|
||||||
umount -l /run
|
umount -l /run
|
||||||
|
|
||||||
unset PS4
|
unset PS4
|
||||||
|
|
|
||||||
|
|
@ -42,9 +42,9 @@ shift
|
||||||
[ -x "$exe" ] || exe=$(command -v $exe)
|
[ -x "$exe" ] || exe=$(command -v $exe)
|
||||||
|
|
||||||
if [ -n "$onetime" ]; then
|
if [ -n "$onetime" ]; then
|
||||||
{
|
{
|
||||||
echo '[ -e "$job" ] && rm "$job"'
|
echo '[ -e "$job" ] && rm "$job"'
|
||||||
echo "$exe $@"
|
echo "$exe $@"
|
||||||
} > "/tmp/$$-${job}.sh"
|
} > "/tmp/$$-${job}.sh"
|
||||||
else
|
else
|
||||||
echo "$exe $@" > "/tmp/$$-${job}.sh"
|
echo "$exe $@" > "/tmp/$$-${job}.sh"
|
||||||
|
|
|
||||||
|
|
@ -12,13 +12,13 @@ printf -- "$$" > /run/initramfs/loginit.pid
|
||||||
[ -e /dev/kmsg ] && exec 5>/dev/kmsg || exec 5>/dev/null
|
[ -e /dev/kmsg ] && exec 5>/dev/kmsg || exec 5>/dev/null
|
||||||
exec 6>/run/initramfs/init.log
|
exec 6>/run/initramfs/init.log
|
||||||
|
|
||||||
while read line; do
|
while read line; do
|
||||||
if [ "$line" = "DRACUT_LOG_END" ]; then
|
if [ "$line" = "DRACUT_LOG_END" ]; then
|
||||||
rm -f /run/initramfs/loginit.pipe
|
rm -f /run/initramfs/loginit.pipe
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
echo "<31>dracut: $line" >&5
|
echo "<31>dracut: $line" >&5
|
||||||
# if "quiet" is specified we output to /dev/console
|
# if "quiet" is specified we output to /dev/console
|
||||||
[ -n "$QUIET" ] && echo "dracut: $line"
|
[ -n "$QUIET" ] && echo "dracut: $line"
|
||||||
echo "$line" >&6
|
echo "$line" >&6
|
||||||
done
|
done
|
||||||
|
|
|
||||||
|
|
@ -7,14 +7,14 @@ check() {
|
||||||
}
|
}
|
||||||
|
|
||||||
depends() {
|
depends() {
|
||||||
echo udev-rules
|
echo udev-rules
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
dracut_install mount mknod mkdir modprobe pidof sleep chroot \
|
dracut_install mount mknod mkdir modprobe pidof sleep chroot \
|
||||||
sed ls flock cp mv dmesg rm ln rmmod mkfifo umount
|
sed ls flock cp mv dmesg rm ln rmmod mkfifo umount
|
||||||
dracut_install -o less
|
dracut_install -o less
|
||||||
if [ ! -e "${initdir}/bin/sh" ]; then
|
if [ ! -e "${initdir}/bin/sh" ]; then
|
||||||
dracut_install bash
|
dracut_install bash
|
||||||
(ln -s bash "${initdir}/bin/sh" || :)
|
(ln -s bash "${initdir}/bin/sh" || :)
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,9 @@ sfdisk -C 1280 -H 2 -S 32 -L /dev/sda <<EOF
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
mkfs.ext3 -L dracut /dev/sda2
|
mkfs.ext3 -L dracut /dev/sda2
|
||||||
mkdir -p /root
|
mkdir -p /root
|
||||||
mount /dev/sda2 /root
|
mount /dev/sda2 /root
|
||||||
cp -a -t /root /source/*
|
cp -a -t /root /source/*
|
||||||
mkdir -p /root/run
|
mkdir -p /root/run
|
||||||
umount /root
|
umount /root
|
||||||
echo "dracut-root-block-created" >/dev/sda1
|
echo "dracut-root-block-created" >/dev/sda1
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ test_run() {
|
||||||
}
|
}
|
||||||
|
|
||||||
test_setup() {
|
test_setup() {
|
||||||
|
|
||||||
if [ ! -e root.ext3 ]; then
|
if [ ! -e root.ext3 ]; then
|
||||||
|
|
||||||
# Create the blank file to use as a root filesystem
|
# Create the blank file to use as a root filesystem
|
||||||
|
|
@ -43,7 +43,7 @@ test_setup() {
|
||||||
(
|
(
|
||||||
initdir=overlay
|
initdir=overlay
|
||||||
. $basedir/dracut-functions
|
. $basedir/dracut-functions
|
||||||
dracut_install sfdisk mkfs.ext3 poweroff cp umount
|
dracut_install sfdisk mkfs.ext3 poweroff cp umount
|
||||||
inst_hook initqueue 01 ./create-root.sh
|
inst_hook initqueue 01 ./create-root.sh
|
||||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||||
)
|
)
|
||||||
|
|
@ -77,7 +77,7 @@ test_setup() {
|
||||||
-d "piix ide-gd_mod ata_piix ext3 sd_mod" \
|
-d "piix ide-gd_mod ata_piix ext3 sd_mod" \
|
||||||
-f initramfs.testing $KVERSION || return 1
|
-f initramfs.testing $KVERSION || return 1
|
||||||
|
|
||||||
# -o "plymouth network md dmraid multipath fips caps crypt btrfs resume dmsquash-live dm"
|
# -o "plymouth network md dmraid multipath fips caps crypt btrfs resume dmsquash-live dm"
|
||||||
}
|
}
|
||||||
|
|
||||||
test_cleanup() {
|
test_cleanup() {
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ test_setup() {
|
||||||
initdir=overlay/source
|
initdir=overlay/source
|
||||||
. $basedir/dracut-functions
|
. $basedir/dracut-functions
|
||||||
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
|
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
|
||||||
/lib/terminfo/l/linux mount dmesg ifconfig dhclient mkdir cp ping dhclient
|
/lib/terminfo/l/linux mount dmesg ifconfig dhclient mkdir cp ping dhclient
|
||||||
inst "$basedir/modules.d/40network/dhclient-script" "/sbin/dhclient-script"
|
inst "$basedir/modules.d/40network/dhclient-script" "/sbin/dhclient-script"
|
||||||
inst "$basedir/modules.d/40network/ifup" "/sbin/ifup"
|
inst "$basedir/modules.d/40network/ifup" "/sbin/ifup"
|
||||||
dracut_install grep
|
dracut_install grep
|
||||||
|
|
@ -34,16 +34,16 @@ test_setup() {
|
||||||
cp -a /etc/ld.so.conf* $initdir/etc
|
cp -a /etc/ld.so.conf* $initdir/etc
|
||||||
sudo ldconfig -r "$initdir"
|
sudo ldconfig -r "$initdir"
|
||||||
)
|
)
|
||||||
|
|
||||||
# second, install the files needed to make the root filesystem
|
# second, install the files needed to make the root filesystem
|
||||||
(
|
(
|
||||||
initdir=overlay
|
initdir=overlay
|
||||||
. $basedir/dracut-functions
|
. $basedir/dracut-functions
|
||||||
dracut_install sfdisk mke2fs poweroff cp umount
|
dracut_install sfdisk mke2fs poweroff cp umount
|
||||||
inst_hook initqueue 01 ./create-root.sh
|
inst_hook initqueue 01 ./create-root.sh
|
||||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||||
)
|
)
|
||||||
|
|
||||||
# create an initramfs that will create the target root filesystem.
|
# create an initramfs that will create the target root filesystem.
|
||||||
# We do it this way so that we do not risk trashing the host mdraid
|
# We do it this way so that we do not risk trashing the host mdraid
|
||||||
# devices, volume groups, encrypted partitions, etc.
|
# devices, volume groups, encrypted partitions, etc.
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ test_setup() {
|
||||||
initdir=overlay/source
|
initdir=overlay/source
|
||||||
. $basedir/dracut-functions
|
. $basedir/dracut-functions
|
||||||
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
|
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
|
||||||
/lib/terminfo/l/linux mount dmesg ifconfig dhclient mkdir cp ping dhclient
|
/lib/terminfo/l/linux mount dmesg ifconfig dhclient mkdir cp ping dhclient
|
||||||
inst "$basedir/modules.d/40network/dhclient-script" "/sbin/dhclient-script"
|
inst "$basedir/modules.d/40network/dhclient-script" "/sbin/dhclient-script"
|
||||||
inst "$basedir/modules.d/40network/ifup" "/sbin/ifup"
|
inst "$basedir/modules.d/40network/ifup" "/sbin/ifup"
|
||||||
dracut_install grep
|
dracut_install grep
|
||||||
|
|
@ -35,16 +35,16 @@ test_setup() {
|
||||||
mkdir $initdir/run
|
mkdir $initdir/run
|
||||||
sudo ldconfig -r "$initdir"
|
sudo ldconfig -r "$initdir"
|
||||||
)
|
)
|
||||||
|
|
||||||
# second, install the files needed to make the root filesystem
|
# second, install the files needed to make the root filesystem
|
||||||
(
|
(
|
||||||
initdir=overlay
|
initdir=overlay
|
||||||
. $basedir/dracut-functions
|
. $basedir/dracut-functions
|
||||||
dracut_install sfdisk mke2fs poweroff cp umount
|
dracut_install sfdisk mke2fs poweroff cp umount
|
||||||
inst_hook initqueue 01 ./create-root.sh
|
inst_hook initqueue 01 ./create-root.sh
|
||||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||||
)
|
)
|
||||||
|
|
||||||
# create an initramfs that will create the target root filesystem.
|
# create an initramfs that will create the target root filesystem.
|
||||||
# We do it this way so that we do not risk trashing the host mdraid
|
# We do it this way so that we do not risk trashing the host mdraid
|
||||||
# devices, volume groups, encrypted partitions, etc.
|
# devices, volume groups, encrypted partitions, etc.
|
||||||
|
|
|
||||||
|
|
@ -39,8 +39,8 @@ mdadm /dev/md0 --fail /dev/sda2 --remove /dev/sda2 && \
|
||||||
. /tmp/mduuid;
|
. /tmp/mduuid;
|
||||||
} && \
|
} && \
|
||||||
{
|
{
|
||||||
echo "dracut-root-block-created"
|
echo "dracut-root-block-created"
|
||||||
echo MD_UUID=$MD_UUID
|
echo MD_UUID=$MD_UUID
|
||||||
}> /dev/sda1
|
}> /dev/sda1
|
||||||
dd if=/dev/zero of=/dev/sda2
|
dd if=/dev/zero of=/dev/sda2
|
||||||
poweroff -f
|
poweroff -f
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ test_run() {
|
||||||
echo "MD_UUID=$MD_UUID"
|
echo "MD_UUID=$MD_UUID"
|
||||||
|
|
||||||
client_run || return 1
|
client_run || return 1
|
||||||
|
|
||||||
# client_run rd.md.conf=0 || return 1
|
# client_run rd.md.conf=0 || return 1
|
||||||
|
|
||||||
client_run rd.lvm=0 failme && return 1
|
client_run rd.lvm=0 failme && return 1
|
||||||
|
|
@ -52,14 +52,14 @@ test_run() {
|
||||||
test_setup() {
|
test_setup() {
|
||||||
# Create the blank file to use as a root filesystem
|
# Create the blank file to use as a root filesystem
|
||||||
dd if=/dev/zero of=root.ext2 bs=1M count=40
|
dd if=/dev/zero of=root.ext2 bs=1M count=40
|
||||||
|
|
||||||
kernel=$KVERSION
|
kernel=$KVERSION
|
||||||
# Create what will eventually be our root filesystem onto an overlay
|
# Create what will eventually be our root filesystem onto an overlay
|
||||||
(
|
(
|
||||||
initdir=overlay/source
|
initdir=overlay/source
|
||||||
. $basedir/dracut-functions
|
. $basedir/dracut-functions
|
||||||
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
|
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
|
||||||
/lib/terminfo/l/linux mount dmesg ifconfig dhclient mkdir cp ping dhclient
|
/lib/terminfo/l/linux mount dmesg ifconfig dhclient mkdir cp ping dhclient
|
||||||
inst "$basedir/modules.d/40network/dhclient-script" "/sbin/dhclient-script"
|
inst "$basedir/modules.d/40network/dhclient-script" "/sbin/dhclient-script"
|
||||||
inst "$basedir/modules.d/40network/ifup" "/sbin/ifup"
|
inst "$basedir/modules.d/40network/ifup" "/sbin/ifup"
|
||||||
dracut_install grep
|
dracut_install grep
|
||||||
|
|
@ -69,7 +69,7 @@ test_setup() {
|
||||||
cp -a /etc/ld.so.conf* $initdir/etc
|
cp -a /etc/ld.so.conf* $initdir/etc
|
||||||
sudo ldconfig -r "$initdir"
|
sudo ldconfig -r "$initdir"
|
||||||
)
|
)
|
||||||
|
|
||||||
# second, install the files needed to make the root filesystem
|
# second, install the files needed to make the root filesystem
|
||||||
(
|
(
|
||||||
initdir=overlay
|
initdir=overlay
|
||||||
|
|
@ -78,7 +78,7 @@ test_setup() {
|
||||||
inst_hook initqueue 01 ./create-root.sh
|
inst_hook initqueue 01 ./create-root.sh
|
||||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||||
)
|
)
|
||||||
|
|
||||||
# create an initramfs that will create the target root filesystem.
|
# create an initramfs that will create the target root filesystem.
|
||||||
# We do it this way so that we do not risk trashing the host mdraid
|
# We do it this way so that we do not risk trashing the host mdraid
|
||||||
# devices, volume groups, encrypted partitions, etc.
|
# devices, volume groups, encrypted partitions, etc.
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ cryptsetup -q luksFormat /dev/sda2 /keyfile
|
||||||
cryptsetup -q luksFormat /dev/sda3 /keyfile
|
cryptsetup -q luksFormat /dev/sda3 /keyfile
|
||||||
cryptsetup -q luksFormat /dev/sda4 /keyfile
|
cryptsetup -q luksFormat /dev/sda4 /keyfile
|
||||||
cryptsetup luksOpen /dev/sda2 dracut_sda2 </keyfile
|
cryptsetup luksOpen /dev/sda2 dracut_sda2 </keyfile
|
||||||
cryptsetup luksOpen /dev/sda3 dracut_sda3 </keyfile
|
cryptsetup luksOpen /dev/sda3 dracut_sda3 </keyfile
|
||||||
cryptsetup luksOpen /dev/sda4 dracut_sda4 </keyfile
|
cryptsetup luksOpen /dev/sda4 dracut_sda4 </keyfile
|
||||||
mdadm --create /dev/md0 --run --auto=yes --level=5 --raid-devices=3 /dev/mapper/dracut_sda2 /dev/mapper/dracut_sda3 /dev/mapper/dracut_sda4
|
mdadm --create /dev/md0 --run --auto=yes --level=5 --raid-devices=3 /dev/mapper/dracut_sda2 /dev/mapper/dracut_sda3 /dev/mapper/dracut_sda4
|
||||||
# wait for the array to finish initailizing, otherwise this sometimes fails
|
# wait for the array to finish initailizing, otherwise this sometimes fails
|
||||||
|
|
@ -44,7 +44,7 @@ cryptsetup luksClose /dev/mapper/dracut_sda3 && \
|
||||||
cryptsetup luksClose /dev/mapper/dracut_sda4 && \
|
cryptsetup luksClose /dev/mapper/dracut_sda4 && \
|
||||||
:; :;} && \
|
:; :;} && \
|
||||||
{
|
{
|
||||||
echo "dracut-root-block-created"
|
echo "dracut-root-block-created"
|
||||||
for i in /dev/sda[234]; do
|
for i in /dev/sda[234]; do
|
||||||
udevadm info --query=env --name=$i|grep 'ID_FS_UUID='
|
udevadm info --query=env --name=$i|grep 'ID_FS_UUID='
|
||||||
done
|
done
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ test_run() {
|
||||||
LUKSARGS=$(cat luks.txt)
|
LUKSARGS=$(cat luks.txt)
|
||||||
|
|
||||||
dd if=/dev/zero of=check-success.img bs=1M count=1
|
dd if=/dev/zero of=check-success.img bs=1M count=1
|
||||||
|
|
||||||
echo "CLIENT TEST START: $LUKSARGS"
|
echo "CLIENT TEST START: $LUKSARGS"
|
||||||
$testdir/run-qemu -hda root.ext2 -hdb check-success.img -m 256M -nographic \
|
$testdir/run-qemu -hda root.ext2 -hdb check-success.img -m 256M -nographic \
|
||||||
-net none -kernel /boot/vmlinuz-$KVERSION \
|
-net none -kernel /boot/vmlinuz-$KVERSION \
|
||||||
|
|
@ -52,7 +52,7 @@ test_setup() {
|
||||||
initdir=overlay/source
|
initdir=overlay/source
|
||||||
. $basedir/dracut-functions
|
. $basedir/dracut-functions
|
||||||
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
|
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
|
||||||
/lib/terminfo/l/linux mount dmesg ifconfig dhclient mkdir cp ping dhclient
|
/lib/terminfo/l/linux mount dmesg ifconfig dhclient mkdir cp ping dhclient
|
||||||
inst "$basedir/modules.d/40network/dhclient-script" "/sbin/dhclient-script"
|
inst "$basedir/modules.d/40network/dhclient-script" "/sbin/dhclient-script"
|
||||||
inst "$basedir/modules.d/40network/ifup" "/sbin/ifup"
|
inst "$basedir/modules.d/40network/ifup" "/sbin/ifup"
|
||||||
dracut_install grep
|
dracut_install grep
|
||||||
|
|
@ -62,7 +62,7 @@ test_setup() {
|
||||||
cp -a /etc/ld.so.conf* $initdir/etc
|
cp -a /etc/ld.so.conf* $initdir/etc
|
||||||
sudo ldconfig -r "$initdir"
|
sudo ldconfig -r "$initdir"
|
||||||
)
|
)
|
||||||
|
|
||||||
# second, install the files needed to make the root filesystem
|
# second, install the files needed to make the root filesystem
|
||||||
(
|
(
|
||||||
initdir=overlay
|
initdir=overlay
|
||||||
|
|
@ -71,7 +71,7 @@ test_setup() {
|
||||||
inst_hook initqueue 01 ./create-root.sh
|
inst_hook initqueue 01 ./create-root.sh
|
||||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||||
)
|
)
|
||||||
|
|
||||||
# create an initramfs that will create the target root filesystem.
|
# create an initramfs that will create the target root filesystem.
|
||||||
# We do it this way so that we do not risk trashing the host mdraid
|
# We do it this way so that we do not risk trashing the host mdraid
|
||||||
# devices, volume groups, encrypted partitions, etc.
|
# devices, volume groups, encrypted partitions, etc.
|
||||||
|
|
@ -89,9 +89,9 @@ test_setup() {
|
||||||
cryptoUUIDS=$(grep --binary-files=text -m 3 ID_FS_UUID root.ext2)
|
cryptoUUIDS=$(grep --binary-files=text -m 3 ID_FS_UUID root.ext2)
|
||||||
for uuid in $cryptoUUIDS; do
|
for uuid in $cryptoUUIDS; do
|
||||||
eval $uuid
|
eval $uuid
|
||||||
printf ' rd.luks.uuid=luks-%s ' $ID_FS_UUID
|
printf ' rd.luks.uuid=luks-%s ' $ID_FS_UUID
|
||||||
done > luks.txt
|
done > luks.txt
|
||||||
|
|
||||||
|
|
||||||
(
|
(
|
||||||
initdir=overlay
|
initdir=overlay
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,9 @@ rm /etc/lvm/lvm.conf
|
||||||
|
|
||||||
udevadm control --reload-rules
|
udevadm control --reload-rules
|
||||||
# dmraid does not want symlinks in --disk "..."
|
# dmraid does not want symlinks in --disk "..."
|
||||||
if [ -e /dev/hda ] ; then
|
if [ -e /dev/hda ] ; then
|
||||||
echo y|dmraid -f isw -C Test0 --type 1 --disk "/dev/hdb /dev/hdc"
|
echo y|dmraid -f isw -C Test0 --type 1 --disk "/dev/hdb /dev/hdc"
|
||||||
else
|
else
|
||||||
echo y|dmraid -f isw -C Test0 --type 1 --disk "/dev/sdb /dev/sdc"
|
echo y|dmraid -f isw -C Test0 --type 1 --disk "/dev/sdb /dev/sdc"
|
||||||
fi
|
fi
|
||||||
udevadm settle
|
udevadm settle
|
||||||
|
|
@ -17,12 +17,12 @@ udevadm settle
|
||||||
SETS=$(dmraid -c -s)
|
SETS=$(dmraid -c -s)
|
||||||
# scan and activate all DM RAIDS
|
# scan and activate all DM RAIDS
|
||||||
for s in $SETS; do
|
for s in $SETS; do
|
||||||
dmraid -ay -i -p --rm_partitions "$s"
|
dmraid -ay -i -p --rm_partitions "$s"
|
||||||
[ -e "/dev/mapper/$s" ] && kpartx -a -p p "/dev/mapper/$s"
|
[ -e "/dev/mapper/$s" ] && kpartx -a -p p "/dev/mapper/$s"
|
||||||
done
|
done
|
||||||
|
|
||||||
udevadm settle
|
udevadm settle
|
||||||
sfdisk -g /dev/mapper/isw*Test0
|
sfdisk -g /dev/mapper/isw*Test0
|
||||||
# save a partition at the beginning for future flagging purposes
|
# save a partition at the beginning for future flagging purposes
|
||||||
sfdisk -C 2560 -H 2 -S 32 -L /dev/mapper/isw*Test0 <<EOF
|
sfdisk -C 2560 -H 2 -S 32 -L /dev/mapper/isw*Test0 <<EOF
|
||||||
,1
|
,1
|
||||||
|
|
@ -38,8 +38,8 @@ udevadm settle
|
||||||
SETS=$(dmraid -c -s -i)
|
SETS=$(dmraid -c -s -i)
|
||||||
# scan and activate all DM RAIDS
|
# scan and activate all DM RAIDS
|
||||||
for s in $SETS; do
|
for s in $SETS; do
|
||||||
dmraid -ay -i -p --rm_partitions "$s"
|
dmraid -ay -i -p --rm_partitions "$s"
|
||||||
[ -e "/dev/mapper/$s" ] && kpartx -a -p p "/dev/mapper/$s"
|
[ -e "/dev/mapper/$s" ] && kpartx -a -p p "/dev/mapper/$s"
|
||||||
done
|
done
|
||||||
|
|
||||||
udevadm settle
|
udevadm settle
|
||||||
|
|
@ -47,7 +47,7 @@ udevadm settle
|
||||||
mdadm --create /dev/md0 --run --auto=yes --level=5 --raid-devices=3 \
|
mdadm --create /dev/md0 --run --auto=yes --level=5 --raid-devices=3 \
|
||||||
/dev/mapper/isw*p2 \
|
/dev/mapper/isw*p2 \
|
||||||
/dev/mapper/isw*p3 \
|
/dev/mapper/isw*p3 \
|
||||||
/dev/mapper/isw*p4
|
/dev/mapper/isw*p4
|
||||||
|
|
||||||
# wait for the array to finish initailizing, otherwise this sometimes fails
|
# wait for the array to finish initailizing, otherwise this sometimes fails
|
||||||
# randomly.
|
# randomly.
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ test_setup() {
|
||||||
initdir=overlay/source
|
initdir=overlay/source
|
||||||
. $basedir/dracut-functions
|
. $basedir/dracut-functions
|
||||||
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
|
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
|
||||||
/lib/terminfo/l/linux mount dmesg ifconfig dhclient mkdir cp ping dhclient
|
/lib/terminfo/l/linux mount dmesg ifconfig dhclient mkdir cp ping dhclient
|
||||||
inst "$basedir/modules.d/40network/dhclient-script" "/sbin/dhclient-script"
|
inst "$basedir/modules.d/40network/dhclient-script" "/sbin/dhclient-script"
|
||||||
inst "$basedir/modules.d/40network/ifup" "/sbin/ifup"
|
inst "$basedir/modules.d/40network/ifup" "/sbin/ifup"
|
||||||
dracut_install grep
|
dracut_install grep
|
||||||
|
|
@ -59,16 +59,16 @@ test_setup() {
|
||||||
mkdir $initdir/run
|
mkdir $initdir/run
|
||||||
sudo ldconfig -r "$initdir"
|
sudo ldconfig -r "$initdir"
|
||||||
)
|
)
|
||||||
|
|
||||||
# second, install the files needed to make the root filesystem
|
# second, install the files needed to make the root filesystem
|
||||||
(
|
(
|
||||||
initdir=overlay
|
initdir=overlay
|
||||||
. $basedir/dracut-functions
|
. $basedir/dracut-functions
|
||||||
dracut_install sfdisk mke2fs poweroff cp umount
|
dracut_install sfdisk mke2fs poweroff cp umount
|
||||||
inst_hook initqueue 01 ./create-root.sh
|
inst_hook initqueue 01 ./create-root.sh
|
||||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||||
)
|
)
|
||||||
|
|
||||||
# create an initramfs that will create the target root filesystem.
|
# create an initramfs that will create the target root filesystem.
|
||||||
# We do it this way so that we do not risk trashing the host mdraid
|
# We do it this way so that we do not risk trashing the host mdraid
|
||||||
# devices, volume groups, encrypted partitions, etc.
|
# devices, volume groups, encrypted partitions, etc.
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||||
export TERM=linux
|
export TERM=linux
|
||||||
export PS1='nfstest-server:\w\$ '
|
export PS1='nfstest-server:\w\$ '
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ client_test() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# nfsinfo=( server:/path nfs{,4} options )
|
# nfsinfo=( server:/path nfs{,4} options )
|
||||||
nfsinfo=($(awk '{print $2, $3, $4; exit}' client.img))
|
nfsinfo=($(awk '{print $2, $3, $4; exit}' client.img))
|
||||||
|
|
||||||
if [[ "${nfsinfo[0]%%:*}" != "$server" ]]; then
|
if [[ "${nfsinfo[0]%%:*}" != "$server" ]]; then
|
||||||
echo "CLIENT TEST INFO: got server: ${nfsinfo[0]%%:*}"
|
echo "CLIENT TEST INFO: got server: ${nfsinfo[0]%%:*}"
|
||||||
|
|
@ -210,7 +210,7 @@ test_setup() {
|
||||||
/etc/services sleep mount chmod
|
/etc/services sleep mount chmod
|
||||||
type -P portmap >/dev/null && dracut_install portmap
|
type -P portmap >/dev/null && dracut_install portmap
|
||||||
type -P rpcbind >/dev/null && dracut_install rpcbind
|
type -P rpcbind >/dev/null && dracut_install rpcbind
|
||||||
[ -f /etc/netconfig ] && dracut_install /etc/netconfig
|
[ -f /etc/netconfig ] && dracut_install /etc/netconfig
|
||||||
type -P dhcpd >/dev/null && dracut_install dhcpd
|
type -P dhcpd >/dev/null && dracut_install dhcpd
|
||||||
[ -x /usr/sbin/dhcpd3 ] && inst /usr/sbin/dhcpd3 /usr/sbin/dhcpd
|
[ -x /usr/sbin/dhcpd3 ] && inst /usr/sbin/dhcpd3 /usr/sbin/dhcpd
|
||||||
instmods nfsd sunrpc ipv6
|
instmods nfsd sunrpc ipv6
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||||
export TERM=linux
|
export TERM=linux
|
||||||
export PS1='nfstest-server:\w\$ '
|
export PS1='nfstest-server:\w\$ '
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue