copy activated module to storage (memory) before activation

pull/40/head
TomasM 2017-11-12 16:01:46 -05:00
parent 09cb84bda4
commit 6e3ec50c36
1 changed files with 13 additions and 9 deletions

View File

@ -73,16 +73,20 @@ activate()
usage "file not found $SB" usage "file not found $SB"
fi fi
# check if file is in aufs union - if yes, move outside # copy the module to storage dir so it can be activated from there
if [ -r "$LIVE/changes/$SB" ]; then
TGT="$(get_bundle_storage_dir)" TGT="$(get_bundle_storage_dir)"
echo "File stored inside AUFS filesystem couldn't be activated, moving to $TGT, then activating from there"
mv -n "$SB" "$TGT/$BAS" if [ -r $TGT/$BAS ]; then
die "File exists: $TGT/$BAS"
fi
cp -n "$SB" "$TGT/$BAS"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
die "Error moving file to $TGT/$BAS. Not enough space or target already exists" die "Error copying file to $TGT/$BAS. Not enough space?"
fi fi
SB="$TGT/$BAS" SB="$TGT/$BAS"
fi
# check if this particular file is already activated # check if this particular file is already activated
if print_branches | cut -f 2 | fgrep -q "$SB"; then if print_branches | cut -f 2 | fgrep -q "$SB"; then