Until now we removed everything from /home/grml in the RELEASE
class. The grml-home init script from grml-etc then used to copy
files from /etc/skel to /home/grml during bootup. Instead lets do
this during ISO build time to speed up the boot process. To
ensure that no unwanted files are in /home/grml (actually:
/home/$USERNAME) we remove the directory, recreate it and then
copy all files from /etc/skel.
This fixes the problem that /home/grml is empty and has wrong
permissions if grml-home isn't executed (which is happening
with systemd nowadays where we don't execute grml-home during
bootup).
Closes grml/release-planning#7 @ GH
echo "Removing /var/lib/apt/lists/*-stuff, dpkg-status-old and pkgcache.bin"
rm -f $target/var/lib/apt/lists/*Packages \
echo "Removing /var/lib/apt/lists/*-stuff, dpkg-status-old and pkgcache.bin"
rm -f $target/var/lib/apt/lists/*Packages \
rm -rf $target/root
mkdir -m 0755 $target/root
rm -rf $target/root
mkdir -m 0755 $target/root
-echo "Removing all files inside /home/grml"
-rm -rf $target/home/grml
-mkdir -m 0755 $target/home/grml
+echo "Removing all files inside /home/${USERNAME}"
+rm -rf "${target}/home/${USERNAME}"
+mkdir -m 0755 "${target}/home/${USERNAME}"
+$ROOTCMD chown "${USERNAME}:${USERNAME}" "/home/${USERNAME}"
+
+echo "Syncing /home/${USERNAME}/ with data from /etc/skel/:"
+$ROOTCMD su -s /bin/sh "${USERNAME}" -c "rsync -Hav /etc/skel/ /home/${USERNAME}/"
## END OF FILE #################################################################
# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2
## END OF FILE #################################################################
# vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2