Commit Graph

150 Commits (c8ebb80590be2dbe0cb63c9696903889b51efc75)

Author SHA1 Message Date
Harald Hoyer 8714280104 only install /etc/modprobe.d for hostonly 2012-10-16 13:15:21 +02:00
Harald Hoyer 167a320e5f s/libnss*.so/libnss_*.so so that we don't install libnss3.so 2012-10-04 14:38:25 -04:00
Harald Hoyer ba111df2b9 nfs: install all nfs submodules 2012-09-10 15:49:58 +02:00
Harald Hoyer 6ca264a151 nfs/module-setup.sh: check for "rpc.rpc" before running chown 2012-07-26 18:12:05 +02:00
Harald Hoyer 68e7661ca7 deprecate old command line options 2012-07-25 10:32:42 +02:00
Dave Young 83a420674b nfs: install modprobe config file
install nfs modprobe config file

For nfs4, in case nfs.ko is not loaded mount.nfs4 will try to load
nfs4.ko instead of nfs.ko. Fedora nfs-utils creates a lib/modprobe.d/nfs.conf
in which there's below alias:
alias nfs4 nfs

Dracut also need this file to auto load nfs kernel module.

Tested booting to a fedora 17 nfsroot share.

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-07-11 08:45:34 +02:00
Harald Hoyer 53fe81e752 modules.d/*/module-setup.sh: combine and specify type for installs
To speedup image creation, combine dracut_install calls and specify the exact type.
E.g. inst_script instead of the generic inst.
2012-06-29 12:41:27 +02:00
Harald Hoyer 9f6baa127a nfs: extend libnss wildcard 2012-06-15 11:12:08 +02:00
Harald Hoyer d77540c8e4 get rid of libdir and usrlibdir 2012-06-04 15:23:15 +02:00
Harald Hoyer eef7649e71 merge "cleanup" and "pre-pivot-cleanup" hooks 2012-04-23 11:32:45 +02:00
Dave Young 1bd76bf981 move cleanup scripts to pre-pivot-cleanup hook
below cleanup scripts is moved:
40network: kill-dhclient.sh
90crypt: crypt-cleanup.sh
90multipath: multipathd-stop.sh
95iscsi: cleanup-iscsi.sh
95nfs: nfsroot-cleanup.sh

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-04-19 11:59:45 +02:00
Jon Ander Hernandez c9143a63fe Debian multiarch support
Another solution could be searching in directories found at
/etc/ld.so.conf.d/*.conf or adding a new parameter. Here is a patch
which adds a new --libdirs parameter, and also a new inst_libdir_file
function which will try to expand metacharacters on each lib
directory:

    inst_libdir_file "libdevmapper-event-lvm*.so"
2012-04-16 14:46:53 +02:00
Harald Hoyer 8a5456e872 95nfs/nfs-lib.sh: add server-ip to nfs server search 2012-04-05 13:25:41 +02:00
Harald Hoyer 5e5f3d5e6c 95nfs/module-setup.sh: removed "egrep" and "ls" calls 2012-02-25 16:06:16 +01:00
Harald Hoyer 14669e3a86 95nfs/module-setup.sh: whitespace fixup 2012-02-22 15:15:22 +01:00
Harald Hoyer 552ecca6db Renamed all shell scripts to *.sh 2012-02-22 15:15:21 +01:00
Harald Hoyer 969394f503 95nfs/nfs-lib.sh: do not bail out at sourcing in nfsroot_from_dhcp()
nfsroot_from_dhcp() returned with failure if one of
/tmp/net.$iface.override /tmp/dhclient.$iface.dhcpopts was missing
2012-02-15 16:39:41 +01:00
Will Woods 9fcfa04ca9 port nfsroot to nfs-lib
Rewrite nfsroot to use nfs-lib. The functionality should be unchanged.

Signed-off-by: Will Woods <wwoods@redhat.com>
2012-02-15 15:46:24 +01:00
Will Woods 9c463909d6 95nfs: add nfs-lib.sh
nfs-lib.sh contains a bunch of functions used to parse NFS "url"s of
various types, pull nfs information out of dhcp info, and actually
perform nfs mounts sanely.

Signed-off-by: Will Woods <wwoods@redhat.com>
2012-02-15 15:46:24 +01:00
Harald Hoyer fb67e4aa36 shutdown on demand
Do not save and restore the initramfs, but instead, just unpack the
default initramfs for shutdown on shutdown.
2012-02-13 07:08:08 +01:00
Dave Young c6655c4115 split nfs rpc daemons startup script
fstab-sys will mount nonroot nfs as well, so we need to split the necessary
code from nfsroot to start rpc daemon as hook script.

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-02-07 12:14:21 +01:00
Dave Young 65bb31a405 source dracut-lib.sh in nfs cleanup script
nfsroot-cleanup.sh need source dracut-lib.sh for function incol2

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-02-07 12:14:21 +01:00
Dave Young cc78087b83 add nobody group for rpc.idmapd
Add nobody group due to rpc.idmapd will fail to startup without nobody group

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-02-07 12:14:21 +01:00
Dave Young 59ee80764e deal common part of etc passwd in 99base
ssh module will need root user in /etc/passwd, so add root and nobody
to /etc/passwd in 99base instead of nfs module

Signed-off-by: Dave Young <dyoung@redhat.com>
2012-01-23 09:48:35 +01:00
Cong Wang eead773204 nfs: fix regex patterns in check()
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
2012-01-13 11:35:49 +01:00
Cong Wang 1b7fd0fa3e Check module dependencies of mount points
Like -H, we need to poll every module to check if it is needed
to mount a specific device in '--mount'.

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
2012-01-13 11:35:49 +01:00
Harald Hoyer 480d772f22 */module-setup.sh: use host_fs_types host_devs
For the $hostonly case, use $host_fs_types and $host_devs to determine,
if a module has to be included in the initramfs.
2011-12-15 14:49:03 +01:00
Harald Hoyer e59f58f854 use inst_simple to install non-binary files 2011-08-12 13:11:30 +02:00
Harald Hoyer 5e802b113a removed sourceforge references 2011-08-12 09:53:40 +02:00
Harald Hoyer 29b10e65b1 dracut-functions: make local vars local and prefix with "_" 2011-05-12 11:06:47 +02:00
Harald Hoyer 3b403b32fc removed trailing whitespaces 2011-05-10 11:56:09 +02:00
Harald Hoyer 1325cddee9 let rpc user own /var/lib/rpcbind
https://bugzilla.redhat.com/show_bug.cgi?id=698160
2011-05-02 11:27:12 +02:00
Harald Hoyer fb59f4c967 get rid of absolute PATHs 2011-04-08 13:49:06 +02:00
Harald Hoyer d125a47061 mkdir always with -m 0755 2011-04-08 10:39:46 +02:00
Jon Ander Hernandez c174aea07d Ensure rpc_pipefs is mounted
While on some systems (like Fedora) rpc_pipefs is mounted
automatically when sunrpc module is loaded, on Debian based systems it
needs to be mounted manually.
2011-03-29 16:17:03 +02:00
Harald Hoyer 0b53ca70b6 Move all hooks to "$hookdir"
hookdir=/lib/dracut/hooks for now, to keep the root directory clean
2011-03-25 16:10:46 +01:00
Harald Hoyer c9f1e3d1f4 check for getarg() function before sourcing dracut-lib.sh
make use of "type getarg" to check, if we really need to source
dracut-lib.sh
2011-03-25 16:10:46 +01:00
Harald Hoyer 8ce58f1f42 add missing shebang 2011-02-23 09:38:25 +01:00
Harald Hoyer 71df3c4329 renamed module-info.sh to module-setup.sh 2011-02-02 16:35:18 +01:00
Harald Hoyer 95d2dabc25 replaced check,install,installkernel with module-info.sh 2011-02-02 13:56:03 +01:00
Harald Hoyer fa7ada31d0 new parameter option names with "rd.*" namespace
Renamed Options
       Here is a list of options, which were used in dracut prior to
       version 008, and their new replacement.

       rdbreak
           rd.break

       rd_CCW
           rd.ccw

       rdcopystate
           rd.copystate

       rd_DASD_MOD
           rd.dasd_mod.dasd

       rd_DASD
           rd.dasd

       rdinitdebug rdnetdebug
           rd.debug

       rd_NO_DM
           rd.dm=0

       rd_DM_UUID
           rd.dm.uuid

       rdblacklist
           rd.driver.blacklist

       rdinsmodpost
           rd.driver.post

       rdloaddriver
           rd.driver.pre

       rd_NO_FSTAB
           rd.fstab=0

       rdinfo
           rd.info

       check
           rd.live.check

       rdlivedebug
           rd.live.debug

       live_dir
           rd.live.dir

       liveimg
           rd.live.image

       overlay
           rd.live.overlay

       readonly_overlay
           rd.live.overlay.readonly

       reset_overlay
           rd.live.overlay.reset

       live_ram
           rd.live.ram

       rd_NO_CRYPTTAB
           rd.luks.crypttab=0

       rd_LUKS_KEYDEV_UUID
           rd.luks.keydev.uuid

       rd_LUKS_KEYPATH
           rd.luks.keypath

       rd_NO_LUKS
           rd.luks=0

       rd_LUKS_UUID
           rd.luks.uuid

       rd_LUKS_UUID
           rd.luks.uuid

       rd_NO_LVMCONF
           rd.lvm.conf

       rd_LVM_LV
           rd.lvm.lv

       rd_NO_LVM
           rd.lvm=0

       rd_LVM_SNAPSHOT
           rd.lvm.snapshot

       rd_LVM_SNAPSIZE
           rd.lvm.snapsize

       rd_LVM_VG
           rd.lvm.vg

       rd_NO_MDADMCONF
           rd.md.conf=0

       rd_NO_MDIMSM
           rd.md.imsm=0

       rd_NO_MD
           rd.md=0

       rd_MD_UUID
           rd.md.uuid

       rd_NFS_DOMAIN
           rd.nfs.domain

       rd_NO_PLYMOUTH
           rd.plymouth=0

       rd_retry
           rd.retry

       rdshell
           rd.shell

       rd_NO_SPLASH
           rd.splash

       rdudevdebug
           rd.udev.debug

       rdudevinfo
           rd.udev.info

       rd_NO_ZFCPCONF
           rd.zfcp.conf=0

       rd_ZFCP
           rd.zfcp
