updated on Fri Jan 20 04:00:45 UTC 2012
[aur-mirror.git] / linux-libre / linux-libre.install
blobd75b48c8fd3e5f419b6d0d3bfa752ecf63abc10a
1 # arg 1:  the new package version
2 # arg 2:  the old package version
4 KERNEL_NAME=
5 KERNEL_VERSION=3.1.5-1-LIBRE
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-libre${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-libre${KERNEL_NAME}.img /boot/kernel26${KERNEL_NAME}.img
21       ln -sf initramfs-linux-libre${KERNEL_NAME}-fallback.img /boot/kernel26${KERNEL_NAME}-fallback.img
22       ln -sf vmlinuz-linux-libre${KERNEL_NAME} /boot/vmlinuz26${KERNEL_NAME}
23     fi
24   fi
27 post_upgrade() {
28   pacman -Q grub &>/dev/null
29   hasgrub=$?
30   pacman -Q grub2 &>/dev/null
31   hasgrub2=$?
32   pacman -Q lilo &>/dev/null
33   haslilo=$?
34   # reminder notices
35   if [ $haslilo -eq 0 ]; then
36     echo ">>>"
37     if [ $hasgrub -eq 0 -o $hasgrub2 -eq 0 ]; then
38       echo ">>> If you use the LILO bootloader, you should run 'lilo' before rebooting."
39     else
40       echo ">>> You appear to be using the LILO bootloader. You should run"
41       echo ">>> 'lilo' before rebooting."
42     fi
43     echo ">>>"
44   fi
46   if grep "^[^#]*[[:space:]]/boot" etc/fstab 2>&1 >/dev/null; then
47     if ! grep "[[:space:]]/boot" etc/mtab 2>&1 >/dev/null; then
48       echo "WARNING: /boot appears to be a seperate partition but is not mounted."
49       echo "         You probably just broke your system. Congratulations."
50     fi
51   fi
53   # updating module dependencies
54   echo ">>> Updating module dependencies. Please wait ..."
55   depmod ${KERNEL_VERSION}
56   echo ">>> Generating initial ramdisk, using mkinitcpio.  Please wait..."
57   mkinitcpio -p linux-libre${KERNEL_NAME}
60 post_remove() {
61   # also remove the compat symlinks
62   rm -f boot/{initramfs-linux-libre,kernel26}${KERNEL_NAME}.img
63   rm -f boot/{initramfs-linux-libre,kernel26}${KERNEL_NAME}-fallback.img