move most automagic to package installation end

This commit is contained in:
Tobias Powalowski 2022-11-26 11:24:02 +01:00
parent b14b626118
commit 7fcfd6f230
3 changed files with 21 additions and 14 deletions

View file

@ -98,10 +98,6 @@ prepare_storagedrive() {
configure_system() {
destdir_mounts || return 1
## PREPROCESSING ##
auto_pacman_mirror
auto_network
auto_parameters
auto_system_files
auto_mkinitcpio
## END PREPROCESS ##
geteditor || return 1
@ -147,8 +143,6 @@ configure_system() {
if [[ ${S_CONFIG} -eq 1 ]]; then
# only done on normal exit of configure menu
## POSTPROCESSING ##
# adjust time
auto_timesetting
# /etc/initcpio.conf
run_mkinitcpio
DIALOG --infobox "Rebuilding glibc locales ..." 3 40

View file

@ -1,10 +1,10 @@
#!/bin/bash
# created by Tobias Powalowski <tpowa@archlinux.org>
# auto_fstab()
# preprocess fstab file
# comments out old fields and inserts new ones
# according to partitioning/formatting stage
#
auto_fstab(){
# Modify fstab
if [[ "${S_MKFS}" = "1" || "${S_MKFSAUTO}" = "1" ]]; then
@ -21,15 +21,17 @@ auto_fstab(){
fi
}
# auto_ssd()
# add udev rule for schedulers by default
# add sysctl file for swaps
auto_ssd () {
auto_scheduler () {
if [[ ! -f ${DESTDIR}/etc/udev/rules.d/70-ioschedulers.rules ]]; then
DIALOG --infobox "Enable performance ioscheduler settings on installed system ..." 3 70
cp /etc/udev/rules.d/60-ioschedulers.rules "${DESTDIR}"/etc/udev/rules.d/60-ioschedulers.rules
sleep 1
fi
}
# add sysctl file for swaps
auto_swap () {
if [[ ! -f ${DESTDIR}/etc/sysctl.d/99-sysctl.conf ]]; then
DIALOG --infobox "Enable sysctl swap settings on installed system ..." 3 70
cp /etc/sysctl.d/99-sysctl.conf "${DESTDIR}"/etc/sysctl.d/99-sysctl.conf
@ -60,7 +62,7 @@ auto_network()
if [[ ${S_NET} -eq 0 ]]; then
return 1
fi
DIALOG --infobox "Enable netctl network and proxy settings to installed system ..." 3 70
DIALOG --infobox "Enable netctl network and proxy settings on installed system ..." 3 70
# copy netctl profiles
[[ -d ${DESTDIR}/etc/netctl ]] && cp /etc/netctl/* "${DESTDIR}"/etc/netctl/ 2>/dev/null
# enable netctl profiles
@ -152,7 +154,7 @@ auto_mkinitcpio() {
sleep 1
}
auto_parameters() {
auto_vconsole() {
if [[ ! -f ${DESTDIR}/etc/vconsole.conf ]]; then
DIALOG --infobox "Setting keymap and font on installed system ..." 3 70
: >"${DESTDIR}"/etc/vconsole.conf
@ -206,12 +208,15 @@ auto_pacman_mirror() {
fi
}
auto_system_files() {
auto_hostname() {
if [[ ! -f ${DESTDIR}/etc/hostname ]]; then
DIALOG --infobox "Set default hostname on installed system ..." 3 70
echo "myhostname" > "${DESTDIR}"/etc/hostname
sleep 1
fi
}
auto_locale() {
if [[ ! -f ${DESTDIR}/etc/locale.conf ]]; then
DIALOG --infobox "Set default locale on installed system ..." 3 70
echo "LANG=C.UTF-8" > "${DESTDIR}"/etc/locale.conf

View file

@ -175,12 +175,20 @@ install_packages() {
# automagic time!
# any automatic configuration should go here
DIALOG --infobox "Writing base configuration..." 6 40
auto_timesetting
auto_network
auto_fstab
auto_ssd
auto_scheduler
auto_swap
auto_mdadm
auto_luks
auto_pacman
auto_testing
auto_pacman_mirror
auto_vconsole
auto_hostname
auto_locale
auto_mkinitcpio
# tear down the chroot environment
chroot_umount
}