Remounting rw/ro file systems.

This commit is contained in:
Kolan Sh 2012-08-09 18:23:28 +04:00
parent f233ec5278
commit 1e8601c164
2 changed files with 25 additions and 1 deletions

View File

@ -1,2 +1,4 @@
EGENCACHE=FALSE
ECLEAN_DISTFILES=FALSE
RW_REMOUNT='/usr'
RO_REMOUNT='/usr'

View File

@ -1,6 +1,6 @@
#!/bin/bash
STAGE=1
STAGE=0
source /etc/make.conf
[ -f /etc/gentoo-upgrade.conf ] && source /etc/gentoo-upgrade.conf
@ -44,6 +44,17 @@ function in_list()
TRUE_LIST=(TRUE True true YES Yes yes 1)
FALSE_LIST=(FALSE False false NO No no 0)
# Stage 0: remounting file systems ro->rw
if [ 0 -eq $STAGE ]; then
echo "======= STAGE $STAGE: remounting file systems ro->rw ======="
for fs in $RW_REMOUNT; do
mount -o remount,rw $fs
[ 0 -ne $? ] && echo "Stage $STAGE: mount -o remount,rw $fs failed ;-( =======" && exit $STAGE
done
let STAGE++
fi
# Stage 1: sync portage tree
if [ 1 -eq $STAGE ]; then
echo "======= STAGE $STAGE: sync portage tree ======="
@ -419,4 +430,15 @@ if [ 19 -eq $STAGE ]; then
let STAGE++
fi
# Stage 20: remounting file systems rw->ro
if [ 20 -eq $STAGE ]; then
echo "======= STAGE $STAGE: remounting file systems rw->ro ======="
for fs in $RO_REMOUNT; do
mount -o remount,ro $fs
[ 0 -ne $? ] && echo "Stage $STAGE: mount -o remount,ro $fs failed ;-( =======" && exit $STAGE
done
let STAGE++
fi
exit 0