48 lines
2.0 KiB
Makefile
48 lines
2.0 KiB
Makefile
|
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
|
||
|
|
||
|
postinstall: timesyncd.conf firstboot.start
|
||
|
# Konfigurationen anpassen
|
||
|
cp timesyncd.conf $(CHROOT)/etc/systemd/timesyncd.conf
|
||
|
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
|
||
|
|
||
|
# MariaDB-Konfiguration
|
||
|
cp mariadb/my.cnf $(CHROOT)/etc/mysql/my.cnf
|
||
|
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
|
||
|
find $(CHROOT)/etc/php/apache2-*/ -iname php.ini -print | xargs \sed -i \
|
||
|
-e 's:.*date.timezone =.*:date.timezone = Europe/Berlin:' \
|
||
|
-e 's:.*max_execution_time =.*:max_execution_time = 3600:' \
|
||
|
-e 's:.*max_input_time =.*:max_input_time = 3600:' \
|
||
|
-e 's:.*post_max_size =.*:post_max_size = 8G:' \
|
||
|
-e 's:.*upload_max_filesize =*.:upload_max_filesize = 8G:' \
|
||
|
-e 's:.*always_populate_raw_post_data =.*:always_populate_raw_post_data = -1:'
|
||
|
$(inroot) systemctl enable apache2
|
||
|
|
||
|
clean:
|