Commit Graph

163 Commits (29b10e65b12988db162b463ebee9c8ced56a7dbb)

Author SHA1 Message Date
Harald Hoyer 29b10e65b1 dracut-functions: make local vars local and prefix with "_" 2011-05-12 11:06:47 +02:00
Michal Soltys 6e43debe67 dracut-functions: remove find_rule()
Not used anymore.

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-05-10 14:46:06 +02:00
Michal Soltys 09a19bb1ba dracut-functions: update inst_binary()
This update adds support for sort-of corner case - when explicitly
specified binary (e.g. through dracut_install or inst) is a library
itself.

In such case, we would expect the binary to undergo typical
library-related handling (symlinks and such).

Apart from that, the patch cleans indenting and a few unused variables
in inst_binary() (probably leftovers from the past ?)

Signed-off-by: Michal Soltys <soltys@ziu.info>
2011-05-10 14:46:06 +02:00
Harald Hoyer 3b403b32fc removed trailing whitespaces 2011-05-10 11:56:09 +02:00
Harald Hoyer e2cdb570ae dracut-functions: only dinfo() about missing firmware files
People are scared about those messages, so only dwarn() if the module
is actually loaded on the system.
2011-05-10 11:31:45 +02:00
Harald Hoyer 4c2a28c64b dracut-functions: ln -s with '-fn' 2011-04-08 10:42:42 +02:00
Harald Hoyer a16ebfd56a dracut-functions: bashified ret=ret+$? to ret+=$? 2011-03-29 11:30:27 +02:00
Amadeusz Żołnowski e27770e10c dracut-functions: logging functions adjusted to dracut-logger 2011-03-25 16:21:32 +01:00
Amadeusz Żołnowski 0b70674329 dracut-functions: code formatting corrected 2011-03-25 16:21:08 +01:00
Harald Hoyer 0874654c78 dracut-functions: try to find dracutbasedir, if not set 2011-03-25 16:10:47 +01:00
Harald Hoyer d6d53f60b2 dracut-functions: use "type" to determine the need of sourcing dracut-logger 2011-03-25 16:10:47 +01:00
Harald Hoyer 0b53ca70b6 Move all hooks to "$hookdir"
hookdir=/lib/dracut/hooks for now, to keep the root directory clean
2011-03-25 16:10:46 +01:00
Harald Hoyer c97e1a76f3 dracut-functions: install udev rules
Install the udev rules to /lib, if the original rule is found there.
2011-03-25 16:10:46 +01:00
Harald Hoyer 94f4923039 mkdir -m 0755
add the missing directory permissions to mkdir
2011-03-25 15:44:00 +01:00
Amadeusz Żołnowski e103615be2 dracut-logger: logging facility module for build- and boot-time
It's dash compatible to be used also at boot-time. For now it's included
by dracut-functions and replaces functions: dinfo(), dwarning() and
derror(). New options are introduced: -L|--stdlog, and -q|--quiet to
control stderr verbosity. Logging to file or syslog may be controlled by
options set in config file.

Note that code is not adjusted to the meaning of the new logging
functions, yet.

