linaro-android-media-create fails when not running as root

Bug #789093 reported by Guilherme Salgado
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Linaro Image Tools
Fix Released
High
Guilherme Salgado

Bug Description

If you run l-a-m-c without sudo, you'll get the traceback below. It happens because the unpacked userdata is not world readable, which causes the following line (from move_contents()) to return an empty list:
  files = glob.glob(os.path.join(from_, '*'))

Which in turn causes the move to fail as there are no files to move to the userdata disk.

mv: missing destination file operand after `/tmp/tmpdTw_YS/userdata-disc'
Try `mv --help' for more information.
Traceback (most recent call last):
  File "/home/salgado/devel/linaro-image-tools/trunk/linaro-android-media-create", line 147, in <module>
    populate_partition(DATA_DIR + "/data", DATA_DISK, data_partition)
  File "/home/salgado/devel/linaro-image-tools/trunk/linaro_image_tools/media_create/rootfs.py", line 29, in populate_partition
    move_contents(content_dir, root_disk)
  File "/home/salgado/devel/linaro-image-tools/trunk/linaro_image_tools/media_create/rootfs.py", line 117, in move_contents
    mv_cmd = ['mv']
  File "/home/salgado/devel/linaro-image-tools/trunk/linaro_image_tools/cmd_runner.py", line 87, in wait
    raise SubcommandNonZeroReturnValue(self._my_args, returncode)
linaro_image_tools.cmd_runner.SubcommandNonZeroReturnValue: Sub process "['sudo', '-E', 'mv', '/tmp/tmpdTw_YS/userdata-disc']" returned a non-zero value: 1

Related branches

Revision history for this message
Alexander Sack (asac) wrote :

thanks salgado!

subscribed linaro-release ...

could be release noted or we can ensure that our default instructions posted should just refer to sudo linaro-android-media-create.

Changed in linaro-image-tools:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Alexander Sack (asac) wrote :

should get fixed for 11.06 ... guess thats 0.4.9. maybe milestone there.

Revision history for this message
Mattias Backman (mabac) wrote :

It always works for me without sudo. Unpacking the userdata.tar.bz2 file gives all the files my user and group as owner. I wonder if that's just lucky since I perhaps happen to have the same user id as the packed data.

uid=1000(mabac) gid=1000(mabac) groups=1000(mabac)

Revision history for this message
Guilherme Salgado (salgado) wrote :

Indeed, looks like it will work without sudo if you run l-a-m-c with a user whose uid/gid is 1000. This is the permission of the files in the tarball:

drwxrwx--x 1000/1000 0 2011-05-26 11:42 data/
drwxrwx--x 1000/1000 0 2011-05-26 11:42 data/app/

James Westby (james-w)
Changed in linaro-image-tools:
milestone: none → 0.4.9
milestone: 0.4.9 → 2011.07
James Westby (james-w)
Changed in linaro-image-tools:
assignee: nobody → Guilherme Salgado (salgado)
Changed in linaro-image-tools:
status: Confirmed → In Progress
Changed in linaro-image-tools:
status: In Progress → Fix Committed
James Westby (james-w)
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.