aboutsummaryrefslogtreecommitdiffstats
path: root/platforms/rpi-aarch64/second_stage_install.sh
diff options
context:
space:
mode:
authorJybz <j.biernacki@free.fr>2023-08-26 16:21:11 +0200
committerJybz <j.biernacki@free.fr>2023-08-26 16:21:11 +0200
commita3b81566b3b730e0a3bc3e768a40498b230bf524 (patch)
tree2e3c33db3569a850f6891ed6f4c8205fd23e0ee0 /platforms/rpi-aarch64/second_stage_install.sh
parent48cc20fa0f1ca83f26577df702ed64beeb1d3b32 (diff)
downloadmageia4arm-a3b81566b3b730e0a3bc3e768a40498b230bf524.tar
mageia4arm-a3b81566b3b730e0a3bc3e768a40498b230bf524.tar.gz
mageia4arm-a3b81566b3b730e0a3bc3e768a40498b230bf524.tar.bz2
mageia4arm-a3b81566b3b730e0a3bc3e768a40498b230bf524.tar.xz
mageia4arm-a3b81566b3b730e0a3bc3e768a40498b230bf524.zip
Chore: rework rpi script
using upstream dtb setting u-boot env for memory error and skipping preboot snifing usb
Diffstat (limited to 'platforms/rpi-aarch64/second_stage_install.sh')
-rw-r--r--platforms/rpi-aarch64/second_stage_install.sh31
1 files changed, 27 insertions, 4 deletions
diff --git a/platforms/rpi-aarch64/second_stage_install.sh b/platforms/rpi-aarch64/second_stage_install.sh
index 88125ae..5d3f165 100644
--- a/platforms/rpi-aarch64/second_stage_install.sh
+++ b/platforms/rpi-aarch64/second_stage_install.sh
@@ -19,12 +19,18 @@
export ARCH=arm64
+# remove the warning:
+# 186/194: lockdev warning: group lock does not exist - using root
+# #############################################
+groupadd -r lock
+
/usr/bin/chown :shadow /etc/shadow /etc/gshadow /etc/login.defs /etc/pam.d/chage-chfn-chsh /etc/pam.d/chpasswd-newusers /etc/pam.d/system-auth /etc/pam.d/user-group-mod /bin/passwd /bin/chage
/usr/bin/chown :systemd-journal -R /var/log/journal
#Install all packages you need
-<INSTALL_EXEC> basesystem grub2-efi efibootmgr chrony polkit lockdev rng-tools man openssh-server rfkill wireless-tools bluez wpa_supplicant make rsync binutils ldetect usbutils kernel-desktop-latest u-boot
+<INSTALL_EXEC> basesystem grub2-efi efibootmgr chrony polkit lockdev rng-tools man openssh-server rfkill wireless-tools bluez wpa_supplicant make rsync binutils ldetect usbutils kernel-desktop-latest u-boot u-boot-tools
+
#For the wifi :
/sbin/urpmi.update "Nonfree Release"
@@ -32,12 +38,29 @@ export ARCH=arm64
<INSTALL_EXEC> --media "Nonfree Release,Nonfree Updates" -a --fuzzy kernel-firmware-nonfree
<INSTALL_EXEC> --media "Nonfree Release,Nonfree Updates" raspberrypi-firmware
-/usr/bin/sed -i -e 's/GRUB_CMDLINE_LINUX_DEFAULT="\(.*\)"/GRUB_CMDLINE_LINUX_DEFAULT="\1 audit=0"/' /etc/default/grub
+/usr/bin/sed -i -e '/GRUB_CMDLINE_LINUX_DEFAULT/s|"[[:space:]]*$| audit=0"|' /etc/default/grub
+
+echo \
+"# Configuration file for fw_(printenv/setenv) utility.
+# Up to two entries are valid, in this case the redundant
+# environment sector is assumed present.
+# MTD device name Device offset Env. size Flash sector size
+/boot/EFI/uboot.env 0x0000 0x4000" > /etc/fw_env.config
+
+sed -e 's|preboot=.*$|preboot=|' \
+ -e 's|kernel_addr_r=.*$|kernel_addr_r=0x00001000|' \
+ /usr/lib/u-boot/rpi_arm64/default_env.txt \
+ | mkenvimage -s $((0x4000)) -o /boot/EFI/uboot.env -
+
+cp /usr/lib/u-boot/rpi_arm64/u-boot.bin /boot/EFI/u-boot.bin
-mv /etc/grub.d/30_os-prober /tmp
+# permanently disable access to u-boot from grub, not working and not required.
+chmod -x /etc/grub.d/30_uefi-firmware
+# disable osprober because it finds and embedded the BuildSystem OS into the image.
+chmod -x /etc/grub.d/30_os-prober
/usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg
/usr/sbin/grub2-install --skip-fs-probe --target=arm64-efi --efi-directory=/boot/EFI --removable --no-nvram --force-file-id
-mv /tmp/30_os-prober /etc/grub.d/
+chmod +x /etc/grub.d/30_os-prober
/usr/bin/chown :chrony -R /etc/chrony.keys /var/log/chrony
/usr/bin/chown :daemon /etc/wpa_supplicant.conf