Commit Graph

6116 Commits (055)

Author SHA1 Message Date
Harald Hoyer 8109b6c0d4 fix(dmsquash-live-ntfs): shellcheck for modules.d/90dmsquash-live-ntfs 2021-03-26 11:13:04 +01:00
Harald Hoyer 1ce0eeffab fix(dbus): shellcheck for modules.d/09dbus 2021-03-26 11:07:59 +01:00
Harald Hoyer 74668e212d fix(rngd): shellcheck for modules.d/06rngd 2021-03-26 11:07:45 +01:00
Harald Hoyer f32b5e582e fix(rescue): shellcheck for modules.d/03rescue 2021-03-26 11:06:05 +01:00
Harald Hoyer f506c4268b fix(mksh): shellcheck for modules.d/00mksh 2021-03-26 10:56:54 +01:00
Harald Hoyer b470a79c18 fix(dash): shellcheck for modules.d/00dash 2021-03-26 10:55:53 +01:00
Harald Hoyer dafdf37268 fix(bash): shellcheck for modules.d/00bash 2021-03-26 10:55:36 +01:00
Harald Hoyer 90c679e753 ci: shellcheck all directories with .sh 2021-03-26 09:35:30 +01:00
Harald Hoyer d376b98537 test: add shellcheck to Makefile 2021-03-26 09:35:30 +01:00
Harald Hoyer cc914eaa8b style: use shfmt 3.2.4 2021-03-19 11:34:05 +01:00
David Hildenbrand f3dcb60619 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>
2021-03-18 15:04:10 +01:00
Harald Hoyer 2ec7fa190e style(install): astyle post correction 2021-03-15 15:37:08 +01:00
Harald Hoyer b7b8eedab5 docs: document astyle in HACKING.md 2021-03-15 15:37:08 +01:00
Harald Hoyer f1ed92c348 style: use astyle for C formatting 2021-03-15 15:37:08 +01:00
Harald Hoyer 5667978e7b style: use astyle instead of indent 2021-03-15 15:37:08 +01:00
Harald Hoyer 0850cf532d style(install): use block for the FOREACH macros 2021-03-15 15:37:08 +01:00
Harald Hoyer 9e587f0008 ci: splitout indent-c from indent
... to be able to call it from CI
2021-03-15 15:37:08 +01:00
Harald Hoyer 07b65603ff test: check for shfmt in Makefile 2021-03-15 15:37:08 +01:00
Jóhann B. Guðmundsson 01126a209a 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.
2021-03-15 10:20:08 +01:00
Harald Hoyer 567c455753 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
2021-03-13 20:13:13 +01:00
Harald Hoyer d4caa86aba feat(btrfs): add 64-btrfs-dm.rules rules 2021-03-13 19:12:54 +00:00
Harald Hoyer d85b7e4edd ci: add lint for C and shell format 2021-03-13 20:10:43 +01:00
Harald Hoyer 0561f953c4 docs: document code formatting in HACKING.md 2021-03-13 20:10:43 +01:00
Harald Hoyer 9bc5282e30 style: `make indent` for C 2021-03-13 20:10:43 +01:00
Harald Hoyer 2b50b67c50 style: shfmt post reformat 2021-03-13 20:10:43 +01:00
Harald Hoyer 75d758e8f1 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 .
```
2021-03-13 20:10:43 +01:00
Harald Hoyer 9a52c3fdb0 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 .
```
2021-03-13 20:10:43 +01:00
Harald Hoyer 560402c3dc style: shfmt pre correction 2021-03-13 20:10:43 +01:00
Harald Hoyer e0a0fa6174 feat: extend Makefile indent target
- extend the C indent file pattern
- add shfmt, if installed
2021-03-13 20:10:43 +01:00
Harald Hoyer eddca44221 chore: add .shellcheckrc 2021-03-13 20:10:43 +01:00
Harald Hoyer 9012f3996b fix: set vimrc and emacs indention according to .editorconfig 2021-03-13 20:10:43 +01:00
Harald Hoyer 1f621aba37 feat: customize .editorconfig according to shfmt 2021-03-13 20:10:43 +01:00
Harald Hoyer 5d99b4d0eb test: fix test 98 getarg
Fix a mis-replaced comparison.
2021-03-12 09:20:32 +01:00
Harald Hoyer 60a34d8b11 fix(network-legacy): silence getargs 2021-03-10 19:31:19 +01:00
Harald Hoyer 72cba8aecd test: sync and poweroff in create-root.sh 2021-03-10 19:31:19 +01:00
Harald Hoyer 1b61cfdbec fix: use getargs with _cryptgetargsname 2021-03-10 19:31:19 +01:00
Harald Hoyer 455329cf71 test: change the LABEL to include spaces
Test for root device with a LABEL, which includes spaces.
2021-03-10 19:31:19 +01:00
Harald Hoyer b800edd698 fix(base): wait_for_dev quote shell variables 2021-03-10 19:31:19 +01:00
Harald Hoyer d3532978de refactor: factor out label_uuid_to_dev 2021-03-10 19:31:19 +01:00
Harald Hoyer 40fc0ad40d chore: update .gitignore 2021-03-10 19:31:19 +01:00
Harald Hoyer 501d82f796 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.
2021-03-10 19:31:19 +01:00
Harald Hoyer d643156d56 fix: remove dracut.pc on `make clean` 2021-03-10 17:58:37 +01:00
Harald Hoyer d8a454a537 fix: honor KVERSION environment in the Makefile 2021-03-10 17:58:08 +01:00
Jonas Jelten b12f8188a4 feat(nbd): support ipv6 link local nbds 2021-03-09 13:58:10 +00:00
Kairui Song 7c0bc0b2fd 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.
2021-03-09 13:40:35 +00:00
Kairui Song 5d05ffbd87 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.
2021-03-09 13:40:35 +00:00
Kairui Song a9345f6800 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.
2021-03-09 13:40:35 +00:00
Kairui Song 90f269f6af 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 ... >
========================================================================
2021-03-09 13:40:35 +00:00
Kairui Song 8f7c332e48 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>
2021-03-09 13:40:35 +00:00
Kairui Song bdd194bb8c refactor(squash): don't record mount points in text file
The squasn mount points are recorded in text file so later clean up
script can umount them, this is not needed, the mount points are fixed
so just detect the umount by hardcoded pattern.
2021-03-09 13:40:35 +00:00