From 3ffe9a580a08cc00a74740454513a0a0e3ed5aa4 Mon Sep 17 00:00:00 2001 From: Natalia Serrano Date: Tue, 24 Sep 2024 12:52:06 +0200 Subject: [PATCH] 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)