summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ogness <john.ogness@linutronix.de>2018-04-20 17:03:00 +0200
committerJohn Ogness <john.ogness@linutronix.de>2018-04-20 17:03:00 +0200
commit27605a4b4aa3ec0a50391d6367b2ea0a9de17b91 (patch)
treec055227adfcc1a7df3a0d39cd644c340530188fc
parentcd5a925929cc08a43749028ab76476f2e31c3c41 (diff)
dd-multi.sh: unpack the tarballs directly
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>
-rwxr-xr-xlx-trainer-vm/dd-multi.sh20
1 files changed, 3 insertions, 17 deletions
diff --git a/lx-trainer-vm/dd-multi.sh b/lx-trainer-vm/dd-multi.sh
index 50f8786..499260b 100755
--- a/lx-trainer-vm/dd-multi.sh
+++ b/lx-trainer-vm/dd-multi.sh
@@ -134,29 +134,15 @@ for dest in $DESTS; do
echo 'LABEL=lxhome /home ext4 defaults 0 0' | \
tee -a ${TMP_ROOT}${dest}${ROOTPT}/etc/fstab > /dev/null
- # copy layer tarballs to /home
- for tarball in $LAYERS; do
- destfile="${TMP_ROOT}${dest}${HOMEPT}/`basename $tarball`"
- if [ -f $destfile ]; then
- echo
- echo "WARNING: OVERWRITING $destfile" 1>&2
- echo
- sleep 1
- fi
- cp $tarball $destfile
- done
-
# remount home to /home
umount ${TMP_ROOT}${dest}${HOMEPT}
mount ${dest}${HOMEPT} ${TMP_ROOT}${dest}${ROOTPT}/home
# unpack layers
for tarball in $LAYERS; do
- destfile=`basename $tarball`
- echo "unpacking $destfile to ${dest}"
- chroot ${TMP_ROOT}${dest}${ROOTPT} \
- tar -x -f /home/$destfile --numeric-owner -C /
- rm ${TMP_ROOT}${dest}${ROOTPT}/home/$destfile
+ echo "unpacking $tarball to $dest"
+ tar -x -f $tarball --numeric-owner \
+ -C ${TMP_ROOT}${dest}${ROOTPT}
done
# unmount partitions