Compare commits

..

25 Commits
0.1 ... 0.2

Author SHA1 Message Date
Harald Hoyer
22a27a5023 version 0.2 2009-07-01 21:32:33 +02:00
Harald Hoyer
14f450cab2 unset netroot before we return (it was set to $root without checkin) 2009-07-01 21:32:33 +02:00
Harald Hoyer
ada0bc3e5f use different multicast ports for the different testsuites 2009-07-01 21:32:33 +02:00
Harald Hoyer
6fb586f3ef omit the plymouth module in the testsuite 2009-07-01 19:28:51 +02:00
Harald Hoyer
5831685cdb use _all_ modules to run the test, in case another module fails
also run the tests with 256MB virtual machines
2009-07-01 19:28:51 +02:00
Harald Hoyer
950086e987 do not assume nfs for root=/dev/... but for /dev/nfs 2009-07-01 19:28:31 +02:00
Harald Hoyer
440d35d3c0 man page update 2009-07-01 16:55:50 +02:00
Harald Hoyer
0aaa523c82 specfile cleanup
removed mkinitrd replacement
2009-07-01 16:23:23 +02:00
Harald Hoyer
3473f5d938 prepare init to mount devtmpfs instead of tmpfs on /dev 2009-07-01 10:53:02 +02:00
Harald Hoyer
e7170fb717 let dmraid remove the used partitions 2009-07-01 10:53:02 +02:00
Warren Togami
9d4c1799fe Fix legacy root=/dev/nfs nfsroot=IP:path case
TODO: root=/dev/nfs DHCP cases are still broken.
2009-06-30 18:22:44 -04:00
Warren Togami
6da2ee08a6 NFS empty path becomes "/tftpboot/%s" only if root=/dev/nfs legacy mode 2009-06-30 18:03:16 -04:00
Warren Togami
297cb80bab Cleanup parse-nfsroot and NFS tests.
TODO: root=/dev/nfs is still broken.
2009-06-30 17:48:56 -04:00
Warren Togami
798d950651 Add test for Legacy root=IP:path NFSv3 syntax 2009-06-30 16:38:57 -04:00
Warren Togami
92798bf79b netroot= variant is not supported for NFS, you must use root=
TODO: This temporarily breaks Legacy root=/dev/nfs.
2009-06-30 16:27:45 -04:00
Warren Togami
696e68c643 Really fix --drivers 2009-06-30 15:35:18 -04:00
Warren Togami
d8b3d672c3 Fix case where --drivers was specified. 2009-06-30 15:17:08 -04:00
Warren Togami
8af0a48521 Detect block drivers during dracut since we cannot rely on the modules.block list. 2009-06-30 14:36:57 -04:00
Seewer Philippe
2d21db6def Bugfix: Fix BOOTIF argument translation 2009-06-25 23:28:38 -04:00
Warren Togami
3847431d3d Clarify some NFS parsing and point out things that need to be fixed. 2009-06-24 00:34:24 -04:00
Warren Togami
fb3d8cf7c2 Remove legacy nfsroot.txt derived shortcuts and accompanying tests.
(further cleanup is needed)
2009-06-23 17:08:39 -04:00
Harald Hoyer
d0d1ea3d87 prompt the crypto disk, when asking for a password
also check, if root is already mounted and flock against
console activities.
2009-06-23 07:49:23 +02:00
Harald Hoyer
0286b3b411 add Requires of mkinitrd to dracut rpm 2009-06-23 07:49:23 +02:00
Warren Togami
5655a3ffbf Remove dracut invented variations of Legacy nfsroot.txt syntax and accompanying tests.
- Remove root=nfs nfsroot=...
- Remove root=nfs4 nfsroot=...
- Remove root=/dev/nfs4 nfsroot=...
- Legacy nfsroot= without root=/dev/nfs should be unsupported according to the nfsroot.txt.
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/filesystems/nfsroot.txt
45 root=/dev/nfs
46
47   This is necessary to enable the pseudo-NFS-device. Note that it's not a
48   real device but just a synonym to tell the kernel to use NFS instead of
49   a real device.
2009-06-22 16:40:09 -04:00
Harald Hoyer
9794cf831b mv Authors AUTHORS, add AUTHORS to specfile 2009-06-19 14:40:09 +02:00
15 changed files with 143 additions and 217 deletions

View File

View File

