refs #596 move more debconf settings to the config

pull/1/head
Natalia Serrano 2024-08-13 15:11:17 +02:00
parent 305e6209bf
commit 4ac6b8cdd4
4 changed files with 16 additions and 14 deletions

View File

@ -9,7 +9,7 @@ import configparser
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'):
print ('configuration file "boottoolsgenerator.cfg" not found')
sys.exit (1)

View File

@ -2,16 +2,17 @@
import os
import subprocess
import configparser
from boottoolsfunctions import _run
debconf_settings = """
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
""".strip()
config = configparser.ConfigParser (inline_comment_prefixes='#')
if not os.path.exists ('boottoolsgenerator.cfg'):
print ('configuration file "boottoolsgenerator.cfg" not found')
sys.exit (1)
config.read ('boottoolsgenerator.cfg')
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'
_run (['dpkg-reconfigure', 'console-setup', 'locales'])

View File

@ -69,6 +69,12 @@ settings =
openssh-server openssh-server/permit-root-login boolean true
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]
template =

View File

@ -24,7 +24,7 @@ logging.basicConfig (
)
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'):
print ('configuration file "boottoolsgenerator.cfg" not found')
sys.exit (1)
@ -90,10 +90,8 @@ if (rc): ## 'file|grep' failed
except Exception as e:
logger.error (str (e))
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)')
#cat /etc/schroot/schroot.conf | grep $BTROOTFSIMG || btogSetFsAccess
btogSetFsAccess (btrootfsimg)
## para hacer schroot --cosas, el mntpt tiene que estar desmontado
@ -113,7 +111,6 @@ if (cp.returncode):
except Exception as e:
logger.error (str (e))
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')
@ -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))
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))
## /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])