Unfortunately after some testing it seems this simple thing causes a
horrible, horrible problem: TMPDIR is passed on to qemu which means when
packages are installed, they are fed to a TMPDIR that possibly does not
exist on the target system. In my case I have a large disk mounted at
/build and errors such as:

debconf: apt-extracttemplates failed: Illegal seek
Extracting templates from packages: 15%E: Could not open file 
/build/rootstock/tmp/man-db.template.48360 - open (2: No such file or directory)
E: Unable to write to /build/rootstock/tmp/man-db.template.48360 - 
ofstream::ofstream (2: No such file or directory)
E: Could not open file /build/rootstock/tmp/man-db.config.48361 - open (2: No 
such file or directory)
E: Unable to write to /build/rootstock/tmp/man-db.config.48361 - 
ofstream::ofstream (2: No such file or directory)

Inside the "chroot" this directory obviously does not exist.

Possibly the correct solution is to pass -p as well (even though it is
deprecated it is the best solution) such as

mktemp -d -p ${ROOTSTOCKTEMP} -t

This way the temporary directory base can be passed as a new rootstock
argument (--tmpdir?) without overriding the TMPDIR environment variable
and accidentally passing it to the VM. Alternatively, passing
TMPDIR=/tmp before qemu-arm-static would make sure it uses the chroot's
/tmp directory.

Either solution seems good..

-- 
rootstock cmdline does not respect TMPDIR
https://bugs.launchpad.net/bugs/638190
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to