leifliddy / asahi-fedora-builder

Builds a minimal Fedora image to run on Apple M-series systems
MIT License
241 stars 11 forks source link

Just a query about kernel used #2

Closed ericcurtin closed 2 years ago

ericcurtin commented 2 years ago

Hi @leifliddy,

First of all thanks very much for your working porting this to fedora, it's running on my M1 Mac Mini and is running very well. Thanks for sharing this info:

The Fedora kernel config used is nearly identical to the kernel config used by the Asahi Linux project:
**only a few Fedora-specific modifications were made
https://github.com/AsahiLinux/PKGBUILDs/blob/main/linux-asahi/config

Did you build a fedora kernel, an asahi kernel or an upstream kernel here, just wondering what kernel it is specifically?

ericcurtin commented 2 years ago

I may create an unofficial CentOS Stream 9 version of this with RT patchset, for my own needs.

leifliddy commented 2 years ago

I basically followed what Asahi Linux was doing here: https://github.com/AsahiLinux/PKGBUILDs/tree/main/linux-asahi

Which currently uses the following source: https://github.com/AsahiLinux/linux/releases/tag/asahi-5.18-2

...and then updates that aforementioned 5.17 linux-asahi/config kernel config --> 5.18 via make olddefconfig

Then I simply took the official Fedora 5.18 kernel SRPM and modified it to use this kernel source and config: https://www.leifliddy.com/asahi-linux/36/source/SRPMS/kernel-5.18.0-asahi2.1.fc36.src.rpm

I'll post another message tonight highlighting the changes I made to the Asahi kernel config.

I'm glad someone found this project useful : )

ericcurtin commented 2 years ago

I'll post another message tonight highlighting the changes I made to the Asahi kernel config.

I'd appreciate that thanks

I'm glad someone found this project useful : )

There's more than a few finding this useful. :)

ericcurtin commented 2 years ago

I'm hoping to create a rt kernel fork:

https://github.com/ericcurtin/asahi-rt-builder

https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git/

leifliddy commented 2 years ago

These are the changes that were made.

#  The first line in kernel-aarch64-fedora.config must be arm64
-#
+# arm64

# Asahi Linux config
-CONFIG_LOCALVERSION="-ARCH"
-CONFIG_LOCALVERSION_AUTO=n
-CONFIG_BUILD_SALT=""

# Fedora config
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
# The spec file contains the following logic to set the value of CONFIG_BUILD_SALT
#  perl -p -i -e "s/^CONFIG_BUILD_SALT.*/CONFIG_BUILD_SALT=\"%{KVERREL}\"/" .config
# you don't need to specify this manually
+CONFIG_BUILD_SALT="5.18.0-asahi2.1.fc36.aarch64"

# The Fedora kernel configs don't contain any kernel module compression options
# The spec file contains the following logic to XZ compress the modules if %{zipmodules} is True
# Thereby making compression optional

#   if [ "%{zipmodules}" -eq "1" ]; then \
#    find $RPM_BUILD_ROOT/lib/modules/ -type f -name '*.ko' | xargs -P${RPM_BUILD_NCPUS} -r xz; \

# Asahi Linux config
-CONFIG_MODULE_COMPRESS_NONE=n
-CONFIG_MODULE_COMPRESS_ZSTD=y

# Fedora config
+CONFIG_MODULE_COMPRESS_NONE=y
+CONFIG_MODULE_COMPRESS_ZSTD=n

# Asahi Linux config
-CONFIG_MD_CLUSTER=m
-CONFIG_USB_CONFIGFS_F_MIDI=y
-CONFIG_USB_CONFIGFS_F_UVC=y
-CONFIG_USB_MIDI_GADGET=m
-CONFIG_USB_G_WEBCAM=m

# Fedora config
# the MD_CLUSTER, USB_MIDI_GADGET, AND USB_G_WEBCAM modules wouldn't compile correctly
# **I'm not sure why
# the USB_CONFIGFS modules were removed as dependencies
+CONFIG_MD_CLUSTER=n
+CONFIG_USB_CONFIGFS_F_MIDI=n
+CONFIG_USB_CONFIGFS_F_UVC=n
+CONFIG_USB_MIDI_GADGET=n
+CONFIG_USB_G_WEBCAM=n

# Fedora attempts to load the pkcs8_key_parser module at boot time, so therefore we include it
# Asahi Linux config
-CONFIG_PKCS8_PRIVATE_KEY_PARSER is not set

# Fedora config
+CONFIG_PKCS8_PRIVATE_KEY_PARSER=m

# Change CONFIG_LSM to match Fedora kernel
# this really doesn't matter as most of these modules aren't even enabled
# Asahi Linux config
-CONFIG_LSM="yama,loadpin,safesetid,integrity,selinux,smack,tomoyo,apparmor"

# Fedora config
+CONFIG_LSM="lockdown,yama,integrity,selinux,bpf,landlock"
leifliddy commented 2 years ago

I'm hoping to create a rt kernel fork:

https://github.com/ericcurtin/asahi-rt-builder

https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git/

Nice! Sounds interesting.