refs #596 move more debconf settings to the config
parent
305e6209bf
commit
4ac6b8cdd4
|
@ -9,7 +9,7 @@ import configparser
|
||||||
|
|
||||||
from boottoolsfunctions import _run
|
from boottoolsfunctions import _run
|
||||||
|
|
||||||
config = configparser.ConfigParser (inline_comment_prefixes='#')
|
config = configparser.ConfigParser (comment_prefixes='#', inline_comment_prefixes='#')
|
||||||
if not os.path.exists ('boottoolsgenerator.cfg'):
|
if not os.path.exists ('boottoolsgenerator.cfg'):
|
||||||
print ('configuration file "boottoolsgenerator.cfg" not found')
|
print ('configuration file "boottoolsgenerator.cfg" not found')
|
||||||
sys.exit (1)
|
sys.exit (1)
|
||||||
|
|
|
@ -2,16 +2,17 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import configparser
|
||||||
from boottoolsfunctions import _run
|
from boottoolsfunctions import _run
|
||||||
|
|
||||||
debconf_settings = """
|
config = configparser.ConfigParser (inline_comment_prefixes='#')
|
||||||
console-setup console-setup/charmap47 select UTF-8
|
if not os.path.exists ('boottoolsgenerator.cfg'):
|
||||||
console-setup console-setup/codeset47 select . Combined - Latin; Slavic Cyrillic; Greek
|
print ('configuration file "boottoolsgenerator.cfg" not found')
|
||||||
console-setup console-setup/fontface47 select VGA
|
sys.exit (1)
|
||||||
console-setup console-setup/fontsize-fb47 select 8x16
|
config.read ('boottoolsgenerator.cfg')
|
||||||
""".strip()
|
debconf_settings2 = config['debconf'].get ('settings2')
|
||||||
|
|
||||||
subprocess.run (['debconf-set-selections'], input=debconf_settings, text=True)
|
subprocess.run (['debconf-set-selections'], input=debconf_settings2, text=True)
|
||||||
|
|
||||||
os.environ['DEBIAN_FRONTEND'] = 'noninteractive'
|
os.environ['DEBIAN_FRONTEND'] = 'noninteractive'
|
||||||
_run (['dpkg-reconfigure', 'console-setup', 'locales'])
|
_run (['dpkg-reconfigure', 'console-setup', 'locales'])
|
||||||
|
|
|
@ -69,6 +69,12 @@ settings =
|
||||||
openssh-server openssh-server/permit-root-login boolean true
|
openssh-server openssh-server/permit-root-login boolean true
|
||||||
refind refind/install_to_esp boolean false
|
refind refind/install_to_esp boolean false
|
||||||
|
|
||||||
|
settings2 =
|
||||||
|
console-setup console-setup/charmap47 select UTF-8
|
||||||
|
console-setup console-setup/codeset47 select . Combined - Latin; Slavic Cyrillic; Greek
|
||||||
|
console-setup console-setup/fontface47 select VGA
|
||||||
|
console-setup console-setup/fontsize-fb47 select 8x16
|
||||||
|
|
||||||
[ISOLinux]
|
[ISOLinux]
|
||||||
|
|
||||||
template =
|
template =
|
||||||
|
|
|
@ -24,7 +24,7 @@ logging.basicConfig (
|
||||||
)
|
)
|
||||||
logger = logging.getLogger ('boottools')
|
logger = logging.getLogger ('boottools')
|
||||||
|
|
||||||
config = configparser.ConfigParser (inline_comment_prefixes='#')
|
config = configparser.ConfigParser (comment_prefixes='#', inline_comment_prefixes='#')
|
||||||
if not os.path.exists ('boottoolsgenerator.cfg'):
|
if not os.path.exists ('boottoolsgenerator.cfg'):
|
||||||
print ('configuration file "boottoolsgenerator.cfg" not found')
|
print ('configuration file "boottoolsgenerator.cfg" not found')
|
||||||
sys.exit (1)
|
sys.exit (1)
|
||||||
|
@ -90,10 +90,8 @@ if (rc): ## 'file|grep' failed
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error (str (e))
|
logger.error (str (e))
|
||||||
sys.exit (2)
|
sys.exit (2)
|
||||||
#echo ================= nati after btogSetFsVirtual; ls -la /opt/opengnsys/tftpboot/ogclient/
|
|
||||||
|
|
||||||
logger.info ('Fase 3.2 - Configurar acceso schroot al Segundo Sistema de archivos (img)')
|
logger.info ('Fase 3.2 - Configurar acceso schroot al Segundo Sistema de archivos (img)')
|
||||||
#cat /etc/schroot/schroot.conf | grep $BTROOTFSIMG || btogSetFsAccess
|
|
||||||
btogSetFsAccess (btrootfsimg)
|
btogSetFsAccess (btrootfsimg)
|
||||||
|
|
||||||
## para hacer schroot --cosas, el mntpt tiene que estar desmontado
|
## para hacer schroot --cosas, el mntpt tiene que estar desmontado
|
||||||
|
@ -113,7 +111,6 @@ if (cp.returncode):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error (str (e))
|
logger.error (str (e))
|
||||||
sys.exit (3)
|
sys.exit (3)
|
||||||
#echo ================= nati after fase 3; ls -la /opt/opengnsys/tftpboot/ogclient/
|
|
||||||
|
|
||||||
###########################################################################
|
###########################################################################
|
||||||
logger.info ('FASE 4 - Incorporando ficheros OpenGnsys al sistema raíz rootfs')
|
logger.info ('FASE 4 - Incorporando ficheros OpenGnsys al sistema raíz rootfs')
|
||||||
|
@ -145,8 +142,6 @@ if (not _is_mounted (btrootfsmnt)):
|
||||||
logger.debug ('running \'{}/02-boottoolsFsOpengnsys.py --mntpt "{}" --osdistrib "{}" --oscodename "{}" --osrelease "{}" --osarch "{}" --oshttp "{}"\''.format (curdir, btrootfsmnt, osdistrib, oscodename, osrelease, osarch, oshttp))
|
logger.debug ('running \'{}/02-boottoolsFsOpengnsys.py --mntpt "{}" --osdistrib "{}" --oscodename "{}" --osrelease "{}" --osarch "{}" --oshttp "{}"\''.format (curdir, btrootfsmnt, osdistrib, oscodename, osrelease, osarch, oshttp))
|
||||||
stdout, _ = _run (['{}/02-boottoolsFsOpengnsys.py'.format (curdir), '--mntpt', btrootfsmnt, '--osdistrib', osdistrib, '--oscodename', oscodename, '--osrelease', osrelease, '--osarch', osarch, '--oshttp', oshttp])
|
stdout, _ = _run (['{}/02-boottoolsFsOpengnsys.py'.format (curdir), '--mntpt', btrootfsmnt, '--osdistrib', osdistrib, '--oscodename', oscodename, '--osrelease', osrelease, '--osarch', osarch, '--oshttp', oshttp])
|
||||||
logger.debug ('02-boottoolsFsOpengnsys stdout follows: {}'.format (stdout))
|
logger.debug ('02-boottoolsFsOpengnsys stdout follows: {}'.format (stdout))
|
||||||
## /tmp/02.py --osdistrib ubuntu --oscodename focal --osrelease 5.4.0-42-generic --osarch amd64 --oshttp http://es.archive.ubuntu.com/ubuntu/
|
|
||||||
## /tmp/opengnsys_installer/opengnsys/client/./boot-tools/02-boottoolsFsOpengnsys.py --mntpt "/var/lib/tftpboot/ogclient/ogclientmount" --osdistrib "Ubuntu" --oscodename "noble" --osrelease "6.8.0-39-generic" --osarch "amd64" --oshttp "http://es.archive.ubuntu.com/ubuntu/"
|
|
||||||
|
|
||||||
_run (['umount', btrootfsmnt])
|
_run (['umount', btrootfsmnt])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue