summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2012-04-04fix pcmcia /usr moveTobias Powalowski1-3/+3
2012-04-02create /lib as a symlink to /usr/lib0.8.6Dave Reisner2-1/+2
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>
2012-04-02base: move usb modprobe rule to /usr/lib/modprobe.dDave Reisner1-1/+1
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-02shutdown: detach all loop devices before umountingDave Reisner1-0/+6
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-02shutdown: refine umount_all logicDave Reisner1-3/+3
remove the mountpoint filtering from the awk processing and drop the -l flag from umount. Not clear why either of these were present -- they're both wrong. 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-04-02mkinitcpio: hardcode a sane PATHDave Reisner1-3/+3
Avoid pulling insane apps from user added PATH elements. FS#29162 Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-02add minor tweaks to make testing a bit easierDave Reisner2-2/+3
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>
2012-04-02shutdown: improve handling of dm devicesDave Reisner1-4/+8
- use the 'remove' action for cryptsetup rather than luksClose - handle dm devices with dmsetup, not lvm - disable dmraid devices by name, instead of all at once Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-02init_functions: fix missing * in fsck messageDave Reisner1-1/+1
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-04-02init: fix location of udevdDave Reisner1-2/+2
We've gotta stop moving this around... Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-03-28fsck: leverage blank /etc/fstab included by baseDave Reisner2-2/+2
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>
2012-03-26shutdown: disassemble devices on shutdownDave Reisner2-1/+65
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>
2012-03-26shutdown: add vim modeline, fix whitespacingDave Reisner1-13/+15
Make this consistent with the rest of the codebase. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-03-24Makefile: simplify 'make dist' target0.8.5Dave Reisner1-9/+6
- Use git-ls-files and bsdtar to create the archive rather than using git-archive and an temporary directory. - Remove the tarball target. 'dist' is more common. - Remove the 'clean' dependency from dist. Our dependencies are sufficient higher up that touching the Makefile or the asciidoc input will trigger a doc rebuild on changes. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-03-24init_functions: fix tag resolution w/o udev rulesDave Reisner1-10/+9
The combination of the udev+mdadm hooks plus a tag based root= would cause resolve_device to fail because it immediately looked for a udev symlink which would never be created. The proper fix is to get rid of the mdadm hook and to always use mdadm_udev (which should be merged into mdadm), but this might come back and bite us again. The new solution doesn't assume that udev rules exist and tries blkid first. If the device doesn't (yet) exist fall back on a udev symlink if udevd is running. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-03-24move bash completion to /usr/share/bash-completionDave Reisner1-2/+2
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-03-24natively support locale.conf and vconsole.confDave Reisner2-7/+26
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>
2012-03-24init_functions: support fsck.mode= cmdline parameterDave Reisner1-0/+6
Possible options are 'skip' and 'force' which are synonyms for fastboot and forcefsck, respectively. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-03-24init_functions: avoid special treatment for forcefsckDave Reisner1-2/+1
I don't want to make a habit of treating cmdline opts as special if they don't need to be, and this is a case where some simple PE magic can be substituted. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-03-16bash-completion: find hooks in /usr/libMatthew Monaco1-2/+3
[dreisner: add handling for -A flag] Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-03-16memdisk: fix udev rule pathGerardo Exequiel Pozzi1-1/+1
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
2012-03-11hooks/resume: refactorDave Reisner1-25/+37
- cleanup syntax, style - use case to detect syntax (avoid problems with vanilla devspecs containing a ':') - support LABEL=/UUID= syntax for vanilla hibernation (FS#28504) - be more verbose about errors Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-03-06mkinitcpio: force UID/GID 0 for files written to imageDave Reisner1-1/+1
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>
2012-03-04mkinitcpio: dedupe MODPATHS array before installation0.8.4Dave Reisner1-1/+2
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>
2012-03-04init: add informational output about mountingDave Reisner2-0/+2
Applies to both the real root and any device that's mounted on /usr Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-03-04add -A option to specify extra hooksDave Reisner2-3/+11
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-03-04mkinitcpio: allow -S to be specified multiple timesDave Reisner2-1/+4
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-03-04add support for HOOKDIR/INSTDIR as arraysDave Reisner7-54/+83
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>
2012-03-04init_functions: lazily resolve UUID/LABEL tagsDave Reisner1-5/+22
Relying on blkid to do tag resolution will fail when the root device doesn't yet exist. This is, of course, bad for USB root devices. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-03-03install/fsck: use fsck.ext4 for ext[234]Dave Reisner1-2/+12
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>
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-22README: fix email address0.8.3Dave Reisner1-1/+1
2012-02-22use --tab-file flag for findmnt -sDave Reisner2-4/+5
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-20lsinitcpio: trim binaries during discoveryDave Reisner1-3/+3
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-02-20lsinitcpio: detect kver separate from modulesDave Reisner1-6/+4
mkinitcpio will always create /lib/modules/$kernver/kernel in the image, so we can use this to detect the kernel the image was built for, even if the image contains no modules. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-02-17mkinitcpio: unzip modules before image compressionTom Gundersen1-0/+3
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>
2012-02-14mkinitcpio: install all modules to a single dirDave Reisner1-6/+2
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>
2012-02-14mkinitcpio: catch more buildtime errorsDave Reisner1-3/+6
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>
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-02-08udev: remove hooksDave Reisner2-35/+0
These should belong to the udev package. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-02-08memdisk: use blkid builtinDave Reisner1-1/+1
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-01-29fsck: fix copypasta error in picking /usr fsck helperDave Reisner1-1/+1
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-01-29init: use fastboot, not skip to avoid fsckDave Reisner2-1/+6
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>
2012-01-29init_functions: avoid using fsck_ret to check 0Dave Reisner1-7/+7
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>
2012-01-28function: avoid applying --try to all modulesDave Reisner1-3/+3
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>
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-28avoid absolute paths in add_binary callsDave Reisner4-9/+9
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>
2012-01-28mkinitcpio.conf: add note about separate /usr, fsck as defaultDave Reisner1-1/+4
Signed-off-by: Dave Reisner <dreisner@archlinux.org>