linaro-media-create can't mktemp when TMPDIR set

Bug #834803 reported by Al Grant
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro Image Tools
Fix Released
Medium
Georgy Redkozubov

Bug Description

sudo TMPDIR=/hd/tmp linaro-media-create ...

fails because linaro-hwpack-install picks up TMPDIR and tries to create a temporary in /hd/tmp,
but that's not around because it's chrooted (see below). One solution might be to have prepare_chroot
create a suitably named subdirectory of the temporary directory it's going to chroot into.

failed to create directory via template `/hd/tmp/tmp.XXXXXXXXXX': No such file or directory
proc umounted
Traceback (most recent call last):
  File "/usr/bin/linaro-media-create", line 146, in <module>
    verified_files, *hwpacks)
  File "/usr/lib/pymodules/python2.6/linaro_image_tools/media_create/chroot_utils.py", line 64, in install_hwpacks
    install_hwpack(chroot_dir, hwpack_file, hwpack_force_yes or hwpack_verified)
  File "/usr/lib/pymodules/python2.6/linaro_image_tools/media_create/chroot_utils.py", line 85, in install_hwpack
    cmd_runner.run(args, as_root=True, chroot=chroot_dir).wait()
  File "/usr/lib/pymodules/python2.6/linaro_image_tools/cmd_runner.py", line 100, in wait
    raise SubcommandNonZeroReturnValue(self._my_args, returncode)
linaro_image_tools.cmd_runner.SubcommandNonZeroReturnValue: Sub process "['chroot', '/hd/tmp/tmpJO7Ryq/binary', 'linaro-hwpack-install', '/hwpack_linaro-lt-panda-x11-base_20110726-1_armel_supported.tar.gz']" returned a non-zero value: 1

Related branches

Revision history for this message
James Westby (james-w) wrote : Re: [Bug 834803] [NEW] linaro-media-create can't mktemp when TMPDIR set

On Fri, 26 Aug 2011 15:25:37 -0000, Al Grant <email address hidden> wrote:
> Public bug reported:
>
> sudo TMPDIR=/hd/tmp linaro-media-create ...
>
> fails because linaro-hwpack-install picks up TMPDIR and tries to create a temporary in /hd/tmp,
> but that's not around because it's chrooted (see below). One solution might be to have prepare_chroot
> create a suitably named subdirectory of the temporary directory it's going to chroot into.

Yeah, or it could unset TMPDIR when running things in the chroot, as it
doesn't really matter whether we are following the users preference
there as it is inside a temporary dir anyway.

Either approach would work.

Thanks,

James

Changed in linaro-image-tools:
status: New → Triaged
importance: Undecided → Medium
Changed in linaro-image-tools:
assignee: nobody → Georgy Redkozubov (georgy-redkozubov)
status: Triaged → In Progress
Changed in linaro-image-tools:
status: In Progress → Fix Committed
Mattias Backman (mabac)
Changed in linaro-image-tools:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.