summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
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>
2012-01-28install/base: drop support for m-i-tDave Reisner2-2/+7
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>
2012-01-28mkinitcpio: obsolete install as a buildhook functionDave Reisner1-7/+1
All official hooks have been using build() for quite some time now. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-01-28shutdown: make reboot the default actionDave Reisner1-5/+2
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>
2012-01-28man: replace refs to kernel26 with linux, et alDave Reisner1-5/+5
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-01-28fsck: add helper for usr if different fs from rootDave Reisner1-2/+7
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-01-13init: drop support for non-devtmpfs0.8.2Tom Gundersen1-12/+1
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>
2012-01-13Update PS1 ramfs -> rootfsGerardo Exequiel Pozzi1-1/+1
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>
2012-01-13autodetect: try to find /usr partition fstypeDave Reisner1-2/+11
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-01-13init: mount separate /usrDave Reisner2-1/+10
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>
2012-01-13base: add findmnt as a part of the base layoutDave Reisner2-1/+2
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>
2012-01-13udev: update for udev 176Dave Reisner2-3/+3
- firmware handling is now a udevd builtin - udevadm may move -- let a path lookup find it Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-01-12dsdt: remove hook. this has been defunct for yearsDave Reisner1-14/+0
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>
2012-01-11Keep modules.devname needed for on-demand module loadingGerardo Exequiel Pozzi1-2/+2
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>
2012-01-05shutdown: add new hook0.8.1Dave Reisner4-1/+54
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.
2012-01-05mkinitcpio: include modules.{builtin,order} for depmod callDave Reisner1-1/+6
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>
2012-01-05function: suppress errors from modprobeDave Reisner1-1/+1
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>
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 Reisner2-3/+3
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-12-26mkinitcpio: avoid color when stdout isn't a ttyDave Reisner1-1/+1
Follow suit with lsinitcpio (change 0495018d) and make output colorless on redirecting/piping stdout. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-12-26lsinitcpio: remove duplicate in_array functionDave Reisner1-9/+0
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-12-26functions: display proper name on file not foundDave Reisner1-1/+1
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-12-17ensure MODULEDIR is declared with a trailing slashDave Reisner1-1/+1
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>
2011-12-16lsinitcpio: cleanup binary displayDave Reisner1-1/+1
- trim leading paths from all binaries - sort alphabetically - add same trailing indent as the module display Signed-off-by: Dave Reisner <dreisner@archlinux.org>