installer_gentoo/sysconfig.sh

32 lines
1.4 KiB
Bash

#!/bin/bash
set -eu
# configuration du système
# Franciser la gentoo
echo "Europe/Paris" > $CHROOT/etc/timezone
echo "fr_FR.UTF-8 UTF-8" >> $CHROOT/etc/locale.gen
chroot $CHROOT /bin/bash -c "locale-gen"
echo 'LANG="fr_FR.UTF-8"' > $CHROOT/etc/env.d/02locale
echo 'LC_COLLATE="C"' >> $CHROOT/etc/env.d/02locale
sed -i 's/keymap="us"/keymap="fr"/g' $CHROOT/etc/conf.d/keymaps
# Configuration réseau et activation de(s) interface(s) réseau au démarrage ainsi que le serveur SSH
cp /etc/resolv.conf $CHROOT/etc/resolv.conf
echo "127.0.0.1 localhost" > $CHROOT/etc/hosts
echo "::1 localhost" >> $CHROOT/etc/hosts
echo "127.0.1.1 $MYHOSTNAME.$MYDOMAIN $MYHOSTNAME" >> $CHROOT/etc/hosts
echo hostname='"'$MYHOSTNAME'"' > $CHROOT/etc/conf.d/hostname
for interfaces in `ls /sys/class/net | sed /lo/d`
do
chroot $CHROOT /bin/bash -c "ln -s /etc/init.d/net.lo /etc/init.d/net.$interfaces"
chroot $CHROOT /bin/bash -c "rc-update add net.$interfaces default"
done
chroot $CHROOT /bin/bash -c "rc-update add sshd default"
# Configuration de fstab
echo "$SYS / ext4 noatime 0 1" > $CHROOT/etc/fstab
echo "$SWAP none swap sw 0 0" >> $CHROOT/etc/fstab
echo "/dev/cdrom /mnt/cdrom auto noauto,ro 0 0" >> $CHROOT/etc/fstab
# ajout de l'utilisateur
chroot $CHROOT /bin/bash -c "useradd -p \`openssl passwd -1 $PASSWORD\` -G wheel $USER"