mutable for rm, use mkhomedir_helper

This commit is contained in:
Christopher Laprise 2019-07-30 23:25:35 -04:00
parent 302c968313
commit 55181dc2dd
No known key found for this signature in database
GPG Key ID: 448568C8B281C952
2 changed files with 17 additions and 9 deletions

3
ibrowse.whitelist Normal file
View File

@ -0,0 +1,3 @@
/rw/home/user/.mozilla/firefox/profile.default/places.sqlite
/rw/home/user/.mozilla/firefox/profile.default/places.sqlite-shm
/rw/home/user/.mozilla/firefox/profile.default/places.sqlite-wal

View File

@ -134,11 +134,11 @@ if qsvc vm-boot-protect || qsvc vm-boot-protect-root; then
fi fi
fi fi
# Don't bother with root protections in template or standalone # Don't bother with root protections in template or standalone
if ! is_rwonly_persistent; then if ! is_rwonly_persistent; then
make_immutable make_immutable
exit 0 exit 0
fi fi
fi fi
@ -191,19 +191,24 @@ if qsvc vm-boot-protect-root && is_rwonly_persistent; then
subdir=`echo $dir |sed -r 's|^/rw/||'` subdir=`echo $dir |sed -r 's|^/rw/||'`
bakdir="$rwbak/BAK-$subdir" bakdir="$rwbak/BAK-$subdir"
origdir="$rwbak/ORIG-$subdir" origdir="$rwbak/ORIG-$subdir"
if [ -d "$bakdir" ] && [ ! -d "$origdir" ]; then if [ -e "$bakdir" ] && [ ! -e "$origdir" ]; then
mv "$bakdir" "$origdir" mv "$bakdir" "$origdir"
fi fi
rm -rf "$bakdir" if [ -e "$bakdir" ]; then
chattr -R -i "$bakdir"
rm -rf "$bakdir"
fi
mv "$rw/$subdir" "$bakdir" mv "$rw/$subdir" "$bakdir"
mkdir -p "$rw/$subdir" mkdir -p "$rw/$subdir"
# Populate /home/user w skel files if it was in privdirs # Populate /home/user w skel files if it was in privdirs
case "$subdir" in case "$subdir" in
"home"|"home/"|"home/user"|"home/user/") "home"|"home/"|"home/user"|"home/user/")
mkdir -p $rw/home/user echo "Populating home dir"
cp -aT /etc/skel $rw/home/user #chown user:user $rw/home/user
chown -R user:user $rw/home/user rm -rf /home/user $rw/home/user
mkhomedir_helper user
mv /home/user $rw/home
;; ;;
esac esac
done done