Skip to content

Commit

Permalink
cleanup files, more
Browse files Browse the repository at this point in the history
  • Loading branch information
korewaChino committed Oct 26, 2023
1 parent 83ba77f commit f60010f
Show file tree
Hide file tree
Showing 5 changed files with 263 additions and 7 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/build-katsu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ jobs:
fail-fast: false
matrix:
variant:
- flagship
- gnome
- kde
- pantheon
- flagship/flagship-live
- gnome/gnome-live
- kde/kde-live
- pantheon/pantheon-live
- base/base-disk-x86_64
- base/base-disk-aarch64
runs-on: ubuntu-latest
container:
image: ghcr.io/terrapkg/builder:f38
Expand Down Expand Up @@ -79,7 +81,7 @@ jobs:
- name: Build ISO
run: |
pushd katsu
katsu --output=iso modules/${{ matrix.variant }}/${{ matrix.variant }}-live.yaml
katsu --output=iso modules/${{ matrix.variant }}.yaml
popd
- name: Upload ISO
Expand Down
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,19 @@

This repository contains various scripts and configuration files for building an Ultramarine Linux image.

It mainly contains Kickstart scripts, scripts which are used by the Anaconda installer to automatically install the initial Ultramarine Linux image, which are then built into the final bootable image using weldr's [Lorax](https://github.com/weldr/lorax) tool.
## Building an image

Install Katsu

```bash
dnf install katsu
```

Run Katsu on manifest

```bash
katsu -o iso katsu/modules/flagship/flagship-live.yaml
```

## Ultramarine Linux Docker/OCI image

Expand All @@ -13,11 +25,13 @@ The image itself is similar to the vanilla Fedora image, but includes the Ultram
## Building locally

To build the image locally, you need to have the following installed:

- Lorax
- Anaconda
- pykickstart

You can then run the following command to build the image:

```
./build.sh <VARIANT>
```
```
94 changes: 94 additions & 0 deletions katsu/modules/base/base-disk-aarch64.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
builder: dnf
distro: Ultramarine Linux 39

users:
- username: ultramarine
# plaintext password: ultramarine
password: "$y$j9T$6/DebcxXazPrtBYnNXtEM.$yaUJHww5Mo1L8xNJ9IDJ.bvKOrIJxAG9PGQKWioBMx3"
groups:
- wheel


import:
- base.yaml

scripts:
post:
- id: grub
name: Set up GRUB
file: grub-setup.sh

disk:
size: 8GiB
partitions:
- label: EFI
size: 512MiB
filesystem: efi
mountpoint: /boot/efi

- label: boot
size: 1GiB
filesystem: ext4
mountpoint: /boot

- label: root
# size: 2.5MiB
filesystem: ext4
mountpoint: /


dnf:
releasever: 39
arch: aarch64
options:
- --setopt=cachedir=/var/cache/dnf
- --nogpgcheck
- --setopt=keepcache=True
exclude:
- fedora-release*
- generic-release*
packages:
- filesystem
- setup
- lvm2
- btrfs-progs
- dmraid
- nvme-cli
- kernel
- glibc
- glibc-common
- dracut-config-generic
- dracut-tools
- dnf
- dracut
# - mkpasswd # maybe not needed soon
- "@core"
- "@standard"
- grub2-tools
- "@hardware-support"
- NetworkManager
- rpm
- libgomp
- ultramarine-release-identity-basic
- ultramarine-release-basic
- fedora-repos
- efibootmgr

arch_packages:
aarch64:
- grub2-efi-aa64
- grub2-efi-aa64-modules
- grub2-efi-aa64-cdboot
- shim-aa64
- shim-unsigned-aarch64
- bcm283x-firmware
- bcm283x-overlays
- "@arm-tools"
x86_64:
- grub2-efi-x64
- grub2-efi-x64-modules
- grub2-efi-x64-cdboot
- grub2-pc
- grub2-pc-modules
- shim-x64
- shim-unsigned-x64
93 changes: 93 additions & 0 deletions katsu/modules/base/base-disk-x86_64.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
builder: dnf
distro: Ultramarine Linux 39

users:
- username: ultramarine
# plaintext password: ultramarine
password: "$y$j9T$6/DebcxXazPrtBYnNXtEM.$yaUJHww5Mo1L8xNJ9IDJ.bvKOrIJxAG9PGQKWioBMx3"
groups:
- wheel


import:
- base.yaml

scripts:
post:
- id: grub
name: Set up GRUB
file: grub-setup.sh

disk:
size: 8GiB
partitions:
- label: EFI
size: 512MiB
filesystem: efi
mountpoint: /boot/efi

- label: boot
size: 1GiB
filesystem: ext4
mountpoint: /boot

- label: root
# size: 2.5MiB
filesystem: ext4
mountpoint: /


dnf:
releasever: 39
options:
- --setopt=cachedir=/var/cache/dnf
- --nogpgcheck
- --setopt=keepcache=True
exclude:
- fedora-release*
- generic-release*
packages:
- filesystem
- setup
- lvm2
- btrfs-progs
- dmraid
- nvme-cli
- kernel
- glibc
- glibc-common
- dracut-config-generic
- dracut-tools
- dnf
- dracut
# - mkpasswd # maybe not needed soon
- "@core"
- "@standard"
- grub2-tools
- "@hardware-support"
- NetworkManager
- rpm
- libgomp
- ultramarine-release-identity-basic
- ultramarine-release-basic
- fedora-repos
- efibootmgr

arch_packages:
aarch64:
- grub2-efi-aa64
- grub2-efi-aa64-modules
- grub2-efi-aa64-cdboot
- shim-aa64
- shim-unsigned-aarch64
- bcm283x-firmware
- bcm283x-overlays
- "@arm-tools"
x86_64:
- grub2-efi-x64
- grub2-efi-x64-modules
- grub2-efi-x64-cdboot
- grub2-pc
- grub2-pc-modules
- shim-x64
- shim-unsigned-x64
53 changes: 53 additions & 0 deletions katsu/modules/base/grub-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash
set -x
# Disable os-prober for now

echo "Disabling os-prober..."

echo "GRUB_DISABLE_OS_PROBER=true" > /etc/default/grub
grub2-mkconfig > /boot/grub2/grub.cfg
rm /etc/default/grub


# get /dev/ of /boot, or / if /boot is not a separate partition
function find_bootdev {
# try findmnt /boot
if findmnt -n -o SOURCE /boot; then
bootdev=$(findmnt -n -o SOURCE /boot)
else
bootdev=$(findmnt -n -o SOURCE /)
fi
}


find_bootdev
# get blkid of /boot
bootid=$(blkid -s UUID -o value $bootdev)

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

# edit ro to rw in all entries

sed -i 's/ ro / rw /g' /boot/loader/entries/*.conf

dracut -vfN --add-drivers "virtio virtio_blk virtio_scsi xchi_pci mmc" --regenerate-all

arch=$(uname -m)
if [[ $arch == "aarch64" ]]; then
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
fi
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*

0 comments on commit f60010f

Please sign in to comment.