Commit Graph

2452 Commits

Author SHA1 Message Date
Harald Hoyer
538a94d9e5 use dash instead of underscore for udev control commands 2009-03-05 14:20:48 +01:00
Harald Hoyer
ca75dc510b serialize lvm calls with a subshell 2009-03-05 14:20:27 +01:00
Harald Hoyer
8ac8d68a0e testimage target fixes 2009-03-05 14:20:05 +01:00
Harald Hoyer
7f5112e3d6 add dmraid 2009-03-05 14:19:41 +01:00
Harald Hoyer
0680bbaf01 fixed rpm building on Fedora 11
"Only dest dir longer than base dir not supported"
2009-03-05 11:31:30 +01:00
Harald Hoyer
2f525c4905 add compile phase to testimage and force overwrite 2009-03-05 11:31:27 +01:00
Harald Hoyer
6567383252 do not get GITTAG, if there is no .git 2009-03-05 11:31:17 +01:00
Harald Hoyer
d012395c94 fixed dirs in specfile 2009-03-05 10:57:49 +01:00
Harald Hoyer
6b2a2be3ba added tar.bz2 target for the rpm and archive target 2009-03-05 10:56:13 +01:00
Harald Hoyer
710322ecf0 define gittag for rpm target 2009-03-05 10:55:49 +01:00
Harald Hoyer
4579f5a832 add sample dracut.conf 2009-03-05 10:44:17 +01:00
Harald Hoyer
32731fee48 install console udev rules and helper apps 2009-03-05 10:34:09 +01:00
Harald Hoyer
b2714d05e2 allow dracut.conf to be local if -l is set 2009-03-05 10:33:42 +01:00
Harald Hoyer
ccd71eeb17 add testimage target 2009-03-05 10:33:18 +01:00
Harald Hoyer
7323a62176 renamed archive file and convenience target for rpm 2009-03-05 10:18:46 +01:00
Harald Hoyer
53abb691b2 small corrections and obsolete mkinitrd only when defined in specfile 2009-03-05 10:16:50 +01:00
Harald Hoyer
f8a22bfb95 fix modules.d install 2009-03-05 09:54:58 +01:00
Harald Hoyer
aedead8068 add \n to switch_root 2009-03-04 17:49:19 +01:00
Harald Hoyer
7fac4e8850 kill udevd before switching root 2009-03-04 17:48:20 +01:00
Harald Hoyer
7702658f5e also run ldconfig on /lib64 2009-03-04 17:36:55 +01:00
Harald Hoyer
962a11e74a only run ldconfig on /lib and /usr/lib with -n
This also suppresses error messages about missing ld.so.conf
2009-03-04 17:35:14 +01:00
Harald Hoyer
0f9c78c104 merge fix, find_binary 2009-03-04 17:29:42 +01:00
Harald Hoyer
834f614534 fixes for specfile and Makefile 2009-03-04 17:25:30 +01:00
Harald Hoyer
c4da240717 replace switch_root shell script with binary
The switch_root shell script did not work with bash-4.0-2, because
"exec" gets the real path of the executable which is then
"/sysroot/lib/ld-linux.so.2" instread of "./lib/ld-linux.so.2".

Also the required chroot binary might live in /usr/bin, which can
be mounted later.

Here is the switch_root code from nash, which can be stripped down
further, but which works.

>From f1b1e4f8694104f007e4483c36b0bf40a5760167 Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Date: Wed, 4 Mar 2009 13:41:07 +0100
Subject: [PATCH] replace switch_root shell script with binary

The switch_root shell script did not work with bash-4.0-2, because
"exec" gets the real path of the executable which is then
"/sysroot/lib/ld-linux.so.2" instead of "./lib/ld-linux.so.2".
Also the required chroot binary might live in /usr/bin, which can
be mounted later.

