| Age | Commit message (Collapse) | Author |
|
After calling partprobe, userspace may need a moment to delete any
previously existing device nodes. Sleep a second to give userspace
a chance to do this before checking for the nodes to appear.
Also, copy the vmdk files in parallel. Otherwise it takes forever
to setup the USB disks.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
|
|
As of 6f5bc54("lx-trainer-vm: increase image size to 64GiB") the
root filesystem is now large enough for all layers and training
work. So there is no reason to create a separate /home partition.
Change the dd-multi.sh script to instead:
- create an exfat partition
- convert the image to VMDK format and copy to exfat partition
This allows participants who cannot boot from USB to be able to
use VMware or VirtualBox during the training. They need only to
create a virtual machine and set the "training-hd.vmdk" file as
the hard drive.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
|
|
Rename the variable representing the extra partition. Until now
this was /home but it will be changed to be an extra partition.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
|
|
It seems that calling umount directly after mount can lead to a
busy error. With strace on umount the problem goes away. It must
be a very small window. Someone should debug the umount syscall
on this. It is reproducable with:
./dd-multi.sh lx-trainer.img /dev/sdx
(i.e. regular training image and no layers)
Implement a workaround for this for now.
From the comments...
If there were no layer files added, umount might return a busy
error since we just mounted. (Possibly a kernel bug.) By
accessing the filesytem before unmounting it, the mount/umount
problem seems to go away. Use "ls" to access the filesystem.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
|
|
Start the untar processes in parallel. This will take advantage
of file caching and should max out the USB bandwidth.
This is important because some trainings (like Yocto) have huge
layers.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
|
|
/home shouldn't be empty, but check just in case. Getting an
error in the middle of the script is very annoying.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
|
|
It is very annoying if the script aborts in the middle because
of something like missing files. Check for them in the beginnning.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
|
|
Tarballs are copied to the USB drives and then unpacked in a
chroot. However, this means the data will travel across the bus
three times! For large layers this is craziness.
Since --numeric-owner is used anyway, just unpack the tarballs
directly.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
|
|
- require gpt images and expect partition layout
and sizes from lx-trainer-vm.xml
- cleanup output
- use dd instead of cat (to allow progress status)
- use parted instead of fdisk (necessary to fix gpt table)
- remove unnecessary partprobe's
Signed-off-by: John Ogness <john.ogness@linutronix.de>
|
|
When partitioning many devices, it is possible that partprobe
returns with a "EBUSY" error. Loop until partprobe succeeds.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
|
|
There is a latency between when partprobe is called and when udev
actually creates the device nodes. Wait for the desired device
nodes to appear before continuing.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
|
|
Use 'basename' to isolate the layer tarball filename in case
they are specified in a directory other than the current working
directory.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
|
|
Initially write 10MB of 0's instead of 1MB to make sure any tables
at the beginning are really gone.
Rather than calling 'partprobe' with no arguments, explicitly pass
the list of devices to re-read.
'fdisk' is used to create the 2nd (/home) partition. Do not do that
in the background but instead synchronously for each device. Add a
'sync' afterwards to hopefully create a barrier before rescanning
the devices. This is should address a problem where 'partprobe' is
run too early and the kernel does not find the 2nd partition of the
last device.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
|
|
Layers can now be specified using: --layer=tarball
Signed-off-by: John Ogness <john.ogness@linutronix.de>
|
|
- removed extra dd-variation scripts
- updated script for general usage (src/dest as arguments)
- adjusted script to support modifying new image
- moves /home/* from part1 to part2
- adds /home entry to /etc/fstab
- moved manut's update-home.sh to "extra" directory
(may still be in use? until a general replacement exists)
Signed-off-by: John Ogness <john.ogness@linutronix.de>
|