Doxygen formatted documentation (as a proposal, by the way) is included
in dracut-logger.
2011-03-15 19:52:59 +01:00
Will Woods fe9cdf741f inst_dir: fix handling of relative symlinks outside the current dir
inst_dir used the following to try to resolve a relative path:
  [[ $target = ${target##*/} ]] && target="${file%/*}/$target"
  inst_dir $target

This will only match if $target has no slashes, so something like
/usr/bin -> ../sbin would result in: inst_dir ../sbin, or
/usr/share -> local/share would result in: inst_dir local/share
which is not going to do the right thing.

Instead, we resolve any non-absolute link, like so:
  [[ $target == ${target#/} ]] && target=$(dirname "$file")/$target
Thus /usr/bin -> ../sbin results in: inst_dir /usr/../sbin, and
/usr/share -> local/share results in: inst_dir /usr/local/share
which is what you would expect.
2011-03-09 12:09:10 +01:00
Harald Hoyer 0b440844bd dracut-functions: fixed instmods() return value
The FIPS installkernel() relies on the instmods() return value. So only
return 0, if the module and its dependencies were actually installed
correctly.
2011-03-07 13:37:18 +01:00
Harald Hoyer 724b87a6f8 dracut-functions: check for missing dracut modules
If the user explicitly specified "-a <modules>" or "-m <modules>",
   warn him about possible missing modules.
2011-03-07 13:37:18 +01:00
Harald Hoyer 5242d8fb57 dracut-functions: if .hmac files are present, install them also
For FIPS mode, we need all checksum files, called .<filename>.hmac. So,
if we find one, we install it.
2011-03-07 13:37:18 +01:00
Harald Hoyer 1a0d82a3dd dracut-functions: space 2011-03-07 13:37:17 +01:00
Harald Hoyer ebaee770ac dracut-functions: more verbose logging message format 2011-03-07 13:37:17 +01:00
Harald Hoyer ee89f47453 dracut-functions: check if directory of logfile is writable
Do not check, if the logfile itsself is writable. Check the directory
instead.
2011-03-07 13:37:11 +01:00
Amadeusz Żołnowski f90fd5b34b dracut-functions: fixed doubled $initdir prefix inst_library()
Commit 172d85b9c9 caused following error:

./dracut-functions: line 307: cd: /tmp/initramfs.mP7cPY/tmp/initramfs.mP7cPY/lib64: No such file or directory

Patch removes beginning $initdir for symlink case.
2011-02-25 10:06:35 +01:00
Jon Ander Hernandez 172d85b9c9 dracut-functions: fixed installing libraries which links to another directory
$ ldd `which bash` | grep ld
/lib64/ld-linux-x86-64.so.2 (0x00007fa1cc3ff000)

$ readlink -f /lib64/ld-linux-x86-64.so.2
/lib/ld-2.12.1.so

So inst_library /lib64/ld-linux-x86-64.so.2 was doing :

(cd "/tmp/initramfs.4uaeD9/lib64" && ln -s "/lib/ld-2.12.1.so"
 "ld-linux-x86-64.so.2")

But, /tmp/initramfs.4uaeD9/lib64 -> /lib... :-S
2011-02-17 10:50:18 +01:00
Harald Hoyer 81c6e7fb69 dracut-functions: handle shared objects in find_binary w/o the exec flag 2011-02-17 10:50:16 +01:00
maximilian attems f63c30d89b dracut: Don't suppress the modprobe error output.
It happens that either due to newer modprobe or missing depmod
module-init-tools cries.
Suppressing the error ensures for a funny debug search for the user.
Resulting initramfs is generally unbootable due to missing module deps.

Better use the quiet option of modprobe itself.
It makes it less chatty, but doesn't suppress "fatal" errors.

Signed-off-by: maximilian attems <max@stro.at>
2011-02-16 15:01:30 +01:00
Harald Hoyer 52889453c1 dracut-functions: write to $HOME/dracut.log instead of /tmp/dracut.log 2011-02-08 17:59:48 +01:00
Harald Hoyer 71df3c4329 renamed module-info.sh to module-setup.sh 2011-02-02 16:35:18 +01:00
Harald Hoyer 95d2dabc25 replaced check,install,installkernel with module-info.sh 2011-02-02 13:56:03 +01:00
Harald Hoyer 51c977d1ff dracut-functions:find_block_device() workaround for btrfs
/proc/self/mountinfo contains the btrfs virtual device major minor.
Determine the real major minor with the device.
2010-10-29 12:34:27 +02:00
Harald Hoyer 11adeb7c01 dracut-functions:inst_symlink() create target dir
if the target directory of the symlink didn't exist, we failed
2010-10-28 17:11:34 +02:00
Harald Hoyer 54b01e99d3 dracut-functions: suppress modinfo errors for hostonly mode 2010-10-27 11:19:27 +02:00
Harald Hoyer 1f9de919e0 dracut-functions: filter_kernel_modules() search in extra dirs
search also in "extra" and "weak-updates" for kernel modules
https://bugzilla.redhat.com/show_bug.cgi?id=622641
2010-09-22 16:19:11 +02:00
Harald Hoyer cc02093d69 reformat source code
removed tabs and set indention to 4 spaces
added emacs and vi format headers
2010-09-10 15:34:36 +02:00
Victor Lowther 3478b3146f Trivial cleanups in dracut-functions
This is a patch series I have been playing with for awhile.

It cleans up some of the dracut code and adds a PKGBUILD file to make
it easier to use in Arch Linux.
2010-08-23 11:51:33 +02:00
Harald Hoyer 7c1796860f dracut: add --fstab, to ignore /proc/self/mountinfo 2010-08-06 13:54:34 +02:00
Harald Hoyer 029f2691f8 dracut-functions: use /proc/self/mountinfo, instead of /proc/mounts
1. it's easier to get the major:minor
2. it's more failsafe in a chroot() (rescue CD case)
2010-08-05 18:59:51 +02:00
Andrey Borzenkov 62f8a2b63c Harden check for used modules in hostonly mode
Make sure that we do not accept module name which is substring of
some other module name. This resulted in piix being mistakenly loaded
together with ata_piix. It completely broke DVD access here.

Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru>
2010-08-04 18:30:02 +02:00
Harald Hoyer 578c24a473 dracut-functions: fixed --omit 2010-08-04 17:46:54 +02:00
Harald Hoyer f007e84e8e dracut-functions: fix check=255 logic and dependencies 2010-08-02 14:17:52 +02:00
Harald Hoyer bb7645459e dracut-functions: fix "-m -a" handling 2010-07-27 11:51:27 +02:00
Amadeusz Żołnowski a10a1416c1 dracut-functions: additional symlinks for library files
rev_lib_symlinks: it's new
inst_library: creating additional symlinks for installed library files
2010-07-21 13:38:46 +02:00
Amadeusz Żołnowski fd2312e03d dracut-functions: cosmetic changes to inst_rules 2010-07-06 10:19:02 +02:00
Amadeusz Żołnowski 5f70a1bd06 dracut-functions: info which udev rules are skipped
I found it useful.  Maybe help others debugging.
2010-07-06 10:19:01 +02:00
Amadeusz Żołnowski 87122afcda add module i18n
dracut-functions: added functions: mksubdirs, inst_decompress,
                  inst_opt_decompress and print_vars

dracut.conf.d: added configuration files for Gentoo and RedHat/Fedora
2010-07-06 10:18:30 +02:00
Harald Hoyer 45b5a4e142 dracut-functions: use LC_ALL=C rather than LANG=C 2010-06-22 11:59:49 +02:00
Harald Hoyer e4ebd474ec dracut-functions: set LANG=C for ldd output parsing 2010-06-22 10:32:25 +02:00
Amadeusz Żołnowski 22ecea456b dracut, dracut-functions: better vercmp
credits go to V. Lowther
2010-06-17 09:43:16 +02:00
Amadeusz Żołnowski 2c24ee9a72 dracut-functions: fun. vercmp optimized; credits go to Victor Lowther 2010-06-09 17:36:02 +02:00
Amadeusz Żołnowski ecf42850c3 Support old version of module-init-tools
modprobe included in version prior to 3.7 of module-init-tools doesn't
have -d | --dirname option which allows to give a prefix other than
'/' for kernel modules path. Dracut assumes existence of that
option and uses it even with default '/'. The patch passes -d option
only if it's different from default and also checks module-init-tools
version if user changes the prefix by --kmoddir Dracut option.
2010-06-09 10:46:38 +02:00