Here is the switch_root code from nash, which can be stripped down
further, but which works.
2009-03-04 17:23:03 +01:00
Harald Hoyer
65381749c8 strip "init=" from INIT 2009-03-04 17:19:41 +01:00
Victor Lowther
54b4419653 Fix several inst functions.
Move file existence checking into the individual inst functions. This makes
things a bit easier to understand and maintain.
2009-03-04 17:18:47 +01:00
Victor Lowther
a344b762a0 Steal rules we need from the latest udev package.
This should arguably be done by importing the udev git repo as a submodule,
but I am too lazy to figure out how to do that right now.

I suppose this could also be done by rewriting the 95udev-rules.sh module
for each distribution, but that is something best left to the distro
maintainers once we acheive some sort of widespread adoption.  Until then,
stealing rules from upstream udev seems like the most portable solution.
2009-03-04 17:14:57 +01:00
Victor Lowther
09805e02b8 Get rid of some RedHat specific modules and udev rules
They are not needed to boot with dracut, so away they go.

Also rewrite inst_rules to automatically search likely rule locations when
installing udev rules.
2009-03-04 17:14:53 +01:00
Victor Lowther
ca7d88da13 Modify instmods to not rely on the existence of modules.* files
This patch series aims to make dracut more distro-independent.  It includes
some of the functionality that Seewer Philippe posted to the list to make
dracut work on Ubuntu.

depmod does not create these files on all distros (Debian, specifically),
so modify instmods to use pathname components and find to do what we want.

As a bonus, this removes the special-case for =ata.
2009-03-04 17:11:11 +01:00
Seewer Philippe
7bcacaaa5f Create directories for symlinked libraries if needed
Sometimes symlinks for libraries reside in weird places. Create those
weird places if necessary.

--
  dracut-functions |    1 +
  1 files changed, 1 insertions(+), 0 deletions(-)
2009-03-04 17:10:51 +01:00
Seewer Philippe
9f88fcd94b Canonicalize symlinks
When handling links sometimes one readlink isn't enough. Dracut doesn't
need to clone a whole link series, so just use readlink -f

--
  dracut-functions |    8 +++-----
  1 files changed, 3 insertions(+), 5 deletions(-)
2009-03-04 17:10:03 +01:00
Seewer Philippe
59e3c455b8 Make bash regexes behave
On some systems with newer or unpatched bash versions the whole right
portion of =~ is considered part of the regex. Means we need to get rid
of enclosing ''.

This patch fixes this.

--
  dracut-functions |    8 ++++----
  1 files changed, 4 insertions(+), 4 deletions(-)
2009-03-04 17:07:46 +01:00
Seewer Philippe
9b88534374 Fix find_binary always succeeding
find_binary inside dracut-functions always succeeds. Independent of
whether the file actually exists or not.

This patch fixes this.

And since we're using the function not only to find binaries at little
enhancement there shouldn't be that bad either.

--
dracut-functions |   21 ++++++++++++++++-----
  1 files changed, 16 insertions(+), 5 deletions(-)
2009-03-04 17:05:58 +01:00
Seewer Philippe
acf324172d Fix instmods recursing indefinitely
the instmod function inside dracut-functions starts to recurses indefinitely
if modprobe --show-depends is used and the output contains module options.

Example:

#modprobe --show-depends libata
insmod /lib/modules/2.6.27-11-generic/kernel/drivers/acpi/dock.ko
insmod /lib/modules/2.6.27-11-generic/kernel/drivers/scsi/scsi_mod.ko
insmod /lib/modules/2.6.27-11-generic/kernel/drivers/ata/libata.ko ignore_hpa=1

This patch fixes this.

--
 dracut-functions |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
2009-03-04 17:01:53 +01:00
Seewer Philippe
fafe4adec5 Fix Makefile installing in wrong directories
rules, hooks and modules are installed in $(DESTDIR)/usr/libexec/dracut/
instead of their corresponding sub-directories.

This patch fixes this.

--
 Makefile |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
