]> git.ipfire.org Git - thirdparty/mkosi.git/log
thirdparty/mkosi.git
4 years agoCI: add black to CI and document editable installs now need --no-use-pep517 584/head
Joerg Behrmann [Fri, 18 Dec 2020 15:25:31 +0000 (16:25 +0100)] 
CI: add black to CI and document editable installs now need --no-use-pep517

4 years agoUse black for code formatting
Joerg Behrmann [Fri, 18 Dec 2020 15:21:06 +0000 (16:21 +0100)] 
Use black for code formatting

4 years agoAdd pyproject.toml to configure black
Joerg Behrmann [Fri, 18 Dec 2020 15:12:40 +0000 (16:12 +0100)] 
Add pyproject.toml to configure black

4 years agoReplace the sys.stderr.write calls with a custom MkosiPrinter class
Peter Hutterer [Thu, 17 Dec 2020 00:06:31 +0000 (10:06 +1000)] 
Replace the sys.stderr.write calls with a custom MkosiPrinter class

Most notably, we no longer use ansi escape codes when we are redirecting to a
file.

4 years agoFix flake8 warnings
Peter Hutterer [Thu, 17 Dec 2020 00:13:12 +0000 (10:13 +1000)] 
Fix flake8 warnings

These are all whitespace fixes with a few exceptions:
- one "if not foo is None" -> "if foo is not None"
- one f"static string" changed to "static string"
- two "except Something as e" changed to "except Something" where e isn't
  being used

Flake8 errors disabled:
  501: line too long
  504: line break after binary operator
  741: ambiguous variable name

Flake8 errors left after this patch:
  E241 multiple spaces after ','
  F541 f-string is missing placeholders

Both of the above warnings are triggered by lines that are better left as-is
for consistency with the surrounding code.

4 years agoAdd backticks around the workspace command error
Peter Hutterer [Wed, 16 Dec 2020 23:43:51 +0000 (09:43 +1000)] 
Add backticks around the workspace command error

Better visual separation between the actual command and the full sentence.
We'll never have backticks in our command so unlike other quotes we don't have
to worry about escaping them, and at this point we're all used to backticks
for markdown anyway.

4 years agoAllow disabling unified kernel images on BIOS for all distros
Daan De Meyer [Thu, 17 Dec 2020 21:07:19 +0000 (21:07 +0000)] 
Allow disabling unified kernel images on BIOS for all distros

Fixes #580.

4 years agoSupport mkosi.* files in mkosi.default.d + distro specific
Daan De Meyer [Sat, 15 Aug 2020 14:42:35 +0000 (15:42 +0100)] 
Support mkosi.* files in mkosi.default.d + distro specific
subdirectories

Fixes #506

4 years agoExplicitly specify dracut filesystem when using --hostonly-initrd
Daan De Meyer [Mon, 14 Dec 2020 22:19:22 +0000 (22:19 +0000)] 
Explicitly specify dracut filesystem when using --hostonly-initrd

It seems dracut includes the host's filesystem when building a
hostonly image and not the image's filesystem. This causes issues
when these two don't match. Include the correct one explicitly
as a workaround.

4 years agoRedirect non-redirected subprocesses output to stderr except build-script
Daan De Meyer [Fri, 11 Dec 2020 20:14:33 +0000 (20:14 +0000)] 
Redirect non-redirected subprocesses output to stderr except build-script

When running a language server via mkosi, communication with the editor
is done via mkosi's stdin/stdout. If the client reads output from mkosi's
subprocesses instead of LSP json messages from stdout, it won't recognize
the output and crash. To make the language server integration work when the
build image needs to be built from scratch, we redirect all non-redirected
output from subprocesses to stderr except for the build-script. This way,
we can get progress output from mkosi right in the editor without breaking
the language server integration.

The split was already quite arbitrary in the first place. All of mkosi's messages
go to stderr and most subprocess output went to stdout. Instead, let's define
the split between stdout/stderr a bit more so we can take advantage of it.
Only the build script gets to write to stdout which simplifies language server
usage with mkosi.

