20 |
done |
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.conf with given params |
# updates /boot/grub/grub.conf with given params |
34 |
# example: alx_grub_update kernel-image-name description |
# example: alx_grub_update kernel-image-name description |
35 |
alx_grub_update() |
alx_grub_update() |
39 |
local i |
local i |
40 |
local rootfs |
local rootfs |
41 |
local grubroot |
local grubroot |
42 |
|
local grubopts |
43 |
local OLD_IFS |
local OLD_IFS |
44 |
local grubconf="/boot/grub/grub.conf" |
local grubconf="/boot/grub/grub.conf" |
45 |
|
|
78 |
done |
done |
79 |
IFS="${OLD_IFS}" |
IFS="${OLD_IFS}" |
80 |
|
|
81 |
|
# check for special hardware |
82 |
|
if [[ -x $(which hwinfo) ]] |
83 |
|
then |
84 |
|
# zotac devices |
85 |
|
if [[ ! -z $(hwinfo --bios | grep -i zotac) ]] |
86 |
|
then |
87 |
|
grubopts="rootdelay=8" |
88 |
|
echo "Special device 'ZOTAC' detected!" |
89 |
|
fi |
90 |
|
fi |
91 |
|
|
92 |
# fix description |
# fix description |
93 |
: > ${grubconf} |
: > ${grubconf} |
94 |
echo "default 0" >> ${grubconf} |
echo "default 0" >> ${grubconf} |
96 |
# using roots current password |
# using roots current password |
97 |
echo "password --md5 $(cat /etc/shadow | grep root | cut -d: -f2)" >> ${grubconf} |
echo "password --md5 $(cat /etc/shadow | grep root | cut -d: -f2)" >> ${grubconf} |
98 |
echo >> ${grubconf} |
echo >> ${grubconf} |
99 |
acho "# normal boot" >> ${grubconf} |
echo "# normal boot" >> ${grubconf} |
100 |
echo "title ${KERNEL_DESCRIPTION}" >> ${grubconf} |
echo "title ${KERNEL_DESCRIPTION}" >> ${grubconf} |
101 |
echo "root ${grubroot}" >> ${grubconf} |
echo "root ${grubroot}" >> ${grubconf} |
102 |
echo "kernel ${grubroot}/boot/${KERNEL_IMAGE} ${rootfs} quiet" >> ${grubconf} |
echo "kernel ${grubroot}/boot/${KERNEL_IMAGE} ${rootfs} quiet ${grubopts}" >> ${grubconf} |
103 |
echo >> ${grubconf} |
echo >> ${grubconf} |
104 |
echo "# admin boots" >> ${grubconf} |
echo "# admin boots" >> ${grubconf} |
105 |
echo "title ${KERNEL_DESCRIPTION} - Re-run hardware-detection" >> ${grubconf} |
echo "title ${KERNEL_DESCRIPTION} - Re-run hardware-detection" >> ${grubconf} |
106 |
echo "lock" >> ${grubconf} |
echo "lock" >> ${grubconf} |
107 |
echo "root ${grubroot}" >> ${grubconf} |
echo "root ${grubroot}" >> ${grubconf} |
108 |
echo "kernel ${grubroot}/boot/${KERNEL_IMAGE} ${rootfs} quiet hardware-auto-detection" >> ${grubconf} |
echo "kernel ${grubroot}/boot/${KERNEL_IMAGE} ${rootfs} quiet ${grubopts} hardware-auto-detection" >> ${grubconf} |
109 |
echo >> ${grubconf} |
echo >> ${grubconf} |
110 |
echo "title ${KERNEL_DESCRIPTION} - Reset *all* local settings" >> ${grubconf} |
echo "title ${KERNEL_DESCRIPTION} - Reset *all* local settings" >> ${grubconf} |
111 |
echo "lock" >> ${grubconf} |
echo "lock" >> ${grubconf} |
112 |
echo "root ${grubroot}" >> ${grubconf} |
echo "root ${grubroot}" >> ${grubconf} |
113 |
echo "kernel ${grubroot}/boot/${KERNEL_IMAGE} ${rootfs} quiet alx-reset-settings" >> ${grubconf} |
echo "kernel ${grubroot}/boot/${KERNEL_IMAGE} ${rootfs} quiet ${grubopts} alx-reset-settings" >> ${grubconf} |
114 |
} |
} |
115 |
|
|
116 |
## compat |
## compat |