@@ -1,4 +1,4 @@
VERSION=0.1
VERSION=0.2
GITVERSION=$(shell [ -d .git ] && git rev-list --abbrev-commit -n 1 HEAD |cut -b 1-8)
prefix = /usr

View File

@@ -87,9 +87,16 @@ mount nfs share from <server-ip>:/<root-dir>, if no server-ip is given,
use dhcp next_server.
NFS options can be appended with the prefix "." or ","
.TP
.B root=dhcp root-path=<server-ip>:<root-dir>[:<nfs-options>]
.B root=nfs:[<server-ip>:]<root-dir>[:<nfs-options>]
.TP
.B root=nfs4:[<server-ip>:]<root-dir>[:<nfs-options>]
.TP
.B root=dhcp
root=dhcp alone directs initrd to look at the DHCP root-path where NFS
options can be specified.
root-path=<server-ip>:<root-dir>[,<nfs-options>]
root-path=nfs:<server-ip>:<root-dir>[,<nfs-options>]
root-path=nfs4:<server-ip>:<root-dir>[,<nfs-options>]
.TP
.B root=/dev/nfs nfsroot=[<server-ip>:]<root-dir>[,<nfs-options>]
\fBDeprecated!\fR kernel Documentation/filesystems/nfsroot.txt defines
@@ -114,12 +121,17 @@ If the root partition is not specified using \fBroot=\fR, one of the partitions
with label \fBROOT\fR or \fB/\fR will be used to boot from.
.TP
.B root=??? netroot=iscsi:[<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname>
e.g. root=LABEL=ROOT netroot=root=LABEL=ROOT netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0
.B root=iscsi:[<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname>
e.g. root=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0
.TP
.B root=??? netroot=iscsi:[<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname> ...
multiple netroot options allow setting up multiple iscsi disks
e.g.
root=UUID=12424547 netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0 netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target1
.B not yet implemented
.TP
.B root=??? iscsi_initiator= iscsi_target_name= iscsi_target_ip= iscsi_target_port= iscsi_target_group= iscsi_username= iscsi_password= iscsi_in_username= iscsi_in_password=
these variables can also be put in a file in /conf/conf.d/, which will be sourced
.TP
.B root=??? iscsi_firmware
@@ -130,7 +142,8 @@ will read the iscsi parameter from the BIOS firmware
.B root=nbd:<server>:<port>[:<fstype>][:<mountopts>]
mount nbd share from <server>
.TP
.B root=dhcp root-path=nbd:<server>:<port>[:<fstype>][:<mountopts>]
.B root=dhcp
with dhcp root-path=nbd:<server>:<port>[:<fstype>][:<mountopts>]
root=dhcp alone directs initrd to look at the DHCP root-path where NBD options can be specified.
This syntax is only usable in cases where you are directly mounting the volume as the rootfs.
@@ -150,7 +163,7 @@ explicit network configuration
.SH Misc
.TP
.B rdblacklist=<drivername>
TBD: do not load kernel drivername
do not load kernel module <drivername>
.SH Debug
.TP
@@ -169,13 +182,12 @@ set udev to loglevel debug
.B rdnetdebug
debug network scripts in dracut. Output is written to /tmp/
.SH CONFIGURATION IN INITRAMFS
.TP
.B /conf/conf.d/
Any files found in /conf/conf.d/ will be sourced in the initramfs to
specify special variables.
Command line options can override values set here.
set initial values. Command line options will override these values
set in the configuration files.
.SH AUTHORS
.nf

View File

@@ -1,17 +1,23 @@
# define gittag 2c02c831
%define replace_mkinitrd 0
%if 0%{?fedora} < 12
%define with_switch_root 1
%else
%define with_switch_root 0
Name: dracut
Version: 0.1
%endif
%if %{defined gittag}
Release: 1.git%{gittag}%{?dist}
%define rdist 1.git%{gittag}%{?dist}
%define dashgittag -%{gittag}
%else
Release: 1%{?dist}
%define rdist %{?dist}
%endif
Name: dracut
Version: 0.2
Release: 1%{?rdist}
Summary: Initramfs generator using udev
Group: System Environment/Base
License: GPLv2
License: GPLv2+
URL: http://apps.sourceforge.net/trac/dracut/wiki
Source0: dracut-%{version}%{?dashgittag}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -25,10 +31,16 @@ Requires: grep
Requires: mktemp
Requires: mount
Requires: bash
%if 0%{?replace_mkinitrd}
Obsoletes: mkinitrd < 7.0
Provides: mkinitrd = 7.0
Requires: /bin/sh
Requires: fileutils, grep, mount, gzip, tar, mktemp >= 1.5-5, findutils
Requires: lvm2 >= 2.02.33-9, dhclient
Requires: filesystem >= 2.1.0, cpio, device-mapper, initscripts >= 8.63-1
Requires: e2fsprogs >= 1.38-12, libselinux, libsepol, coreutils
Requires: mdadm, elfutils-libelf, plymouth >= 0.7.0
Requires: cryptsetup-luks
%ifnarch s390 s390x
Requires: dmraid
Requires: kbd
%endif
%if ! 0%{?with_switch_root}
@@ -42,17 +54,13 @@ dracut is a new, event-driven initramfs infrastructure based around udev.
%package generic
Summary: Metapackage to build a generic initramfs
Requires: %{name} = %{version}-%{release}
Requires: device-mapper
Requires: cryptsetup-luks
Requires: rpcbind nfs-utils
Requires: lvm2
Requires: iscsi-initiator-utils
Requires: nbd
Requires: mdadm
Requires: net-tools iproute
%description generic
This package requires everything, which is needed to build a generic
This package requires everything which is needed to build a generic
all purpose initramfs.
@@ -67,32 +75,20 @@ make
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT sbindir=/sbin sysconfdir=/etc mandir=%{_mandir}
%if 0%{?replace_mkinitrd}
ln -s dracut $RPM_BUILD_ROOT/sbin/mkinitrd
ln -s dracut/dracut-functions $RPM_BUILD_ROOT/usr/libexec/initrd-functions
%endif
%if ! 0%{?with_switch_root}
rm -f $RPM_BUILD_ROOT/sbin/switch_root
%endif
#mkdir -p $RPM_BUILD_ROOT/sbin
#mv $RPM_BUILD_ROOT/%{_prefix}/lib/dracut/modules.d/99base/switch_root $RPM_BUILD_ROOT/sbin
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,0755)
%doc README HACKING TODO COPYING
%doc README HACKING TODO COPYING AUTHORS
/sbin/dracut
%if 0%{?with_switch_root}
/sbin/switch_root
%endif
%if 0%{?replace_mkinitrd}
/sbin/mkinitrd
/usr/libexec/initrd-functions
%endif
%dir %{_datadir}/dracut
%{_datadir}/dracut/dracut-functions
%{_datadir}/dracut/modules.d
@@ -104,6 +100,9 @@ rm -rf $RPM_BUILD_ROOT
%doc README.generic
%changelog
* Wed Jul 01 2009 Harald Hoyer <harald@redhat.com> 0.2-1
- version 0.2
* Fri Jun 19 2009 Harald Hoyer <harald@redhat.com> 0.1-1
- first release

View File

@@ -2,7 +2,7 @@
# pxelinux provides macaddr '-' separated, but we need ':'
fix_bootif() {
local macaddr=${1##??-}
local macaddr=${1}
local IFS='-'
macaddr=$(for i in ${macaddr} ; do echo -n $i:; done)
macaddr=${macaddr%:}

View File

@@ -1,4 +1,14 @@
#!/bin/sh
[ -b /dev/mapper/$2 ] || exec /bin/plymouth ask-for-password --command="/sbin/cryptsetup luksOpen -T1 $1 $2"
# do not ask, if we already have root
[ -f /sysroot/proc ] && exit 0
# check if destination already exists
[ -b /dev/mapper/$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
exit 0

View File

@@ -1,3 +1,3 @@
dmraid -ay
dmraid -ay -Z
udevadm settle --timeout=30 >/dev/null 2>&1

View File

@@ -1,7 +1,13 @@
#!/bin/bash
# FIXME: hard-coded module list of doom.
[[ $drivers ]] || drivers="=block sd_mod =fs"
if [ -z "$drivers" ]; then
drivers="sd_mod =fs"
# Include block controller drivers
for modname in $(find "/lib/modules/$kernel/kernel/drivers" -name '*.ko'); do
if nm -uPA $modname | egrep -q 'ata_scsi_ioctl|scsi_add_host|blk_init_queue|register_mtd_blktrans|scsi_esp_register'; then
drivers="${drivers} $modname"
fi
done
fi
instmods $drivers
[ -f /etc/modprobe.conf ] && dracut_install /etc/modprobe.conf
dracut_install $(find /etc/modprobe.d/ -type f -name '*.conf')

View File

@@ -63,20 +63,12 @@ netif="$1"
root="$2"
NEWROOT="$3"
# If it's not nfs we don't continue
# Continue if nfs prefix
case "${root%%:*}" in
nfs|nfs4);;
*) return;;
esac
# Ugly: root=nfs[4] requires dhcp root-path
if [ "$root" = "nfs" ] || [ "$root" = "nfs4" ] ; then
# No need to check if the file exists. ip cmdline parser takes care of this
. /tmp/dhclient.$netif.dhcpopts
[ -z "$new_root_path" ] && die "Required dhcp option root-path not available"
root=$root:$new_root_path
fi
root_to_var $root
#Load other data that might provide info
@@ -87,8 +79,8 @@ root_to_var $root
#already takes care of nfs:... formatted root-path
[ -z "$path" ] && root_to_var $nfs:$new_root_path
#Empty path defaults to "/tftpboot/%s"
[ -z "$path" ] && path="/tftpboot/%s"
#Empty path defaults to "/tftpboot/%s" only in nfsroot.txt legacy mode
[ -z "$path" ] && [ "$(getarg root=)" = "/dev/nfs" ] && path="/tftpboot/%s"
if [ -z "$server" ] ; then
# XXX new_dhcp_next_server is unconfirmed this is an assumption

View File

@@ -2,12 +2,13 @@
#
# 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]
#
# Legacy formats:
# [net]root=[[/dev/]nfs[4]] nfsroot=[server:]path[,options]
# [net]root=[[/dev/]nfs[4]] nfsroot=[server:]path[:options]
# 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.
@@ -71,45 +72,39 @@ netroot_to_var() {
[ -z "$netroot" ] && netroot=$(getarg netroot=)
[ -z "$nfsroot" ] && nfsroot=$(getarg nfsroot=)
# Handle old style <server-ip>:/<path
# netroot= cmdline argument must be ignored, but must be used if
# we're inside netroot to parse dhcp root-path
if [ -n "$netroot" ] ; then
if [ "$netroot" = "$(getarg netroot=)" ] ; then
warn "Ignoring netroot argument for NFS"
netroot=$root
fi
else
netroot=$root;
fi
# LEGACY convert 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."
if [ "$(getarg root=)" != "/dev/nfs" ]; then
die "Argument nfsroot only accepted for legacy root=/dev/nfs"
fi
netroot=nfs:$nfsroot;
fi
case "$netroot" in
/dev/nfs) netroot=nfs;;
/dev/*) unset netroot; return;;
# LEGACY: root=<server-ip>:/<path
[0-9]*:/*|[0-9]*\.[0-9]*\.[0-9]*[!:]|/*)
netroot=nfs:$netroot;;
esac
# Root takes precedence over netroot
case "${root%%:*}" in
nfs|nfs4|/dev/nfs|/dev/nfs4)
if [ -n "$netroot" ] ; then
warn "root takes precedence over netroot. Ignoring netroot"
fi
netroot=$root
;;
esac
# If it's not empty or nfs we don't continue
# Continue if nfs
case "${netroot%%:*}" in
''|nfs|nfs4|/dev/nfs|/dev/nfs4);;
*) return;;
esac
if [ -n "$nfsroot" ] ; then
[ -z "$netroot" ] && netroot=$root
# @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."
case "$netroot" in
''|nfs|nfs4|/dev/nfs|/dev/nfs4) netroot=${netroot:-nfs}:$nfsroot;;
*) die "Argument nfsroot only accepted for empty root= or root=[/dev/]nfs[4]"
esac
fi
# If it's not nfs we don't continue
case "${netroot%%:*}" in
nfs|nfs4|/dev/nfs|/dev/nfs4);;
*) return;;
nfs|nfs4|/dev/nfs);;
*) unset netroot; return;;
esac
# Check required arguments

View File

@@ -27,15 +27,20 @@ mknod /dev/null c 1 3
# mount some important things
mount -t proc /proc /proc >/dev/null 2>&1
mount -t sysfs /sys /sys >/dev/null 2>&1
mount -t tmpfs -omode=0755 udev /dev >/dev/null 2>&1
if [ ! -c /dev/ptmx ]; then
if mount -t devtmpfs -omode=0755 udev /dev >/dev/null 2>&1; then
:; else
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
mknod /dev/ptmx c 5 2
mknod /dev/console c 5 1
mknod /dev/kmsg c 1 11
fi
fi
getarg rdinitdebug && set -x
# Make some basic devices first, let udev handle the rest
mknod /dev/null c 1 3
mknod /dev/ptmx c 5 2
mknod /dev/console c 5 1
mknod /dev/kmsg c 1 11
mkdir /dev/shm
mkdir /dev/pts
mount -t devpts -o gid=5,mode=620 /dev/pts /dev/pts >/dev/null 2>&1

View File

@@ -7,7 +7,7 @@ KVERSION=${KVERSION-$(uname -r)}
#DEBUGFAIL="rdinitdebug rdnetdebug"
test_run() {
$testdir/run-qemu -hda root.ext2 -m 128M -nographic \
$testdir/run-qemu -hda root.ext2 -m 256M -nographic \
-net none -kernel /boot/vmlinuz-$KVERSION \
-append "root=/dev/dracut/root rw quiet console=ttyS0,115200n81 $DEBUGFAIL" \
-initrd initramfs.testing
@@ -50,7 +50,7 @@ test_setup() {
-f initramfs.makeroot $KVERSION || return 1
rm -rf overlay
# Invoke KVM and/or QEMU to actually create the target filesystem.
$testdir/run-qemu -hda root.ext2 -m 128M -nographic -net none \
$testdir/run-qemu -hda root.ext2 -m 256M -nographic -net none \
-kernel "/boot/vmlinuz-$kernel" \
-append "root=/dev/dracut/root rw rootfstype=ext2 quiet console=ttyS0,115200n81" \
-initrd initramfs.makeroot || return 1
@@ -63,7 +63,6 @@ test_setup() {
inst ./cryptroot-ask /sbin/cryptroot-ask
)
sudo $basedir/dracut -l -i overlay / \
-m "dash crypt lvm mdraid udev-rules base rootfs-block" \
-d "ata_piix ext2 sd_mod" \
-f initramfs.testing $KVERSION || return 1
}

View File

@@ -10,7 +10,7 @@ run_server() {
# Start server first
echo "NFS TEST SETUP: Starting DHCP/NFS server"
$testdir/run-qemu -hda server.ext2 -m 128M -nographic \
$testdir/run-qemu -hda server.ext2 -m 256M -nographic \
-net nic,macaddr=52:54:00:12:34:56,model=e1000 \
-net socket,mcast=230.0.0.1:1234 \
-serial udp:127.0.0.1:9999 \
@@ -42,7 +42,7 @@ client_test() {
return 1
fi
$testdir/run-qemu -hda client.img -m 128M -nographic \
$testdir/run-qemu -hda client.img -m 256M -nographic \
-net nic,macaddr=$mac,model=e1000 \
-net socket,mcast=230.0.0.1:1234 \
-kernel /boot/vmlinuz-$KVERSION \
@@ -104,69 +104,34 @@ test_nfsv3() {
client_test "NFSv3 root=dhcp DHCP path only" 52:54:00:12:34:00 \
"root=dhcp" 192.168.50.1 -wsize=4096 || return 1
client_test "NFSv3 netroot=dhcp DHCP path only" 52:54:00:12:34:00 \
"netroot=dhcp" 192.168.50.1 -wsize=4096 || return 1
client_test "NFSv3 Legacy root=/dev/nfs nfsroot=IP:path" 52:54:00:12:34:01 \
"root=/dev/nfs nfsroot=192.168.50.1:/nfs/client" 192.168.50.1 -wsize=4096 || return 1
client_test "NFSv3 root=nfs DHCP path only" 52:54:00:12:34:00 \
"root=nfs" 192.168.50.1 -wsize=4096 || return 1
client_test "NFSv3 Legacy root=/dev/nfs DHCP path only" 52:54:00:12:34:00 \
"root=/dev/nfs" 192.168.50.1 -wsize=4096 || return 1
client_test "NFSv3 root=/dev/nfs DHCP path only" 52:54:00:12:34:00 \
"root=/dev/nfs" 192.168.50.1 -wsize=4096 || return 1
client_test "NFSv3 netroot=dhcp DHCP IP:path" 52:54:00:12:34:01 \
"netroot=dhcp" 192.168.50.2 -wsize=4096 || return 1
client_test "NFSv3 Legacy root=/dev/nfs DHCP IP:path" 52:54:00:12:34:01 \
"root=/dev/nfs" 192.168.50.2 -wsize=4096 || return 1
client_test "NFSv3 root=dhcp DHCP IP:path" 52:54:00:12:34:01 \
"root=dhcp" 192.168.50.2 -wsize=4096 || return 1
client_test "NFSv3 root=nfs DHCP IP:path" 52:54:00:12:34:01 \
"root=nfs" 192.168.50.2 -wsize=4096 || return 1
client_test "NFSv3 root=/dev/nfs DHCP IP:path" 52:54:00:12:34:01 \
"root=/dev/nfs" 192.168.50.2 -wsize=4096 || return 1
client_test "NFSv3 root=dhcp DHCP proto:IP:path" 52:54:00:12:34:02 \
"root=dhcp" 192.168.50.3 -wsize=4096 || return 1
client_test "NFSv3 netroot=dhcp DHCP proto:IP:path:options" \
52:54:00:12:34:03 "netroot=dhcp" 192.168.50.3 wsize=4096 || return 1
client_test "NFSv3 root=dhcp DHCP proto:IP:path:options" 52:54:00:12:34:03 \
"root=dhcp" 192.168.50.3 wsize=4096 || return 1
client_test "NFSv3 netroot=nfs:..." 52:54:00:12:34:04 \
"netroot=nfs:192.168.50.1:/nfs/client" 192.168.50.1 \
-wsize=4096 || return 1
client_test "NFSv3 root=nfs:..." 52:54:00:12:34:04 \
"root=nfs:192.168.50.1:/nfs/client" 192.168.50.1 -wsize=4096 || return 1
client_test "NFSv3 nfsroot=/nfs/client" 52:54:00:12:34:04 \
"nfsroot=/nfs/client" 192.168.50.1 -wsize=4096 || return 1
client_test "NFSv3 Legacy root=IP:path" 52:54:00:12:34:04 \
"root=192.168.50.1:/nfs/client" 192.168.50.1 -wsize=4096 || return 1
client_test "NFSv3 nfsroot=192.168.50.2:/nfs/client" 52:54:00:12:34:04 \
"nfsroot=192.168.50.2:/nfs/client" 192.168.50.2 -wsize=4096 || return 1
# This test must fail: root=dhcp must ignore other arguments
client_test "NFSv3 root=dhcp nfsroot=/nfs/client" 52:54:00:12:34:04 \
# This test must fail: nfsroot= requires root=/dev/nfs
client_test "NFSv3 Invalid root=dhcp nfsroot=/nfs/client" 52:54:00:12:34:04 \
"root=dhcp nfsroot=/nfs/client" 192.168.50.1 -wsize=4096 && return 1
client_test "NFSv3 root=nfs nfsroot=/nfs/client" 52:54:00:12:34:04 \
"root=nfs nfsroot=/nfs/client" 192.168.50.1 -wsize=4096 || return 1
client_test "NFSv3 root=nfs nfsroot=/nfs/%s" 52:54:00:12:34:04 \
"root=nfs nfsroot=/nfs/%s" 192.168.50.1 -wsize=4096 || return 1
client_test "NFSv3 root=nfs nfsroot=/nfs/ip/%s no host name (use IP)" \
52:54:00:12:34:7f \
"root=nfs nfsroot=/nfs/ip/%s \
ip=192.168.50.101:192.168.50.1::255.255.255.0::eth0:off" \
192.168.50.1 -wsize=4096 || return 1
client_test "NFSv3 root=nfs nfsroot=/nfs/client,wsize=4096" \
52:54:00:12:34:04 "root=nfs nfsroot=/nfs/client,wsize=4096" \
192.168.50.1 wsize=4096 || return 1
client_test "NFSv3 root=dhcp DHCP path,options" \
52:54:00:12:34:05 "root=dhcp" 192.168.50.1 wsize=4096 || return 1
@@ -182,70 +147,16 @@ test_nfsv4() {
# server, so put these later in the list to avoid a pause when doing
# switch_root
client_test "NFSv4 netroot=nfs4 DHCP path only" 52:54:00:12:34:80 \
"netroot=nfs4" 192.168.50.1 -wsize=4096 || return 1
client_test "NFSv4 root=nfs4 DHCP path only" 52:54:00:12:34:80 \
"root=nfs4" 192.168.50.1 -wsize=4096 || return 1
client_test "NFSv4 root=/dev/nfs4 DHCP path only" 52:54:00:12:34:80 \
"root=/dev/nfs4" 192.168.50.1 -wsize=4096 || return 1
client_test "NFSv4 netroot=nfs4 DHCP IP:path" 52:54:00:12:34:81 \
"netroot=nfs4" 192.168.50.2 -wsize=4096 || return 1
client_test "NFSv4 root=nfs4 DHCP IP:path" 52:54:00:12:34:81 \
"root=nfs4" 192.168.50.2 -wsize=4096 || return 1
client_test "NFSv4 root=/dev/nfs4 DHCP IP:path" 52:54:00:12:34:81 \
"root=/dev/nfs4" 192.168.50.2 -wsize=4096 || return 1
client_test "NFSv4 netroot=dhcp DHCP proto:IP:path" 52:54:00:12:34:82 \
"netroot=dhcp" 192.168.50.3 -wsize=4096 || return 1
client_test "NFSv4 root=dhcp DHCP proto:IP:path" 52:54:00:12:34:82 \
"root=dhcp" 192.168.50.3 -wsize=4096 || return 1
client_test "NFSv4 netroot=dhcp DHCP proto:IP:path:options" \
52:54:00:12:34:83 "netroot=dhcp" 192.168.50.3 wsize=4096 || return 1
client_test "NFSv4 root=dhcp DHCP proto:IP:path:options" 52:54:00:12:34:83 \
"root=dhcp" 192.168.50.3 wsize=4096 || return 1
client_test "NFSv4 netroot=nfs4:..." 52:54:00:12:34:84 \
"netroot=nfs4:192.168.50.1:/client" 192.168.50.1 \
-wsize=4096 || return 1
client_test "NFSv4 root=nfs4:..." 52:54:00:12:34:84 \
"root=nfs4:192.168.50.1:/client" 192.168.50.1 \
-wsize=4096 || return 1
client_test "NFSv4 root=nfs4 nfsroot=/client" 52:54:00:12:34:84 \
"root=nfs4 nfsroot=/client" 192.168.50.1 -wsize=4096 || return 1
client_test "NFSv4 root=nfs4 nfsroot=192.168.50.2:/client" \
52:54:00:12:34:84 "root=nfs4 nfsroot=192.168.50.2:/client" \
192.168.50.2 -wsize=4096 || return 1
client_test "NFSv4 root=nfs4 nfsroot=path,opts" \
52:54:00:12:34:84 "root=nfs4 nfsroot=/client,wsize=4096" \
192.168.50.1 wsize=4096 || return 1
# These two only work with NFSv4 in the test suite -- NFSv3 needs
# a /nfs prefix due to our server configuration
client_test "NFSv4 netroot=nfs4" 52:54:00:12:34:84 \
"netroot=nfs4" 192.168.50.1 -wsize=4096 || return 1
client_test "NFSv4 root=nfs4" 52:54:00:12:34:84 \
"root=nfs4" 192.168.50.1 -wsize=4096 || return 1
client_test "NFSv4 root=nfs4 DHCP path,options" \
52:54:00:12:34:85 "root=nfs4" 192.168.50.1 wsize=4096 || return 1
client_test "NFSv4 root=nfs4 DHCP IP:path,options" \
52:54:00:12:34:86 "root=nfs4" 192.168.50.2 wsize=4096 || return 1
client_test "NFSv4 root=dhcp DHCP proto:IP:path,options" \
52:54:00:12:34:87 "root=dhcp" 192.168.50.3 wsize=4096 || return 1
}
@@ -365,7 +276,6 @@ test_setup() {
# Make client's dracut image
$basedir/dracut -l -i overlay / \
-m "dash udev-rules base network nfs debug" \
-d "e1000 nfs sunrpc" \
-f initramfs.testing $KVERSION || return 1
}

View File

@@ -9,9 +9,9 @@ run_server() {
# Start server first
echo "iSCSI TEST SETUP: Starting DHCP/iSCSI server"
$testdir/run-qemu -hda server.ext2 -hdb root.ext2 -m 128M -nographic \
$testdir/run-qemu -hda server.ext2 -hdb root.ext2 -m 256M -nographic \
-net nic,macaddr=52:54:00:12:34:56,model=e1000 \
-net socket,mcast=230.0.0.1:1234 \
-net socket,mcast=230.0.0.1:1235 \
-serial udp:127.0.0.1:9999 \
-kernel /boot/vmlinuz-$KVERSION \
-append "root=/dev/sda rw quiet console=ttyS0,115200n81" \
@@ -33,9 +33,9 @@ run_client() {
return 1
fi
$testdir/run-qemu -hda client.img -m 128M -nographic \
$testdir/run-qemu -hda client.img -m 256M -nographic \
-net nic,macaddr=52:54:00:12:34:00,model=e1000 \
-net socket,mcast=230.0.0.1:1234 \
-net socket,mcast=230.0.0.1:1235 \
-kernel /boot/vmlinuz-$KVERSION \
-append "root=dhcp rw quiet console=ttyS0,115200n81 $DEBUGFAIL" \
-initrd initramfs.testing
@@ -100,7 +100,7 @@ test_setup() {
return 1
fi
# Invoke KVM and/or QEMU to actually create the target filesystem.
$testdir/run-qemu -hda root.ext2 -hdb client.img -m 128M -nographic -net none \
$testdir/run-qemu -hda root.ext2 -hdb client.img -m 256M -nographic -net none \
-kernel "/boot/vmlinuz-$kernel" \
-append "root=/dev/dracut/root rw rootfstype=ext2 quiet console=ttyS0,115200n81" \
-initrd initramfs.makeroot || return 1
@@ -113,9 +113,7 @@ test_setup() {
inst_simple ./hard-off.sh /emergency/01hard-off.sh
# inst ./cryptroot-ask /sbin/cryptroot-ask
)
# -m "debug dash crypt lvm mdraid udev-rules base rootfs-block iscsi" \
sudo $basedir/dracut -l -i overlay / \
-m "debug dash udev-rules base rootfs-block iscsi" \
-d "ata_piix ext2 sd_mod" \
-f initramfs.testing $KVERSION || return 1

View File

@@ -11,9 +11,9 @@ run_server() {
echo "NBD TEST SETUP: Starting DHCP/NBD server"
$testdir/run-qemu -hda server.ext2 -hdb nbd.ext2 -hdc encrypted.ext2 \
-m 128M -nographic \
-m 256M -nographic \
-net nic,macaddr=52:54:00:12:34:56,model=e1000 \
-net socket,mcast=230.0.0.1:1234 \
-net socket,mcast=230.0.0.1:1236 \
-serial udp:127.0.0.1:9999 \
-kernel /boot/vmlinuz-$KVERSION \
-append "root=/dev/sda rw quiet console=ttyS0,115200n81" \
@@ -46,9 +46,9 @@ client_test() {
return 1
fi
$testdir/run-qemu -hda flag.img -m 128M -nographic \
$testdir/run-qemu -hda flag.img -m 256M -nographic \
-net nic,macaddr=$mac,model=e1000 \
-net socket,mcast=230.0.0.1:1234 \
-net socket,mcast=230.0.0.1:1236 \
-kernel /boot/vmlinuz-$KVERSION \
-append "$cmdline $DEBUGFAIL ro quiet console=ttyS0,115200n81" \
-initrd initramfs.testing
@@ -213,7 +213,7 @@ make_encrypted_root() {
rm -rf overlay
# Invoke KVM and/or QEMU to actually create the target filesystem.
$testdir/run-qemu -hda flag.img -hdb encrypted.ext2 -m 128M \
$testdir/run-qemu -hda flag.img -hdb encrypted.ext2 -m 256M \
-nographic -net none \
-kernel "/boot/vmlinuz-$kernel" \
-append "root=/dev/dracut/root rw quiet console=ttyS0,115200n81" \
@@ -308,7 +308,7 @@ test_setup() {
-f initramfs.server $KVERSION || return 1
sudo $basedir/dracut -l -i overlay / \
-m "dash crypt lvm mdraid udev-rules base rootfs-block nbd debug" \
-o "plymouth" \
-d "ata_piix ext2 ext3 sd_mod e1000" \
-f initramfs.testing $KVERSION || return 1
}