removed trailing whitespaces

master
Harald Hoyer 2011-05-10 11:39:10 +02:00
parent e2cdb570ae
commit 3b403b32fc
105 changed files with 413 additions and 413 deletions

View File

@ -1,11 +1,11 @@
Right now, most of the testing is done using a qemu/kvm guest and
generating the initramfs on another box but the support is all present
to build for the "running" machine. For the former, you can boot the guest
using qemu's -kernel and -initrd options.
using qemu's -kernel and -initrd options.

dracut exists and will build an image. It is command-line equivalent
to most mkinitrd implementations and should be pretty straight-forward
to use.
to use.

To use, just run dracut with an output file name and, optionally, a
kernel version (it defaults to using the current). The appropriate
@ -14,7 +14,7 @@ like to customize the list of modules copied in, edit /etc/dracut.conf
and set
dracutmodules="foo bar baz"

Note that dracut calls functional components in modules.d "modules"
Note that dracut calls functional components in modules.d "modules"
while kernel modules are called "drivers".

Requirements:

64
NEWS
View File

@ -67,7 +67,7 @@ dracut-006
- add btrfsctl scan for btrfs multi-devices (raid)
- teach dmsquash live-root to use rootflags
- trigger udev with action=add
- fixed add_drivers handling
- fixed add_drivers handling
- add sr_mod
- use pigz instead of gzip, if available
- boot from LVM mirrors and snapshots
@ -80,7 +80,7 @@ dracut-006

dracut-005
==========
- dcb support to dracut's FCoE support
- dcb support to dracut's FCoE support
- add readonly overlay support for dmsquash
- add keyboard kernel modules
- dracut.conf: added add_dracutmodules
@ -118,7 +118,7 @@ dracut-003
- add s390 network support
- fixed dracut-gencmdline for root=UUID or LABEL
- do not destroy assembled raid arrays if mdadm.conf present
- mount /dev/shm
- mount /dev/shm
- let udevd not resolve group and user names
- moved network from udev to initqueue
- improved debug output: specifying "rdinitdebug" now logs
@ -126,7 +126,7 @@ dracut-003
- strip kernel modules which have no x bit set
- redirect stdin, stdout, stderr all RW to /dev/console
so the user can use "less" to view /init.log and dmesg
- add new device mapper udev rules and dmeventd
- add new device mapper udev rules and dmeventd
- fixed dracut-gencmdline for root=UUID or LABEL
- do not destroy assembled raid arrays if mdadm.conf present
- mount /dev/shm
@ -171,17 +171,17 @@ dracut-001
Supported cmdline formats:
fcoe=<networkdevice>:<dcb|nodcb>
fcoe=<macaddress>:<dcb|nodcb>

Note currently only nodcb is supported, the dcb option is reserved for
future use.

Note letters in the macaddress must be lowercase!

Examples:
fcoe=eth0:nodcb
fcoe=4A:3F:4C:04:F8:D7:nodcb

- Syslog support for dracut
- Syslog support for dracut
This module provides syslog functionality in the initrd.
This is especially interesting when complex configuration being
used to provide access to the device the rootfs resides on.
@ -208,20 +208,20 @@ dracut-0.8
dracut-0.7
==========
- dracut: strip binaries in initramfs

--strip
strip binaries in the initramfs (default)

--nostrip
do not strip binaries in the initramfs
- dracut-catimages

Usage: ./dracut-catimages [OPTION]... <initramfs> <base image>
[<image>...]
Creates initial ramdisk image by concatenating several images from the
command
line and /boot/dracut/

-f, --force Overwrite existing initramfs file.
-i, --imagedir Directory with additional images to add
(default: /boot/dracut/)
@ -238,44 +238,44 @@ dracut-0.7
dracut-0.6
==========
- dracut: add --kernel-only and --no-kernel arguments

--kernel-only
only install kernel drivers and firmware files

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

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

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

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

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

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

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

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

initrd-config.img
optional image with local configuration files

- dracut: add --kmoddir directory, where to look for kernel modules

-k, --kmoddir [DIR]
specify the directory, where to look for kernel modules

@ -295,18 +295,18 @@ dracut-0.4
- firmware loading support
- new internal queue (initqueue)
initqueue now loops until /dev/root exists or root is mounted

init now has the following points to inject scripts:

