From 6530d52679c301d5a25c07597a971acb1e04c172 Mon Sep 17 00:00:00 2001 From: udeved Date: Thu, 2 Jul 2015 08:52:23 +0200 Subject: [PATCH] [manjaro-chroot][util-mount] fix and clean up --- bin/manjaro-chroot.in | 2 +- lib/util-mount.sh | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/bin/manjaro-chroot.in b/bin/manjaro-chroot.in index 808931e..0427bb6 100644 --- a/bin/manjaro-chroot.in +++ b/bin/manjaro-chroot.in @@ -48,7 +48,7 @@ check_root "$0" "${orig_argv[@]}" if ${automount};then chrootdir=/mnt - chroot_mount_partitions + chroot_mount_partitions $chrootdir else chrootdir=$1 shift diff --git a/lib/util-mount.sh b/lib/util-mount.sh index f627a7b..8164428 100644 --- a/lib/util-mount.sh +++ b/lib/util-mount.sh @@ -27,22 +27,23 @@ get_os(){ chroot_mount_partitions(){ for os in $(get_os);do if [[ "${os##*:}" == 'linux' ]];then + msg "mount ${os##*:} ${os%%:*}" mount ${os%%:*} $1 parse_fstab "$1/etc/fstab" #umount $1 fi done - local m_args=() for entry in ${mounts[@]};do entry=${entry//UUID=} local dev=${entry%:*} - m_args+=("$dev") - if [[ "${entry#*:}" != '/' && "${entry#*:}" != 'none' ]];then - local mp=$1${entry#*:} - m_args+=("$mp") - mount /dev/disk/by-uuid/${m_args[@]} - fi - unset m_args + local mp=$1${entry#*:} + case "${entry#*:}" in + /|/home|swap) continue ;; + *) + msg2 "mount /dev/disk/by-uuid/${dev} ${mp}" + mount /dev/disk/by-uuid/${dev} ${mp} + ;; + esac done }