diff options
author | James Meyer <james.meyer@operamail.com> | 2012-08-26 16:52:53 (GMT) |
---|---|---|
committer | James Meyer <james.meyer@operamail.com> | 2012-08-26 16:52:53 (GMT) |
commit | 3f3fd1a851677fd9400bf4e5484ee000487c6834 (patch) | |
tree | 07c10dd9724bd87d623bdff03dc9de8f98b566ec | |
parent | 218a2dc67a18563c3afa7f003f1a1980784241c0 (diff) | |
download | linhes_pkgbuild-3f3fd1a851677fd9400bf4e5484ee000487c6834.zip linhes_pkgbuild-3f3fd1a851677fd9400bf4e5484ee000487c6834.tar.gz linhes_pkgbuild-3f3fd1a851677fd9400bf4e5484ee000487c6834.tar.bz2 |
LinHES-config: mv_install. fix grub2 defaults file on install. set timeout to 0 and hidden for 5
-rwxr-xr-x | abs/core/LinHES-config/mv_install.py | 46 |
1 files changed, 40 insertions, 6 deletions
diff --git a/abs/core/LinHES-config/mv_install.py b/abs/core/LinHES-config/mv_install.py index 260a275..af7d8a6 100755 --- a/abs/core/LinHES-config/mv_install.py +++ b/abs/core/LinHES-config/mv_install.py @@ -857,21 +857,55 @@ def fstab_it(install_type): def grub_it(): logging.info("______Start of grub install______") cmd = "chroot %s grub-install --target=i386-pc --recheck --debug /dev/%s" %(data_config.MOUNTPOINT,hostoptions["rootdisk"]) - logging.info("Running grub-install") + logging.info(" Running grub-install") runcmd(cmd) cmd = " mkinitcpio -g %s/boot/initramfs-linux.img" %(data_config.MOUNTPOINT) logging.info("Running mkinitcpio") runcmd(cmd) + newgrub = [] + grubfile = data_config.MOUNTPOINT+"/etc/default/grub" + try: + f = open(grubfile, 'r') + oldgrub = f.readlines() + + f.close() + except: + logging.debug(" Couldn't open grub file for reading") + pass + + time_line = "GRUB_TIMEOUT=" + hidden_time = "GRUB_HIDDEN_TIMEOUT=" + color_line = "GRUB_COLOR" + + for line in oldgrub: + new_line=line + if line.find(time_line) != -1 : + new_line="GRUB_TIMEOUT=0\n" + + if line.find(color_line) != -1 : + new_line=line.lstrip('''#''') + + if line.find(hidden_time) != -1 : + new_line="GRUB_HIDDEN_TIMEOUT=5\n" + + newgrub.append(new_line) + + if len(newgrub) > 0: + try: + f = open(grubfile, 'w') + for line in newgrub: + logging.debug(line) + f.write(line) + f.close() + except: + logging.debug(" Couldn't open grub file for writing") + cmd="chroot %s grub-mkconfig -o /boot/grub/grub.cfg" %data_config.MOUNTPOINT runcmd(cmd) - #rootuuid = find_uuid(hostoptions["rootpartition"]) - #cmd = " mkinitcpio -b %s -g %s/boot/kernel26.img" %(data_config.MOUNTPOINT, data_config.MOUNTPOINT) - #cmd = " mkinitcpio -g %s/boot/initramfs-linux.img" %(data_config.MOUNTPOINT) - #logging.info("Running mkinitcpio") - #runcmd(cmd) + def grub_it1(): logging.info("______Start of grub install______") |