4 years agoqemu: Enable -vga virtio when not using --qemu-headless
Daan De Meyer [Mon, 14 Dec 2020 22:22:12 +0000 (22:22 +0000)] 
qemu: Enable -vga virtio when not using --qemu-headless

Supports higher resolutions than the default driver. Probably
is more performant as well.

4 years agoRun finalize script with OUTPUTDIR environment variable set
Daan De Meyer [Mon, 14 Dec 2020 22:52:48 +0000 (22:52 +0000)] 
Run finalize script with OUTPUTDIR environment variable set

Fixes #575.

4 years agoAdd --install-directory option
Daan De Meyer [Sat, 12 Dec 2020 22:31:51 +0000 (22:31 +0000)] 
Add --install-directory option

While binaries can already be retrieved using the --build-directory
option. Sometimes it's a lot easier to have access to the installed
contents instead. --install-directory allows accessing the contents
of /root/dest from the build container outside of the build image.

4 years agoCreate /usr/include with correct mode when --include-directory is used
Daan De Meyer [Sat, 12 Dec 2020 23:00:22 +0000 (23:00 +0000)] 
Create /usr/include with correct mode when --include-directory is used

Currently, when we're using --include-directory, /usr/include is created
by mount_bind() which creates /usr with 0700 (because makedirs mode
only applies to the leaf directory). Create /usr/include explicitly with
the correct mode to avoid permission warnings from pacman.

4 years agoEmpty include directory before installing to it
Daan De Meyer [Sat, 12 Dec 2020 22:55:36 +0000 (22:55 +0000)] 
Empty include directory before installing to it

Pacman (and probably other package managers as well) expect
/usr/include to be empty when we're bootstrapping so let's make
sure we empty the directory before installing to it.

4 years agoCI: Install mkosi explicitly
Daan De Meyer [Sat, 12 Dec 2020 14:19:41 +0000 (14:19 +0000)] 
CI: Install mkosi explicitly

Since we'll soon be installing the latest stable version with the
action, let's modify CI already to do an explicit install that
installs mkosi with the latest changes from the PR.

4 years agoUpdate summary with new options
Daan De Meyer [Fri, 11 Dec 2020 23:10:56 +0000 (23:10 +0000)] 
Update summary with new options

4 years agoMerge pull request #572 from bluca/debian_improvements
Daan De Meyer [Sat, 12 Dec 2020 16:32:35 +0000 (16:32 +0000)] 
Merge pull request #572 from bluca/debian_improvements

remove dpkg unsafe-io config after bootstrap, add it before

4 years agodebian: enable dpkg unsafe-io before debootstrap 572/head
Luca Boccassi [Sat, 12 Dec 2020 14:36:11 +0000 (14:36 +0000)] 
debian: enable dpkg unsafe-io before debootstrap

Second stage bootstrapping uses dpkg from the chroot, so it can
already be configured

4 years agodebian: remove dpkg unsafe-io config after bootstrap
Luca Boccassi [Sat, 12 Dec 2020 14:34:19 +0000 (14:34 +0000)] 
debian: remove dpkg unsafe-io config after bootstrap

4 years agoCI: Simplify install step
Daan De Meyer [Sat, 12 Dec 2020 11:54:34 +0000 (11:54 +0000)] 
CI: Simplify install step

Remove duplicate packages already installed by the Github Action.
Also, with the recent speedups in dpkg, we can now run the action
for Ubuntu and Debian as well without these becoming the major
bottleneck in CI.

4 years agoCI: Build tar archives
Daan De Meyer [Sat, 12 Dec 2020 11:50:01 +0000 (11:50 +0000)] 
CI: Build tar archives

We actually weren't building tar archives until now. Let's build
them but not try to boot them since that's not supported.

4 years agoGithub Action: Install qemu and ovmf
Daan De Meyer [Fri, 11 Dec 2020 22:51:29 +0000 (22:51 +0000)] 
Github Action: Install qemu and ovmf

Let's install qemu and ovmf as well so mkosi qemu works out of the
box when using the action.

