PKGBUILDs/core/kernel26-olinuxino/kernel26.install

49 lines
1.5 KiB
Text

KERNEL_NAME=-olinuxino
KERNEL_VERSION=2.6.35-7-ARCH+
flush_kernel() {
echo "Do you want the new kernel flashed onto mmcblk0p1? [y|N] "
# something traps the last line of output, so users can't see the
# question ...
read -r shouldwe
if [[ $shouldwe =~ ^([yY][eE][sS]|[yY])$ ]]; then
echo ""
echo "Specify NTSC or PAL display output [N|P]: "
read -r disp
if [[ $disp =~ ^([nN][tT][sS][cC]|[nN])$ ]]; then
echo "Writing the NTSC kernel image on /dev/mmcblk0p1 ..."
dd if=/boot/oli-${KERNEL_VERSION}-ntsc.sb of=/dev/mmcblk0p1 ibs=512 seek=4 conv=sync,notrunc
fi
if [[ $disp =~ ^([pP][aA][lL]|[pP])$ ]]; then
echo "Writing the PAL kernel image on /dev/mmcblk0p1 ..."
dd if=/boot/oli-${KERNEL_VERSION}-pal.sb of=/dev/mmcblk0p1 ibs=512 seek=4 conv=sync,notrunc
fi
fi
}
## arg 1: the new package version
post_install() {
flush_kernel
# updating module dependencies
echo ">>> Updating module dependencies. Please wait ..."
depmod ${KERNEL_VERSION}
}
## arg 1: the new package version
## arg 2: the old package version
post_upgrade() {
flush_kernel
if grep "^[^#]*[[:space:]]/boot" etc/fstab 2>&1 >/dev/null; then
if ! grep "[[:space:]]/boot" etc/mtab 2>&1 >/dev/null; then
echo "WARNING: /boot appears to be a seperate partition but is not mounted."
echo " You probably just broke your system. Congratulations."
fi
fi
# updating module dependencies
echo ">>> Updating module dependencies. Please wait ..."
depmod ${KERNEL_VERSION}
}
# vim:set ts=2 sw=2 et: