summaryrefslogtreecommitdiffstats
path: root/hooks/usr
blob: 389e14c01d8895e4b1bb1eb37b3f71ca6f0e281c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/ash

run_latehook() {
    local realtab=/new_root/etc/fstab

    if [ -f "$realtab" ]; then
        if usr_source=$(findmnt -snero source --tab-file="$realtab" /usr); then
            mountopts=$(findmnt -snero options --tab-file="$realtab" /usr)
            fsck_device "$usr_source"
            msg ":: mounting '$usr_source' on /usr"
            mount "$usr_source" /new_root/usr -o "$mountopts"
        fi
    fi
}

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