]> git.ipfire.org Git - thirdparty/dracut.git/log
thirdparty/dracut.git
4 years agofix(zipl): shellcheck for modules.d/91zipl
Harald Hoyer [Fri, 26 Mar 2021 09:29:24 +0000 (10:29 +0100)] 
fix(zipl): shellcheck for modules.d/91zipl

4 years agofix(crypt-loop): shellcheck for modules.d/91crypt-loop
Harald Hoyer [Fri, 26 Mar 2021 09:29:24 +0000 (10:29 +0100)] 
fix(crypt-loop): shellcheck for modules.d/91crypt-loop

4 years agofix(qemu): shellcheck for modules.d/90qemu
Harald Hoyer [Fri, 26 Mar 2021 09:29:23 +0000 (10:29 +0100)] 
fix(qemu): shellcheck for modules.d/90qemu

4 years agofix(ppcmac): shellcheck for modules.d/90ppcmac
Harald Hoyer [Fri, 26 Mar 2021 09:29:22 +0000 (10:29 +0100)] 
fix(ppcmac): shellcheck for modules.d/90ppcmac

4 years agofix(nvdimm): shellcheck for modules.d/90nvdimm
Harald Hoyer [Fri, 26 Mar 2021 09:29:22 +0000 (10:29 +0100)] 
fix(nvdimm): shellcheck for modules.d/90nvdimm

4 years agofix(multipath): shellcheck for modules.d/90multipath
Harald Hoyer [Fri, 26 Mar 2021 09:29:22 +0000 (10:29 +0100)] 
fix(multipath): shellcheck for modules.d/90multipath

4 years agofix(lvm): shellcheck for modules.d/90lvm
Harald Hoyer [Fri, 26 Mar 2021 09:29:21 +0000 (10:29 +0100)] 
fix(lvm): shellcheck for modules.d/90lvm

4 years agofix(livenet): shellcheck for modules.d/90livenet
Harald Hoyer [Fri, 26 Mar 2021 09:29:21 +0000 (10:29 +0100)] 
fix(livenet): shellcheck for modules.d/90livenet

4 years agofix(kernel-network-modules): shellcheck for modules.d/90kernel-network-modules
Harald Hoyer [Fri, 26 Mar 2021 09:29:21 +0000 (10:29 +0100)] 
fix(kernel-network-modules): shellcheck for modules.d/90kernel-network-modules

4 years agofix(kernel-modules-extra): shellcheck for modules.d/90kernel-modules-extra
Harald Hoyer [Fri, 26 Mar 2021 09:29:20 +0000 (10:29 +0100)] 
fix(kernel-modules-extra): shellcheck for modules.d/90kernel-modules-extra

4 years agofix(kernel-modules): shellcheck for modules.d/90kernel-modules
Harald Hoyer [Fri, 26 Mar 2021 09:29:20 +0000 (10:29 +0100)] 
fix(kernel-modules): shellcheck for modules.d/90kernel-modules

4 years agofix(dmraid): shellcheck for modules.d/90dmraid
Harald Hoyer [Fri, 26 Mar 2021 09:29:19 +0000 (10:29 +0100)] 
fix(dmraid): shellcheck for modules.d/90dmraid

4 years agofix(cms): shellcheck for modules.d/80cms
Harald Hoyer [Fri, 26 Mar 2021 09:29:17 +0000 (10:29 +0100)] 
fix(cms): shellcheck for modules.d/80cms

4 years agofix(plymouth): shellcheck for modules.d/50plymouth
Harald Hoyer [Fri, 26 Mar 2021 09:29:17 +0000 (10:29 +0100)] 
fix(plymouth): shellcheck for modules.d/50plymouth

4 years agofix(gensplash): shellcheck for modules.d/50gensplash
Harald Hoyer [Fri, 26 Mar 2021 09:29:16 +0000 (10:29 +0100)] 
fix(gensplash): shellcheck for modules.d/50gensplash

4 years agofix(drm): shellcheck for modules.d/50drm
Harald Hoyer [Fri, 26 Mar 2021 09:29:16 +0000 (10:29 +0100)] 
fix(drm): shellcheck for modules.d/50drm

4 years agofix(url-lib): shellcheck for modules.d/45url-lib
Harald Hoyer [Fri, 26 Mar 2021 09:29:16 +0000 (10:29 +0100)] 
fix(url-lib): shellcheck for modules.d/45url-lib

