summaryrefslogtreecommitdiffstats
path: root/source/installer/sources/initrd/usr/lib/setup/setup
diff options
context:
space:
mode:
Diffstat (limited to 'source/installer/sources/initrd/usr/lib/setup/setup')
-rwxr-xr-xsource/installer/sources/initrd/usr/lib/setup/setup56
1 files changed, 39 insertions, 17 deletions
diff --git a/source/installer/sources/initrd/usr/lib/setup/setup b/source/installer/sources/initrd/usr/lib/setup/setup
index 5fc8a0e4b..6eb96dc3a 100755
--- a/source/installer/sources/initrd/usr/lib/setup/setup
+++ b/source/installer/sources/initrd/usr/lib/setup/setup
@@ -1,25 +1,25 @@
-#!/bin/sh
+#!/bin/bash
#
# Copyright 1993, 1994, 1999 Patrick Volkerding, Moorhead, Minnesota USA
# Copyright 2001, 2003, 2004 Slackware Linux, Inc., Concord, CA
-# Copyright 2006, 2007, 2018, 2021, 2022 Patrick Volkerding, Sebeka, Minnesota USA
+# Copyright 2006, 2007, 2018, 2021, 2022, 2023 Patrick Volkerding, Sebeka, Minnesota USA
# All rights reserved.
#
-# Redistribution and use of this script, with or without modification, is
+# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
-# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# As always, bug reports, suggestions, etc: volkerdi@slackware.com
@@ -61,6 +61,10 @@ To do this, you'll need to leave 'setup', and make the partitions using \
information, read the 'setup' help file from the next menu." 10 64
fi
if [ -d /sys/firmware/efi ]; then
+ # First, let's make sure that efivarfs is active:
+ if [ "$(/bin/ls /sys/firmware/efi/efivars 2> /dev/null | wc -l)" = "0" ]; then
+ mount -t efivarfs none /sys/firmware/efi/efivars
+ fi
if ! probe -l 2> /dev/null | grep "EFI System Partition" 1> /dev/null 2> /dev/null ; then
dialog --title "NO EFI SYSTEM PARTITION DETECTED" \
--msgbox "This machine appears to be using EFI/UEFI, but no EFI System \
@@ -76,11 +80,11 @@ ROOT_DEVICE="`mount | grep "on / " | cut -f 1 -d ' '`"
echo "$ROOT_DEVICE" > $TMP/SeTrootdev
if mount | grep /var/log/mount 1> /dev/null 2> /dev/null ; then # clear source location:
# In case of bind mounts, try to unmount them first:
- umount /var/log/mount/dev 2> /dev/null
- umount /var/log/mount/proc 2> /dev/null
- umount /var/log/mount/sys 2> /dev/null
+ umount -R /var/log/mount/dev 2> /dev/null
+ umount -R /var/log/mount/proc 2> /dev/null
+ umount -R /var/log/mount/sys 2> /dev/null
# Unmount target partition:
- umount /var/log/mount
+ umount -R /var/log/mount
fi
# Anything mounted on /var/log/mount now is a fatal error:
if mount | grep /var/log/mount 1> /dev/null 2> /dev/null ; then
@@ -100,7 +104,7 @@ mkdir /var/log/mount 2> /dev/null
while [ 0 ]; do
- dialog --title "Slackware Linux Setup (version 15.0)" \
+ dialog --title "Slackware Linux Setup (version 15.1)" \
--menu \
"Welcome to Slackware Linux Setup.\n\
Select an option below using the UP/DOWN keys and SPACE or ENTER.\n\
@@ -336,9 +340,9 @@ to choose packages individually." 4 60
if [ "$MAINSELECT" = "CONFIGURE" ]; then
# Make bind mounts for /dev, /proc, and /sys:
- mount -o bind /dev $T_PX/dev 2> /dev/null
- mount -o bind /proc $T_PX/proc 2> /dev/null
- mount -o bind /sys $T_PX/sys 2> /dev/null
+ mount -o rbind /dev $T_PX/dev 2> /dev/null
+ mount -o rbind /proc $T_PX/proc 2> /dev/null
+ mount -o rbind /sys $T_PX/sys 2> /dev/null
SeTconfig
REPLACE_FSTAB=Y
if [ -r $TMP/SeTnative ]; then
@@ -388,7 +392,7 @@ if mount | grep /var/log/mntiso 1> /dev/null 2> /dev/null ; then
umount -f /var/log/mntiso
fi
if mount | grep /var/log/mount 1> /dev/null 2> /dev/null ; then
- umount /var/log/mount
+ umount -R /var/log/mount
fi
# Anything mounted on /var/log/mount now is a fatal error:
if mount | grep /var/log/mount 1> /dev/null 2> /dev/null ; then
@@ -436,6 +440,24 @@ if [ -f ${T_PX}/etc/fstab ]; then
"\nYou may now physically unplug the Slackware Installation Media USB stick from the USB port.\n" 8 60
}
+ # Prompt the user to unplug the bootable USB stick containing
+ # A-i-O (All in One Offline) partition.
+ mountpoint -q /slack-all-in-one && {
+ # Try to umount the A-i-O partition, but ignore any errors (errors would typically be
+ # occur if the user has a shell open within the USB stick's mount point), since
+ # we'll be shutting down soon anyway.
+ sync
+ umount /slack-all-in-one > /dev/null 2>&1
+ # Don't suggest disconnection if it's on ARM, because the A-i-O partition
+ # is on the same SD card that is converted from being the Installer to the
+ # OS's /boot partition.
+ [[ ! "$( uname -m )" =~ a(rm*|arch64) ]] && {
+ dialog \
+ --title "Unplug Slackware Installation USB Stick" \
+ --msgbox \
+ "\nYou may now physically unplug the Slackware Installation USB stick from the USB port.\n" 8 60 ;}
+ }
+
# Offer to reboot or drop to shell or power off.
exec 3>&1
installerexittype=$( dialog \