Skip to content

Commit

Permalink
ci: update for changed device tree names
Browse files Browse the repository at this point in the history
starfive-tech@daba99e

Signed-off-by: MichaIng <[email protected]>
  • Loading branch information
MichaIng committed May 11, 2024
1 parent 8528bb4 commit 281af29
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
make -j$(nproc)
make install INSTALL_PATH='linux-image-visionfive2/boot'
make dtbs_install INSTALL_DTBS_PATH='linux-image-visionfive2/usr/lib/linux-image-visionfive2'
find linux-image-visionfive2/usr/lib/linux-image-visionfive2 -mindepth 1 -regextype egrep \( ! -regex '.*/(starfive|vf2-overlay.*|jh7110-visionfive-v2.*\.dtb)' -o -regex '.*/jh7110-visionfive-v2-A1[01].dtb' \) -exec rm -Rf {} +
find linux-image-visionfive2/usr/lib/linux-image-visionfive2 -mindepth 1 -regextype egrep \( ! -regex '.*/(starfive|vf2-overlay.*|jh7110-starfive-visionfive-2-.*\.dtb)' -o -regex '.*/jh7110-starfive-visionfive-2-A1[01].dtb' \) -exec rm -Rf {} +
make modules_install INSTALL_MOD_PATH='linux-image-visionfive2'
rm linux-image-visionfive2/lib/modules/*/build linux-image-visionfive2/lib/modules/*/source
# WiFi/BT firmware: https://github.com/starfive-tech/buildroot/blob/JH7110_VisionFive2_devel/package/starfive/starfive-firmware/starfive-firmware.mk
Expand All @@ -56,18 +56,19 @@ jobs:
- name: Build package
run: |
kernelversion=$(make kernelversion)
curl -fO 'https://dietpi.com/downloads/binaries/linux-image-visionfive2.deb'
cur_version=$(dpkg-deb -f linux-image-visionfive2.deb Version)
rm linux-image-visionfive2.deb
cur_suffix=${cur_version#*-dietpi}
echo "Current package version is: $cur_version"
#curl -fO 'https://dietpi.com/downloads/binaries/linux-image-visionfive2.deb'
#cur_version=$(dpkg-deb -f linux-image-visionfive2.deb Version)
#rm linux-image-visionfive2.deb
#cur_suffix=${cur_version#*-dietpi}
#echo "Current package version is: $cur_version"
echo "New kernel version is: $kernelversion"
[ "$kernelversion-dietpi$cur_suffix" = "$cur_version" ] && version="$kernelversion-dietpi$((cur_suffix+1))" || version="$kernelversion-dietpi1"
#[ "$kernelversion-dietpi$cur_suffix" = "$cur_version" ] && version="$kernelversion-dietpi$((cur_suffix+1))" || version="$kernelversion-dietpi1"
version="$kernelversion-dietpi"
echo "New package version will be: $version"
cat << _EOF_ > linux-image-visionfive2/boot/extlinux/extlinux.conf
label DietPi
linux /boot/vmlinuz-$kernelversion
fdt /usr/lib/linux-image-visionfive2/starfive/jh7110-visionfive-v2.dtb
fdt /usr/lib/linux-image-visionfive2/starfive/jh7110-starfive-visionfive-2-v1.3b.dtb
append root=/dev/mmcblk1p1 rootfstype=ext4 rootwait earlycon=sbi console=ttyS0,115200 console=tty1 consoleblank=0 net.ifnames=0
_EOF_
echo '/boot/extlinux/extlinux.conf' > linux-image-visionfive2/DEBIAN/conffiles
Expand All @@ -77,6 +78,8 @@ jobs:
export DEB_MAINT_PARAMS=\$* INITRD=Yes
[ -d '/etc/kernel/postinst.d' ] && run-parts --arg='$kernelversion' --arg='/boot/vmlinuz-$kernelversion' /etc/kernel/postinst.d
sed -Ei '/^[[:blank:]]*(linux|kernel)/c\linux /boot/vmlinuz-$kernelversion' /boot/extlinux/extlinux.conf
# Post-6.1.86-dietpi1 extlinux.conf migration, due to changed device tree names: https://github.com/starfive-tech/linux/commit/daba99e
dpkg --compare-versions "$1" gt '5.15.158-dietpi' || sed -i -e 's/jh7110-visionfive-v2/jh7110-starfive-visionfive-2/g' -e 's/jh7110-starfive-visionfive-2\.dtb/jh7110-starfive-visionfive-2-v1.3b\.dtb/g' /boot/extlinux/extlinux.conf
exit 0
_EOF_
cp linux-image-visionfive2/DEBIAN/postinst linux-image-visionfive2/DEBIAN/preinst
Expand Down

0 comments on commit 281af29

Please sign in to comment.