summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2012-10-25man-pages: Add entry for -V/--version optionEric Bélanger2-0/+6
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
2012-10-25lsinitcpio: Add -V/--version option to display versionEric Bélanger1-2/+12
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
2012-10-25Add -V/--version option to display version informationEric Bélanger1-2/+12
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
2012-10-21function: add a map() utility function0.11.0Dave Reisner2-27/+16
map() runs the first argument (a function) with each of the remaining arguments as $1. The return value of map() is only 0 if all the calls succeeded. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-10-21install/ide: remove this crufty old hookDave Reisner1-15/+0
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-10-21convert autodetect cache to hashDave Reisner3-24/+29
If mkinitcpio -s is run, we still flush this cache to disk before exiting. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-10-21functions: trim path of resolved symlinkDave Reisner1-1/+1
When reporting that a hook is deprecated, only show the hook name, not the full resolved path. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-10-21add manpage for mkinitcpio.confDave Reisner4-1/+86
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-10-21makefile: spring cleaningDave Reisner1-40/+32
- use MANPAGES instead of DIST_EXTRA (it's only manpages anyways) - uniformly use $(var) instead of ${var} - consolidate manpage generate rules - prefer cp over install when symlinks might be involved
2012-10-07ensure builtins are dash/underscore translatedDave Reisner1-2/+4
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-10-07mkinitcpio: remove find_moduledirDave Reisner1-20/+2
Using anything but /lib/modules isn't really sane, and it shouldn't be supported. If you want to use /usr/lib/modules, then /lib must be a symlink to usr/lib. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-10-07separate image building to functionsDave Reisner1-129/+137
Mostly in favor of scoping out some variables further. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-10-07honor -n for presetsDave Reisner1-0/+1
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-10-07mkinitcpio: check for preset file by sourcing itDave Reisner1-42/+44
Instead of using a bash test, just source the preset file. If it fails, exit. This patch is a bit ugly because it remove a level of indentation.
2012-10-07commit to some level of style in variable namingDave Reisner6-217/+285
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-09-30functions: avoid fully resolving soname symlinksDave Reisner1-4/+2
It's okay to fully resolve the symlink to add the regular file it points to, but avoid mangling the symlink name to try and preserve relative links. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-09-30lsinitcpio: add -l, --list option; define as defaultDave Reisner3-11/+32
This is the default action for lsinitcpio. Add it just for the purpose of clarity. This change also separates out true options from 'actions' and validates that the user only passed a single action to lsinitcpio. Update the manpage accordingly. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-09-30lsinitcpio: add -c, --config option to dump configDave Reisner3-4/+13
Now that mkinitcpio stores the build time config file in the image, we should have a way of easily getting it back out. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-09-30lsinitcpio: move image analysis to separate functionDave Reisner1-66/+70
git (at least version 1.7.12.1) does a great job of showing the absolute wrong code moving around in this patch. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-09-30functions: include image config on image itselfDave Reisner1-7/+6
For the purposes of accounting and debugging, it's nice to have this around. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-09-30mkinitcpio: munge modules.order before calling depmodDave Reisner1-1/+7
The initramfs installs all modules to kernel/ which devalues the modules.order file. To avoid any edge cases with the wrong module being loaded (because all matching modules for a given alias will be added), make sure that the modules.order file is actually valid. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-09-30functions: always treat ADDED_MODULES as a hashDave Reisner2-5/+5
Overlooked in b8d9c5cd2753e9. This change also assigns a value of "2" to builtin modules which are added to the the ADDED_MODULES array, to distinguish them from actual modules on disk. Using this, we can avoid adding builtins to the image's runtime config. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-09-24mkinitcpio: protect module install on $MODPATHSDave Reisner1-1/+1
This was always wrong and should have been braced by MODPATHS rather than ADDED_MODULES. However, since ADDED_MODULES now possibly contains modules that weren't actually added (builtins), creating an initramfs without modules causes cp to be passed a null string to be copied. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-09-24force bsdcpio to run with LANG=CDave Reisner1-1/+1
In case mkinitcpio is in run via chroot(1), this possibly silences a harmless warning about bsdcpio failing to set the default locale. This comes up fairly often with the recent install media and users think that it's something to be concerned about. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-09-17silently ignore builtin modulesDave Reisner1-0/+7
Assuming modules.builtin exists, add the module names it contains to the ADDED_MODULES hash so that we silently skip over them. Suggested-by: Matthew Monaco <dgbaley27@0x01b.net> Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-09-17declare ADDED_MODULES as associative arrayDave Reisner2-4/+4
Lookups in the hash table are far faster than traversing the entire array, as this grows O(n) and introduces a particularly noticeable slowdown on larger images. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-09-17install/base: update help verbiageDave Reisner1-2/+2
This hasn't provided actual directories in a while. Reword it to point out that it's only providing the critical scripts and binaries for booting. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-09-17functions: allow add_symlink to only take a single argDave Reisner2-10/+24
In the case of a single arg, use readlink(1) to resolve the target of the symlink. Document this, and additionally note the lack of guarantee about the target of the symlink. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-09-17mkinitcpio.8: add missing doc for add_symlinkDave Reisner1-0/+5
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-09-17install fstab/mtab as part of base layoutDave Reisner2-5/+4
These are low level enough that they should be part of the base layout, similar to the filesystem package in userspace. Later hooks can easily override these, if they really want to. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-09-01mkinitcpio: refuse to run if image path isn't writeableDave Reisner1-0/+7
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-08-30init: add support for root=PARTLABEL=fooDave Reisner1-1/+1
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-08-27mkinitcpio.8: fix typoDave Reisner1-1/+1
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-08-19init: avoid needlessly trimming PATHDave Reisner1-1/+0
busybox gives us something sane which doesn't need setting, or resetting. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-08-19functions: avoid creating /usr/sbinDave Reisner1-1/+1
Booo. This broke my boot. Should never have been added in f3638aaa0937. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-08-13shutdown: add hack workaround for broken dm/kernelDave Reisner1-0/+4
This is already fixed elsewhere, and eventually this hack needs to be removed. However, for now, it seems that some kernels (3.4 and 3.0) will hang on shutdown with the combination of systemd and lvm/crypt. Removing evidence of udev being alive in /run seems to fix this. Fixes FS#30995. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-08-13functions: symlink /usr/local/sbin -> /usr/binDave Reisner1-1/+2
This was overlooked in 5f81d06e8b87. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-08-11install/consolefont: support .fnt filesDave Reisner1-2/+2
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-28mkinitcpio: rename longopt for --add to --addhooksDave Reisner3-9/+9
Rename this option so that it mirrors the longopt name for -S, --skiphooks. The original --add option remains behind in the option parser for backwards compatability, but no other references remain. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-07-28implement --moduleroot optionDave Reisner5-9/+16
This might be useful for creating an initramfs image as part of a kernel package. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-07-24baseroot: add flagfile to indicate we're in an initramfsTom Gundersen1-1/+4
This is used by udev to deal with firmware requests for firmware that is not available until the real root. It will also be used by systemd to detect what to do, if that is ever used. ref: http://www.spinics.net/lists/linux-wireless/msg94522.html Signed-off-by: Tom Gundersen <teg@jklm.no>
2012-07-24init_functions: use a consistent default rootdelayDave Reisner1-1/+1
init defaults to a rootdelay of 10, but poll_device falls back on a default of 5 if rootdelay is somehow manage during the hook run. Keep this consistent and use 10 seconds in both places. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-07-15lsinitcpio: comment on why bsdtar alone isn't good enoughDave Reisner1-1/+3
I almost deleted this, replacing it with only bsdtar. Add a comment so I'm not tempted to do this again. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-07-15initalize buildroot later, and out outside of hooksDave Reisner3-36/+36
mkinitcpio needs to be able to more tightly control the layout of the image. By moving this outside the control of the base hook, it's more reasonable to believe that a drop-in replacement for the base hook could be written, as it now only contains the utilities required for the /init that it provides. Being that initialize_buildroot is outside of a hook, we can make "raw" calls to coreutils that create the directories and symlinks, saving some overhead and forking. This also symlinks /usr/local/{lib,bin} into the common /usr/lib and /usr/bin, respectively, so that there's always a way to override libs and bins, and they're automatically pulled into our strict early init path of /usr/bin. Finally, we lump all this generally a little "later" in the early setup. This addresses an unseen "bug" wherein an extra temp directory that never gets used is created when leveraging a preset. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-07-15use last exit status as default arg for cleanupDave Reisner1-1/+3
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-07-15add 'strip' install hookDave Reisner1-0/+32
Mostly a convenience for myself, and anyone else who runs builds of things like util-linux or kmod, where having debug symbols on these libraries can add a large amount of weight to the image. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-06-13shutdown: don't alert udev on disable VGsDave Reisner1-1/+1
Fixes FS#30271. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-06-12Update module filter to be aware of hyphens in the MODULES arrayBrian Parsons1-1/+1
[dave: fix whitespace and re-add needed quoting] Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-06-08lsinitcpio: show only regular files as binaries0.9.2Dave Reisner1-2/+1
Show only regular files in /usr/bin instead of everything (including the mess of symlinks to busybox and kmod). It's also a nice to have since we're showing more about the multiple hook points now. This mostly restores the behavior prior to f7b8a6f0fd. Signed-off-by: Dave Reisner <dreisner@archlinux.org>