refs #1630 fix bugs in ogGrubHidePartitions
parent
7e255b6c52
commit
41aa2c3a5f
|
@ -848,7 +848,7 @@ def ogBootLoaderHidePartitions (disk, par, datadisk=None, datapar=None):
|
|||
#2:/dev/sda3
|
||||
awk_out = subprocess.run (f'''
|
||||
awk '/menuentry.*Windows/ {{gsub(/\\)"/, ""); gsub(/^.*dev/,""); print NR":/dev"$1}} ' {cfgfile}
|
||||
''', shell=True, text=True).stdout
|
||||
''', shell=True, text=True, capture_output=True).stdout
|
||||
if awk_out:
|
||||
winentry = awk_out.splitlines()
|
||||
winentry.reverse()
|
||||
|
@ -867,17 +867,17 @@ def ogBootLoaderHidePartitions (disk, par, datadisk=None, datapar=None):
|
|||
for entry in winentry:
|
||||
line, part = entry.split (':')
|
||||
# En cada entrada, oculto o muestro cada particion.
|
||||
TEXT = ''
|
||||
text = ''
|
||||
for parthidden in winpart:
|
||||
# Muestro la particion de la entrada actual y la de datos.
|
||||
if parthidden == part or parthidden == partdata:
|
||||
HIDDEN = '-'
|
||||
hidden = '-'
|
||||
else:
|
||||
HIDDEN = '+'
|
||||
hidden = '+'
|
||||
numdisk, numpart = DiskLib.ogDevToDisk (parthidden).split()
|
||||
numdisk = int (numdisk)
|
||||
numpart = int (numpart)
|
||||
TEXT = f'\tparttool (hd{numdisk-1},{parttabletype}{numpart}) hidden{hidden} \n{text}'
|
||||
text = f'\tparttool (hd{numdisk-1},{parttabletype}{numpart}) hidden{hidden} \n{text}'
|
||||
subprocess.run (['sed', '-i', f'{line}a\\ {text}', cfgfile])
|
||||
# Activamos la particion que se inicia en todas las entradas de windows.
|
||||
subprocess.run (['sed', '-i', '/chainloader/i\\\tparttool ${root} boot+', cfgfile])
|
||||
|
|
Loading…
Reference in New Issue