summaryrefslogtreecommitdiff
path: root/configs/profile/root-image/root/customize_root_image.sh
diff options
context:
space:
mode:
Diffstat (limited to 'configs/profile/root-image/root/customize_root_image.sh')
-rwxr-xr-xconfigs/profile/root-image/root/customize_root_image.sh52
1 files changed, 24 insertions, 28 deletions
diff --git a/configs/profile/root-image/root/customize_root_image.sh b/configs/profile/root-image/root/customize_root_image.sh
index a98e18a..7d626ba 100755
--- a/configs/profile/root-image/root/customize_root_image.sh
+++ b/configs/profile/root-image/root/customize_root_image.sh
@@ -1,12 +1,11 @@
#!/bin/bash
-readonly DEV_RELEASE=1 # 1 for development builds - 0 for production builds
+### post-install chroot customization script ###
+set -e -u
source /root/customize_root_image-constants.inc
-set -e -u
-
# 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 ;
@@ -18,18 +17,11 @@ chmod 440 /etc/sudoers.d/g_wheel
# configure pacman
sed -i "s|#Server|Server|" /etc/pacman.d/mirrorlist
-if [[ "${enable_offline_install}" == 'true' ]]
-then cat /etc/pacman-offline.conf > /etc/pacman-online.conf
- for repo in ${REPOS}
- do echo -e "\n[${repo}]\nInclude = /etc/pacman.d/mirrorlist" >> /etc/pacman-online.conf
- done
- cp /etc/pacman-offline.conf /etc/pacman.conf
-else cp /usr/share/pacman/defaults/pacman.conf.${arch} /etc/pacman.conf
- rm /etc/pacman-*.conf
-fi
# KLUDGE begin # TODO: https://labs.parabola.nu/issues/1527
-echo "Server = https://parabola.isacdaavid.info:8081/\$repo/os/\$arch" > /etc/pacman.d/mirrorlist
+if [[ "${arch}" == "i686" ]]
+then echo "Server = https://repomirror.parabola.nu/\$repo/os/\$arch" > /etc/pacman.d/mirrorlist
+fi
# KLUDGE end
# configure services
@@ -53,12 +45,17 @@ else echo "invalid \$iso_init for services '${iso_init}'"
exit 1
fi
-# configure root user
+# 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
-sed -i "s|_EDITION_TITLE_|${iso_title}|" /etc/motd
-sed -i "s|_NETWORK_MOTD_MSG_|${NETWORK_MOTD_MSG}| ; s|^>>>>\(.*\)| \1|g" /etc/motd
if [[ "${iso_gui}" == 'cli' ]]
then cp ${ROOT_SKEL_FILES} /root/
sed -i "s|_DESKTOP_SESSION_||" /root/.bash_profile
@@ -68,25 +65,24 @@ else # configure GUI login session and live user
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
- else sed -i "s|--autologin root|--autologin ${LIVE_USER}|" /etc/conf.d/agetty.tty1
+ elif [[ "${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}'"
fi
# configure desktop environment
- sed -i "s|_EDITION_TITLE_|${WELCOME_TITLE}|" /home/${LIVE_USER}/.config/autostart/autostart.sh
- sed -i "s|--question|--info|" /home/${LIVE_USER}/.config/autostart/autostart.sh
- sed -i "s|--cancel-label=.*|\&|" /home/${LIVE_USER}/.config/autostart/autostart.sh
-
+ sed -i "s|_EDITION_TITLE_|${PRETTY_NAME}|" /home/${LIVE_USER}/.config/autostart/autostart.sh
+ sed -i "s|--question|--info|" /home/${LIVE_USER}/.config/autostart/autostart.sh
+ sed -i "s|--cancel-label=.*|\&|" /home/${LIVE_USER}/.config/autostart/autostart.sh
+ 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
- sed -i "s|_DESKTOP_SESSION_|LXDE|" /home/${LIVE_USER}/.bash_profile
- sed -i "s|_DESKTOP_SESSION_|LXDE|" /home/${LIVE_USER}/.dmrc
+ 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' ]]
- then sed -i "s|_DESKTOP_SESSION_|mate|" /home/${LIVE_USER}/.bash_profile
- sed -i "s|_DESKTOP_SESSION_|mate|" /home/${LIVE_USER}/.dmrc
+ 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}'"
exit 1
fi
fi
-
-# development builds - set DEV_RELEASE=0 for production builds
-(($DEV_RELEASE)) && source /root/customize_root_image-dev.sh 2> /dev/null