[manjaro-chroot][util-mount] fix and clean up

This commit is contained in:
udeved 2015-07-02 08:52:23 +02:00
parent 5b8a0e9689
commit 6530d52679
2 changed files with 10 additions and 9 deletions

View file

@ -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

View file

@ -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
}