If symlink is yet alone in target directory, inst_symlink will fail to
create it. This is how to reproduce the bug:
# mkdir /tmp/test
# ln -s /bin/cp /tmp/test/cp
# ./dracut -l -f -H /tmp/test.img -I /tmp/test/cp
Result:
[...]
I: *** Including modules done ***
ln: failed to create symbolic link
`/var/tmp/initramfs.Z5isVu//tmp/test/cp': No such file or directory
ln: failed to create symbolic link
`/var/tmp/initramfs.Z5isVu//tmp/test/cp': No such file or directory
I: Wrote /tmp/test.img:
[...]
Following patch creates directory for the symlink if it doesn't exist.
The "online" hook runs whenever a network interface comes online (that
is, once it's actually up and configured).
The initqueue --env argument is used to set "$netif" to the name of the
newly-online network interface.
first check for omit, then mark the kernel module as seen
when we temporarily omit_drivers, we don't want to mark them as seen.
example: nfs.ko module in kernel-modules, but the nfs module
should be able to load it later on.
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>
Determine devices and filesystems to be included in the host-only
initramfs image.
To get a minimal initramfs, which can mount
/
/etc
/usr
/usr/bin
/usr/sbin
/usr/lib
/usr/lib64
/boot
we look in fstab for the corresponding devices and determine their and
their slaves' filesystem type and put all that in $host_fs_types
and $host_devs.
inst_script checks for a shebang, if it doesn't exist it exits.
If it does it should not be calling inst_binary, it should call
inst_simple like it used to.
This patch replaces:
- {var}>... redirections with functionally identical eval construct +
explicit FDs
- ^^ and ,, case modifiers with temporary shopt
This allows us to lower minimum required bash version
to at least 3.1 (with current code).
Signed-off-by: Michal Soltys <soltys@ziu.info>
mostly with reference to earlier commit:
- bash doesn't need unsetting locals
- make normalize_path() a bit faster, also make sure we remove all
trailing slashes
- normalize paths before tests
Signed-off-by: Michal Soltys <soltys@ziu.info>
- IFS was not preserved, and modified value could leak to outside functions
- the '.' relative path should be returned for arguments such as /x/y/z
/x/y - but not for $1 == $2 ones
- $1 == $2 is self-looping link, so it returns final component of its
name
Signed-off-by: Michal Soltys <soltys@ziu.info>
Bash shell expands all ${parameter} before evaluating a command.
For multiple declarations and assignments within the same 'local' command,
then new variables or new values that appear towards the left
do not affect parameter expansion towards the right.
--
John Reiser, jreiser@BitWagon.com
>From 507ad6f66fc66f868a9e5fdd3806e012c4022baa Mon Sep 17 00:00:00 2001
From: John Reiser <jreiser@BitWagon.com>
Date: Fri, 23 Sep 2011 07:37:43 -0700
Subject: [PATCH] Parameter expansion occurs before command evaluation.
${parameter} on the right is expanded before evaluating "local var=value"
on the left.