From e60695f847b9bb5e19122feae44d94a65a4905fb Mon Sep 17 00:00:00 2001 From: Natalia Serrano Date: Tue, 24 Sep 2024 12:52:06 +0200 Subject: [PATCH 1/5] refs #773 write a sysctl.conf --- boottools/btog.py | 7 +++++++ mkoglive.py | 1 + 2 files changed, 8 insertions(+) diff --git a/boottools/btog.py b/boottools/btog.py index e1e7bf9..d841bf4 100644 --- a/boottools/btog.py +++ b/boottools/btog.py @@ -243,6 +243,13 @@ def copy_og_files (builder, og_shared, og_engine, ogclientmount, osdistrib, osco if os.path.exists (f'{og_shared}/bin/browser'): shutil.copy (f'{og_shared}/bin/browser', f'{ogclientmount}/bin/') if os.path.exists (f'{og_shared}/bin/ogAdmClient'): shutil.copy (f'{og_shared}/bin/ogAdmClient', f'{ogclientmount}/bin/') +def sysctl (btrootfsmnt): + logger.debug ('copiando sysctl.conf') + with open (f'{btrootfsmnt}/etc/sysctl.conf', 'w') as fd: + fd.write ('net.ipv6.conf.all.disable_ipv6 = 1\n') + fd.write ('net.ipv6.conf.default.disable_ipv6 = 1\n') + fd.write ('net.ipv6.conf.lo.disable_ipv6 = 1\n') + def ssh_server (btrootfsmnt): if not os.path.exists ('/root/.ssh/id_rsa'): ## creates a key pair in the VM (or docker container), not in the chroot utils.run (['ssh-keygen', '-q', '-f', '/root/.ssh/id_rsa', '-N', '']) diff --git a/mkoglive.py b/mkoglive.py index 37439f3..79f369a 100755 --- a/mkoglive.py +++ b/mkoglive.py @@ -87,6 +87,7 @@ def _chroot_tasks (cfgfile, curdir, osrelease, osarch): def _ssh_stuff (btrootfsimg, btrootfsmnt): _mount_rootfs (btrootfsimg, btrootfsmnt) + btog.sysctl (btrootfsmnt) btog.ssh_server (btrootfsmnt) btog.ssh_client (btrootfsmnt) utils.umount (btrootfsmnt) From a12001f84a138aaf47e03d9bf685d85e9dc68900 Mon Sep 17 00:00:00 2001 From: Natalia Serrano Date: Tue, 24 Sep 2024 13:00:47 +0200 Subject: [PATCH 2/5] refs #773 do not use python apt module --- boottools/apt.py | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/boottools/apt.py b/boottools/apt.py index d50f6dd..7fe0656 100644 --- a/boottools/apt.py +++ b/boottools/apt.py @@ -58,30 +58,8 @@ def cache_search (pkgs): return res def install (pkgs, opts={}): - apt_pkg.init() - - if opts: - apt_pkg.init_config() - for k in opts: - apt_pkg.config.set (k, opts[k]) - - cache = apt_pkg.Cache() - sl = apt_pkg.SourceList() - sl.read_main_list() - cache.update (apt.progress.base.AcquireProgress(), sl) - - _to_install = [] - dep_cache = apt_pkg.DepCache(cache) - for p in pkgs: - package = cache[p] - if not package: - print (f'package "{p}" not found') - continue - _to_install.append (p) - dep_cache.mark_install(package) - - if _to_install: - print ('about to install these packages: "{}"'.format (' '.join (_to_install))) - fetcher = apt_pkg.Acquire() - install_progress = apt.progress.base.InstallProgress() - dep_cache.commit(fetcher, install_progress) + opts_list = [] + for k in opts: opts_list += ['-o', f'{k}={opts[k]}'] + print ('about to install these packages: "{}"'.format (' '.join (pkgs))) + import subprocess + subprocess.run (['apt-get', '--yes', 'install'] + pkgs + opts_list) From 38339192726466e5e8221884957c2cf3f9f2f304 Mon Sep 17 00:00:00 2001 From: Natalia Serrano Date: Tue, 24 Sep 2024 13:01:05 +0200 Subject: [PATCH 3/5] refs #776 install ogagent dependencies --- mkoglive.cfg | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mkoglive.cfg b/mkoglive.cfg index 16507d7..ba97641 100644 --- a/mkoglive.cfg +++ b/mkoglive.cfg @@ -68,6 +68,8 @@ isolinux_template = [Packages] +agent = policykit-1 python3 python3-pyqt6 python3-requests python3-six python3-prctl python3-distro libxss1 zenity + basic = dialog man-db fbset gdebi-core bash-static busybox-static locales lshw gawk git python3-openssl python3 php-cli dmidecode rpm sqlite3 os-prober moreutils jq #console-data # ogLive anterior a Ubuntu 20.04 From 16482c60fd22c6d52deb678a47972a16bf62099a Mon Sep 17 00:00:00 2001 From: Natalia Serrano Date: Tue, 24 Sep 2024 13:01:59 +0200 Subject: [PATCH 4/5] Revert "refs #776 install ogagent dependencies" This reverts commit 38339192726466e5e8221884957c2cf3f9f2f304. --- mkoglive.cfg | 2 -- 1 file changed, 2 deletions(-) diff --git a/mkoglive.cfg b/mkoglive.cfg index ba97641..16507d7 100644 --- a/mkoglive.cfg +++ b/mkoglive.cfg @@ -68,8 +68,6 @@ isolinux_template = [Packages] -agent = policykit-1 python3 python3-pyqt6 python3-requests python3-six python3-prctl python3-distro libxss1 zenity - basic = dialog man-db fbset gdebi-core bash-static busybox-static locales lshw gawk git python3-openssl python3 php-cli dmidecode rpm sqlite3 os-prober moreutils jq #console-data # ogLive anterior a Ubuntu 20.04 From 985d83fe5e8e630ff5e62050dbb99702fb2c3d19 Mon Sep 17 00:00:00 2001 From: Natalia Serrano Date: Tue, 24 Sep 2024 13:02:05 +0200 Subject: [PATCH 5/5] Revert "refs #773 do not use python apt module" This reverts commit a12001f84a138aaf47e03d9bf685d85e9dc68900. --- boottools/apt.py | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/boottools/apt.py b/boottools/apt.py index 7fe0656..d50f6dd 100644 --- a/boottools/apt.py +++ b/boottools/apt.py @@ -58,8 +58,30 @@ def cache_search (pkgs): return res def install (pkgs, opts={}): - opts_list = [] - for k in opts: opts_list += ['-o', f'{k}={opts[k]}'] - print ('about to install these packages: "{}"'.format (' '.join (pkgs))) - import subprocess - subprocess.run (['apt-get', '--yes', 'install'] + pkgs + opts_list) + apt_pkg.init() + + if opts: + apt_pkg.init_config() + for k in opts: + apt_pkg.config.set (k, opts[k]) + + cache = apt_pkg.Cache() + sl = apt_pkg.SourceList() + sl.read_main_list() + cache.update (apt.progress.base.AcquireProgress(), sl) + + _to_install = [] + dep_cache = apt_pkg.DepCache(cache) + for p in pkgs: + package = cache[p] + if not package: + print (f'package "{p}" not found') + continue + _to_install.append (p) + dep_cache.mark_install(package) + + if _to_install: + print ('about to install these packages: "{}"'.format (' '.join (_to_install))) + fetcher = apt_pkg.Acquire() + install_progress = apt.progress.base.InstallProgress() + dep_cache.commit(fetcher, install_progress)