ios-xr / gisobuild

Golden ISO build tool for ios-xr
Other
28 stars 14 forks source link

ISO build inside Podman container fails #9

Closed jumalwelho closed 2 years ago

jumalwelho commented 3 years ago

When running the script inside rootless Podman container ( $UID = 0) causes the script to hang. There is a workaround to use Podman run parameter '--userns=keep-id' :

2021-02-10 12:56:47:: ISO /home/git/gisobuild/tmpbz8bv034/iso/host.iso vm_type HOST searchkey HOST.ISO 2021-02-10 12:56:51:: Cleaning Iso 2021-02-10 12:56:51:: iso extract path /home/git/gisobuild/tmpphdrdw8f 2021-02-10 12:56:51:: Cleaning Iso 2021-02-10 12:56:51:: iso extract path /home/git/gisobuild/tmpbz8bv034 2021-02-10 12:56:52:: Exiting with exception 2021-02-10 12:56:52:: TB: Traceback (most recent call last): File "/home/git/gisobuild/./gisobuild.py", line 3235, in main(args) File "/home/git/gisobuild/./gisobuild.py", line 3039, in main supp_arch = giso.get_supp_arch(vm_type) File "/home/git/gisobuild/./gisobuild.py", line 1859, in get_supp_arch fs_root = iso.get_iso_extract_path() File "/home/git/gisobuild/./gisobuild.py", line 1425, in get_iso_extract_path run_cmd("zcat -f %s%s | cpio -id" % (self.iso_mount_path, File "/home/git/gisobuild/./gisobuild.py", line 76, in run_cmd raise RuntimeError("Error CMD=%s returned --->%s" % (cmd, out)) RuntimeError: Error CMD=zcat -f /home/git/gisobuild/tmplrxzonj8/boot/initrd.img | cpio -id returned --->cpio: var: C annot change ownership to uid 434115, gid 25: Invalid argument cpio: var/backups: Cannot change ownership to uid 434115, gid 25: Invalid argument cpio: var/lib: Cannot change ownership to uid 434115, gid 25: Invalid argument . . .

jumalwelho commented 2 years ago

Okay so the issue seemed to be that gisobuild.py tried to issue weird priviledges. Not sure if good fix but inside rootless container (Podman) in line 1425 one could use cpio option -R root:root so the files created will be using the same UID/GID as the user running the container