Age | Commit message (Collapse) | Author | Files | Lines |
|
Prevents problems with bogusly named filesystems, e.g.:
mount -t tmpfs / /mount/point
Fixes FS#39090.
|
|
The '-k none' switch prevents mkinitcpio from adding modules to the
image and keeps it from bailing out when it cannot find any.
|
|
As suggested by Harald Hoyer, this is more accurate for the sake of
following where udev gets its modaliases from. In some rare cases, it
may even be more complete than scraping the raw modalias files.
Also, introduce a wrapper around modprobe so that the options passed
are never ommitted, or wrongly specified. In this case, a subtle bug
with the -r flag is fixed due to using the wrong variable with
modprobe's -d flag.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
In particular, skipping ata-generic causes some macbooks to not boot.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
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>
|
|
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>
|
|
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Oops.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
|
|
Bashify and refactor to cut back on unnecessary churn. Since our
{all,checked}_modules functions always return clean module names, we can
add these directly to the autodetect file instead of aggregating them
during the autodetect hook and then cleansing one at a time. There's a
small speed increase here for the simplest code path.
Signed-off-by: Dave Reisner <d@falconindy.com>
|
|
Output style and coloring is borrowed from makepkg with minor
adjustments. Most instances where we encounter fatal errors are replaced
with a 'die' function to wrap this up neatly. In addition, we introduce
the -n flag, for no-color.
As a side effect, we need to source the functions file earlier so we
have the output functions available earlier.
Signed-off-by: Dave Reisner <d@falconindy.com>
|
|
This is an unfortunate name clash with a common utility and should be
avoided. Rename the install function to 'build' and warn the user when
we discover a hook using an 'install' function.
Signed-off-by: Dave Reisner <d@falconindy.com>
|
|
Instead of calling blkid, get the file system type directly from findmnt.
Fixes FS#23100.
|
|
Replace all of the repeated calls to dirname and basename with our new
replacments. Also replace the 'grep ... /dev/null' idiom with calls to
'grep -q', which does exactly what we want.
Signed-off-by: Dan McGee <dan@archlinux.org>
|
|
We used to expect only .ko as a kernel module name. Also accept .ko.gz,
so we can reduce the installed size of the kernel26 package.
|
|
|
|
|
|
Needed to get libcrc32c and therefore btrfs to work. Also remove the
equivalent section in autodetect, which wasn't working anyway.
|
|
This error went unnoticed after auto_modules was switched over to
resolve-modalias. As a result, ata_generic and ide-generic weren't
filtered anymore.
|
|
In this way, remove eval hacks and enviroments vars, just use blkid
syntax.
I guess in this way will fix/hide "command not found" when fstype
is not property setup in fs, reported by some users.
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
|
|
target kernel don't match.
We need --set-version when resolving filesystem aliases, thanks Tobias.
|
|
This fixes future bugs in 2.6.33 when the ext4 driver is used for ext3 and ext2, and you want to mount ext2/3 as your root filesystem
|
|
|
|
|
|
|
|
blkid is part of e2fsprogs, not udev, so it's not as
ubiquitous. Additionally, we need to use the same detection
at installtime as we do at runtime.
Thomas has patched klibc's fstype to work with ext4, so we
should continue to use it
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
|
|
Original-work-by: Gerhard Brauer <gerhard.brauer@web.de>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
|
|
This is better and more updated with regards to figuring
out the fs type of a given block device
Original-work-by: Gerhard Brauer <gerhard.brauer@web.de>
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
|
|
|
|
|
|
|
|
|
|
fixes Archlinux #8448
|