Compare commits

...

7 Commits

Author SHA1 Message Date
Pratham Patel
ab0dc451f1
README: specify the debug flag 2024-04-30 11:02:21 +05:30
Pratham Patel
a1d73a65b1
update readme 2024-04-30 10:56:59 +05:30
Pratham Patel
f692add983
do user setup "correctly" 2024-04-30 10:42:00 +05:30
Pratham Patel
d3a5d4ea18
switch from GRUB2 to systemd-boot 2024-04-30 10:40:14 +05:30
Pratham Patel
550563d561
some more, non-asahi cleanup 2024-04-30 10:37:24 +05:30
Pratham Patel
6bedd927b0
remove asahi-specific stuff 2024-04-30 10:31:37 +05:30
Pratham Patel
55c7fc5760
rawhide -> f40 2024-04-30 10:23:00 +05:30
13 changed files with 20 additions and 174 deletions

View File

@ -1,87 +1 @@
# Fedora Asahi Remix KIWI descriptions
This contains the KIWI descriptions for building the Fedora Asahi Remix.
This repository has multiple branches, one for each supported Fedora release. The default branch is `rawhide`, and is probably _not_ what you want.
## Spin variants
* Minimal (image type: `oem`, image profiles: `Minimal`)
* Server (image type: `oem`, image profiles: `Server`)
* Workstation GNOME (image type: `oem`, image profiles: `Workstation-GNOME`)
* Workstation KDE (image type: `oem`, image profiles: `Workstation-KDE`)
## Spin build quickstart
### Pre-requisites for non-AArch64 hosts
On non-AArch64 hosts, install `qemu-user-static` and restart the binfmt service:
```bash
$ sudo dnf --assumeyes install qemu-user-static
$ sudo systemctl restart systemd-binfmt.service
```
Note that building non-aarch64 is untested and likely to expose bugs.
### Podman
The instructions below will use the `podman` command. Only Podman is supported for this workflow.
First, pull down the container of the required environment (Fedora Linux 36 or higher works). We'll use Fedora Linux 37.
```bash
$ sudo podman pull registry.fedoraproject.org/fedora:37-aarch64
```
Assuming you're in the root directory of the Git checkout, set up the container:
```bash
$ sudo podman run --privileged --rm -it -v $PWD:/code:z -w /code registry.fedoraproject.org/fedora:37-aarch64 /bin/bash
```
Once in the container environment, set up your development environment and run the image build (substitute `<image_type>` and `<image_profile>` for the appropriate settings):
```bash
# Install kiwi
[]$ dnf --assumeyes install kiwi
# Run the image build
[]$ kiwi-ng --type=<image_type> --profile=<image_profile> --color-output system build --description ./ --target-dir ./outdir
```
For example, to build the --profile=Workstation-GNOME profile:
```bash
[]$ kiwi-ng --debug --type=oem --profile=Workstation-GNOME --color-output system build --description ./ --target-dir ./outdir
```
We also provide a script to generate an [Asahi Installer](https://github.com/AsahiLinux/asahi-installer) package from the raw image that kiwi produces:
```bash
# Install prerequsites
[]$ dnf --assumeyes install fatcat gawk p7zip-plugins rpmdistro-repoquery util-linux zip zstd
# Build the package
[]$ ./make-asahi-installer-package.sh outdir/Fedora-Asahi-Remix.aarch64-0.0.0.raw package.zip
```
## Contributing
Please default to submitting PRs against the `rawhide` branch. Release branches should generally merge from `rawhide` and only deviate where absolutely necessary.
This project is tested using the [Software Factory Zuul CI instance](https://fedora.softwarefactory-project.io/zuul/project/pagure.io/fedora-asahi/kiwi-descriptions)
using the [Test Management Tool](https://tmt.readthedocs.io/).
## Licensing
This is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, under version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
sudo kiwi-ng --debug --type=oem --profile=Minimal --color-output system build --description ./ --target-dir ./outdir

View File

@ -129,9 +129,6 @@ def kiwiBuild(profile):
def packageBuild(target):
# TODO: rewrite in python instead of shelling out
runCommand(["./make-asahi-installer-package.sh"])
base = f"fedora-{RELEASE}-{target['id']}-{BUILDVER}"
os.rename(f"fedora-{RELEASE}-{BUILDVER}.zip", f"{base}.zip")
os.rename(f"fedora-{RELEASE}-{BUILDVER}.logs.zip", f"{base}.logs.zip")

View File

@ -5,19 +5,15 @@
<packages type="image" patternType="plusRecommended" profiles="Common">
<namedCollection name="core"/>
<namedCollection name="standard"/>
<namedCollection name="hardware-support"/>
<package name="NetworkManager-wifi"/>
<package name="chrony"/>
<package name="initial-setup"/>
<package name="glibc-all-langpacks"/>
<package name="shadow-utils"/>
<ignore name="abrt-cli"/>
<ignore name="dracut-config-rescue"/>
<ignore name="generic-release*"/>
<ignore name="generic-logos*"/>
<!-- Asahi packages -->
<package name="alsa-ucm-asahi"/>
<package name="asahi-platform-metapackage"/>
<package name="asahi-repos"/>
<package name="fedora-asahi-remix-scripts"/>
<package name="tiny-dfr"/>
</packages>
</image>

View File

@ -3,21 +3,13 @@
<profile name="BootCore" description="Boot core packages"/>
</profiles>
<packages type="bootstrap" patternType="plusRecommended" profiles="BootCore">
<package name="grubby"/>
<package name="sdubby"/>
</packages>
<packages type="image" patternType="plusRecommended" profiles="BootCore">
<package name="grub2-efi-aa64" arch="aarch64"/>
<package name="grub2-efi-aa64-modules" arch="aarch64"/>
<package name="shim-signed-aa64" arch="aarch64"/>
<package name="grub2-efi-aa64" arch="aarch64"/>
<package name="uboot-images-armv8" arch="aarch64"/>
<package name="kernel-16k"/>
<package name="kernel-16k-modules-extra"/>
<package name="kernel"/>
<package name="kernel-modules-extra"/>
<package name="systemd-boot-unsigned"/>
<package name="systemd-oomd-defaults"/>
<package name="systemd-resolved"/>
<!-- Asahi packages -->
<package name="asahi-fwextract" arch="aarch64"/>
<package name="dracut-asahi" arch="aarch64"/>
<package name="update-m1n1" arch="aarch64"/>
</packages>
</image>

View File

@ -1,6 +1,6 @@
<image>
<users profiles="Azure,AWSEC2,OpenStack,LiveInstall">
<!-- The password here does not matter, it will be erased in config.sh -->
<user name="root" groups="root" password="linux" home="/root" pwdformat="plain" />
<user name="root" groups="root" home="/root" password="fedora_rocks!" pwdformat="plain" />
<user name="riscv" groups="riscv,wheel" home="/home/riscv" password="fedora_rocks!" pwdformat="plain" />
</users>
</image>

View File

@ -33,23 +33,6 @@ echo 'uninitialized' > /etc/machine-id
## remove random seed, the newly installed instance should make its own
rm -f /var/lib/systemd/random-seed
#======================================
# Configure grub correctly
#--------------------------------------
## Works around issues with grub-bls
## See: https://github.com/OSInside/kiwi/issues/2198
echo "GRUB_DEFAULT=saved" >> /etc/default/grub
## Disable submenus to match Fedora
echo "GRUB_DISABLE_SUBMENU=true" >> /etc/default/grub
## Disable recovery entries to match Fedora
echo "GRUB_DISABLE_RECOVERY=true" >> /etc/default/grub
#======================================
# Delete & lock the root user password
#--------------------------------------
passwd -d root
passwd -l root
#======================================
# Setup default services
#--------------------------------------
@ -57,27 +40,6 @@ passwd -l root
## Enable persistent journal
mkdir -p /var/log/journal
#======================================
# Setup firstboot initial setup
#--------------------------------------
if [[ "$kiwi_profiles" == *"KDE"* ]]; then
## Enable calamares
systemctl enable calamares-firstboot.service
elif [[ "$kiwi_profiles" != *"GNOME"* ]] && [[ "$kiwi_profiles" != *"KDE"* ]]; then
## Enable initial-setup
systemctl enable initial-setup.service
## Enable reconfig mode
touch /etc/reconfigSys
fi
## Enable swap setup on firstboot
systemctl enable asahi-setup-swap-firstboot.service
## Enable extras install on firstboot; this will only run if the extras are
## actually present (and self disable afterwards)
systemctl enable asahi-extras-firstboot.service
#======================================
# Setup default target
#--------------------------------------
@ -99,11 +61,4 @@ rpm -qa --qf '%{size}\t%{name}-%{version}-%{release}.%{arch}\n' |sort -rn
# Note that running rpm recreates the rpm db files which aren't needed or wanted
rm -f /var/lib/rpm/__db*
#======================================
# Generate boot.bin
#======================================
mkdir -p /boot/efi/m1n1
update-m1n1 /boot/efi/m1n1/boot.bin
rm /boot/.builder
exit 0

View File

@ -13,10 +13,9 @@
<keytable>us</keytable>
<timezone>UTC</timezone>
<rpm-check-signatures>true</rpm-check-signatures>
<release-version>rawhide</release-version>
<release-version>40</release-version>
</preferences>
<include from="this://./repositories/core.xml"/>
<include from="this://./repositories/asahi.xml"/>
<include from="this://./components/boot.xml"/>
<include from="this://./components/base.xml"/>
<include from="this://./components/desktop-environments.xml"/>

View File

@ -7,7 +7,7 @@
</profiles>
<preferences profiles="Minimal">
<type image="oem" filesystem="btrfs" kernelcmdline="" target_blocksize="4096" bootpartition="true" bootpartsize="1024" bootfilesystem="ext4" efipartsize="500" firmware="uefi" btrfs_root_is_subvolume="true" btrfs_set_default_volume="false" rootfs_label="fedora" fsmountoptions="x-systemd.growfs,compress=zstd:1">
<bootloader name="grub2" console="none" timeout="5" timeout_style="menu"/>
<bootloader name="systemd_boot"/>
<systemdisk name="fedora">
<volume name="@root=root"/>
<volume name="home" parent="/"/>

View File

@ -7,7 +7,7 @@
</profiles>
<preferences profiles="Server">
<type image="oem" filesystem="btrfs" kernelcmdline="" target_blocksize="4096" bootpartition="true" bootpartsize="1024" bootfilesystem="ext4" efipartsize="500" firmware="uefi" btrfs_root_is_subvolume="true" btrfs_set_default_volume="false" rootfs_label="fedora" fsmountoptions="x-systemd.growfs,compress=zstd:1">
<bootloader name="grub2" console="none" timeout="5" timeout_style="menu"/>
<bootloader name="systemd_boot"/>
<systemdisk name="fedora">
<volume name="@root=root"/>
<volume name="home" parent="/"/>

View File

@ -15,7 +15,7 @@
</profiles>
<preferences profiles="WorkstationCommon">
<type image="oem" filesystem="btrfs" kernelcmdline="rhgb quiet" target_blocksize="4096" bootpartition="true" bootpartsize="1024" bootfilesystem="ext4" efipartsize="500" firmware="uefi" btrfs_root_is_subvolume="true" btrfs_set_default_volume="false" rootfs_label="fedora" fsmountoptions="x-systemd.growfs,compress=zstd:1">
<bootloader name="grub2" console="console" timeout="1" timeout_style="hidden"/>
<bootloader name="systemd_boot"/>
<systemdisk name="fedora">
<volume name="@root=root"/>
<volume name="home" parent="/"/>

View File

@ -1,12 +1,5 @@
<image>
<repository type="rpm-md" alias="fedora" sourcetype="metalink">
<source path="https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&amp;arch=$basearch">
<signing key="file:///usr/share/distribution-gpg-keys/fedora/RPM-GPG-KEY-fedora-$releasever-primary"/>
</source>
</repository>
<repository type="rpm-md" alias="updates" sourcetype="metalink">
<source path="https://mirrors.fedoraproject.org/metalink?repo=updates-released-f$releasever&amp;arch=$basearch">
<signing key="file:///usr/share/distribution-gpg-keys/fedora/RPM-GPG-KEY-fedora-$releasever-primary"/>
</source>
</repository>
<repository type="rpm-md" alias="fedora" sourcetype="baseurl">
<source path="http://fedora.riscv.rocks/repos-dist/f$releasever/latest/$basearch"></source>
</repository>
</image>

View File

@ -1 +1 @@
core-rawhide.xml
core-nonrawhide.xml

View File

@ -3,4 +3,4 @@
UPDATEDEFAULT=yes
# DEFAULTKERNEL specifies the default kernel package type
DEFAULTKERNEL=kernel-16k-core
DEFAULTKERNEL=kernel-core