-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update more things, add scripting test
- Loading branch information
1 parent
16f4e8e
commit ee3e5e2
Showing
8 changed files
with
183 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: Build test | ||
|
||
on: | ||
push: | ||
branches: [ refactor ] | ||
|
||
jobs: | ||
unit-test: | ||
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 \ | ||
xorriso \ | ||
rpm \ | ||
limine \ | ||
systemd \ | ||
btrfs-progs \ | ||
e2fsprogs \ | ||
xfsprogs \ | ||
dosfstools \ | ||
grub2 \ | ||
parted \ | ||
util-linux-core \ | ||
systemd-container \ | ||
grub2-efi \ | ||
uboot-images-armv8 \ | ||
uboot-tools \ | ||
rustc \ | ||
qemu-user-static-aarch64 \ | ||
qemu-user-binfmt \ | ||
qemu-kvm \ | ||
qemu-img \ | ||
cargo \ | ||
systemd-devel \ | ||
mkpasswd \ | ||
moby-engine | ||
- 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 | ||
pushd tests/ng | ||
echo "COLORBT_SHOW_HIDDEN=1" >> .env | ||
echo "KATSU_LOG=trace" >> .env | ||
katsu -o disk-image katsu.yaml 2>&1 | ||
xz -z9 katsu-work/image/katsu.img -c > katsu-work/image/katsu.raw.xz | ||
popd | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: katsudon-arm | ||
path: tests/ng/katsu-work/image/*.raw.xz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash -x | ||
|
||
# get /dev/ of /boot | ||
bootdev=$(findmnt -n -o SOURCE /boot) | ||
|
||
# get blkid of /boot | ||
bootid=$(blkid -s UUID -o value $bootdev) | ||
|
||
# heredoc for /dev/disk | ||
|
||
cat << EOF > /boot/efi/EFI/fedora/grub.cfg | ||
search --no-floppy --fs-uuid --set=dev $bootid | ||
set prefix=(\$dev)/grub2 | ||
export \$prefix | ||
configfile \$prefix/grub.cfg | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash -x | ||
rm -f /var/lib/systemd/random-seed | ||
rm -f /etc/NetworkManager/system-connections/*.nmconnection | ||
|
||
rm -f /etc/machine-id | ||
touch /etc/machine-id | ||
|
||
rm -f /var/lib/rpm/__db* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/bash | ||
echo "Hello from pre2.sh" | ||
echo "This is an integration test for Katsu, the Ultramarine image builder." | ||
# check if $CHROOT is set, if not, exit | ||
|
||
|
||
echo "Testing if CHROOT is set..." | ||
if [ -z "$CHROOT" ]; then | ||
echo "CHROOT is not set, exiting." | ||
exit 1 | ||
fi | ||
echo "CHROOT: $CHROOT" | ||
|
||
# check if $CHROOT is a directory, if not, exit | ||
echo "Testing if CHROOT is a directory..." | ||
if [ ! -d "$CHROOT" ]; then | ||
echo "CHROOT is not a directory, exiting." | ||
exit 1 | ||
fi | ||
|
||
# check if $CHROOT is readable, if not, exit | ||
echo "Testing if CHROOT is readable..." | ||
if [ ! -r "$CHROOT" ]; then | ||
echo "CHROOT is not readable, exiting." | ||
exit 1 | ||
fi | ||
|
||
# check if $CHROOT is writable, if not, exit | ||
echo "Testing if CHROOT is writable..." | ||
if [ ! -w "$CHROOT" ]; then | ||
echo "CHROOT is not writable, exiting." | ||
exit 1 | ||
fi | ||
|
||
|
||
|
||
echo "Enjoy!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash -x | ||
|
||
setfiles -v -F -e /proc -e /sys -e /dev -e /bin /etc/selinux/targeted/contexts/files/file_contexts / | ||
setfiles -v -F -e /proc -e /sys -e /dev -e /etc/selinux/targeted/contexts/files/file_contexts.bin /bin |