updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / kernel26rsbac-daz / kernel26rsbac-daz.install
blobc4a39ff4e09c7caddc33e750a11782820e538989
1 LOCAL_VERSION=rsbac-daz
2 KERNEL_VERSION=2.6.30-rsbac-daz
3 RSBAC_VERSION=1.4.2
4 ADMIN_VERSION=$(pacman -Q rsbac-admin 2> /dev/null | sed 's/.*[ ]\(.*\)-.*/\1/')
6 check_admin() {
7   echo -n ":: Checking rsbac-admin... "
8   if [ -z "$ADMIN_VERSION" ]; then
9     echo "not installed"
10     echo "==> You should install rsbac-admin ($RSBAC_VERSION)"
11   elif [ "$ADMIN_VERSION" != "$RSBAC_VERSION" ]; then
12     echo "$ADMIN_VERSION"
13     echo "==> You need to upgrade to rsbac-admin ($RSBAC_VERSION)"
14   else
15     echo "ok"
16     echo -e "\n  ------------------------------------------------------------"
17     echo    "  IMPORTANT:"
18     echo    "   Read the following steps carefully and follow them exactly."
19     echo    "   A reboot is involved, so write down the steps if necessary."
20     echo    "  ------------------------------------------------------------"
21     echo -e "\n  CONFIGURATION:"
22     echo    "   1. Add this paramater to the RSBAC kernel's GRUB/LILO entry:"
23     echo    "       rsbac_softmode"
24     echo    "   2. Reboot to the Softmode RSBAC kernel."
25     echo    "   3. Login as the secoff user."
26     echo    "   4. Run the configuration script:"
27     echo -n "       $ ./config "
28     [ "$RSBAC_VERSION" == "kernel26rsbac-daz" ] && echo "daz" || echo "rsbac"
29     echo    "   5. Remove the 'rsbac_softmode' kernel parameter."
30     echo -ne "\n  You should now have "
31     [ "$RSBAC_VERSION" == "kernel26rsbac-daz" ] && \
32       echo -n "a Dazuko interface " || echo -n "an RSBAC framework "
33     echo "upon rebooting."
34   fi
37 post_install() {
38   # Update module dependencies
39   echo ">>> Updating module dependencies.  Please wait..."
40   depmod -v $KERNEL_VERSION &> /dev/null
42   # Generate init ramdisks
43   echo ">>> MKINITCPIO SETUP"
44   echo ">>> ----------------"
45   echo ">>> If you use LVM2, encrypted root, or software RAID,"
46   echo ">>> ensure you enable support in the /etc/mkinitcpio.conf file."
47   echo ">>> More information about mkinitcpio setup can be found here:"
48   echo ">>> http://wiki.archlinux.org/index.php/Mkinitcpio"
49   echo ""
50   echo ">>> Generating initial ramdisk, using mkinitcpio.  Please wait..."
51   /sbin/mkinitcpio -p kernel26$LOCAL_VERSION
53   # Check admin version
54   check_admin
57 post_upgrade() {
58   pacman -Q grub &> /dev/null
59   hasgrub=$?
60   pacman -Q lilo &> /dev/null
61   haslilo=$?
63   # Reminder notices
64   if [ $haslilo -eq 0 ]; then
65     echo ">>>"
66     if [ $hasgrub -eq 0 ]; then
67       echo ">>> If you use the LILO bootloader, you should run 'lilo' before rebooting."
68     else
69       echo ">>> You appear to be using the LILO bootloader.  You should run"
70       echo ">>> 'lilo' before rebooting."
71     fi
72     echo ">>>"
73   fi
74   if grep "/boot" /etc/fstab 2>&1 >/dev/null; then
75     if ! grep "/boot" /etc/mtab 2>&1 >/dev/null; then
76       echo "WARNING: /boot appears to be a separate partition but is not mounted."
77       echo "         This is most likely not what you want.  Please mount your /boot"
78       echo "         partition and reinstall the kernel, unless you are sure this is OK."
79     fi
80   fi
82   # Important upgrade notice
83   if [ "`vercmp $2 2.6.13`" -lt 0 ]; then
84     echo ">>>"
85     echo ">>> IMPORTANT KERNEL UPGRADE NOTICE"
86     echo ">>> -------------------------------"
87     echo ">>> As of kernel 2.6.13, DevFS is NO LONGER AVAILABLE!"
88     echo ">>> If you still use DevFS, please make the transition to uDev before"
89     echo ">>> rebooting.  If you really need to stay with DevFS for some reason,"
90     echo ">>> then you can manually downgrade to an older version:"
91     echo ">>>"
92     echo ">>> # pacman -U http://archlinux.org/~judd/kernel/kernel26-scsi-2.6.12.2-1.pkg.tar.gz"
93     echo ">>>"
94     echo ">>> If you choose to downgrade, don't forget to add kernel26-scsi to your"
95     echo ">>> IgnorePkg list in the /etc/pacman.conf file."
96     echo ">>>"
97     echo ">>> (NOTE: The following portion applies to uDev users as well!)"
98     echo ">>>"
99     echo ">>> If you use any DevFS paths in your GRUB menu.lst, then you will not"
100     echo ">>> be able to boot!  Change your root= parameter to use the classic"
101     echo ">>> naming scheme."
102     echo ">>>"
103     echo ">>> EXAMPLES:"
104     echo ">>> - change root=/dev/discs/disc0/part3 to root=/dev/sda3"
105     echo ">>> - change root=/dev/md/0 to root=/dev/md0"
106     echo ">>>"
107   fi
108   if [ "`vercmp $2 2.6.18`" -lt 0 ]; then
109     echo ">>> --------------------------------------------------------------"
110     echo ">>> |                          WARNING:                          |"
111     echo ">>> |mkinitrd is not supported anymore in kernel >=2.6.18 series!|"
112     echo ">>> |              Please change to mkinitcpio setup.            |"
113     echo ">>> --------------------------------------------------------------"
114     echo ">>>"
115   fi
117   # Update module dependencies
118   echo ">>> Updating module dependencies.  Please wait ..."
119   depmod -v $KERNEL_VERSION &> /dev/null
121   # Generate init ramdisks
122   echo ">>> MKINITCPIO SETUP"
123   echo ">>> ----------------"
124   if [ "`vercmp $2 2.6.18`" -lt 0 ]; then
125     echo ">>> Please change your bootloader config files:"
126     echo ">>> Grub: /boot/grub/menu.lst | Lilo: /etc/lilo.conf"
127     echo "---------------------------------------------------------"
128     echo "| - initrd26.img to kernel26$LOCAL_VERSION.img               |"
129     echo "| - initrd26-full.img to kernel26$LOCAL_VERSION-fallback.img |"
130     echo "---------------------------------------------------------"
131   fi
132   if [ "`vercmp $2 2.6.19`" -lt 0 ]; then
133     echo ""
134     echo ">>> New PATA/IDE subsystem - EXPERIMENTAL"
135     echo ">>> ----------"
136     echo ">>> To use the new pata drivers, change the 'ide' hook "
137     echo ">>> to 'pata' in the /etc/mkinitcpio.conf HOOKS= line."
138     echo ">>> The new system changes: /dev/hd? to /dev/sd?"
139     echo ">>> Don't forget to modify GRUB, LILO, and /etc/fstab to the"
140     echo ">>> new naming system."
141     echo ">>> eg: hda3 --> sda3, hdc8 --> sdc8"
142     echo ""
143     echo ">>> piix/ata_piix (Intel chipsets) - IMPORTANT"
144     echo "----------"
145     echo ">>> If you have enabled ide/pata/sata HOOKs in /etc/mkinitcpio.conf,"
146     echo ">>> the 'ata_piix' module will be used."
147     echo ">>> This may cause your devices to shift names, eg:"
148     echo ">>> - IDE: devices from hd? to sd?"
149     echo ">>> - SATA: sda might shift to sdc if you have 2 other disks on a PIIX IDE port."
150     echo ">>> To check if this will affect you, check 'mkinitcpio -M' for piix/ata_piix."
151     echo ""
152   fi
153   echo ">>> If you use LVM2, encrypted root, or software RAID,"
154   echo ">>> ensure you enable support in the /etc/mkinitcpio.conf file."
155   echo ">>> More information about mkinitcpio setup can be found here:"
156   echo ">>> http://wiki.archlinux.org/index.php/Mkinitcpio"
157   echo ""
158   echo ">>> Generating initial ramdisk, using mkinitcpio.  Please wait..."
159   if [ "`vercmp $2 2.6.19`" -lt 0 ]; then
160     /sbin/mkinitcpio -p kernel26$LOCAL_VERSION -m "ATTENTION:
161       If you get a kernel panic below and are using an Intel chipset,
162       append 'earlymodules=piix' to the kernel commandline."
163   else
164     /sbin/mkinitcpio -p kernel26$LOCAL_VERSION
165   fi
167   # ACPI info 
168   if [ "`vercmp $2 2.6.21`" -lt 0 ]; then
169     echo ""
170     echo "Important ACPI Information:"
171     echo ">>> Since 2.6.20.7 all possible ACPI parts are modularized."
172     echo ">>> The modules are located at:"
173     echo ">>> /lib/modules/$(uname -r)/kernel/drivers/acpi"
174     echo ">>> For more information about ACPI modules check this wiki page:"
175     echo ">>> http://wiki.archlinux.org/index.php/ACPI_modules"
176   fi
178   # Check admin version
179   check_admin