4 years agofix(ifcfg): shellcheck for modules.d/45ifcfg
Harald Hoyer [Fri, 26 Mar 2021 09:29:15 +0000 (10:29 +0100)] 
fix(ifcfg): shellcheck for modules.d/45ifcfg

4 years agofix(lvmmerge): shellcheck for modules.d/80lvmmerge
Harald Hoyer [Fri, 26 Mar 2021 09:29:17 +0000 (10:29 +0100)] 
fix(lvmmerge): shellcheck for modules.d/80lvmmerge

4 years agofix(cio_ignore): shellcheck for modules.d/81cio_ignore
Harald Hoyer [Fri, 26 Mar 2021 09:29:18 +0000 (10:29 +0100)] 
fix(cio_ignore): shellcheck for modules.d/81cio_ignore

4 years agofix(btrfs): shellcheck for modules.d/90btrfs
Harald Hoyer [Fri, 26 Mar 2021 09:29:18 +0000 (10:29 +0100)] 
fix(btrfs): shellcheck for modules.d/90btrfs

4 years agofix(crypt): shellcheck for modules.d/90crypt
Harald Hoyer [Fri, 26 Mar 2021 09:29:18 +0000 (10:29 +0100)] 
fix(crypt): shellcheck for modules.d/90crypt

4 years agofix(network): shellcheck for modules.d/40network
Harald Hoyer [Fri, 26 Mar 2021 09:29:15 +0000 (10:29 +0100)] 
fix(network): shellcheck for modules.d/40network

4 years agofix(network-wicked): shellcheck for modules.d/35network-wicked
Harald Hoyer [Fri, 26 Mar 2021 09:29:14 +0000 (10:29 +0100)] 
fix(network-wicked): shellcheck for modules.d/35network-wicked

4 years agofix(i18n): shellcheck for modules.d/10i18n
Harald Hoyer [Fri, 26 Mar 2021 09:29:13 +0000 (10:29 +0100)] 
fix(i18n): shellcheck for modules.d/10i18n

4 years agofix: shellcheck for dracut*.sh
Harald Hoyer [Fri, 26 Mar 2021 11:30:15 +0000 (12:30 +0100)] 
fix: shellcheck for dracut*.sh

4 years agodocs: add docs/BASH.md
Harald Hoyer [Fri, 26 Mar 2021 14:29:59 +0000 (15:29 +0100)] 
docs: add docs/BASH.md

Add a little document providing help in common bash problems.

4 years agofix(systemd): shellcheck for modules.d/00systemd
Harald Hoyer [Fri, 26 Mar 2021 09:29:05 +0000 (10:29 +0100)] 
fix(systemd): shellcheck for modules.d/00systemd

4 years agofix(network-manager): shellcheck for modules.d/35network-manager
Harald Hoyer [Fri, 26 Mar 2021 09:29:14 +0000 (10:29 +0100)] 
fix(network-manager): shellcheck for modules.d/35network-manager

4 years agofix(convertfs): shellcheck for modules.d/30convertfs
Harald Hoyer [Fri, 26 Mar 2021 09:29:13 +0000 (10:29 +0100)] 
fix(convertfs): shellcheck for modules.d/30convertfs

4 years agofix(dbus-daemon): shellcheck for modules.d/06dbus-daemon
Harald Hoyer [Fri, 26 Mar 2021 09:29:12 +0000 (10:29 +0100)] 
fix(dbus-daemon): shellcheck for modules.d/06dbus-daemon

4 years agofix(watchdog): shellcheck for modules.d/04watchdog
Harald Hoyer [Fri, 26 Mar 2021 09:29:10 +0000 (10:29 +0100)] 
fix(watchdog): shellcheck for modules.d/04watchdog

4 years agofix(dbus-broker): shellcheck for modules.d/06dbus-broker
Harald Hoyer [Fri, 26 Mar 2021 09:29:12 +0000 (10:29 +0100)] 
fix(dbus-broker): shellcheck for modules.d/06dbus-broker

4 years agofix(watchdog-modules): shellcheck for modules.d/04watchdog-modules
Harald Hoyer [Fri, 26 Mar 2021 09:29:11 +0000 (10:29 +0100)] 
fix(watchdog-modules): shellcheck for modules.d/04watchdog-modules

