Last active
May 23, 2018 01:48
-
-
Save MilhouseVH/77fc59bb693d3239ac5a6b93f4156a6c to your computer and use it in GitHub Desktop.
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 | |
CONFIG=/flash/extlinux/extlinux.conf | |
if grep -qE "BOOT_IMAGE=" /proc/cmdline; then | |
echo "Unable to migrate - this installation is still using the BOOT_IMAGE= parameter" | |
elif [ -f ${CONFIG} ] && grep -qE "^ LINUX /(Image|zImage)$" ${CONFIG}; then | |
mount -o remount,rw /flash | |
[ -f /flash/Image ] && mv /flash/Image /flash/KERNEL | |
[ -f /flash/zImage ] && mv /flash/zImage /flash/KERNEL | |
sed -i 's/\(^ LINUX \/\)\(Image\|zImage\)/\1KERNEL/' ${CONFIG} | |
mount -o remount,ro /flash | |
echo "Kernel migration successful." | |
else | |
echo "Kernel migration not required." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment