diff --git a/03-boottoolsSoftwareInstall.py b/03-boottoolsSoftwareInstall.py index 070a907..f7ab2f7 100755 --- a/03-boottoolsSoftwareInstall.py +++ b/03-boottoolsSoftwareInstall.py @@ -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) diff --git a/05-boottoolsFsLocales.py b/05-boottoolsFsLocales.py index a7a5387..e3995b8 100755 --- a/05-boottoolsFsLocales.py +++ b/05-boottoolsFsLocales.py @@ -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']) diff --git a/boottoolsgenerator.cfg b/boottoolsgenerator.cfg index 4bda2ff..3542537 100644 --- a/boottoolsgenerator.cfg +++ b/boottoolsgenerator.cfg @@ -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 = diff --git a/boottoolsgenerator.py b/boottoolsgenerator.py index e91e7e2..2b6a362 100755 --- a/boottoolsgenerator.py +++ b/boottoolsgenerator.py @@ -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])