From f2ebfa66006603f4e49a1db22bee60ecdb662397 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 24 Feb 2017 13:10:18 +0100 Subject: [PATCH] Create /home/$USERNAME in RELEASE class with up2date files from /etc/skel 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 --- etc/grml/fai/config/scripts/RELEASE/98-clean-chroot | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/etc/grml/fai/config/scripts/RELEASE/98-clean-chroot b/etc/grml/fai/config/scripts/RELEASE/98-clean-chroot index 06dfe69..626267f 100755 --- a/etc/grml/fai/config/scripts/RELEASE/98-clean-chroot +++ b/etc/grml/fai/config/scripts/RELEASE/98-clean-chroot @@ -8,7 +8,7 @@ set -u set -e - +. "$GRML_LIVE_CONFIG" echo "Removing /var/lib/apt/lists/*-stuff, dpkg-status-old and pkgcache.bin" rm -f $target/var/lib/apt/lists/*Packages \ @@ -32,9 +32,13 @@ echo "Removing all files inside /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 -- 2.1.4