summaryrefslogtreecommitdiff
path: root/lx-trainer-vm/dd-multi.sh
AgeCommit message (Collapse)Author
2019-02-01dd-multi.sh: add sleep for caution, copy vmdk in parallelJohn Ogness
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>
2019-01-28dd-multi: create vmdk partition instead of /home paritionJohn Ogness
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>
2019-01-28dd-multi: rename HOMEPT to EXTRAPTJohn Ogness
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>
2018-09-06dd-multi: workaround mount/umount issueJohn Ogness
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>
2018-05-04dd-multi.sh: unpack layers in parallelJohn Ogness
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>
2018-05-04dd-multi.sh: check if /home is empty before copyingJohn Ogness
/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>
2018-05-04dd-multi.sh: check for layers before beginningJohn Ogness
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>
2018-04-20dd-multi.sh: unpack the tarballs directlyJohn Ogness
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>
2018-04-05dd-multi: update/cleanup for gpt supportJohn Ogness
- 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>
2018-03-20dd-multi.sh: loop partprobe until successJohn Ogness
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>
2018-02-23dd-multi.sh: wait for new partitionsJohn Ogness
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>
2018-02-20dd-multi.sh: add support for layer tarballs in subdirsJohn Ogness
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>
2018-02-19dd-multi.sh: change partitioning procedureJohn Ogness
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>
2017-12-19dd-multi.sh: add layer supportJohn Ogness
Layers can now be specified using: --layer=tarball Signed-off-by: John Ogness <john.ogness@linutronix.de>
2017-09-18update scripts and READMEJohn Ogness
- 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>