4 years agoGithub Action: Update dependency versions
Daan De Meyer [Fri, 11 Dec 2020 22:28:58 +0000 (22:28 +0000)] 
Github Action: Update dependency versions

4 years agoMerge pull request #569 from bluca/debian_improvements
Daan De Meyer [Sat, 12 Dec 2020 11:20:50 +0000 (11:20 +0000)] 
Merge pull request #569 from bluca/debian_improvements

Use unsafe-io with dpkg and restore compatiblity with nspawn v241 and lower

4 years agonspawn: check if --console is available before using it 569/head
Luca Boccassi [Fri, 11 Dec 2020 15:56:44 +0000 (15:56 +0000)] 
nspawn: check if --console is available before using it

On Debian Buster nspawn doesn't support this parameter (v241)

4 years agodpkg: use force-unsafe-io
Luca Boccassi [Fri, 11 Dec 2020 15:56:17 +0000 (15:56 +0000)] 
dpkg: use force-unsafe-io

Removes lots of fsyncs from dpkg when packages are installed, since
either bootstrapping works or it fails and we start over

4 years agoAdd --include-directory option
Daan De Meyer [Fri, 11 Dec 2020 17:37:33 +0000 (17:37 +0000)] 
Add --include-directory option

--include-directory makes the header files installed in the container
available on the host. This is useful when running a language server
such as clangd in the mkosi container. If we define a path mapping
in clangd from /usr/include to the include directory, we can jump
to all the header files of external dependencies in the include
directory right from the editor.

4 years agoAllow build script to read from stdin when running in a script
Daan De Meyer [Fri, 11 Dec 2020 00:08:27 +0000 (00:08 +0000)] 
Allow build script to read from stdin when running in a script

When running language servers like clangd via a mkosi build-script,
we need clangd to be able to read from stdin to interact with the
editor. By default, systemd-nspawn doesn't do this for security
issues but in this case we trust the build script so we can specify
--pipe to enable the build script to read from stdin.

4 years agocentos_epel: Fix --mirror
Daan De Meyer [Thu, 10 Dec 2020 20:42:52 +0000 (20:42 +0000)] 
centos_epel: Fix --mirror

Fixes #561.

4 years agoFedora: Update default release to 33
Daan De Meyer [Wed, 9 Dec 2020 18:09:45 +0000 (18:09 +0000)] 
Fedora: Update default release to 33

4 years agoAdd a vga device for --qemu-headless when using BIOS with Fedora/CentOS
Daan De Meyer [Wed, 9 Dec 2020 18:39:16 +0000 (18:39 +0000)] 
Add a vga device for --qemu-headless when using BIOS with Fedora/CentOS

Fixed #559

4 years agoArch: Switch back to using a single call to pacman
Daan De Meyer [Mon, 7 Dec 2020 21:41:52 +0000 (21:41 +0000)] 
Arch: Switch back to using a single call to pacman

We shouldn't be working around dependency issues in Arch. I'm not
getting any failures using this anymore right now but if any turn
up, we should file bug reports for the relevant Arch packages to
add the necessary dependencies. Now that base is a metapackage and
not a group, the burden to add it as a dependency should be very
minimal.

4 years agoOnly print summary when summary verb is used
Daan De Meyer [Sun, 6 Dec 2020 18:27:51 +0000 (18:27 +0000)] 
Only print summary when summary verb is used

Printing the entire summary every time we're building the image
is unnecessarily verbose. Let's only print the summary when the
user asks for it.

4 years agoReplace -boot c option with -nodefaults
Daan De Meyer [Sun, 6 Dec 2020 14:56:11 +0000 (14:56 +0000)] 
Replace -boot c option with -nodefaults

-boot c doesn't actually change anything. Boot order when using
OVMF can only be changed by editing OVMF_VARS.fd. Instead, we
remove the default CDROM device by specifying -nodefaults and
add back the serial device manually. This avoids the boot warning
as well and saves a second on boot time.

4 years agoAdd --hostonly option
Daan De Meyer [Sun, 6 Dec 2020 16:40:18 +0000 (16:40 +0000)] 
Add --hostonly option

Enabling --hostonly speeds up QEMU boots by roughly 2 seconds on
my machine.

4 years agoqemu: Add if=virtio option.
Daan De Meyer [Sun, 6 Dec 2020 19:32:26 +0000 (19:32 +0000)] 
qemu: Add if=virtio option.

Speeds up boot from 12s to 6s.

4 years agoqemu: Add -cpu host option
Daan De Meyer [Sun, 6 Dec 2020 19:22:53 +0000 (19:22 +0000)] 
qemu: Add -cpu host option

We don't need compatibility for our use case so let's squeeze out
all the performance we can.

4 years agoqemu: Add rudimentary kvm detection instead of using qemu's fallback
Daan De Meyer [Sun, 6 Dec 2020 19:50:02 +0000 (19:50 +0000)] 
qemu: Add rudimentary kvm detection instead of using qemu's fallback

This allows conditionally enabling other options if KVM is available.

4 years agoAdd --autologin option
Daan De Meyer [Sun, 6 Dec 2020 13:13:07 +0000 (13:13 +0000)] 
Add --autologin option

This is useful when using mkosi for development as systemd does since
it removes a manual step from the testing workflow.

4 years agoChange QEMU boot order so it doesn't try the CD-ROM
Daan De Meyer [Sun, 6 Dec 2020 13:48:31 +0000 (13:48 +0000)] 
Change QEMU boot order so it doesn't try the CD-ROM

Currently, when booting with QEMU, there's a log message about
QEMU trying to boot from the CD-ROM device but not finding anything
there. By changing the boot order, QEMU skips the CD-ROM device and
immediately boots our image.

4 years agoSet COLUMNS and LINES to current terminal values when using --qemu-headless
Daan De Meyer [Sun, 6 Dec 2020 13:37:19 +0000 (13:37 +0000)] 
Set COLUMNS and LINES to current terminal values when using --qemu-headless

By default, systemd uses 80x24 dimensions for terminal size when logging
in over the serial console. Just like we set TERM already when using
--qemu-headless, set COLUMNS and LINES as well so the serial terminal
can use the full size of the screen.

4 years agoFix all-ethernet.network permissions
Daan De Meyer [Sun, 6 Dec 2020 13:16:08 +0000 (13:16 +0000)] 
Fix all-ethernet.network permissions

systemd-networkd currently complains about the permissions for
all-ethernet (world-writable). Restrict the permissions so
systemd-networkd doesn't complain anymore.

4 years agoAdd --network-veth option
Daan De Meyer [Sun, 6 Dec 2020 12:28:41 +0000 (12:28 +0000)] 
Add --network-veth option

Sets up a virtual ethernet link between the host and the container/vm.
For boot, we just pass --network-veth to nspawn. For qemu, we set up
a TAP nic with the correct ifname so that it is picked up by
systemd-networkd on the host.

4 years agoArch: Add --needed option when installing packages with pacman
Daan De Meyer [Sat, 5 Dec 2020 12:08:51 +0000 (12:08 +0000)] 
Arch: Add --needed option when installing packages with pacman

Using --needed prevents packages that are already installed from
being reinstalled.

4 years agobump version numbers for v8 v8
Daan De Meyer [Wed, 2 Dec 2020 21:50:58 +0000 (21:50 +0000)] 
bump version numbers for v8

4 years agoMerge pull request #542 from DaanDeMeyer/rpm-from-source
Daan De Meyer [Wed, 2 Dec 2020 20:42:44 +0000 (20:42 +0000)] 
Merge pull request #542 from DaanDeMeyer/rpm-from-source

Rpm from source

4 years agoMerge pull request #541 from drewmoseley/master
Daan De Meyer [Wed, 2 Dec 2020 20:02:55 +0000 (20:02 +0000)] 
Merge pull request #541 from drewmoseley/master

Handle rw and ro kernel command line parameters.

4 years agoCI: Build rpm from source 542/head
Daan De Meyer [Wed, 2 Dec 2020 20:00:26 +0000 (20:00 +0000)] 
CI: Build rpm from source

