util-iso-cal: write netinstall.conf

shorter write function names
This commit is contained in:
udeved 2016-07-30 21:31:07 +02:00
parent e037b47597
commit f65c227bef
2 changed files with 32 additions and 22 deletions

View file

@ -9,7 +9,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
write_calamares_machineid_conf(){ write_machineid_conf(){
local conf="$1/etc/calamares/modules/machineid.conf" local conf="$1/etc/calamares/modules/machineid.conf"
if [[ ${initsys} == 'openrc' ]];then if [[ ${initsys} == 'openrc' ]];then
echo "systemd: false" > $conf echo "systemd: false" > $conf
@ -22,7 +22,7 @@ write_calamares_machineid_conf(){
fi fi
} }
write_calamares_finished_conf(){ write_finished_conf(){
local conf="$1/etc/calamares/modules/finished.conf" local conf="$1/etc/calamares/modules/finished.conf"
echo '---' > "$conf" echo '---' > "$conf"
echo 'restartNowEnabled: true' >> "$conf" echo 'restartNowEnabled: true' >> "$conf"
@ -34,7 +34,7 @@ write_calamares_finished_conf(){
fi fi
} }
write_calamares_bootloader_conf(){ write_bootloader_conf(){
source "$1/etc/mkinitcpio.d/${kernel}.preset" source "$1/etc/mkinitcpio.d/${kernel}.preset"
local conf="$1/etc/calamares/modules/bootloader.conf" local conf="$1/etc/calamares/modules/bootloader.conf"
echo '---' > "$conf" echo '---' > "$conf"
@ -51,7 +51,7 @@ write_calamares_bootloader_conf(){
echo '#efiBootloaderId: "dirname"' >> "$conf" echo '#efiBootloaderId: "dirname"' >> "$conf"
} }
write_calamares_services_conf(){ write_services_conf(){
local conf="$1/etc/calamares/modules/services.conf" local conf="$1/etc/calamares/modules/services.conf"
echo '---' > "$conf" echo '---' > "$conf"
echo '' >> "$conf" echo '' >> "$conf"
@ -92,7 +92,7 @@ write_calamares_services_conf(){
fi fi
} }
write_calamares_displaymanager_conf(){ write_displaymanager_conf(){
local conf="$1/etc/calamares/modules/displaymanager.conf" local conf="$1/etc/calamares/modules/displaymanager.conf"
echo "displaymanagers:" > "$conf" echo "displaymanagers:" > "$conf"
echo " - ${displaymanager}" >> "$conf" echo " - ${displaymanager}" >> "$conf"
@ -106,13 +106,13 @@ write_calamares_displaymanager_conf(){
echo "basicSetup: false" >> "$conf" echo "basicSetup: false" >> "$conf"
} }
write_calamares_initcpio_conf(){ write_initcpio_conf(){
local conf="$1/etc/calamares/modules/initcpio.conf" local conf="$1/etc/calamares/modules/initcpio.conf"
echo "---" > "$conf" echo "---" > "$conf"
echo "kernel: ${kernel}" >> "$conf" echo "kernel: ${kernel}" >> "$conf"
} }
write_calamares_unpack_conf(){ write_unpack_conf(){
local conf="$1/etc/calamares/modules/unpackfs.conf" local conf="$1/etc/calamares/modules/unpackfs.conf"
echo "---" > "$conf" echo "---" > "$conf"
echo "unpack:" >> "$conf" echo "unpack:" >> "$conf"
@ -126,7 +126,7 @@ write_calamares_unpack_conf(){
fi fi
} }
write_calamares_users_conf(){ write_users_conf(){
local conf="$1/etc/calamares/modules/users.conf" local conf="$1/etc/calamares/modules/users.conf"
echo "---" > "$conf" echo "---" > "$conf"
echo "userGroup: users" >> "$conf" echo "userGroup: users" >> "$conf"
@ -141,13 +141,13 @@ write_calamares_users_conf(){
echo "setRootPassword: true" >> "$conf" echo "setRootPassword: true" >> "$conf"
} }
write_calamares_packages_conf(){ write_packages_conf(){
local conf="$1/etc/calamares/modules/packages.conf" local conf="$1/etc/calamares/modules/packages.conf"
echo "---" > "$conf" echo "---" > "$conf"
echo "backend: pacman" >> "$conf" echo "backend: pacman" >> "$conf"
} }
write_calamares_welcome_conf(){ write_welcome_conf(){
local conf="$1/etc/calamares/modules/welcome.conf" local conf="$1/etc/calamares/modules/welcome.conf"
echo "---" > "$conf" >> "$conf" echo "---" > "$conf" >> "$conf"
echo "showSupportUrl: true" >> "$conf" echo "showSupportUrl: true" >> "$conf"
@ -170,7 +170,7 @@ write_calamares_welcome_conf(){
${cal_netinstall} && echo " - internet" >> "$conf" ${cal_netinstall} && echo " - internet" >> "$conf"
} }
write_calamares_settings_conf(){ write_settings_conf(){
local conf="$1/etc/calamares/settings.conf" local conf="$1/etc/calamares/settings.conf"
echo "---" > "$conf" echo "---" > "$conf"
echo "modules-search: [ local ]" >> "$conf" echo "modules-search: [ local ]" >> "$conf"
@ -229,29 +229,37 @@ write_calamares_settings_conf(){
echo "dont-chroot: false" >> "$conf" echo "dont-chroot: false" >> "$conf"
} }
write_netinstall_conf(){
local conf="$1/etc/calamares/modules/netinstall.conf"
echo "---" > "$conf"
echo "groupsUrl: ${cal_grp_url}"
}
configure_calamares(){ configure_calamares(){
msg2 "Configuring Calamares ..." msg2 "Configuring Calamares ..."
mkdir -p $1/etc/calamares/modules mkdir -p $1/etc/calamares/modules
write_calamares_settings_conf "$1" write_settings_conf "$1"
write_calamares_welcome_conf "$1" write_welcome_conf "$1"
write_calamares_packages_conf "$1" write_packages_conf "$1"
write_calamares_bootloader_conf "$1" write_bootloader_conf "$1"
write_calamares_unpack_conf "$1" write_unpack_conf "$1"
write_calamares_displaymanager_conf "$1" write_displaymanager_conf "$1"
write_calamares_initcpio_conf "$1" write_initcpio_conf "$1"
write_calamares_machineid_conf "$1" write_machineid_conf "$1"
write_calamares_finished_conf "$1" write_finished_conf "$1"
write_calamares_services_conf "$1" write_netinstall_conf "$1"
write_calamares_users_conf "$1"
write_services_conf "$1"
write_users_conf "$1"
} }

View file

@ -449,6 +449,8 @@ load_profile_config(){
[[ -z ${cal_unpackfs} ]] && cal_unpackfs='true' [[ -z ${cal_unpackfs} ]] && cal_unpackfs='true'
[[ -z ${cal_grp_url} ]] && cal_grp_url="https://raw.githubusercontent.com/calamares/calamares-manjaro/master/netinstall.yaml"
check_profile_vars check_profile_vars
return 0 return 0