Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e0364f95bc | ||
![]() |
970e646b00 | ||
![]() |
df328b6c36 | ||
![]() |
5b6e76c011 | ||
![]() |
eab677a216 | ||
![]() |
4ce1991856 | ||
![]() |
7e87a0bfa0 | ||
![]() |
7717b4433a | ||
![]() |
5db734030d | ||
![]() |
5966b1b15d | ||
![]() |
3e17f33b27 | ||
![]() |
bd81caa80a | ||
![]() |
f910f00627 |
2
Makefile
2
Makefile
@@ -1,4 +1,4 @@
|
||||
VERSION=0.2
|
||||
VERSION=0.3
|
||||
GITVERSION=$(shell [ -d .git ] && git rev-list --abbrev-commit -n 1 HEAD |cut -b 1-8)
|
||||
|
||||
prefix = /usr
|
||||
|
3
dracut
3
dracut
@@ -19,6 +19,7 @@ Creates initial ramdisk images for preloading modules
|
||||
call when building the initramfs. Modules are located
|
||||
in /usr/share/dracut/modules.d.
|
||||
-o, --omit [LIST] Omit a space-separated list of dracut modules.
|
||||
-a, --add [LIST] Add a space-separated list of dracut modules.
|
||||
-d, --drivers [LIST] Specify a space-separated list of kernel modules to
|
||||
include in the initramfs.
|
||||
-h, --help This message
|
||||
@@ -45,6 +46,7 @@ while (($# > 0)); do
|
||||
-f|--force) force=yes;;
|
||||
-m|--modules) dracutmodules_l="$2"; shift;;
|
||||
-o|--omit) omit_dracutmodules_l="$2"; shift;;
|
||||
-a|--add) add_dracutmodules_l="$2"; shift;;
|
||||
-d|--drivers) drivers_l="$2"; shift;;
|
||||
-h|--help) usage; exit 1 ;;
|
||||
--debug) debug="yes";;
|
||||
@@ -73,6 +75,7 @@ done
|
||||
# these options override the stuff in the config file
|
||||
[[ $dracutmodules_l ]] && dracutmodules=$dracutmodules_l
|
||||
[[ $omit_dracutmodules_l ]] && omit_dracutmodules=$omit_dracutmodules_l
|
||||
[[ $add_dracutmodules_l ]] && add_dracutmodules="$add_dracutmodules $add_dracutmodules_l"
|
||||
[[ $drivers_l ]] && drivers=$drivers_l
|
||||
[[ $dracutbasedir ]] || dracutbasedir=/usr/share/dracut
|
||||
|
||||
|
@@ -257,7 +257,9 @@ check_modules() {
|
||||
[[ $dracutmodules != all ]] && ! strstr "$dracutmodules" "$mod" && \
|
||||
continue
|
||||
strstr "$omit_dracutmodules" "$mod" && continue
|
||||
should_source_module "$moddir" || continue
|
||||
if ! strstr "$add_dracutmodules" " $mod "; then
|
||||
should_source_module "$moddir" || continue
|
||||
fi
|
||||
mods_to_load+=" $mod "
|
||||
done
|
||||
}
|
||||
|
3
dracut.8
3
dracut.8
@@ -117,9 +117,6 @@ associated fields.
|
||||
|
||||
http://tools.ietf.org/html/rfc4173
|
||||
|
||||
If the root partition is not specified using \fBroot=\fR, one of the partitions found
|
||||
with label \fBROOT\fR or \fB/\fR will be used to boot from.
|
||||
|
||||
.TP
|
||||
.B root=iscsi:[<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname>
|
||||
e.g. root=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0
|
||||
|
@@ -1,7 +1,7 @@
|
||||
%if 0%{?fedora} < 12
|
||||
%define with_switch_root 1
|
||||
%else
|
||||
%define with_switch_root 0
|
||||
%define with_switch_root 1
|
||||
%endif
|
||||
|
||||
%if %{defined gittag}
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
|
||||
Name: dracut
|
||||
Version: 0.2
|
||||
Version: 0.3
|
||||
Release: 1%{?rdist}
|
||||
Summary: Initramfs generator using udev
|
||||
Group: System Environment/Base
|
||||
@@ -44,6 +44,7 @@ Requires: kbd
|
||||
%endif
|
||||
|
||||
%if ! 0%{?with_switch_root}
|
||||
Requires: /sbin/switch_root
|
||||
BuildArch: noarch
|
||||
%endif
|
||||
|
||||
@@ -100,6 +101,9 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%doc README.generic
|
||||
|
||||
%changelog
|
||||
* Thu Jul 02 2009 Harald Hoyer <harald@redhat.com> 0.3-1
|
||||
- version 0.3
|
||||
|
||||
* Wed Jul 01 2009 Harald Hoyer <harald@redhat.com> 0.2-1
|
||||
- version 0.2
|
||||
|
||||
|
@@ -19,20 +19,20 @@ fix_bootif() {
|
||||
BOOTIF=$(getarg 'BOOTIF=')
|
||||
if [ -n "$BOOTIF" ] ; then
|
||||
BOOTIF=$(fix_bootif "$BOOTIF")
|
||||
printf 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="%s", RUN+="/sbin/ifup $env{INTERFACE}"\n' "$BOOTIF"
|
||||
printf 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="%s", RUN+="/sbin/initqueue /sbin/ifup $env{INTERFACE}"\n' "$BOOTIF"
|
||||
|
||||
# If we have to handle multiple interfaces, handle only them.
|
||||
elif [ -n "$IFACES" ] ; then
|
||||
for iface in $IFACES ; do
|
||||
printf 'ACTION=="add", SUBSYSTEM=="net", KERNEL=="%s", RUN+="/sbin/ifup $env{INTERFACE}"\n' "$iface"
|
||||
printf 'ACTION=="add", SUBSYSTEM=="net", KERNEL=="%s", RUN+="/sbin/initqueue /sbin/ifup $env{INTERFACE}"\n' "$iface"
|
||||
done
|
||||
|
||||
# Default: We don't know the interface to use, handle all
|
||||
else
|
||||
printf 'ACTION=="add", SUBSYSTEM=="net", RUN+="/sbin/ifup $env{INTERFACE}"\n'
|
||||
printf 'ACTION=="add", SUBSYSTEM=="net", RUN+="/sbin/initqueue /sbin/ifup $env{INTERFACE}"\n'
|
||||
fi
|
||||
|
||||
# Udev event 'online' only gets fired from ifup/dhclient-script.
|
||||
# No special rules required
|
||||
printf 'ACTION=="online", SUBSYSTEM=="net", RUN+="/sbin/netroot $env{INTERFACE}"\n'
|
||||
printf 'ACTION=="online", SUBSYSTEM=="net", RUN+="/sbin/initqueue /sbin/netroot $env{INTERFACE}"\n'
|
||||
} > /etc/udev/rules.d/60-net.rules
|
||||
|
@@ -7,6 +7,6 @@
|
||||
SUBSYSTEM!="block", GOTO="luks_end"
|
||||
ACTION!="add|change", GOTO="luks_end"
|
||||
|
||||
ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="/sbin/cryptroot-ask $env{DEVNAME} luks-$env{ID_FS_UUID}"
|
||||
ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="/sbin/initqueue /sbin/cryptroot-ask $env{DEVNAME} luks-$env{ID_FS_UUID}"
|
||||
|
||||
LABEL="luks_end"
|
||||
|
@@ -2,13 +2,20 @@
|
||||
|
||||
# do not ask, if we already have root
|
||||
[ -f /sysroot/proc ] && exit 0
|
||||
|
||||
# check if destination already exists
|
||||
[ -b /dev/mapper/$2 ] && exit 0
|
||||
|
||||
# we already asked for this device
|
||||
[ -f /tmp/cryptroot-asked-$2 ] && exit 0
|
||||
|
||||
# flock against other interactive activities
|
||||
{ flock -s 9;
|
||||
/bin/plymouth ask-for-password --prompt "$1 is password protected" --command="/sbin/cryptsetup luksOpen -T1 $1 $2"
|
||||
} 9>/.console.lock
|
||||
|
||||
# mark device as asked
|
||||
>> /tmp/cryptroot-asked-$2
|
||||
|
||||
exit 0
|
||||
|
||||
|
@@ -7,6 +7,6 @@
|
||||
SUBSYSTEM!="block", GOTO="luks_end"
|
||||
ACTION!="add|change", GOTO="luks_end"
|
||||
|
||||
ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="/sbin/cryptroot-ask $env{DEVNAME} luks-$env{ID_FS_UUID}"
|
||||
ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="/sbin/initqueue /sbin/cryptroot-ask $env{DEVNAME} luks-$env{ID_FS_UUID}"
|
||||
|
||||
LABEL="luks_end"
|
||||
|
@@ -1,7 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
# do not ask, if we already have root
|
||||
[ -f /sysroot/proc ] && exit 0
|
||||
|
||||
# check if destination already exists
|
||||
[ -b /dev/mapper/$2 ] && exit 0
|
||||
|
||||
# we already asked for this device
|
||||
[ -f /tmp/cryptroot-asked-$2 ] && exit 0
|
||||
|
||||
# flock against other interactive activities
|
||||
{ flock -s 9;
|
||||
/sbin/cryptsetup luksOpen -T1 $1 $2 </dev/console >/dev/console 2>&1
|
||||
echo -n "$1 is password protected "
|
||||
/sbin/cryptsetup luksOpen -T1 $1 $2
|
||||
} 9>/.console.lock
|
||||
|
||||
# mark device as asked
|
||||
>> /tmp/cryptroot-asked-$2
|
||||
|
||||
exit 0
|
@@ -1,8 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
dracut_install umount
|
||||
inst iscsistart
|
||||
inst hostname
|
||||
inst iscsi-iname
|
||||
inst_hook cmdline 90 "$moddir/parse-iscsiroot.sh"
|
||||
inst "$moddir/iscsiroot" "/sbin/iscsiroot"
|
||||
inst "$moddir/mount-lun.sh" "/bin/mount-lun.sh"
|
||||
instmods iscsi_tcp crc32c
|
||||
|
@@ -114,17 +114,15 @@ if [ -z $iscsi_initiator ]; then
|
||||
iscsi_initiator=$(iscsi-iname)
|
||||
fi
|
||||
|
||||
if [ -z $iscsi_lun ]; then
|
||||
iscsi_lun=0
|
||||
fi
|
||||
|
||||
echo "InitiatorName='$iscsi_initiator'" > /dev/.initiatorname.iscsi
|
||||
|
||||
# FIXME $iscsi_lun?? $iscsi_protocol??
|
||||
# FIXME $iscsi_protocol??
|
||||
|
||||
# if root does not specify a block device
|
||||
# we set a fallback to recognize any filesystems labeled
|
||||
# LABEL=/ or LABEL=ROOT
|
||||
if [ "${root#block:*}" = "$root" ]; then
|
||||
( root="block:/dev/disk/by-label/\x2f" . /pre-udev/30-block-genrules.sh )
|
||||
( root="block:/dev/disk/by-label/ROOT" . /pre-udev/30-block-genrules.sh )
|
||||
fi
|
||||
echo "iscsi_lun=$iscsi_lun . /bin/mount-lun.sh " > /mount/iscsi.sh
|
||||
|
||||
iscsistart -i $iscsi_initiator -t $iscsi_target_name \
|
||||
-g $iscsi_target_group -a $iscsi_target_ip \
|
||||
|
14
modules.d/95iscsi/mount-lun.sh
Executable file
14
modules.d/95iscsi/mount-lun.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
if [ -z $iscsi_lun ]; then
|
||||
iscsi_lun=0
|
||||
fi
|
||||
NEWROOT=${NEWROOT:-"/sysroot"}
|
||||
|
||||
for disk in /dev/disk/by-path/*-iscsi-*-$iscsi_lun; do
|
||||
if mount -t ${fstype:-auto} -o "$rflags" $disk $NEWROOT; then
|
||||
if [ ! -d /sysroot/proc ]; then
|
||||
umount $disk
|
||||
continue
|
||||
fi
|
||||
break
|
||||
fi
|
||||
done
|
@@ -93,7 +93,7 @@ done
|
||||
# If we didn't get a root= on the command line, then we need to
|
||||
# add the udev rules for mounting the nbd0 device
|
||||
if [ ! -e /etc/udev/rules.d/99-mount.rules ]; then
|
||||
printf 'KERNEL=="%s", RUN+="/bin/mount -t %s -o %s %s %s"\n' \
|
||||
printf 'KERNEL=="%s", RUN+="/sbin/initqueue /bin/mount -t %s -o %s %s %s"\n' \
|
||||
nbd0 "$nbdfstype" "$fsopts" /dev/nbd0 "$NEWROOT" \
|
||||
> /etc/udev/rules.d/99-mount.rules
|
||||
fi
|
||||
|
@@ -4,10 +4,6 @@
|
||||
# root=nbd:srv:port[:fstype[:rootflags[:nbdopts]]]
|
||||
# [root=*] netroot=nbd:srv:port[:fstype[:rootflags[:nbdopts]]]
|
||||
#
|
||||
# Legacy formats:
|
||||
# [net]root=[nbd] nbdroot=srv,port
|
||||
# [net]root=[nbd] nbdroot=srv:port[:fstype[:rootflags[:nbdopts]]]
|
||||
#
|
||||
# nbdopts is a comma seperated list of options to give to nbd-client
|
||||
#
|
||||
# root= takes precedence over netroot= if root=nbd[...]
|
||||
@@ -32,7 +28,6 @@ netroot_to_var() {
|
||||
# This script is sourced, so root should be set. But let's be paranoid
|
||||
[ -z "$root" ] && root=$(getarg root=)
|
||||
[ -z "$netroot" ] && netroot=$(getarg netroot=)
|
||||
[ -z "$nbdroot" ] && nbdroot=$(getarg nbdroot=)
|
||||
|
||||
# Root takes precedence over netroot
|
||||
if [ "${root%%:*}" = "nbd" ] ; then
|
||||
@@ -43,26 +38,6 @@ if [ "${root%%:*}" = "nbd" ] ; then
|
||||
netroot=$root
|
||||
fi
|
||||
|
||||
# If it's not empty or nbd we don't continue
|
||||
[ -z "$netroot" ] || [ "${netroot%%:*}" = "nbd" ] || return
|
||||
|
||||
if [ -n "$nbdroot" ] ; then
|
||||
[ -z "$netroot" ] && netroot=$root
|
||||
|
||||
# Debian legacy style contains no ':' Converting is easy
|
||||
[ "$nbdroot" = "${nbdroot##*:}" ] && nbdroot=${nbdroot%,*}:${nbdroot#*,}
|
||||
|
||||
# @deprecated
|
||||
warn "Argument nbdroot is deprecated and might be removed in a future release. See http://apps.sourceforge.net/trac/dracut/wiki/commandline for more information."
|
||||
|
||||
# Accept nbdroot argument?
|
||||
[ -z "$netroot" ] || [ "$netroot" = "nbd" ] || \
|
||||
die "Argument nbdroot only accepted for empty root= or [net]root=nbd"
|
||||
|
||||
# Override netroot with nbdroot content?
|
||||
[ -z "$netroot" ] || [ "$netroot" = "nbd" ] && netroot=nbd:$nbdroot
|
||||
fi
|
||||
|
||||
# If it's not nbd we don't continue
|
||||
[ "${netroot%%:*}" = "nbd" ] || return
|
||||
|
||||
|
@@ -2,16 +2,15 @@
|
||||
#
|
||||
# Preferred format:
|
||||
# root=nfs[4]:[server:]path[:options]
|
||||
# FIXME: What is the below referring to other than root=dhcp?
|
||||
# [root=*] netroot=nfs[4]:[server:]path[:options]
|
||||
#
|
||||
# This syntax can come from DHCP root-path as well.
|
||||
#
|
||||
# Legacy format:
|
||||
# root=/dev/nfs nfsroot=[server:]path[,options]
|
||||
#
|
||||
# FIXME: This blurb below refers to only legacy?
|
||||
# If the 'nfsroot' parameter is not given 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.
|
||||
# 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
|
||||
# [server:]path[:options] or the default "/tftpboot/%s" will be used.
|
||||
#
|
||||
# If server is unspecified it will be pulled from one of the following
|
||||
# sources, in order:
|
||||
@@ -20,10 +19,8 @@
|
||||
# DHCP server-id option
|
||||
# DHCP root-path option
|
||||
#
|
||||
# NFSv4 is only used if explicitly requested; default is NFSv2 or NFSv3
|
||||
# depending on kernel configuration
|
||||
#
|
||||
# root= takes precedence over netroot= if root=nfs[...]
|
||||
# NFSv4 is only used if explicitly requested with nfs4: prefix, otherwise
|
||||
# NFSv3 is used.
|
||||
#
|
||||
|
||||
# Sadly there's no easy way to split ':' separated lines into variables
|
||||
@@ -83,7 +80,7 @@ else
|
||||
netroot=$root;
|
||||
fi
|
||||
|
||||
# LEGACY convert nfsroot= is valid only if root=/dev/nfs
|
||||
# LEGACY: nfsroot= is valid only if root=/dev/nfs
|
||||
if [ -n "$nfsroot" ] ; then
|
||||
# @deprecated
|
||||
warn "Argument nfsroot is deprecated and might be removed in a future release. See http://apps.sourceforge.net/trac/dracut/wiki/commandline for more information."
|
||||
|
@@ -1,8 +1,8 @@
|
||||
if [ "${root%%:*}" = "block" ]; then
|
||||
(
|
||||
printf 'KERNEL=="%s", RUN+="/bin/mount -t %s -o %s %s %s"\n' \
|
||||
printf 'KERNEL=="%s", RUN+="/sbin/initqueue /bin/mount -t %s -o %s %s %s"\n' \
|
||||
${root#block:/dev/} "$fstype" "$rflags" "${root#block:}" "$NEWROOT"
|
||||
printf 'SYMLINK=="%s", RUN+="/bin/mount -t %s -o %s %s %s"\n' \
|
||||
printf 'SYMLINK=="%s", RUN+="/sbin/initqueue /bin/mount -t %s -o %s %s %s"\n' \
|
||||
${root#block:/dev/} "$fstype" "$rflags" "${root#block:}" "$NEWROOT"
|
||||
) >> /etc/udev/rules.d/99-mount.rules
|
||||
fi
|
||||
|
@@ -14,6 +14,29 @@ emergency_shell()
|
||||
sh -i
|
||||
}
|
||||
|
||||
do_initqueue()
|
||||
{
|
||||
while :; do
|
||||
# bail out, if we have mounted the root filesystem
|
||||
[ -d "$NEWROOT/proc" ] && break;
|
||||
|
||||
if [ $UDEVVERSION -ge 143 ]; then
|
||||
udevadm settle --exit-if-exists=/initqueue/work
|
||||
else
|
||||
udevadm settle --timeout=30
|
||||
fi
|
||||
[ -f /initqueue/work ] || break
|
||||
rm /initqueue/work
|
||||
|
||||
for job in /initqueue/*.job; do
|
||||
. $job
|
||||
rm -f $job
|
||||
# bail out, if we have mounted the root filesystem
|
||||
[ -d "$NEWROOT/proc" ] && break;
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||
export TERM=linux
|
||||
NEWROOT="/sysroot"
|
||||
@@ -29,8 +52,9 @@ mount -t proc /proc /proc >/dev/null 2>&1
|
||||
mount -t sysfs /sys /sys >/dev/null 2>&1
|
||||
|
||||
if [ ! -c /dev/ptmx ]; then
|
||||
if mount -t devtmpfs -omode=0755 udev /dev >/dev/null 2>&1; then
|
||||
:; else
|
||||
# try to mount devtmpfs
|
||||
if ! mount -t devtmpfs -omode=0755 udev /dev >/dev/null 2>&1; then
|
||||
# if it failed fall back to normal tmpfs
|
||||
mount -t tmpfs -omode=0755 udev /dev >/dev/null 2>&1
|
||||
# Make some basic devices first, let udev handle the rest
|
||||
mknod /dev/null c 1 3
|
||||
@@ -45,6 +69,8 @@ mkdir /dev/shm
|
||||
mkdir /dev/pts
|
||||
mount -t devpts -o gid=5,mode=620 /dev/pts /dev/pts >/dev/null 2>&1
|
||||
|
||||
UDEVVERSION=$(udevadm --version)
|
||||
|
||||
# run scriptlets to parse the command line
|
||||
getarg 'rdbreak=cmdline' && emergency_shell
|
||||
source_all cmdline
|
||||
@@ -75,7 +101,8 @@ source_all pre-trigger
|
||||
|
||||
# then the rest
|
||||
udevadm trigger $udevtriggeropts >/dev/null 2>&1
|
||||
udevadm settle --timeout=30 >/dev/null 2>&1
|
||||
|
||||
do_initqueue
|
||||
|
||||
# pre-mount happens before we try to mount the root filesystem,
|
||||
# and happens once.
|
||||
@@ -83,6 +110,8 @@ getarg 'rdbreak=pre-mount' && emergency_shell
|
||||
source_all pre-mount
|
||||
getarg 'rdbreak=mount' && emergency_shell
|
||||
|
||||
do_initqueue
|
||||
|
||||
# mount scripts actually try to mount the root filesystem, and may
|
||||
# be sourced any number of times. As soon as one suceeds, no more are sourced.
|
||||
i=0
|
||||
@@ -90,7 +119,8 @@ while :; do
|
||||
[ -d "$NEWROOT/proc" ] && break;
|
||||
|
||||
for f in /mount/*.sh; do
|
||||
[ -x "$f" ] && . "$f";
|
||||
[ -f "$f" ] && . "$f"
|
||||
do_initqueue
|
||||
[ "$ROOTFS_MOUNTED" ] && break;
|
||||
done
|
||||
|
||||
@@ -115,7 +145,14 @@ done
|
||||
}
|
||||
|
||||
getarg rdbreak && emergency_shell
|
||||
kill $(pidof udevd)
|
||||
|
||||
HARD=""
|
||||
while pidof udevd >/dev/null 2>&1; do
|
||||
for pid in $(pidof udevd); do
|
||||
kill $HARD $pid >/dev/null 2>&1
|
||||
done
|
||||
HARD="-9"
|
||||
done
|
||||
|
||||
# Clean up the environment
|
||||
for i in $(export -p); do
|
||||
|
5
modules.d/99base/initqueue
Executable file
5
modules.d/99base/initqueue
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "$@" > /tmp/$$.job
|
||||
mv /tmp/$$.job /initqueue/
|
||||
>> /initqueue/work
|
@@ -1,16 +1,20 @@
|
||||
#!/bin/bash
|
||||
dracut_install mount mknod mkdir modprobe pidof sleep chroot sed ls flock cp
|
||||
dracut_install mount mknod mkdir modprobe pidof sleep chroot sed ls flock cp mv
|
||||
if [ ! -e "${initdir}/bin/sh" ]; then
|
||||
dracut_install bash
|
||||
(ln -s bash "${initdir}/bin/sh" || :)
|
||||
fi
|
||||
# install our scripts and hooks
|
||||
inst "$moddir/init" "/init"
|
||||
inst "$moddir/initqueue" "/sbin/initqueue"
|
||||
mkdir -p ${initdir}/initqueue
|
||||
mkdir -p ${initdir}/tmp
|
||||
# Bail out if switch_root does not exist
|
||||
if which switch_root >/dev/null 2>&1; then
|
||||
dracut_install switch_root
|
||||
else
|
||||
inst "$moddir/switch_root" "/sbin/switch_root"
|
||||
inst "$moddir/switch_root" "/sbin/switch_root" \
|
||||
|| derror "Failed to install switch_root"
|
||||
fi
|
||||
inst "$moddir/dracut-lib.sh" "/lib/dracut-lib.sh"
|
||||
inst_hook cmdline 10 "$moddir/parse-root-opts.sh"
|
||||
|
@@ -63,6 +63,8 @@ test_setup() {
|
||||
inst ./cryptroot-ask /sbin/cryptroot-ask
|
||||
)
|
||||
sudo $basedir/dracut -l -i overlay / \
|
||||
-o "plymouth" \
|
||||
-a "debug" \
|
||||
-d "ata_piix ext2 sd_mod" \
|
||||
-f initramfs.testing $KVERSION || return 1
|
||||
}
|
||||
|
@@ -276,6 +276,8 @@ test_setup() {
|
||||
|
||||
# Make client's dracut image
|
||||
$basedir/dracut -l -i overlay / \
|
||||
-o "plymouth" \
|
||||
-a "debug" \
|
||||
-d "e1000 nfs sunrpc" \
|
||||
-f initramfs.testing $KVERSION || return 1
|
||||
}
|
||||
|
@@ -4,27 +4,9 @@ for x in 63-luks.rules 64-lvm.rules 70-mdadm.rules 99-mount-rules; do
|
||||
> "/etc/udev/rules.d/$x"
|
||||
done
|
||||
udevadm control --reload-rules
|
||||
# save a partition at the beginning for future flagging purposes
|
||||
sfdisk -C 640 -H 2 -S 32 -L /dev/sda <<EOF
|
||||
,,
|
||||
EOF
|
||||
#mdadm --create /dev/md0 --run --auto=yes --level=5 --raid-devices=3 /dev/sda2 /dev/sda3 /dev/sda4
|
||||
# wait for the array to finish initailizing, otherwise this sometimes fails
|
||||
# randomly.
|
||||
#mdadm -W /dev/md0
|
||||
#echo -n test >keyfile
|
||||
#cryptsetup -q luksFormat /dev/sda1 /keyfile
|
||||
#echo "The passphrase is test"
|
||||
#cryptsetup luksOpen /dev/sda1 dracut_crypt_test </keyfile && \
|
||||
#lvm pvcreate -ff -y /dev/mapper/dracut_crypt_test && \
|
||||
#lvm vgcreate dracut /dev/mapper/dracut_crypt_test && \
|
||||
#lvm pvcreate -ff -y /dev/sda1 && \
|
||||
#lvm vgcreate dracut /dev/sda1 && \
|
||||
#lvm lvcreate -l 100%FREE -n root dracut && \
|
||||
#lvm vgchange -ay && \
|
||||
mke2fs -L ROOT /dev/sda1 && \
|
||||
mke2fs -F /dev/sda && \
|
||||
mkdir -p /sysroot && \
|
||||
mount /dev/sda1 /sysroot && \
|
||||
mount /dev/sda /sysroot && \
|
||||
cp -a -t /sysroot /source/* && \
|
||||
umount /sysroot && \
|
||||
echo "dracut-root-block-created" >/dev/sdb
|
||||
|
@@ -3,7 +3,7 @@ TEST_DESCRIPTION="root filesystem over iSCSI"
|
||||
|
||||
KVERSION=${KVERSION-$(uname -r)}
|
||||
|
||||
#DEBUGFAIL="rdinitdebug rdnetdebug rdudevinfo"
|
||||
#DEBUGFAIL="rdinitdebug rdnetdebug"
|
||||
|
||||
run_server() {
|
||||
# Start server first
|
||||
@@ -114,6 +114,8 @@ test_setup() {
|
||||
# inst ./cryptroot-ask /sbin/cryptroot-ask
|
||||
)
|
||||
sudo $basedir/dracut -l -i overlay / \
|
||||
-o "plymouth dmraid" \
|
||||
-a "debug" \
|
||||
-d "ata_piix ext2 sd_mod" \
|
||||
-f initramfs.testing $KVERSION || return 1
|
||||
|
||||
|
@@ -4,7 +4,7 @@ TEST_DESCRIPTION="root filesystem on NBD"
|
||||
KVERSION=${KVERSION-$(uname -r)}
|
||||
|
||||
# Uncomment this to debug failures
|
||||
#DEBUGFAIL="rdinitdebug rdnetdebug rdbreak"
|
||||
#DEBUGFAIL="rdinitdebug rdnetdebug"
|
||||
|
||||
run_server() {
|
||||
# Start server first
|
||||
@@ -120,22 +120,6 @@ test_run() {
|
||||
"root=nbd:192.168.50.1:2000:ext2:errors=panic:bs=2048" \
|
||||
ext2 errors=panic || return 1
|
||||
|
||||
# Check legacy parsing
|
||||
|
||||
client_test "NBD root=nbd nbdroot=srv:port" 52:54:00:12:34:00 \
|
||||
"root=nbd nbdroot=192.168.50.1:2000" || return 1
|
||||
|
||||
# This test must fail: root=dhcp ignores nbdroot
|
||||
client_test "NBD root=dhcp nbdroot=srv:port" 52:54:00:12:34:00 \
|
||||
"root=dhcp nbdroot=192.168.50.1:2000" && return 1
|
||||
|
||||
client_test "NBD root=nbd nbdroot=srv,port" 52:54:00:12:34:00 \
|
||||
"root=nbd nbdroot=192.168.50.1,2000" || return 1
|
||||
|
||||
# This test must fail: root=dhcp ignores nbdroot
|
||||
client_test "NBD root=dhcp nbdroot=srv,port" 52:54:00:12:34:00 \
|
||||
"root=dhcp nbdroot=192.168.50.1,2000" && return 1
|
||||
|
||||
# DHCP root-path parsing
|
||||
|
||||
client_test "NBD root=dhcp DHCP root-path nbd:srv:port" 52:54:00:12:34:01 \
|
||||
@@ -308,7 +292,8 @@ test_setup() {
|
||||
-f initramfs.server $KVERSION || return 1
|
||||
|
||||
sudo $basedir/dracut -l -i overlay / \
|
||||
-o "plymouth" \
|
||||
-o "plymouth" \
|
||||
-a "debug" \
|
||||
-d "ata_piix ext2 ext3 sd_mod e1000" \
|
||||
-f initramfs.testing $KVERSION || return 1
|
||||
}
|
||||
|
Reference in New Issue
Block a user