Problem when flashing system

Hi,

I just got a new TK1.

I am trying to flash a system into TK1. The host machine is Ubuntu 12.04.

I followed instructions listed in "l4t_quick_start_guide.txt:, but got

sudo ./flash.sh -S 8GiB jetson-tk1 mmcblk0p1
copying dtbfile(/home/yan/Downloads/Linux_for_Tegra/kernel/dtb/tegra124-pm375.dtb) to tegra124-pm375.dtb… done.
Making system.img… /home/yan/Downloads/Linux_for_Tegra/rootfs 8589934592
mapping system.img to loop device failed.

Any ideas? Thanks

yan

Your /dev/loop0 may not exist yet. Try this before running to create /dev/loop0…expect reboot to remove it if udev is in charge:
sudo losetup --find

Test for existence of /dev/loop0 after the losetup --find…I thought Ubuntu still had not moved to udev, but this is why it doesn’t exist sometimes.

Hi, thanks.

I had tried the “losetup --find”, and got only “/dev/loop1”

I connect TK1 via USB port and have rebooted TK1 for several times. What else can I do?

Ok, this is a weakness in flash.sh script that can be worked around. A bit of history to explain…

The /dev/ directory contains device special files which correspond basically to hardware. Hardware needing entries increased to the point that maintenance was becoming impossible. Lots of web traffic on the topic of how to deal with it, and lots of comments about how there is no “great” solution. One thing that was obvious was that there was a scheme needed to dynamically generate those files as they were used.

Enter udev. This is to do that. However, some distributions still have not adopted udev, or have only partially adopted it. losetup started options to be able to do this in 2005, and has had the --find option since then, even on distributions which did not need --find.

Fedora for example tends to be leading edge (“bleeding edge”), so /dev/loop0 never exists unless root runs losetup --find. Ubuntu seems to create /dev//loop0 statically, but other /dev/loopN only exist when used. The --find option is supposed to find the first unused loop device, and if run with root authority, create it when it doesn’t exist. What your error tells me is that something on your system is already using /dev/loop0, and so /dev/loop1 is the first unused device.

You may be using a loopback mounted file system (e.g., loopback mounted encrypted file system), and thus hard coded loop0 is not the first unused loop device. So you either have to free up loop0 before running flash.sh, or you use sudo losetup --find to create /dev/loop1 (temporary…goes away after reboot) and edit flash.sh to use /dev/loop1 instead of loop0.

The best solution would be to release flash.sh to use losetup --find in order to detect the first unused loop device, rather than hard coding loop0. This will work with all udev or non-udev systems, and also be immune to systems which have loop0 but in which loop0 is busy.

EDIT: I checked my Ubuntu, looks like it does statically create loop0 through loop7. The --find option thus is needed to find the first unused device, but does not need to be used to create a device unless loop0 through loop7 are used already.

Hi, Thanks. I will try what you said tonight. yan