summarylogtreecommitdiffstats
path: root/mkinitcpio-rbd-hook
blob: 9f19d7291e72655f0dec9be510468a483ae661b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/ash

run_hook() {
    msg -n ":: Mapping RBD device..."
    if [ -n "${ip}" -a -n "${rbd}" ]; then
        modprobe rbd
        echo ${rbd//:/ } > /sys/bus/rbd/add_single_major
        if [ -e "/dev/rbd0" ]; then
            msg "Succesfully mounted RBD block device, continuing..."
        else
            msg "Failed to mount the RBD block device, either network is not up, rnd kernel
            parameters are incorrect."
        fi
    else
        msg "Unable to mount RBD block device : Missing ip or rbd kernel parameters."
    fi
}

# vim: set ft=sh ts=4 sw=4 et: