|
@@ -369,6 +369,7 @@ setup-vbootstrap(){
|
|
fi
|
|
fi
|
|
ARCHIVES_DIR=${BUILD_ROOT}/var/cache/apt/archives
|
|
ARCHIVES_DIR=${BUILD_ROOT}/var/cache/apt/archives
|
|
EXTERNAL_ARCHIVES_DIR=${CACHE_DIR}/${BASE_PROFILE}/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"
|
|
__chroot_sh="/usr/sbin/chroot ${BUILD_ROOT} /bin/sh -c -l"
|
|
|
|
|
|
@@ -460,9 +461,9 @@ mount-chroot-umount(){
|
|
;;
|
|
;;
|
|
unionfs_dir)
|
|
unionfs_dir)
|
|
[ -d ${BUILD_ROOT} ] || return 1
|
|
[ -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}
|
|
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} ... "
|
|
echo $"Retry lazy unmount ${BUILD_ROOT} ... "
|
|
umount -l ${BUILD_ROOT}
|
|
umount -l ${BUILD_ROOT}
|
|
echo $"done."
|
|
echo $"done."
|
|
@@ -526,11 +527,24 @@ mount-chroot-mount(){
|
|
unionfs_dir)
|
|
unionfs_dir)
|
|
if [ $with_unionfs -eq 1 ]; then
|
|
if [ $with_unionfs -eq 1 ]; then
|
|
[ -d ${UNIONFS_ROOT} ] || mkdir -p ${UNIONFS_ROOT}
|
|
[ -d ${UNIONFS_ROOT} ] || mkdir -p ${UNIONFS_ROOT}
|
|
|
|
+ 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 ||:
|
|
/sbin/modprobe aufs >& /dev/null ||:
|
|
- if ( grep -q aufs /proc/filesystems ) ; then
|
|
|
|
|
|
+ #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})" ] && \
|
|
[ -z "$(mount | grep ${UNIONFS_ROOT})" ] && \
|
|
mount -t aufs -o br=${UNIONFS_ROOT}=rw:${BUILD_ROOT}=ro aufs ${BUILD_ROOT}
|
|
mount -t aufs -o br=${UNIONFS_ROOT}=rw:${BUILD_ROOT}=ro aufs ${BUILD_ROOT}
|
|
else
|
|
else
|
|
|
|
+ #unionfs
|
|
[ -z "$(mount | grep ${UNIONFS_ROOT})" ] && \
|
|
[ -z "$(mount | grep ${UNIONFS_ROOT})" ] && \
|
|
mount -t unionfs -o dirs=${UNIONFS_ROOT}=rw:${BUILD_ROOT}=ro unionfs ${BUILD_ROOT}
|
|
mount -t unionfs -o dirs=${UNIONFS_ROOT}=rw:${BUILD_ROOT}=ro unionfs ${BUILD_ROOT}
|
|
unionctl ${BUILD_ROOT} --list
|
|
unionctl ${BUILD_ROOT} --list
|