summaryrefslogtreecommitdiffstats
path: root/mkinitcpio
AgeCommit message (Collapse)AuthorFilesLines
2019-10-07Split the hookdir var creation and also add the hookdir option to the optparser.Giancarlo Razzolini1-3/+4
2019-10-04Merge branch 'master' of https://github.com/falconindy/mkinitcpio into ↵Giancarlo Razzolini1-15/+13
falconindy-master
2019-10-04[mkinitcpio] Fixup declaration and remove trailing :Morten Linderud1-4/+3
2019-10-04[mkinitcpio] Support multiple hook pathsMorten Linderud1-2/+9
2019-10-04Add flag to specify where to look for hooks.Morten Linderud1-0/+6
2019-09-17consolidate error reporting within generation pipelineDave Reisner1-15/+13
2019-09-09mkinitcpio: Produce reproducible initramfs imagesDaniel Edgecumbe1-10/+13
We achieve this by stripping timestamps from within the filesystem, and by using a pipeline to strip inodes from the cpio archive. It functions for at least the 'gzip', 'xz', 'bzip2', 'lz4' and 'cat' compressors. The 'lzop' compressor embeds a runtime timestamp. Motivation: https://reproducible-builds.org Signed-off-by: Daniel Edgecumbe <git@esotericnonsense.com>
2017-12-30cleanup some shellcheck lint warningsDave Reisner1-13/+11
2017-10-01Avoid erroneous deprecation warningsDave Reisner1-10/+2
Consistently handle hooks as symlinks by relying on the exit status of readlink instead of an lstat and always, additionally, examine the hooks basenames to ensure that we aren't warning about foo deprecating foo (because the hook is a symlink to somewhere else that the hook is actually stored on disk. ref: https://bugs.archlinux.org/task/55323
2017-03-19arrayize config vars in mkinitcpio.confDave Reisner1-4/+6
allows for backwards compat by detecting and converting old-style string-based configs.
2017-03-17mkinitcpio: allow -s to be passed through to presetsDave Reisner1-0/+2
ref: https://bugs.archlinux.org/task/53343
2016-11-25add missing -P, --allpresets option to usage outputDave Reisner1-0/+1
2016-11-20mkinitcpio: fixing quoting in call to initialize_buildrootDave Reisner1-1/+1
2016-07-17Support version extraction from i[3456]86 kernelsDave Reisner1-2/+2
Arch might not really support some of these, but mkinitcpio can.
2016-07-02error out if asked to extract a kver from image on non-x86v20Dave Reisner1-1/+7
Version extraction only works on x86 (i686 and x86_64) kernels. ref: https://bugs.archlinux.org/task/43256
2014-12-28mkinitcpio: expose syntax errors in preset filesAlexei Colin1-1/+1
2014-12-28mkinitcpio avoiding adding a CPIO entry for '.'Dave Reisner1-1/+1
The archive goes from looking like this: . ./buildconfig ./config ./init ./init_functions ./VERSION ./lib64 ./sbin To: buildconfig config init init_functions VERSION lib64 sbin Note the lack of the "root" entry and leading "./". This fixes an issue with packing ucode into the initramfs since the kernel really wants an exact match, and not path equivalency.
2014-03-30make missing compression binaries a non-fatal warningDave Reisner1-2/+10
Fallback on no compression at all, since we don't want to make potentially poor assumptions about what the kernel might support. Fixes FS#39659.
2013-12-22Add -l flag when using lz4 compressionDave Reisner1-0/+3
This isn't documented, but it's needed since the kernel lz4 support is based on the original streaming format and not the newer default. Use -l to force the legacy codec. Fixup lsinitcpio to support the older format, and, add a warning when the newer format is detected. Who knows when this will be "resolved" ... Upstream discussion: https://code.google.com/p/lz4/issues/detail?id=102
2013-12-06prevent calling a preset from a presetDave Reisner1-1/+6
This is surely a configuration error as it's an infinite loop.
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ächler1-1/+1
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-24mkinitcpio: Improve output when -d option is used.Thomas Bächler1-3/+7
2013-11-24mkinitcpio: add -d optionThomas Bächler1-5/+10
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-09-09add mkinitcpio version marker in buildroot creationDave Reisner1-3/+0
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-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 Reisner1-1/+2
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-07-08Generate /etc/ld.so.cache for imageDave Reisner1-0/+3
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-05-07move install_modules to functions to allow for testingDave Reisner1-41/+0
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-05-07remove "arbitrary" limit from index_of()Dave Reisner1-7/+4
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-24functions: implement add_firmwareDave Reisner1-1/+1
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-03-13mkinitcpio: honor updates directory for firmwareDave Reisner1-0/+1
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-02-28mkinitcpio: use consistent style in case statementDave Reisner1-18/+36
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-02-05Add -P, --allpresets optionDave Reisner1-10/+17
As a logical extension, allow the -p option to be specified multiple times in order to process several presets at once. Original-patch-by: Sébastien Luttringer <seblu@seblu.net> Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-01-21Do more to determine the color caps of the termDave Reisner1-16/+1
823e24 wasn't really correct, since running 'tput setaf 0' effectively sanity checks the terminfo as well as checking existance. However, it does nothing to affirm that the terminal is capable of supporting colors. Moreover, *never* fall back on the hardcoded escapes as doing so implies that we've found a broken terminfo and we have no idea what the terminal is capable of doing. This reverts commit 823e2454176d4381cd3acc30481e9d84cdc298b1.
2013-01-13factor out kver detection to functions fileDave Reisner1-18/+1
This leaves bash completion with a duplication, but this is intentional to avoid pulling in the entire functions file and worrying about pollution. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-01-12use type to determine availability of tputDave Reisner1-1/+1
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2013-01-12mkinitcpio: avoid using 'file' to get kernel versionsDave Reisner1-2/+17
The kernel defines an offset at a fixed location within the bzImage which we can use to find the kernel version string. Since this is fairly important, reimplement the algorithm (which file almost surely uses) using low level tools to avoid the possibility that file may break or change its output, critically wounding mkinitcpio. Note that this change leaves 'file' in use for lsinitcpio compression detection. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-12-02mkinitcpio: use fancy unicode in -L output0.12.0Dave Reisner1-2/+4
Denote deprecation with unicode superscript footnote markers. Yes, this inherently limits us to 9 deprecation notices in its current form, but there really shouldn't ever be so many deprecated items at once. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-11-26handle deprecation notices in -H and -LDave Reisner1-18/+78
Separate out the printing from these flags to separate functions and examine each hook more closely, pointing out where it might be deprecated, and what should be used in place of it. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-11-26replace find_in_dirs with PATH= manipulationDave Reisner1-8/+7
Declaring our lookup paths like normal colon delimited PATHs lets us reuse them for builtins like source and type to do the same work that this function previously did. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-11-26selectively decompress modules on installDave Reisner1-6/+19
Don't make any assumptions about the compression on modules and scan the passed in module list for telltale extensions. This has the benefit of doing nothing when modules are uncompressed, and adds support for decompression of XZ modules. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-11-26unique _modpaths arrays in during buildDave Reisner1-10/+11
Declaring _modpaths as an associative array allows us to forego the printf|sort -u|xargs cp pipeline as we can guarantee that the array is already prepared. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-11-24obsolete old-style install hook APIDave Reisner1-2/+1
This removes any meaning from the definitions of MODULES, BINARIES, FILES, and SCRIPT within install hooks. It also removed the deprecated checked_modules() function, which is replaced by add_checked_modules(). Signed-off-by: Dave Reisner <dreisner@archlinux.org>
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 Reisner1-3/+1
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-21convert autodetect cache to hashDave Reisner1-3/+4
If mkinitcpio -s is run, we still flush this cache to disk before exiting. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
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>