2010-10-28 17:11:27 +02:00
Harald Hoyer 48d2199e94 nfs/install: fixed s/LIBDIR/libdir 2010-09-10 17:51:32 +02:00
Harald Hoyer cc02093d69 reformat source code
removed tabs and set indention to 4 spaces
added emacs and vi format headers
2010-09-10 15:34:36 +02:00
Harald Hoyer 5acc508cae fixed "use $libdir and $usrlibdir instead of ..." 2010-08-23 12:40:15 +02:00
Amadeusz Żołnowski 55309e7800 use $libdir and $usrlibdir instead of individual detect with ldd 2010-08-23 11:55:11 +02:00
Amadeusz Żołnowski f3af7bd66b use 'type' built-in instead of external cmd 'which' in every Bash script 2010-08-23 11:54:09 +02:00
Harald Hoyer b6a7c09070 chmod 0755 *.sh 2010-05-19 09:40:48 +02:00
Harald Hoyer 0679a6d24e nfs: add missing nfsidmap libs 2010-04-16 17:59:48 +02:00
Harald Hoyer 7f00669875 nfs: fixed nsswitch.conf parsing
based on a patch of Ian Dall.
https://bugzilla.redhat.com/show_bug.cgi?id=578060
2010-04-15 16:26:06 +02:00
Harald Hoyer 9232cab470 fix IFS restoring 2010-02-18 09:46:19 +01:00
Harald Hoyer 21a74b32b2 nfs4: rpc.idmapd does not accept parameters anymore
modify /etc/idmapd.conf instead
2010-02-15 10:43:51 +01:00
Harald Hoyer a39ea24f10 nfs: suppress error message about missing passwd 2010-02-10 18:54:31 +01:00
Harald Hoyer 93bc3d440c make nfs4 work 2010-02-10 17:21:46 +01:00
Harald Hoyer c98bcec89c add preliminary IPv6 support 2010-02-04 16:05:19 +01:00
Harald Hoyer 4073e3a325 nfs: add rd_NFS_DOMAIN parameter to set the NFSv4 domain name
https://bugzilla.redhat.com/show_bug.cgi?id=537969
2009-11-26 10:38:40 +01:00
Harald Hoyer 48df9fcc11 nfs: install passwd entries for nobody and nfsnobody 2009-11-26 10:38:06 +01:00
Harald Hoyer f214273fd6 nfs/nfsroot: do not redirect output on rdnetdebug
nfsroot is now in the initqueue
2009-10-01 14:46:16 +02:00
Harald Hoyer 1dc53cfd1e nfs: specify nfs version 3 explicitly and retry with nfs version 2 2009-10-01 14:46:13 +02:00
Harald Hoyer a52586e8ea network: break udevsettle early 2009-09-15 15:38:53 +02:00
Harald Hoyer 5a8d8dfbb6 switch modules to initqueue-finished 2009-09-15 11:17:22 +02:00
Harald Hoyer b806825d2a nfs: only install libnfsidmap_nsswitch.so of all libnfsidmap_*.so 2009-08-14 17:27:49 +02:00
Harald Hoyer 67a38adacf nfs: only install libnss_*.so which are used by nsswitch.conf 2009-07-31 12:40:53 +02:00
Harald Hoyer 6c4b24afb0 nfsroot-cleanup: don't try to read from nonexistant /tmp/nfs.rpc_pipefs_path 2009-07-23 18:27:33 +02:00
Marc Grimme 2fe2945869 nfsroot-cleanup: make /var/lib/nfs/rpc_pipefs path configurable
/tmp/nfs.rpc_pipefs_path can contain the path where
/var/lib/nfs/rpc_pipefs will be moved before switch_root.

This is useful if /var is a separate partition in the real root.
2009-07-23 12:19:54 +02:00
Harald Hoyer 33ee031c4a dracut: add --kernel-only and --no-kernel arguments
--kernel-only
              only install kernel drivers and firmware files

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

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

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

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

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

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

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

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

initrd-config.img
  optional image with local configuration files
2009-07-22 15:07:11 +02:00
Harald Hoyer 47e1402108 nfs: do not install whole passwd, grep for rpc user 2009-07-17 16:00:20 +02:00
Warren Togami 19c258b689 NFSv4 rpcbind should need only the rpcbind user, not the entire /etc/passwd.
TODO: /etc/passwd and /etc/group are not removed yet due to 90mdraid.
      dledford said he'll go in and clean this up since he has the hardware
      to actually test the mdmon stuff.
2009-07-09 14:33:33 -04:00
Harald Hoyer 5b2db7d177 put back the nfs mount in the udev event
it solves the following case:

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

- the server could be reachable on any interface
- any interface can get an IP by dhcp
- only one IP is allowed to mount the root
2009-07-03 14:56:20 +02:00
Harald Hoyer 9719024132 Defer mount to the real mount loop
Udev rules set a /dev/root symlink to the real root and add
a mount script to /mount/. This enables the proper use of pre-mount
scripts and prevents mount being killed by a udev timeout.
2009-07-03 12:38:43 +02:00
Warren Togami bd81caa80a Clean up NFS comments. 2009-07-01 15:46:48 -04: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 950086e987 do not assume nfs for root=/dev/... but for /dev/nfs 2009-07-01 19:28:31 +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 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 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
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 b8f39ef152 renamed dracut-lib to dracut-lib.sh 2009-06-19 13:00:09 +02:00
Harald Hoyer 1e885ccdfb support old style root=dhcp root-path=server-ip:/path 2009-06-17 20:25:23 +02:00
Philippe Seewer 1b31fc140b netroot: Add ip= cmdline checker
As with other netroot boot arguments ip= lines should be parsed and
checked. Having this has the advantage that other cmdline scripts
can tell the ip= parser if dhcp or ip=:srv:... is needed, like
parse-root.sh (renamed dhcp-fallback) or parse-nfsroot do.

The nfs test-suite has one check which uses static ip lines, but
the autoconf param is wrong. Fixed this as well.
2009-06-17 08:37:40 +02:00
Philippe Seewer 50e7ff76de netroot: Introduce detailed cmdline parsers
This introduces detailed cmdline parsing, warning or aborting if the
cmdline does not contain arguments according to the spec.

Makeing sure the parsers don't just call getarg for netroot et al,
allows their reuse inside netroot to analyse dhcp root-path as well.
Hence we can get rid of the current netroot hooks. The hook itself stays
in order to add further modules which should run before netroot handlers
are called.

This has one drawback: nfsroot needs some more logic to handle nfs
specific data inside dhcp root-path.

The parsers have been writting according to current discussions about
cmdline arguments. This lead to the "discovery" that some test-cases
violate the spec. These tests have not been removed, but change to
"must fail".
2009-06-17 08:37:40 +02:00
Philippe Seewer 580bb5417c netroot and others: Style changes
Multiline conditionals ( && { ... } ) should use if, function
declarations go to the top of the file, add/update comments and remove
some unnecessary clutter.
2009-06-17 08:37:39 +02:00
Philippe Seewer 268de90f82 netroot handlers: Add argument checking
This is probably not necessary, but paranoia dictates that the actual
netroot handlers should check if all three required arguments (netif,
root, NEWROOT) are there and useable.
2009-06-17 08:37:39 +02:00
Philippe Seewer 9cdfd735a8 netroot: Don't export NEWROOT
Exporting NEWROOT to handlers when we already pass them two other
arguments doesn't make sense. Passing it as a third argument is
better.
2009-06-17 08:37:39 +02:00
Philippe Seewer 115a35c175 nfsroot: statd is only needed for nfs4
rpc.statd is only needed for NFSv4, because it's required for
locking. We don't support locking for NFSv2/3, so start it only
if we are mount from NFSv4.
2009-06-17 08:37:39 +02:00
Philippe Seewer 3da03a6036 NFS: Add support for debian based distros
This patch enhances nfsroot and the nfs test-suite with compatibility
for debian based distros. This is mainly the difference of using
portmap instead of rpcbind and the missing file /etc/netconfig
2009-06-17 08:37:38 +02:00
Warren Togami 21df4aa429 grep is installed by 95debug for the moment, remove this to simplify. 2009-06-12 23:48:54 -04:00
David Dillow aec48753c2 network: add support for netroot=...
This adds support for a command line option netroot=, which is currently
equivalent to root=. This will allow us to break out handling in NBD and
iSCSI to support constructs such as "root=LABEL=/ netroot=dhcp" to make
use of our block device handling with network attached devices.

