123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- #!/bin/bash
- ## post-install chroot customization script ##
- set -e -u
- source /root/customize_root_image-constants.inc
- LOG_CONFIG "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
- LOG_CONFIG "sudo"
- chmod 750 /etc/sudoers.d
- chmod 440 /etc/sudoers.d/g_wheel
- LOG_CONFIG "pacman"
- [[ "${ISO_INIT}" == 'openrc' ]] && sed -i "$NONSYSTEMD_REGEX" /etc/pacman-online.conf
- [[ "${INSTALL_TYPE}" == 'Complete' ]] && cp /etc/pacman-offline.conf /etc/pacman.conf || \
- cp /etc/pacman-online.conf /etc/pacman.conf
- LOG_CONFIG "services"
- if [[ "${ISO_INIT}" == 'openrc' ]]
- then # delete files that are specific to other init systems
- rm ${OPENRC_DELETE_FILES}
- # enable services
- for service in ${OPENRC_SERVICES} ; do rc-update add ${service} default ; done ;
- # create the 'dbus' group and user if they do not exist
- if ! grep -q 'dbus' /etc/group ; then groupadd -g 81 dbus ; fi ;
- if ! grep -q 'dbus' /etc/passwd ; then useradd -r -s /sbin/nologin -u 81 -g 81 dbus ; fi ;
- 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
- LOG_CONFIG "system defaults and root user"
- usermod -s ${DEFAULT_SHELL} root 2> /dev/null
- 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
- LOG_CONFIG "login session and live user"
- sed -i "s|_EDITION_TITLE_|${ISO_TITLE}|" /etc/motd
- sed -i "s|_NETWORK_MOTD_MSG_|${NETWORK_MOTD_MSG}|" /etc/motd
- sed -i "s|_ENABLE_TTS_BRLTTY_|${ENABLE_TTS_BRLTTY}|" /etc/skel/.bash_profile
- case "${ISO_WMDE}" in
- 'cli' ) # configure CLI login session
- cp ${ROOT_SKEL_FILES} /root/
- sed -i "s|_DESKTOP_SESSION_||" /root/.bash_profile
- ;;
- 'mini' ) # configure installer-only session
- cp ${ROOT_SKEL_FILES} /root/
- cp ${MINI_SKEL_FILES} /root/
- # sed -i "s|_DESKTOP_SESSION_|mini|" /root/.bash_profile
- sed -i "s|_DESKTOP_SESSION_||" /root/.bash_profile
- cat > /root/.gtkrc-2.0 << END
- gtk-theme-name="parabola-blackmate"
- gtk-icon-theme-name="Adwaita"
- gtk-font-name="Sans 10"
- gtk-cursor-theme-name="FlatbedCursors-Blue"
- gtk-cursor-theme-size=18
- END
- ;;
- * ) # configure GUI login session
- # configure live user
- [[ -n "$(id ${LIVE_USER} 2> /dev/null)" ]] && userdel -r ${LIVE_USER} 2> /dev/null
- useradd -m -p "" -g users -G "${LIVE_USER_GROUPS}" -s ${DEFAULT_SHELL} ${LIVE_USER}
- # configure auto-login
- case "${ISO_INIT}" in
- 'openrc' ) sed -i "s|--autologin root|--autologin ${LIVE_USER}|" /etc/conf.d/agetty.tty1 ;;
- 'systemd' ) sed -i "s|--autologin root|--autologin ${LIVE_USER}|" /etc/systemd/system/getty@tty1.service.d/autologin.conf ;;
- esac
- # configure desktop environment
- sed -i "s|/issue-tracker/|/isos/|" /home/${LIVE_USER}/Desktop/bug-tracker.desktop
- case "${ISO_WMDE}" in
- 'lxde' )
- 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
- ;;
- 'mate' )
- sed -i "s|_DESKTOP_SESSION_|mate|" /home/${LIVE_USER}/.bash_profile
- sed -i "s|_DESKTOP_SESSION_|mate|" /home/${LIVE_USER}/.dmrc
- ;;
- * )
- echo "unknown \$ISO_WMDE for _DESKTOP_SESSION_ '${ISO_WMDE}'"
- exit 1
- ;;
- esac
- # configure welcome news alert
- sed -i "s|_EDITION_TITLE_|${OS_PRETTY_NAME}| ; \
- s|,Don't show this again:0|| ; \
- s|620x460|620x520| " /usr/bin/autostart.sh
- ;;
- esac
|