mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-11-28 22:57:37 +00:00
51 lines
1.6 KiB
Text
51 lines
1.6 KiB
Text
KERNEL_NAME=-olinuxino
|
|
KERNEL_VERSION=2.6.35-4-OLinuXino-ARCH+
|
|
|
|
flush_kernel() {
|
|
if [ -x /usr/local/bin/elftosb -a -d /boot/imx-bootlets-olinuxino ]; then
|
|
echo "elftosb and the imx-bootlets appear to be installed."
|
|
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
|
|
pushd /boot
|
|
echo "Generating sdcard image ..."
|
|
elftosb -z -c ./imx-bootlets-olinuxino/linux.bd -o imx23-olinuxino.sb
|
|
echo "Flushing the image on /dev/mmcblk0p1 ..."
|
|
dd if=imx23-olinuxino.sb of=/dev/mmcblk0p1 ibs=512 seek=4 conv=sync,notrunc
|
|
popd
|
|
fi
|
|
else
|
|
echo "elftosb and/or the imx-bootlets are not installed."
|
|
echo "You should burn /boot/zImage onto your boot medium."
|
|
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:
|