2009-03-04 17:01:22 +01:00
Victor Lowther
49c68fa442 Add documentation on how to write a dracut module.
Also some minor cleanups to the dracut script.
2009-03-04 16:58:07 +01:00
Victor Lowther
6337e3edca Modify Makefile to understand the new module structure. 2009-03-04 16:55:17 +01:00
Victor Lowther
20abd91484 Create a self-contained structure for dracut modules
All modules now live in a subdirectory /modules.d.  Each module is
self-contained -- it should contain everything that it will install
on the initrd.  All modules must include a script named install, which
will be sourced by dracut.  This script should do the actual file installation
using inst methods.  The moddir variable will point to the full path to the
module dracut is currently working on.

As usual, this patch series applies on top of my previous patch series,
and is available as normalize-modules from http://git.fnordovax.org/dracut.
2009-03-04 16:55:14 +01:00
Victor Lowther
58a797d5f9 Do not run dhclient if the interface is already up. 2009-03-04 16:55:10 +01:00
Victor Lowther
5f3e2dd2f3 Move running dhclient on DHCP interfaces into a pre-mount hook.
Static interfaces are still configured on the fly as we add them, but
discussions on the mailing list have suggested that we need to have finer
control over bringing up dhcp interfaces.

The default hook just runs all the requested dhclients in parallel and waits
for them to all return.  If you need something more complicated than this, or
need to have more control over bringing interfaces up, you will probably need
to override some stuff in the 40network hook.
2009-03-04 16:55:05 +01:00
Victor Lowther
6a376b57eb Save any dhcp options we did not handle to net.$interface.dhcpopts 2009-03-04 16:55:02 +01:00
Victor Lowther
17867cf913 Update scripts to make things a little easier to read 2009-03-04 16:54:59 +01:00
Victor Lowther
0ac9584ded We now know how to configure the network interfaces.
Provided that you are configuring them via DHCP. RARP, BOOTP, and static
configuration are not written yet.

Also, adding nic drivers really bloats the initrd.

I am looking for feedback on these patches from people who actually implement
booting over the network.  This patch series does not include support for that
yet -- you will not find nfsroot= handling, or booting to a fs supplied by
dhcp yet.  I do want to make it as easy as possible to add support for booting
over the network, as well as making it easy for people to customize things to
meet their site requirements.

This patch series is also available as the network-configurability branch at
http://git.fnordovax.org/dracut.  It may be rebased without warning to keep
it in sync with the rest of dracut.
2009-03-04 16:54:43 +01:00
Victor Lowther
8177ca3e1e Add some predefined break points.
We now have a breakpoint just before each of the hook invocations, and one
just before we switch to the real root.
2009-03-04 16:54:40 +01:00
Victor Lowther
972673f6d3 Trim out device nodes we do not have to actually create.
If plymouth needs more, it can add them back in the hooks.
2009-03-04 16:54:37 +01:00
Victor Lowther
d05f3c4354 Modify getarg to be slightly more useful.
If the last character in the argument to search for is "=", then
getarg will echo all the text after the = as well as returning 0 or 1 depending
on whether or not the arg is found.
Otherwise, getarg will jsut return 0 if the exact test of the argument is found,
1 otherwise.
2009-03-04 16:54:31 +01:00
Victor Lowther
a08c1f452a Move actually mounting the root filesystem into its own series of hooks.
We now have mount hooks.  They are sourced in an infinite loop until one of
them actually mounts the real root filesystem.

This makes it easier to add support for arbitrarily complex schemes to find
the root filesystem without having to patch the init script.

This patch series is also avaialble ass the hookify-finding-root branch at
http://git.fnordovax.org/dracut
2009-03-04 16:54:24 +01:00
Victor Lowther
19e9dd9303 cryptsetup does not like running in a while read loop.
Add some additional manglage to ensure that stdin/stdout is always pointing
the right thing.  A more elegant way of doing this would be much appreciated
2009-02-24 14:53:42 -05:00
Victor Lowther
5ee69f0b54 Make cryptroot handling act as a real producer/consumer.
This should handle the case of having more than one encrypted
block device on the system as best we can right now.
2009-02-23 13:22:01 -05:00
Victor Lowther
9689f4c8ce Support rootflags and rootfstype kernel parameters.
This also folds in support for ro and rw flags.
2009-02-23 13:22:01 -05:00