summaryrefslogtreecommitdiffstats
path: root/modules.d/95iscsi/mount-lun.sh
blob: c1869844eaa91e97d71c00a4c4d92824eab3b015 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh
if [ -z "$iscsi_lun" ]; then
    iscsi_lun=0
fi
NEWROOT=${NEWROOT:-/sysroot}

for disk in /dev/disk/by-path/*-iscsi-*-"$iscsi_lun"; do
    if mount -t "${fstype:-auto}" -o "$rflags" "$disk" "$NEWROOT"; then
        if [ ! -d "$NEWROOT"/proc ]; then
            umount "$disk"
            continue
        fi
        break
    fi
done