Magellan Linux

Contents of /mage/trunk/include/mcore.minc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1848 - (show annotations) (download)
Thu Sep 29 11:49:33 2011 UTC (12 years, 7 months ago) by niro
File size: 1064 byte(s)
-added mcore include
1 # mcore specific functions
2
3 add_conf_prot()
4 {
5 local i
6
7 for i in $@
8 do
9 export CONFIG_PROTECT="${CONFIG_PROTECT} ${i}"
10 done
11 }
12
13 add_conf_prot_mask()
14 {
15 local i
16
17 for i in $@
18 do
19 export CONFIG_PROTECT_MASK="${CONFIG_PROTECT_MASK} ${i}"
20 done
21 }
22
23 add_conf_prot_ignore()
24 {
25 local i
26
27 for i in $@
28 do
29 export CONFIG_PROTECT_IGNORE="${CONFIG_PROTECT_IGNORE} ${i}"
30 done
31 }
32
33 # updates /boot/grub/grub.cfg via grub-mkconfig and installs the bootloader if neccessary
34 mcore_grub_update()
35 {
36 local grub2conf="/boot/grub/grub.cfg"
37 local bootdisk
38
39 # create a device.map
40 if [[ ! -f /boot/grub/device.map ]]
41 then
42 grub-mkdevicemap
43 fi
44
45 # needed by grub-mkconfig on the first run
46 if [[ ! -f /boot/grub/video.lst ]]
47 then
48 install -m0644 /$(mlibdir)/grub/*/video.lst /boot/grub/video.lst
49 fi
50
51 # update grub.cfg
52 LC_ALL=C grub-mkconfig -o ${grub2conf}
53
54 # install bootloader to disk
55 bootdisk="$(grub-probe --target=drive /boot | sed 's:(\(.*\),.*):(\1):')"
56
57 # Generate core.img, but don't let it be installed in boot sector
58 grub-install --no-floppy "${bootdisk}"
59 }