diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2017-01-11 11:02:29 +0100 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2017-04-11 11:19:50 +0200 |
commit | 5c7e5b48a39fea528573797e56cc9e6ab8f5abf2 (patch) | |
tree | 2b5414e29235735e9a00cc727e217c6325083611 /projectroot/usr | |
parent | 4d3ab0abcb56a0c93572db357aed857ba0915dd6 (diff) | |
download | ptxdist-5c7e5b48a39fea528573797e56cc9e6ab8f5abf2.tar.gz ptxdist-5c7e5b48a39fea528573797e56cc9e6ab8f5abf2.tar.xz |
initmethod: /usr merge
move initmethod-bbinit-functions.sh
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'projectroot/usr')
-rwxr-xr-x | projectroot/usr/lib/init/initmethod-bbinit-functions.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/projectroot/usr/lib/init/initmethod-bbinit-functions.sh b/projectroot/usr/lib/init/initmethod-bbinit-functions.sh new file mode 100755 index 000000000..122e37883 --- /dev/null +++ b/projectroot/usr/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" +} + |