PKGBUILDs/core/kernel26-olinuxino/kernel26.install

43 lines
1.3 KiB
Plaintext
Raw Normal View History

2012-07-14 19:11:41 +00:00
KERNEL_NAME=-olinuxino
KERNEL_VERSION=2.6.35-5-OLinuXino-ARCH+
2012-07-14 19:11:41 +00:00
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 "Writing the kernel image on /dev/mmcblk0p1 ..."
# this first dd is probably unnecessary
#dd if=/dev/zero of=/dev/mmcblk0p1 bs=512 count=4
dd if=/boot/oli-${KERNEL_VERSION}.sb of=/dev/mmcblk0p1 ibs=512 seek=4 conv=sync,notrunc
2012-07-14 19:11:41 +00:00
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: