mkimage-profiles/features.in/dev/live/image-scripts.d/40-hasher
Michael Shigorin 809ae4d9e8 live-builder: minor fixes
su wasn't making it into the image breaking ~/.git setup,
and there's no reason for a full default boot timeout either.
2012-07-16 18:24:18 +03:00

45 lines
1.1 KiB
Bash
Executable File

#!/bin/sh -efu
# configure hasher (implies that 30-users has been run already)
# predefined passwordless livecd user
USER="altlinux"
if ! id "$USER" >&/dev/null; then
echo "No such user '$USER'" >&2
exit
fi
# ~
HOME="/home/$USER"
install -dm750 -o "$USER" -g "$USER" "$HOME"
# we honestly don't know much more
if type -t git && type -t su; then
su - -c "git config --global user.email $USER@localhost" "$USER"
su - -c "git config --global user.name 'live builder'" "$USER"
fi >&/dev/null
# developer should feel comfortable, eh? ;-)
ZSHELL="/bin/zsh"
if [ -x "$ZSHELL" ]; then
chsh -s "$ZSHELL" "$USER"
install -m755 -o "$USER" -g "$USER" /dev/null "$HOME/.zshrc"
echo "mkdir -p \"\$TMP/hasher\"" >> "$HOME/.zshrc"
fi
# $TMP
TMP="/tmp/.private/$USER"
control pam_mktemp enabled
sed -i '/^%_tmppath.*tmp$/d' "$HOME/.rpmmacros"
echo "%_tmppath $TMP" >> "$HOME/.rpmmacros"
# ~/hasher
WORKDIR="$TMP/hasher"
ln -s "$TMP/hasher" "$HOME/hasher"
# online repo needs network not isolation
echo "export share_network=1" >> /etc/profile.d/hasher.sh
chmod +x /etc/profile.d/hasher.sh
# requisite
hasher-useradd "$USER"