rootstock cmdline does not respect TMPDIR
Bug #638190 reported by
Matt Sealey
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
RootStock |
Confirmed
|
Low
|
Unassigned | ||
rootstock (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: rootstock
rootstock (0.1.99.4) cmdline does not respect TMPDIR
discussion with Oliver Grawert revealed that on line 699:
BUILDDIR=$(mktemp -d)
Should be
BUILDDIR=$(mktemp -d -t)
So that mktemp respects the TMPDIR environment variable.
Changed in project-rootstock: | |
importance: | Undecided → Low |
milestone: | none → 0.1.99.5 |
status: | New → Confirmed |
To post a comment you must log in.
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-extracttemp lates failed: Illegal seek rootstock/ tmp/man- db.template. 48360 - open (2: No such file or directory) rootstock/ tmp/man- db.template. 48360 - ofstream::ofstream (2: No such file or directory) rootstock/ tmp/man- db.config. 48361 - open (2: No such file or directory) rootstock/ tmp/man- db.config. 48361 - ofstream::ofstream (2: No such file or directory)
Extracting templates from packages: 15%E: Could not open file /build/
E: Unable to write to /build/
E: Could not open file /build/
E: Unable to write to /build/
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..