diff --git a/sh/alias/overlay.sh b/sh/alias/overlay.sh index 82fe273..9418f75 100644 --- a/sh/alias/overlay.sh +++ b/sh/alias/overlay.sh @@ -1,3 +1,25 @@ +obm() { a__overlay_bind_mount "${@}"; } +a__overlay_bind_mount() { + local directory + for directory in "dev" "dev/pts" "proc" "sys"; do + if ! mount --bind "/${directory}" "overlay/mount/${directory}"; then + sh_log_error "Unable to bind mount directory: ${directory}" + return 1 + fi + done +} + +obu() { a__overlay_bind_unmount "${@}"; } +a__overlay_bind_unmount() { + local directory + for directory in "sys" "proc" "dev/pts" "dev"; do + if ! umount --lazy "overlay/mount/${directory}"; then + sh_log_error "Unable to bind unmount directory: ${directory}" + return 1 + fi + done +} + orm() { a__overlay_root_mount "${@}"; } a__overlay_root_mount() { local root="${1}" @@ -74,17 +96,6 @@ a__overlay_root_unmount() { fi } -obm() { a__overlay_bind_mount "${@}"; } -a__overlay_bind_mount() { - local directory - for directory in "dev" "dev/pts" "proc" "sys"; do - if ! mount --bind "/${directory}" "overlay/mount/${directory}"; then - sh_log_error "Unable to bind mount directory: ${directory}" - return 1 - fi - done -} - ocr() { a__overlay_command_root "${@}"; } a__overlay_command_root() { chroot \ @@ -98,17 +109,6 @@ a__overlay_command_user() { "overlay/mount" "${@}" } -obu() { a__overlay_bind_unmount "${@}"; } -a__overlay_bind_unmount() { - local directory - for directory in "sys" "proc" "dev/pts" "dev"; do - if ! umount --lazy "overlay/mount/${directory}"; then - sh_log_error "Unable to bind unmount directory: ${directory}" - return 1 - fi - done -} - omm() { a__overlay_mirror_mount "${@}"; } a__overlay_mirror_mount() { mount --make-rslave --rbind "/deb" "overlay/mount/deb"