diff options
Diffstat (limited to 'projectroot/lib/init/initmethod-bbinit-functions.sh')
-rwxr-xr-x | projectroot/lib/init/initmethod-bbinit-functions.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/projectroot/lib/init/initmethod-bbinit-functions.sh b/projectroot/lib/init/initmethod-bbinit-functions.sh new file mode 100755 index 000000000..122e37883 --- /dev/null +++ b/projectroot/lib/init/initmethod-bbinit-functions.sh @@ -0,0 +1,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" +} + |