Age | Commit message (Collapse) | Author | Files | Lines |
|
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>
|
|
$ mkinitcpio -L
==> Available hooks
/usr/bin/mkinitcpio: line 173: cd: /lib/initcpio/install: No such file or directory
sort and dedupe as well, since we deal with a hierarchy which may (for
some horrible reason) contain duplicates.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Additionally, exit zero after returning.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Updates the doc and bash-completion, as well. Also adds the previously
unmentioned -A option to the --help output.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
This still doesn't solve all our problems, but it gets us closer.
There's no point in creating an image if HOOKS aren't present as this is
the bread and butter of any sane mkinitcpio recipe.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
This should have been done as part of b65cf9cd9.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
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>
|
|
Avoid pulling insane apps from user added PATH elements.
FS#29162
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Since INSTDIR and HOOKDIR are understood as arrays now, declare them as
such with the local 'hooks' and 'install' first to override the local
FS. This makes the missing udev error go away and allows easier testing
of other out of tree hooks.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
This fixes a strange edge where-in a user creates an image as non-root
and attempts to boot from it. Any setuid binaries (such as mount) will
fail, as the ownership is preserved.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
The only reason this has to be done is because of the Kconfig option
that reuses the ext4 module for ext[23], thereby aliasing ext[23] to
ext4. This is (currently) the only case in the whole kernel where valid
module names magically become aliases.
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 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>
|
|
This increases compression efficiency, which might be useful on an image
containing a lot of modules.
For the usecase I had in mind, this reduced the size by about a quarter.
Signed-off-by: Tom Gundersen <teg@jklm.no>
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
depmod doesn't care where modules are, within reason, and separating
modules into the respective hierarchies only serves to irritate users
who go looking for modules in the rootfs (aka me). Forget all this and
dump everything into the kernel/ dir.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Move the unsetting of the errtrace and ERR trap flags to after the
image has been built. This lets us capture errors during module
installation to the build root and the call to depmod. Either of these
steps failing could be hazardous and should prompt a failure.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
All official hooks have been using build() for quite some time now.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Otherwise we need to modprobe module manually.
(Particulary I need this for archiso for using /dev/loop-control)
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
|
|
When present, modules.order will allow depmod to order the binary module
indicies for faster lookups and more deterministic behavior in resolving
aliases. We can discard this file from the buildroot after depmod is
called.
modules.builtin.bin is added as well (generated from modules.builtin),
to allow modprobe to not fail when a symbol is provided as a builtin.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Follow suit with lsinitcpio (change 0495018d) and make output colorless
on redirecting/piping stdout.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
This forces bash tests as well as utilities like find to dereference
MODULEDIR in the odd case that it's a symlink.
Addresses FS#27494
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
This is mostly a debugging aid. lsinitcpio will be taught to read this.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
This lets the config file be an override for any files or binaries added
by hooks.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Maybe something went wrong with depmod after a kernel install, or the
user grabbed a kernel directory for an old kernel. Either way, if you're
using an initramfs, there's a very high probability that you'll have at
least 1 module on it.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
- Always call this function. At worst, just return the current kver.
- Do all our error reporting from within the function.
- Add an additional check for existance prior to allow for a more
appropriate error message when we encounter a situation such as /boot
not being mounted.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
cc36db45 was a bit too strict about localizing variables and blew out
TMPDIR, which might be a legit variable sourced from the calling
environment. Restore this behavior with a bit of refactoring, and
additionally add in a check to make sure the temporary directory is
writeable before proceeding.
Fixes FS#26373.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
As it turns out, the mountpoint toy from util-linux isn't really at
feature parity with sysvinit's. In particular, and with respect to
v2.20:
- It throws false negatives when /proc isn't mounted. Rather, it should
fall back on using stat(2), as is the basis for sysvinit's tool.
- when /proc is mounted with as source of 'none', it segfaults on a null
dereference.
Patches have been sent upstream to resolve these issues, but in the
meantime, we're mounting /dev and /proc for very specific reasons.
Instead of relying on a fork/exec to figure out if these API FS's are
mounted, use a simple bash test to see if these specific needs are
available within the FS.
One of many possible fixes for FS#26344.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
If PRESET is set, we're in the main loop, not a worker process. No image
will ever be created here, so there's never a need for saving any build
dir.
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 avoids errors with process substitutions in chroots, among other
things. It's important that /proc be checked first as /etc/mtab might be
a link to /proc/self/mounts.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Instead of bailing entirely, throw an error, and ensure that we exit
with a non-zero status. The user might do something as simple as
misspell a hook name which may or may not prevent a useful image from
being created.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Avoids explosions if a user has no HOOKS in their config, as seen:
https://bbs.archlinux.org/viewtopic.php?pid=966344
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Also make sure that simple variables are declared as null strings.
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>
|
|
Broken in 491a99.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
This also removes a superfluous check on MODULEDIR, which is already
covered by get_kernver.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
This should be performed first, to avoid false positives on any checks
that would have been previously done before we knew our BASEDIR was
valid. Remove usage of readlink here as well, and use pushd/pwd to
resolve. The final trimming of any trailing slash (which might be the
entire BASEDIR value) resolves an edge case bug where specifying a
BASEDIR that resolved to '/' would cause explosions in add_symlink.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|