updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / linux-pax / linux-pax.install
blobeaf1fad21ea66165a61c0ccb10b8e500993758ea
1 # arg 1:  the new package version
2 # arg 2:  the old package version
4 KERNEL_NAME=-pax
5 KERNEL_VERSION=3.2-pax
7 _fix_permissions () {
8         /usr/bin/linux-pax-flags
10         echo You can repeat this process after updating or installing affected
11         echo binaries by running "linux-pax-flags".
14 post_install () {
15   # updating module dependencies
16   echo ">>> Updating module dependencies. Please wait ..."
17   depmod ${KERNEL_VERSION}
18   echo ">>> Generating initial ramdisk, using mkinitcpio.  Please wait..."
19   mkinitcpio -p linux${KERNEL_NAME}
21   # compat symlinks for the official kernels only
22   if [ -z "${KERNEL_NAME}" -o "${KERNEL_NAME}" = "-lts" ]; then
23     loaders="$(find /boot -name syslinux.cfg -or -name extlinux.conf -or -name grub.cfg -or -name menu.lst)"
24     [ -f /etc/lilo.conf ] && loaders="$loaders /etc/lilo.conf"
25     if [ -n "${loaders}" ] && grep -q -e vmlinuz26 -e kernel26.img -e kernel26-fallback.img $loaders; then
26       # add compat symlinks for the initramfs images
27       ln -sf initramfs-linux${KERNEL_NAME}.img boot/kernel26${KERNEL_NAME}.img
28       ln -sf initramfs-linux${KERNEL_NAME}-fallback.img \
29         boot/kernel26${KERNEL_NAME}-fallback.img
30       ln -sf vmlinuz-linux${KERNEL_NAME} /boot/vmlinuz26${KERNEL_NAME}
31     fi
32   fi
34   _fix_permissions
37 post_upgrade() {
38   pacman -Q grub &>/dev/null
39   hasgrub=$?
40   pacman -Q grub2 &>/dev/null
41   hasgrub2=$?
42   pacman -Q lilo &>/dev/null
43   haslilo=$?
44   # reminder notices
45   if [ $haslilo -eq 0 ]; then
46     echo ">>>"
47     if [ $hasgrub -eq 0 -o $hasgrub2 -eq 0 ]; then
48       echo ">>> If you use the LILO bootloader, you should run 'lilo' before rebooting."
49     else
50       echo ">>> You appear to be using the LILO bootloader. You should run"
51       echo ">>> 'lilo' before rebooting."
52     fi
53     echo ">>>"
54   fi
56   if grep "^[^#]*[[:space:]]/boot" etc/fstab 2>&1 >/dev/null; then
57     if ! grep "[[:space:]]/boot" etc/mtab 2>&1 >/dev/null; then
58       echo "WARNING: /boot appears to be a seperate partition but is not mounted"
59       echo "         This is most likely not what you want.  Please mount your /boot"
60       echo "         partition and reinstall the kernel unless you are sure this is OK"
61     fi
62   fi
64   # updating module dependencies
65   echo ">>> Updating module dependencies. Please wait ..."
66   depmod ${KERNEL_VERSION}
67   echo ">>> Generating initial ramdisk, using mkinitcpio.  Please wait..."
68   mkinitcpio -p linux${KERNEL_NAME}
70   _fix_permissions
73 post_remove() {
74   # also remove the compat symlinks
75   rm -f boot/{initramfs-linux,kernel26}${KERNEL_NAME}.img
76   rm -f boot/{initramfs-linux,kernel26}${KERNEL_NAME}-fallback.img