Skip to content

Instantly share code, notes, and snippets.

@MilhouseVH
Last active May 23, 2018 01:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MilhouseVH/77fc59bb693d3239ac5a6b93f4156a6c to your computer and use it in GitHub Desktop.
Save MilhouseVH/77fc59bb693d3239ac5a6b93f4156a6c to your computer and use it in GitHub Desktop.
#!/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