|
@@ -302,6 +302,7 @@ setup-vbootstrap(){
|
|
|
fi
|
|
|
ARCHIVES_DIR=${BUILD_ROOT}/var/cache/apt/archives
|
|
|
EXTERNAL_ARCHIVES_DIR=${CACHE_DIR}/${BASE_PROFILE}/apt/archives
|
|
|
+ UNIONFS_WORK=${UNIONFS_DIR}/unionfs_work
|
|
|
|
|
|
__chroot_sh="/usr/sbin/chroot ${BUILD_ROOT} /bin/sh -c -l"
|
|
|
|
|
@@ -393,9 +394,9 @@ mount-chroot-umount(){
|
|
|
;;
|
|
|
unionfs_dir)
|
|
|
[ -d ${BUILD_ROOT} ] || return 1
|
|
|
- [ -z "$(mount | grep ${BUILD_ROOT} | egrep '(unionfs|aufs)')" ] || \
|
|
|
+ [ -z "$(mount | grep ${BUILD_ROOT} | egrep '(unionfs|aufs|overlay)')" ] || \
|
|
|
umount ${BUILD_ROOT}
|
|
|
- if [ ! -z "$(mount | grep ${BUILD_ROOT} | egrep '(unionfs|aufs)')" ]; then
|
|
|
+ if [ ! -z "$(mount | grep ${BUILD_ROOT} | egrep '(unionfs|aufs|overlay)')" ]; then
|
|
|
echo $"Retry lazy unmount ${BUILD_ROOT} ... "
|
|
|
umount -l ${BUILD_ROOT}
|
|
|
echo $"done."
|
|
@@ -459,10 +460,24 @@ mount-chroot-mount(){
|
|
|
unionfs_dir)
|
|
|
if [ $with_unionfs -eq 1 ]; then
|
|
|
[ -d ${UNIONFS_ROOT} ] || mkdir -p ${UNIONFS_ROOT}
|
|
|
- if ( /sbin/modprobe aufs >& /dev/null ) ; then
|
|
|
+ if [ -d ${UNIONFS_WORK} ]; then
|
|
|
+ #workdir needs emply
|
|
|
+ rm -rf ${UNIONFS_WORK}; mkdir -p ${UNIONFS_WORK}
|
|
|
+ else
|
|
|
+ mkdir -p ${UNIONFS_WORK}
|
|
|
+ fi
|
|
|
+ /sbin/modprobe overlay >& /dev/null ||:
|
|
|
+ /sbin/modprobe aufs >& /dev/null ||:
|
|
|
+ #overlayfs
|
|
|
+ if ( grep -q overlay /proc/filesystems ) ; then
|
|
|
+ [ -z "$(mount | grep ${UNIONFS_ROOT})" ] && \
|
|
|
+ mount -t overlay overlay -o lowerdir=${BUILD_ROOT},upperdir=${UNIONFS_ROOT},workdir=${UNIONFS_WORK} ${BUILD_ROOT}
|
|
|
+ #aufs
|
|
|
+ elif ( grep -q aufs /proc/filesystems ) ; then
|
|
|
[ -z "$(mount | grep ${UNIONFS_ROOT})" ] && \
|
|
|
mount -t aufs -o br=${UNIONFS_ROOT}=rw:${BUILD_ROOT}=ro aufs ${BUILD_ROOT}
|
|
|
else
|
|
|
+ #unionfs
|
|
|
[ -z "$(mount | grep ${UNIONFS_ROOT})" ] && \
|
|
|
mount -t unionfs -o dirs=${UNIONFS_ROOT}=rw:${BUILD_ROOT}=ro unionfs ${BUILD_ROOT}
|
|
|
unionctl ${BUILD_ROOT} --list
|