On Wed, Mar 10, 2021 at 11:41:46AM +0800, Xu Xijian wrote:
On Fri, Mar 05, 2021 at 04:59:54PM +0800, Yu Chuan wrote:
Signed-off-by: Yu Chuan 13186087857@163.com
distro/depends/install-iso-release | 2 ++ tests/install-iso-release | 53 +++++++++++++++++++++++++++++-
tests/install-iso-release => tests/install-iso-sync-rootfs
ok
release_rootfs() {
- :
- # mount nfs rootfs
- local nfs_rootfs_mount_point=/tmp/nfs_rootfs_${ROOTFS_SUFFIX}
- mkdir -p ${nfs_rootfs_mount_point}
- mount -t nfs ${NFS_SERVER_HOST}:${NFS_ROOT_DIR}/${os}/${os_arch}/${os_version}-iso-${ROOTFS_SUFFIX} ${nfs_rootfs_mount_point} || die "mount nfs rootfs failed"
- # activate the lvm
- vgchange -ay
- # mount local logical volume
- local lv_rootfs_mount_point=/tmp/lv_rootfs_${ROOTFS_SUFFIX}
- mkdir -p ${lv_rootfs_mount_point}
- mount /dev/mapper/${VG_NAME}-${iso_os}_${iso_arch}_${iso_version}_${ROOTFS_SUFFIX} ${lv_rootfs_mount_point} || die "mount lv rootfs failed"
- # release rootfs
comment => sync rootfs to nfs server
ok
-------- Thanks Yu Chuan
Thanks, Xijian
- local exclude_file=/tmp/exclude_file_${ROOTFS_SUFFIX}
- prepare_exclude_file "$exclude_file"
- rsync -az ${lv_rootfs_mount_point}/. ${nfs_rootfs_mount_point} --exclude-from=$exclude_file || die "copy out rootfs failed"
- cd ${nfs_rootfs_mount_point} && mkdir -p "${SKIP_RELEASE_DIRS[@]}"
- # umount nfs rootfs
- umount $nfs_rootfs_mount_point || log_warn "umount failed: nfs_rootfs_mount_point"
- # umount local logical volume
- umount $lv_rootfs_mount_point || log_warn "umount failed: $lv_rootfs_mount_point"
}
main()
2.23.0