summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2013-12-01Load build and run hooks from /etc/initcpioDave Reisner3-3/+11
This lets users shoot themselves in the foot more easily, as they can put their own modified hooks into /etc/initcpio/{hooks,install} to override those shipped by the distro in /usr/lib/initcpio. To make debugging easier, include the full path of the hook being used when mkinitcpio runs in verbose mode. Implements FS#37796.
2013-11-27sd-shutdown: don't fail after kernel updatesDave Reisner1-1/+1
When the module directory matching $(uname -r) cannot be found, generation of the shutdown ramfs aborted: systemd[1]: Starting Generate shutdown-ramfs... mkinitcpio[1944]: ==> ERROR: '/lib/modules/3.12.1-1-ARCH' is not a valid kernel module directory systemd[1]: mkinitcpio-generate-shutdown-ramfs.service: main process exited, code=exited, status=1/FAILURE systemd[1]: Failed to start Generate shutdown-ramfs. systemd[1]: Unit mkinitcpio-generate-shutdown-ramfs.service entered failed state. Tell mkinitcpio that we do not wish to add any kernel modules.
2013-11-27merge optkver into KERNELVERSIONDave Reisner1-6/+8
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-11-27mkinitcpio: Allow building an image without modulesThomas Bächler4-3/+10
The '-k none' switch prevents mkinitcpio from adding modules to the image and keeps it from bailing out when it cannot find any.
2013-11-27init_functions: escape slashes in tag valuesDave Reisner1-2/+11
This allows booting from devices which have labels like LABEL=/. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-11-26move a bunch of stuff to subdirsDave Reisner5-4/+5
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-11-24Add mkinitcpio-generate-shutdown-ramfs.serviceThomas Bächler3-1/+32
When enabled, this service generates an "initramfs" that systemd pivots to on shutdown to ensure clean umounting and shutdown of loop and dm devices. The actual work is done by systemd-shutdown.
2013-11-24mkinitcpio: Improve output when -d option is used.Thomas Bächler1-3/+7
2013-11-24mkinitcpio.8: document -d, --generatedirDave Reisner1-0/+5
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-11-24functions: error out when buildroot isn't writeableDave Reisner1-0/+5
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-11-24mkinitcpio: add -d optionThomas Bächler2-22/+28
The -d (--generatedir) option writes the root of the generated image directly to the specified directory. Useful for generating a shutdown-ramfs with mkinitcpio -d /run/initramfs/.
2013-10-21lsinitcpio: separate decompression from archive readingDave Reisner1-3/+3
This essentially reverts 306dcbd7b21f8a680 which foolishly assumes that kernel and libarchive decompression support stay in sync. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-09-26kernel-install: add hookTom Gundersen2-0/+15
This will allow systemd's kernel-install script to generate and install an initrd as per the freedesktop boot loader specs. See kernel-install(8) for details. Notice that 'profiles' are not used. This will eventually be hooked up so that calling "make install" from a kernel build will do the right thing. Signed-off-by: Tom Gundersen <teg@jklm.no>
2013-09-25mkinitcpio.conf(5): mention lz4 compressionDave Reisner1-3/+3
Since b5927393d103af9, mkinitcpio acknowledges that lz4 exists. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-09-24PKGBUILD: Point to the gitweb page for upstream URLDave Reisner1-1/+1
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-09-24autodetect: read modaliases from uevent filesDave Reisner2-7/+8
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-09-20functions: always add toplevel dir in add_full_dirDave Reisner1-1/+2
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-09-09add mkinitcpio version marker in buildroot creationDave Reisner2-3/+3
It doesn't make any sense that this was added during the final image creation. This fixes a subtle bug that would manifest itself if the user archived the build root manually. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-09-07lsinitcpio: return success based on echo, not hexdumpDave Reisner1-0/+1
The impetus for doing this was a bug in util-linux's hexdump which never saw a release. For uniformity, simply echo an empty line here. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-09-07lsinitcpio: add support for lz4 compressed imageDave Reisner3-1/+8
Note that this requires a very recent version of lz4 utilities as it uses lz4, and not the original lz4c tool, in order to be command line API compliant with other compression tools. See upstream discussions: https://code.google.com/p/lz4/issues/detail?id=83 Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-08-28mkinitcpio: preserve permissions if run as rootDave Reisner1-1/+5
Running as non-root is usually for my own dev purposes, but someone might do this and be surprised when a directory/file that needs permissions other than root isn't preserved. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-08-28rely on libmount defaults for file locationsDave Reisner2-2/+3
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-07-27init: avoid passing empty RD_TIMESTAMP variableDave Reisner1-1/+0
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-07-18init: rely on ConditionPathIsReadWrite for root fsck flag0.15.0Dave Reisner1-3/+13
Add an annoying warning in case the root device is fsck'd and about to be mounted RO. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-07-08Generate /etc/ld.so.cache for imageDave Reisner2-0/+6
Shaves a trivial, but measurable, amount of time off of early userspace at the cost of a small cache file. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-07-01rdlogger: log messages which would have been hidden by quietDave Reisner2-1/+7
This allows 'quiet rd.log=kmsg' to produce a silent boot while still logging the full output that would have been written to the console. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-06-25init: remove unneeded intermediate variableDave Reisner1-3/+2
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-06-25init: merge duped code, use bitfield_has_bit in fsck_rootDave Reisner1-14/+8
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-06-25init: allow for logging of early userspaceDave Reisner3-2/+176
This introduces support for the rd.log and rd.debug kernel command line options, which log early userspace activity to /run/initramfs/init.log. Code is largely inspired by Dracut's implementation of early userspace logging, but without needless complexity and redundancies. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-06-19init: throw error on unknown fsck.modeDave Reisner1-2/+9
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-05-07move install_modules to functions to allow for testingDave Reisner2-41/+41
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-05-07remove "arbitrary" limit from index_of()Dave Reisner2-11/+13
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-05-07init: redirect /proc/cmdline to parse_cmdlineDave Reisner2-2/+2
This makes it easier to test parse_cmdline. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-05-07README: its 2013, year of the ponyDave Reisner1-1/+1
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-05-07lsinitcpio: remove unused variablesDave Reisner1-3/+0
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-05-02shutdown: include umount from util-linux0.14.0Dave Reisner1-0/+1
This is needed for the --recursive flag. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-05-02mkinitcpio: ensure ERR trap propagates to install_modulesDave Reisner1-0/+2
Without this flag set, errors in install_modules are ignored, and mkinitcpio potentially exits without complaining about build problems when foolish people run out of disk (presumably after using /tmp as a build directory). Fixes FS#35037. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-04-24shutdown: use umount --recursiveDave Reisner2-16/+2
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-04-24hooks/memdisk: scope variables, use newer syntaxDave Reisner1-6/+9
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-04-24hooks/usr: conditionally fsck /usr based on fstabDave Reisner1-2/+8
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-04-24functions: implement add_firmwareDave Reisner2-8/+26
Add this as an abstraction for the various places firmware might exist. Additionally, don't complain about missing firmware unless *none* of it can be found -- and even then, only throw a warning. NB: this means that users building images without the autodetect hook and a rudimentary hook like "block" will see warnings which are going to cause panic, chaos, and upheaval. I fully expect that this will result in extra non-work for me in the form of closing invalid bug reports. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-04-21functions: return a count of failures from map, if possibleDave Reisner1-1/+1
I don't have any particular use case for this, but it might be nice to have this available in the future. 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>
2013-03-13mkinitcpio: honor updates directory for firmwareDave Reisner2-2/+6
This also removes a check which would have otherwise hidden a missing firmware error from the user. FS#34255. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-03-13mkinitcpio: fix reference to bad variable nameDave Reisner1-1/+1
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-03-09lsinitcpio: shortcut lzop involvement to bsdtarDave Reisner1-8/+4
libarchive 3.1 supports LZO now, so we no longer need this indirection everywhere. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-02-28PKGBUILD: depend on systemd, not systemd-toolsDave Reisner1-1/+1
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-02-28mkinitcpio: use consistent style in case statementDave Reisner1-18/+36
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-02-28add zsh completionDaniel Wallace2-0/+65
add zsh completion for lsinitcpio and mkinitcpio Signed-off-by: Daniel Wallace <danielwallace@gtmanfred.com>