Pi 3 B WiFi Fix #3

Merged
skip merged 1 commits from :r9 into r9 2023-02-25 21:03:39 +00:00
Showing only changes of commit 2671712335 - Show all commits

View File

@ -1,15 +1,12 @@
# Kickstart to build Rocky 8 image for Raspberry Pi 4 hardware (aarch64) # Kickstart to build Rocky 8 image for Raspberry Pi 4 hardware (aarch64)
# #
# Disk setup # Disk setup
clearpart --initlabel --all clearpart --initlabel --all
part /boot --asprimary --fstype=vfat --size=300 --label=boot part /boot --asprimary --fstype=vfat --size=300 --label=boot
part swap --asprimary --fstype=swap --size=512 --label=swap part swap --asprimary --fstype=swap --size=512 --label=swap
part / --asprimary --fstype=ext4 --size=2800 --label=RPIROOT part / --asprimary --fstype=ext4 --size=2800 --label=RPIROOT
# Repos setup: # Repos setup:
url --url http://download.rockylinux.org/pub/rocky/9/BaseOS/aarch64/os/ url --url http://download.rockylinux.org/pub/rocky/9/BaseOS/aarch64/os/
repo --name="BaseOS" --baseurl=http://download.rockylinux.org/pub/rocky/9/BaseOS/aarch64/os/ --cost=100 repo --name="BaseOS" --baseurl=http://download.rockylinux.org/pub/rocky/9/BaseOS/aarch64/os/ --cost=100
@ -19,10 +16,6 @@ repo --name="CRB" --baseurl=http://download.rockylinux.org/pub/rocky/9/CRB/aarch
repo --name="rockyrpi" --baseurl=https://download.rockylinux.org/pub/sig/9/altarch/aarch64/altarch-rockyrpi/ --cost=20 repo --name="rockyrpi" --baseurl=https://download.rockylinux.org/pub/sig/9/altarch/aarch64/altarch-rockyrpi/ --cost=20
repo --name="rockyextras" --baseurl=https://download.rockylinux.org/pub/rocky/9/extras/aarch64/os/ --cost=20 repo --name="rockyextras" --baseurl=https://download.rockylinux.org/pub/rocky/9/extras/aarch64/os/ --cost=20
# Install process: # Install process:
#text #text
keyboard us --xlayouts=us --vckeymap=us keyboard us --xlayouts=us --vckeymap=us
@ -39,7 +32,6 @@ bootloader --location=none
lang en_US.UTF-8 lang en_US.UTF-8
skipx skipx
# Package selection: # Package selection:
%packages %packages
@core @core
@ -60,7 +52,6 @@ kernel-tools
langpacks-en langpacks-en
glibc-all-langpacks glibc-all-langpacks
# will enable rocky-release-rpi after full 9 release (and we have it in the -extras repo) # will enable rocky-release-rpi after full 9 release (and we have it in the -extras repo)
rocky-release-rpi rocky-release-rpi
raspberrypi2-firmware raspberrypi2-firmware
@ -68,18 +59,14 @@ raspberrypi2-kernel4
%end %end
# Post install scripts: # Post install scripts:
%post %post
# Write initial boot line to cmdline.txt (we will update the root partuuid further down) # Write initial boot line to cmdline.txt (we will update the root partuuid further down)
cat > /boot/cmdline.txt << EOF cat > /boot/cmdline.txt << EOF
console=ttyAMA0,115200 console=tty1 root= rootfstype=ext4 elevator=deadline rootwait console=ttyAMA0,115200 console=tty1 root= rootfstype=ext4 elevator=deadline rootwait
EOF EOF
# Apparently kickstart user was not working, attempt to do it here? # Apparently kickstart user was not working, attempt to do it here?
/sbin/useradd -c "Rocky Linux default user" -G wheel -m -U rocky /sbin/useradd -c "Rocky Linux default user" -G wheel -m -U rocky
echo "rockylinux" | passwd --stdin rocky echo "rockylinux" | passwd --stdin rocky
@ -97,8 +84,6 @@ This image WILL NOT WORK on a Raspberry Pi 1 or 2 (1.1 or earlier), we are 64-bi
The newer Pi Zero devices should be supported, as well as the Raspberry Pi 2 version 1.2 boards, which are 64-bit The newer Pi Zero devices should be supported, as well as the Raspberry Pi 2 version 1.2 boards, which are 64-bit
IMAGE NOTES / DIFFERENCES FROM STOCK ROCKY 8: IMAGE NOTES / DIFFERENCES FROM STOCK ROCKY 8:
- Based on Rocky Linux 9, points to production Rocky 9 aarch64 repositories - Based on Rocky Linux 9, points to production Rocky 9 aarch64 repositories
@ -107,7 +92,6 @@ IMAGE NOTES / DIFFERENCES FROM STOCK ROCKY 8:
- Initial User "rocky" (default password: "rockylinux"). Root password disabled, rocky user is a sudoer - Initial User "rocky" (default password: "rockylinux"). Root password disabled, rocky user is a sudoer
- Partitions are 300 MB /boot , 512 MB swap, 2800 MB rootfs. Requires a 4 GB or larger storage device to serve as your disk - Partitions are 300 MB /boot , 512 MB swap, 2800 MB rootfs. Requires a 4 GB or larger storage device to serve as your disk
GROW YOUR PARTITION: GROW YOUR PARTITION:
If you want to automatically resize your root (/ ) partition, just type the following (as root user): If you want to automatically resize your root (/ ) partition, just type the following (as root user):
@ -115,23 +99,16 @@ sudo rootfs-expand
It should fill your main rootfs partition to the end of the disk. It should fill your main rootfs partition to the end of the disk.
Thanks for your interest on Rocky-on-Rpi, feel free to share your experience or contribute in our chat channel at: https://chat.rockylinux.org/rocky-linux/channels/altarch ! Thanks for your interest on Rocky-on-Rpi, feel free to share your experience or contribute in our chat channel at: https://chat.rockylinux.org/rocky-linux/channels/altarch !
-The Rocky Linux Team -The Rocky Linux Team
EOF EOF
# Run the fix-wifi script (extracts the .xz firmware) - should be installed via the rocky-release-rpi package # Run the fix-wifi script (extracts the .xz firmware) - should be installed via the rocky-release-rpi package
# (shouldn't be needed anymore - fixed in newer rpi kernel builds) # (shouldn't be needed anymore - fixed in newer rpi kernel builds)
#fix-wifi-rpi.sh #fix-wifi-rpi.sh
# Cleanup before shipping an image # Cleanup before shipping an image
# Remove ifcfg-link on pre generated images # Remove ifcfg-link on pre generated images
@ -144,16 +121,12 @@ touch /etc/machine-id
# Ensure no ssh keys are present # Ensure no ssh keys are present
rm -f "/etc/ssh/*_key*" rm -f "/etc/ssh/*_key*"
# Clean yum cache # Clean yum cache
yum clean all yum clean all
# Fix weird sssd bug, where it gets its folder owned by the unbound user: # Fix weird sssd bug, where it gets its folder owned by the unbound user:
chown -R sssd:sssd /var/lib/sss/{db,pipes,mc,pubconf,gpo_cache} chown -R sssd:sssd /var/lib/sss/{db,pipes,mc,pubconf,gpo_cache}
# Setting tuned profile to powersave by default -> sets the CPU governor to "ondemand". This prevents overheating issues # Setting tuned profile to powersave by default -> sets the CPU governor to "ondemand". This prevents overheating issues
cat > /etc/sysconfig/cpupower << EOF cat > /etc/sysconfig/cpupower << EOF
# See 'cpupower help' and cpupower(1) for more info # See 'cpupower help' and cpupower(1) for more info
@ -161,11 +134,8 @@ CPUPOWER_START_OPTS="frequency-set -g ondemand"
CPUPOWER_STOP_OPTS="frequency-set -g ondemand" CPUPOWER_STOP_OPTS="frequency-set -g ondemand"
EOF EOF
%end %end
# Add the PARTUUID of the rootfs partition to the kernel command line # Add the PARTUUID of the rootfs partition to the kernel command line
# We must do this *outside* of the chroot, by grabbing the UUID of the loopmounted rootfs # We must do this *outside* of the chroot, by grabbing the UUID of the loopmounted rootfs
%post --nochroot %post --nochroot
@ -183,7 +153,6 @@ PART_UUID_ROOTFS="$(/sbin/blkid "$(/sbin/blkid --uuid $UUID_ROOTFS)" | \
echo "cmdline.txt looks like this, please review:" echo "cmdline.txt looks like this, please review:"
/bin/cat $INSTALL_ROOT/boot/cmdline.txt /bin/cat $INSTALL_ROOT/boot/cmdline.txt
# Extract UUID of swap partition: # Extract UUID of swap partition:
UUID_SWAP=$(/bin/grep 'swap' $INSTALL_ROOT/etc/fstab | awk '{print $1}' | awk -F '=' '{print $2}') UUID_SWAP=$(/bin/grep 'swap' $INSTALL_ROOT/etc/fstab | awk '{print $1}' | awk -F '=' '{print $2}')
@ -191,4 +160,9 @@ UUID_SWAP=$(/bin/grep 'swap' $INSTALL_ROOT/etc/fstab | awk '{print $1}' | awk
/usr/sbin/mkswap -L "_swap" -p 4096 -U "${UUID_SWAP}" /dev/disk/by-uuid/${UUID_SWAP} /usr/sbin/mkswap -L "_swap" -p 4096 -U "${UUID_SWAP}" /dev/disk/by-uuid/${UUID_SWAP}
%end %end
%post
# WiFi fix on Pi 3 Model B(image wont boot on Pi 3B w/o this fix)
cd /lib/firmware/brcm
xz -d -k brcmfmac43430-sdio.raspberrypi,3-model-b.txt.xz
%end