From 551a4ca4e6e55c4e80d544e233958921e374d37b Mon Sep 17 00:00:00 2001 From: bill-auger Date: Wed, 30 May 2018 19:47:41 -0400 Subject: housekeeping --- .../root-image/root/customize_root_image.sh | 97 +++++++++++++--------- 1 file changed, 58 insertions(+), 39 deletions(-) (limited to 'configs/profile/root-image/root/customize_root_image.sh') diff --git a/configs/profile/root-image/root/customize_root_image.sh b/configs/profile/root-image/root/customize_root_image.sh index 2a2886c..0444bbb 100755 --- a/configs/profile/root-image/root/customize_root_image.sh +++ b/configs/profile/root-image/root/customize_root_image.sh @@ -6,28 +6,28 @@ set -e -u source /root/customize_root_image-constants.inc -# configure timezone and locales +# configure timezone and locales # + ln -sf /usr/share/zoneinfo/UTC /etc/localtime for locale in ${LOCALES} ; do sed -i "s/#${locale}/${locale}/" /etc/locale.gen ; done ; locale-gen -# configure sudo + +# configure sudo # + chmod 750 /etc/sudoers.d chmod 440 /etc/sudoers.d/g_wheel -# configure pacman + +# configure pacman # + sed -i "s|#Server|Server|" /etc/pacman.d/mirrorlist -[ "${INSTALL_TYPE}" == 'Complete' ] && pacman_conf=pacman-offline.conf || pacman_conf=pacman-online.conf -cp /etc/${pacman_conf} /etc/pacman.conf +[ "${INSTALL_TYPE}" == 'Complete' ] && cp /etc/pacman-offline.conf /etc/pacman.conf || \ + cp /etc/pacman-online.conf /etc/pacman.conf -# configure services -if [[ "${iso_init}" == 'systemd' ]] -then # delete files that are specific to other init systems - rm ${SYSTEMD_DELETE_FILES} +# configure services # - # enable services - systemctl enable ${SYSTEMD_SERVICES} -elif [[ "${iso_init}" == 'openrc' ]] +if [[ "${ISO_INIT}" == 'openrc' ]] then # delete files that are specific to other init systems rm ${OPENRC_DELETE_FILES} @@ -37,53 +37,72 @@ then # delete files that are specific to other init systems # create the dbus user and group if it does not exist if [[ "$(grep 'dbus' /etc/group )" = "" ]] ; then groupadd -g 81 dbus ; fi ; if [[ "$(grep 'dbus' /etc/passwd)" = "" ]] ; then useradd -r -s /sbin/nologin -g 81 -u 81 dbus ; fi ; -else echo "invalid \$iso_init for services '${iso_init}'" + +elif [[ "${ISO_INIT}" == 'systemd' ]] +then # delete files that are specific to other init systems + rm ${SYSTEMD_DELETE_FILES} + + # enable services + systemctl enable ${SYSTEMD_SERVICES} + +else echo "invalid \$ISO_INIT for services '${ISO_INIT}'" exit 1 fi -# configure root user, system defaults, and login session + +# configure root user, system defaults, and login session # + usermod -s ${DEFAULT_SHELL} root 2> /dev/null -sed -i "s|_EDITION_TITLE_|${iso_title}|" /etc/motd -sed -i "s|_NETWORK_MOTD_MSG_|${NETWORK_MOTD_MSG}| ; s|^>>>>\(.*\)| \1|g" /etc/motd -sed -i "s|PRETTY_NAME=.*|PRETTY_NAME=\"${PRETTY_NAME}\"|" /usr/lib/os-release -echo "VERSION=\"$( echo ${iso_title} | cut -d ' ' -f 6 )\"" >> /usr/lib/os-release -echo "VERSION_ID=\"$(echo ${iso_title} | cut -d ' ' -f 6 )\"" >> /usr/lib/os-release -echo "VARIANT=\"$( echo ${PRETTY_NAME} | cut -d ' ' -f -3 --complement)\"" >> /usr/lib/os-release -echo "VARIANT_ID=\"${iso_init}-${iso_gui}\"" >> /usr/lib/os-release - -# configure CLI login session -if [[ "${iso_gui}" == 'cli' ]] -then cp ${ROOT_SKEL_FILES} /root/ +sed -i "s|_EDITION_TITLE_|${ISO_TITLE}|" /etc/motd +sed -i "s|_NETWORK_MOTD_MSG_|${NETWORK_MOTD_MSG}|" /etc/motd +sed -i "s|PRETTY_NAME=.*|PRETTY_NAME=\"${OS_PRETTY_NAME}\"|" /usr/lib/os-release +echo "VERSION=\"${OS_VERSION}\"" >> /usr/lib/os-release +echo "VERSION_ID=\"${OS_VERSION_ID}\"" >> /usr/lib/os-release +echo "VARIANT=\"${OS_VARIANT}\"" >> /usr/lib/os-release +echo "VARIANT_ID=\"${OS_VARIANT_ID}\"" >> /usr/lib/os-release + + +# configure login session # + +if [[ "${ISO_GUI}" == 'cli' ]] +then # configure CLI login session + cp ${ROOT_SKEL_FILES} /root/ sed -i "s|_DESKTOP_SESSION_||" /root/.bash_profile else # configure GUI login session and live user + + # configure live user [[ -n "$(id ${LIVE_USER} 2> /dev/null)" ]] && userdel -r ${LIVE_USER} 2> /dev/null useradd -m -p "" -g users -G "${USER_GROUPS}" -s ${DEFAULT_SHELL} ${LIVE_USER} - if [[ "${iso_init}" == 'systemd' ]] - then sed -i "s|--autologin root|--autologin ${LIVE_USER}|" /etc/systemd/system/getty@tty1.service.d/autologin.conf - elif [[ "${iso_init}" == 'openrc' ]] + + # configure auto-login + if [[ "${ISO_INIT}" == 'openrc' ]] then sed -i "s|--autologin root|--autologin ${LIVE_USER}|" /etc/conf.d/agetty.tty1 - else echo "invalid \$iso_init for --autologin '${iso_init}'" + + elif [[ "${ISO_INIT}" == 'systemd' ]] + then sed -i "s|--autologin root|--autologin ${LIVE_USER}|" /etc/systemd/system/getty@tty1.service.d/autologin.conf fi # configure welcome news alert - sed -i "s|_EDITION_TITLE_|${PRETTY_NAME}|" /usr/bin/autostart.sh - sed -i "s|,Don't show this again:0||" /usr/bin/autostart.sh - sed -i "s|620x460|620x520|" /usr/bin/autostart.sh + sed -i "s|_EDITION_TITLE_|${OS_PRETTY_NAME}| ; \ + s|,Don't show this again:0|| ; \ + s|620x460|620x520| " /usr/bin/autostart.sh # configure desktop environment sed -i "s|/issue-tracker/|/isos/|" /home/${LIVE_USER}/Desktop/bug-tracker.desktop - if [[ "${iso_gui}" == 'lxde' ]] - then rm -f /etc/xdg/autostart/octopi-notifier.desktop 2> /dev/null - touch /home/${LIVE_USER}/Desktop/parabola-installer.desktop ; sleep 2 ; # sort - touch /home/${LIVE_USER}/Desktop/parabola-irc.desktop ; sleep 2 ; # sort - touch /home/${LIVE_USER}/Desktop/bug-tracker.desktop # sort + if [[ "${ISO_GUI}" == 'lxde' ]] + then rm -f /etc/xdg/autostart/octopi-notifier.desktop 2> /dev/null # FIXME: issue #1850 + for desktop_file in parabola-installer.desktop parabola-irc.desktop bug-tracker.desktop + do sleep 2 ; touch /home/${LIVE_USER}/Desktop/${desktop_file} ; # sort + done sed -i "s|_DESKTOP_SESSION_|LXDE|" /home/${LIVE_USER}/.bash_profile sed -i "s|_DESKTOP_SESSION_|LXDE|" /home/${LIVE_USER}/.dmrc - elif [[ "${iso_gui}" == 'mate' ]] + + elif [[ "${ISO_GUI}" == 'mate' ]] then sed -i "s|_DESKTOP_SESSION_|mate|" /home/${LIVE_USER}/.bash_profile sed -i "s|_DESKTOP_SESSION_|mate|" /home/${LIVE_USER}/.dmrc - else echo "invalid \$iso_gui for _DESKTOP_SESSION_ '${iso_gui}'" + + else echo "invalid \$ISO_GUI for _DESKTOP_SESSION_ '${ISO_GUI}'" exit 1 fi fi -- cgit v1.2.2