#19 let's avoid using root user (mount -o loop)
Closed: Fixed 7 years ago Opened 8 years ago by lkocman.

Hello,

I'd like to eliminate usage of local mount command which seems to require root privileges.
We could do these in either runroot or find some other way to do so

2015-07-10 14:37:47 [ERROR ] Exception: ERROR running command: mount -o loop /tmp/tweak_buildinstall_K7UKhF/images/efiboot.img /tmp/tweak_buildinstalllnIM0Z

Lubos


p7-zip on Ubuntu works great as a simple userland tool for extracting ISOs' contents as a non-root user, similar to unpacking a tarball. I haven't gotten it to work on Fedora, yet, though.

The pattern in which Pungi is doing the image manipulation is roughly this:

dd if=/dev/zero of=image bs=1k count=5760
mke2fs -F image
mount -o loop image /mount_tmp
# copy files to /mount_tmp
umount /mount_tmp

We could use guestmount and guestunmount from libguestfs-tools-c package. This is available in Fedora and works fine. Installing all the dependencies on my workstation system took 24 MiB.

Only mounting and unmounting of the image would need to change.

guestmount -a image -m /dev/sda /mount_tmp
guestunmount /mount_tmp

In buildinstall phase mount is used on existing images and modifying their contents. This is actually the place that caused the error in original report.

@lsedlar changed the status to Closed

7 years ago

Login to comment on this ticket.

Metadata