diff options
Diffstat (limited to 'setup2hd/setup.liveslak.tpl')
-rw-r--r-- | setup2hd/setup.liveslak.tpl | 147 |
1 files changed, 97 insertions, 50 deletions
diff --git a/setup2hd/setup.liveslak.tpl b/setup2hd/setup.liveslak.tpl index 5b6e65a..fb6e03e 100644 --- a/setup2hd/setup.liveslak.tpl +++ b/setup2hd/setup.liveslak.tpl @@ -1,7 +1,12 @@ +# This script is sourced from setup2hd. + +# The script defaults to curses dialog but Xdialog is a good alternative: +DIALOG=${DIALOG:-"dialog"} + # Liveslak installation routine: if [ "$MAINSELECT" = "INSTALL" ]; then if [ ! -r $TMP/SeTnative ]; then - dialog --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \ + ${DIALOG} --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \ --title "CANNOT INSTALL SOFTWARE YET" --msgbox "\ \n\ Before you can install software, complete the following tasks:\n\ @@ -20,7 +25,7 @@ Press ENTER to return to the main menu." 16 68 # --------------------------------------------- # # Buy us some time while we are calculating disk usage: - dialog --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \ + ${DIALOG} --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \ --title "WELCOME TO @UDISTRO@ LIVE (@LIVEDE@)" --infobox \ "\nCalculating disk usage, please be patient ..." 5 65 @@ -32,7 +37,7 @@ Press ENTER to return to the main menu." 16 68 # Warn when it looks we have insufficient room: if [ $PARTFREE -lt $(($DU_LIVE/1024)) ]; then - dialog --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \ + ${DIALOG} --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \ --title "WELCOME TO @UDISTRO@ LIVE (@LIVEDE@)" --yesno \ "\nAvailable space: $PARTFREE MB\nRequired space: $(($DU_LIVE/1024))\nIt looks like your hard drive partition is too small.\nDo you want to continue?" 10 65 retval=$? @@ -41,20 +46,32 @@ Press ENTER to return to the main menu." 16 68 exit 1 fi else - dialog --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \ + ${DIALOG} --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \ --title "WELCOME TO @UDISTRO@ LIVE (@LIVEDE@)" --msgbox \ "\nAvailable space: $PARTFREE MB\nRequired space: $(($DU_LIVE/1024)) MB\nIt looks like you're good to go!" 10 65 fi - ( - # Install the Live OS by rsyncing the readonly overlay to the harddisk: - rsync -HAXav --whole-file --checksum-choice=none --inplace --progress --no-inc-recursive \ - /mnt/@LIVEMAIN@fs/ $T_PX/ \ - | awk '{ if (index($0, "to-chk=") > 0) { split($0, pieces, "to-chk="); split(pieces[2], term, ")"); split(term[1], division, "/"); print (1-(division[1]/division[2]))*100 }; fflush(); }' \ - | sed --unbuffered 's/^\([0-9]*\).*/\1/' - ) | dialog --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \ - --title "INSTALLING @UDISTRO@ LIVE (@LIVEDE@) TO DISK" --gauge \ - "\nProcessing ${TOT_MODS} @CDISTRO@ Live modules ($(( $DU_LIVE/1024 )) MB)" 8 65 + # Install the Live OS by rsyncing the readonly overlay to the harddisk: + if [ "${DIALOG}" == "Xdialog" ]; then + ${DIALOG} --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \ + --title "INSTALLING @UDISTRO@ LIVE (@LIVEDE@) TO DISK" --infobox \ + "\nProcessing ${TOT_MODS} @CDISTRO@ Live modules ($(( $DU_LIVE/1024 )) MB)" 8 80 5000 + ( + rsync -HAXa --whole-file --checksum-choice=none --inplace \ + --info=progress2 --no-inc-recursive \ + /mnt/liveslakfs/ $T_PX/ ; echo DONE \ + ) | ${DIALOG} --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \ + --title "INSTALLING @UDISTRO@ LIVE (@LIVEDE@) TO DISK" --tailbox \ + - 8 80 + else + ( + rsync -HAXa --whole-file --checksum-choice=none --inplace \ + --info=progress2 --no-inc-recursive \ + /mnt/liveslakfs/ $T_PX/ ; echo DONE \ + ) | ${DIALOG} --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \ + --title "INSTALLING @UDISTRO@ LIVE (@LIVEDE@) TO DISK" --programbox \ + "\nProcessing ${TOT_MODS} @CDISTRO@ Live modules ($(( $DU_LIVE/1024 )) MB)" 8 80 + fi # # Live OS Post Install routine. If you want, you can override this routine @@ -65,18 +82,18 @@ Press ENTER to return to the main menu." 16 68 live_post_install () { # --------------------- # Set up a user account, - dialog --title "@UDISTRO@ (@LIVEDE@) USER CREATION" \ + ${DIALOG} --title "@UDISTRO@ (@LIVEDE@) USER CREATION" \ --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \ --msgbox "You will first get the chance to create your user account, \ -and set its password.\nYour account will be added to sudoers and suauth.\n\n\ -After that, you will be asked to set the root password." 9 55 +and set its password.\nYour account will be added to 'sudoers'.\n\n\ +After that, you will be asked to set the root password." 11 55 # This will set UFULLNAME, UACCOUNT, UACCTNR and USHELL variables: - SeTuacct 2>&1 1> $TMP/tempresult + SeTuacct 2>&1 1> $TMP/uacctresult if [ $? = 0 ]; then # User filled out the form, so let's get the results for # UFULLNAME, UACCOUNT, UACCTNR and USHELL: - source $TMP/tempresult - rm -f $TMP/tempresult + source $TMP/uacctresult + rm -f $TMP/uacctresult # Set a password for the new account: UPASS=$(SeTupass $UACCOUNT) # Create the account and set the password: @@ -91,7 +108,7 @@ After that, you will be asked to set the root password." 9 55 root:${UACCOUNT}:OWNPASS root:ALL EXCEPT GROUP wheel:DENY EOT - chmod 600 ${LIVE_ROOTDIR}/etc/suauth + chmod 600 ${T_PX}/etc/suauth fi # Configure sudoers: @@ -108,19 +125,31 @@ EOT unset UPASS fi + # Add a rc.firewall script: + install -D -m0775 -t ${T_PX}/etc/rc.d/ /usr/share/@LIVEMAIN@/rc.firewall + # Install a firewall configuration script: + install -D -m755 /usr/share/@LIVEMAIN@/SeTfirewall ${T_PX}/usr/sbin/myfwconf + # Add a Slackware setup script invoking that 'myfwconf' script: + cat <<EOT >${T_PX}/var/log/setup/setup.firewall +#!/bin/sh +#BLURB="Configure a basic firewall." +chroot . usr/sbin/myfwconf +EOT + chmod 0775 ${T_PX}/var/log/setup/setup.firewall + # Re-use some of the custom configuration from 0099-@DISTRO@_zzzconf-*.sxz # (some of these may not be present but the command will not fail): - dialog --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \ + ${DIALOG} --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \ --title "POST-INSTALL @UDISTRO@ LIVE (@LIVEDE@) DATA" --infobox \ "\nCopying Live modifications to hard disk ..." 5 65 sleep 1 # It's too fast... # Do not overwrite a custom keymap: if [ ! -f $T_PX/etc/rc.d/rc.keymap ]; then - unsquashfs -f -dest $T_PX \ + unsquashfs -n -f -dest $T_PX \ /mnt/livemedia/@LIVEMAIN@/system/0099*zzzconf*.sxz \ /etc/rc.d/rc.keymap fi - unsquashfs -f -dest $T_PX \ + unsquashfs -n -f -dest $T_PX \ /mnt/livemedia/@LIVEMAIN@/system/0099*zzzconf*.sxz \ /etc/X11/xinit/xinitrc \ /etc/X11/xdm/liveslak-xdm \ @@ -131,29 +160,41 @@ EOT /etc/rc.d/rc.font \ /etc/rc.d/rc.gpm \ /etc/slackpkg \ - /etc/vconsole.conf + /etc/vconsole.conf \ + /var/lib/sddm/state.conf \ + /var/lib/slackpkg # Point xdm to the custom /etc/X11/xdm/liveslak-xdm/xdm-config: sed -i ${T_PX}/etc/rc.d/rc.4 -e 's,bin/xdm -nodaemon,& -config /etc/X11/xdm/liveslak-xdm/xdm-config,' - # Prevent Slackware's SeTconfig from asking redundant questions later on: - sed -i ${T_PX}/usr/lib/setup/SeTconfig \ + # If gcc was not installed, create a symlink to cpp pointing to mcpp; + # liveslak's XDM theme needs a C preprocessor to calculate screen positions: + if [ ! -x ${T_PX}/usr/bin/cpp ]; then + ln -s mcpp ${T_PX}/usr/bin/cpp + fi + # If nvi was not installed, do not use it as a default selection: + if [ ! -x ${T_PX}/usr/bin/nvi ] && [ -e ${T_PX}/var/log/setup/setup.vi-ex ]; + then + sed -e 's/default-item "nvi/default-item "elvis/' -i ${T_PX}/var/log/setup/setup.vi-ex + fi + # Prevent SeTconfig from asking redundant questions later on: + sed -i /usr/share/@LIVEMAIN@/SeTconfig \ -e '/.\/var\/log\/setup\/$SCRIPT $T_PX $ROOT_DEVICE/i # Skip stuff that was taken care of by liveslak\nif echo $SCRIPT |grep -E "(make-bootdisk|mouse|setconsolefont|xwmconfig)"; then continue; fi' # If a user account was created, we restore some of the user customization: if [ -n "${UACCOUNT}" ] && [ -d "${T_PX}/home/${UACCOUNT}" ]; then - unsquashfs -f -dest $T_PX \ + unsquashfs -n -f -dest $T_PX \ /mnt/livemedia/@LIVEMAIN@/system/0099*zzzconf*.sxz \ /home/@LIVEUID@/.face \ - /home/@LIVEUID@/.face.icon - if [ "@LIVEUID@" != ${UACCOUNT} ]; then - rsync -a $T_PX/home/@LIVEUID@/ $T_PX/home/${UACCOUNT}/ - rm -rf $T_PX/home/@LIVEUID@ - fi + /home/@LIVEUID@/.face.icon \ + /home/@LIVEUID@/.bashrc \ + /home/@LIVEUID@/.profile \ + /home/@LIVEUID@/.screenrc \ + /home/@LIVEUID@/.xprofile \ + /home/@LIVEUID@/.xscreensaver fi # If the Live OS is real-time capable we need to apply that to the install: - if [ "@LIVEDE@" = "PLASMA5" -o "@LIVEDE@" = "DAW" -o "@LIVEDE@" = "STUDIOWARE" ]; -then - unsquashfs -f -dest $T_PX \ + if [ "@LIVEDE@" = "DAW" -o "@LIVEDE@" = "STUDIOWARE" ]; then + unsquashfs -n -f -dest $T_PX \ /mnt/livemedia/@LIVEMAIN@/system/0099*zzzconf*.sxz \ /etc/security/limits.d/rt_audio.conf \ /etc/initscript \ @@ -162,10 +203,9 @@ then fi # Copy relevant settings for Live DAW: - if [ "@LIVEDE@" = "DAW" ]; -then + if [ "@LIVEDE@" = "DAW" ]; then LCLIVEDE=$(echo @LIVEDE@ |tr 'A-Z' 'a-z') - unsquashfs -f -dest $T_PX \ + unsquashfs -n -f -dest $T_PX \ /mnt/livemedia/@LIVEMAIN@/system/0099*zzzconf*.sxz \ /etc/pulse/daemon.conf \ /etc/xdg/menus/applications-merged/liveslak-daw.menu \ @@ -179,19 +219,27 @@ then # If a user account was created, we restore DAW user customization: if [ -n "${UACCOUNT}" ] && [ -d "${T_PX}/home/${UACCOUNT}" ]; then - unsquashfs -f -dest $T_PX \ + unsquashfs -n -f -dest $T_PX \ /mnt/livemedia/@LIVEMAIN@/system/0099*zzzconf*.sxz \ /home/@LIVEUID@/.jackdrc \ - /home/${LIVEUID}/.config/autostart/qjackctl.desktop \ - /home/${LIVEUID}/.config/rncbc.org/QjackCtl.conf \ - /home/${LIVEUID}/.config/kscreenlockerrc - if [ "@LIVEUID@" != ${UACCOUNT} ]; then - rsync -a $T_PX/home/@LIVEUID@/ $T_PX/home/${UACCOUNT}/ - rm -rf $T_PX/home/@LIVEUID@ - fi + /home/@LIVEUID@/.config/autostart/qjackctl.desktop \ + /home/@LIVEUID@/.config/rncbc.org/QjackCtl.conf \ + /home/@LIVEUID@/.config/kscreenlockerrc \ + /home/@LIVEUID@/.config/plasmarc fi fi + # If we restored user customizations and the new user account is + # not the same as the live user, sync the files over: + if [ "@LIVEUID@" != ${UACCOUNT} ]; then + rsync -a $T_PX/home/@LIVEUID@/ $T_PX/home/${UACCOUNT}/ + rm -rf $T_PX/home/@LIVEUID@ + # Also change SDDM default user: + sed -i ${T_PX}/var/lib/sddm/state.conf -e "s/User=@LIVEUID@/User=${UACCOUNT}/g" + fi + # Let's ensure the proper ownership: + chroot ${T_PX} /usr/bin/chown -R ${UACCTNR} /home/${UACCOUNT} + # Remove the marker file from the filesystem root: rm -f ${T_PX}/@MARKER@ @@ -204,13 +252,12 @@ then - default runlevel - keyboard layout - language setting - After finishing system configuration and before rebooting, you can add any further Live modules from /@LIVEMAIN@/addons/ and /@LIVEMAIN@/optional/ to your hard drive, using a command similar to this: - # unsquashfs -f -dest $T_PX /mnt/livemedia/@LIVEMAIN@/addons/mymodule.sxz + - slackpkg/slackpkg+ EOF - dialog --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \ + ${DIALOG} --backtitle "@CDISTRO@ Linux Setup (Live Edition)" \ --title "POST INSTALL HINTS AND TIPS" --msgbox "`cat $TMP/tempmsg`" \ - 20 65 + 19 65 rm $TMP/tempmsg MAINSELECT="CONFIGURE" |