The package rpms/m1n1.git has added or updated architecture specific content in its spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s): https://src.fedoraproject.org/cgit/rpms/m1n1.git/commit/?id=885621e38c400ca7....
Change: +%ifarch aarch64
Thanks.
Full change: ============
commit d145488598ece26fb31deb4406f19d08f2d0e471 Author: Fedora Release Engineering releng@fedoraproject.org Date: Thu Jul 18 16:32:18 2024 +0000
Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
commit 885621e38c400ca74e42ef9c9ed8582c3af21fae Author: Davide Cavalca dcavalca@fedoraproject.org Date: Mon May 13 08:35:00 2024 -0700
Build stage1 as well on aarch64
diff --git a/.gitignore b/.gitignore index f45a081..1e173f8 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ /m1n1-1.4.12.tar.gz /m1n1-1.4.13.tar.gz /m1n1-1.4.14.tar.gz +/rust-fatfs-87fc1ed5074a32b4e0344fcdde77359ef9e75432.tar.gz diff --git a/m1n1-rust-deps.patch b/m1n1-rust-deps.patch new file mode 100644 index 0000000..d94852b --- /dev/null +++ b/m1n1-rust-deps.patch @@ -0,0 +1,18 @@ +diff -Naur a/rust/Cargo.toml b/rust/Cargo.toml +--- a/rust/Cargo.toml 2024-04-29 00:46:20.000000000 -0700 ++++ b/rust/Cargo.toml 2024-05-13 08:43:28.387201165 -0700 +@@ -12,10 +12,7 @@ + # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + [dependencies] + fatfs = { path = "vendor/rust-fatfs", default-features = false, features = ["lfn", "alloc"] } +-uuid = { version = "1.7.0", default-features = false } +- +-[patch.crates-io] +-uuid = { path = "vendor/uuid" } +-log = { path = "vendor/log" } +-bitflags = { path = "vendor/bitflags" } +-cfg-if = { path = "vendor/cfg-if" } ++uuid = { version = "1.8", default-features = false } ++log = "0.4" ++bitflags = "1" ++cfg-if = "1.0" diff --git a/m1n1.spec b/m1n1.spec index 594e6ae..3e66718 100644 --- a/m1n1.spec +++ b/m1n1.spec @@ -1,5 +1,21 @@ %global debug_package %{nil}
+# Chainloading support requires the aarch64-unknown-none-softfloat rust target, +# which is only available on aarch64 +%ifarch aarch64 +%bcond chainloading 1 +%else +%bcond chainloading 0 +%endif + +# We need to vendor fatfs because m1n1 stage1 relies on unreleased changes +# (notably, the lfn feature): https://github.com/rafalh/rust-fatfs/issues/81 +%global fatfs_commit 87fc1ed5074a32b4e0344fcdde77359ef9e75432 + +%global _description %{expand: +m1n1 is the bootloader developed by the Asahi Linux project to bridge the Apple +(XNU) boot ecosystem to the Linux boot ecosystem.} + Name: m1n1 Version: 1.4.14 Release: %autorelease @@ -10,6 +26,11 @@ Summary: Bootloader and experimentation playground for Apple Silicon License: MIT AND CC0-1.0 AND OFL-1.1-RFN AND Zlib AND (BSD-2-Clause OR GPL-2.0-or-later) AND (BSD-3-Clause OR GPL-2.0-or-later) URL: https://github.com/AsahiLinux/m1n1 Source: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz +Source: https://github.com/rafalh/rust-fatfs/archive/%%7Bfatfs_commit%7D/rust-fatfs-... +# Use distribution packages instead of the vendored ones +Patch: m1n1-rust-deps.patch +# https://github.com/rafalh/rust-fatfs/commit/eb274ca10d035c176e5eac79420ca734... +Patch: rust-fatfs-fix-build-log.patch
%ifarch aarch64 # On aarch64 do a native build @@ -33,6 +54,11 @@ BuildRequires: zopfli # For the udev rule BuildRequires: systemd-rpm-macros
+%if %{with chainloading} +BuildRequires: cargo-rpm-macros >= 24 +BuildRequires: rust-std-static-aarch64-unknown-none-softfloat +%endif + # These are bundled, modified and statically linked into m1n1 Provides: bundled(arm-trusted-firmware) Provides: bundled(dwc3) @@ -42,9 +68,26 @@ Provides: bundled(libfdt) Provides: bundled(minilzlib) Provides: bundled(tinf)
-%description -m1n1 is the bootloader developed by the Asahi Linux project to bridge the Apple -(XNU) boot ecosystem to the Linux boot ecosystem. +%description %_description + +%if %{with chainloading} +%package stage1 +Summary: %{summary} +# The following breakdown only covers the rust dependencies +# Apache-2.0 OR MIT +# MIT +# MIT OR Apache-2.0 +License: MIT AND CC0-1.0 AND OFL-1.1-RFN AND Zlib AND (BSD-2-Clause OR GPL-2.0-or-later) AND (BSD-3-Clause OR GPL-2.0-or-later) AND (Apache-2.0 OR MIT) AND MIT AND (MIT OR Apache-2.0) +# LICENSE.dependencies contains a full license breakdown of the rust dependencies + +# This is vendored and statically linked into m1n1 when building for stage 1 +Provides: bundled(crate(fatfs))= 0.4.0 + +%description stage1 %_description + +This package contains the stage1 build of m1n1 that is used by the Asahi Linux +Installer. +%endif
%package tools Summary: Developer tools for m1n1 @@ -55,11 +98,12 @@ Requires: python3dist(pyserial) Requires: systemd-udev BuildArch: noarch
-%description tools +%description tools %_description + This package contains various developer tools for m1n1.
%prep -%autosetup -p1 +%autosetup -N
# Use our logos # https://pagure.io/fedora-logos/pull-request/21 @@ -88,11 +132,35 @@ rm SourceCodePro-Bold.ttf font.bin font_retina.bin ./makefont.sh 16 32 25 "$font" font_retina.bin popd
+%if %{with chainloading} +tar -xf %{SOURCE1} -C rust/vendor/rust-fatfs --strip-components 1 +%autopatch -p1 + +%cargo_prep + +%generate_buildrequires +cd rust +%cargo_generate_buildrequires +%endif + %build +%if %{with chainloading} +%make_build %{buildflags} CHAINLOADING=1 +mv build build-stage1 +pushd rust +%{cargo_license_summary} +%{cargo_license} > LICENSE.dependencies +popd +%endif + %make_build %{buildflags}
%install install -Dpm0644 -t %{buildroot}%{_libdir}/%{name} build/%{name}.{bin,macho} +%if %{with chainloading} +install -Dpm0644 -t %{buildroot}%{_libdir}/%{name}-stage1 \ + build-stage1/%{name}.{bin,macho} +%endif install -Ddpm0755 %{buildroot}%{_libexecdir}/%{name} cp -pr proxyclient tools %{buildroot}%{_libexecdir}/%{name}/ install -Dpm0644 -t %{buildroot}%{_udevrulesdir} udev/80-m1n1.rules @@ -102,6 +170,13 @@ install -Dpm0644 -t %{buildroot}%{_udevrulesdir} udev/80-m1n1.rules %doc README.md %{_libdir}/%{name}
+%if %{with chainloading} +%files stage1 +%license LICENSE 3rdparty_licenses/LICENSE.* rust/vendor/rust-fatfs/LICENSE.txt rust/LICENSE.dependencies +%doc README.md +%{_libdir}/%{name}-stage1 +%endif + %files tools %{_libexecdir}/%{name} %{_udevrulesdir}/80-m1n1.rules diff --git a/rust-fatfs-fix-build-log.patch b/rust-fatfs-fix-build-log.patch new file mode 100644 index 0000000..ed6f9f0 --- /dev/null +++ b/rust-fatfs-fix-build-log.patch @@ -0,0 +1,28 @@ +From eb274ca10d035c176e5eac79420ca734c02613ae Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Harabie=C5=84?= rafalh92@outlook.com +Date: Mon, 9 Oct 2023 23:30:57 +0200 +Subject: [PATCH] Fix build with log v0.4.20 + +Fixes #87 +--- + src/log_macros.rs | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/rust/vendor/rust-fatfs/src/log_macros.rs b/rust/vendor/rust-fatfs/src/log_macros.rs +index 5d2e9d2..36a195d 100644 +--- a/rust/vendor/rust-fatfs/src/log_macros.rs ++++ b/rust/vendor/rust-fatfs/src/log_macros.rs +@@ -51,7 +51,12 @@ macro_rules! log { + log::log!(target: $target, lvl, $($arg)+); + } + }); +- ($lvl:expr, $($arg:tt)+) => (log!(target: log::__log_module_path!(), $lvl, $($arg)+)) ++ ($lvl:expr, $($arg:tt)+) => ({ ++ let lvl = $lvl; ++ if lvl <= $crate::log_macros::MAX_LOG_LEVEL { ++ log::log!(lvl, $($arg)+); ++ } ++ }) + } + + #[macro_export] diff --git a/sources b/sources index b307a38..0d44bbf 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ SHA512 (m1n1-1.4.14.tar.gz) = 5fee4af23dab761b5ee72ef1ddef654e8c1addc8faecef5963b87d69da89739574a5fc541c9a779c257be08f8b15f2e4ba59cbaaaf765a6b82a0696469455e2e +SHA512 (rust-fatfs-87fc1ed5074a32b4e0344fcdde77359ef9e75432.tar.gz) = ecfab788647e41573b7904199ca7e60c0845e4cb09b06dc7f4b2cb3e837f4e2571ab043dae6fb065658ffe6793748e1e09ee1a4f1edd7e1fd9e63580c3237b4e
arch-excludes@lists.fedoraproject.org