Skip to content

Commit

Permalink
Document broken grub2-mkconfig call
Browse files Browse the repository at this point in the history
  • Loading branch information
korewaChino committed Oct 10, 2024
1 parent 694e342 commit 73fa138
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 4 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,56 @@ jobs:
name: image-arm
path: tests/ng/katsu-work/image/*.raw.zstd

bios-x86_64:
runs-on: ubuntu-latest
container:
image: ghcr.io/terrapkg/builder:f38
# Pass /dev from host to container
# Very hacky, but it works
# Microsoft/Github, if you're reading this,
# I'm sorry.
options: --privileged -v /dev:/dev

steps:
- uses: actions/checkout@v4
- name: Cache DNF packages
uses: actions/cache@v2
with:
path: /var/cache/dnf
key: dnf-${{ runner.os }}
restore-keys: |
dnf-${{ runner.os }}-
dnf-
- name: Install dependencies
run: |
dnf install -y $DNF_PKGS
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- uses: Swatinem/rust-cache@v2

- name: Build and install katsu
run: cargo install --path . --debug

- name: Run test
run: |
export PATH=$HOME/.cargo/bin:$PATH
export KATSU_KEEP_CHROOT=1
pushd tests/ng
echo "COLORBT_SHOW_HIDDEN=1" >> .env
echo "KATSU_LOG=trace" >> .env
katsu -o disk-image katsu-bios.yaml 2>&1
zstd -19 katsu-work/image/katsu.img -c > katsu-work/image/katsu.raw.zstd
popd
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: image-x86_64
path: tests/ng/katsu-work/image/*.raw.zstd

image-x86_64:
runs-on: ubuntu-latest
container:
Expand Down
1 change: 1 addition & 0 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ impl RootBuilder for DnfRootBuilder {

// While grub2-mkconfig may not return 0 it should still work
// todo: figure out why it still wouldn't write the file to /boot/grub2/grub.cfg
// but works when run inside a post script
let res = crate::chroot_run_cmd!(&chroot,
grub2-mkconfig -o /boot/grub2/grub.cfg;
);
Expand Down
3 changes: 3 additions & 0 deletions tests/ng/katsu-bios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ scripts:
name: Relabel SELinux for new filesystem
file: modules/scripts/selinux.sh

# Generate GRUB configuration
# While Katsu tries to actually generate one for you before running scripts,
# That process is not perfect and usually does not actually write the configuration to the disk at least for now.
- id: grub-install
name: Install GRUB
file: modules/scripts/grub-confgen.sh
Expand Down
2 changes: 1 addition & 1 deletion tests/ng/modules/scripts/grub-confgen.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash -x

# Re-generate GRUB configuration in case Katsu fails to create one during the build process
grub2-mkconfig -o /boot/grub2/grub.cfg
5 changes: 2 additions & 3 deletions tests/ng/modules/scripts/grub-install.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/bin/bash
set -x
# Disable os-prober for now


# Re-generate GRUB configuration in case Katsu fails to create one during the build process
grub2-mkconfig -o /boot/grub2/grub.cfg

# get /dev/ of /boot, or / if /boot is not a separate partition
function find_bootdev {
Expand Down

0 comments on commit 73fa138

Please sign in to comment.