Creating the rootfs image fails sometimes
Created by: ollieparanoid
The following error just happened during pmbootstrap install
:
losetup: /home/user/rootfs/lg-mako.img: failed to set up loop device: No such file or directory
When I run pmbootstrap install
again, it gets created fine. This might be a regression in using truncate
instead of fallocate
? Or maybe it is related to the loop
module not getting loaded properly?
I rand lsmod | grep loop
directly after the failed pmbootstrap install
and the loop
module was loaded.
Full log:
(029356) [23:47:15] (native) % rm /home/user/rootfs/lg-mako.img
(029356) [23:47:15] (native) create lg-mako.img (435M)
(029356) [23:47:15] WARNING: Make sure, that your target device's partition table has allocated at least 435M as system partition!
[23:47:15] Continue? (y/n) [y] y
(029356) [23:47:18] (native) % su user -c 'mkdir -p /home/user/rootfs'
(029356) [23:47:18] (native) % truncate -s 435M /home/user/rootfs/lg-mako.img
(029356) [23:47:18] (native) mount /dev/install (lg-mako.img)
(029356) [23:47:18] (native) mount /home/user/rootfs/lg-mako.img (loop)
(029356) [23:47:18] % sudo mount --bind /dev/loop-control /home/user/.local/var/pmbootstrap/chroot_native//dev/loop-control
(029356) [23:47:18] (native) % losetup -f /home/user/rootfs/lg-mako.img
losetup: /home/user/rootfs/lg-mako.img: failed to set up loop device: No such file or directory
(029356) [23:47:19] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(029356) [23:47:19] NOTE: The failed command's output is above the ^^^ line in the logfile: /home/user/.local/var/pmbootstrap/log.txt
(029356) [23:47:19] ERROR: Command failed: (native) % losetup -f /home/user/rootfs/lg-mako.img
(029356) [23:47:19] Run 'pmbootstrap log' for details.
(029356) [23:47:19] See also: <https://postmarketos.org/troubleshooting>
(029356) [23:47:19] Traceback (most recent call last):
File "/home/user/code/pmbootstrap/pmb/helpers/run.py", line 45, in core
stderr=args.logfd)
File "/usr/lib/python3.6/subprocess.py", line 291, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '/usr/bin/sh', '-c', "env -i CHARSET=UTF-8 PATH=/usr/lib/ccache/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sb
in:/bin SHELL=/bin/ash HISTFILE=~/.ash_history /usr/bin/chroot /home/user/.local/var/pmbootstrap/chroot_native sh -c 'cd /;losetup -f /home/user/rootfs/lg-mako.img'"]
' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/user/code/pmbootstrap/pmbootstrap.py", line 53, in main
getattr(pmb.helpers.frontend, args.action)(args)
File "/home/user/code/pmbootstrap/pmb/helpers/frontend.py", line 136, in install
pmb.install.install(args)
File "/home/user/code/pmbootstrap/pmb/install/install.py", line 285, in install
install_system_image(args)
File "/home/user/code/pmbootstrap/pmb/install/install.py", line 164, in install_system_image
pmb.install.blockdevice.create(args, size_image)
File "/home/user/code/pmbootstrap/pmb/install/blockdevice.py", line 101, in create
create_and_mount_image(args, size)
File "/home/user/code/pmbootstrap/pmb/install/blockdevice.py", line 84, in create_and_mount_image
pmb.install.losetup.mount(args, img_path)
File "/home/user/code/pmbootstrap/pmb/install/losetup.py", line 44, in mount
pmb.chroot.root(args, ["losetup", "-f", img_path])
File "/home/user/code/pmbootstrap/pmb/chroot/root.py", line 86, in root
return_stdout, check)
File "/home/user/code/pmbootstrap/pmb/helpers/run.py", line 58, in core
raise RuntimeError("Command failed: " + log_message) from exc
RuntimeError: Command failed: (native) % losetup -f /home/user/rootfs/lg-mako.img