updated on Sun Jan 22 04:03:10 UTC 2012
[aur-mirror.git] / linux-ck / linux-ck.install
blob289758fde4db076747eb536eee96b9cbc1c9768a
1 KERNEL_NAME=-ck
2 KERNEL_VERSION=3.2.1-3-ck
4 post_install () {
5         # updating module dependencies
6         echo ">>> Updating module dependencies. Please wait ..."
7         depmod ${KERNEL_VERSION}
8         echo ">>> Generating initial ramdisk, using mkinitcpio.  Please wait..."
9         mkinitcpio -p linux${KERNEL_NAME}
11         # compat symlinks for the official kernels only
12         if [ -z "${KERNEL_NAME}" -o "${KERNEL_NAME}" = "-lts" ]; then
13                 loaders="$(find /boot -name syslinux.cfg -or -name extlinux.conf -or -name grub.cfg -or -name menu.lst)"
14                 [ -f /etc/lilo.conf ] && loaders="$loaders /etc/lilo.conf"
15                 if [ -n "${loaders}" ] && grep -q -e vmlinuz26 -e kernel26.img -e kernel26-fallback.img $loaders; then
16                         # add compat symlinks for the initramfs images
17                         ln -sf initramfs-linux${KERNEL_NAME}.img boot/kernel26${KERNEL_NAME}.img
18                         ln -sf initramfs-linux${KERNEL_NAME}-fallback.img \
19                                 boot/kernel26${KERNEL_NAME}-fallback.img
20                         ln -sf vmlinuz-linux${KERNEL_NAME} /boot/vmlinuz26${KERNEL_NAME}
21                 fi
22         fi
25 post_upgrade() {
26         pacman -Q grub &>/dev/null
27         hasgrub=$?
28         pacman -Q grub2 &>/dev/null
29         hasgrub2=$?
30         pacman -Q lilo &>/dev/null
31         haslilo=$?
32         # reminder notices
33         if [ $haslilo -eq 0 ]; then
34                 echo ">>>"
35                 if [ $hasgrub -eq 0 -o $hasgrub2 -eq 0 ]; then
36                         echo ">>> If you use the LILO bootloader, you should run 'lilo' before rebooting."
37                 else
38                         echo ">>> You appear to be using the LILO bootloader. You should run"
39                         echo ">>> 'lilo' before rebooting."
40                 fi
41                 echo ">>>"
42         fi
44         if grep "^[^#]*[[:space:]]/boot" etc/fstab 2>&1 >/dev/null; then
45                 if ! grep "[[:space:]]/boot" etc/mtab 2>&1 >/dev/null; then
46                         echo "WARNING: /boot appears to be a seperate partition but is not mounted."
47                         echo " You probably just broke your system. Congratulations."   
48                 fi
49         fi
51         # updating module dependencies
52         echo ">>> Updating module dependencies. Please wait ..."
53         depmod ${KERNEL_VERSION}
54         echo ">>> Generating initial ramdisk, using mkinitcpio.  Please wait..."
55         mkinitcpio -p linux${KERNEL_NAME}
58 post_remove() {
59         # also remove the compat symlinks
60         rm -f boot/{initramfs-linux,kernel26}${KERNEL_NAME}.img
61         rm -f boot/{initramfs-linux,kernel26}${KERNEL_NAME}-fallback.img