Push pre-release change

This commit is contained in:
Ivan Bushchik 2023-03-02 20:34:21 +03:00
parent 3b90d2623c
commit 5af9fd942c
No known key found for this signature in database
GPG key ID: 9F6DDABE11A2674D
18 changed files with 197 additions and 326 deletions

15
DOCS.md
View file

@ -1,7 +1,14 @@
# Docs
Build image with kiwi-ng
Use `kiwi/build-all.sh` for building all images for installer.
```
kiwi-ng -profile=<image_profile> --color-output system build --description ./ --target-dir ./outdir
```
## All images
- Tumbleweed-JeOS
- Tumbleweed-KDE
- Tumbleweed-GNOME
- Tumbleweed-XFCE
- Leap-JeOS
- Leap-KDE
- Leap-GNOME
- Leap-XFCE

View file

@ -5,9 +5,9 @@
- [x] Build Tumbleweed image using kiwi-ng
- [x] Prepare repos with necessary packages (kernel, m1n1, u-boot, asahi-scripts, etc.)
- [x] Provide basic types of openSUSE (Leap, Tumbleweed) for installation.
- [x] Build installer (for use like general Asahi installer, ex. `curl https://ivabus.dev/suse | sh`)
- [x] Prepare basic (cli only, DE) rootfs images
------
- [ ] Prepare basic (cli only, DE) rootfs images
- [ ] Build installer (for use like general Asahi installer, ex. `curl https://ivabus.dev/suse | sh`)
- [ ] Test every type of installation
- [ ] Document things
- [ ] First release

View file

