From db965f133e606cb133101ba9acae36ea46aaa2ce Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 2 Jun 2021 17:26:46 -0400 Subject: [PATCH] Add a 'pack' and attempt to bind /etc/resolv.conf on exec This facilitates custom manual image work --- confluent_osdeploy/diskless/build/genimage.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/confluent_osdeploy/diskless/build/genimage.py b/confluent_osdeploy/diskless/build/genimage.py index 7ad4ed91..fd1bc277 100644 --- a/confluent_osdeploy/diskless/build/genimage.py +++ b/confluent_osdeploy/diskless/build/genimage.py @@ -135,6 +135,8 @@ def main(): build_root(opts, args[1:]) if args[0] == 'exec': exec_root(opts, args[1:]) + if args[0] == 'pack': + pack_image(opts, args[1:]) def exec_root(opts, args): @@ -145,6 +147,7 @@ def exec_root_backend(optargs): installroot = args[0] imgname = os.path.basename(installroot) _mount_constrained_fs(opts, installroot) + _mount('/etc/resolv.conf', os.path.join(installroot, 'etc/resolv.conf'), flags=MS_BIND|MS_RDONLY) os.chroot(installroot) os.chdir('/') os.environ['PS1'] = '[\x1b[1m\x1b[4mIMGUTIL EXEC {0}\x1b[0m \W]$ '.format(imgname)