4 years agofix(modsign): shellcheck for modules.d/03modsign
Harald Hoyer [Fri, 26 Mar 2021 09:29:10 +0000 (10:29 +0100)] 
fix(modsign): shellcheck for modules.d/03modsign

4 years agofix(systemd-networkd): shellcheck for modules.d/02systemd-networkd
Harald Hoyer [Fri, 26 Mar 2021 09:29:09 +0000 (10:29 +0100)] 
fix(systemd-networkd): shellcheck for modules.d/02systemd-networkd

4 years agofix(caps): shellcheck for modules.d/02caps
Harald Hoyer [Fri, 26 Mar 2021 09:29:09 +0000 (10:29 +0100)] 
fix(caps): shellcheck for modules.d/02caps

4 years agofix(systemd-sysusers): shellcheck for modules.d/01systemd-sysusers
Harald Hoyer [Fri, 26 Mar 2021 09:29:08 +0000 (10:29 +0100)] 
fix(systemd-sysusers): shellcheck for modules.d/01systemd-sysusers

4 years agofix(systemd-sysctl): shellcheck for modules.d/01systemd-sysctl
Harald Hoyer [Fri, 26 Mar 2021 09:29:08 +0000 (10:29 +0100)] 
fix(systemd-sysctl): shellcheck for modules.d/01systemd-sysctl

4 years agofix(systemd-repart): shellcheck for modules.d/01systemd-repart
Harald Hoyer [Fri, 26 Mar 2021 09:29:08 +0000 (10:29 +0100)] 
fix(systemd-repart): shellcheck for modules.d/01systemd-repart

4 years agofix(systemd-initrd): shellcheck for modules.d/01systemd-initrd
Harald Hoyer [Fri, 26 Mar 2021 09:29:07 +0000 (10:29 +0100)] 
fix(systemd-initrd): shellcheck for modules.d/01systemd-initrd

4 years agofix(systemd-coredump): shellcheck for modules.d/01systemd-coredump
Harald Hoyer [Fri, 26 Mar 2021 09:29:07 +0000 (10:29 +0100)] 
fix(systemd-coredump): shellcheck for modules.d/01systemd-coredump

4 years agofix(systemd-ask-password): shellcheck for modules.d/01systemd-ask-password
Harald Hoyer [Fri, 26 Mar 2021 09:29:06 +0000 (10:29 +0100)] 
fix(systemd-ask-password): shellcheck for modules.d/01systemd-ask-password

4 years agofix(fips): shellcheck for modules.d/01fips
Harald Hoyer [Fri, 26 Mar 2021 09:29:06 +0000 (10:29 +0100)] 
fix(fips): shellcheck for modules.d/01fips

4 years agofix(warpclock): shellcheck for modules.d/00warpclock
Harald Hoyer [Fri, 26 Mar 2021 09:29:05 +0000 (10:29 +0100)] 
fix(warpclock): shellcheck for modules.d/00warpclock

4 years agofix(base): shellcheck for modules.d/99base
Harald Hoyer [Mon, 22 Mar 2021 09:13:19 +0000 (10:13 +0100)] 
fix(base): shellcheck for modules.d/99base

Also remove some functions, which are not used and broken anyway.

4 years agofix(squash): shellcheck for modules.d/99squash
Harald Hoyer [Fri, 26 Mar 2021 09:29:35 +0000 (10:29 +0100)] 
fix(squash): shellcheck for modules.d/99squash

4 years agofix(biosdevname): shellcheck for modules.d/97biosdevname
Harald Hoyer [Fri, 26 Mar 2021 09:29:31 +0000 (10:29 +0100)] 
fix(biosdevname): shellcheck for modules.d/97biosdevname

4 years agofix(terminfo): shellcheck for modules.d/95terminfo
Harald Hoyer [Fri, 26 Mar 2021 09:29:29 +0000 (10:29 +0100)] 
fix(terminfo): shellcheck for modules.d/95terminfo

4 years agofix(debug): shellcheck for modules.d/95debug
Harald Hoyer [Fri, 26 Mar 2021 09:29:26 +0000 (10:29 +0100)] 
fix(debug): shellcheck for modules.d/95debug

4 years agofix(qemu-net): shellcheck for modules.d/90qemu-net
Harald Hoyer [Fri, 26 Mar 2021 09:29:23 +0000 (10:29 +0100)] 
fix(qemu-net): shellcheck for modules.d/90qemu-net

4 years agofix(dmsquash-live-ntfs): shellcheck for modules.d/90dmsquash-live-ntfs
Harald Hoyer [Fri, 26 Mar 2021 09:29:20 +0000 (10:29 +0100)] 
fix(dmsquash-live-ntfs): shellcheck for modules.d/90dmsquash-live-ntfs

4 years agofix(dbus): shellcheck for modules.d/09dbus
Harald Hoyer [Fri, 26 Mar 2021 09:29:13 +0000 (10:29 +0100)] 
fix(dbus): shellcheck for modules.d/09dbus

4 years agofix(rngd): shellcheck for modules.d/06rngd
Harald Hoyer [Fri, 26 Mar 2021 09:29:12 +0000 (10:29 +0100)] 
fix(rngd): shellcheck for modules.d/06rngd

4 years agofix(rescue): shellcheck for modules.d/03rescue
Harald Hoyer [Fri, 26 Mar 2021 09:29:10 +0000 (10:29 +0100)] 
fix(rescue): shellcheck for modules.d/03rescue

4 years agofix(mksh): shellcheck for modules.d/00mksh
Harald Hoyer [Fri, 26 Mar 2021 09:29:05 +0000 (10:29 +0100)] 
fix(mksh): shellcheck for modules.d/00mksh

4 years agofix(dash): shellcheck for modules.d/00dash
Harald Hoyer [Fri, 26 Mar 2021 09:29:04 +0000 (10:29 +0100)] 
fix(dash): shellcheck for modules.d/00dash

4 years agofix(bash): shellcheck for modules.d/00bash
Harald Hoyer [Fri, 26 Mar 2021 09:29:04 +0000 (10:29 +0100)] 
fix(bash): shellcheck for modules.d/00bash

4 years agoci: shellcheck all directories with .sh
Harald Hoyer [Mon, 22 Mar 2021 08:14:20 +0000 (09:14 +0100)] 
ci: shellcheck all directories with .sh

4 years agotest: add shellcheck to Makefile
Harald Hoyer [Fri, 12 Mar 2021 09:27:31 +0000 (10:27 +0100)] 
test: add shellcheck to Makefile

4 years agostyle: use shfmt 3.2.4
Harald Hoyer [Mon, 15 Mar 2021 12:49:05 +0000 (13:49 +0100)] 
style: use shfmt 3.2.4

4 years agofeat(qemu): include the virtio_mem kernel module
David Hildenbrand [Thu, 18 Mar 2021 09:41:49 +0000 (10:41 +0100)] 
feat(qemu): include the virtio_mem kernel module

This adds support for virtio-mem devices, which provide a dynamic
amount of memory in a VM. Right now, the driver gets loaded and any
memory gets added to the system when loading the kernel module from disk.

While not strictly required to boot, we want to be able to
1) add virito-mem provided memory to the system early while booting up
2) add virtio-mem provided memory even when booting without a disk
3) add virtio-mem devices without adding actual memory in kdump
   environments such that we can query things like:
 a) is a certain PFN currently plugged in the hypervisor and, therefore,
    should actually be read when creating a system dump. (kexec-tools
    prepares the vmcore header, like on x86-64)
 b) which ranges of a virtio-mem device are currently plugged in the
    hypervisor and, therefore, should be added to the dump. (vmcore header
    gets prepared by the crashkernel, like on s390x)
 Note that loading virtio-mem in kdump environments currently fails with
 -EBUSY -- but there are plans to install proper hooks instead to support
  especially a) in the near future.

1) and 2) are only really effective when memory hotplug is configured to
automatically online all added system RAM in the kernel (and not late,
via udev rules): e.g., via "mhp_default_state=online" on the kernel
cmdline or via CONFIG_MEMORY_HOTPLUG_DEFAULT_ONLINE in the kernel.

Especially 2) and 3) require the module to be present inside the initial
ramdisk. The primary use case for including it in the initial ramdisk
is 3).

Signed-off-by: David Hildenbrand <david@redhat.com>
4 years agostyle(install): astyle post correction
Harald Hoyer [Mon, 15 Mar 2021 11:40:04 +0000 (12:40 +0100)] 
style(install): astyle post correction

4 years agodocs: document astyle in HACKING.md
Harald Hoyer [Mon, 15 Mar 2021 11:26:28 +0000 (12:26 +0100)] 
docs: document astyle in HACKING.md

4 years agostyle: use astyle for C formatting
Harald Hoyer [Mon, 15 Mar 2021 11:14:22 +0000 (12:14 +0100)] 
style: use astyle for C formatting

4 years agostyle: use astyle instead of indent
Harald Hoyer [Mon, 15 Mar 2021 11:12:31 +0000 (12:12 +0100)] 
style: use astyle instead of indent

4 years agostyle(install): use block for the FOREACH macros
Harald Hoyer [Mon, 15 Mar 2021 11:13:26 +0000 (12:13 +0100)] 
style(install): use block for the FOREACH macros

4 years agoci: splitout indent-c from indent
Harald Hoyer [Fri, 12 Mar 2021 09:33:23 +0000 (10:33 +0100)] 
ci: splitout indent-c from indent

... to be able to call it from CI

4 years agotest: check for shfmt in Makefile
Harald Hoyer [Fri, 12 Mar 2021 09:27:31 +0000 (10:27 +0100)] 
test: check for shfmt in Makefile

4 years agochore(.packit.yml): adding all fedora release + centos to packit
Jóhann B. Guðmundsson [Thu, 25 Feb 2021 11:49:32 +0000 (11:49 +0000)] 
chore(.packit.yml): adding all fedora release + centos to packit

With this config change,copr builds will happen on pull requests
for all fedora development branches and the next major RHEL release
( fedora-eln ) and on commits, copr builds will happen on all fedora
release and the next major RHEL release.

4 years agofix(udev-rules): add btrfs udev rules by default
Harald Hoyer [Thu, 25 Feb 2021 13:13:00 +0000 (14:13 +0100)] 
fix(udev-rules): add btrfs udev rules by default

Install `64-btrfs.rules` unconditionally to mark btrfs devices ready or
not.

In case no `btrfs` kernel module is available in the initramfs, the
device should not be ready.

Depends on: https://github.com/systemd/systemd/pull/18802

Fixes: https://github.com/dracutdevs/dracut/issues/947
4 years agofeat(btrfs): add 64-btrfs-dm.rules rules
Harald Hoyer [Thu, 25 Feb 2021 13:16:00 +0000 (14:16 +0100)] 
feat(btrfs): add 64-btrfs-dm.rules rules

4 years agoci: add lint for C and shell format
Harald Hoyer [Wed, 24 Feb 2021 13:40:38 +0000 (14:40 +0100)] 
ci: add lint for C and shell format

4 years agodocs: document code formatting in HACKING.md
Harald Hoyer [Thu, 25 Feb 2021 09:53:22 +0000 (10:53 +0100)] 
docs: document code formatting in HACKING.md

4 years agostyle: `make indent` for C
Harald Hoyer [Wed, 24 Feb 2021 13:46:19 +0000 (14:46 +0100)] 
style: `make indent` for C

4 years agostyle: shfmt post reformat
Harald Hoyer [Thu, 25 Feb 2021 08:46:32 +0000 (09:46 +0100)] 
style: shfmt post reformat

4 years agostyle: shfmt -s reformat
Harald Hoyer [Thu, 25 Feb 2021 08:43:35 +0000 (09:43 +0100)] 
style: shfmt -s reformat

reproducible with:

```
$ shfmt_version=3.0.1
$ wget "https://github.com/mvdan/sh/releases/download/v${shfmt_version}/shfmt_v${shfmt_version}_linux_amd64" -O shfmt
$ chmod u+x shfmt
$ ./shfmt -w -s .
```

4 years agostyle: shfmt reformat
Harald Hoyer [Thu, 25 Feb 2021 08:42:54 +0000 (09:42 +0100)] 
style: shfmt reformat

reproducible with:

```
$ shfmt_version=3.0.1
$ wget "https://github.com/mvdan/sh/releases/download/v${shfmt_version}/shfmt_v${shfmt_version}_linux_amd64" -O shfmt
$ chmod u+x shfmt
$ ./shfmt -w .
```

4 years agostyle: shfmt pre correction
Harald Hoyer [Thu, 25 Feb 2021 07:50:09 +0000 (08:50 +0100)] 
style: shfmt pre correction

4 years agofeat: extend Makefile indent target
Harald Hoyer [Thu, 25 Feb 2021 09:52:53 +0000 (10:52 +0100)] 
feat: extend Makefile indent target

- extend the C indent file pattern
- add shfmt, if installed

4 years agochore: add .shellcheckrc
Harald Hoyer [Wed, 24 Feb 2021 13:41:49 +0000 (14:41 +0100)] 
chore: add .shellcheckrc

4 years agofix: set vimrc and emacs indention according to .editorconfig
Harald Hoyer [Thu, 25 Feb 2021 09:26:36 +0000 (10:26 +0100)] 
fix: set vimrc and emacs indention according to .editorconfig

4 years agofeat: customize .editorconfig according to shfmt
Harald Hoyer [Wed, 10 Feb 2021 09:21:16 +0000 (10:21 +0100)] 
feat: customize .editorconfig according to shfmt

4 years agotest: fix test 98 getarg
Harald Hoyer [Thu, 11 Mar 2021 12:35:51 +0000 (13:35 +0100)] 
test: fix test 98 getarg

Fix a mis-replaced comparison.

4 years agofix(network-legacy): silence getargs
Harald Hoyer [Mon, 8 Mar 2021 14:40:00 +0000 (15:40 +0100)] 
fix(network-legacy): silence getargs

4 years agotest: sync and poweroff in create-root.sh
Harald Hoyer [Mon, 8 Mar 2021 12:19:42 +0000 (13:19 +0100)] 
test: sync and poweroff in create-root.sh

4 years agofix: use getargs with _cryptgetargsname
Harald Hoyer [Mon, 8 Mar 2021 12:17:40 +0000 (13:17 +0100)] 
fix: use getargs with _cryptgetargsname

4 years agotest: change the LABEL to include spaces
Harald Hoyer [Mon, 8 Mar 2021 09:15:29 +0000 (10:15 +0100)] 
test: change the LABEL to include spaces

Test for root device with a LABEL, which includes spaces.

4 years agofix(base): wait_for_dev quote shell variables
Harald Hoyer [Mon, 8 Mar 2021 09:14:36 +0000 (10:14 +0100)] 
fix(base): wait_for_dev quote shell variables

4 years agorefactor: factor out label_uuid_to_dev
Harald Hoyer [Mon, 8 Mar 2021 09:12:54 +0000 (10:12 +0100)] 
refactor: factor out label_uuid_to_dev

4 years agochore: update .gitignore
Harald Hoyer [Mon, 8 Mar 2021 09:22:00 +0000 (10:22 +0100)] 
chore: update .gitignore

4 years agofix: correctly handle kernel parameters
Harald Hoyer [Fri, 5 Mar 2021 15:07:10 +0000 (16:07 +0100)] 
fix: correctly handle kernel parameters

The kernel has an odd way to handle `"` surrounded parameters.
To handle the parameters as the kernel would do, no simple shell script
suffices, so a new utility `dracut-util` is introduced. Written in "C"
it handles `dracut-getarg` and `dracut-getargs` as the old shell script
functions `_dogetarg` and `_dogetargs` would.

4 years agofix: remove dracut.pc on `make clean`
Harald Hoyer [Mon, 8 Mar 2021 09:39:51 +0000 (10:39 +0100)] 
fix: remove dracut.pc on `make clean`

4 years agofix: honor KVERSION environment in the Makefile
Harald Hoyer [Mon, 8 Mar 2021 09:11:29 +0000 (10:11 +0100)] 
fix: honor KVERSION environment in the Makefile

4 years agofeat(nbd): support ipv6 link local nbds
Jonas Jelten [Sat, 27 Feb 2021 11:45:15 +0000 (12:45 +0100)] 
feat(nbd): support ipv6 link local nbds

4 years agoperf: disable initrd compression when squash module is enabled
Kairui Song [Sun, 31 Jan 2021 17:49:54 +0000 (01:49 +0800)] 
perf: disable initrd compression when squash module is enabled

With squash module, the initramfs is double compressed, which slow down
the build progress and doesn't shrink the size much.

4 years agofeat: squash module follow --compress option
Kairui Song [Mon, 15 Feb 2021 15:15:26 +0000 (23:15 +0800)] 
feat: squash module follow --compress option

