Add "rebuild" option to dracut to append the current arguments
to those with which the input initramfs image was built. This
option helps in incrementally building initramfs for testing.
Usage: dracut [output_file] --rebuild input_file
If optional output file is not provided, input file provided to
rebuild will be used as output file.
This patch alters the creation of the initramfs image by adding
the file "/tmp/params.txt" to the image. Command line parameters
excluding "--rebuild", input & output image names and "kernel
version" are stored in this file. In case "--rebuild" parameter
is specified, "/tmp/params.txt" file, if present in input image,
is read and its contents "prepend"ed to the current command line
parameters, that is if such a file is already present. Also, it
stores the cumulative parameters to the file "/tmp/params.txt",
in the new image. This patch has been tested successfully on a
PowerBox with f19. It does not alter the behaviour of any of the
existing options.
Signed-off-by: Manik Bajpai <manibajp@linux.vnet.ibm.com>
Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
[Edited-by: Harald Hoyer]
Simplified the cpio extraction process by using 'lsinitrd'.
If a non-default device mapper name is used for an encrypted partion is
used, (i.e. not luks-$UUID) due to parsing of /etc/crypttab, then the
short-circuits put in place to prevent asking the password twice do not
work.
This would not normally be an issue as the settled job itself should be
removed after it has run and thus cannot be run again. Sadly, due to
the corresponding udev rule using ACTION="add|changed", and the fact
that trying to unlock the device (whether successful or not) seems to
trigger a changed event, it means the settled job is recreated with
each itteration thus causing the whole loop to run again.
It is this situation that the short-circuit exits would normally come
into play but sadly do not work when non-standard names are used.
By the time the /tmp/cryptroot-asked-$2 file is written near the end of
the script, the value of $2 has already been lost due to the argument
parsing code's use of 'shift'. So while on systems where the default
name is used are protected by checking /dev/mapper/xxxx, the
/tmp/cryptroot-asked-$2 file didn't help on systems where this was not
used due to this bug.
So this commit shuffles things around somewhat such that:
1. The /dev/mapper/xxxx device is checked *after* resolving $2 (which
contains the default name) to whatever /etc/crypttab specifies.
2. The cryptroot-asked-xxxx file also uses the translated name both
for the initial check and to flag when it's written.
As a separate fix, it might make sense to change the udev rule to only
act on add events rather than add|change events, but I'm not sure of the
ramifications of such a change and there may be cases where the add
event is missed and thus the change event needs to be included.
Dracut claims to have LZ4 support, but trying to use it will result in an xzcat failure at the end due to missing CAT support.
The lz4 command chokes on '--', so abstract that out into the CAT select.
Something similar will need to be done for LZO.
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
This removes the dependency on 'getconf' as well, which is not installed by default on my embedded systems.
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Systemd tries to load this modules very early.
Even though they are not strictly required it it is a good
thing to have them around.
[Edited-by: Harald Hoyer: moved to installkernel() ]
dracut-install could not handle output like:
/lib/$LIB/liblsp.so => /lib/lib64/liblsp.so (0x00007faf00727000)
also unset LD_PRELOAD, so we get a clean environment
if i18n_install_all is set to "yes", then install all keyboard layouts
and fonts regardless of the hostonly setting.
This way, people can switch keyboard layouts, without having to recreate
the initramfs.