Commit 5f06a4dd authored by udeved's avatar udeved

util-iso-mount: use only one overlay mount function

parent bb34a7f6
......@@ -35,32 +35,75 @@ track_fs() {
}
# $1: new branch
mount_fs_root(){
FS_ACTIVE_MOUNTS=()
mkdir -p "${mnt_dir}/work"
mkdir -p "$1"
track_fs -t overlay overlay -olowerdir="${work_dir}/rootfs",upperdir="$1",workdir="${mnt_dir}/work" "$1"
}
mount_fs_desktop(){
FS_ACTIVE_MOUNTS=()
mkdir -p "${mnt_dir}/work"
mkdir -p "$1"
track_fs -t overlay overlay -olowerdir="${work_dir}/desktopfs":"${work_dir}/rootfs",upperdir="$1",workdir="${mnt_dir}/work" "$1"
}
mount_fs_live(){
FS_ACTIVE_MOUNTS=()
mkdir -p "${mnt_dir}/work"
mkdir -p "$1"
track_fs -t overlay overlay -olowerdir="${work_dir}/livefs":"${work_dir}/desktopfs":"${work_dir}/rootfs",upperdir="$1",workdir="${mnt_dir}/work" "$1"
}
# mount_fs_root(){
# FS_ACTIVE_MOUNTS=()
# mkdir -p "${mnt_dir}/work"
# mkdir -p "$1"
# track_fs -t overlay overlay -olowerdir="${work_dir}/rootfs",upperdir="$1",workdir="${mnt_dir}/work" "$1"
# }
#
# mount_fs_desktop(){
# FS_ACTIVE_MOUNTS=()
# mkdir -p "${mnt_dir}/work"
# mkdir -p "$1"
# track_fs -t overlay overlay -olowerdir="${work_dir}/desktopfs":"${work_dir}/rootfs",upperdir="$1",workdir="${mnt_dir}/work" "$1"
# }
#
# mount_fs_live(){
# FS_ACTIVE_MOUNTS=()
# mkdir -p "${mnt_dir}/work"
# mkdir -p "$1"
# track_fs -t overlay overlay -olowerdir="${work_dir}/livefs":"${work_dir}/desktopfs":"${work_dir}/rootfs",upperdir="$1",workdir="${mnt_dir}/work" "$1"
# }
#
# mount_fs_net(){
# FS_ACTIVE_MOUNTS=()
# mkdir -p "${mnt_dir}/work"
# mkdir -p "$1"
# track_fs -t overlay overlay -olowerdir="${work_dir}/livefs":"${work_dir}/rootfs",upperdir="$1",workdir="${mnt_dir}/work" "$1"
# }
#
# mount_fs_select(){
# local fs="$1" pkglist="$2"
# if [[ -f "$pkglist" ]]; then
# mount_fs_desktop "$fs"
# else
# mount_fs_root "$fs"
# fi
# }
#
# mount_fs_select_boot(){
# local fs="$1" pkglist="$2"
# if [[ -f "$pkglist" ]]; then
# mount_fs_live "$fs"
# else
# mount_fs_net "$fs"
# fi
# }
mount_fs_net(){
mount_fs(){
FS_ACTIVE_MOUNTS=()
local lower= upper="$1" work="$2" pkglist="$3"
local fs=${upper##*/}
local rootfs="$work/rootfs" desktopfs="$work/desktopfs" livefs="$work/livefs"
mkdir -p "${mnt_dir}/work"
mkdir -p "$1"
track_fs -t overlay overlay -olowerdir="${work_dir}/livefs":"${work_dir}/rootfs",upperdir="$1",workdir="${mnt_dir}/work" "$1"
mkdir -p "$upper"
case $fs in
desktopfs) lower="$rootfs" ;;
livefs|mhwdfs)
lower="$rootfs"
if [[ -f $pkglist ]];then
lower="$desktopfs":"$rootfs"
fi
;;
bootfs)
lower="$livefs":"$rootfs"
if [[ -f $pkglist ]];then
lower="$livefs":"$desktopfs":"$rootfs"
fi
;;
esac
track_fs -t overlay overlay -olowerdir="$lower",upperdir="$upper",workdir="${mnt_dir}/work" "$upper"
}
umount_fs(){
......
......@@ -305,7 +305,7 @@ make_image_desktop() {
prepare_dir "${desktopfs}"
mount_fs_root "${desktopfs}"
mount_fs "${desktopfs}" "${work_dir}"
create_chroot "${mkchroot_args[@]}" "${desktopfs}" "${packages[@]}"
......@@ -322,15 +322,6 @@ make_image_desktop() {
fi
}
mount_fs_select(){
local fs="$1"
if [[ -f "${desktop_list}" ]]; then
mount_fs_desktop "$fs"
else
mount_fs_root "$fs"
fi
}
make_image_live() {
if [[ ! -e ${work_dir}/livefs.lock ]]; then
msg "Prepare [Live installation] (livefs)"
......@@ -338,7 +329,7 @@ make_image_live() {
prepare_dir "${livefs}"
mount_fs_select "${livefs}"
mount_fs "${livefs}" "${work_dir}" "${desktop_list}"
create_chroot "${mkchroot_args[@]}" "${livefs}" "${packages[@]}"
......@@ -363,7 +354,7 @@ make_image_mhwd() {
prepare_dir "${mhwdfs}${mhwd_repo}"
mount_fs_select "${mhwdfs}"
mount_fs "${mhwdfs}" "${work_dir}" "${desktop_list}"
reset_pac_conf "${mhwdfs}"
......@@ -396,11 +387,7 @@ make_image_boot() {
local bootfs="${work_dir}/bootfs"
if [[ -f "${desktop_list}" ]]; then
mount_fs_live "${bootfs}"
else
mount_fs_net "${bootfs}"
fi
mount_fs "${bootfs}" "${work_dir}" "${desktop_list}"
prepare_initcpio "${bootfs}"
prepare_initramfs "${bootfs}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment