Skip to content

Commit 007462f

Browse files
committed
fix #3
1 parent 41b1d9c commit 007462f

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

src/sbin/init_overlay

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,15 @@ if [ "$DOUPDATE" -eq 1 ]
122122
then
123123
#do update
124124
#merge first
125-
merge_overlay && \
126-
#backup_boot
125+
echo "merging..." && \
126+
merge_overlay $OVERMPOINT / && \
127+
echo "merge done" && \
128+
echo "backing up boot..." && \
127129
backup_boot && \
128-
#create new overlay
130+
echo "backup boot done" && \
131+
echo "recreating overlay..." && \
129132
/sbin/create_overlay && \
133+
echo "recreated overlay" && \
130134
mountall
131135
fi
132136

src/sbin/merge_overlay

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ CONF=${CONF:-/etc/coderbot/init_overlay.conf}
1919
source $CONF #|| fail "ERROR: file not found CONF_FILE: $CONF"
2020

2121
OVERMPOINT=${OVERMPOINT:-$1}
22-
ROMMPOINT=${ROMMPOINT:-$2}
22+
ROMMPOINT=/
2323
REOPTS="rw,remount,rw"
2424
UPPERDIR=${UPPERDIR:-upper}
2525

26-
[ -d $OVERMPOINT ] || fail "ERROR: OVERMPOINT $OVERMPOINT directory not faound"
27-
[ -d $ROMMPOINT ] || fail "ERROR: ROMMPOINT $ROMMPOINT directory not faound"
26+
[ -d $OVERMPOINT ] || fail "ERROR: OVERMPOINT $OVERMPOINT directory not found"
27+
[ -d $ROMMPOINT ] || fail "ERROR: ROMMPOINT $ROMMPOINT directory not found"
2828

2929
mount -o $REOPTS $ROMMPOINT || fail "ERROR: can't remount $ROMMPOINT rw"
3030

@@ -35,6 +35,7 @@ OPAQUE=`getfattr -dm- -R . | perl -le '$lastfile=""; while(<>){if($_ =~ m/^#.*fi
3535
#back to previous dir
3636
cd - || fail "ERROR: can't cd to previous dir (-)"
3737

38+
echo "Removing deleted files"
3839
if [ -z "$REMOVED" ]
3940
then
4041
echo "Nothing to remove"
@@ -46,6 +47,7 @@ else
4647
done <<< $REMOVED
4748
fi
4849

50+
echo "Removing opaque files"
4951
if [ -z "$OPAQUE" ]
5052
then
5153
echo "No opaque to remove"
@@ -56,6 +58,8 @@ else
5658
done <<< $OPAQUE
5759
fi
5860

61+
echo "Copying files from overlay to lower fs"
62+
5963
cp -a "${OVERMPOINT}/${UPPERDIR}/." $ROMMPOINT/ || fail "ERROR in copying files"
6064

6165
echo "Merged ok, now you should clear overlay and backup boot"

0 commit comments

Comments
 (0)