Last active
August 25, 2017 08:25
-
-
Save Obihoernchen/28c02a8eeb37f816b4f3e9ea6f150f42 to your computer and use it in GitHub Desktop.
Use new official 4.9 kernel build
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DLPATH=ftp://vserver.obihoernchen.net/ODROID-XU4-KERNEL/LATEST-4.9 | |
if [[ "$1" =~ ^(ftp|https?):// ]]; then | |
DLPATH="$1" | |
fi | |
rm -r /boot/* | |
# for safety | |
rm -r /tmp/kernel-update | |
echo "Download kernel" | |
mkdir /tmp/kernel-update | |
cd /tmp/kernel-update | |
wget $DLPATH -O kernel.tar.xz | |
echo | |
echo "Extract kernel" | |
tar -xf kernel.tar.xz | |
KERNEL_VERSION=$(ls config-* | sed -e 's/^config-//') | |
echo | |
echo "Kernel Version: $KERNEL_VERSION" | |
echo | |
echo "Copy firmware and modules" | |
cp -R lib/* /lib | |
echo | |
echo "Create intramfs and uInitrd" | |
cp config-$KERNEL_VERSION /boot | |
update-initramfs -c -k $KERNEL_VERSION | |
mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n "uInitrd-$KERNEL_VERSION" -d /boot/initrd.img-$KERNEL_VERSION /boot/uInitrd-$KERNEL_VERSION | |
echo | |
echo "Install kernel" | |
mount /dev/mmcblk0p1 /media/boot | |
mount /dev/mmcblk1p1 /media/boot | |
cp zImage /media/boot | |
DTB=$(ls *.dtb) | |
cp $DTB /media/boot | |
sed -i -r "s/\S+\.dtb;/${DTB};/" /media/boot/boot.ini | |
echo "Using dtb: $DTB" | |
cp /boot/uInitrd-$KERNEL_VERSION /media/boot/uInitrd | |
sync | |
sleep 3 | |
umount /media/boot | |
rm -r /tmp/kernel-update | |
echo | |
echo "Kernel updated successfully" | |
echo "Reboot to use new kernel" |
Hi,
yes unfortunately OMV3/armbian changed the boot layout so this script is not compatible with OMV3 right now.
Will you update the script for OMV3 in the near future? Just askin.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Second try:
I've created /media/boot and run update script:
So this time only these 2 commands failed:
Any help appreciated.