Skip to content

Commit

Permalink
update more stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
korewaChino committed Sep 23, 2023
1 parent 1a8c1c3 commit e7d87ad
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/arm-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ jobs:
cargo \
moby-engine
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- uses: Swatinem/rust-cache@v2

Expand Down
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
# katsu
An experimental image builder for RPM/DNF based systems.
# Katsu

> An experimental image builder for RPM/DNF based systems.
Katsu is a tool for building bootable images from RPM based systems. It is an alternative Lennart Poettering's [mkosi](https://github.com/systemd/mkosi) tool, designed to be robust, fast, and easy to use while still providing many output formats. It is Ultramarine Linux's new image builder from Ultramarine 39 onwards.

Katsu currently supports the following output formats:

- ISO 9660 disc images
- RAW disk images

## Why Katsu?

Katsu stemmed from our frustration with Fedora's Lorax/OSBuild toolchain. Lorax is a very complex Python application that relies on another complex Python application, Anaconda, to build images. Then on top of that uses hard-to-read Mako templates to configure the image on top.

We found it difficult to work with Lorax and Anaconda, and we wanted to build images in a more straightforward way where we can control any aspect of the image building process down to the filesystem layout. And thus, Katsu was born.

Katsu uses YAML configuration files to describe the image, with modular manifests similar to the likes of rpm-ostree. This makes it easy to read, write, and maintain Katsu configurations.

## Dependencies

- `xorriso`
- `dracut`
- `limine` or `grub2`
Expand Down
16 changes: 14 additions & 2 deletions src/creator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ pub trait ImageCreator {
self.init_script()?;
self.instpkgs()?;
// self.dracut()?;
// self.rootpw()?;
self.rootpw()?;
self.postinst_script()?;

// self.squashfs()?;
Expand Down Expand Up @@ -570,10 +570,22 @@ pub trait ImageCreator {
extra_args.push("--forcearch");
extra_args.push(cfg.arch.as_ref().unwrap());
}
prepare_chroot(root).unwrap_or_else(|e| {
error!(?e, "Failed to prepare chroot");
std::process::exit(1);
});
cmd_lib::run_cmd!(
$dnf in -y --releasever=$rel $[extra_args] --installroot $root $[pkgs];
$dnf clean all;
)?;
).unwrap_or_else(|e| {
error!(?e, "Failed to install packages");
unmount_chroot(root).unwrap_or_else(|e| {
error!(?e, "Failed to unmount chroot");
std::process::exit(1);
});
std::process::exit(1);
});
unmount_chroot(root)?;
Ok(())
}
}
Expand Down
16 changes: 13 additions & 3 deletions tests/katsudon-arm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ packages:
- btrfs-progs
- dmraid
- nvme-cli
- dbus-daemon
# necessary stuff
- "@core"
- fedora-repos
Expand All @@ -35,11 +34,22 @@ packages:
- chrony
- dracut-config-generic
- "@arm-tools"
# - "-dracut-config-rescue"
- chrony
- "@hardware-support"
# - "-iwl*"
# - "-ipw*"
# - "-usb_modeswitch"
- grub2-efi-aa64
- grub2-efi-aa64-modules
- grub2-efi-aa64-cdboot
- grub2-tools


disk:
bootloader: true
root_format: btrfs
disk_size: 8G
root_format: xfs
disk_size: 6G

sys:
releasever: 38
Expand Down
2 changes: 1 addition & 1 deletion tests/postinst.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ echo max_parallel_downloads=20 >> /etc/dnf/dnf.conf
echo defaultyes=True >> /etc/dnf/dnf.conf

systemd-sysusers

cp -P /usr/share/uboot/rpi_arm64/u-boot.bin /boot/efi/rpi-u-boot.bin
cp -P /usr/share/uboot/rpi_3/u-boot.bin /boot/efi/rpi3-u-boot.bin
cp -P /usr/share/uboot/rpi_4/u-boot.bin /boot/efi/rpi4-u-boot.bin
rm -f /var/lib/systemd/random-seed
Expand Down

0 comments on commit e7d87ad

Please sign in to comment.