Age | Commit message (Collapse) | Author | Files | Lines |
|
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>
|
|
FS#10061 still isn't dead, its just resting:
https://bbs.archlinux.org/viewtopic.php?pid=1056003
An strace from a helpful user shows that our mdadm call is trying to
open a block device and the call never returns:
open("/dev/sdb", O_RDONLY|O_DIRECT|O_LARGEFILE
Fix this by only scanning explicitly the block devices we're interested
in, found via sysfs. This is an all around win for everyone, especially
users who have mdadm installed without any need for it.
This changes some of our assumptions about the environment:
- the mdadm binary exists when we find md devices in /sys
- the user running mkinitcpio isn't any specific UID or part of any
particular group, but merely has read access to the block devices
we're about to scan.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
These should belong to the udev package.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Move this logic inside fsck_device as well, so that fastboot skips a
possible fsck on the /usr partition as well.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
our fsck_ret function would always return true when passed 0, which
clearly isn't what we want. Use a simple string compare instead.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
An error in logic here would cause the --try flag to be passed to all
modules after the first, if a hook added modules ending with a '?'.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
In particular, skipping ata-generic causes some macbooks to not boot.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
This makes us more resilient against path changes -- add_binary is smart
enough to resolve the path for us.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Install kmod in /usr/bin and provide symlinks for all the applets to the
kmod multi-call.
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>
|
|
systemd passes 'kexec' on 'systemctl kexec' which isn't being caught.
Catch the few possible verbs for a halt, and let everything else default
to trying a kexec; falling back on a reboot.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
udev does not support this as of udev-176, so there is no point in
pretending it will work.
This also drops devtmpfs_mounted=1, so any custom hooks that use this
would have to be updated (no official hooks are affected).
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
This is cosmetic change, but using rootfs is more correct than ramfs.
[Rootfs is a special instance of ramfs or tmpfs, if that is enabled]
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Use findmnt to detect the existance of a separate /usr partition
existing in the real root. If it does exist, fetch the options for it
and mount it. This currently makes a lot of assumptions and won't be
very friendly towards something such as a dm-crypt device.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
This is required for mounting a separate /usr. While the shutdown hook
is essentially a soft requirement for a separate /usr, we shouldn't
break init.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
- firmware handling is now a udevd builtin
- udevadm may move -- let a path lookup find it
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Refer to commit 9a9e0d68555 in the kernel where Linus removes this and
says "to be revisited later". The only option (currently) is to built
this into your kernel image.
Suggested by FS#27906.
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>
|
|
This adds functionality to pivot to back to the initramfs on shutdown,
thereby allowing the system to unmount the real root device. This will
be necessary for anyone with /usr as a separate partition.
|
|
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>
|
|
kmod is a bit noisier about unresolvable aliases, but we don't really
care for the purposes of creating the module whitelist.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Avoiding adding a filesystem module to the whitelist when it doesn't
actually exist as a module (in case its compiled in staticly).
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>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
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>
|
|
- trim leading paths from all binaries
- sort alphabetically
- add same trailing indent as the module display
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
init doesn't set a umask, so this was previously created as world
writable and sticky.
Reported-by: Thomas Bächler <thomas@archlinux.org>
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
The function did its job, it just isn't going to add any deps. This
makes add_binary effectively a slightly more costly version of add_file.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Report this version on -a if it's found.
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>
|
|
Fixes FS#27385
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
This means that no "setup" of the initramfs is requried on boot,
and this should make testing a lot eaiser by just chrooting into
the ramfs to check if it works.
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
Add compat symlinks from /bin, /sbin and /usr/sbin, so nothing is lost.
This will make sure that it is not possibly to install two different
versions of the same binary in PATH.
The main usecase of this is that we want to be able to override any
symlink provided by busybox by adding a binary by the same name. With
this patch we don't have to worry in case the busybox symlink and the
binary we add are in different directories; the last binary to be added
always takes precedence.
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
This lets the config file be an override for any files or binaries added
by hooks.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Now that we're including symlinks to busybox on the prebuilt image, this
display needs a bit of tidying up.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Since we now silently overwrite instead of silently failing on existing
files and symlinks, we have a lot of sodeps which are overwritten by
various binaries -- udevd and udevadm being one example. Nip this in
add_binary by doing our own check and preventing addition of
pre-existing files in the $BUILDROOT.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
This goes in hand with an earlier commit which changed behavior to
silenltly overwrite files rather than silently fail.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Now we fail silently if the file exists, which means there is no easy way to overwrite binaries.
I think it makes the most sense to do the following:
1) add all the busybox stuff as a basic system;
2) overwrite some of the links with any binaries we add to base hook;
3) allow users to write their own hooks to overwrite even more stuff.
This can now be done by this hook.
v2: make sure we are able to overwrite a symlink pointing to a directory
Signed-off-by: Tom Gundersen <teg@jklm.no>
|
|
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>
|
|
I think this error is more confusing to most people than it needs to be,
and it's not really accurate any longer. Generalize the message and
inform the user that we simply couldn't find the root device.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
These are all root owned, so we don't need to be concerned about DoS
attacks via these FS's.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
This is mainly for avoid this:
[ramfs /]# mount /dev/md0 /mnt/a
[ramfs /]# mount -o bind /mnt/a /mnt/b
[ramfs /]# mount -o bind,remount,ro /mnt/b
warning: can't open /etc/fstab: No such file or directory
[ramfs /]#
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
|