summaryrefslogtreecommitdiffstats
path: root/src/kernel-install (follow)
Commit message (Collapse)AuthorAgeFilesLines
* kernel-install: drop redundant "/"Yu Watanabe2020-11-241-1/+1
| | | | | | | | | | | | | | | | Follow-up for 1cdbff1c844ce46f1d84d8feeed426ebfd550988. After the commit 1cdbff1c844ce46f1d84d8feeed426ebfd550988, each entry .conf contains redundant slash like the following: ``` $ cat xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-5.9.8-200.fc33.x86_64.conf title Fedora 33 (Thirty Three) version 5.9.8-200.fc33.x86_64 machine-id xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx options root=/dev/nvme0n1p2 ro rootflags=subvol=system/fedora selinux=0 audit=0 linux //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/5.9.8-200.fc33.x86_64/linux initrd //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/5.9.8-200.fc33.x86_64/initrd ```
* meson: add option to skip installing to $sysconfdirJörg Thalheim2020-11-121-10/+13
| | | | | | | | | | | | | | | | | | | | | This is useful for development where overwriting files out side the configured prefix will affect the host as well as stateless systems such as NixOS that don't let packages install to /etc but handle configuration on their own. Alternative to https://github.com/systemd/systemd/pull/17501 tested with: $ mkdir inst build && cd build $ meson \ -Dcreate-log-dirs=false \ -Dsysvrcnd-path=$(realpath ../inst)/etc/rc.d \ -Dsysvinit-path=$(realpath ../inst)/etc/init.d \ -Drootprefix=$(realpath ../inst) \ -Dinstall-sysconfdir=false \ --prefix=$(realpath ../inst) .. $ ninja install
* license: LGPL-2.1+ -> LGPL-2.1-or-laterYu Watanabe2020-11-092-2/+2
|
* Merge pull request #16777 from DaanDeMeyer/kernel-install-followupZbigniew Jędrzejewski-Szmek2020-08-251-2/+5
|\ | | | | kernel-install: "Linux" => "Default" and reuse $BOOT/Default if it already exists
| * kernel-install: Reuse $BOOT/Default if it already existsDaan De Meyer2020-08-241-1/+4
| | | | | | | | | | Avoids duplicate installation problems when the machine ID is initialized after a kernel is already installed under $BOOT/Default.
| * kernel-install: Use "Default" as fallback instead of "Linux"Daan De Meyer2020-08-241-1/+1
| | | | | | | | | | | | "Linux" conflicts /efi/Linux when /efi is the install location. /efi/Linux is already reserved for unified kernel images so we can't use it for type #1 images. Instead, we use "Default".
* | tree-wide: fix spelling of "fallback"Zbigniew Jędrzejewski-Szmek2020-08-201-1/+1
|/ | | | | | Similarly to "setup" vs. "set up", "fallback" is a noun, and "fall back" is the verb. (This is pretty clear when we construct a sentence in the present continous: "we are falling back" not "we are fallbacking").
* kernel-install: Add fallback to "Linux" if no machine-id is foundDaan De Meyer2020-08-101-12/+3
| | | | | This allows kernel-install to be used by image builders such as mkosi which don't have a machine-id available when they call kernel-install.
* kernel-install/90-loaderentry: fix when /boot is not mountpointKir Kolyshkin2020-08-031-2/+3
| | | | | | | | | | | | | | | | | | I happen to have a machine where /boot is not a separate mountpoint, but rather just a directory under /. After upgrade to recent Fedora, I found out that grub2 can't find any new kernels. This happens because loadentry script generates kernel and initrd file paths relative to /boot, while grub2 expects path to be relative to the root of filesystem on which they are residing. This commit fixes this issue by using stat's %m to find the mount point of a partition holding the images, and using it as a prefix to be removed from ENTRY_DIR_ABS. Note that %m for stat requires coreutils 8.6, released in Oct 2010. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
* kernel-install: extend --helpZbigniew Jędrzejewski-Szmek2020-06-051-2/+5
|
* Add meson build option to prevent building kernel-installJakov Smolic2020-04-141-12/+16
| | | | | | | This commit introduces new meson build option "kernel-install" to prevent kernel-install from building if the user sets the added option as "false". Signed-off-by: Jakov Smolic <jakov.smolic@sartura.hr> Signed-off-by: Luka Perkov <luka.perkov@sartura.hr>
* treewide: more portable bash shebangsJörg Thalheim2020-03-054-4/+4
| | | | | | | | | | | | | | | | As in 2a5fcfae024ffc370bb780572279f45a1da3f946 and in 3e67e5c9928f8b1e1c5a63def88d53ed1fed12eb using /usr/bin/env allows bash to be looked up in PATH rather than being hard-coded. As with the previous changes the same arguments apply - distributions have scripts to rewrite shebangs on installation and they know what locations to rely on. - For tests/compilation we should rather rely on the user to have setup there PATH correctly. In particular this makes testing from git easier on NixOS where do not provide /bin/bash to improve compose-ability.
* kernel-install: strip BOOT_IMAGE= from kernel optionsZbigniew Jędrzejewski-Szmek2020-02-261-0/+1
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=1716164.
* kernel-install: do not require non-empty kernel cmdlineZbigniew Jędrzejewski-Szmek2019-08-271-10/+4
| | | | | | | | | | | | | | | | | | | | | | When booting with Fedora-Server-dvd-x86_64-30-20190411.n.0.iso, /proc/cmdline is empty (libvirt, qemu host with bios, not sure if that matters), after installation to disk, anaconda would "crash" in kernel-core %posttrans, after calling kernel-install, because dracut would fail with > Could not determine the kernel command line parameters. > Please specify the kernel command line in /etc/kernel/cmdline! I guess it's legitimate, even if unusual, to have no cmdline parameters. Two changes are done in this patch: 1. do not fail if the cmdline is empty. 2. if /usr/lib/kernel/cmdline or /etc/kernel/cmdline are present, but empty, ignore /proc/cmdline. If there's explicit configuration to have empty cmdline, don't ignore it. The same change was done in dracut: https://github.com/dracutdevs/dracut/pull/561.
* kernel-install: add a check that the vmlinuz arg is saneZbigniew Jędrzejewski-Szmek2019-04-031-0/+5
|
* kernel-install: create the entry directory only if $BOOT/$MACHINE_ID existsZbigniew Jędrzejewski-Szmek2019-03-123-6/+34
| | | | | | | | | | | | | Things are currently fairly ugly in Fedora: we create $BOOT/$MACHINE_ID/$KERNEL_VERSION/, and then 20-grub.install that is installed by grub2-common.rpm wants to remove that directory before 50-dracut.install get a chance to run. 50-dracut.install checks for the presence of that directory to decide where to install the kernel. So let's make the creation of the directory conditional. Previous commit changes bootctl install to create $BOOT/$MACHINE_ID, and this commit makes kernel-install not create it. In effect, the entry directory will only be created if 'bootctl install' or something else created the parent directory. https://bugzilla.redhat.com/show_bug.cgi?id=1648907
* kernel-install: rename $BOOT_DIR[_ABS] to $ENTRY_DIR[_ABS]Zbigniew Jędrzejewski-Szmek2019-03-123-37/+37
| | | | | | | | "BOOT" is misleading, because it sounds like this refers to /boot or $BOOT, when in fact it refers to some subdirectory. Those variable names are purely interal, so we can change them. $BOOT_DIR_ABS was used in NEWS, but it should not be (because it is an internal detail), so the old NEWS entry is reworded to use "entry directory".
* kernel-install: add --verboseZbigniew Jędrzejewski-Szmek2019-03-113-1/+22
| | | | | | This makes it easier to see what is going on. Documentation for --verbose and --help is added to the man page. Our plugins are updated to also log a bit.
* kernel-install/50-depmod: use standard headerZbigniew Jędrzejewski-Szmek2019-03-111-5/+11
|
* kernel-install: fix dracut initrd detection (240 backward compatibility) ↵Marc-Antoine Perennou2019-01-272-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#11570) * kernel-install: fix initrd when called as installkernel Running make install from the kernel runs e.g.: installkernel 4.20.5 arch/x86/boot/bzImage System.map "/boot" Since 0912c0b80eb24fb9a4e1cc4abf274a1358b9943d this would cal 90-loaderentry.install with those arguments: add 4.20.5 /boot/... arch/x86/boot/bzImage System.map "/boot" The two last arguments would then be handled as the initrd files. As System.map exists in current directory but not in /boot/... it would get copied there, and used as initrd intead of the initrd which has been generated by dracut. With this change, nothing changes when kernel-install is called directly, but when it's called as installkernel, we now pass thos arguments to 90-loaderentry.install: add 4.20.5 /boot/... arch/x86/boot/bzImage initrd initrd is thus detected as the file to use for the initrd, and as it exists, nothing is copied over and the initrd line generated is consistent with what one would expect * kernel-install: fix dracut initrd detection when called directly This brings back the systemd 240 behaviour when called directly too * kernel-install: unify initrd fallback * kernel-install: move initrd fallback handling to 90-loaderentry.install * kernel-install: move initrd fallback just before creating loader entry
* Add multiple initrd file support to kernel-installMike Auty2019-01-182-14/+19
| | | | | | | Instead of having just a single INITRD field, add support for all additional parameters being INITRD fields in order. Signed-off-by: Mike Auty <mike.auty@gmail.com>
* Improve kernel-install support for initrd files. (#11281)ikelos2018-12-292-2/+13
| | | | | | | | The current support in kernel-install for initrd images doesn't copy over the initrd file or allow a means for it to be specified (it requires a specific filename in a particular directory). This patchset adds support for (optionally) providing the name of initial ramdisk file to copied over and used by kernel-install.
* kernel-install: teach bot loader spec entry generator to generate entries ↵Lennart Poettering2018-10-191-2/+14
| | | | | | | | | | | | | | | | | | with "tries" This makes two changes: 1. When called for "remove" any drop-ins with "+" suffix are removed too, so that the logic works for entries with boot counting enabled too and we don't lose track of configuration snippets created that way. 2. When called for "add" we optionally generate a "+" suffix, based on the data in /etc/kernel/tries if it exists. This basically means after "echo 5 > /etc/kernel/tries" any installed kernels will automatically set up for 5 boot tries before older kernels will be tried.
* kernel-install: don't try to run depmod when kernel doesn't support modulesMarc-Antoine Perennou2018-08-081-0/+1
| | | | Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
* tree-wide: drop copyright lines for more authorsZbigniew Jędrzejewski-Szmek2018-06-221-1/+0
| | | | Acks in https://github.com/systemd/systemd/issues/9320.
* Drop my copyright headersZbigniew Jędrzejewski-Szmek2018-06-141-2/+0
| | | | | | | perl -i -0pe 's/\s*Copyright © .... Zbigniew Jędrzejewski.*?\n/\n/gms' man/*xml git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/(#\n)?# +Copyright © [0-9, -]+ Zbigniew Jędrzejewski.*?\n//gms' git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/\s*\/\*\*\*\s+Copyright © [0-9, -]+ Zbigniew Jędrzejewski[^\n]*?\s*\*\*\*\/\s*/\n\n/gms' git grep -e 'Copyright.*Jędrzejewski' -l | xargs perl -i -0pe 's/\s+Copyright © [0-9, -]+ Zbigniew Jędrzejewski[^\n]*//gms'
* tree-wide: beautify remaining copyright statementsLennart Poettering2018-06-142-2/+2
| | | | | | Let's unify an beautify our remaining copyright statements, with a unicode ©. This means our copyright statements are now always formatted the same way. Yay.
* tree-wide: drop license boilerplateZbigniew Jędrzejewski-Szmek2018-04-061-13/+0
| | | | | | | | | | Files which are installed as-is (any .service and other unit files, .conf files, .policy files, etc), are left as is. My assumption is that SPDX identifiers are not yet that well known, so it's better to retain the extended header to avoid any doubt. I also kept any copyright lines. We can probably remove them, but it'd nice to obtain explicit acks from all involved authors before doing that.
* kernel-install: Don't install BLS kernel images if dest dir doesn't exist ↵Javier Martinez Canillas2018-02-281-0/+4
| | | | | | | (#8306) The script shouldn't rely on a previous script exiting with a status code that prevents it to be executed. Instead, should check if the destination directory for the BLS kernel image exists and exit otherwise.
* Add license headers and SPDX identifiers to meson.build filesZbigniew Jędrzejewski-Szmek2017-11-191-0/+17
| | | | | | | So far I avoided adding license headers to meson files, but they are pretty big and important and should carry license headers like everything else. I added my own copyright, even though other people modified those files too. But this is mostly symbolic, so I hope that's OK.
* Add SPDX license headers to various assorted filesZbigniew Jędrzejewski-Szmek2017-11-191-0/+1
|
* build-sys: drop automake supportZbigniew Jędrzejewski-Szmek2017-07-181-1/+0
| | | | | v2: - also mention m4
* kernel-install: support the case /etc/machine-id is missing or empty (#5975)Yu Watanabe2017-05-302-14/+21
| | | | | | | | | | | | Some .install plugins does not require that machine ID is set such as 20-grubby.install for Fedora and 50-depmod.install. To support such plugins to run without valid machine-id, this commit makes the following change: * if /etc/machine-id is missing or empty, create temporary directory and set its path to BOOT_DIR_ABS, * run the .install helpers with KERNEL_INSTALL_MACHINE_ID environment variable that'd be empty if /etc/machine-id is missing or empty. This may be useful for installing kernel for e.g. stateless systems which initialize machine-id while booting the systems.
* meson: reindent all files with 8 spacesZbigniew Jędrzejewski-Szmek2017-04-241-2/+0
| | | | | | | The indentation for emacs'es meson-mode is added .dir-locals. All files are reindented automatically, using the lasest meson-mode from git. Indentation should now be fairly consistent.
* meson: use join_paths consistentlyMichael Biebl2017-04-241-1/+1
| | | | | With -Dsplit-usr=true, we set rootprefix to /. This leads to //lib/systemd or //lib/udev for various dir variables. Using join_paths() avoids this.
* meson: create dirs and touch /usrZbigniew Jędrzejewski-Szmek2017-04-241-0/+3
| | | | | | | | | This is the equivalent of $(INSTALL_DIRS) and install-touch-usr-hook. I did not bother to create the directories into which we install files, since they will be created anyway. v2: - remove bashism
* meson: build systemd using mesonZbigniew Jędrzejewski-Szmek2017-04-241-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's crucial that we can build systemd using VS2010! ... er, wait, no, that's not the official reason. We need to shed old systems by requring python 3! Oh, no, it's something else. Maybe we need to throw out 345 years of knowlege accumulated in autotools? Whatever, this new thing is cool and shiny, let's use it. This is not complete, I'm throwing it out here for your amusement and critique. - rules for sd-boot are missing. Those might be quite complicated. - rules for tests are missing too. Those are probably quite simple and repetitive, but there's lots of them. - it's likely that I didn't get all the conditions right, I only tested "full" compilation where most deps are provided and nothing is disabled. - busname.target and all .busname units are skipped on purpose. Otherwise, installation into $DESTDIR has the same list of files and the autoconf install, except for .la files. It'd be great if people had a careful look at all the library linking options. I added stuff until things compiled, and in the end there's much less linking then in the old system. But it seems that there's still a lot of unnecessary deps. meson has a `shared_module` statement, which sounds like something appropriate for our nss and pam modules. Unfortunately, I couldn't get it to work. For the nss modules, we need an .so version of '2', but `shared_module` disallows the version argument. For the pam module, it also didn't work, I forgot the reason. The handling of .m4 and .in and .m4.in files is rather awkward. It's likely that this could be simplified. If make support is ever dropped, I think it'd make sense to switch to a different templating system so that two different languages and not required, which would make everything simpler yet. v2: - use get_pkgconfig_variable - use sh not bash - use add_project_arguments v3: - drop required:true and fix progs/prog typo v4: - use find_library('bz2') - add TTY_GID definition - define __SANE_USERSPACE_TYPES__ - use join_paths(prefix, ...) is used on all paths to make them all absolute v5: - replace all declare_dependency's with [] - add more conf.get guards around optional components v6: - drop -pipe, -Wall which are the default in meson - use compiler.has_function() and compiler.has_header_symbol instead of the hand-rolled checks. - fix duplication in 'liblibsystemd' library name - use the right .sym file for pam_systemd - rename 'compiler' to 'cc': shorter, and more idiomatic. v7: - use ENABLE_ENVIRONMENT_D not HAVE_ENVIRONMENT_D - rename prefix to prefixdir, rootprefix to rootprefixdir ("prefix" is too common of a name and too easy to overwrite by mistake) - wrap more stuff with conf.get('ENABLE...') == 1 - use rootprefix=='/' and rootbindir as install_dir, to fix paths under split-usr==true. v8: - use .split() also for src/coredump. Now everything is consistent ;) - add rootlibdir option and use it on the libraries that require it v9: - indentation v10: - fix check for qrencode and libaudit v11: - unify handling of executable paths, provide options for all progs This makes the meson build behave slightly differently than the autoconf-based one, because we always first try to find the executable in the filesystem, and fall back to the default. I think different handling of loadkeys, setfont, and telinit was just a historical accident. In addition to checking in $PATH, also check /usr/sbin/, /sbin for programs. In Fedora $PATH includes /usr/sbin, (and /sbin is is a symlink to /usr/sbin), but in Debian, those directories are not included in the path. C.f. https://github.com/mesonbuild/meson/issues/1576. - call all the options 'xxx-path' for clarity. - sort man/rules/meson.build properly so it's stable
* kernel-install: remove unneeded modules.* files created by depmod (#5766)Yu Watanabe2017-04-211-2/+10
| | | Fixes #5765.
* kernel-install: avoid process substitutionMichal Schmidt2017-01-111-4/+4
| | | | | | | | | bash implements process substitution using /dev/fd/N (this is documented in man bash). We'd like kernel-install to work in chrooted RPM scriptlets without /dev. We can use here-strings instead. bash uses temporary files to implement those.
* kernel-install: use exit instead of return (#4565)Yu Watanabe2016-11-041-2/+2
| | | | | /bin/kernel-install: line 143: return: can only `return' from a function or sourced script https://bugzilla.redhat.com/show_bug.cgi?id=1391829
* kernel-install: allow plugins to terminate the procedure (#4174)Zbigniew Jędrzejewski-Szmek2016-09-241-2/+12
| | | Replaces #4103.
* Revert "kernel-install: Add KERNEL_INSTALL_NOOP (#4103)"Martin Pitt2016-09-171-7/+0
| | | | | | | Further discussion showed that this better gets addressed at the packaging level. This reverts commit 34210af7c63640fca1fd4a09fc23b01a8cd70bf3.
* kernel-install: Add KERNEL_INSTALL_NOOP (#4103)Colin Walters2016-09-141-0/+7
| | | | | | | Will be used by rpm-ostree (and likely lorax) to suppress RPM->kernel->%posttrans->dracut runs, and basically everything else this script is doing. I'll also likely change the `kernel.spec` to respect this as well.
* kernel-install: when searching for location to place kernel consider /efiLennart Poettering2016-07-211-3/+8
| | | | | | | | | | With this change kernel-install will now first look for an existing kernel installation in /efi, /boot and /boot/efi. If none is found, /efi is used if it is a mount point, otherwise /boot/efi if it is one. If nothing of that worked /boot is used without further checking. This means /boot should be the default unless something was installed before or something else was explicitly mounted.
* kernel-install: recognize /boot/efi mountpoint (#3751)Harald Hoyer2016-07-192-2/+11
| | | install everything in /boot/efi, if this is a mountpoint
* 90-loaderentry.install: fixup BOOT_OPTIONSHarald Hoyer2015-06-021-3/+3
| | | | | better use "read -r -d '' -a" to read in the array. It handles multiple lines and missing newline at the EOF.
* kernel-install/90-loaderentry.install: fix cmdline parsingMichael Chapman2014-11-011-1/+1
| | | | | | | | | | | | | | | A recent commit (2f3a215) changed the parsing of /proc/cmdline to use a shell array. Unfortunately, this introduced a bug: "read -ar line" populates the shell variable $r, not $line. This breaks installation of new loader entries: # kernel-install add 3.17.1-304.fc21.x86_64 \ /boot/vmlinuz-3.17.1-304.fc21.x86_64 Could not determine the kernel command line parameters. Please specify the kernel command line in /etc/kernel/cmdline! This commit alters the read command to correctly populate the $line array instead.
* kernel-install/90-loaderentry.install: fixed cmdline parsingHarald Hoyer2014-08-151-5/+4
| | | | | | If /etc/kernel/cmdline is missing or empty, we read /proc/cmdline and want to filter out the initrd line. Due to a bug, the whole contents was filtered out.
* build-sys: add missing Makefile linkLennart Poettering2014-06-161-0/+1
|
* os-release: define /usr/lib/os-release as fallback for /etc/os-releaseLennart Poettering2014-06-131-0/+2
| | | | | | | | | | | | | | | | The file should have been in /usr/lib/ in the first place, since it describes the OS container in /usr (and not the configuration in /etc), hence, let's support os-release files in /usr/lib as fallback if no version in /etc exists, following the usual override logic. A prior commit already enabled tmpfiles to create /etc/os-release as a symlink to /usr/lib/os-release should it be missing, thus providing nice compatibility with applications only checking in /etc. While it's probably a good idea if all apps check both locations via a fallback logic, it is only necessary in the early boot process, as long as the /etc/os-release symlink has not been restored, in case we boot with an empty /etc.