Age | Commit message (Collapse) | Author | Files | Lines |
|
Using --tab-file for findmnt calls is redundant if we can rely on the
defaults. Sanitize the environment from any LIBMOUNT_* variables so
that we can be sure of what file we're reading.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Doing this oddly results in findmnt never stat(2)'ing the target
directory, which might be problematic with stale NFS mounts and maybe
autofs.
Fixes FS#36629, I suppose.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
This is needed for the --recursive flag.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Linux 3.9 adds a filesystem alias in the supporting module in the form
of fs-$filesystem. While this is mainly aimed at security/paranoia, it
does mean that we can make better use of the fact that we always resolve
filesystem as aliases to filesystem modules. Do an additional lookup in
add_if_avail to resolve the new alias in addition to the filesystem
name itself.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Some of these modules have modaliases which can be picked up by
whitelisting.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Make the hook a bit more generic by including non-usb keyboard drivers.
This should mean that any keyboard will now work in the initramfs.
In addition to fixing some uncommon setups requiring additional keyboard
modules, this would allow us to no longer build in the atkbd module (and
hence i8042) in our stock kernels, which will remove an ugly error message
on boot for systems without the i8042 controller.
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
Broken by ac8499c08279b05d.
FS#32935.
https://bbs.archlinux.org/viewtopic.php?id=153982
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Add this as a default in the config file.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
As the autodetect hook gets better with every kernel release, we can
"afford" to remove the needless segregation of block device driver hooks
and simply merge all the "vanilla" or "unstacked" block device drivers.
This should make a lot of setups, like usb or virtio, easier as you
won't need to remember to add the hook.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
This is a partial "revert" of 822a88700e since kernels as of 3.5 add
module aliases for hid devices.
Fixes FS#32575.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
If mkinitcpio -s is run, we still flush this cache to disk before
exiting.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
This is an ugly patch, and probably does more than I'd like it to. The
idea is that mkinitcpio adopts some sort of consistent style which I'm
actually happy with. I define 3 kinds of variables:
1) local variables: all lower case, and scoped within functions. Use
freely, as they're well contained.
2) global variables: these are known to mkinitcpio internally, but are
global in scope. They mainly carry runtime configuration and collected
data during the image generation process. These are always lower case,
but carry a leading underscore to denote that they're global.
3) "API" variables: also global in scope, but exist "outside" of
mkinitcpio -- either drawn in from the configuration file, or "exported"
to the install hooks. These are always all upper case. When introducing
new variables, extreme care must be taken to pick names that will not
conflict with the environment inherited by mkinitcpio.
A HACKING file is introduced with a similar description of the above,
and more.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
This hasn't provided actual directories in a while. Reword it to point
out that it's only providing the critical scripts and binaries for
booting.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
These are low level enough that they should be part of the base layout,
similar to the filesystem package in userspace. Later hooks can easily
override these, if they really want to.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
This might be useful for creating an initramfs image as part of a kernel
package.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
mkinitcpio needs to be able to more tightly control the layout of the
image. By moving this outside the control of the base hook, it's more
reasonable to believe that a drop-in replacement for the base hook could
be written, as it now only contains the utilities required for the /init
that it provides.
Being that initialize_buildroot is outside of a hook, we can make "raw"
calls to coreutils that create the directories and symlinks, saving some
overhead and forking.
This also symlinks /usr/local/{lib,bin} into the common /usr/lib and
/usr/bin, respectively, so that there's always a way to override libs
and bins, and they're automatically pulled into our strict early init
path of /usr/bin.
Finally, we lump all this generally a little "later" in the early setup.
This addresses an unseen "bug" wherein an extra temp directory that
never gets used is created when leveraging a preset.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Mostly a convenience for myself, and anyone else who runs builds of
things like util-linux or kmod, where having debug symbols on these
libraries can add a large amount of weight to the image.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Mount separate /usr partitions voluntarily, as a late running hook.
This is an unfortunate patch that will no doubt result in some hatemail,
though it won't thoroughly break anyone to the point of not booting.
As a side effect, findmnt is no longer a requisite of the core /init, so
move it to the shutdown and usr hooks where it's required.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
There's no need to keep this mildly dangerous script executable on the
filesystem.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Break this out of install/base into a separate function. We need to be
able to read from the RUNHOOKS array to accurately specify which hooks
to execute at runtime.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
This option is just a bad idea. Initramfs creation is too important to
get wrong, and running it from outside the root FS has too many gotchas,
the worst of them being:
- where do you pull hooks from?
- how do you resolve binary dependencies within the root?
In general, dealing with the extra luggage of the base directory makes the
codebase more complicated than it needs to be (see all the '_' prefixed
functions which are called from add functions). In favor of simplifying the
code, and making it more maintainable, kill this off and force the sane
option of chroot'ing into an install if the need arises.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
fsck binaries might be outside of /sbin -- glob on all the common paths.
This almost matches what we use for util-linux's fsck search path, but
we omit the oddball /sbin/fs and /sbin/fs.d directories.
Note that this only affects non-autodetect images, since autodetect
resolves fsck helpers directly by name.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Thanks to Radoslaw Nadstawny (Rad3k) for writing this.
Satsifies FS#21022.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
20509ade neglected to filter the raid456 module when detecting raid[456]
arrays, which lead to non-bootable systems from the autodetect-enabled
image.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
This hook has been moved to the pcmciautils package.
Signed-off-by: Tom Gundersen <teg@jklm.no>
Acked-by: Dave Reisner <d@falconindy.com>
|
|
|
|
This makes us a little more future proof as far as moving files around.
No need for 2 lib/ directories in early userspace anyways.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Everything we need to know about the devices is already in sysfs
attributes for the md devices. Read any found nodes for raid levels and
sort them into our whitelist. This removes the need for root in order to
"scan" arrays.
More code churn on top of d11ba00.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Since 3b18c9cd we have a blank /etc/fstab in the image. This is also
forward thinking for the next release of util-linux (2.22), where fsck
complains loudly about my filthy hack of using /dev/null as /etc/fstab.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
sysfs contains enough information about block devices to be able to
determine the order of stacked devices such as lvm, raid, or crypto. By
looking at the device symlinks from the holders/ attributes of a block
device, we can walk down each device chain until we reach the most
descendant device.
For each of these devices at the end of a chain, detect its type and
perform the appropriate action to disassemble it. Then, walk back up the
device chain, disassembling each parent device.
To save ourselves some pain and make sure we're fairly accurate, lsblk
is brought in for detection of device types.
Thanks-To: Florian Pritz <bluewind@xinu.at>
Thanks-To: Tom Gundersen <teg@jklm.no>
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
This is implemented for the keymap and consolefont hooks. It's done in
such a way that vconsole.conf and locale.conf will override and
supplement rc.conf.
Implements FS#29022.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
|
|
This is a really ugly patch, but allows mkinitcpio to read hooks from
multiple locations, namely:
/usr/lib/initcpio/{install,hooks}
/lib/initcpio/{install,hooks}
Preference is given to the first, and all files included with mkinitcpio
are moved there.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
e2fsprogs makes a lot of hardlinks for its fsck tools. If ext[234] is
detected, add the fsck.ext4 binary and add symlinks.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Make the logic similar to how we treat usrfstype.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Behavior changed in util-linux commit 2f1ac44b4b.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Trading out modinfo for modprobe allows us to detect filesystems like
ext2 and ext3 which might be aliased to ext4 in the case of Kconfig
CONFIG_EXT4_USE_FOR_EXT23 being enabled. Maybe this catches other insane
corner cases, too.
Since we now treat this as possible aliases, we also need to be mindful
of the fact that it could resolve to multiple module names. Assign the
output as an array to respect this.
Fixes FS#28569.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|