iSCSI has not been changed in this patch as I don't currently have a way
to test it.
2009-06-11 01:47:11 -04:00
Harald Hoyer 169363e827 add ipv6 rpc.idmapd and various conf files for NFS
rpcbind on Fedora does not seem work for NFS4 without IPv6
2009-06-08 14:50:22 +02:00
David Dillow abe9ccc89a NFS root: add support for default root path and %s substitution
This implements a default path of /tftpboot/%s if no path is provided,
and adds host name substitution for %s, with a fall back to the IP address,
as provided by the kernel's nfsroot handling.

The test suite is updated to test this functionality.
2009-06-07 17:17:48 -04:00
David Dillow 4107be9f9f NFS root: add missing DHCP root-path/nfsroot=[IP:]/path[,options] format
Reported-by: Seewer Philippe <philippe.seewer@bfh.ch>
2009-06-07 14:59:38 -04:00
Seewer Philippe 07b2fbb183 Get rid of cat and grep 2009-06-05 16:10:52 +02:00
David Dillow 2129ffe93e nfs: cleanup currently needs grep 2009-06-05 00:26:10 -04:00
David Dillow b4dc8ad346 Allow NFS and NBD to be built into the kernel
Probe for NFS and NBD capability before trying to load their modules
in case they are built into the kernel. Ugly use of flag files, but
avoids the need for grep to be on the image.
2009-06-01 19:59:22 -04:00
David Dillow 92997caf35 cleanup shebangs in sourced scripts
All of the scripts are sourced, so there is no need to have
will pick up on the .sh extension.
2009-06-01 19:17:48 -04:00
Warren Togami 4f0e32751f nfs needs sunrpc 2009-06-01 18:38:53 -04:00
David Dillow 5103130352 nfsroot: move to netroot framework
Parse and convert commandline options in the cmdline hook, and
fill in the missing pieces in the netroot hook. This also allows
root=dhcp to work as expected.
2009-06-01 00:56:01 -04:00
David Dillow 145ca9e5b3 nfsroot: move to same sort order as block methods
There is no reason for this to be a 40nfsroot rather than 95nfs
once other network root handlers are added. Go ahead and move it.
2009-05-31 22:45:12 -04:00