echo
log "Generating network configuration ..."
- local temp_dir=$( mktemp -d 'tmp.XXXXXXXXXX.cobbler' )
+ local temp_dir=$( mktemp -p /tmp -d 'tmp.XXXXXXXXXX.cobbler' )
local tmp_nw_cfg="${temp_dir}/network"
local tmp_nw_script_dir="${temp_dir}/network-scripts"
- local old_dir="/etc/sysconfig/network/network-scripts/.old"
+ local nw_script_dir="/etc/sysconfig/network-scripts"
+ local old_dir="${nw_script_dir}/.old"
local ifcfg_file=
mkdir -pv "${tmp_nw_script_dir}"
EOF
- for ifcfg_file in /etc/sysconfig/network-scripts/ifcfg-* ; do
+ for ifcfg_file in ${nw_script_dir}/ifcfg-* ; do
local bname=$(basename "${ifcfg_file}" )
if [[ "${bname}" == "ifcfg-lo" ]] ; then
continue
fi
mv -v "${ifcfg_file}" "${old_dir}"
done
- mv -v "${dev_file}" "/etc/sysconfig/network/network-scripts"
+ mv -v "${dev_file}" "${nw_script_dir}"
rm -vf "${temp_dir}"
}
+#-----------------------------------------------------------
+tweak_systemd() {
+
+ echo
+ log "Tweaking systemd ..."
+
+ local sdir="/etc/systemd/system"
+ local getty_dir_tgt="${sdir}/getty.target.wants"
+ local getty_dir_at="${sdir}/getty@.service.d"
+ local getty_svc="/usr/lib/systemd/system/getty@.service"
+ local i=
+ local glink=
+
+ mkdir -pv "${getty_dir_at}"
+ echo "Generating ${getty_dir_at}/noclear.conf ..."
+ cat <<-EOF >"${getty_dir_at}/noclear.conf"
+ [Service]
+ TTYVTDisallocate=no
+ EOF
+
+ for i in 2 3 4 ; do
+ glink="${getty_dir_tgt}/gett@tty${i}.service"
+ ln -sv "${getty_svc}" "${glink}"
+ done
+
+}
+
+#-----------------------------------------------------------
+tweak_grub() {
+
+ local grub_cfg="/etc/default/grub"
+ if [[ -f "${grub_cfg}" ]] ; then
+
+ echo
+ log "Tweaking '${grub_cfg}' ..."
+
+ sed --in-place=".bak.$( date -r ${grub_cfg} +'%Y-%m-%d_%H:%M:%S' )" -e 's/^\(GRUB_CMDLINE_LINUX=.*\)[ ]quiet\(.*\)/\1\2/' "${grub_cfg}"
+ grub2-mkconfig -o /boot/grub2/grub.cfg
+
+ fi
+
+}
+
#-----------------------------------------------------------
main() {
disable_ipv6
install_network
manage_dns
+ tweak_systemd
+
+
+ tweak_grub
}