2017-07-26 21:31:31 +02:00
|
|
|
preinstall:
|
|
|
|
# switch to hardened, build hardened toolchain, rebuild everything
|
|
|
|
mkdir -p $(CHROOT)/etc/portage/profile
|
|
|
|
echo "-hardened" >> $(CHROOT)/etc/portage/profile/use.mask
|
|
|
|
$(inroot) $(EMERGE) $(USEPKG) --oneshot gcc
|
|
|
|
$(inroot) $(EMERGE) $(USEPKG) --oneshot binutils virtual/libc
|
|
|
|
-$(gcc_config)
|
|
|
|
$(inroot) $(EMERGE) $(USEPKG) --emptytree @world
|
|
|
|
$(inroot) bash -c 'yes YES | etc-update --automode -9'
|
|
|
|
|
|
|
|
# Unitas-Portage-Overlay einbinden
|
|
|
|
$(inroot) $(EMERGE) -n $(USEPKG) app-portage/layman
|
|
|
|
sed -i 's/check_official : Yes/check_official : No/' $(CHROOT)/etc/layman/layman.cfg
|
|
|
|
wget -P $(CHROOT)/etc/layman/overlays http://dev.unitas-network.de/raw/Gentoo/Unitas.git/master/unitas-overlays.xml
|
|
|
|
$(inroot) layman -l | grep -q unitas || $(inroot) layman -La unitas
|
|
|
|
|
2018-09-16 10:00:30 +02:00
|
|
|
postinstall: timesyncd.conf firstboot.start
|
2017-07-26 21:31:31 +02:00
|
|
|
# Konfigurationen anpassen
|
|
|
|
cp timesyncd.conf $(CHROOT)/etc/systemd/timesyncd.conf
|
2018-09-16 10:00:30 +02:00
|
|
|
mkdir -p $(CHROOT)/etc/local.d
|
2017-07-26 21:31:31 +02:00
|
|
|
cp firstboot.start $(CHROOT)/etc/local.d/firstboot.start
|
|
|
|
touch $(CHROOT)/firstboot
|
|
|
|
sed -i 's/# %wheel ALL=(ALL) ALL/%wheel ALL=(ALL) ALL/' $(CHROOT)/etc/sudoers
|
|
|
|
$(inroot) useradd -m -G users,wheel -s /bin/bash admin
|
|
|
|
$(inroot) passwd -d admin; $(inroot) passwd -e admin
|
|
|
|
$(inroot) systemctl enable screen@adm.service
|
|
|
|
|
|
|
|
# Beispiel feste IP-Adresse
|
|
|
|
cp 00-eth0.network $(CHROOT)/00-eth0.network.example
|
|
|
|
|
2019-07-07 13:54:56 +02:00
|
|
|
# MariaDB-Konfiguration ($$, weil make ein $ entfernt)
|
|
|
|
sed -i "s/^character-set-server.*$$/character-set-server = utf8mb4\ncollation-server = utf8mb4_general_ci\ntransaction_isolation = READ-COMMITTED\nbinlog_format = ROW\nexpire_logs_days = 3/" $(CHROOT)/etc/mysql/my.cnf
|
|
|
|
sed -i "s/^innodb_file_per_table.*$$/innodb_file_per_table=1\ninnodb_file_format=barracuda\ninnodb_large_prefix=on/" $(CHROOT)/etc/mysql/my.cnf
|
|
|
|
sed -i "s/default-character-set=utf8/default-character-set=utf8mb4/" $(CHROOT)/etc/mysql/my.cnf
|
2017-07-26 21:31:31 +02:00
|
|
|
cp mariadb/my.cnf.root $(CHROOT)/root/.my.cnf
|
|
|
|
chmod 0600 $(CHROOT)/root/.my.cnf
|
|
|
|
rm -rf $(CHROOT)/var/lib/mysql/*
|
|
|
|
$(inroot) bash -c 'yes gentoo | emerge --config dev-db/mariadb'
|
|
|
|
|
|
|
|
# Apache-/PHP-Konfiguration
|
|
|
|
sed -i 's:APACHE2_OPTS=\":APACHE2_OPTS=\"-D WSGI :' $(CHROOT)/etc/conf.d/apache2
|
|
|
|
cp apache/00_default_ssl_vhost.conf $(CHROOT)/etc/apache2/vhosts.d/
|
|
|
|
$(inroot) systemctl enable apache2
|
|
|
|
|
|
|
|
# privacyIDEA Konfiguration (eigene Voreinstellungen)
|
|
|
|
cp privacyidea/enckey $(CHROOT)/etc/privacyidea/
|
|
|
|
cp privacyidea/pi.cfg $(CHROOT)/etc/privacyidea/
|
|
|
|
cp privacyidea/private.pem $(CHROOT)/etc/privacyidea/
|
|
|
|
cp privacyidea/public.pem $(CHROOT)/etc/privacyidea/
|
|
|
|
cp privacyidea/openssl.cnf $(CHROOT)/etc/privacyidea/CA/
|
|
|
|
$(inroot) chown -R privacyidea:root /etc/privacyidea
|
|
|
|
chmod 600 $(CHROOT)/etc/privacyidea/enckey
|
|
|
|
chmod 600 $(CHROOT)/etc/privacyidea/private.pem
|
|
|
|
touch $(CHROOT)/var/log/privacyidea/privacyidea.log
|
|
|
|
$(inroot) chown privacyidea:root /var/log/privacyidea/privacyidea.log
|
|
|
|
|
|
|
|
# FreeRADIUS-Konfiguration
|
|
|
|
sed -i 's:filename = .*:filename = /usr/lib/privacyidea/authmodules/FreeRADIUS/privacyidea_radius.pm:' $(CHROOT)/etc/raddb/mods-available/perl
|
|
|
|
ln -s ../mods-available/perl $(CHROOT)/etc/raddb/mods-enabled/perl
|
|
|
|
cp freeradius/privacyidea $(CHROOT)/etc/raddb/sites-available/
|
|
|
|
$(inroot) chown root:radius /etc/raddb/sites-available/privacyidea
|
|
|
|
chmod 640 $(CHROOT)/etc/raddb/sites-available/privacyidea
|
2017-09-12 09:28:04 +02:00
|
|
|
cp freeradius/dictionary.netknights $(CHROOT)/etc/raddb/dictionary
|
|
|
|
$(inroot) chown root:radius /etc/raddb/dictionary
|
|
|
|
chmod 640 $(CHROOT)/etc/raddb/dictionary
|
2017-07-26 21:31:31 +02:00
|
|
|
rm $(CHROOT)/etc/raddb/mods-enabled/eap
|
|
|
|
rm $(CHROOT)/etc/raddb/sites-enabled/*
|
|
|
|
ln -s ../sites-available/privacyidea $(CHROOT)/etc/raddb/sites-enabled/privacyidea
|
|
|
|
mv $(CHROOT)/etc/raddb/dictionary $(CHROOT)/etc/raddb/dictionary.orig
|
|
|
|
cp $(CHROOT)/etc/privacyidea/dictionary $(CHROOT)/etc/raddb/
|
|
|
|
$(inroot) systemctl enable freeradius
|
|
|
|
|
|
|
|
clean:
|