summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-09-06debian/tests: Add basic test for amd64 using busyboxBen Hutchings
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-09-06debian/tests: Add basic test for amd64 using klibc and not busyboxBen Hutchings
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-09-06debian/tests: Add common test preparation codeBen Hutchings
This should allow implementing various test cases without too much repetition. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-09-06Change "panic" parameter handling to work more like the kernelBen Hutchings
Negative timeout values are treated by the kernel as "reboot immediately" and 0 is treated as "wait forever". Emulate this behaviour in the panic() function. Treat invalid (non-numeric) values the same as 0, which seems to match what the kernel does. Previously we would ignore them completely and open a shell as normal. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-09-06Add FSTYPE config parameter to allow overriding filesystem type detectionBen Hutchings
This is needed for testing, and should also be useful for building more generic initramfs images. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-09-06initramfs.conf: Delete "NFS Section" commentBen Hutchings
There are no real sections in this file. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-09-06Add CI configuration for salsa.debian.orgBen Hutchings
2020-09-01hook-functions: copy_exec: Copy libgcc_s.so with any soversion up to 9Ben Hutchings
hppa and m68k have higher soversions for libgcc_s.so, so copy libgcc_s.so.[1-9] instead of assuming soversion 1. (I considered copying libgcc_s.so.*, but I'm unsure whether that will ever match extra development files that we don't want.) Closes: #959768 Signed-off-by: Ben Hutchings <benh@debian.org>
2020-09-01Remove obsolete update-initramfs state in /var/lib/initramfs-toolsBen Hutchings
update-initramfs used to keep track of which initramfs images it created and "owned", to avoid overwriting the output of another coinstalled initramfs generator. As discussed in #765750, this is no longer a concern and the state checks have been removed. Now that I'm confident this hasn't caused a regression, also remove the state updates and the state directory. After this, there is no turning back: a downgrade will leave update-initramfs owning nothing. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-09-01update-initramfs: Remove test for direct invocation from kernel packageBen Hutchings
The direct invocation of update-initramfs in kernel package maintainer scripts was removed in: - Debian linux 2.6.39-1, thus in wheezy - Ubuntu linux 4.15.0-18.19 (I think), thus in bionic - kernel-package 12.001, thus in Debian squeeze and Ubuntu lucid Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-08-19Merge branch 'add_zstd_format' into 'master'Ben Hutchings
un-,mkinitramfs: add support for zstd Closes: #955469 See merge request kernel-team/initramfs-tools!33
2020-08-19Merge branch 'fix-return-printf' into 'master'Ben Hutchings
Prevents printf error carry over if wrong console is set Closes: #960355 See merge request kernel-team/initramfs-tools!30
2020-08-19Merge branch 'master' into 'master'Ben Hutchings
When overriding configured compressor, warn the user. See merge request kernel-team/initramfs-tools!31
2020-07-29un-,mkinitramfs: add support for zstdNorbert Lange
Add support for zstd compression and decompression. Always use multithreaded compression, as zstd still generates identical archives. The zstd cmdline tool is usually able to decompress gzip, xz, lzma and lz4 so make sure to try the tool early. Signed-off-by: Norbert Lange <nolange79@gmail.com>
2020-06-19When overriding configured compressor, warn the user.Unit 193
2020-06-08scripts/functions: Prevents printf error carry over if wrong console is setGuilherme G. Piccoli
Currently the _log_msg() functions is "void" typed - with no return -, which in terms of shell means it returns whatever its last command returns. This function is the basic building block for all error/warning messages in initramfs-tools. It was noticed [0] that in case of bad console is provided to kernel on command-line, printf (and apparently all write()-related functions) returns error, and so this error is carried over in _log_msg(). Happens that checkfs() function has a loop that runs forever in this scenario (*if* fsck is not present in initramfs, and obviously if "quiet" is not provided in the command-line). The situation is easily reproducible and we can find various reports dating back some years. The reports usually are of the form "machine can't boot if wrong console is provided" or slightly different forms of that, almost always relating serial consoles with boot issues. This patch proposes a pretty simple fix: return zero on _log_msg(). We should definitely not brake the boot due to error log functions; one could argue we could fix checkfs() and that's true, until eventually we find another subtle corner case of "misuse" of the _log_msg() return value (after some debugging), and fix that too, and so on... W could also argue that printf shouldn't return error in this case, and although a valid discussion, it's not worth to have users waiting on a dilemma while boot is quite easy to brake, just by passing a wrong kernel parameter (or having the underlying serial console device changed to output to a different port than the previously set on kernel cmdline). [0] bugs.launchpad.net/cloud-images/+bug/1573095/comments/46 Signed-off-by: Guilherme G. Piccoli <gpiccoli@canonical.com>
2020-05-23hook-functions: Add modules needed for Pinebook LCD display.Vagrant Cascadian
The Pinebook LCD disply does not show output until after the initramfs is loaded, which is too late to enter an encryption passphrase or debug issues with mounting the rootfs. Fix this by adding modules to "fb": analogix-anx6345, pwm-sun4i, sun4i-drm and sun8i-mixer.
2020-04-28debian/control, docs/maintainer-notes.md: Use my @debian.org addressBen Hutchings
I'm now using benh@debian.org in debian/changelog, so make these consistent. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-04-28docs/maintainer-notes.md: Use archive.org URL for Daniel Baumann docBen Hutchings
documentation.debian-projects.org seems to have gone away many years ago, but web.archive.org has a copy so link to that. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-04-28docs/maintainer-notes.md: Use Gitlab markup for definition tableBen Hutchings
This requires a heading row, so add one. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-04-28docs/maintainer-notes.md: Use Gitlab markup for table of contentsBen Hutchings
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-04-28docs/maintainer-notes.md: Delete the horizontal rulesBen Hutchings
This is a short document and there is no need to break it up this much. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-04-28Releasing version 0.137.Ben Hutchings
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-04-28hook-functions: Search for firmware under /lib/firmware/updatesAP
I like to keep up with the official kernel releases. As a result the firmware they wind up requiring is newer than what is available in firmware packages. I placed the firmware from the git repo in /lib/firmware/updates/ which the kernel searches before /lib/firmware. Kernel can find them but update-initramfs cannot. I have attached an initial patch that solves this. I am currently using the resultng code and it is working fine for me. The one thing the patch does not do is allow for a custom location that can be provided to the kernel to search first. This is because that's a little more complicated and requires a decision wrt where to specify this location (ie the config file?). [bwh: Text above is from AP's bug report with minor edits; I added the subject line.] Closes: #956663 Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-04-28Fix new shellcheck warnings around unquoted parameter expansionBen Hutchings
These all seem to be harmless in practice, as the parameter values should not contain metacharacters. In _checkfs_once() *do not* quote $spinner or $force; if these are empty then we do not want to add arguments for them. Add a comment to suppress the warning. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-03-30hook-functions: Don't add backlight modules if we have generic fb deviceBen Hutchings
If we have a generic framebuffer device then there should be no need to set up any backlight in early boot. Also, backlight devices are sometimes handled by large drm drivers like i915 which we don't want to include by default. Fixes: da8519036860 ("hook-functions: Include modules for Chromebook ...") Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-03-30hook-functions: Factor out device class walking into a functionBen Hutchings
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-01-30hook-functions: copy_exec: Correct verbose log message for symlinksBen Hutchings
It was logging the link target, not the name of the symlink. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-01-30hook-functions: copy_exec: Copy libgcc_s.so.0 along with libpthread.soBen Hutchings
pthread_cancel() in libpthread.so.1 depends on functions in libgcc_s.so.0, but uses dlopen() to link to it rather than having a static dependency. Handle this dynamic dependency in copy_exec so that it doesn't have to be handled in every affected hook script. Closes: #950254 Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-01-30Document copy_exec as usable for shared librariesBen Hutchings
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-01-18Releasing version 0.136.Ben Hutchings
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-01-18mkinitramfs: Enable multihreaded xz compressionBen Hutchings
Enable multithreading across all CPUs. Don't change the compression level as suggested, though. Users who still want faster compression should choose a different compressor. Closes: #942144 Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-01-18hook-functions: Drop ext4dev from filesystem module listBen Hutchings
This is obsolete since Linux 2.6.28. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-01-18init: Mount /dev with "exec" option if v86d is presentBen Hutchings
v86d currently maps parts of /dev/mem as executable, even though it may use an emulator. For now, only mount /dev with the "noexec" option if it's not present. Closes: #940171 Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-01-18update-initramfs: Make "-c -k all" options useful againBen Hutchings
"update-initramfs -c -k all" used to re-create initramfs images if they had been deleted without using "update-initramfs -d", as it used the state directory to determine which kernel versions should have them. Since commit f39625a "update-initramfs: Make "-k all" take over other initramfs images", it ignores the state directory and is almost equivalent to "update-initramfs -u -k all". Change it to operate on all installed kernel versions. This will ignore which kernel versions suppressed initramfs generation, but I think it's reasonable to assume users won't use these options if they have installed such kernels. Closes: #926401 Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-01-18init: Remove special case for kernel parameter resume=UUID=...Ben Hutchings
This reverts commit 9f7bb9c72b5a50c0fbcd5f501072d3ff5aab91c4. All the keyword=value forms for block device naming are now handled in resolve_device. Related-to: #944777 Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-01-18mkinitramfs: Copy modules.builtin.bin into initramfsBen Hutchings
modinfo now prints an error message if modules.builtin.bin (created by depmod) is missing. Copy it in early if it's present. Closes: #948257 Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-01-18Revert "mkinitramfs: check if initramfs has a shell"Ben Hutchings
This reverts commit 9c823ad2b3284a6bd5cfbdfdd699d3e033cadd3f. It did not solve the problem it was intended to, because it used "$DESTDIR" in the destination argument to copy_exec and would therefore copy to /var/tmp/<something> inside the initramfs. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-01-18initramfs-tools(7): Change example to use copy_exec instead of cpBen Hutchings
Executables should always be installed into the initramfs with copy_exec. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-01-18Merge branch 'cgzones-guest/initramfs-tools-selinux'Ben Hutchings
Do not copy SELinux context in mkinitramfs (Closes: #948365) See merge request kernel-team/initramfs-tools!25
2020-01-18mkinitramfs: Use cp -p option for ld.so.conf* instead of -aZBen Hutchings
This is consistent with all the other copies into the initramfs. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-01-18Merge branch 'tighten-run-initramfs-perms' into 'master'Ben Hutchings
Tighten permissions for /run/initramfs See merge request kernel-team/initramfs-tools!22
2020-01-18Tighten permissions for /run/initramfsTopi Miettinen
/run/initramfs contains a log file from fsck of root file system, which could perhaps contain sensitive information, for example if /home or /var are also located there and fsck is triggered. Let's tighten the permissions to 0700. Signed-off-by: Topi Miettinen <toiwoton@gmail.com>
2020-01-18Merge branch 'janitor-bot-guest/initramfs-tools-lintian-fixes'Ben Hutchings
Fix some issues reported by lintian See merge request kernel-team/initramfs-tools!21
2020-01-18debian/rules: Suppress execution of dh_installinitramfsBen Hutchings
debhelper 12 wants to run dh_installinitramfs, but we don't want this - in particular, because it makes initramfs-tools-core's maintainer scripts run update-initramfs. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-01-13Do not copy SELinux context in mkinitramfs (Closes: #948365)Christian Göttsche
Instead use the default one with option 'Z'.
2020-01-11Merge branch 'f2fs' into 'master'Ben Hutchings
hook-functions: Add f2fs as base in auto_add_modules See merge request kernel-team/initramfs-tools!24
2020-01-11hook-functions: Add f2fs as base in auto_add_modulesRomain Perier
For people wanting to change their filesystem to F2FS or for embedded devices with eMMC or sdcard, add the f2fs module and its dependency as base module. Moreover, this adds "crc32" as hidden dependency module for f2fs.
2020-01-07mkinitramfs: Remove armhf dynamic linker hackBen Hutchings
This reverts commit da64d1a11ca8680e69d67c192b8d6e60be6411ee, which was a workaround for the inconsistent choices of interpreter path in the early days of armhf and the limitations of copy_file at the time. Now that copy_file automatically replicates symlinks and their targets, we don't need to do anything special about the dynamic linker. An initramfs built for Debian 10 on armhf currently contains: /lib/arm-linux-gnueabihf/ld-2.28.so regular file /lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 link to ld-2.28.so /lib/arm-linux-gnueabihf/ld-linux.so.3 link to /lib/ld-linux-armhf.so.3 /lib/ld-linux-armhf.so.3 regular file There are two *copies* of the dynamic linker as well as two symlinks to one or the other of them. After this commit, the initramfs contains: /lib/arm-linux-gnueabihf/ld-2.28.so regular file /lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 link to ld-2.28.so /lib/ld-linux-armhf.so.3 link to arm-linux-gnueabihf/ld-2.28.so The /lib/…/ld-linux.so.3 symlink is no longer created, because Debian armhf binaries all use /lib/ld-linux-armhf.so.3 as the interpreter path, but it would be created if we ever switched over. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2020-01-07mkinitramfs: Remove special case for Arm OABI portsBen Hutchings
This reverts commit 879602b218973fc7a5f92874bbaf41ea818fae31. The arm (OABI little-endian) port was replaced by armel and was last released in Debian 5.0. The armeb (OABI big-endian) port never made it into a Debian release and has died off completely. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>