Skip to content
Snippets Groups Projects
Commit f155dae1 authored by ab0027's avatar ab0027 :speech_balloon:
Browse files

No need to update kernel with rpi-update

parent 78df57d3
No related branches found
No related tags found
No related merge requests found
Pipeline #12797 failed
......@@ -25,25 +25,13 @@ build-zynthbox-image-armhf:
# Update and install dependencies
- echo "# Update and install dependencies"
- apt-get update
- apt-get install -y coreutils p7zip-full qemu-user-static sudo git wget curl python3 lsof fdisk xz-utils openssh-client jq zip binutils kmod
- sudo curl -L --output /usr/bin/rpi-update https://raw.githubusercontent.com/raspberrypi/rpi-update/master/rpi-update && sudo chmod +x /usr/bin/rpi-update
- apt-get install -y coreutils p7zip-full qemu-user-static sudo git wget curl python3 lsof fdisk xz-utils openssh-client jq zip binutils
# Download raspios base image and update kernel
# Download raspios base image
- wget -c --trust-server-names 'https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2024-03-15/2024-03-15-raspios-bookworm-armhf-lite.img.xz' -O ./raspios-${debian_release_name}-armhf-lite.img.xz
- xz -dv ./raspios-${debian_release_name}-armhf-lite.img.xz
- sudo mount -o loop,offset=$(get_partition_start_offset root ./raspios-${debian_release_name}-armhf-lite.img),sizelimit=$(get_partition_size root ./raspios-${debian_release_name}-armhf-lite.img) ./raspios-${debian_release_name}-armhf-lite.img $mountdir
- sudo mount -o loop,offset=$(get_partition_start_offset boot ./raspios-${debian_release_name}-armhf-lite.img),sizelimit=$(get_partition_size boot ./raspios-${debian_release_name}-armhf-lite.img) ./raspios-${debian_release_name}-armhf-lite.img $mountdir/boot/firmware
- sudo mount --bind /dev $mountdir/dev
- sudo mount --bind /dev/pts $mountdir/dev/pts
- sudo mount --bind /proc $mountdir/proc
- sudo mount --bind /sys $mountdir/sys
- echo "# Cleaning up old and unused kernels"
- sudo chroot $mountdir apt -yy remove "linux-headers-6.6.2*" "linux-image-6.6.2*" "linux-headers-rpi-v*" "linux-image-rpi-v*" "linux-kbuild-6.6.2*"
- echo "# Installing new kernels"
- sudo SKIP_WARNING=1 SKIP_BACKUP=1 ROOT_PATH=$mountdir BOOT_PATH=$mountdir/boot/firmware rpi-update
- sudo umount $mountdir/boot/firmware $mountdir/dev/pts $mountdir/dev/ $mountdir/proc/ $mountdir/sys/
- sudo umount $mountdir
- zip ./raspios-${debian_release_name}-armhf-lite.img.zip ./raspios-${debian_release_name}-armhf-lite.img
- mv ./raspios-${debian_release_name}-armhf-lite.img.zip ./ZynthianOS/src/image
# Clone repositories required to generate zynthbox image
- echo "# Clone repositories required to generate zynthbox image"
......@@ -55,10 +43,6 @@ build-zynthbox-image-armhf:
- echo "ZYNTHIANOS_ZYNTHBOX_REPO_KEY_URL='https://repo.zynthbox.io/repo_key.pub'" >> ZynthianOS/src/modules/zynthianos/config
- echo "ZYNTHIANOS_ZYNTHBOX_REPO_SOURCELINE='deb http://repo.zynthbox.io/testing-${debian_release_name} ${debian_release_name} main'" >> ZynthianOS/src/modules/zynthianos/config
# Use custom base image from above
- echo "# Using custom base image"
- mv ./raspios-${debian_release_name}-armhf-lite.img.zip ./ZynthianOS/src/image
# Build zynthbox image
- echo "# Building zynthbox image"
- cd ./ZynthianOS/src
......@@ -66,10 +50,12 @@ build-zynthbox-image-armhf:
- bash -x ./build_dist
- mv ./workspace/*.img ./workspace/$image_name
- echo "Image Size -> $(du -h ./workspace/$image_name)"
# Compress image
- echo "# Compressing image"
- xz -zv --threads=12 --memory=100% ./workspace/$image_name
- echo "Compressed Image Size -> $(du -h ./workspace/$image_name.xz)"
# Push compressed image to pub.zynthbox.io
- echo "# Pushing compressed image to pub.zynthbox.io"
- scp -P 3138 -i "$SSH_KEY_PUB_ZYNTHBOX_IO" -o "StrictHostKeyChecking no" "./workspace/$image_name.xz" zynthbox@pub.zynthbox.io:ISOs/.ci-testing-isos/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment