updated on Thu Jan 26 00:18:00 UTC 2012
[aur-mirror.git] / linux-sony / linux-sony.install
blob32f58d4e3f2d0f0f546c0c89fab52f819ddbf4d7
1 # arg 1:  the new package version
2 # arg 2:  the old package version
4 KERNEL_NAME=-sony
5 KERNEL_VERSION=3.2.1-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 findmnt --fstab -uno SOURCE /boot &>/dev/null && ! mountpoint -q /boot; then
48     echo "WARNING: /boot appears to be a separate partition but is not mounted."
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