Try to make mksquashfs follow --compress option if squash module is
included, if not specified or invalid, fall back to use mksquashfs's
default compressor.

4 years agorefactor: delay compressor detection
Kairui Song [Wed, 24 Feb 2021 15:39:07 +0000 (23:39 +0800)] 
refactor: delay compressor detection

No function change, decide which compressor to use right before
compressing the initramfs.

This may delay the print of this message:
"dracut: no compression tool available. Initramfs image is going to be big."
but should be OK, this message is not an error.

4 years agofeat(squash): use busybox for early setup if available
Kairui Song [Mon, 15 Feb 2021 06:04:05 +0000 (14:04 +0800)] 
feat(squash): use busybox for early setup if available

Use busybox can help reduce the size of early setup environment.

With this change, everything is packed in the squash image, and
the setup files will be dropped once squash image setup is done,
so initramfs stage memory usage is reduced to the minimun,
and initramfs decompress is also faster.

File layout of a squash initramfs looks like this:

========================================================================
drwxr-xr-x   1 root     root            0 Feb 15 14:07 .
-rwxr-xr-x   1 root     root          946 Feb 15 14:07 init
lrwxrwxrwx   1 root     root            7 Feb 15 14:07 lib -> usr/lib
drwxr-xr-x   1 root     root            0 Feb 15 14:07 squash
-rw-r--r--   1 root     root     91000832 Feb 15 14:07 squash-root.img
drwxr-xr-x   1 root     root            0 Feb 15 14:07 usr
drwxr-xr-x   1 root     root            0 Feb 15 14:07 usr/bin
-rwxr-xr-x   1 root     root      1293688 Jul 27  2020 usr/bin/busybox
lrwxrwxrwx   1 root     root            7 Feb 15 14:07 usr/bin/echo -> busybox
lrwxrwxrwx   1 root     root            7 Feb 15 14:07 usr/bin/mkdir -> busybox
lrwxrwxrwx   1 root     root            7 Feb 15 14:07 usr/bin/modprobe -> busybox
lrwxrwxrwx   1 root     root            7 Feb 15 14:07 usr/bin/mount -> busybox
lrwxrwxrwx   1 root     root            7 Feb 15 14:07 usr/bin/sh -> busybox
lrwxrwxrwx   1 root     root            7 Feb 15 14:07 usr/bin/switch_root -> busybox
drwxr-xr-x   1 root     root            0 Feb 15 14:07 usr/lib
drwxr-xr-x   1 root     root            0 Feb 15 14:07 usr/lib/dracut
-rw-r--r--   1 root     root           23 Feb 15 14:07 usr/lib/dracut/build-parameter.txt
-rw-r--r--   1 root     root           31 Feb 15 14:07 usr/lib/dracut/dracut-051-93.git20210215.fc33
-rw-r--r--   1 root     root          358 Feb 15 14:07 usr/lib/dracut/modules.txt
-rw-r--r--   1 root     root            0 Feb 15 14:07 usr/lib/dracut/need-initqueue
drwxr-xr-x   1 root     root            0 Feb 15 14:07 usr/lib/modules
drwxr-xr-x   1 root     root            0 Feb 15 14:07 usr/lib/modules/5.10.11-200.fc33.x86_64
drwxr-xr-x   1 root     root            0 Feb 15 14:07 usr/lib/modules/5.10.11-200.fc33.x86_64/kernel
<... kernel module misc files skipped ... >
========================================================================

4 years agorefactor(squash): structure in a cleaner way
Kairui Song [Mon, 15 Feb 2021 15:08:47 +0000 (23:08 +0800)] 
refactor(squash): structure in a cleaner way

Simplify the squash mount layout. Instead of overlay on each top
directory (/etc, /usr), just mount and switch_root into the squash
image, with a overlay on top of it.

Also install the binaries and setup scripts separately, so the squash
setup code and the squash image content is independent of each other,
all squash setup script and binaries can be deleted safely upon
switch_root.

With this change, previous squash clean up service and other tricky
implementations are all gone.

This commit depends on systemd commits from:
https://github.com/systemd/systemd/pull/18124

Previouly systemd doesn't recognize non-ramfs initramfs, now this is
doable with SYSTEMD_IN_INITRD=lenient

Signed-off-by: Kairui Song <kasong@redhat.com>