[arch-projects] [mkinitcpio][PATCH 00/19] Break all the things!
Hi all, What follows this is the changes I have in store for the next release, which I'll be tagging 0.9.0. There's one change not included, but I'll explain what that is. I realize this patchset is huge, and I don't expect anyone to look through it in its entirety. However, there's two things worth pointing out here that I'd appreciate some feedback on: * Changes to install hook API I've added some new functions: - add_checked_modules - add_all_modules - add_runscript These are intended to replace all_modules and checked_modules, which currently return the list of modules that the caller should add. The new functions simply go ahead and queue the modules for addition rather than making the caller do something with them. add_runscript does some introspection to figure out which hook called it and add the appropriate script from /usr/lib/initcpio/hooks. The general idea here is that we're getting rid of using MODULES, FILES, BINARIES, and SCRIPT in the install hooks and we'll be down to a singular method of adding files to the image. With the refactored error parsing, mkinitcpio can properly detect errors from any add_* function, which should improve the experience a bit. Consider the next release the deprecation warning, though I'm not sure when I'll remove things. I've made sure that current hooks continue to work in the same way. There's no explicit callout during runtime about these things being deprecated, but maybe there should be? I'll plan on fixing all the hooks in the repos myself. Since this is new API, I'd like to get it right the first time. If anyone sees anything lacking, room for improvement, or wants to send me death threats, feel free. * Support for late running hooks I've refactored running hooks in early userspace and we now support a second run after root has been mounted. To make things simple, current hook files only need to define an extra function run_latehook() to be considered. Hooks run in reverse order from the normal run. lsinitcpio of course gains support for reading these. We already have some obvious candidates to use this feature: udev and shutdown. udev startup/shutdown no longer needs to be hardcoded in /init, and shutdown can delete modules before copying / over to /run/initramfs, saving some modicum of space in tmpfs. I'm also tempted to move mounting of /usr to a late running hook, but I'm sure that we'll see some breakage by doing this, even with proper warnings. Opinions here welcome. The final unlisted change is what I referred to earlier about udev. Since the udev hook would be handling its own startup/shutdown, we'd simply yank those if blocks out of /init and carry on. I've been testing this and it works quite well. Random feedback and tomatoes unrelated to the above points are welcome, as always. Cheers, d Dave Reisner (19): use MODULEDIR as reference for *.(order|builtin) files mkinitcpio: separate logic to resolve kernel version document special kernel cmdline parameters refactor error tracking in build hooks mmc: package as mode 644, not 755 functions: remove get_dirname and get_basename functions: move --try logic into add_module move -g option checking to parseopts loop functions: introduce add_checked_modules and add_all_modules functions: introduce add_runscript use new API for install hooks init: correct trimming of earlymodules and MODULES init_functions: move running hooks to separate func init: add support for late running hooks shutdown: package as 644, install as 755 shutdown: convert to late hook buildsys: fix clean target lsinitcpio: extract the image to a tempdir lsinitcpio: add support for listing late hooks Makefile | 2 +- functions | 125 +++++++++++++++++++++++++++++++++++++-------------- hooks/shutdown | 3 +- init | 26 +++-------- init_functions | 27 +++++++++++ install/consolefont | 6 +-- install/filesystems | 4 +- install/fsck | 4 ++ install/fw | 8 +++- install/ide | 4 +- install/keymap | 4 +- install/memdisk | 9 ++-- install/mmc | 7 ++- install/pata | 6 ++- install/resume | 2 +- install/sata | 6 ++- install/scsi | 9 ++-- install/shutdown | 7 +-- install/sleep | 2 +- install/usb | 12 +++-- install/usbinput | 5 ++- install/virtio | 2 +- lsinitcpio | 70 +++++++++++++++++++++-------- mkinitcpio | 59 ++++++++++++++---------- mkinitcpio.8.txt | 51 +++++++++++++++++++++ 25 files changed, 317 insertions(+), 143 deletions(-) mode change 100755 => 100644 install/mmc mode change 100755 => 100644 shutdown -- 1.7.10.2
--- mkinitcpio | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkinitcpio b/mkinitcpio index 9a74a8b..4fb48e4 100755 --- a/mkinitcpio +++ b/mkinitcpio @@ -400,7 +400,7 @@ if (( ${#ADDED_MODULES[*]} )); then msg "Generating module dependencies" install -m644 -t "$BUILDROOT/usr/lib/modules/$KERNELVERSION" \ - "/lib/modules/$KERNELVERSION"/modules.{builtin,order} + "$MODULEDIR"/modules.{builtin,order} depmod -b "$BUILDROOT" "$KERNELVERSION" # remove all non-binary module.* files (except devname for on-demand module loading) -- 1.7.10.2
Rename get_kernelver -> resolve_kernelver, and ensure that it only does
what it's name advertises. Introduce find_moduledir to locate the
corresponding module directory in /usr/lib or /lib.
Signed-off-by: Dave Reisner
Signed-off-by: Dave Reisner
On Sun, May 13, 2012 at 1:57 PM, Dave Reisner
Signed-off-by: Dave Reisner
--- install/fsck | 4 ++++ mkinitcpio.8.txt | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/install/fsck b/install/fsck index e8b5ea3..eefd451 100644 --- a/install/fsck +++ b/install/fsck @@ -41,6 +41,10 @@ operation on the root device prior to mounting. If the autodetect hook is used, only the fsck helper specific to your filesystem will be added to the image. It is highly recommended that if you include this hook that you also include any necessary modules to ensure your keyboard will work in early userspace. + +To control the behavior of fsck on bootup, fsck.mode=force can be passed on +the kernel command line to insist on running a full filesystem check. Similar,y
Minor typo. Should be "Similarly".
+fsck.mode=skip can be passed to cause fsck not to run at all. HELPEOF }
diff --git a/mkinitcpio.8.txt b/mkinitcpio.8.txt index f947514..070cfeb 100644 --- a/mkinitcpio.8.txt +++ b/mkinitcpio.8.txt @@ -98,6 +98,57 @@ you generate a new initial ramdisk, you define a preset and use the -p switch to generate an initial ramdisk according to your preset. Presets are located in /etc/mkinitcpio.d
+Early Init Environment +---------------------- +mkinitcpio gives special treatment to certain environment variables passed on +the kernel command line: + +*break*['=
']:: + If specified, mkinitcpio will start a shell during early init. The optional + parameter controls when this occurs: when 'premount' or no parameter are + specified, the shell will be launched prior to mounting root. If 'postmount' + is specified, the shell will be launched after mounting root. + +*disablehooks=*'hooklist':: + This is a comma separated list of hooks which will be skipped during early + init. + +*earlymodules=*'modulelist':: + This is a comma separated list of modules which will be loaded prior to any + others. This is generally not needed, and usually points to a configuration + or kernel problem. + +*quiet*:: + Causes mkinitcpio to output fewer messages during boot. Errors will not be + suppressed. + +*ro*:: + Specifies that root should be mounted with readonly permissions. This is the + default behavior. + +*rw*:: + Specifies that root should be mounted with readwrite permissions. This is + generally only useful if your initramfs uses the 'fsck' hook. + +*root=*'rootdevice':: + This variable describes the root partition which early init will mount + before passing control to the real init. mkinitcpio understands a variety of + formats, the most basic of which is the path to the block device, either + directly, such as '/dev/sda2', or using a udev symlink such as + '/dev/disk/by-label/CorsairF80-root'. Support for identification by LABEL or + UUID tags are also supported, such as, 'LABEL=CorsairF80-root'. As of + util-linux 2.22, PARTUUID is also supported. Identification via hex encoded + major/minor device ID is supported for legacy reasons, but should not be used. + +*rootdelay=*'seconds':: + Sets the delay, in seconds, that mkinitcpio is willing to wait for the root + device to show up, if it is not available immediately. This defaults to 5 + seconds. If an invalid integer is passed, this variable will have no effect. + +These are only the variables that the core of mkinitcpio honor. Additional +hooks may look for other environment variables and should be documented by the +help output for the hook. + Files ----- '/etc/mkinitcpio.conf':: -- 1.7.10.2
On Mon, May 14, 2012 at 12:18:23PM -0400, canyonknight@gmail.com wrote:
On Sun, May 13, 2012 at 1:57 PM, Dave Reisner
wrote: Signed-off-by: Dave Reisner
--- install/fsck | 4 ++++ mkinitcpio.8.txt | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/install/fsck b/install/fsck index e8b5ea3..eefd451 100644 --- a/install/fsck +++ b/install/fsck @@ -41,6 +41,10 @@ operation on the root device prior to mounting. If the autodetect hook is used, only the fsck helper specific to your filesystem will be added to the image. It is highly recommended that if you include this hook that you also include any necessary modules to ensure your keyboard will work in early userspace. + +To control the behavior of fsck on bootup, fsck.mode=force can be passed on +the kernel command line to insist on running a full filesystem check. Similar,y
Minor typo. Should be "Similarly".
Thanks for the catch. Fixed up on my working branch. d
Rather than catching errors solely from parse_hook via an ERR trap,
implement a RETURN trap which catches all errors from the core add_*
functions.
In the future, this may mean that support for MODULES/FILES/BINARIES
within hooks goes away, and those variables remain only in the config.
Signed-off-by: Dave Reisner
Signed-off-by: Dave Reisner
A lot has changed since 643e98eeb42677 when these functions were
implemented, and there is exactly 1 case of get_dirname left, and no
calls to get_basename. Remove these, and use a PE in place of the
remaining call.
Signed-off-by: Dave Reisner
Allow add_module to detect trailing ? characters for ignoring errors
rather than passing -t or --try to add_module.
Signed-off-by: Dave Reisner
Avoid any delay in checking this option, as it only serves to fragment
the logic.
Signed-off-by: Dave Reisner
Instead of returning a list of modules which the caller should then add
themselves or stuff into the MODULES string, call add_module for each
candidate. This is basically a different wrapper around all_modules.
DEPRECATION WARNING: This commit marks checked_modules as deprecated.
Although it is not slated to go away, direct usage of all_modules is
strongly discouraged.
Signed-off-by: Dave Reisner
This function adds a runtime script to the /hooks directory on the
initramfs image. Note that this function will also install hooks with
executable permissions for use by a later change to early init.
With this commit, there are now methods available which can be used in
place of the MODULES, FILES, BINARIES, and SCRIPT variables, as we now
offer error checking on the add_* functions. Usage of the variables is
deprecated, and these will no longer be read in a future version of
mkinitcpio.
Signed-off-by: Dave Reisner
Signed-off-by: Dave Reisner
This never worked properly and only "fixed" the stupid bug that found
an edge case when either of these vars contains nothing more than a
single space.
Signed-off-by: Dave Reisner
Abstract this out to the init_functions file, and allow this function
take 2+ parameters -- the hook name to be run, a user friendly short
description, and then the list of hook files to source from. While we're
at it, take advantage of the fact that hooks are now installed with
executable perms. If a hook isn't marked excutable, we skip it, thereby
removing our eval hack.
Signed-off-by: Dave Reisner
This adds support for a second round of hooks during early userspace.
Users can define a 'run_latehook' in their hook script similar to the
declaration of 'run_hook' which continues to run at the same point in
execution. Scripts are executed after mounting root in reverse order of
how they're clared in mkinitcpio'c config. These late running hooks
should take care of things such as:
- mounting other partitions
- moving config to the real root (mostly for liveCDs)
- shutting down previously started daemons
Signed-off-by: Dave Reisner
There's no need to keep this mildly dangerous script executable on the
filesystem.
Signed-off-by: Dave Reisner
Run this later in early init where we can delete the modules from the
ramfs before copying the image over to /run/initramfs.
Signed-off-by: Dave Reisner
We don't ship compressed manpages, and this never touched lsinitcpio's
generated page.
Signed-off-by: Dave Reisner
We read the image a number of times. Extract the image to a temp
directory so we can just extract it once and use the filesystem to our
advantage. This requires a temp dir which we can nuke on an EXIT trap,
but the whole operation is sped is a bit, especially for larger images.
The real goal of this is to make examination of the hooks easier. Since
we now have multiple hook sets to contend with, dynamically tally up the
available functions in the hook files so we can iterate over specific
functions of interest in the output.
Signed-off-by: Dave Reisner
On Sun, May 13, 2012 at 12:57 PM, Dave Reisner
We read the image a number of times. Extract the image to a temp directory so we can just extract it once and use the filesystem to our advantage. This requires a temp dir which we can nuke on an EXIT trap, but the whole operation is sped is a bit, especially for larger images.
The real goal of this is to make examination of the hooks easier. Since we now have multiple hook sets to contend with, dynamically tally up the available functions in the hook files so we can iterate over specific functions of interest in the output.
Signed-off-by: Dave Reisner
---
You missed one: TIMEFORMAT=%R decomptime=$({ time decomp "$image" >/dev/null; } 2>&1 ) This is guarded by a 'if compressed' block now, but it is probably useful even if you are using an uncompressed tar image- there is still work being done in reading and breaking the individual files out of the tarfile.
lsinitcpio | 59 +++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 41 insertions(+), 18 deletions(-)
diff --git a/lsinitcpio b/lsinitcpio index 5abe37f..f33d9d3 100755 --- a/lsinitcpio +++ b/lsinitcpio @@ -59,7 +59,6 @@ size_to_human() { }' }
- OPT_SHORT='ahnvx' OPT_LONG=('analyze' 'help' 'nocolor' 'verbose' 'extract')
@@ -127,6 +126,9 @@ if (( analyze )); then declare -a binaries explicitmod modules foundhooks hooks declare kernver ratio columns=$(tput cols)
+ workdir=$(mktemp -d --tmpdir="$TMPDIR" lsinitcpio.XXXXXX) + trap 'rm -rf "$workdir"' EXIT + # fallback in case tput failed us columns=${columns:-80}
@@ -139,27 +141,48 @@ if (( analyze )); then ratio=.$(( zsize * 1000 / fullsize % 1000 )) fi
- # read contents of image - while read -r line; do - if [[ $line = *.ko?(.?z) ]]; then - line=${line##*/} - modules+=("${line%.ko?(.?z)}") - elif [[ -z $kernver && $line =~ /lib/modules/([^/]+)/ ]]; then - kernver=${BASH_REMATCH[1]} - elif [[ $line = ./hooks/* ]]; then - foundhooks+=("${line##*/}") - elif [[ $line = *@(/?(s)bin/)* ]]; then - binaries+=("${line##*/}") - fi - done < <(decomp "$image" | bsdtar tf -) - - read -r version < <(decomp "$image" | bsdtar xOf - VERSION 2>/dev/null) + # decompress the image since we need to read from it multiple times + decomp "$image" | bsdtar -C "$workdir" -xf - + + # collect stats + kernver=("$workdir"/usr/lib/modules/*/) + kernver=${kernver%/} + kernver=${kernver##*/} + + modules=("$workdir/usr/lib/modules/$kernver"/kernel/*.ko*) + modules=("${modules[@]##*/}") + modules=("${modules[@]%.ko*}") + + foundhooks=("$workdir"/hooks/*) + foundhooks=("${foundhooks[@]##*/}") + + binaries=("$workdir"/usr/bin/*) + binaries=("${binaries[@]##*/}") + + read -r version < "$workdir/VERSION"
# source and read config - . <(decomp "$image" | bsdtar xOf - config) + . "$workdir/config" + explicitmod=($MODULES) + for hook in $HOOKS; do - in_array "$hook" "${foundhooks[@]}" && hooks+=("$hook") + [[ -e $workdir/hooks/$hook ]] || continue + + mapfile -t funcs < \ + <(awk ' + /^[[:space:]]*[[:alnum:]_]+/ && /\([[:space:]]*\)/ { + match($1, /[[:alnum:]_]+/) + print substr($1, RSTART, RLENGTH) + }' "$workdir/hooks/$hook") + + for fn in "${funcs[@]}"; do + case $fn in + run_hook) + hooks+=("$hook") + ;; + esac + done done
# print results -- 1.7.10.2
On Sun, May 13, 2012 at 01:39:35PM -0500, Dan McGee wrote:
On Sun, May 13, 2012 at 12:57 PM, Dave Reisner
wrote: We read the image a number of times. Extract the image to a temp directory so we can just extract it once and use the filesystem to our advantage. This requires a temp dir which we can nuke on an EXIT trap, but the whole operation is sped is a bit, especially for larger images.
The real goal of this is to make examination of the hooks easier. Since we now have multiple hook sets to contend with, dynamically tally up the available functions in the hook files so we can iterate over specific functions of interest in the output.
Signed-off-by: Dave Reisner
--- You missed one: TIMEFORMAT=%R decomptime=$({ time decomp "$image" >/dev/null; } 2>&1 )
This is guarded by a 'if compressed' block now, but it is probably useful even if you are using an uncompressed tar image- there is still work being done in reading and breaking the individual files out of the tarfile.
Sure, we can placate the few weirdos who don't compress their images at all. This patch was more interested in getting rid of the archive reads for: scanning binaries/modules/hooks + extracting the config + extracting the version file. Added locally as a separate patch.
lsinitcpio | 59 +++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 41 insertions(+), 18 deletions(-)
diff --git a/lsinitcpio b/lsinitcpio index 5abe37f..f33d9d3 100755 --- a/lsinitcpio +++ b/lsinitcpio @@ -59,7 +59,6 @@ size_to_human() { }' }
- OPT_SHORT='ahnvx' OPT_LONG=('analyze' 'help' 'nocolor' 'verbose' 'extract')
@@ -127,6 +126,9 @@ if (( analyze )); then declare -a binaries explicitmod modules foundhooks hooks declare kernver ratio columns=$(tput cols)
+ workdir=$(mktemp -d --tmpdir="$TMPDIR" lsinitcpio.XXXXXX) + trap 'rm -rf "$workdir"' EXIT + # fallback in case tput failed us columns=${columns:-80}
@@ -139,27 +141,48 @@ if (( analyze )); then ratio=.$(( zsize * 1000 / fullsize % 1000 )) fi
- # read contents of image - while read -r line; do - if [[ $line = *.ko?(.?z) ]]; then - line=${line##*/} - modules+=("${line%.ko?(.?z)}") - elif [[ -z $kernver && $line =~ /lib/modules/([^/]+)/ ]]; then - kernver=${BASH_REMATCH[1]} - elif [[ $line = ./hooks/* ]]; then - foundhooks+=("${line##*/}") - elif [[ $line = *@(/?(s)bin/)* ]]; then - binaries+=("${line##*/}") - fi - done < <(decomp "$image" | bsdtar tf -) - - read -r version < <(decomp "$image" | bsdtar xOf - VERSION 2>/dev/null) + # decompress the image since we need to read from it multiple times + decomp "$image" | bsdtar -C "$workdir" -xf - + + # collect stats + kernver=("$workdir"/usr/lib/modules/*/) + kernver=${kernver%/} + kernver=${kernver##*/} + + modules=("$workdir/usr/lib/modules/$kernver"/kernel/*.ko*) + modules=("${modules[@]##*/}") + modules=("${modules[@]%.ko*}") + + foundhooks=("$workdir"/hooks/*) + foundhooks=("${foundhooks[@]##*/}") + + binaries=("$workdir"/usr/bin/*) + binaries=("${binaries[@]##*/}") + + read -r version < "$workdir/VERSION"
# source and read config - . <(decomp "$image" | bsdtar xOf - config) + . "$workdir/config" + explicitmod=($MODULES) + for hook in $HOOKS; do - in_array "$hook" "${foundhooks[@]}" && hooks+=("$hook") + [[ -e $workdir/hooks/$hook ]] || continue + + mapfile -t funcs < \ + <(awk ' + /^[[:space:]]*[[:alnum:]_]+/ && /\([[:space:]]*\)/ { + match($1, /[[:alnum:]_]+/) + print substr($1, RSTART, RLENGTH) + }' "$workdir/hooks/$hook") + + for fn in "${funcs[@]}"; do + case $fn in + run_hook) + hooks+=("$hook") + ;; + esac + done done
# print results -- 1.7.10.2
The previous patch makes this quite simple, and we can easily catch
instances of run_latehook() for printing in the output.
Signed-off-by: Dave Reisner
Am 13.05.2012 19:57, schrieb Dave Reisner:
The final unlisted change is what I referred to earlier about udev. Since the udev hook would be handling its own startup/shutdown, we'd simply yank those if blocks out of /init and carry on. I've been testing this and it works quite well.
I haven't looked through your patchset yet, but here is the bad part about udev: In the past, udev needed to run before the modules listed in MODULES= from mkinitcpio.conf were loaded. Otherwise, firmware loading would fail, and almost everyone with MODULES="radeon" would be very unhappy! I know that some things have changed regarding firmware loading since then, but this is likely still an issue in some form - and even if it isn't, it is a good idea to have a firmware helper present before doing anything.
On Mon, May 14, 2012 at 10:37:38AM +0200, Thomas Bächler wrote:
Am 13.05.2012 19:57, schrieb Dave Reisner:
The final unlisted change is what I referred to earlier about udev. Since the udev hook would be handling its own startup/shutdown, we'd simply yank those if blocks out of /init and carry on. I've been testing this and it works quite well.
I haven't looked through your patchset yet, but here is the bad part about udev:
In the past, udev needed to run before the modules listed in MODULES= from mkinitcpio.conf were loaded. Otherwise, firmware loading would fail, and almost everyone with MODULES="radeon" would be very unhappy! I know that some things have changed regarding firmware loading since then, but this is likely still an issue in some form - and even if it isn't, it is a good idea to have a firmware helper present before doing anything.
Excellent point -- was curious about this myself. I asked Kay about it: 08:50 kay » it will be catched with the coldplug run, yes 08:50 kay » but if udev runs in intramfs, and there is no firmware file, the request will be canceled 08:51 falconindy » yeah, this is initramfs 08:51 falconindy » so settle will play catchup and things will just work (hopefully) 08:57 kay » settle? 08:57 kay » trigger will 08:58 falconindy » even better 08:58 kay » but if udev from initramfs still runs and there is no firmware file, all is discarded So it seems to me that we're covered here since we assume that the firmware is present (or else its a bug in mkinitcpio). I'd like to get someone with perhaps a radeon to confirm this via my working branch and a modified udev hook (I can provide this), but I guess the worst case scenario is that we file a bug. d
Am 14.05.2012 15:50, schrieb Dave Reisner:
In the past, udev needed to run before the modules listed in MODULES= from mkinitcpio.conf were loaded. Otherwise, firmware loading would fail, and almost everyone with MODULES="radeon" would be very unhappy! I know that some things have changed regarding firmware loading since then, but this is likely still an issue in some form - and even if it isn't, it is a good idea to have a firmware helper present before doing anything.
Excellent point -- was curious about this myself. I asked Kay about it:
08:50 kay » it will be catched with the coldplug run, yes 08:50 kay » but if udev runs in intramfs, and there is no firmware file, the request will be canceled
That should be taken care of.
08:51 falconindy » yeah, this is initramfs 08:51 falconindy » so settle will play catchup and things will just work (hopefully) 08:57 kay » settle? 08:57 kay » trigger will 08:58 falconindy » even better 08:58 kay » but if udev from initramfs still runs and there is no firmware file, all is discarded
So it seems to me that we're covered here since we assume that the firmware is present (or else its a bug in mkinitcpio). I'd like to get someone with perhaps a radeon to confirm this via my working branch and a modified udev hook (I can provide this), but I guess the worst case scenario is that we file a bug.
Back in the day (haha), udev still worked with modules waiting for firmware in module_init. But running 'modprobe foobar; udevd --daemon' would wait for the timeout and start udev afterwards. Starting udev before module loading is safe and also works with old versions. If these bugs are all fixed, then Kay is of course correct.
On Mon, May 14, 2012 at 04:04:24PM +0200, Thomas Bächler wrote:
Am 14.05.2012 15:50, schrieb Dave Reisner:
In the past, udev needed to run before the modules listed in MODULES= from mkinitcpio.conf were loaded. Otherwise, firmware loading would fail, and almost everyone with MODULES="radeon" would be very unhappy! I know that some things have changed regarding firmware loading since then, but this is likely still an issue in some form - and even if it isn't, it is a good idea to have a firmware helper present before doing anything.
Excellent point -- was curious about this myself. I asked Kay about it:
08:50 kay » it will be catched with the coldplug run, yes 08:50 kay » but if udev runs in intramfs, and there is no firmware file, the request will be canceled
That should be taken care of.
08:51 falconindy » yeah, this is initramfs 08:51 falconindy » so settle will play catchup and things will just work (hopefully) 08:57 kay » settle? 08:57 kay » trigger will 08:58 falconindy » even better 08:58 kay » but if udev from initramfs still runs and there is no firmware file, all is discarded
So it seems to me that we're covered here since we assume that the firmware is present (or else its a bug in mkinitcpio). I'd like to get someone with perhaps a radeon to confirm this via my working branch and a modified udev hook (I can provide this), but I guess the worst case scenario is that we file a bug.
Back in the day (haha), udev still worked with modules waiting for firmware in module_init. But running 'modprobe foobar; udevd --daemon' would wait for the timeout and start udev afterwards.
Hmmm, so this problem would be visible via the same broken modules that cropped up when udev removed the timeout handling (mostly wifi drivers). I've got a user testing this for me and reporting that radeon doesn't work properly. Even though the driver looks like it does an async firmware request, it blocks for 60 seconds before timing out and saying failed to load firmware (even though the provided path exists).
Starting udev before module loading is safe and also works with old versions. If these bugs are all fixed, then Kay is of course correct.
I'm more inclined to think that this is module specific than udev specific. Either way, probably best to leave the udev startup where it is and just move out the cleanup. Boooo. d
Am 14.05.2012 17:59, schrieb Dave Reisner:
I'm more inclined to think that this is module specific than udev specific. Either way, probably best to leave the udev startup where it is and just move out the cleanup. Boooo.
Have it your way and introduce early hooks.
On Mon, May 14, 2012 at 06:19:11PM +0200, Thomas Bächler wrote:
Am 14.05.2012 17:59, schrieb Dave Reisner:
I'm more inclined to think that this is module specific than udev specific. Either way, probably best to leave the udev startup where it is and just move out the cleanup. Boooo.
Have it your way and introduce early hooks.
I thought about that briefly, and can't see a use for it beyond starting udev. It's low overhead, but I'm not convinced there's enough need for it. Maybe someone can prove me wrong. d
On Mon, May 14, 2012 at 12:27:11PM -0400, Dave Reisner wrote:
On Mon, May 14, 2012 at 06:19:11PM +0200, Thomas Bächler wrote:
Am 14.05.2012 17:59, schrieb Dave Reisner:
I'm more inclined to think that this is module specific than udev specific. Either way, probably best to leave the udev startup where it is and just move out the cleanup. Boooo.
Have it your way and introduce early hooks.
I thought about that briefly, and can't see a use for it beyond starting udev. It's low overhead, but I'm not convinced there's enough need for it.
Maybe someone can prove me wrong.
d
So, I'm going back on this and implementing early hooks anyways. I'm going to take some time to see if I can optimize this at all so that we can avoid rereading the same N files 4 times. Same user who reported the radeon fail confirmed that udev as an early hook works well with loading radeon in early userspace, but I guess we knew already that it would work. d
participants (5)
-
canyonknight@gmail.com
-
Dan McGee
-
Dave Reisner
-
Dave Reisner
-
Thomas Bächler