Harald Hoyer [Tue, 7 Feb 2012 17:45:54 +0000 (18:45 +0100)]
99base/init: predefine path to init
if you add realinitpath="<path1> <path2>" to dracut.conf, then it will
be written to $initdir/etc/cmdline.d/distroinit.conf with
"rd.distroinit=<path1> rd.distroinit=<path2>" and evaluated by
99base/init, when it searches for init.
Dave Young [Thu, 2 Feb 2012 07:59:52 +0000 (15:59 +0800)]
auto setup network without netroot
Current dracut network only will be setup when netroot is used. But there are
some cases we need network even without netroot. For example kdump will need
copy vmcore to remote machine via scp or nfs mount. OTOH, if we use dracut as
a recovery system the network is helpful even root is not a network device.
This implementation is based on the manually bring up method. Here add a kernel
cmdline argument rd.neednet. If rd.neednet is set dracut will bring up network
with ifup $INTERFACE -m. If netroot is used we still keep original behavior.
Dave Young [Thu, 2 Feb 2012 07:59:49 +0000 (15:59 +0800)]
allow ifup bring up network manually even without netroot
For kdump we need scp vmcore to remote machine, the nic to be used is
not limited to netroot one. we need a feature for manually bringing up
network interface. Also it is useful for emergency shell with
ssh-client for recovery or test purpose
I implement this by adding one argument to ifup script, user can use
`/sbin/ifup eth0 -m` to bring up eth0, note ifup will regard it a
manual operation for the nic specified in 1st argument if there's
the 2nd argument.
If same nic is used for netroot the 2nd argument will be ignored,
in this case we will leave netroot bring up it automatically to
avoid side effect. And in this case hooks such as kdump will need to
execute after netroot mounted.
`ifup eth0 -m` will create /tmp/net.eth0.manualup stamp file,
later dhclient-script can check this and pass $2 to netroot,
then netroot script will bring eth0 up
Thanks for comments and suggestions from David Dillow.
Ian Dall [Mon, 23 Jan 2012 09:46:10 +0000 (10:46 +0100)]
network/dhclient-script: set FQDN
When booting with nfsroot, dracut doesn't necessarily set the initial
hostname correctly.
According to dhcp-options(5), the name may or may not be qualified with
the local domain. It goes on to say "it is preferable to use the
domain-name option to specify the domain name".
So dhclient-script needs to be able to handle the cases: a) where
host-name is fully qualified and domain name is also specified; b)
where hostname is fully qualified and the domain is not separately
specified; c) where host-name is "short" and domain-name is also
specified; and d) do its best where host-name is short but domain-name
is not specified.
The dhclient-script in initramfs does not handle case "c", apparently
the preferred situation properly, setting hostname to "short".
James Buren [Sun, 22 Jan 2012 18:56:24 +0000 (12:56 -0600)]
plymouth: add xz support for kernel modules
This rewrites a portion of the module to support xz, as well as allow
an easier expansion should future compression methods for kernel
modules ever materialize.
Dave Young [Mon, 26 Dec 2011 06:29:21 +0000 (14:29 +0800)]
Add ssh client module code
Add ssh client module which support ssh key mode and interactive mode.
with --sshkey option you can provide the ssh key to be installed
>why not call it "ssh" module?
ssh-client is better, maybe future there will be ssh-server come in.
In debian these are also two different packages.
Usage:
1. sshkey mode:
transfer your public key to remote machine with ssh-copy-id or do it mannaully
example of options:
./dracut -l -H -a ssh-client --sshkey /root/.ssh/id_rsa i.img
2. interactive mode:
need use --ctty option, ie.:
./dracut -l -H -a ssh-client --ctty i.img
[v2 changes]:
per wangcong: add patch description about module name
add help line in usage()
remove useless comment
Michal Soltys [Mon, 26 Dec 2011 06:29:15 +0000 (14:29 +0800)]
Add job control support to emergency shell
Option --ctty will optionally add setsid binary to dracut's image.
During runtime, if rd.ctty is set and is a character device,
emergency shells will be spawned with job control.
in case no ctty was provided, shell was spawned without caring about
/dev/console. Also, the ctty is more opportunistic. If the image was
generated with --ctty, we will fallback to /dev/tty1 if rc.ctty is
invalid or missing. Otherwise we spawn standard shell on /dev/console
[dyoung@redhat.com: Rebased to usrmove branch]
Signed-off-by: Michal Soltys <soltys@ziu.info> Signed-off-by: Dave Young <dyoung@redhat.com>
Anton Blanchard [Mon, 26 Dec 2011 22:08:27 +0000 (09:08 +1100)]
Handle upper case MAC addresses in ifname option
While the documentation states that ifname MAC addresses must be
lower case, we silently accept upper case ones and fail later on
when udev doesn't rename the device.
Instead of adding sanity checking on the MAC address just convert
it to lower case and remove the requirement completely.
Dave Young [Thu, 12 Jan 2012 08:00:31 +0000 (16:00 +0800)]
fstab-sys: mount it in initramfs instead of newroot if mount point is not found
fstab-sys now also handles device passed by dracut argument "--mount"
The "--mount" mount point is possible not exist in $NEWROOT. Thus mount it
in initramfs if mount point is not exist in real rootfs
Cong Wang [Tue, 20 Dec 2011 06:09:56 +0000 (14:09 +0800)]
Allow to add mount points even not in hostonly mode
Don't force --mount only working in hostonly mode, let users decide.
With this patch, people can still combine -H --mount '...' if they
want to use it in hostonly mode.
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Colin Guthrie [Sat, 31 Dec 2011 13:35:59 +0000 (13:35 +0000)]
init: Fix bogus message about invalid root device.
When the initqueue cannot be processed, it might be about an invalid
root device (in which case a separate message produced via
wait_for_dev() should be displayed anyway), but it could also
be for any other reason (e.g. /dev/resume not existing).
Therefore, it is best to use a more generic error message.
Also a minor tab->space conversion in the near vacinity of
the real change.
Colin Guthrie [Sat, 31 Dec 2011 13:30:58 +0000 (13:30 +0000)]
resume: Fix failure when invalid device passed via 'resume='
This commit allows the waiting for a device to be cancelled.
When the resume partition does not exist, it becomes quite hard
to work out what to do (you have to either create the
/dev/resume symlink manually, or remove the 'finished' job
that is waiting for it). Additionally dracut incorrectly
displays a message about not being able to find the root
device, which is bogus and misleading.
This commit should just bail on the whole resume thing
if the device cannot be found and proceed with a normal boot.
Colin Guthrie [Mon, 26 Dec 2011 23:03:34 +0000 (23:03 +0000)]
btrfs: Ensure crc32c module is installed.
As outlined here:
https://bugs.mageia.org/show_bug.cgi?id=3214
and:
https://bugs.launchpad.net/ubuntu/+source/linux-linaro-omap/+bug/715835
the btrfs module needs a CRC implementation.
Anssi Hannula [Sat, 3 Dec 2011 11:25:45 +0000 (11:25 +0000)]
plymouth: Include kms modules even if they are not currently loaded.
This should fix initial initrd generation during install.
If the modules are not desired to be used, the nokmsboot kernel
command line should disable them.
Harald Hoyer [Thu, 15 Dec 2011 13:36:37 +0000 (14:36 +0100)]
dracut: add --add-fstab and --mount option
--add-fstab [FILE] Add file to the initramfs fstab
--mount "[DEV] [MP] [FSTYPE] [FSOPTS]"
Mount device [DEV] on mountpoint [MP] with filesystem
[FSTYPE] and options [FSOPTS] in the initramfs