Some Fedora packages depend on rpm 4.15 already which is newer
than the version of rpm available in Ubuntu Focal's repositories.

4 years agoCI: Drop clear, photon, opensuse, openmandriva and mageia
Daan De Meyer [Wed, 2 Dec 2020 19:57:48 +0000 (19:57 +0000)] 
CI: Drop clear, photon, opensuse, openmandriva and mageia

The overhead of supporting these in CI is too big compared to the
benefit of maintaining them in CI. We can add back support for these
distros once a dedicated maintainer shows up willing to do the work.

4 years agoFix incorrect script name in README. 541/head
Drew Moseley [Wed, 2 Dec 2020 19:12:48 +0000 (14:12 -0500)] 
Fix incorrect script name in README.

Signed-off-by: Drew Moseley <drew.moseley@northern.tech>
4 years agoDo not automatically specify rw on kernel command line.
Drew Moseley [Wed, 2 Dec 2020 19:12:34 +0000 (14:12 -0500)] 
Do not automatically specify rw on kernel command line.

Signed-off-by: Drew Moseley <drew.moseley@northern.tech>
4 years agobump version numbers for v7 v7
Daan De Meyer [Tue, 1 Dec 2020 12:31:26 +0000 (12:31 +0000)] 
bump version numbers for v7

4 years agosetup-mkosi: Update dependencies to latest versions
Daan De Meyer [Tue, 1 Dec 2020 09:00:55 +0000 (09:00 +0000)] 
setup-mkosi: Update dependencies to latest versions

4 years agoCheck if loop device partition exists in nspawn_params_for_blockdev_access
Daan De Meyer [Mon, 30 Nov 2020 19:55:37 +0000 (19:55 +0000)] 
Check if loop device partition exists in nspawn_params_for_blockdev_access

Fixes #537.

4 years agoDisable Openmandriva boot tests
Daan De Meyer [Mon, 30 Nov 2020 20:08:17 +0000 (20:08 +0000)] 
Disable Openmandriva boot tests

We don't have an active maintainer for Openmandriva so let's
disable the tests for now until one shows up.

4 years agoCI: Run apt-get update before install python3-venv
Daan De Meyer [Wed, 14 Oct 2020 19:33:26 +0000 (20:33 +0100)] 
CI: Run apt-get update before install python3-venv

4 years agomypy: Remove unused type: ignore comments
Daan De Meyer [Wed, 14 Oct 2020 19:10:45 +0000 (20:10 +0100)] 
mypy: Remove unused type: ignore comments

These were fixed in the latest mypy release.

4 years agobin: use /usr/bin/env to get bash path instead of hardwiring it
Joerg Behrmann [Thu, 8 Oct 2020 15:37:23 +0000 (17:37 +0200)] 
bin: use /usr/bin/env to get bash path instead of hardwiring it

Fixes #532

4 years agobump version numbers for v6 v6
Daan De Meyer [Fri, 2 Oct 2020 18:57:00 +0000 (19:57 +0100)] 
bump version numbers for v6

4 years agoMerge pull request #523 from foxxx0/centos7-fixes
Daan De Meyer [Sun, 27 Sep 2020 21:28:48 +0000 (22:28 +0100)] 
Merge pull request #523 from foxxx0/centos7-fixes

Various CentOS 7 fixes and some features/changes

4 years agofix small typo in comment 523/head
Thore Bödecker [Fri, 21 Aug 2020 10:00:32 +0000 (12:00 +0200)] 
fix small typo in comment

4 years agorun postinstall nspawn with loopdev if bootable
Thore Bödecker [Fri, 21 Aug 2020 09:46:20 +0000 (11:46 +0200)] 
run postinstall nspawn with loopdev if bootable

This enables nspawn blockdev access for the postinstall script when a
bootable image is being created.
(Needed in order to e.g. make changes to bootloader from within the
postinstall script.)

Also this commit deduplicates the code required for setting up these
nspawn parameters and moves it into a separate method, that is being
called from multiple places.

4 years agofix bootable CentOS 7 efi by using grub2-efi
Thore Bödecker [Fri, 21 Aug 2020 09:34:38 +0000 (11:34 +0200)] 
fix bootable CentOS 7 efi by using grub2-efi

First of all the `systemd-udev` package does not exist in the CentOS 7
repository and thus will cause the `dnf` step to always fail.

The `bootctl` / `systemd-boot` feature in CentOS 7 is very broken and
does not work.
To create bootable CentOS 7 EFI images, this commit switches to
`grub2-efi`.

Furthermore it will fail early if unified kernel images were not
explicitly disabled via the commandline switch. They are simply not
supported by grub.

There are some quirks when an EFI image is being built on a non-EFI
system, since grub2 will check for existence of `/sys/firmware/efi` and
only create an efi-compatible boot config if that directory exists.
Otherwise it will generate 16bit `linux16` and `initrd16` boot
entries, which are obviously incorrect. This is subsequently fixed
by patching the generated file.

Also the `grub2-efi` setup requires a more ellaborate nspawn setup,
just like `clr-boot-manager`

4 years agoextend mkfs to support adding cmdline args
Thore Bödecker [Fri, 21 Aug 2020 09:24:04 +0000 (11:24 +0200)] 
extend mkfs to support adding cmdline args

The `mkfs_<filesystem>()` methods have been renamed to
`mkfs_<filesystem>_cmd()` and just return the cmdline now.
This allows for some easier adjustments within `mkfs_generic()`.

The e2fsprogs packaged within CentOS 7 is very old and does not support
the `metadata_csum` ext4 feature.
This commit explicitly disables this feature upon filesystem creation.
Otherwise all e2fsprogs utilities will not work or misbehave within the
created image. (e.g. `tune2fs -l`)

Additionally this commit explicitly enabled the `64bit` feature for ext4
on supported architectures. Previously this might or might not have been
enabled by default, depending on the e2fsprogs version where mkosi is
running.

4 years agoadd helper for determining if CentOS older than 8
Thore Bödecker [Mon, 24 Aug 2020 09:26:52 +0000 (11:26 +0200)] 
add helper for determining if CentOS older than 8

4 years agoallow optional override of GPT first-lba header
Thore Bödecker [Fri, 21 Aug 2020 09:18:29 +0000 (11:18 +0200)] 
allow optional override of GPT first-lba header

Usage of this feature is totally optional and the defaults are actually
preferred, which should set the First (usable) Logical Byte Address to
sector 2048, leaving a 1MiB gap before the first partition.
However there might be a reason to override this, e.g. if the created
image is being altered later on by tools which need a different
first-lba value. One example would be the `prl_disk_tool` utility from
the Parallels virtualization suite.

4 years agoGive prepare scripts access to SRCDIR.
Daan De Meyer [Thu, 20 Aug 2020 20:37:03 +0000 (21:37 +0100)] 
Give prepare scripts access to SRCDIR.

There are often project specific files that contain the dependencies
necessary to be installed. Make sure the prepare script has access to
these files so the logic doesn't have to be repeated in the prepare
script itself.

4 years agoMerge pull request #525 from DaanDeMeyer/no-verity-uki-cache
Daan De Meyer [Tue, 1 Sep 2020 18:41:20 +0000 (19:41 +0100)] 
Merge pull request #525 from DaanDeMeyer/no-verity-uki-cache

Cache unified kernel images and secure boot when not doing verity

4 years agoMake sure we apply the btrfs stale devices fix everywhere
Daan De Meyer [Wed, 26 Aug 2020 21:37:02 +0000 (22:37 +0100)] 
Make sure we apply the btrfs stale devices fix everywhere

Currently, failing build scripts can also trigger the
btrfs stale devices failure. Let's apply the fix more
generally so we always catch the error.

5 years agoMove action to repository root
Daan De Meyer [Tue, 25 Aug 2020 18:42:16 +0000 (19:42 +0100)] 
Move action to repository root

Publishing an action to the marketplace requires the action metadata
file to be in the repository root.

5 years agoBoot nspawn with --volatile=overlay when using dm-verity 525/head
Daan De Meyer [Sat, 22 Aug 2020 11:18:41 +0000 (12:18 +0100)] 
Boot nspawn with --volatile=overlay when using dm-verity

5 years agoCache unified kernel images and secure boot when not doing verity
Daan De Meyer [Sat, 22 Aug 2020 11:15:26 +0000 (12:15 +0100)] 
Cache unified kernel images and secure boot when not doing verity

There's no need to re-generate these every time if we're not embedding
the root hash.

5 years agoMerge pull request #519 from DaanDeMeyer/qemu-boot-tests
Daan De Meyer [Tue, 25 Aug 2020 18:37:23 +0000 (19:37 +0100)] 
Merge pull request #519 from DaanDeMeyer/qemu-boot-tests

QEMU boot tests

5 years agoCI: Add QEMU boot tests 519/head
Daan De Meyer [Mon, 17 Aug 2020 17:34:35 +0000 (18:34 +0100)] 
CI: Add QEMU boot tests

Adding these gives us a clear idea of which setups should work and which
are broken. This helps with triaging issues since we can immediately see
if a setup is supposed to work or not. It also makes sure setups that do
work keep working in the future.

Currently, only Arch, CentOS and Fedora can boot on all included setups
(nspawn, UEFI + systemd-boot with unified kernel images, UEFI +
systemd-boot and BIOS). Debian, Ubuntu, OpenSUSE and Mageia fail
on UEFI without unified kernel images because their package managers
don't install any boot loader entries that systemd-boot can read.

Photon doesn't work on any of the setups. Clear also has a lot of issues
due to it using its own bootloader and OpenMandriva has QEMU failures.
For now, we disable all these but we hope support by them can be added
by interested contributors in the future.

5 years agoCI: Stop running setup-mkosi on Ubuntu and Debian
Daan De Meyer [Sat, 22 Aug 2020 11:55:15 +0000 (12:55 +0100)] 
CI: Stop running setup-mkosi on Ubuntu and Debian

Ubuntu is currently the slowest of all the builds. Let's speed it up by
removing unnecessary dependency building and installation.

5 years agoOnly install dracut config files when necessary
Daan De Meyer [Thu, 20 Aug 2020 21:56:52 +0000 (22:56 +0100)] 
Only install dracut config files when necessary

5 years agoOpenSUSE: Remove dracut workaround
Daan De Meyer [Thu, 20 Aug 2020 18:00:40 +0000 (19:00 +0100)] 
OpenSUSE: Remove dracut workaround

5 years agoOpenSUSE: Support passwordless root login
Daan De Meyer [Thu, 20 Aug 2020 17:42:14 +0000 (18:42 +0100)] 
OpenSUSE: Support passwordless root login

5 years agoArch: Quote correctly in mkosi-kernel-remove script
Daan De Meyer [Thu, 20 Aug 2020 16:40:40 +0000 (17:40 +0100)] 
Arch: Quote correctly in mkosi-kernel-remove script

5 years agoFail early when using --bootable on Photon
Daan De Meyer [Wed, 19 Aug 2020 22:13:44 +0000 (23:13 +0100)] 
Fail early when using --bootable on Photon

5 years agoFail early when trying to use --bootable with Clear Linux
Daan De Meyer [Wed, 19 Aug 2020 22:12:59 +0000 (23:12 +0100)] 
Fail early when trying to use --bootable with Clear Linux

5 years agoFail early when using --without-unified-kernel-images on unsupported
Daan De Meyer [Wed, 19 Aug 2020 22:09:03 +0000 (23:09 +0100)] 
Fail early when using --without-unified-kernel-images on unsupported
distros

5 years agoMageia: Make sure systemd is included in the initramfs
Daan De Meyer [Wed, 19 Aug 2020 21:43:42 +0000 (22:43 +0100)] 
Mageia: Make sure systemd is included in the initramfs

