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