summaryrefslogtreecommitdiffstats
path: root/install/autodetect
AgeCommit message (Collapse)AuthorFilesLines
2013-11-27mkinitcpio: Allow building an image without modulesThomas Bächler1-0/+2
The '-k none' switch prevents mkinitcpio from adding modules to the image and keeps it from bailing out when it cannot find any.
2013-09-24autodetect: read modaliases from uevent filesDave Reisner1-2/+1
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>
2013-08-28rely on libmount defaults for file locationsDave Reisner1-1/+1
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>
2013-08-28autodetect: search for /usr explicitly using -TDave Reisner1-1/+1
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>
2013-03-13autodetect: allow whitelisting by MODULE_FS_ALIASDave Reisner1-3/+5
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>
2012-10-21convert autodetect cache to hashDave Reisner1-17/+21
If mkinitcpio -s is run, we still flush this cache to disk before exiting. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-10-07commit to some level of style in variable namingDave Reisner1-8/+9
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>
2012-07-29autodetect: fix wrong flag passed to modprobe0.10Dave Reisner1-1/+1
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-07-28implement --moduleroot optionDave Reisner1-1/+1
This might be useful for creating an initramfs image as part of a kernel package. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-06-08avoid reliance on sed, embrace awkDave Reisner1-1/+1
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-05-12mkinitcpio: remove --basedir optionDave Reisner1-2/+2
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>
2012-04-09mdadm: fix raid[456] autodetectionDave Reisner1-1/+1
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>
2012-04-02autodetect: simplify mdadm autodetectionDave Reisner1-23/+5
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>
2012-02-27install/autodetect: avoid adding empty rootfstypeDave Reisner1-5/+5
Make the logic similar to how we treat usrfstype. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-02-22use --tab-file flag for findmnt -sDave Reisner1-1/+1
Behavior changed in util-linux commit 2f1ac44b4b. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-02-22autodetect: resolve guessed filesystem modulesDave Reisner1-2/+8
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>
2012-02-11autodetect: refactor raid device detectionDave Reisner1-6/+22
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>
2012-01-28autodetect: remove hack to exclude {ata,ide}-genericDave Reisner1-1/+1
In particular, skipping ata-generic causes some macbooks to not boot. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-01-13autodetect: try to find /usr partition fstypeDave Reisner1-2/+11
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-01-05autodetect: check for rootfs module existanceDave Reisner1-1/+6
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>
2012-01-05mkinitcpio: remove hardcoded pathsDave Reisner1-2/+2
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-11-15autodetect: store rootfstype for use by other hooksDave Reisner1-1/+1
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-10-16mkinitcpio: avoid stomping on TMPDIR from the environmentDave Reisner1-1/+1
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>
2011-07-09autodetect: add verbose feedback on autodetect successDave Reisner1-0/+4
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-07-05autodetect: check for /sys/devices before autodetectingDave Reisner1-2/+2
Oops. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-06-26install/autodetect: refactor and simplify hookDave Reisner1-63/+28
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>
2011-06-19overhaul output, introducing colorDave Reisner1-2/+2
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>
2011-06-16mkinitcpio: deprecate install() in install hooksDave Reisner1-1/+1
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>
2011-03-27Simplify root file system detectionThomas Bächler1-2/+1
Instead of calling blkid, get the file system type directly from findmnt. Fixes FS#23100.
2011-01-31Use new helper functions instead of system commandsDan McGee1-2/+1
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>
2011-01-25Support .ko.gz kernel modules, in addition to .koThomas Bächler1-2/+3
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.
2011-01-12If filesystem autodetection fails, use all_modules instead of checked_modulesThomas Bächler1-1/+8
2011-01-12autodetect: only probe the root deviceThomas Bächler1-4/+7
2010-06-19Implement explicit module dependsJan Steffens1-13/+2
Needed to get libcrc32c and therefore btrfs to work. Also remove the equivalent section in autodetect, which wasn't working anyway.
2010-06-19Fix autodetect bitrotJan Steffens1-6/+3
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.
2010-05-08Change how autodetect hook lookup for filesystemsGerardo Exequiel Pozzi1-1/+1
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>
2010-02-11Fix file system autodetection of filesystems when the running kernel and the ↵Thomas Bächler1-1/+1
target kernel don't match. We need --set-version when resolving filesystem aliases, thanks Tobias.
2010-02-07Allow a filesystem name to be an alias instead of a kernel moduleThomas Bächler1-4/+7
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
2010-01-10Remove klibc-isms from autodetect: Use blkid for filesystem detectionThomas Bächler1-4/+1
2009-11-27fixed autodetection of raid module on mdadm>=3.0.xTobias Powalowski1-1/+1
2009-06-07Fix #12374Thomas Bächler1-1/+1
2008-12-30Revert fstype -> blkid change0.5.20Aaron Griffin1-1/+1
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>
2008-12-29Add ext4 to filesystem autodetectionAaron Griffin1-0/+1
Original-work-by: Gerhard Brauer <gerhard.brauer@web.de> Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-12-29Use udev's blkid instead of klibc-extra's fstypeAaron Griffin1-1/+1
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>
2008-04-13Don't add the 'generic' ide or pata modules when autodetection is enabledThomas Bächler1-1/+2
2008-03-16Fix various coding style issuesThomas Bächler1-5/+5
2008-03-15Fix syntax error introduced in one of the last commitsThomas Bächler1-1/+1
2008-03-15Use a temporary directory instead of several files. trap cleanupThomas Bächler1-3/+3
2007-10-31Fix problems with /sbin and /usr/sbin not being in the path,Thomas Bächler1-1/+1
fixes Archlinux #8448
2007-08-11Coding style change, use -n and -z for variable testsAaron Griffin1-1/+1
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com> git-svn-id: http://projects.archlinux.org/svn/initramfs/mkinitcpio@209 880c04e9-e011-0410-abf7-b926e227c9cd