Deal with system firmware
This commit is contained in:
parent
0968113a36
commit
7fc56ee45a
1 changed files with 12 additions and 11 deletions
23
build-rpi.sh
23
build-rpi.sh
|
@ -99,7 +99,6 @@ EOF
|
||||||
chmod +x ubuntusway-$architecture/third-stage
|
chmod +x ubuntusway-$architecture/third-stage
|
||||||
LANG=C chroot ubuntusway-$architecture /third-stage
|
LANG=C chroot ubuntusway-$architecture /third-stage
|
||||||
|
|
||||||
|
|
||||||
# Install Raspberry Pi specific packages
|
# Install Raspberry Pi specific packages
|
||||||
cat << EOF > ubuntusway-$architecture/hardware
|
cat << EOF > ubuntusway-$architecture/hardware
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
@ -246,26 +245,28 @@ mount -o bind "${basedir}/bootp/" ubuntusway-$architecture/boot/firmware
|
||||||
# Copy Raspberry Pi specific files
|
# Copy Raspberry Pi specific files
|
||||||
cp -r "${rootdir}"/rpi/rootfs/system-boot/* ubuntusway-${architecture}/boot/firmware/
|
cp -r "${rootdir}"/rpi/rootfs/system-boot/* ubuntusway-${architecture}/boot/firmware/
|
||||||
|
|
||||||
|
NEW_KERNEL=$(ls -1 ubuntusway-$architecture/boot/vmlinuz-* | tail -n1 | awk -F/ '{print $NF}' | cut -d'-' -f2-4)
|
||||||
|
if [ -z "${NEW_KERNEL}" ]; then
|
||||||
|
echo "ERROR! Could not detect the new kernel version"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Kernel: ${NEW_KERNEL}"
|
||||||
|
|
||||||
# Copy kernels and firmware to boot partition
|
# Copy kernels and firmware to boot partition
|
||||||
cat << EOF > ubuntusway-$architecture/hardware
|
cat << EOF > ubuntusway-$architecture/hardware
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
cp /boot/vmlinuz /boot/firmware/vmlinuz
|
cp /boot/vmlinuz-${NEW_KERNEL} /boot/firmware/vmlinuz
|
||||||
cp /boot/initrd.img /boot/firmware/initrd.img
|
cp /boot/initrd.img-${NEW_KERNEL} /boot/firmware/initrd.img
|
||||||
# Copy device-tree blobs to fat32 partition
|
# Copy device-tree blobs to fat32 partition
|
||||||
cp -r /lib/firmware/*-raspi/device-tree/broadcom/* /boot/firmware/
|
cp -r /lib/firmware/${NEW_KERNEL}/device-tree/broadcom/* /boot/firmware/
|
||||||
cp -r /lib/firmware/*-raspi/device-tree/overlays /boot/firmware/
|
cp -r /lib/firmware/${NEW_KERNEL}/device-tree/overlays /boot/firmware/
|
||||||
|
cp -v /lib/linux-firmware-raspi/* /boot/firmware/
|
||||||
rm -f hardware
|
rm -f hardware
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
chmod +x ubuntusway-$architecture/hardware
|
chmod +x ubuntusway-$architecture/hardware
|
||||||
LANG=C chroot ubuntusway-$architecture /hardware
|
LANG=C chroot ubuntusway-$architecture /hardware
|
||||||
|
|
||||||
# Grab some updated firmware from the Raspberry Pi foundation
|
|
||||||
git clone -b '1.20220331' --single-branch --depth 1 https://github.com/raspberrypi/firmware raspi-firmware
|
|
||||||
cp raspi-firmware/boot/*.elf "${basedir}/bootp/"
|
|
||||||
cp raspi-firmware/boot/*.dat "${basedir}/bootp/"
|
|
||||||
cp raspi-firmware/boot/bootcode.bin "${basedir}/bootp/"
|
|
||||||
|
|
||||||
umount ubuntusway-$architecture/dev/pts
|
umount ubuntusway-$architecture/dev/pts
|
||||||
umount ubuntusway-$architecture/dev/
|
umount ubuntusway-$architecture/dev/
|
||||||
umount ubuntusway-$architecture/proc
|
umount ubuntusway-$architecture/proc
|
||||||
|
|
Loading…
Add table
Reference in a new issue