Magellan Linux

Diff of /mage/branches/alx-0_6_0/include/alx.minc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2067 by niro, Wed May 11 21:16:12 2011 UTC revision 2518 by niro, Thu Jun 30 15:25:12 2011 UTC
# Line 20  add_conf_prot_mask() Line 20  add_conf_prot_mask()
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()
# Line 29  alx_grub_update() Line 39  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     local pass
46    
47   KERNEL_IMAGE="$1"   KERNEL_IMAGE="$1"
48   KERNEL_DESCRIPTION="$2"   KERNEL_DESCRIPTION="$2"
# Line 67  alx_grub_update() Line 79  alx_grub_update()
79   done   done
80   IFS="${OLD_IFS}"   IFS="${OLD_IFS}"
81    
82     # check for special hardware
83     if [[ -x $(which hwinfo) ]]
84     then
85     # zotac devices
86     if [[ ! -z $(hwinfo --bios --storage | grep -i zotac) ]]
87     then
88     grubopts="rootdelay=8"
89     echo "Special device 'ZOTAC' detected!"
90     fi
91     fi
92    
93   # fix description   # fix description
94   : > ${grubconf}   : > ${grubconf}
95   echo "default 0" >> ${grubconf}   echo "default 0" >> ${grubconf}
96   echo "timeout 3" >> ${grubconf}   echo "timeout 3" >> ${grubconf}
97   # using roots current password   # using roots current password if one was set
98   echo "password --md5 $(cat /etc/shadow | grep root | cut -d: -f2)"  >> ${grubconf}   pass="$(grep '^root:' /etc/shadow | cut -d: -f2)"
99     # or fallback to a default password
100     [[ -z ${pass} ]] && pass="$1$oc/rCMuc$ZodLQSj6N5zYIJtOBg.RT/"
101     echo "password --md5 ${pass}"  >> ${grubconf}
102   echo  >> ${grubconf}   echo  >> ${grubconf}
103   acho "# normal boot" >> ${grubconf}   echo "# normal boot" >> ${grubconf}
104   echo "title ${KERNEL_DESCRIPTION}" >> ${grubconf}   echo "title ${KERNEL_DESCRIPTION}" >> ${grubconf}
105   echo "root ${grubroot}" >> ${grubconf}   echo "root ${grubroot}" >> ${grubconf}
106   echo "kernel ${grubroot}/boot/${KERNEL_IMAGE} ${rootfs} quiet" >> ${grubconf}   echo "kernel ${grubroot}/boot/${KERNEL_IMAGE} ${rootfs} quiet ${grubopts}" >> ${grubconf}
107   echo >> ${grubconf}   echo >> ${grubconf}
108   echo "# admin boots" >> ${grubconf}   echo "# admin boots" >> ${grubconf}
109   echo "title ${KERNEL_DESCRIPTION} - Re-run hardware-detection" >> ${grubconf}   echo "title ${KERNEL_DESCRIPTION} - Re-run hardware-detection" >> ${grubconf}
110   echo "lock"  >> ${grubconf}   echo "lock"  >> ${grubconf}
111   echo "root ${grubroot}" >> ${grubconf}   echo "root ${grubroot}" >> ${grubconf}
112   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}
113   echo >> ${grubconf}   echo >> ${grubconf}
114   echo "title ${KERNEL_DESCRIPTION} - Reset *all* local settings" >> ${grubconf}   echo "title ${KERNEL_DESCRIPTION} - Reset *all* local settings" >> ${grubconf}
115   echo "lock"  >> ${grubconf}   echo "lock"  >> ${grubconf}
116   echo "root ${grubroot}" >> ${grubconf}   echo "root ${grubroot}" >> ${grubconf}
117   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}
118  }  }
119    
120  ## compat  ## compat

Legend:
Removed from v.2067  
changed lines
  Added in v.2518