/cmdline/*.sh
scripts for command line parsing

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

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

/initqueue/*.sh
runs in parallel to the udev trigger
Udev events can add scripts here with /sbin/initqueue.
@ -318,12 +318,12 @@ dracut-0.4
filesystem was mounted, the user will be dropped to a shell after
a timeout.
Scripts can remove themselves from the initqueue by "rm $job".

/pre-mount/*.sh
scripts to run before the root filesystem is mounted
NFS is an exception, because it has no device node to be created
and mounts in the udev events

/mount/*.sh
scripts to mount the root filesystem
NFS is an exception, because it has no device node to be created
@ -331,12 +331,12 @@ dracut-0.4
If the udev queue is empty and no root device is found or no root
filesystem was mounted, the user will be dropped to a shell after
a timeout.

/pre-pivot/*.sh
scripts to run before the real init is executed and the initramfs
disappears
All processes started before should be killed here.

The behaviour of the dmraid module demonstrates how to use the new
mechanism. If it detects a device which is part of a raidmember from a
udev rule, it installs a job to scan for dmraid devices, if the udev

16
README
View File

@ -2,8 +2,8 @@ Dracut
------
Dracut is a new initramfs infrastructure.

Information about the initial goals and aims can be found at
https://fedoraproject.org/wiki/Initrdrewrite
Information about the initial goals and aims can be found at
https://fedoraproject.org/wiki/Initrdrewrite

Unlike existing initramfs's, this is an attempt at having as little as
possible hard-coded into the initramfs as possible. The initramfs has
@ -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
of generator modules that are sourced by the main dracut script to install
specific functionality into the initrd. They live in the modules.d
subdirectory, and use functionality provided by dracut-functions to do their
specific functionality into the initrd. They live in the modules.d
subdirectory, and use functionality provided by dracut-functions to do their
work.

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'
as a kernel parameter, the initramfs will drop to a shell just before
switching to a new root. You can pass 'rdbreak=hookpoint', and the initramfs
will break just before hooks in that hookpoint run.
will break just before hooks in that hookpoint run.

Also, there is an attempt to keep things as distribution-agnostic as
possible. Every distribution has their own tool here and it's not
@ -56,7 +56,7 @@ Currently dracut lives on sourceforge.
Project Page:
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.

Git Repository:
@ -64,7 +64,7 @@ http://dracut.git.sourceforge.net/
git://dracut.git.sourceforge.net/gitroot/dracut/dracut

Trac Instance:
http://apps.sourceforge.net/trac/dracut/
http://apps.sourceforge.net/trac/dracut/

The git tree can be found at
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
is being used for the discussion -- initramfs@vger.kernel.org. It is
a typical vger list, send mail to majordomo@vger.kernel.org with body
of 'subscribe initramfs email@host.com'
of 'subscribe initramfs email@host.com'


Licensed under the GPLv2

View File

@ -1,7 +1,7 @@
To build a generic initramfs, you have to install the following software packages:
* device-mapper
* cryptsetup-luks
* rpcbind nfs-utils
* rpcbind nfs-utils
* lvm2
* iscsi-initiator-utils
* nbd

View File

@ -12,20 +12,20 @@ dracut_install_dir/modules.d/
The numeric code must be present and in the range of 00 - 99.
Modules with lower numbers are installed first. This is important
because the dracut install functions (which install files onto
the initrd) refuse to overwrite already installed files. This makes
it easy for an earlier module to override the functionality of a
the initrd) refuse to overwrite already installed files. This makes
it easy for an earlier module to override the functionality of a
later module, so that you can have a distro or system specific
module override or modify the functionality of a generic module
without having to patch the more generic module.

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
to copying files from the host system onto the initrd in a controlled
manner.
manner.

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
specialized for different file types. Browse through dracut-functions
fore more details. dracut also provides a $moddir variable if you
@ -33,21 +33,21 @@ install():
hook, a udev rule, or a specialized executable.

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.


check():
check():
Dracut calls this function to check and see if a module can be installed
on the initrd.

When called without options, check should check to make sure that
any files it needs to install into the initrd from the host system
are present. It should exit with a 0 if they are, and a 1 if they are
not.

When called with $hostonly set, it should perform the same check
that it would without it set, and it should also check to see if the
When called with $hostonly set, it should perform the same check
that it would without it set, and it should also check to see if the
functionality the module implements is being used on the host system.
For example, if this module handles installing support for LUKS
encrypted volumes, it should return 0 if all the tools to handle
@ -60,7 +60,7 @@ depends():
which rely on the network module to detect and configure network
interfaces.

Any other files in the module will not be touched by dracut directly.
Any other files in the module will not be touched by dracut directly.

You are encouraged to provide a README that describes what the module is for.

@ -84,7 +84,7 @@ init has the following hook points to inject scripts:
Udev events can add scripts here with /sbin/initqueue.
If /sbin/initqueue is called with the "--onetime" option, the script
will be removed after it was run.
If /lib/dracut/hooks/initqueue/work is created and udev >= 143 then
If /lib/dracut/hooks/initqueue/work is created and udev >= 143 then
this loop can process the jobs in parallel to the udevtrigger.
If the udev queue is empty and no root device is found or no root
filesystem was mounted, the user will be dropped to a shell after
@ -93,7 +93,7 @@ init has the following hook points to inject scripts:

/lib/dracut/hooks/pre-mount/*.sh
scripts to run before the root filesystem is mounted
Network filesystems like NFS that do not use device files are an
Network filesystems like NFS that do not use device files are an
exception. Root can be mounted already at this point.

/lib/dracut/hooks/mount/*.sh

50
dracut
View File

@ -1,7 +1,7 @@
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
#
#
# Generator script for a dracut initramfs
# Tries to retain some degree of compatibility with the command line
# 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.
-d, --drivers [LIST] Specify a space-separated list of kernel modules to
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.
--filesystems [LIST] Specify a space-separated list of kernel filesystem
modules to exclusively include in the generic
initramfs.
-k, --kmoddir [DIR] Specify the directory, where to look for kernel
-k, --kmoddir [DIR] Specify the directory, where to look for kernel
modules
--fwdir [DIR] Specify additional directories, where to look for
--fwdir [DIR] Specify additional directories, where to look for
firmwares, separated by :
--kernel-only Only install kernel drivers and firmware files
--no-kernel Do not install kernel drivers and firmware files
@ -73,7 +73,7 @@ Creates initial ramdisk images for preloading modules
-q, --quiet Decrease verbosity level (default is info(4))
-c, --conf [FILE] Specify configuration file to use.
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
-l, --local Local mode. Use modules from the current working
directory instead of the system-wide installed in
@ -85,7 +85,7 @@ Creates initial ramdisk images for preloading modules
-i, --include [SOURCE] [TARGET]
Include the files in the SOURCE directory into the
Target directory in the final initramfs.
If SOURCE is a file, it will be installed to TARGET
If SOURCE is a file, it will be installed to TARGET
in the final initramfs.
-I, --install [LIST] Install the space separated list of files into the
initramfs.
@ -96,14 +96,14 @@ Creates initial ramdisk images for preloading modules
Make sure your kernel has bzip2 decompression support
compiled in, otherwise you will not be able to boot.
--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.
--xz Compress the generated initramfs using xz.
Make sure that your kernel has xz support compiled
in, otherwise you will not be able to boot.
--compress [COMPRESSION] Compress the generated initramfs with the
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.
--no-compress Do not compress the generated initramfs. This will
override any other compression options.
@ -137,7 +137,7 @@ push() {
# val=$(pop stack)
pop() {
local __stack=$1; shift
local __resultvar=$1
local __resultvar=$1
local myresult;
# check for empty stack
eval '[[ ${#'${__stack}'[@]} -eq 0 ]] && return 1'
@ -241,7 +241,7 @@ while (($# > 0)); do
show_modules_l="yes"
;;
-*) printf "\nUnknown option: %s\n\n" "$1" >&2; usage; exit 1;;
*)
*)
if ! [[ ${outfile+x} ]]; then
outfile=$1
elif ! [[ ${kernel+x} ]]; then
@ -261,7 +261,7 @@ fi
PATH=/sbin:/bin:/usr/sbin:/usr/bin
export PATH

[[ $debug ]] && {
[[ $debug ]] && {
export PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): ';
set -x
}
@ -269,7 +269,7 @@ export PATH
[[ $dracutbasedir ]] || dracutbasedir=/usr/share/dracut

[[ $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 [[ ! -f $conffile ]]; then
@ -287,7 +287,7 @@ fi

# source our config dir
if [[ $confdir && -d $confdir ]]; then
for f in "$confdir"/*.conf; do
for f in "$confdir"/*.conf; do
[[ -e $f ]] && . "$f"
done
fi
@ -455,9 +455,9 @@ fi
readonly initdir=$(mktemp --tmpdir=/var/tmp/ -d -t initramfs.XXXXXX)

# 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.
trap 'exit 1;' SIGINT
trap 'exit 1;' SIGINT

# Need to be able to have non-root users read stuff (rpcbind etc)
chmod 755 "$initdir"
@ -476,14 +476,14 @@ mkdir -m 0755 -p "${initdir}${prefix}/lib"
[[ $prefix ]] && ln -sfn "${prefix#/}/lib" "$initdir/lib"

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
mkdir -m 0755 -p "${initdir}${prefix}/$d"
[[ $prefix ]] && ln -sfn "${prefix#/}/${d#/}" "$initdir/$d"
done
done

for d in proc sys sysroot root run run/lock run/initramfs; do
mkdir -m 0755 -p "$initdir/$d";
for d in proc sys sysroot root run run/lock run/initramfs; do
mkdir -m 0755 -p "$initdir/$d";
done

ln -sfn /run "$initdir/var/run"
@ -529,7 +529,7 @@ while pop include_src src && pop include_target tgt; do
if [[ -f $src ]]; then
inst $src $tgt
else
ddebug "Including directory: $src"
ddebug "Including directory: $src"
mkdir -p "${initdir}/${tgt}"
# check for preexisting symlinks, so we can cope with the
# symlinks to $prefix
@ -544,7 +544,7 @@ while pop include_src src && pop include_target tgt; do
cp -a -t "$s" "$i"/*
else
cp -a -t "$s" "$i"
fi
fi
done
fi
fi
@ -577,9 +577,9 @@ if (($maxloglvl >= 5)); then
du -c "$initdir" | sort -n | ddebug
fi

# strip binaries
# strip binaries
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
derror "Could not find '$p'. You should run $0 with '--nostrip'."
do_strip=no
@ -610,10 +610,10 @@ if strstr "$modules_loaded" " fips " && command -v prelink >/dev/null; then
fi

if ! ( cd "$initdir"; find . |cpio -R 0:0 -H newc -o --quiet | \
$compress > "$outfile"; ); then
$compress > "$outfile"; ); then
dfatal "dracut: creation of $outfile failed"
exit 1
fi
fi

dinfo "Wrote $outfile:"
dinfo "$(ls -l "$outfile")"

View File

@ -39,7 +39,7 @@ Creates initial ramdisk image by concatenating several images from the command
line and /boot/dracut/

-f, --force Overwrite existing initramfs file.
-i, --imagedir Directory with additional images to add
-i, --imagedir Directory with additional images to add
(default: /boot/dracut/)
-o, --overlaydir Overlay directory, which contains files that
will be used to create an additional image
@ -120,7 +120,7 @@ images+=($@)
dinfo "Using base image $baseimage"
cat "$baseimage" > "$outfile"

for i in "${images[@]}"; do
for i in "${images[@]}"; do
dinfo "Appending $i"
cat "$i" >> "$outfile"
done

View File

@ -67,7 +67,7 @@ line and /boot/dracut/*.img</para>
<varlistentry>
<term><option>-h</option>, <option>--help</option></term>
<listitem>
<para>display help text and exit.</para>
<para>display help text and exit.</para>
</listitem>
</varlistentry>
<varlistentry>

View File

@ -253,7 +253,7 @@ inst_simple() {
if [[ -e "${src%/*}/.${src##*/}.hmac" ]]; then
inst "${src%/*}/.${src##*/}.hmac" "${target%/*}/.${target##*/}.hmac"
fi
ddebug "Installing $src"
ddebug "Installing $src"
cp -pfL "$src" "${initdir}$target"
}

