Commit Graph

111 Commits (8f092d0dda5615445b5e22df02c1a80c02b8f206)

Author SHA1 Message Date
Harald Hoyer 593b315c70 dracut-functions.sh: bail out, if $initdir is not set 2012-07-09 10:02:04 +02:00
Harald Hoyer 338b43cd6a fips: add instmods silent check mode "-c -s" 2012-07-05 11:15:42 +02:00
Harald Hoyer 194b80f974 dracut-functions.sh:find_kernel_modules_by_path() fixed hostonly part
filter /sys/module/* modules by path
2012-07-02 22:51:24 +02:00
Harald Hoyer ec61f0a3af dracut-functions.sh: forgot --set-version $kernel for modprobe 2012-07-02 22:14:49 +02:00
Harald Hoyer eaa924b69e dracut-functions.sh: create $initdir, if it does not exist 2012-07-02 18:52:49 +02:00
Harald Hoyer 73575f11a9 dracut-functions.sh,dracut.sh: use xargs with "-r" 2012-07-02 18:52:49 +02:00
Harald Hoyer 0e95d84892 dracut-functions.sh: set LC_ALL=C to get correct parsing information 2012-07-02 18:52:49 +02:00
Harald Hoyer f4031e8a9a move dracut-install to dracutbasedir
We do not want to install dracut-install to /usr/bin until all
interfaces are set to stone and the manpage is written. Until then the
tool is dracut internal.
2012-07-02 18:52:49 +02:00
Harald Hoyer 89d44e720b Use /usr/bin/dracut-install if available
/usr/bin/dracut-install greatly improves initramfs creation speed
2012-06-29 12:54:38 +02:00
Harald Hoyer 7224913d16 dracut-functions.sh: grep for "--relative" for the ln_r() check 2012-06-29 12:54:38 +02:00
Harald Hoyer 70c6b773ca dracut.sh, dracut-functions.sh: add dracut_kernel_post()
dracut_kernel_post() does lazy kernel module dependency installation,
depmod and cleans up temporary files
2012-06-29 12:41:28 +02:00
Harald Hoyer ec1aa3bc48 dracut-functions.sh: error out, if $initdir is not set 2012-06-29 12:41:27 +02:00
Harald Hoyer 92f26b6202 dracut-functions: inst(),inst_binary() fixed inst_symlink call 2012-06-29 12:41:27 +02:00
Harald Hoyer 0c6565c810 dracut-functions.sh:inst_libdir_files() combine installs
first, search for all files, then call dracut_install only once
2012-06-29 12:41:27 +02:00
Harald Hoyer d8aeb3a72a dracut.sh, dracut-functions.sh: do lazy kernel module dep resolving
First, we just install the kernel module and keep track, what we
installed. At the very end, call modprobe and modinfo for firmwares to
resolve all kernel module dependencies. This speeds up image creation,
because we can call modprobe and modinfo with many modules.
2012-06-29 12:41:27 +02:00
Harald Hoyer 744054779f dracut-functions.sh:find_kernel_modules_by_path() use IFS=:
For modules.dep use simpler IFS=: to read the file.
2012-06-29 12:41:25 +02:00
Harald Hoyer b19c5d51f8 dracut-functions.sh:inst_decompress() simplify function 2012-06-29 12:41:25 +02:00
Harald Hoyer 22048b44db dracut-functions.sh:inst_simple() do inst_symlink for symlinks 2012-06-29 12:41:25 +02:00
Harald Hoyer d5b5bb3103 dracut-functions.sh: cp with --reflink=auto and --sparse=auto
cp will use COW data copy most of the time. So, it's even better than
hardlink, because we don't have to care about hardlinks, when modifying
files in post.
2012-06-29 12:41:25 +02:00
Harald Hoyer f8be752874 dracut-functions.sh: mksubdirs(): check for dir existence first 2012-06-29 12:41:25 +02:00
Harald Hoyer 520047c3c4 dracut-functions.sh: replace strstr()
the new strstr() is faster, when compared
2012-06-29 12:41:25 +02:00
Harald Hoyer a20d24ded2 dracut-functions.sh: use "ln -r" instead of shell functions 2012-06-21 01:57:11 +02:00
Harald Hoyer 8d95b8b338 Set some global variables in dracut-functions.sh 2012-06-18 13:26:37 +02:00
Harald Hoyer 7abd426438 fixed instmods() return code and set pipefail globally 2012-06-18 13:26:01 +02:00
Harald Hoyer 7828692f97 dracut-functions.sh: fixup inst_libdir_file() again 2012-06-15 09:34:00 +02:00
Thomas Lange cacaa90c63 Debian multiarch support
Hi Jon,

here's the diff which works for me.  The quotation marks around $@ do
not work for me. Instead of "$@" I must to use $_dir/$@ (or
"$_dir"/$@) but no quotation marks around $@. Could you please review
my patch.
2012-06-15 09:20:01 +02:00
Harald Hoyer fe1484f3db modules are now only handled with /sys/modules and modules.dep
No more "find" and /proc/modules checking. We now rely entirely on
depmod and modules.dep
2012-06-06 18:20:35 +02:00
Harald Hoyer d161561290 make udevdir systemdutildir systemdsystemunitdir global vars
your distribution should ship those settings in
/etc/dracut.conf.d/01-distro.conf

see dracut.conf.d/fedora.conf.example
2012-06-06 15:16:00 +02:00
Juan RP 2cf4f4fb74 Avoid annonying warnings when pkg-config is not installed. 2012-06-06 15:02:00 +02:00
Harald Hoyer 604d1eb21a use pkg-config to determine the udev directory 2012-06-04 12:58:42 +02:00
Cong Wang a6d3be9dd5 check kernel module existance
This patch adds check of kernel module existance and
propagate errors to upper callers.

In case of break other callers of instmods(), this patch
adds an option '-c' to it, only when "-c" is specified
we fail, otherwise, errors are ignored.

Reported-by: Dave Young <dyoung@redhat.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Harald Hoyer <harald@redhat.com>
2012-05-16 11:43:25 +02:00
Harald Hoyer cce69be668 removed old udev "vol_id" 2012-05-07 16:27:48 +02:00
Harald Hoyer eef7649e71 merge "cleanup" and "pre-pivot-cleanup" hooks 2012-04-23 11:32:45 +02:00
Dave Young 2e7257a2e3 add pre-pivot-cleanup hook
Sometimes some hook script will need to be before the cleanup hook scripts
For example dhclient killing, nfs cleanup, etc. must not happen before kdump
because it will use their fuctionalities.

So here introduce a new hook pre-pivot-cleanup, all cleanup scripts will go there.
that means pre-pivot hook is splited to two hooks pre-pivot and pre-pivot-cleanup

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 0e979d4829 dracut-functions.sh:get_fs_env() bail out early
if udevadm found information about a device (DEVPATH set), then bail out
early, if ID_FS_TYPE was not set.
2012-03-30 10:47:35 +02:00
Harald Hoyer 66b750a08e dracut-functions.sh: fix get_fs_env() 2012-03-29 15:20:41 +02:00
Harald Hoyer a5cde2dd18 dracut-functions.sh: removed get_fs_uuid() and get_fs_type()
get_fs_uuid() and get_fs_type() are not used anymore
2012-03-29 14:56:46 +02:00
Harald Hoyer 2f6fe2ec79 dracut-functions.sh: no '' for shell regex 2012-03-29 14:38:45 +02:00
Harald Hoyer e03c77cb5b dracut-functions.sh: proper return get_fs_env() and get_fs_type() 2012-03-29 14:37:41 +02:00
Harald Hoyer 85f8bb16b2 dracut-functions.sh: skip comment lines in fstab 2012-03-28 11:09:46 +02:00
Amadeusz Żołnowski e7da9734d8 inst_symlink: create parent dir if doesn't exist
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.
2012-03-26 13:20:29 +02:00
Will Woods 6e3cc00f48 add initqueue --env and "online" hook
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.
2012-03-08 11:05:29 +01:00
Harald Hoyer 4fed3ddf16 add "initqueue/*" to hookdirs and create them in dracut itsself
now we can just use
    inst_hook initqueue/settled 99 "$moddir/pollcdrom.sh"
2012-03-08 11:00:29 +01:00
Harald Hoyer 6a2c23d125 dracut-functions.sh: check for .kernelmodseen dir, before using it 2012-03-08 11:00:29 +01:00
Harald Hoyer e12c1a8da1 dracut-functions.sh:install_kmod_with_fw() delay .kernelmodseen
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.
2012-03-01 17:45:30 +01:00
Harald Hoyer 379c34d2cf dracut.sh/dracut-functions.sh: use a marker-dir for kernel modules
use "$initdir/.kernelmodseen" to mark kernel modules, which we already
handled with install_kmod_with_fw()
2012-02-25 17:09:15 +01:00
Harald Hoyer 334cc28327 dracut-functions.sh: instmods() print only filename instead of fullpath
do not print the full path, when we use "find" for kernel modules, but
rather only the filename.
2012-02-25 17:09:14 +01:00
Harald Hoyer edea870c3c dracut-functions.sh: instmods() removed special case for "=ata" 2012-02-25 17:09:14 +01:00
Harald Hoyer 86191581d1 dracut-functions.sh: instmods(): replace egrep with shell code 2012-02-25 17:09:14 +01:00
Harald Hoyer 07f3e4f168 dracut-functions.sh: get_fs_env() replaced egrep with shell 2012-02-25 17:09:14 +01:00
Harald Hoyer d18bc9070d dracut-functions.sh: optimize ldd 2012-02-24 14:59:18 +01:00
Harald Hoyer 86bf239ede dracut-functions.sh: only call ldd in find_binary() for "*.so*" 2012-02-24 14:59:18 +01:00
Harald Hoyer 3249c257a0 dracut-functions.sh: optimized
get rid off lots of duplicated checks and code
2012-02-24 14:56:40 +01:00
Harald Hoyer 2efa546f26 dracut-functions.sh:for_each_host_dev_fs() return a value
for_each_host_dev_fs() now returns 0 if one func returned with 0
2012-02-22 19:06:00 +01:00
Harald Hoyer 34248c926c change omit_drivers to support regexp expressions 2012-02-22 16:14:38 +01:00
Harald Hoyer 9cb8447c90 dracut-functions.sh:inst_library(): readlink source dir first
read link of the source dir, before convert_abs_to_rel()
2012-02-22 16:13:20 +01:00
Harald Hoyer cc227886c6 dracut-functions.sh:inst_simple(): no inst_dir if dir exists 2012-02-22 16:13:20 +01:00
Harald Hoyer 6d2a7942aa dracut-functions.sh: set IFS only for variable setting 2012-02-22 16:13:20 +01:00
Harald Hoyer 43dfbeec7b dracut-functions.sh: turn off regexp for strstr() 2012-02-22 16:13:20 +01:00
Harald Hoyer 552ecca6db Renamed all shell scripts to *.sh 2012-02-22 15:15:21 +01:00