summaryrefslogtreecommitdiffstats
path: root/projectroot/lib/init/initmethod-bbinit-functions.sh
blob: 122e378838e3f7b03ca735b9760e7419b430593b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh

#
# generic functions for bbinit
#

mount_root_rw() {

    touch "/.root_is_rw" > /dev/null 2>&1 && return

    echo -n "remounting root rw..."
    mount /dev/root / -n -o remount,rw > /dev/null 2>&1
    if [ "$?" -ne "0" ]; then
        echo "failed, aborting"
        return 1
    fi
    echo "done"
}

mount_root_restore() {

    rm "/.root_is_rw" > /dev/null 2>&1 && return

    echo -n "remounting root ro..."
    mount /dev/root / -n -o remount,ro > /dev/null 2>&1
    if [ "$?" -ne "0" ]; then
        echo "failed, aborting"
        return 1
    fi
    echo "done"
}