summaryrefslogtreecommitdiff
path: root/src/kernel-install
Commit message (Collapse)AuthorAgeFilesLines
* 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-302-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-231-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-231-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-231-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-231-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.
* kernel-install: fix help outputSébastien Luttringer2013-12-091-1/+1
| | | | | | Kernel install doesn't need the second argument on his command line when removing. This is correctly documented in the man page.
* kernel-install: add -h/--helpZbigniew Jędrzejewski-Szmek2013-12-081-7/+14
|
* kernel-install: add compat with 'installkernel'Tom Gundersen2013-10-011-3/+9
| | | | | | | | | | | If 'kernel-install' is called as 'installkernel' it will be compatible with the syntax used by the kernel's build system. This means it can be called by doing 'make install' in a kernel build directory, if the correct symlink has been installed (which we don't do by default yet). [Edit harald@redhat.com: removed basename and use shift]
* kernel-install: avoid using 'cp --preserve'Tom Gundersen2013-09-271-1/+3
| | | | Force 0644 and root:root instead, to avoid problems with fat filesystems.
* kernel-install/90-loaderentry.install: do not fail for missing initrdHarald Hoyer2013-07-111-0/+1
|
* kernel-install: filter out "initrd=" from /proc/cmdlineHarald Hoyer2013-06-201-2/+9
|
* kernel-install: add default install scriptsHarald Hoyer2013-05-063-57/+96
| | | | | | | | | | | | | Do the depmod in the kernel-install hooks, so hooks can produce/install kernel modules and be part of the depmod. Also move the basic boot loader entry creation and removal to a plugin script. If PRETTY_NAME is not defined in /etc/os-release, fallback to PRETTY_NAME="Linux $KERNEL_VERSION". Add documentation for everything in the man page.
* kernel-install: Clean upMantas Mikulėnas2013-04-301-62/+75
| | | | | | | | | - Consistent use of $VAR vs ${VAR} - Consistent use of && vs 'if' - Add error checking to some places - Consistent error messages ("Can't" vs "Cannot", etc.) - Function declarations at the top - Miscellaneous adjustments
* kernel-install: don't make unused parameter mandatoryMarc-Antoine Perennou2013-04-081-1/+5
| | | | | | We only use the image name in the case we're adding a kernel Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
* kernel-install: rename the loader entry filenameHarald Hoyer2013-02-261-1/+1
| | | | | | | | The wildcard matching the default loader entry should always be able to point to the same machine. So instead of sorting by <distribution>-<kernel-version>-<machine-id> we better sort by <machine-id>-<kernel-version>.
* kernel-install: create the loader entries with absolute paths relative to /bootHarald Hoyer2013-02-261-2/+2
|
* kernel-install: replace URLs with man pages in the error messagesHarald Hoyer2013-02-261-2/+2
|
* kernel-install: fixed paths in boot loader entryHarald Hoyer2013-02-261-13/+15
| | | | For the loader entry a relative path has to be used.
* kernel-install: remove LANG=Kay Sievers2013-02-251-2/+0
|