5 years agoFedora: Install kernel modules so squashfs is available
Daan De Meyer [Wed, 19 Aug 2020 21:23:37 +0000 (22:23 +0100)] 
Fedora: Install kernel modules so squashfs is available

5 years agoUbuntu/Debian: Add universe regardless of UKI or not
Daan De Meyer [Wed, 19 Aug 2020 21:02:14 +0000 (22:02 +0100)] 
Ubuntu/Debian: Add universe regardless of UKI or not

Leftover from a previous revert.

5 years agoAdd BIOS support to --qemu-headless
Daan De Meyer [Wed, 19 Aug 2020 20:59:44 +0000 (21:59 +0100)] 
Add BIOS support to --qemu-headless

5 years agoArch: Drop e2fsprogs install logic as its part of base
Daan De Meyer [Wed, 19 Aug 2020 20:45:47 +0000 (21:45 +0100)] 
Arch: Drop e2fsprogs install logic as its part of base

5 years agoFix grub installation
Daan De Meyer [Sat, 22 Aug 2020 10:04:08 +0000 (11:04 +0100)] 
Fix grub installation

If we don't mount /dev/block and /dev/disk into the container, grub will
add root=/dev/loop... to the kernel command line which breaks when
booting the image. If we mount these directories, grub will correctly
use the PARTUUID or UUID instead.

5 years agoArch: Handle no kernels installed case in kernel-install hook
Daan De Meyer [Wed, 19 Aug 2020 20:13:28 +0000 (21:13 +0100)] 
Arch: Handle no kernels installed case in kernel-install hook

If a bash glob doesn't match any files, it returns the glob itself which
trips up the current logic. Explicitly check if the file exists to avoid
this.

5 years agoArch: Explicitly install base package first
Daan De Meyer [Wed, 19 Aug 2020 20:06:55 +0000 (21:06 +0100)] 
Arch: Explicitly install base package first

Avoids dependency installation order issues due to other packages
implicitly depending on packages in base.

5 years agoMageia: Apply opensuse dracut fix
Daan De Meyer [Mon, 17 Aug 2020 23:46:44 +0000 (00:46 +0100)] 
Mageia: Apply opensuse dracut fix

5 years agoFall back to software CPU emulation if KVM isn't available
Daan De Meyer [Mon, 17 Aug 2020 22:38:54 +0000 (23:38 +0100)] 
Fall back to software CPU emulation if KVM isn't available

5 years agoFix WithUnifiedKernelImages
Daan De Meyer [Mon, 17 Aug 2020 20:37:31 +0000 (21:37 +0100)] 
Fix WithUnifiedKernelImages

5 years agoArch: Add vmlinuz add/remove hooks when using BIOS
Daan De Meyer [Mon, 17 Aug 2020 19:02:09 +0000 (20:02 +0100)] 
Arch: Add vmlinuz add/remove hooks when using BIOS

dracut doesn't actually copy these to /boot when using BIOS so we an
extra set of hooks to copy these over.

5 years agoOnly boot with OVMF when building UEFI images
Daan De Meyer [Mon, 17 Aug 2020 18:03:50 +0000 (19:03 +0100)] 
Only boot with OVMF when building UEFI images

5 years agoDon't write .pyc files when bin/mkosi is called with sudo
Joerg Behrmann [Sun, 23 Aug 2020 11:44:56 +0000 (13:44 +0200)] 
Don't write .pyc files when bin/mkosi is called with sudo

5 years agoMerge pull request #504 from behrmann/entrypoint_v2
Daan De Meyer [Sat, 22 Aug 2020 09:50:24 +0000 (10:50 +0100)] 
Merge pull request #504 from behrmann/entrypoint_v2

Entrypoint v2

5 years agomove do-a-release.sh to tools directory 504/head
Joerg Behrmann [Thu, 20 Aug 2020 12:42:29 +0000 (14:42 +0200)] 
move do-a-release.sh to tools directory

5 years agoadd generate-zipapp.sh script to generate a zipapp
Joerg Behrmann [Thu, 20 Aug 2020 12:41:20 +0000 (14:41 +0200)] 
add generate-zipapp.sh script to generate a zipapp