parent
298ed3a80c
commit
5eb4c5d394
|
@ -1,25 +0,0 @@
|
||||||
#!/usr/bin/python3
|
|
||||||
|
|
||||||
import sys
|
|
||||||
import argparse
|
|
||||||
import ogGlobals
|
|
||||||
from SystemLib import ogHelp
|
|
||||||
from BootLib import ogBootLoaderSetTheme
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser (add_help=False)
|
|
||||||
parser.add_argument ('disk')
|
|
||||||
parser.add_argument ('par')
|
|
||||||
parser.add_argument ('theme')
|
|
||||||
|
|
||||||
if 2 == len (sys.argv) and 'help' == sys.argv[1]:
|
|
||||||
#parser.print_help() sale en inglés aunque la locale indique otra cosa
|
|
||||||
ogHelp ('ogBootLoaderSetTheme', ogGlobals.lang.MSG_SEE+' ogGrubSetTheme', [])
|
|
||||||
sys.exit (0)
|
|
||||||
|
|
||||||
args = parser.parse_args()
|
|
||||||
ret = ogBootLoaderSetTheme (args.disk, args.par, args.theme)
|
|
||||||
|
|
||||||
if ret is not None:
|
|
||||||
if ret == True: sys.exit (0)
|
|
||||||
elif ret == False: sys.exit (1)
|
|
||||||
else: print (ret)
|
|
|
@ -1,24 +0,0 @@
|
||||||
#!/usr/bin/python3
|
|
||||||
|
|
||||||
import sys
|
|
||||||
import argparse
|
|
||||||
from SystemLib import ogHelp
|
|
||||||
from BootLib import ogGrubSetTheme
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser (add_help=False)
|
|
||||||
parser.add_argument ('disk')
|
|
||||||
parser.add_argument ('par')
|
|
||||||
parser.add_argument ('theme')
|
|
||||||
|
|
||||||
if 2 == len (sys.argv) and 'help' == sys.argv[1]:
|
|
||||||
#parser.print_help() sale en inglés aunque la locale indique otra cosa
|
|
||||||
ogHelp ('ogGrubSetTheme', 'ogGrubSetTheme int_ndiskSecondStage int_partitionSecondStage str_themeName', ['ogGrubSetTheme 1 4 ThemeBasic'])
|
|
||||||
sys.exit (0)
|
|
||||||
|
|
||||||
args = parser.parse_args()
|
|
||||||
ret = ogGrubSetTheme (args.disk, args.par, args.theme)
|
|
||||||
|
|
||||||
if ret is not None:
|
|
||||||
if ret == True: sys.exit (0)
|
|
||||||
elif ret == False: sys.exit (1)
|
|
||||||
else: print (ret)
|
|
|
@ -1061,8 +1061,6 @@ def ogBootLoaderOgliveDefaultEntry (disk, par):
|
||||||
#@brief ver ogBootLoaderSetTheme
|
#@brief ver ogBootLoaderSetTheme
|
||||||
#@see ogBootLoaderSetTheme
|
#@see ogBootLoaderSetTheme
|
||||||
#*/ ##
|
#*/ ##
|
||||||
def ogGrubSetTheme (disk, par, theme):
|
|
||||||
return ogBootLoaderSetTheme (disk, par, theme)
|
|
||||||
|
|
||||||
|
|
||||||
#/**
|
#/**
|
||||||
|
@ -1079,23 +1077,6 @@ def ogGrubSetTheme (disk, par, theme):
|
||||||
#@exception OG_ERR_NOTFOUND Fichero de configuración del tema no encontrado: theme.conf (sólo refind).
|
#@exception OG_ERR_NOTFOUND Fichero de configuración del tema no encontrado: theme.conf (sólo refind).
|
||||||
#@note El tema debe situarse en OGLIB/BOOTLOADER/themes
|
#@note El tema debe situarse en OGLIB/BOOTLOADER/themes
|
||||||
#*/ ##
|
#*/ ##
|
||||||
def ogBootLoaderSetTheme (disk, par, theme):
|
|
||||||
# Nombre de la función que llama a esta.
|
|
||||||
func = inspect.stack()[1][3]
|
|
||||||
|
|
||||||
# Error si no puede montar sistema de archivos.
|
|
||||||
PART = FileSystemLib.ogMount (disk, par)
|
|
||||||
if not PART: return None
|
|
||||||
# La función debe ser llamanda desde ogGrubSetTheme, ogBurgSetTheme or ogRefindSetTheme.
|
|
||||||
if 'ogGrubSetTheme' == func:
|
|
||||||
bootloader = 'grub'
|
|
||||||
bootloaderdir = 'boot/grubMBR'
|
|
||||||
cfgfile = f'{PART}/boot/grubMBR/boot/grub/grub.cfg'
|
|
||||||
SystemLib.ogRaiseError ([], ogGlobals.OG_ERR_FORMAT, 'ogGrubSetTheme not sopported')
|
|
||||||
return None
|
|
||||||
else:
|
|
||||||
SystemLib.ogRaiseError ([], ogGlobals.OG_ERR_FORMAT, f'Use ogGrubOgliveDefaultEntry')
|
|
||||||
return None
|
|
||||||
|
|
||||||
#/**
|
#/**
|
||||||
# ogGrubSetAdminKeys num_disk num_part str_theme
|
# ogGrubSetAdminKeys num_disk num_part str_theme
|
||||||
|
|
Loading…
Reference in New Issue