- case "${UNIONTYPE}" in
- unionmount)
- mpoint="${rootmnt}"
- rootfslist="${rootmnt} ${rootfslist}"
- ;;
-
- *)
- mpoint="${croot}/${imagename}"
- rootfslist="${mpoint} ${rootfslist}"
- ;;
- esac
+ mpoint="${croot}/${imagename}"
+ rootfslist="${mpoint} ${rootfslist}"
- if [ -n "${PERSISTENCE_READONLY}" ] && [ "${cowdevice}" != "tmpfs" ]
- then
- mount -t tmpfs -o rw,noatime,mode=755 tmpfs "/live/overlay"
- root_backing="/live/persistence/$(basename ${cowdevice})-root"
- mkdir -p ${root_backing}
- else
- root_backing="/live/overlay"
- fi
+ mount -t tmpfs -o rw,noatime,mode=755 tmpfs "/live/overlay"
+ root_backing="/live/persistence/$(basename ${cowdevice})-root"
+ mkdir -p ${root_backing}
+ else
+ root_backing="/live/overlay"
+ fi
- if [ "${cow_fstype}" = "nfs" ]
- then
- log_begin_msg \
- "Trying nfsmount ${nfs_cow_opts} ${cowdevice} ${root_backing}"
- nfsmount ${nfs_cow_opts} ${cowdevice} ${root_backing} || \
- panic "Can not mount ${cowdevice} (n: ${cow_fstype}) on ${root_backing}"
- else
- mount -t ${cow_fstype} -o ${cow_mountopt} ${cowdevice} ${root_backing} || \
- panic "Can not mount ${cowdevice} (o: ${cow_fstype}) on ${root_backing}"
- fi
+ if [ "${cow_fstype}" = "nfs" ]
+ then
+ log_begin_msg \
+ "Trying nfsmount ${nfs_cow_opts} ${cowdevice} ${root_backing}"
+ nfsmount ${nfs_cow_opts} ${cowdevice} ${root_backing} || \
+ panic "Can not mount ${cowdevice} (n: ${cow_fstype}) on ${root_backing}"
+ else
+ mount -t ${cow_fstype} -o ${cow_mountopt} ${cowdevice} ${root_backing} || \
+ panic "Can not mount ${cowdevice} (o: ${cow_fstype}) on ${root_backing}"
for dir in ${cow_dirs}; do
unionmountpoint="${rootmnt}${dir}"
mkdir -p ${unionmountpoint}
for dir in ${cow_dirs}; do
unionmountpoint="${rootmnt}${dir}"
mkdir -p ${unionmountpoint}
- # FIXME: handle PERSISTENCE_READONLY
- unionmountopts="-t ${cow_fstype} -o noatime,union,${cow_mountopt} ${cowdevice}"
- # unionmount only works with util-linux mount
- mount.util-linux $unionmountopts "${unionmountpoint}"
+ do_union ${unionmountpoint} ${cow_dir} ${root_backing} ${rootfs_dir}
- cow_dir="/live/overlay${dir}"
- rootfs_dir="${rootfs}${dir}"
- mkdir -p ${cow_dir}
- if [ -n "${PERSISTENCE_READONLY}" ] && [ "${cowdevice}" != "tmpfs" ]
- then
- do_union ${unionmountpoint} ${cow_dir} ${root_backing} ${rootfs_dir}
- else
- do_union ${unionmountpoint} ${cow_dir} ${rootfs_dir}
- fi
+ do_union ${unionmountpoint} ${cow_dir} ${rootfs_dir}