@ -409,17 +409,17 @@ inst_rules() {

inst_dir "/lib/udev/rules.d"
inst_dir "$target"
for rule in "$@"; do
for rule in "$@"; do
for r in /lib/udev/rules.d /etc/udev/rules.d; do
if [[ -f $r/$rule ]]; then
found="$r/$rule"
inst_simple "$found"
fi
done
done
for r in '' ./ $dracutbasedir/rules.d/; do
if [[ -f ${r}$rule ]]; then
found="${r}$rule"
inst_simple "$found" "$target/${found##*/}"
inst_simple "$found" "$target/${found##*/}"
fi
done
[[ $found ]] || dinfo "Skipping udev rule: $rule"
@ -459,7 +459,7 @@ inst_hook() {
dfatal "Aborting initrd creation."
exit 1
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
fi
inst_simple "$3" "/lib/dracut/hooks/${1}/${2}${3##*/}"

View File

@ -168,7 +168,7 @@ resolve_device_name() {
real=$(freadlink /dev/disk/by-label/${1##LABEL=})
[ -b $real ] && { echo $real; return; }
fi
echo "$1"
echo "$1"
}

finddevnoinsys() {
@ -308,7 +308,7 @@ iscsi_set_parameters() {
chap=${result}
if [ -n "${chap}" -a "${chap}" != "<empty>" ]; then
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}"
else
chap=""
@ -318,7 +318,7 @@ iscsi_set_parameters() {
chap_in=${result}
if [ -n "${chap_in}" -a "${chap_in}" != "<empty>" ]; then
chap_in="-U ${chap_in}"
iscsi_get_rec_val $tmpfile "node.session.auth.password_in"
iscsi_get_rec_val $tmpfile "node.session.auth.password_in"
chap_in_pw="-W ${result}"
else
chap_in=""
@ -343,7 +343,7 @@ is_iscsi() {
path=$1
if echo $path | grep -q "/platform/host[0-9]*/session[0-9]*/target[0-9]*:[0-9]*:[0-9]*/[0-9]*:[0-9]*:[0-9]*:[0-9]*"; then
return 0
else
else
return 1
fi
}
@ -399,7 +399,7 @@ handledm() {
EOF
local name=$(dmsetup info --noheadings -c -j $major -m $minor -o name)
local vg=$(lvshow "/dev/mapper/$name")
local raids=$(/sbin/dmraid -s -craidname 2>/dev/null | grep -vi "no raid disks")
local raids=$(/sbin/dmraid -s -craidname 2>/dev/null | grep -vi "no raid disks")
if [ -n "$vg" ]; then
vg=`echo $vg` # strip whitespace
case " $vg_list " in
@ -630,7 +630,7 @@ fi

cemit()
{
cat
cat
}

emit()
@ -640,7 +640,7 @@ emit()
NONL="-n"
shift
fi
echo $NONL "$@"
echo $NONL "$@"
}

emitdmraids()
@ -678,8 +678,8 @@ else
echo -n "rd_NO_MD "
fi

if [ -z "$nolvm" -a -n "$vg_list" ]; then
for vg in $vg_list; do
if [ -z "$nolvm" -a -n "$vg_list" ]; then
for vg in $vg_list; do
echo -n "rd_LVM_VG=$vg "
done
else

View File

@ -15,7 +15,7 @@
<!-- body begins here -->
<refsynopsisdiv id='synopsis'>
<cmdsynopsis>
<command>dracut-gencmdline</command>
<command>dracut-gencmdline</command>
<sbr/>
</cmdsynopsis>
</refsynopsisdiv>

View File

@ -108,9 +108,9 @@ For a complete list of kernel command line options see
<option>--modules&nbsp;<replaceable>&lt;list of dracut modules&gt;</replaceable></option>
</term>
<listitem>
<para>specify a space-separated list of dracut modules to call
when building the initramfs.
Modules are located in
<para>specify a space-separated list of dracut modules to call
when building the initramfs.
Modules are located in
<filename>/usr/share/dracut/modules.d</filename>. This parameter can be specified multiple times.</para>
</listitem>
</varlistentry>
@ -163,7 +163,7 @@ The kernel modules have to be specified without the &quot;.ko&quot; suffix. This
<option>--filesystems&nbsp;<replaceable>&lt;list of filesystems&gt;</replaceable></option>
</term>
<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>
</listitem>
</varlistentry>
@ -300,7 +300,7 @@ include in the generic initramfs. This parameter can be specified multiple times
</term>
<listitem>
<para>specify configuration file to use.
Default:
Default:
<filename>/etc/dracut.conf</filename></para>
</listitem>
</varlistentry>
@ -310,7 +310,7 @@ Default:
</term>
<listitem>
<para>specify configuration directory to use.
Default:
Default:
<filename>/etc/dracut.conf.d</filename></para>
</listitem>
</varlistentry>
@ -336,8 +336,8 @@ This is useful when running dracut from a git checkout.</para>
<option>--hostonly</option>
</term>
<listitem>
<para>Host-Only mode: Install only what is needed for booting
the local host instead of a generic host.
<para>Host-Only mode: Install only what is needed for booting
the local host instead of a generic host.
<warning>
<para>If chrooted to another root other than the real root device, use &quot;--fstab&quot; and provide a valid <filename>/etc/fstab</filename>.</para>
</warning></para>
@ -505,7 +505,7 @@ TARGET directory in the final initramfs. If SOURCE is a file, it will be install
</term>
<listitem>
<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>
</listitem>
</varlistentry>

View File

@ -79,7 +79,7 @@ The kernel modules have to be specified without the &quot;.ko&quot; suffix.</par
<envar>add_drivers+=&quot;&nbsp;<replaceable>&lt;kernel modules&gt;</replaceable>&nbsp;&quot;</envar>
</term>
<listitem>
<para>Specify a space-separated list of kernel
<para>Specify a space-separated list of kernel
modules to add to the initramfs.
The kernel modules have to be specified without the &quot;.ko&quot; suffix.</para>
</listitem>
@ -123,7 +123,7 @@ initramfs.</para>
<envar>hostonly=&quot;<replaceable>{yes|no}</replaceable>&quot;</envar>
</term>
<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.
<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>

View File

@ -25,11 +25,11 @@
<refsect1>
<title>Description</title>
<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>
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.
<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>
<refsect2>
<title>Standard</title>
@ -47,7 +47,7 @@ root filesystem.</para>
<envar>root=<replaceable>&lt;path to blockdevice&gt;</replaceable></envar>
</term>
<listitem>
<para>specify blockdevice to use as root filesystem.
<para>specify blockdevice to use as root filesystem.
e.g.: <programlisting>root=/dev/sda1
root=/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1 </programlisting></para>
</listitem>
@ -66,14 +66,14 @@ root=/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1 </programlisting>
</term>
<listitem>
<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>
</listitem>
</varlistentry>
<varlistentry>
<term><envar>rd.fstab</envar>=0</term>
<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>
</listitem>
</varlistentry>
@ -294,7 +294,7 @@ This parameter can be specified multiple times.</para>
<listitem>
<para>only activate the LUKS partitions with the given UUID
Any &quot;luks-&quot; of the LUKS UUID is removed before comparing to <replaceable>&lt;luks uuid&gt;</replaceable>.
The comparisons also matches, if <replaceable>&lt;luks uuid&gt;</replaceable> is only the beginning of the
The comparisons also matches, if <replaceable>&lt;luks uuid&gt;</replaceable> is only the beginning of the
LUKS UUID, so you don&apos;t have to specify the full UUID.
This parameter can be specified multiple times.</para>
</listitem>
@ -420,8 +420,8 @@ e.g.
<envar>ip=</envar><replaceable>{dhcp|on|any|dhcp6|auto6|ibft}</replaceable>
</term>
<listitem>
<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
<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
with a valid DHCP root-path.</para>
<para><constant>auto6</constant>: IPv6 autoconfiguration</para>
<para><constant>dhcp6</constant>: IPv6 DHCP</para>
@ -459,7 +459,7 @@ This parameter can be specified multiple times.</para>
<envar>bootdev=</envar><replaceable>&lt;interface&gt;</replaceable>
</term>
<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>
</listitem>
</varlistentry>
@ -501,7 +501,7 @@ NFS options can be appended with the prefix &quot;:&quot; or &quot;,&quot; and a
<envar>root=</envar><replaceable>{dhcp|dhcp6}</replaceable>
</term>
<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.
root-path=&lt;server-ip&gt;:&lt;root-dir&gt;[,&lt;nfs-options&gt;]
root-path=nfs:&lt;server-ip&gt;:&lt;root-dir&gt;[,&lt;nfs-options&gt;]
@ -514,8 +514,8 @@ options can be specified.
<envar> nfsroot=</envar><optional><replaceable>&lt;server-ip&gt;</replaceable>:</optional><replaceable>&lt;root-dir&gt;</replaceable><optional>:<replaceable>&lt;nfs-options&gt;</replaceable></optional>
</term>
<listitem>
<para><emphasis remap="B">Deprecated!</emphasis> kernel Documentation<filename>/filesystems/nfsroot.txt</filename> defines
this method.
<para><emphasis remap="B">Deprecated!</emphasis> kernel Documentation<filename>/filesystems/nfsroot.txt</filename> defines
this method.
This is supported by dracut, but not recommended.</para>
</listitem>
</varlistentry>
@ -553,7 +553,7 @@ then used in the Discovery Service stage in conjunction with other
associated fields.</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>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>
</listitem>
</varlistentry>
@ -568,7 +568,7 @@ associated fields.</para>
<replaceable>&lt;LUN&gt;</replaceable>
</optional>:<replaceable>&lt;targetname&gt;</replaceable> ...</term>
<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
netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0
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>
<listitem>
<para>with dhcp root-path=nbd:&lt;server&gt;:&lt;port&gt;[:&lt;fstype&gt;][:&lt;mountopts&gt;]
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.
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>
</listitem>
</varlistentry>
@ -1215,7 +1215,7 @@ rd.znet=ctc,0.0.0600,0.0.0601,0.0.0602,protocol=bar</programlisting></para>
</term>
<listitem>
<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>
</listitem>
</varlistentry>

View File

@ -20,14 +20,14 @@ Release: %{release_prefix}

Summary: Initramfs generator using udev
%if 0%{?fedora}
Group: System Environment/Base
Group: System Environment/Base
%endif
%if 0%{?suse_version}
Group: System/Base
%endif
License: GPLv2+
License: GPLv2+
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
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
Dracut contains tools to create a bootable initramfs for 2.6 Linux kernels.
Unlike existing implementations, dracut does hard-code as little as possible
into the initramfs. Dracut contains various modules which are driven by the
event-based udev. Having root on MD, DM, LVM2, LUKS is supported as well as
Dracut contains tools to create a bootable initramfs for 2.6 Linux kernels.
Unlike existing implementations, dracut does hard-code as little as possible
into the initramfs. Dracut contains various modules which are driven by the
event-based udev. Having root on MD, DM, LVM2, LUKS is supported as well as
NFS, iSCSI, NBD, FCoE with the dracut-network package.

%package network
Summary: Dracut modules to build a dracut initramfs with network support
Requires: %{name} = %{version}-%{release}
Requires: rpcbind
Requires: rpcbind
%if %{with_nbd}
Requires: nbd
%endif
@ -111,7 +111,7 @@ Requires: bridge-utils

%if 0%{?fedora}
Requires: iscsi-initiator-utils
Requires: nfs-utils
Requires: nfs-utils
Requires: dhclient
%endif

@ -165,14 +165,14 @@ This package contains tools to assemble the local initrd and host configuration.
%setup -q -n %{name}-%{version}%{?dashgittag}

%build
make
make

%install
%if 0%{?fedora}
rm -rf $RPM_BUILD_ROOT
%endif
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

@ -285,7 +285,7 @@ rm -rf $RPM_BUILD_ROOT
%defattr(-,root,root,0755)
%{_datadir}/dracut/modules.d/02caps

%files tools
%files tools
%defattr(-,root,root,0755)
%{_mandir}/man8/dracut-gencmdline.8*
%{_mandir}/man8/dracut-catimages.8*

View File

@ -74,7 +74,7 @@
<para>A <acronym>TFTP</acronym> server (on systems that can boot from Ethernet) </para>
</listitem>
</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>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>
@ -431,7 +431,7 @@ title Fedora (2.6.29.5-191.fc11.x86_64)
<para>Remove the boot arguments &apos;&apos;rhgb&apos;&apos; and &apos;&apos;quiet&apos;&apos;
</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><screen>default=0
timeout=5
@ -439,12 +439,12 @@ serial --unit=0 --speed=9600
terminal --timeout=5 serial console
title Fedora (2.6.29.5-191.fc11.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.29.5-191.fc11.x86_64 ro root=/dev/mapper/vg_uc1-lv_root console=tty0 rd.shell
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>
</listitem>
<listitem>
<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.

sh: can&apos;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 &quot;$moddir/insmodpost.sh&quot; /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><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 &quot;blacklist $p&quot; &gt;&gt; /etc/modprobe.d/initramfsblacklist.conf
_do_insmodpost=1
done
@ -635,7 +635,7 @@ unset _do_insmodpost
<para><filename>insmodpost.sh</filename>:</para>
<programlisting>. /lib/dracut-lib.sh

for p in $(getargs rd.driver.post=); do
for p in $(getargs rd.driver.post=); do
modprobe $p
done
</programlisting>

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
#
@ -41,7 +41,7 @@ fi

echo "$image:"
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 "========================================================================"
$CAT "$image" | cpio --extract --verbose --quiet --list
echo "========================================================================"

View File

@ -12,16 +12,16 @@ depends() {
}

install() {
inst /sbin/bootchartd
inst /bin/bash
inst /sbin/bootchartd
inst /bin/bash
inst_symlink /init /sbin/init
inst_dir /lib/bootchart/tmpfs
inst /lib/bootchart/bootchart-collector
inst /etc/bootchartd.conf
inst /sbin/accton
inst /lib/bootchart/bootchart-collector
inst /etc/bootchartd.conf
inst /sbin/accton
inst /usr/bin/pkill /bin/pkill
inst /bin/echo
inst /bin/grep
inst /bin/grep
inst /bin/usleep
inst /usr/bin/[ /bin/[


View File

@ -13,11 +13,11 @@ depends() {
installkernel() {
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 cryptomgr crypto_null tcrypt"
FIPSMODULES="$FIPSMODULES cryptomgr crypto_null tcrypt"

mkdir -m 0755 -p "${initdir}/etc/modprobe.d"

for mod in $FIPSMODULES; do
for mod in $FIPSMODULES; do
if instmods $mod; then
echo $mod >> "${initdir}/etc/fipsmodules"
echo "blacklist $mod" >> "${initdir}/etc/modprobe.d/fips.conf"

View File

@ -12,7 +12,7 @@ if [ "$capsmode" = "1" ]; then

info "Loading CAPS_MODULES $CAPS_MODULES"
for i in $CAPS_MODULES;do modprobe $i 2>&1 >/dev/null | vinfo; done

if [ "$CAPS_MODULES_DISABLED" = "1" -a -e /proc/sys/kernel/modules_disabled ]; then
info "Disabling module loading."
echo $CAPS_MODULES_DISABLED > /proc/sys/kernel/modules_disabled
@ -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/inheritable
fi

echo "CAPS_INIT_DROP=\"$CAPS_INIT_DROP\"" > /etc/capsdrop
info "Will drop capabilities $CAPS_INIT_DROP from init."
fi

View File

@ -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
by Dracut and the ones in the system. Package maintainer is expected to
create those for his/her distribution and it's appreciated to share it
with us, so we can include it in source package.
with us, so we can include it in source package.


1. Hostonly vs Generic

View File

@ -178,12 +178,12 @@ install() {
for kbddir in ${kbddir} /usr/lib/kbd /lib/kbd /usr/share /usr/share/kbd
do
[[ -d "${kbddir}" ]] && \
for dir in ${KBDSUBDIRS//,/ }
for dir in ${KBDSUBDIRS//,/ }
do
[[ -d "${kbddir}/${dir}" ]] && continue
false
done && break
kbddir=''
kbddir=''
done

[[ ${kbddir} ]] || {

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# 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
if [ -n "$namesrv" ] ; then
for s in $namesrv; do
echo nameserver $s
echo nameserver $s
done
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"
exit 1
fi
setup_interface
setup_interface
set | while read line; do
[ "${line#new_}" = "$line" ] && continue
echo "$line"
echo "$line"
done >/tmp/dhclient.$netif.dhcpopts
echo online > /sys/class/net/$netif/uevent
initqueue --onetime --name netroot-$netif netroot $netif
initqueue --onetime --name netroot-$netif netroot $netif
;;
*) echo "dhcp: $reason";;
esac

View File

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

View File

@ -32,10 +32,10 @@ load_ipv6() {
do_ipv6auto() {
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_redirects
echo ip link set $netif up
echo ip link set $netif up
echo wait_for_if_up $netif
} > /tmp/net.$netif.up

@ -44,13 +44,13 @@ do_ipv6auto() {
namesrv=$(getargs nameserver)
if [ -n "$namesrv" ] ; then
for s in $namesrv; do
echo nameserver $s
echo nameserver $s
done
fi >> /tmp/net.$netif.resolv.conf


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
@ -58,7 +58,7 @@ do_static() {
strstr $ip '*:*:*' && load_ipv6

{
echo ip link set $netif up
echo ip link set $netif up
echo wait_for_if_up $netif
# do not flush addr for ipv6
strstr $ip '*:*:*' || \
@ -72,12 +72,12 @@ do_static() {
namesrv=$(getargs nameserver)
if [ -n "$namesrv" ] ; then
for s in $namesrv; do
echo nameserver $s
echo nameserver $s
done
fi >> /tmp/net.$netif.resolv.conf

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.$$ + "
@ -223,7 +223,7 @@ for p in $(getargs ip=); do
do_dhcp -6 ;;
auto6)
do_ipv6auto ;;
*)
*)
do_static ;;
esac
break

View File

@ -5,7 +5,7 @@
check() {
. $dracutfunctions

for program in ip arping dhclient ; do
for program in ip arping dhclient ; do
if ! type -P $program >/dev/null; then
derror "Could not find program \"$program\" required by network."
return 1
@ -42,12 +42,12 @@ installkernel() {
}

install() {
dracut_install ip arping tr dhclient
dracut_install ip arping tr dhclient
dracut_install -o brctl ifenslave
inst "$moddir/ifup" "/sbin/ifup"
inst "$moddir/netroot" "/sbin/netroot"
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 60 "$moddir/net-genrules.sh"
inst_hook cmdline 91 "$moddir/dhcp-root.sh"

View File

@ -20,18 +20,18 @@ type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
[ -z "$netroot" ] && exit 1

# 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
[ -e "/tmp/net.ifaces" ] && read IFACES < /tmp/net.ifaces
for iface in $IFACES ; do
[ -e /tmp/net.$iface.up ] || exit 1
done

# Set or override primary interface
# Set or override primary interface
netif=$1
[ -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
if [ "$netroot" = "dhcp" ] || [ "$netroot" = "dhcp6" ] ; then
# Unset root so we can check later
@ -40,7 +40,7 @@ if [ "$netroot" = "dhcp" ] || [ "$netroot" = "dhcp6" ] ; then
# Load dhcp options
[ -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
if [ -z "$new_root_path" ] ; then
[ -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
[ -f "$f" ] && . "$f";
done
else
else
rootok="1"
fi

@ -89,7 +89,7 @@ done
# Note: This assumes that if no router is present the
# 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

# Get router IP if set
@ -136,7 +136,7 @@ if $handler $netif $netroot $NEWROOT; then

# Save used netif for later use
[ ! -f /tmp/net.ifaces ] && echo $netif > /tmp/net.ifaces
else
else
warn "Mounting root via '$netif' failed"
# If we're trying with multiple interfaces, put that one down.
# ip down/flush ensures that routeing info goes away as well

View File

@ -13,7 +13,7 @@
# return if bond already parsed
[ -n "$bondname" ] && return

# Check if bond parameter is valid
# Check if bond parameter is valid
if getarg bond= >/dev/null ; then
if [ -z "$netroot" ] ; then
die "No netboot configured, bond is invalid"
@ -46,7 +46,7 @@ unset bondname bondslaves bondoptions
if getarg bond >/dev/null; then
# Read bond= parameters if they exist
bond="$(getarg bond=)"
if [ ! "$bond" = "bond" ]; then
if [ ! "$bond" = "bond" ]; then
parsebond "$(getarg bond=)"
fi
# Simple default bond

View File

@ -11,7 +11,7 @@
# return if bridge already parsed
[ -n "$bridgename" ] && return

# Check if bridge parameter is valid
# Check if bridge parameter is valid
if getarg bridge= >/dev/null ; then
if [ -z "$netroot" ] ; then
die "No netboot configured, bridge is invalid"
@ -49,7 +49,7 @@ fi
if getarg bridge >/dev/null; then
# Read bridge= parameters if they exist
bridge="$(getarg bridge=)"
if [ ! "$bridge" = "bridge" ]; then
if [ ! "$bridge" = "bridge" ]; then
parsebridge "$(getarg bridge=)"
fi
# Simple default bridge

View File

@ -156,7 +156,7 @@ for p in $(getargs ip=); do
done

# 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="$BOOTDEV $IFACES"
fi
@ -165,5 +165,5 @@ fi
[ -n "$BOOTDEV" ] && echo $BOOTDEV > /tmp/net.bootdev
[ -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"

View File

@ -31,18 +31,18 @@ for netif in $IFACES ; do
fi
cat /sys/class/net/$netif/address > /tmp/net.$netif.hwaddr
{
echo "# Generated by dracut initrd"
echo "# Generated by dracut initrd"
echo "DEVICE=$netif"
echo "ONBOOT=yes"
echo "NETBOOT=yes"
if [ -f /tmp/net.$netif.lease ]; then
strstr "$ip" '*:*:*' &&
echo "DHCPV6C=yes"
echo "BOOTPROTO=dhcp"
echo "DHCPV6C=yes"
echo "BOOTPROTO=dhcp"
else
echo "BOOTPROTO=none"
echo "BOOTPROTO=none"
# 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 "NETMASK=$mask"
[ -n "$gw" ] && echo "GATEWAY=$gw"
@ -55,7 +55,7 @@ for netif in $IFACES ; do
{
echo "HWADDR=$(cat /sys/class/net/$netif/address)"
echo "TYPE=Ethernet"
echo "NAME=\"Boot Disk\""
echo "NAME=\"Boot Disk\""
} >> /tmp/ifcfg/ifcfg-$netif
fi

@ -88,7 +88,7 @@ for netif in $IFACES ; do
# bridge
{
echo "TYPE=Bridge"
echo "NAME=\"Boot Disk\""
echo "NAME=\"Boot Disk\""
} >> /tmp/ifcfg/ifcfg-$netif
if [ "$ethname" = "$bondname" ] ; then
{
@ -100,7 +100,7 @@ for netif in $IFACES ; do
# This variable is an indicator of a bond interface for initscripts
echo "BONDING_OPTS=\"$bondoptions\""
echo "BRIDGE=$netif"
echo "NAME=\"$bondname\""
echo "NAME=\"$bondname\""
} >> /tmp/ifcfg/ifcfg-$bondname
for slave in $bondslaves ; do
# write separate ifcfg file for the raw eth interface

View File

@ -14,7 +14,7 @@ depends() {

install() {
call_splash_geninitramfs() {
local out ret
local out ret

out=$(splash_geninitramfs -c "$1" ${@:2} 2>&1)
ret=$?

View File

@ -7,11 +7,11 @@ PLYMOUTH_THEME=$(plymouth-set-default-theme)
inst /sbin/plymouthd /bin/plymouthd
dracut_install /bin/plymouth \
"${PLYMOUTH_LOGO_FILE}" \
/etc/system-release
/etc/system-release

mkdir -m 0755 -p "${initdir}/usr/share/plymouth"

if [[ $hostonly ]]; then
if [[ $hostonly ]]; then
dracut_install "${usrlibdir}/plymouth/text.so" \
"${usrlibdir}/plymouth/details.so" \
"/usr/share/plymouth/themes/details/details.plymouth" \
@ -44,6 +44,6 @@ else
done
(
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

View File

@ -215,7 +215,7 @@ readkey() {
fi
;;
*) cat "$mntp/$keypath" ;;
esac
esac

umount "$mntp"
rmdir "$mntp"

View File

@ -43,7 +43,7 @@ if [ -f /etc/crypttab ] && getargbool 1 rd.luks.crypttab -n rd_NO_CRYPTTAB; then
luksname="$name"
break
fi

# path used in crypttab
else
cdev=$(readlink -f $dev)

View File

@ -13,7 +13,7 @@ check() {
[[ $hostonly ]] && {
rootdev=$(find_root_block_device)
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
check_block_and_slaves is_crypt "$rootdev" || return 1
else

View File

@ -13,7 +13,7 @@ else
LUKS=$(getargs rd.luks.uuid rd_LUKS_UUID)

if [ -n "$LUKS" ]; then
for luksid in $LUKS; do
for luksid in $LUKS; do
luksid=${luksid##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 -- '--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
fi


View File

@ -1,4 +1,4 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# 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

View File

@ -21,8 +21,8 @@ echo $SETS|vinfo

if [ -n "$DM_RAIDS" ]; then
# only activate specified DM RAIDS
for r in $DM_RAIDS; do
for s in $SETS; do
for r in $DM_RAIDS; do
for s in $SETS; do
if [ "${s##$r}" != "$s" ]; then
info "Activating $s"
dmraid -ay -i -p --rm_partitions "$s" 2>&1 | vinfo
@ -31,7 +31,7 @@ if [ -n "$DM_RAIDS" ]; then
fi
done
done
else
else
# scan and activate all DM RAIDS
for s in $SETS; do
info "Activating $s"

View File

@ -16,7 +16,7 @@ check() {
[[ $hostonly ]] && {
rootdev=$(find_root_block_device)
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
check_block_and_slaves is_dmraid "$rootdev" || return 1
else
@ -34,7 +34,7 @@ depends() {
}

install() {
dracut_install dmraid partx kpartx
dracut_install dmraid partx kpartx

inst dmeventd

@ -42,7 +42,7 @@ install() {
[ -e "$i" ] && dracut_install "$i"
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
# files, but provides the one below:
inst_rules 64-device-mapper.rules

View File

@ -5,15 +5,15 @@ case "$root" in
live:/dev/*)
{
printf 'KERNEL=="%s", SYMLINK+="live"\n' \
${root#live:/dev/}
${root#live:/dev/}
printf 'SYMLINK=="%s", SYMLINK+="live"\n' \
${root#live:/dev/}
${root#live:/dev/}
} >> $UDEVRULESD/99-live-mount.rules
{
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' \
${root#live:/dev/}
${root#live:/dev/}
} >> $UDEVRULESD/99-live-squash.rules
echo '[ -e /dev/root ]' > $hookdir/initqueue/finished/dmsquash.sh
;;

View File

@ -9,7 +9,7 @@ check() {
}

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
echo dm rootfs-block
return 0

View File

@ -2,10 +2,10 @@
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# 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=,
for p in $i; do
for p in $i; do
modprobe $p
done
)

View File

@ -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

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 the required list is not set via the filesystems variable
if ! [[ $hostonly ]]; then

View File

@ -2,25 +2,25 @@
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# 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=,
for p in $i; do
for p in $i; do
modprobe $p 2>&1 | vinfo
done
)
done

for i in $(getargs rd.driver.blacklist rdblacklist=); do
for i in $(getargs rd.driver.blacklist rdblacklist=); do
(
IFS=,
for p in $i; do
for p in $i; do
echo "blacklist $p" >> /etc/modprobe.d/initramfsblacklist.conf
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
_do_insmodpost=1
done

View File

@ -20,7 +20,7 @@ lvmdevs=$(
done
)

if [ ! -e /etc/lvm/lvm.conf ]; then
if [ ! -e /etc/lvm/lvm.conf ]; then
{
echo 'devices {';
echo -n ' filter = [ '
@ -28,7 +28,7 @@ if [ ! -e /etc/lvm/lvm.conf ]; then
printf '"a|^/dev/%s$|", ' $dev;
done;
echo '"r/.*/" ]';
echo '}';
echo '}';

# establish LVM locking
if [ -n $SNAPSHOT ]; then
@ -66,7 +66,7 @@ IFS=$OLDIFS
maj=${1##*:}
min=$2
sub=${3%% *}
sub=${sub%%\(*};
sub=${sub%%\(*};

check_lvm_ver 2 2 57 $maj $min $sub && \
nopoll="--poll n"

View File

@ -14,7 +14,7 @@ check() {
[[ $hostonly ]] && {
rootdev=$(find_root_block_device)
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
check_block_and_slaves is_lvm "$rootdev" || return 1
else
@ -35,9 +35,9 @@ depends() {
install() {
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
inst /etc/lvm/lvm.conf
# FIXME: near-term hack to establish read-only locking;

View File

@ -22,10 +22,10 @@ KERNEL!="md*", IMPORT{program}="/sbin/mdadm --examine --export $tempnode"

LABEL="do_md_inc"

#
#
# if rd_MDADMCONF do not assemble incrementally
# defer auto assembly until the udev queue is settled
#
#
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'"

View File

@ -3,5 +3,5 @@
# ex: ts=8 sw=4 sts=4 et filetype=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

View File

@ -7,8 +7,8 @@ for i in /dev/md* /dev/md/*; do
[ -b $i ] || continue

mddetail=$(udevadm info --query=property --name=$i)
case "$mddetail" in
*MD_LEVEL=container*)
case "$mddetail" in
*MD_LEVEL=container*)
;;
*DEVTYPE=partition*)
;;

View File

@ -11,7 +11,7 @@ mdadm -Is --run 2>&1 | vinfo

# there could still be some leftover devices
# 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
udevinfo="$(udevadm info --query=env --name=$md)"
strstr "$udevinfo" "MD_UUID=" && continue

View File

@ -14,7 +14,7 @@ check() {
[[ $hostonly ]] && {
rootdev=$(find_root_block_device)
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
check_block_and_slaves is_mdraid "$rootdev" || return 1
else
@ -36,12 +36,12 @@ installkernel() {
}

install() {
dracut_install mdadm partx
dracut_install mdadm partx


# 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)
# 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.
# dledford has hardware to test this, so he should be able to clean this up.
# inst /etc/passwd
@ -53,11 +53,11 @@ install() {

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"
fi

if [[ $hostonly ]] || [[ $mdadmconf = "yes" ]]; then
if [[ $hostonly ]] || [[ $mdadmconf = "yes" ]]; then
if [ -f /etc/mdadm.conf ]; then
inst /etc/mdadm.conf
else
@ -67,7 +67,7 @@ install() {

if [ -x /sbin/mdmon ] ; then
dracut_install mdmon
fi
fi
inst_hook pre-udev 30 "$moddir/mdmon-pre-udev.sh"

inst "$moddir/mdraid_start.sh" /sbin/mdraid_start

View File

@ -11,17 +11,17 @@ else
if [ -n "$MD_UUID" ]; then
for f in /etc/udev/rules.d/65-md-incremental*.rules; do
[ -e "$f" ] || continue
while read line; do
while read line; do
if [ "${line%%UUID CHECK}" != "$line" ]; then
for uuid in $MD_UUID; do
printf 'ENV{MD_UUID}=="%s", GOTO="do_md_inc"\n' $uuid
done;
printf 'GOTO="md_inc_end"\n';
printf 'GOTO="md_inc_end"\n';
else
echo $line;
echo $line;
fi
done < "${f}" > "${f}.new"
mv "${f}.new" "$f"
mv "${f}.new" "$f"
done
fi
fi

View File

@ -4,7 +4,7 @@

if [ -e /etc/multipath.conf ]; then
HARD=""
while pidof multipathd >/dev/null 2>&1; do
while pidof multipathd >/dev/null 2>&1; do
for pid in $(pidof multipathd); do
kill $HARD $pid >/dev/null 2>&1
done

View File

@ -6,6 +6,6 @@ if [ -e /etc/multipath.conf ]; then
modprobe dm-multipath
multipathd -B || multipathd
else
rm /etc/udev/rules.d/??-multipath.rules 2>/dev/null
rm /etc/udev/rules.d/??-multipath.rules 2>/dev/null
fi


View File

@ -4,7 +4,7 @@

check() {
arch=$(uname -m)
[ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1
[ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1

return 0
}

View File

@ -12,7 +12,7 @@ depends() {
}

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 fsck fsck.ext2 fsck.ext4 fsck.ext3 fsck.ext4dev fsck.vfat e2fsck


View File

@ -21,8 +21,8 @@ installkernel() {
}

install() {
dracut_install ip
inst dcbtool
dracut_install ip
inst dcbtool
inst fipvlan
inst lldpad


View File

@ -4,7 +4,7 @@
#
# This implementation is incomplete: Discovery mode is not implemented and
# 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.
#

@ -18,7 +18,7 @@ PATH=/usr/sbin:/usr/bin:/sbin:/bin
# Huh? Empty $2?
[ -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
[ -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=)
[ -n "$arg" ] && iscsi_in_password=$arg

handle_netroot()
handle_netroot()
{
iroot=$1
# override conf/commandline options by dhcp root_path
@ -78,7 +78,7 @@ handle_netroot()
IFS=@
set $iroot
if [ $# -gt 1 ]; then
authinfo=$1; shift
authinfo=$1; shift
iroot=$*
# 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
@ -92,13 +92,13 @@ handle_netroot()
iscsi_in_password=$4
fi
fi
fi
fi

IFS="$OLDIFS"

local v=${iroot}:
local i
set --
set --
while [ -n "$v" ]; do
if [ "${v#\[*:*:*\]:}" != "$v" ]; then
# handle IPv6 address
@ -106,7 +106,7 @@ handle_netroot()
i="${i##\[}"
set -- "$@" "$i"
v=${v#\[$i\]:}
else
else
set -- "$@" "${v%%:*}"
v=${v#*:}
fi
@ -183,8 +183,8 @@ handle_netroot()
}

# loop over all netroot parameter
if getarg netroot; then
for nroot in $(getargs netroot); do
if getarg netroot; then
for nroot in $(getargs netroot); do
[ "${netroot%%:*}" = "iscsi" ] || continue
handle_netroot ${nroot##iscsi:}
done

View File

@ -45,7 +45,7 @@ installkernel() {
local iscsifuncs='iscsi_register_transport'
fgrep -q "$iscsifuncs" "$1"
}
instmods $(filter_kernel_modules iscsi_module_test)
instmods $(filter_kernel_modules iscsi_module_test)
}

install() {

View File

@ -6,7 +6,7 @@ check() {
# If our prerequisites are not met, fail.
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.
[[ $hostonly ]] && {
is_nbd() { [[ -b /dev/block/$1 && $1 == 43:* ]] ;}

View File

@ -20,7 +20,7 @@ netroot_to_var() {
v=${v#*:}
done

unset server port
unset server port
server=$2; port=$3;
}


View File

@ -26,9 +26,9 @@ install() {
type -P portmap >/dev/null && dracut_install portmap
type -P rpcbind >/dev/null && dracut_install rpcbind

dracut_install rpc.statd mount.nfs mount.nfs4 umount
[ -f /etc/netconfig ] && dracut_install /etc/netconfig
dracut_install /etc/services
dracut_install rpc.statd mount.nfs mount.nfs4 umount
[ -f /etc/netconfig ] && dracut_install /etc/netconfig
dracut_install /etc/services
dracut_install /etc/nsswitch.conf /etc/rpc /etc/protocols
dracut_install rpc.idmapd /etc/idmapd.conf
dracut_install sed

View File

@ -46,7 +46,7 @@ if [ -z "$server" ] ; then
[ -n "$var" ] && server=$var && break;
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
server=${server%%:*}
fi
@ -113,7 +113,7 @@ else
# 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=2 $server:$path $NEWROOT ; } \
&& { [ -e /dev/root ] || >/dev/root ; }
&& { [ -e /dev/root ] || >/dev/root ; }
fi

# inject new exit_if_exists

View File

@ -14,7 +14,7 @@ pid=$(pidof rpc.idmapd)
pid=$(pidof rpcbind)
[ -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
[ -d $NEWROOT/$rpcpipefspath ] || \
mkdir -m 0755 -p $NEWROOT/$rpcpipefspath 2>/dev/null

View File

@ -11,7 +11,7 @@
# root=/dev/nfs nfsroot=[server:]path[,options]
#
# 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.
#
# If server is unspecified it will be pulled from one of the following
@ -44,7 +44,7 @@ if [ -n "$netroot" ] ; then
fi
else
netroot=$root;
fi
fi

# LEGACY: nfsroot= is valid only if root=/dev/nfs
if [ -n "$nfsroot" ] ; then
@ -106,7 +106,7 @@ fi;
# Done, all good!
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]
root="$fstype"


View File

@ -9,7 +9,7 @@ install() {
[[ -x "${bin}" ]] && {
inst "${bin}" /usr/sbin/resume
[[ -f /etc/suspend.conf ]] && inst /etc/suspend.conf
break
break
}
done


View File

@ -2,7 +2,7 @@
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# 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
echo "$resume" >/.resume
else

View File

@ -17,7 +17,7 @@ PATH=/usr/sbin:/usr/bin:/sbin:/bin
[ -x $(command -v resume) ] && command resume $a_splash "$resume"

# 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;
echo "${maj%,}:$min"> /sys/power/resume)
>/.resume

View File

@ -5,11 +5,11 @@
if [ "${root%%:*}" = "block" ]; then
{
printf 'KERNEL=="%s", SYMLINK+="root"\n' \
${root#block:/dev/}
${root#block:/dev/}
printf 'SYMLINK=="%s", SYMLINK+="root"\n' \
${root#block:/dev/}
${root#block:/dev/}
} >> $UDEVRULESD/99-root.rules

printf '[ -e "%s" ] && { ln -s "%s" /dev/root 2>/dev/null; rm "$job"; }\n' \
"${root#block:}" "${root#block:}" >> $hookdir/initqueue/settled/blocksymlink.sh


View File

@ -27,7 +27,7 @@ filter_rootopts() {

if [ -n "$root" -a -z "${root%%block:*}" ]; then
mount -t ${fstype:-auto} -o "$rflags",ro "${root#block:}" "$NEWROOT" \
&& ROOTFS_MOUNTED=yes
&& ROOTFS_MOUNTED=yes

READONLY=
fsckoptions=
@ -77,14 +77,14 @@ if [ -n "$root" -a -z "${root%%block:*}" ]; then
&& ! getarg rootflags \
&& [ -f "$NEWROOT/etc/fstab" ] \
&& ! [ -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,
# remount it with the proper options
rootopts="defaults"
while read dev mp fs opts rest; do
while read dev mp fs opts rest; do
# skip comments
[ "${dev%%#*}" != "$dev" ] && continue

if [ "$mp" = "/" ]; then
rootfs=$fs
rootopts=$opts
@ -115,10 +115,10 @@ if [ -n "$root" -a -z "${root%%block:*}" ]; then
if [ -z "$fastboot" -a "$READONLY" != "yes" ]; then
info "Checking filesystems"
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=$?
echo $RD_ROOTFS_FSCK > /run/initramfs/root-fsck

# A return of 4 or higher means there were serious problems.
if [ $RD_ROOTFS_FSCK -gt 3 ]; then
warn $out

View File

@ -7,7 +7,7 @@ install() {
for TERMINFODIR in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
[ -d ${TERMINFODIR} ] && break
done

[ -d ${TERMINFODIR} ] && \
dracut_install $(find ${TERMINFODIR} -type f)
}

View File

@ -10,7 +10,7 @@ install() {
dracut_install basename
inst_rules 50-udev-default.rules 60-persistent-storage.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
inst_rules 50-udev.rules 95-late.rules

@ -22,8 +22,8 @@ install() {
dracut_install cat uname


inst_dir /run/udev
inst_dir /run/udev/rules.d
inst_dir /run/udev
inst_dir /run/udev/rules.d

if [ ! -x /lib/udev/vol_id ]; then
dracut_install blkid

View File

@ -4,14 +4,14 @@

check() {
arch=$(uname -m)
[ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1
[ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1

return 0
}

depends() {
arch=$(uname -m)
[ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1
[ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1

return 0
}

View File

@ -5,7 +5,7 @@
getargbool 1 rd.zfcp.conf -n rd_NO_ZFCPCONF || rm /etc/zfcp.conf

for zfcp_arg in $(getargs rd.zfcp 'rd_ZFCP='); do
(
(
IFS=","
set $zfcp_arg
echo "$@" >> /etc/zfcp.conf

View File

@ -6,15 +6,15 @@
# deviceno WWPN FCPLUN
#
# Example:
# 0.0.4000 0x5005076300C213e9 0x5022000000000000
# 0.0.4001 0x5005076300c213e9 0x5023000000000000
# 0.0.4000 0x5005076300C213e9 0x5022000000000000
# 0.0.4001 0x5005076300c213e9 0x5023000000000000
#
#
# manual setup:
# modprobe zfcp
# echo 1 > /sys/bus/ccw/drivers/zfcp/0.0.4000/online
# echo LUN > /sys/bus/ccw/drivers/zfcp/0.0.4000/WWPN/unit_add
#
#
# Example:
# modprobe zfcp
# echo 1 > /sys/bus/ccw/drivers/zfcp/0.0.4000/online

View File

@ -4,7 +4,7 @@

check() {
arch=$(uname -m)
[ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1
[ "$arch" = "s390" -o "$arch" = "s390x" ] || return 1

return 0
}

View File

@ -2,11 +2,11 @@
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# 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()
{
# If SELinux is disabled exit now
# If SELinux is disabled exit now
getarg "selinux=0" > /dev/null && return 0

SELINUX="enforcing"
@ -14,7 +14,7 @@ rd_load_policy()

# Check whether SELinux is in permissive mode
permissive=0
getarg "enforcing=0" > /dev/null
getarg "enforcing=0" > /dev/null
if [ $? -eq 0 -o "$SELINUX" = "permissive" ]; then
permissive=1
fi
@ -24,7 +24,7 @@ rd_load_policy()
local ret=0
local out
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()
if [ -x "$NEWROOT/sbin/load_policy" ]; then
out=$(chroot "$NEWROOT" /sbin/load_policy -i 2>&1)

View File

@ -1,16 +1,16 @@
Syslog support for dracut

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.

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

Then if syslog is configured it is started and will forward all
kernel messages to the given syslog server.

The syslog implementation is detected automatically by finding the
The syslog implementation is detected automatically by finding the
apropriate binary with the following order:
rsyslogd
syslogd
@ -20,5 +20,5 @@ Then if detected the syslog.conf is generated and syslog is started.
Bootparameters:
syslogserver=ip Where to syslog to
sysloglevel=level What level has to be logged
syslogtype=rsyslog|syslog|syslogng
Don't auto detect syslog but set it
syslogtype=rsyslog|syslog|syslogng
Don't auto detect syslog but set it

View File

@ -7,7 +7,7 @@
#Bootparameters:
#syslogserver=ip Where to syslog to
#sysloglevel=level What level has to be logged
#syslogtype=rsyslog|syslog|syslogng
#syslogtype=rsyslog|syslog|syslogng
# Don't auto detect syslog but set it
type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh


View File

@ -13,7 +13,7 @@ rsyslog_config() {
shift
local filters=$*
local filter=

cat $syslog_template

for filter in $filters; do
@ -32,4 +32,4 @@ template=/etc/templates/rsyslog.conf
if [ -n "$server" ]; then
rsyslog_config "$server" "$template" "$filters" > $conf
rsyslogd -c3
fi
fi

View File

@ -18,7 +18,7 @@ detect_syslog() {
fi
echo "$syslogtype"
[ -n "$syslogtype" ]
}
}

read syslogtype < /tmp/syslog.type
if [ -z "$syslogtype" ]; then

View File

@ -52,12 +52,12 @@ _dogetarg() {

for _o in $CMDLINE; do
if [ "$_o" = "$1" ]; then
return 0;
return 0;
fi
[ "${_o%%=*}" = "${1%=}" ] && _val=${_o#*=};
done
if [ -n "$_val" ]; then
echo $_val;
echo $_val;
return 0;
fi
return 1;
@ -86,7 +86,7 @@ getarg() {
shift;;
esac
done
[ "$RD_DEBUG" = "yes" ] && set -x
[ "$RD_DEBUG" = "yes" ] && set -x
return 1
}

@ -105,7 +105,7 @@ getargbool() {
}

_dogetargs() {
set +x
set +x
local _o _found
unset _o
unset _found
@ -116,7 +116,7 @@ _dogetargs() {
return 0;
fi
if [ "${_o%%=*}" = "${1%=}" ]; then
echo -n "${_o#*=} ";
echo -n "${_o#*=} ";
_found=1;
fi
done
@ -134,10 +134,10 @@ getargs() {
done
if [ -n "$_val" ]; then
echo -n $_val
[ "$RD_DEBUG" = "yes" ] && set -x
[ "$RD_DEBUG" = "yes" ] && set -x
return 0
fi
[ "$RD_DEBUG" = "yes" ] && set -x
[ "$RD_DEBUG" = "yes" ] && set -x
return 1;
}

@ -146,7 +146,7 @@ getargs() {
# it just returns 0. Otherwise 1 is returned.
# $1 = options separated by commas
# $2 = option we are interested in
#
#
# Example:
# $1 = cipher=aes-cbc-essiv:sha256,hash=sha256,verify
# $2 = hash
@ -199,14 +199,14 @@ setdebug() {
if [ -e /proc/cmdline ]; then
RD_DEBUG=no
if getargbool 0 rd.debug -y rdinitdebug -y rdnetdebug; then
RD_DEBUG=yes
RD_DEBUG=yes
[ -n "$BASH" ] && \
export PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): ';
fi
fi
export RD_DEBUG
fi
[ "$RD_DEBUG" = "yes" ] && set -x
[ "$RD_DEBUG" = "yes" ] && set -x
}

setdebug
@ -242,7 +242,7 @@ die() {
echo "<24>dracut: Refusing to continue";
} > /dev/kmsg

{
{
echo "warn dracut: FATAL: \"$@\"";
echo "warn dracut: Refusing to continue";
echo "exit 1"
@ -271,11 +271,11 @@ info() {
check_quiet
echo "<30>dracut: $@" > /dev/kmsg
[ "$DRACUT_QUIET" != "yes" ] && \
echo "dracut: $@"
echo "dracut: $@"
}

vinfo() {
while read line; do
while read line; do
info $line;
done
}
@ -339,16 +339,16 @@ ismounted() {

wait_for_if_up() {
local cnt=0
while [ $cnt -lt 20 ]; do
while [ $cnt -lt 20 ]; do
li=$(ip link show $1)
[ -z "${li##*state UP*}" ] && return 0
sleep 0.1
cnt=$(($cnt+1))
done
done
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>]
nfsroot_to_var() {
# strip nfs[4]:
@ -370,10 +370,10 @@ nfsroot_to_var() {
options="${options##:}"
# strip ":"
options="${options%%:}"

# Does it really start with '/'?
[ -n "${path%%/*}" ] && path="error";

#Fix kernel legacy style separating path and options with ','
if [ "$path" != "${path#*,}" ] ; then
options=${path#*,}
@ -384,7 +384,7 @@ nfsroot_to_var() {
ip_to_var() {
local v=${1}:
local i
set --
set --
while [ -n "$v" ]; do
if [ "${v#\[*:*:*\]:}" != "$v" ]; then
# handle IPv6 address
@ -392,7 +392,7 @@ ip_to_var() {
i="${i##\[}"
set -- "$@" "$i"
v=${v#\[$i\]:}
else
else
set -- "$@" "${v%%:*}"
v=${v#*:}
fi

View File

@ -17,7 +17,7 @@ wait_for_loginit()
exec 0<>/dev/console 1<>/dev/console 2<>/dev/console
# wait for loginit
i=0
while [ $i -lt 10 ]; do
while [ $i -lt 10 ]; do
if [ ! -e /run/initramfs/loginit.pipe ]; then
j=$(jobs)
[ -z "$j" ] && break
@ -25,7 +25,7 @@ wait_for_loginit()
fi
sleep 0.1
i=$(($i+1))
done
done

if [ $i -eq 10 ]; then
kill %1 >/dev/null 2>&1
@ -41,7 +41,7 @@ emergency_shell()
set +e
if [ "$1" = "-n" ]; then
_rdshell_name=$2
shift 2
shift 2
else
_rdshell_name=dracut
fi
@ -105,7 +105,7 @@ if ! ismounted /dev; then
# try to mount devtmpfs
if ! mount -t devtmpfs -o mode=0755,nosuid,noexec udev /dev >/dev/null 2>&1; then
# 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
mknod -m 0666 /dev/null c 1 3
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
export UDEVRULESD=/run/udev/rules.d
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
fi

@ -209,7 +209,7 @@ i=0
while :; do

check_finished && break

udevsettle

check_finished && break
@ -217,7 +217,7 @@ while :; do
if [ -f $hookdir/initqueue/work ]; then
rm $hookdir/initqueue/work
fi

for job in $hookdir/initqueue/*.sh; do
[ -e "$job" ] || break
job=$job . $job
@ -241,7 +241,7 @@ while :; do
# which report no medium for quiet
# some time.
for cdrom in /sys/block/sr*; do
[ -e "$cdrom" ] || continue
[ -e "$cdrom" ] || continue
# skip, if cdrom medium was already found
strstr "$(udevadm info --query=env --path=${cdrom##/sys})" \
ID_CDROM_MEDIA && continue
@ -256,7 +256,7 @@ while :; do
echo change > "$cdrom/uevent"
fi
done

i=$(($i+1))
[ $i -gt $RDRETRY ] \
&& { flock -s 9 ; emergency_shell "No root device \"$root\" found"; } 9>/.console_lock
@ -266,7 +266,7 @@ unset queuetriggered

# reset cdrom polling
for cdrom in /sys/block/sr*; do
[ -e "$cdrom" ] || continue
[ -e "$cdrom" ] || continue
if [ -e "$cdrom"/events_poll_msecs ]; then
echo -1 > "$cdrom"/events_poll_msecs
fi
@ -296,7 +296,7 @@ done

{
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

# 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

HARD=""
while pidof udevd >/dev/null 2>&1; do
while pidof udevd >/dev/null 2>&1; do
for pid in $(pidof udevd); do
kill $HARD $pid >/dev/null 2>&1
done
@ -364,7 +364,7 @@ if getarg init= >/dev/null ; then
set $CLINE
shift
for x in "$@"; do
for s in $ignoreargs; do
for s in $ignoreargs; do
[ "${x%%=*}" = $s ] && continue 2
done
initargs="$initargs $x"
@ -383,14 +383,14 @@ else
done
fi
[ "$RD_DEBUG" = "yes" ] && set -x

if [ -d "$NEWROOT"/run ]; then
NEWRUN="${NEWROOT}/run"
mount --bind /run "$NEWRUN"
NEWINITRAMFSROOT="$NEWRUN/initramfs"

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
done
fi
@ -401,9 +401,9 @@ else
fi

wait_for_loginit

info "Switching root"

umount -l /run

unset PS4

View File

@ -42,9 +42,9 @@ shift
[ -x "$exe" ] || exe=$(command -v $exe)

if [ -n "$onetime" ]; then
{
{
echo '[ -e "$job" ] && rm "$job"'
echo "$exe $@"
echo "$exe $@"
} > "/tmp/$$-${job}.sh"
else
echo "$exe $@" > "/tmp/$$-${job}.sh"

View File

@ -12,13 +12,13 @@ printf -- "$$" > /run/initramfs/loginit.pid
[ -e /dev/kmsg ] && exec 5>/dev/kmsg || exec 5>/dev/null
exec 6>/run/initramfs/init.log

while read line; do
while read line; do
if [ "$line" = "DRACUT_LOG_END" ]; then
rm -f /run/initramfs/loginit.pipe
exit 0
fi
echo "<31>dracut: $line" >&5
# if "quiet" is specified we output to /dev/console
[ -n "$QUIET" ] && echo "dracut: $line"
[ -n "$QUIET" ] && echo "dracut: $line"
echo "$line" >&6
done

View File

@ -7,14 +7,14 @@ check() {
}

depends() {
echo udev-rules
echo udev-rules
return 0
}

install() {
dracut_install mount mknod mkdir modprobe pidof sleep chroot \
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
dracut_install bash
(ln -s bash "${initdir}/bin/sh" || :)

View File

@ -13,9 +13,9 @@ sfdisk -C 1280 -H 2 -S 32 -L /dev/sda <<EOF
EOF

mkfs.ext3 -L dracut /dev/sda2
mkdir -p /root
mount /dev/sda2 /root
cp -a -t /root /source/*
mkdir -p /root
mount /dev/sda2 /root
cp -a -t /root /source/*
mkdir -p /root/run
umount /root
echo "dracut-root-block-created" >/dev/sda1

View File

@ -15,7 +15,7 @@ test_run() {
}

test_setup() {

if [ ! -e root.ext3 ]; then

# Create the blank file to use as a root filesystem
@ -43,7 +43,7 @@ test_setup() {
(
initdir=overlay
. $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_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" \
-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() {

View File

@ -24,7 +24,7 @@ test_setup() {
initdir=overlay/source
. $basedir/dracut-functions
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/ifup" "/sbin/ifup"
dracut_install grep
@ -34,16 +34,16 @@ test_setup() {
cp -a /etc/ld.so.conf* $initdir/etc
sudo ldconfig -r "$initdir"
)

# second, install the files needed to make the root filesystem
(
initdir=overlay
. $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_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
)

# 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
# devices, volume groups, encrypted partitions, etc.

View File

@ -24,7 +24,7 @@ test_setup() {
initdir=overlay/source
. $basedir/dracut-functions
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/ifup" "/sbin/ifup"
dracut_install grep
@ -35,16 +35,16 @@ test_setup() {
mkdir $initdir/run
sudo ldconfig -r "$initdir"
)

# second, install the files needed to make the root filesystem
(
initdir=overlay
. $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_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
)

# 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
# devices, volume groups, encrypted partitions, etc.

View File

@ -39,8 +39,8 @@ mdadm /dev/md0 --fail /dev/sda2 --remove /dev/sda2 && \
. /tmp/mduuid;
} && \
{
echo "dracut-root-block-created"
echo MD_UUID=$MD_UUID
echo "dracut-root-block-created"
echo MD_UUID=$MD_UUID
}> /dev/sda1
dd if=/dev/zero of=/dev/sda2
poweroff -f

View File

@ -27,7 +27,7 @@ test_run() {
echo "MD_UUID=$MD_UUID"

client_run || return 1

# client_run rd.md.conf=0 || return 1

client_run rd.lvm=0 failme && return 1
@ -52,14 +52,14 @@ test_run() {
test_setup() {
# Create the blank file to use as a root filesystem
dd if=/dev/zero of=root.ext2 bs=1M count=40

kernel=$KVERSION
# Create what will eventually be our root filesystem onto an overlay
(
initdir=overlay/source
. $basedir/dracut-functions
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/ifup" "/sbin/ifup"
dracut_install grep
@ -69,7 +69,7 @@ test_setup() {
cp -a /etc/ld.so.conf* $initdir/etc
sudo ldconfig -r "$initdir"
)

# second, install the files needed to make the root filesystem
(
initdir=overlay
@ -78,7 +78,7 @@ test_setup() {
inst_hook initqueue 01 ./create-root.sh
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
)

# 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
# devices, volume groups, encrypted partitions, etc.

View File

@ -18,7 +18,7 @@ cryptsetup -q luksFormat /dev/sda2 /keyfile
cryptsetup -q luksFormat /dev/sda3 /keyfile
cryptsetup -q luksFormat /dev/sda4 /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
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
@ -44,7 +44,7 @@ cryptsetup luksClose /dev/mapper/dracut_sda3 && \
cryptsetup luksClose /dev/mapper/dracut_sda4 && \
:; :;} && \
{
echo "dracut-root-block-created"
echo "dracut-root-block-created"
for i in /dev/sda[234]; do
udevadm info --query=env --name=$i|grep 'ID_FS_UUID='
done

View File

@ -10,7 +10,7 @@ test_run() {
LUKSARGS=$(cat luks.txt)

dd if=/dev/zero of=check-success.img bs=1M count=1

echo "CLIENT TEST START: $LUKSARGS"
$testdir/run-qemu -hda root.ext2 -hdb check-success.img -m 256M -nographic \
-net none -kernel /boot/vmlinuz-$KVERSION \
@ -52,7 +52,7 @@ test_setup() {
initdir=overlay/source
. $basedir/dracut-functions
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/ifup" "/sbin/ifup"
dracut_install grep
@ -62,7 +62,7 @@ test_setup() {
cp -a /etc/ld.so.conf* $initdir/etc
sudo ldconfig -r "$initdir"
)

# second, install the files needed to make the root filesystem
(
initdir=overlay
@ -71,7 +71,7 @@ test_setup() {
inst_hook initqueue 01 ./create-root.sh
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
)

# 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
# devices, volume groups, encrypted partitions, etc.
@ -89,9 +89,9 @@ test_setup() {
cryptoUUIDS=$(grep --binary-files=text -m 3 ID_FS_UUID root.ext2)
for uuid in $cryptoUUIDS; do
eval $uuid
printf ' rd.luks.uuid=luks-%s ' $ID_FS_UUID
printf ' rd.luks.uuid=luks-%s ' $ID_FS_UUID
done > luks.txt


(
initdir=overlay

View File

@ -7,9 +7,9 @@ rm /etc/lvm/lvm.conf

udevadm control --reload-rules
# 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"
else
else
echo y|dmraid -f isw -C Test0 --type 1 --disk "/dev/sdb /dev/sdc"
fi
udevadm settle
@ -17,12 +17,12 @@ udevadm settle
SETS=$(dmraid -c -s)
# scan and activate all DM RAIDS
for s in $SETS; do
dmraid -ay -i -p --rm_partitions "$s"
[ -e "/dev/mapper/$s" ] && kpartx -a -p p "/dev/mapper/$s"
dmraid -ay -i -p --rm_partitions "$s"
[ -e "/dev/mapper/$s" ] && kpartx -a -p p "/dev/mapper/$s"
done

udevadm settle
sfdisk -g /dev/mapper/isw*Test0
sfdisk -g /dev/mapper/isw*Test0
# save a partition at the beginning for future flagging purposes
sfdisk -C 2560 -H 2 -S 32 -L /dev/mapper/isw*Test0 <<EOF
,1
@ -38,8 +38,8 @@ udevadm settle
SETS=$(dmraid -c -s -i)
# scan and activate all DM RAIDS
for s in $SETS; do
dmraid -ay -i -p --rm_partitions "$s"
[ -e "/dev/mapper/$s" ] && kpartx -a -p p "/dev/mapper/$s"
dmraid -ay -i -p --rm_partitions "$s"
[ -e "/dev/mapper/$s" ] && kpartx -a -p p "/dev/mapper/$s"
done

udevadm settle
@ -47,7 +47,7 @@ udevadm settle
mdadm --create /dev/md0 --run --auto=yes --level=5 --raid-devices=3 \
/dev/mapper/isw*p2 \
/dev/mapper/isw*p3 \
/dev/mapper/isw*p4
/dev/mapper/isw*p4

# wait for the array to finish initailizing, otherwise this sometimes fails
# randomly.

View File

@ -48,7 +48,7 @@ test_setup() {
initdir=overlay/source
. $basedir/dracut-functions
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/ifup" "/sbin/ifup"
dracut_install grep
@ -59,16 +59,16 @@ test_setup() {
mkdir $initdir/run
sudo ldconfig -r "$initdir"
)

# second, install the files needed to make the root filesystem
(
initdir=overlay
. $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_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
)

# 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
# devices, volume groups, encrypted partitions, etc.

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/sh
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
export TERM=linux
export PS1='nfstest-server:\w\$ '

View File

@ -57,7 +57,7 @@ client_test() {
fi

# 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
echo "CLIENT TEST INFO: got server: ${nfsinfo[0]%%:*}"
@ -210,7 +210,7 @@ test_setup() {
/etc/services sleep mount chmod
type -P portmap >/dev/null && dracut_install portmap
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
[ -x /usr/sbin/dhcpd3 ] && inst /usr/sbin/dhcpd3 /usr/sbin/dhcpd
instmods nfsd sunrpc ipv6

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/sh
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
export TERM=linux
export PS1='nfstest-server:\w\$ '

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