diff --git a/DOCS.md b/DOCS.md index cf0fad4..75f2954 100644 --- a/DOCS.md +++ b/DOCS.md @@ -1,7 +1,14 @@ # Docs -Build image with kiwi-ng +Use `kiwi/build-all.sh` for building all images for installer. -``` -kiwi-ng -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 \ No newline at end of file diff --git a/TODO.md b/TODO.md index 88ab27a..0d1451a 100644 --- a/TODO.md +++ b/TODO.md @@ -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 diff --git a/installer/installer_data-todo.json b/installer/installer_data-todo.json deleted file mode 100644 index f3f1a59..0000000 --- a/installer/installer_data-todo.json +++ /dev/null @@ -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" - } - ] - } - ] -} \ No newline at end of file diff --git a/installer/installer_data.json b/installer/installer_data.json index 4056152..200d035 100644 --- a/installer/installer_data.json +++ b/installer/installer_data.json @@ -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,11 +27,110 @@ { "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" } ] } ] -} \ No newline at end of file +} diff --git a/kiwi/asahi.xml b/kiwi/asahi.xml deleted file mode 100644 index e69de29..0000000 diff --git a/kiwi/base.xml b/kiwi/base.xml deleted file mode 100644 index e69de29..0000000 diff --git a/kiwi/build-all.sh b/kiwi/build-all.sh new file mode 100755 index 0000000..97cccfe --- /dev/null +++ b/kiwi/build-all.sh @@ -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 + diff --git a/kiwi/config.sh b/kiwi/config.sh index 8df5821..d742ff4 100644 --- a/kiwi/config.sh +++ b/kiwi/config.sh @@ -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 diff --git a/kiwi/config.xml b/kiwi/config.xml index c81cbaf..f5a2577 100644 --- a/kiwi/config.xml +++ b/kiwi/config.xml @@ -15,10 +15,22 @@ us UTC true - + true + + + + + + + + + + + false + true @@ -28,13 +40,19 @@ + + + - + - + + + + @@ -49,7 +67,7 @@ - + @@ -61,6 +79,7 @@ + @@ -72,6 +91,7 @@ + @@ -92,9 +112,9 @@ + - @@ -109,7 +129,9 @@ - + + + diff --git a/kiwi/make-installer.sh b/kiwi/make-installer.sh index 63085fb..e096a79 100755 --- a/kiwi/make-installer.sh +++ b/kiwi/make-installer.sh @@ -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 < installer_data-$package.json < - + - + - + - + - + - + \ No newline at end of file diff --git a/kiwi/root/etc/zypp/repos.d/asahi.repo b/kiwi/root/etc/zypp/repos.d/asahi.repo index b1778f1..cd8d9b3 100644 --- a/kiwi/root/etc/zypp/repos.d/asahi.repo +++ b/kiwi/root/etc/zypp/repos.d/asahi.repo @@ -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 \ No newline at end of file diff --git a/scripts/00_build_repo.sh b/scripts/00_build_repo.sh index eecfa67..b5e099a 100755 --- a/scripts/00_build_repo.sh +++ b/scripts/00_build_repo.sh @@ -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 . diff --git a/scripts/01_build_kernel.sh b/scripts/01_build_kernel.sh index b820858..aa270c7 100755 --- a/scripts/01_build_kernel.sh +++ b/scripts/01_build_kernel.sh @@ -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 diff --git a/scripts/02_build_rpms.sh b/scripts/02_build_rpms.sh index 0598b49..b17c354 100755 --- a/scripts/02_build_rpms.sh +++ b/scripts/02_build_rpms.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -e # This script clones & builds all packages using .spec files. diff --git a/specs/asahi-dtbs.spec b/specs/asahi-dtbs.spec deleted file mode 100644 index 8202a12..0000000 --- a/specs/asahi-dtbs.spec +++ /dev/null @@ -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 \ No newline at end of file diff --git a/specs/asahi-scripts.spec b/specs/asahi-scripts.spec index 65e7643..6f778ba 100644 --- a/specs/asahi-scripts.spec +++ b/specs/asahi-scripts.spec @@ -14,7 +14,6 @@ Requires: growpart Requires: coreutils Requires: diffutils Requires: dosfstools -Requires: kernel-firmware-all Requires: sed Requires: tar Requires: asahi-dtbs diff --git a/specs/kernel.sh b/specs/kernel.sh index 2fe477c..560d41f 100755 --- a/specs/kernel.sh +++ b/specs/kernel.sh @@ -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" \ No newline at end of file +echo "Prepared kernel.spec for $ver-asahi-suse" \ No newline at end of file