]>
Commit | Line | Data |
---|---|---|
26c1cc71 AF |
1 | #!/bin/bash |
2 | ############################################################################ | |
3 | # # | |
4 | # This file is part of the IPFire Firewall. # | |
5 | # # | |
6 | # IPFire is free software; you can redistribute it and/or modify # | |
7 | # it under the terms of the GNU General Public License as published by # | |
8 | # the Free Software Foundation; either version 2 of the License, or # | |
9 | # (at your option) any later version. # | |
10 | # # | |
11 | # IPFire is distributed in the hope that it will be useful, # | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # | |
14 | # GNU General Public License for more details. # | |
15 | # # | |
16 | # You should have received a copy of the GNU General Public License # | |
17 | # along with IPFire; if not, write to the Free Software # | |
18 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # | |
19 | # # | |
da4529ae | 20 | # Copyright (C) 2007-2014 IPFire-Team <info@ipfire.org>. # |
26c1cc71 AF |
21 | # # |
22 | ############################################################################ | |
23 | # | |
24 | . /opt/pakfire/lib/functions.sh | |
26c1cc71 | 25 | |
26c1cc71 | 26 | |
741fa41c AF |
27 | function find_partition() { |
28 | local mountpoint="${1}" | |
06f626f9 | 29 | |
741fa41c AF |
30 | local root |
31 | local dev mp fs flags rest | |
32 | while read -r dev mp fs flags rest; do | |
33 | # Skip unwanted entries | |
34 | [ "${dev}" = "rootfs" ] && continue | |
06f626f9 | 35 | |
741fa41c AF |
36 | if [ "${mp}" = "${mountpoint}" ] && [ -b "${dev}" ]; then |
37 | root="$(basename "${dev}")" | |
38 | break | |
39 | fi | |
40 | done < /proc/mounts | |
41 | echo ${root} | |
42 | return 0 | |
43 | } | |
44 | ||
45 | extract_files | |
26c1cc71 | 46 | # |
741fa41c | 47 | KVER=xxxKVERxxx |
4ac89f17 | 48 | ROOT=`find_partition /` |
26c1cc71 | 49 | # |
26c1cc71 AF |
50 | # Create new module depency |
51 | # | |
52 | depmod -a $KVER-ipfire-pae | |
44ed2a42 AF |
53 | # |
54 | # Made initramdisk | |
55 | # | |
da4529ae AF |
56 | /usr/bin/dracut --force --xz /boot/initramfs-$KVER-ipfire-pae.img $KVER-ipfire-pae |
57 | ||
88872685 AF |
58 | if [ -e /boot/grub/grub.cfg ]; then |
59 | # | |
60 | # Update grub2 config | |
61 | # | |
62 | grub-mkconfig > /boot/grub/grub.cfg | |
63 | else | |
64 | # | |
65 | # xen pv with pygrub need grub.conf / menu.lst | |
66 | # | |
67 | echo "timeout 10" > /boot/grub/grub.conf | |
68 | echo "default 0" >> /boot/grub/grub.conf | |
69 | echo "title IPFire (pae-kernel)" >> /boot/grub/grub.conf | |
70 | echo " kernel /vmlinuz-$KVER-ipfire-pae root=/dev/$ROOT rootdelay=10 panic=10 console=hvc0" \ | |
71 | >> /boot/grub/grub.conf | |
72 | echo " initrd /initramfs-$KVER-ipfire-pae.img" >> /boot/grub/grub.conf | |
73 | echo "# savedefault 0" >> /boot/grub/grub.conf | |
74 | ln -s grub.conf $MNThdd/boot/grub/menu.lst | |
75 | fi | |
8df8a869 | 76 | |
da4529ae | 77 | # request a reboot if pae is supported |
8df8a869 | 78 | if [ ! "$(grep "^flags.* pae " /proc/cpuinfo)" == "" ]; then |
8df8a869 AF |
79 | touch /var/run/need_reboot |
80 | fi | |
13008f32 | 81 | sync && sync |