|
|
@ -131,8 +131,8 @@ create_chroot_pass () {
|
|
|
|
mkdir -p "$overlay_dir/"
|
|
|
|
mkdir -p "$overlay_dir/"
|
|
|
|
lowerdirs=$(get_lowerdirs_for_pass $pass)
|
|
|
|
lowerdirs=$(get_lowerdirs_for_pass $pass)
|
|
|
|
if [ -n "$lowerdirs" ]; then
|
|
|
|
if [ -n "$lowerdirs" ]; then
|
|
|
|
mkdir -p chroot "${overlay_dir}-initial"
|
|
|
|
mkdir -p chroot/
|
|
|
|
mount_overlay "$lowerdirs" "${overlay_dir}-initial" chroot/
|
|
|
|
mount_overlay "$lowerdirs" "$overlay_dir" chroot/
|
|
|
|
else
|
|
|
|
else
|
|
|
|
ln -s "$overlay_dir/" chroot
|
|
|
|
ln -s "$overlay_dir/" chroot
|
|
|
|
fi
|
|
|
|
fi
|
|
|
@ -268,19 +268,8 @@ create_chroot_pass () {
|
|
|
|
lb chroot_devpts remove ${*}
|
|
|
|
lb chroot_devpts remove ${*}
|
|
|
|
|
|
|
|
|
|
|
|
if [ -n "$lowerdirs" ]; then
|
|
|
|
if [ -n "$lowerdirs" ]; then
|
|
|
|
# Although the current chroot was created as an overlay over
|
|
|
|
umount chroot
|
|
|
|
# the previous layer, many operations can result in redundant
|
|
|
|
rmdir chroot
|
|
|
|
# files in the upperdir. Rather than trying to minimize the
|
|
|
|
|
|
|
|
# overlay by hand, we rsync the chroot into a fresh overlay,
|
|
|
|
|
|
|
|
# rely on rsyncs ability to avoid redundant file operations,
|
|
|
|
|
|
|
|
# and take _that_ overlay's upperdir as the content of the
|
|
|
|
|
|
|
|
# layer.
|
|
|
|
|
|
|
|
mkdir chroot-2
|
|
|
|
|
|
|
|
mount_overlay "$lowerdirs" "$overlay_dir" chroot-2/
|
|
|
|
|
|
|
|
rsync -aXHAS --del chroot/ chroot-2/
|
|
|
|
|
|
|
|
umount chroot chroot-2
|
|
|
|
|
|
|
|
rmdir chroot chroot-2
|
|
|
|
|
|
|
|
rm -rf ${overlay_dir}-initial
|
|
|
|
|
|
|
|
else
|
|
|
|
else
|
|
|
|
rm chroot
|
|
|
|
rm chroot
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|