@ -1,220 +0,0 @@
{
"os_list": [
{
"name": "openSUSE Tumbleweed KDE",
"default_os_name": "openSUSE Tumbleweed",
"boot_object": "m1n1.bin",
"next_object": "m1n1/boot.bin",
"package": "asahi-plasma-20221122-4.zip",
"supported_fw": ["12.3", "12.3.1", "12.4"],
"partitions": [
{
"name": "EFI",
"type": "EFI",
"size": "500MB",
"format": "fat",
"volume_id": "0x2abf9f91",
"copy_firmware": true,
"copy_installer_data": true,
"source": "esp"
},
{
"name": "Root",
"type": "Linux",
"size": "12GB",
"expand": true,
"image": "root.img"
}
]
},
{
"name": "openSUSE Tumbleweed GNOME",
"default_os_name": "openSUSE Tumbleweed",
"boot_object": "m1n1.bin",
"next_object": "m1n1/boot.bin",
"package": "asahi-plasma-20221122-4.zip",
"supported_fw": ["12.3", "12.3.1", "12.4"],
"partitions": [
{
"name": "EFI",
"type": "EFI",
"size": "500MB",
"format": "fat",
"volume_id": "0x2abf9f91",
"copy_firmware": true,
"copy_installer_data": true,
"source": "esp"
},
{
"name": "Root",
"type": "Linux",
"size": "12GB",
"expand": true,
"image": "root.img"
}
]
},
{
"name": "openSUSE Tumbleweed XFCE",
"default_os_name": "openSUSE Tumbleweed",
"boot_object": "m1n1.bin",
"next_object": "m1n1/boot.bin",
"package": "asahi-plasma-20221122-4.zip",
"supported_fw": ["12.3", "12.3.1", "12.4"],
"partitions": [
{
"name": "EFI",
"type": "EFI",
"size": "500MB",
"format": "fat",
"volume_id": "0x2abf9f91",
"copy_firmware": true,
"copy_installer_data": true,
"source": "esp"
},
{
"name": "Root",
"type": "Linux",
"size": "12GB",
"expand": true,
"image": "root.img"
}
]
},
{
"name": "openSUSE Tumbleweed base",
"default_os_name": "openSUSE Tumbleweed",
"boot_object": "m1n1.bin",
"next_object": "m1n1/boot.bin",
"package": "asahi-plasma-20221122-4.zip",
"supported_fw": ["12.3", "12.3.1", "12.4"],
"partitions": [
{
"name": "EFI",
"type": "EFI",
"size": "500MB",
"format": "fat",
"volume_id": "0x2abf9f91",
"copy_firmware": true,
"copy_installer_data": true,
"source": "esp"
},
{
"name": "Root",
"type": "Linux",
"size": "12GB",
"expand": true,
"image": "root.img"
}
]
},
{
"name": "openSUSE Leap KDE",
"default_os_name": "openSUSE Leap",
"boot_object": "m1n1.bin",
"next_object": "m1n1/boot.bin",
"package": "asahi-plasma-20221122-4.zip",
"supported_fw": ["12.3", "12.3.1", "12.4"],
"partitions": [
{
"name": "EFI",
"type": "EFI",
"size": "500MB",
"format": "fat",
"volume_id": "0x2abf9f91",
"copy_firmware": true,
"copy_installer_data": true,
"source": "esp"
},
{
"name": "Root",
"type": "Linux",
"size": "12GB",
"expand": true,
"image": "root.img"
}
]
},
{
"name": "openSUSE Leap GNOME",
"default_os_name": "openSUSE Leap",
"boot_object": "m1n1.bin",
"next_object": "m1n1/boot.bin",
"package": "asahi-plasma-20221122-4.zip",
"supported_fw": ["12.3", "12.3.1", "12.4"],
"partitions": [
{
"name": "EFI",
"type": "EFI",
"size": "500MB",
"format": "fat",
"volume_id": "0x2abf9f91",
"copy_firmware": true,
"copy_installer_data": true,
"source": "esp"
},
{
"name": "Root",
"type": "Linux",
"size": "12GB",
"expand": true,
"image": "root.img"
}
]
},
{
"name": "openSUSE Leap XFCE",
"default_os_name": "openSUSE Leap",
"boot_object": "m1n1.bin",
"next_object": "m1n1/boot.bin",
"package": "asahi-plasma-20221122-4.zip",
"supported_fw": ["12.3", "12.3.1", "12.4"],
"partitions": [
{
"name": "EFI",
"type": "EFI",
"size": "500MB",
"format": "fat",
"volume_id": "0x2abf9f91",
"copy_firmware": true,
"copy_installer_data": true,
"source": "esp"
},
{
"name": "Root",
"type": "Linux",
"size": "12GB",
"expand": true,
"image": "root.img"
}
]
},
{
"name": "openSUSE Leap base",
"default_os_name": "openSUSE Leap",
"boot_object": "m1n1.bin",
"next_object": "m1n1/boot.bin",
"package": "asahi-plasma-20221122-4.zip",
"supported_fw": ["12.3", "12.3.1", "12.4"],
"partitions": [
{
"name": "EFI",
"type": "EFI",
"size": "500MB",
"format": "fat",
"volume_id": "0x2abf9f91",
"copy_firmware": true,
"copy_installer_data": true,
"source": "esp"
},
{
"name": "Root",
"type": "Linux",
"size": "12GB",
"expand": true,
"image": "root.img"
}
]
}
]
}

View file

@ -5,7 +5,7 @@
"default_os_name": "openSUSE Tumbleweed",
"boot_object": "m1n1.bin",
"next_object": "m1n1/boot.bin",
"package": "installer-suse.zip",
"package": "Tumbleweed-JeOS.zip.zip",
"supported_fw": ["12.3", "12.3.1", "12.4"],
"partitions": [
{
@ -13,7 +13,7 @@
"type": "EFI",
"size": "536870912B",
"format": "fat",
"volume_id": "0xa060cfc3",
"volume_id": "0x163ea456",
"copy_firmware": true,
"copy_installer_data": true,
"source": "esp"
@ -27,7 +27,106 @@
{
"name": "Root",
"type": "Linux",
"size": "2970595328B",
"size": "3426725888B",
"expand": true,
"image": "root.img"
}
]
},
{
"name": "openSUSE Tumbleweed",
"default_os_name": "openSUSE Tumbleweed",
"boot_object": "m1n1.bin",
"next_object": "m1n1/boot.bin",
"package": "Tumbleweed-KDE.zip.zip",
"supported_fw": ["12.3", "12.3.1", "12.4"],
"partitions": [
{
"name": "EFI",
"type": "EFI",
"size": "536870912B",
"format": "fat",
"volume_id": "0x22de729d",
"copy_firmware": true,
"copy_installer_data": true,
"source": "esp"
},
{
"name": "Boot",
"type": "Linux",
"size": "1073741824B",
"image": "boot.img"
},
{
"name": "Root",
"type": "Linux",
"size": "3426725888B",
"expand": true,
"image": "root.img"
}
]
},
{
"name": "openSUSE Tumbleweed",
"default_os_name": "openSUSE Tumbleweed",
"boot_object": "m1n1.bin",
"next_object": "m1n1/boot.bin",
"package": "Tumbleweed-GNOME.zip.zip",
"supported_fw": ["12.3", "12.3.1", "12.4"],
"partitions": [
{
"name": "EFI",
"type": "EFI",
"size": "536870912B",
"format": "fat",
"volume_id": "0x2fdf3c2a",
"copy_firmware": true,
"copy_installer_data": true,
"source": "esp"
},
{
"name": "Boot",
"type": "Linux",
"size": "1073741824B",
"image": "boot.img"
},
{
"name": "Root",
"type": "Linux",
"size": "3426725888B",
"expand": true,
"image": "root.img"
}
]
},
{
"name": "openSUSE Tumbleweed",
"default_os_name": "openSUSE Tumbleweed",
"boot_object": "m1n1.bin",
"next_object": "m1n1/boot.bin",
"package": "Tumbleweed-XFCE.zip.zip",
"supported_fw": ["12.3", "12.3.1", "12.4"],
"partitions": [
{
"name": "EFI",
"type": "EFI",
"size": "536870912B",
"format": "fat",
"volume_id": "0x3d67bec6",
"copy_firmware": true,
"copy_installer_data": true,
"source": "esp"
},
{
"name": "Boot",
"type": "Linux",
"size": "1073741824B",
"image": "boot.img"
},
{
"name": "Root",
"type": "Linux",
"size": "3426725888B",
"expand": true,
"image": "root.img"
}

View file

View file

14
kiwi/build-all.sh Executable file
View file

@ -0,0 +1,14 @@
#!/bin/bash
set -e
mkdir -p installers
for distro in "Tumbleweed" "Leap"; do
for edition in "JeOS" "KDE" "GNOME" "XFCE"; do
rm -rf ./outdir-$distro-$edition
echo Building $distro-$edition
kiwi-ng --type=oem --profile=$distro-$edition --color-output system build --description ./ --target-dir ./outdir-$distro-$edition
./make-installer.sh outdir-$distro-$edition/asahi-opensuse.aarch64-0.0.1.raw $distro-$edition.zip
done
done

View file

@ -26,8 +26,8 @@ passwd -l root
# Setup default services
#--------------------------------------
## Enable NetworkManager
systemctl enable NetworkManager.service
## Enable wicked
systemctl enable wicked.service
## Enable chrony
systemctl enable chronyd.service
## Enable persistent journal

View file

@ -15,10 +15,22 @@
<keytable>us</keytable>
<timezone>UTC</timezone>
<rpm-check-signatures>true</rpm-check-signatures>
<type image="oem" filesystem="btrfs" firmware="uefi" bootpartition="true" bootpartsize="1024" bootfilesystem="ext4" efipartsize="512" target_blocksize="4096">
<rpm-excludedocs>true</rpm-excludedocs>
<type image="oem" filesystem="btrfs" fsmountoptions="x-systemd.growfs,compress=zstd:1" btrfs_root_is_snapshot="true" firmware="uefi" bootpartition="true" bootpartsize="1024" bootfilesystem="ext4" efipartsize="512" target_blocksize="4096">
<bootloader name="grub2" console="gfxterm"/>
<systemdisk name="asahi">
<volume name="home"/>
<volume name="root"/>
<volume name="tmp"/>
<volume name="opt"/>
<volume name="srv"/>
<volume name="boot/grub2/arm64-efi" mountpoint="boot/grub2/arm64-efi"/>
<volume name="usr/local"/>
<volume name="var" copy_on_write="false"/>
</systemdisk>
<oemconfig>
<oem-resize>false</oem-resize>
<oem-skip-verify>true</oem-skip-verify>
</oemconfig>
</type>
</preferences>
@ -28,13 +40,19 @@
<profiles>
<profile name="Tumbleweed" description="Tumbleweed base"/>
<profile name="Leap" description="Leap base"/>
<profile name="Leap-JeOS" description="Leap JeOS">
<requires profile="Leap"/>
</profile>
<profile name="Leap-KDE" description="Leap with KDE desktop">
<requires profile="Tumbleweed"/>
<requires profile="Leap"/>
</profile>
<profile name="Leap-GNOME" description="Leap with GNOME desktop">
<requires profile="Tumbleweed"/>
<requires profile="Leap"/>
</profile>
<profile name="Leap-XFCE" description="Leap with XFCE desktop">
<requires profile="Leap"/>
</profile>
<profile name="Tumbleweed-JeOS" description="Tumbleweed JeOS">
<requires profile="Tumbleweed"/>
</profile>
<profile name="Tumbleweed-KDE" description="Tumbleweed with KDE desktop">
@ -49,7 +67,7 @@
</profiles>
<include from="this://./repos.xml"/>
<!-- Asahi repo -->
<repository type="rpm-md" alias="asahi" sourcetype="baseurl" priority="1" imageinclude="true">
<repository type="rpm-md" alias="asahi" sourcetype="baseurl" priority="1">
<source path="https://storage.ivabus.dev/asahi-opensuse/repo/">
<signing key="https://ivabus.dev/key.asc"/>
</source>
@ -61,6 +79,7 @@
<package name="gawk"/>
<package name="grep"/>
<package name="gzip"/>
<package name="glibc"/>
<package name="glibc-locale"/>
<package name="cracklib-dict-full"/>
<package name="ca-certificates"/>
@ -72,6 +91,7 @@
<package name="patterns-base-base"/>
<package name="patterns-base-apparmor"/>
<package name="patterns-openSUSE-base"/>
<package name="aaa_base-extras"/>
<package name="acl"/>
<package name="btrfsprogs"/>
<package name="btrfsmaintenance"/>
@ -92,9 +112,9 @@
<package name="rollback-helper"/>
<package name="snapper"/>
<package name="firewalld"/>
<package name="wicked"/>
<package name="systemd"/>
<package name="timezone"/>
<package name="NetworkManager"/>
<package name="wpa_supplicant"/>
<package name="iproute2"/>
<package name="openssh"/>
@ -109,7 +129,9 @@
<package name="yast2-firstboot"/>
</packages>
<packages type="image">
<package name="kernel"/>
<package name="kernel-default"/>
<package name="kernel-asahi-dtbs"/>
<package name="kernel-firmware"/>
<package name="m1n1"/>
<package name="uboot-asahi"/>
<package name="asahi-scripts"/>

View file

@ -16,8 +16,8 @@ requireCommands() {
}
date=$(date +%Y%m%d)
image="${1:-outdir/asahi-opensuse.aarch64-0.0.1.raw}"
package="installer-suse"
image="${1}"
package="${2}"
if [ ! -r "$image" ]; then
fail "$image does not exist or cannot be read!"
@ -56,7 +56,7 @@ pushd "${workdir}/package" > /dev/null
popd > /dev/null
cat > installer_data.json <<EOF
cat > installer_data-$package.json <<EOF
{
"os_list": [
{

View file

@ -1,23 +1,23 @@
<image>
<!-- Tumbleweed repositories -->
<repository type="rpm-md" alias="repo-oss" profiles="Tumbleweed" imageinclude="true">
<repository type="rpm-md" alias="repo-oss" profiles="Tumbleweed">
<source path="http://download.opensuse.org/ports/aarch64/tumbleweed/repo/oss/"/>
</repository>
<repository type="rpm-md" alias="repo-debug" profiles="Tumbleweed" imageinclude="true">
<repository type="rpm-md" alias="repo-debug" profiles="Tumbleweed">
<source path="http://download.opensuse.org/ports/aarch64/debug/tumbleweed/repo/oss/"/>
</repository>
<repository type="rpm-md" alias="repo-update" profiles="Tumbleweed" imageinclude="true">
<repository type="rpm-md" alias="repo-update" profiles="Tumbleweed">
<source path="http://download.opensuse.org/ports/aarch64/update/tumbleweed/"/>
</repository>
<repository type="rpm-md" alias="repo-src-oss" profiles="Tumbleweed" imageinclude="true">
<repository type="rpm-md" alias="repo-src-oss" profiles="Tumbleweed">
<source path="http://download.opensuse.org/ports/aarch64/source/tumbleweed/repo/oss/"/>
</repository>
<!-- Leap repositories -->
<repository type="rpm-md" alias="repo-oss" profiles="Leap" imageinclude="true">
<repository type="rpm-md" alias="repo-oss" profiles="Leap">
<source path="http://download.opensuse.org/distribution/leap/15.3/repo/oss"/>
</repository>
<repository type="rpm-md" alias="repo-non-oss" profiles="Leap" imageinclude="true">
<repository type="rpm-md" alias="repo-non-oss" profiles="Leap">
<source path="http://download.opensuse.org/distribution/leap/15.3/repo/non-oss/"/>
</repository>
</image>

View file

@ -2,5 +2,5 @@
name=asahi
baseurl=https://storage.ivabus.dev/asahi-opensuse/repo
enabled=1
gpgcheck=1
gpgcheck=0
gpgkey=https://ivabus.dev/key.asc

View file

@ -1,8 +1,22 @@
#!/bin/bash
set -e
# This script clones & builds all RPMs that are used in repository.
# Build kernel
# clean up
rm -rf ../repo
sh 01_build_kernel.sh
# sh 02_build_m1n1.sh
sh 02_build_rpms.sh
mkdir -p ../repo/{RPMS,SRPMS}
# RpmBuildDir
RBD=$(rpm --eval "%{_topdir}")
cp -rv $RBD/RPMS ../repo/
cp -rv $RBD/SRPMS ../repo/
cd ../repo
createrepo --xz .

View file

@ -1,41 +1,7 @@
#!/bin/bash
set -e
# This script clones & builds all linux-asahi related packages.
_rcver=6.2
_rcrel=3
_asahirel=6
_commit_id=asahi-${_rcver}${_rcrel+-rc}${_rcrel}-${_asahirel}
makethreads=`nproc`
CC=gcc
CXX=g++
if [ ! -d build ]; then
mkdir build
fi
cd build
if [ ! -f ${_commit_id}.tar.gz ]; then
echo "Downloading linux-asahi sources"
curl -fSLO https://github.com/AsahiLinux/linux/archive/refs/tags/${_commit_id}.tar.gz
fi
if [ ! -d linux-${_commit_id} ]; then
echo "Unpacking linux-asahi"
tar xpf ${_commit_id}.tar.gz
fi
curl -o config -fsSL https://raw.githubusercontent.com/AsahiLinux/PKGBUILDs/main/linux-asahi/config
sed -i -e s/-ARCH/-suse/ config
cd linux-${_commit_id}
echo "Building main kernel"
cp ../config .config
make olddefconfig prepare
diff -u ../config .config || :
make -j$makethreads CC=$CC CXX=$CXX rpm-pkg
# Making source package for asahi-dtbs
make dtbs
make INSTALL_PATH=. dtbs_install
tar cf dtbs-${_rcver}${_rcrel+_rc}${_rcrel}_${_asahirel}.tar dtbs/
cp dtbs-${_rcver}${_rcrel+_rc}${_rcrel}_${_asahirel}.tar ~/rpmbuild/SOURCES/
../specs/kernel.sh
rpmbuild -ba kernel.spec
rm -f kernel.spec

View file

@ -1,4 +1,5 @@
#!/bin/bash
set -e
# This script clones & builds all packages using .spec files.

View file

@ -1,29 +0,0 @@
Name: asahi-dtbs
Version: 6.2_rc3_6
# From _commit_id in 01_build_kernel.sh
Release: 1
Summary: Device Trees (dtb) for Apple Silicon machines
License: GPLv2+
URL: https://github.com/AsahiLinux/linux
BuildArch: aarch64
Source0: dtbs-%{version}.tar
# Generated by 01_build_kernel.sh
%description
Device Trees (dtb) for Apple Silicon machines
%prep
%setup -n dtbs
%install
install -Dpm 755 -t %{buildroot}/lib/modules/$(cat release)-ARCH/dtbs/ $(find . -type f)
%files
/lib/modules/*-ARCH/dtbs/
%posttrans
update-m1n1
%changelog

View file

@ -14,7 +14,6 @@ Requires: growpart
Requires: coreutils
Requires: diffutils
Requires: dosfstools
Requires: kernel-firmware-all
Requires: sed
Requires: tar
Requires: asahi-dtbs

View file

@ -25,7 +25,7 @@ cat > kernel.spec << EOF
%define _commit_id asahi-%{_rcver}%(if [ ! %_rcrel == "0" ]; then echo -rc%{_rcrel}; fi)-%{_asahirel}
%define _rpm_ver %{_rcver}%(if [ ! %_rcrel == "0" ]; then echo _rc%{_rcrel}; fi)_%{_asahirel}_asahi_suse
%define ver ${ver}-asahi-suse
Name: kernel
Name: kernel-asahi
Summary: The Linux Kernel
Version: %{_rpm_ver}
Release: 1
@ -35,7 +35,7 @@ Vendor: The Linux Community
URL: https://www.kernel.org
Source0: https://github.com/AsahiLinux/linux/archive/refs/tags/%{_commit_id}.tar.gz
Source1: config-%{_commit_id}
Provides: kernel-drm kernel-%{_rpm_ver} kernel-default kernel kernel-asahi
Provides: kernel-drm kernel-base kernel-%{_rpm_ver} kernel-default kernel kernel-asahi
BuildRequires: bc binutils bison dwarves
BuildRequires: (elfutils-libelf-devel or libelf-devel) flex
BuildRequires: gcc make openssl openssl-devel perl python3 rsync
@ -54,9 +54,7 @@ Requires(post): kmod-zstd
%package headers
Summary: Header files for the Linux kernel for use by glibc
Group: Development/System
Obsoletes: kernel-headers
Provides: kernel-headers = %{version}
Provides: glibc-kernheaders
Provides: kernel-headers
%description headers
Kernel-headers includes the C header files that specify the interface
between the Linux kernel and userspace libraries and programs. The
@ -68,7 +66,7 @@ glibc package.
Summary: Development package for building kernel modules to match the %{_rpm_ver} kernel
Group: System Environment/Kernel
AutoReqProv: no
%description -n kernel-devel
%description devel
This package provides kernel headers and makefiles sufficient to build modules
against the %{_rpm_ver} kernel package.
@ -154,4 +152,4 @@ fi
%defattr (-, root, root)
/lib/modules/*-ARCH/dtbs/
EOF
echo "Prepared kernel.spec for $ver"
echo "Prepared kernel.spec for $ver-asahi-suse"