summaryrefslogtreecommitdiff
path: root/source/installer/sources/initrd/usr/lib/setup/SeTDOS
diff options
context:
space:
mode:
authorPatrick J Volkerding <volkerdi@slackware.com>2018-06-06 22:19:01 +0000
committerEric Hameleers <alien@slackware.com>2018-06-07 08:58:09 +0200
commit6e00c56127b4fa2328e596ac18647fb7f27b674d (patch)
treed9cb5f96f79880fb29e1875aa169336346d94989 /source/installer/sources/initrd/usr/lib/setup/SeTDOS
parentec4fd2d70a99a651f8498ce4c1ca8b38b9583c39 (diff)
downloadcurrent-6e00c56127b4fa2328e596ac18647fb7f27b674d.tar.gz
Wed Jun 6 22:19:01 UTC 201820180606221901
a/bash-4.4.023-x86_64-1.txz: Upgraded. a/kernel-firmware-20180604_1fa9ce3-noarch-1.txz: Upgraded. a/kernel-generic-4.14.48-x86_64-1.txz: Upgraded. a/kernel-huge-4.14.48-x86_64-1.txz: Upgraded. a/kernel-modules-4.14.48-x86_64-1.txz: Upgraded. ap/cups-2.2.8-x86_64-1.txz: Upgraded. ap/ghostscript-fonts-std-8.11-noarch-3.txz: Rebuilt. Rebuilt this and many other font packages or packages with build scripts that call mkfontdir or mkfontscale to suppress any error messages caused by collisions if another package installation is writing files to the same font directories when those utilities are run. In that case, the other package will also be running mkfontdir/mkfontscale after the files are installed, so any issues will be cleaned up then. Last one out turn off the lights, so to speak. ap/sqlite-3.24.0-x86_64-1.txz: Upgraded. ap/terminus-font-4.40-noarch-3.txz: Rebuilt. d/kernel-headers-4.14.48-x86-1.txz: Upgraded. d/rust-1.26.2-x86_64-1.txz: Upgraded. k/kernel-source-4.14.48-noarch-1.txz: Upgraded. l/elfutils-0.171-x86_64-1.txz: Upgraded. l/harfbuzz-1.7.7-x86_64-1.txz: Upgraded. l/mozilla-nss-3.37.3-x86_64-1.txz: Upgraded. l/readline-7.0.005-x86_64-1.txz: Upgraded. x/dejavu-fonts-ttf-2.37-noarch-4.txz: Rebuilt. x/font-adobe-100dpi-1.0.3-noarch-3.txz: Rebuilt. x/font-adobe-75dpi-1.0.3-noarch-3.txz: Rebuilt. x/font-adobe-utopia-100dpi-1.0.4-noarch-3.txz: Rebuilt. x/font-adobe-utopia-75dpi-1.0.4-noarch-3.txz: Rebuilt. x/font-adobe-utopia-type1-1.0.4-noarch-3.txz: Rebuilt. x/font-arabic-misc-1.0.3-noarch-3.txz: Rebuilt. x/font-bh-100dpi-1.0.3-noarch-3.txz: Rebuilt. x/font-bh-75dpi-1.0.3-noarch-3.txz: Rebuilt. x/font-bh-lucidatypewriter-100dpi-1.0.3-noarch-3.txz: Rebuilt. x/font-bh-lucidatypewriter-75dpi-1.0.3-noarch-3.txz: Rebuilt. x/font-bh-ttf-1.0.3-noarch-3.txz: Rebuilt. x/font-bh-type1-1.0.3-noarch-3.txz: Rebuilt. x/font-bitstream-100dpi-1.0.3-noarch-3.txz: Rebuilt. x/font-bitstream-75dpi-1.0.3-noarch-3.txz: Rebuilt. x/font-bitstream-speedo-1.0.2-noarch-3.txz: Rebuilt. x/font-bitstream-type1-1.0.3-noarch-3.txz: Rebuilt. x/font-cronyx-cyrillic-1.0.3-noarch-3.txz: Rebuilt. x/font-cursor-misc-1.0.3-noarch-3.txz: Rebuilt. x/font-daewoo-misc-1.0.3-noarch-3.txz: Rebuilt. x/font-dec-misc-1.0.3-noarch-3.txz: Rebuilt. x/font-ibm-type1-1.0.3-noarch-3.txz: Rebuilt. x/font-isas-misc-1.0.3-noarch-3.txz: Rebuilt. x/font-jis-misc-1.0.3-noarch-3.txz: Rebuilt. x/font-micro-misc-1.0.3-noarch-3.txz: Rebuilt. x/font-misc-cyrillic-1.0.3-noarch-3.txz: Rebuilt. x/font-misc-ethiopic-1.0.3-noarch-3.txz: Rebuilt. x/font-misc-meltho-1.0.3-noarch-3.txz: Rebuilt. x/font-misc-misc-1.1.2-noarch-3.txz: Rebuilt. x/font-mutt-misc-1.0.3-noarch-3.txz: Rebuilt. x/font-schumacher-misc-1.1.2-noarch-3.txz: Rebuilt. x/font-screen-cyrillic-1.0.4-noarch-3.txz: Rebuilt. x/font-sony-misc-1.0.3-noarch-3.txz: Rebuilt. x/font-sun-misc-1.0.3-noarch-3.txz: Rebuilt. x/font-winitzki-cyrillic-1.0.3-noarch-3.txz: Rebuilt. x/font-xfree86-type1-1.0.4-noarch-3.txz: Rebuilt. x/liberation-fonts-ttf-2.00.1-noarch-3.txz: Rebuilt. x/libinput-1.11.0-x86_64-1.txz: Upgraded. x/sazanami-fonts-ttf-20040629-noarch-3.txz: Rebuilt. x/sinhala_lklug-font-ttf-20060929-noarch-3.txz: Rebuilt. x/tibmachuni-font-ttf-1.901b-noarch-3.txz: Rebuilt. x/ttf-indic-fonts-0.5.14-noarch-3.txz: Rebuilt. x/ttf-tlwg-0.6.4-noarch-3.txz: Rebuilt. x/urw-core35-fonts-otf-20170801_91edd6e_git-noarch-2.txz: Rebuilt. x/wqy-zenhei-font-ttf-0.8.38_1-noarch-6.txz: Rebuilt. xap/mozilla-firefox-60.0.2-x86_64-1.txz: Upgraded. This release contains security fixes and improvements. For more information, see: https://www.mozilla.org/security/known-vulnerabilities/firefox.html (* Security fix *) xap/x3270-3.3.12ga7-x86_64-5.txz: Rebuilt. isolinux/initrd.img: Rebuilt. kernels/*: Upgraded. usb-and-pxe-installers/usbboot.img: Rebuilt.
Diffstat (limited to 'source/installer/sources/initrd/usr/lib/setup/SeTDOS')
-rwxr-xr-xsource/installer/sources/initrd/usr/lib/setup/SeTDOS214
1 files changed, 214 insertions, 0 deletions
diff --git a/source/installer/sources/initrd/usr/lib/setup/SeTDOS b/source/installer/sources/initrd/usr/lib/setup/SeTDOS
new file mode 100755
index 00000000..4f9d1057
--- /dev/null
+++ b/source/installer/sources/initrd/usr/lib/setup/SeTDOS
@@ -0,0 +1,214 @@
+#!/bin/sh
+# SeTpartition user-friendly rewrite Fri Dec 15 13:17:40 CST 1995 pjv
+# More updates for Slackware 3.5: Wed Apr 29 22:43:28 CDT 1998
+# Updated for Slackware 7.x (new fdisk tags) Fri Sep 10 13:17:18 CDT 1999
+TMP=/var/log/setup/tmp
+T_PX="`cat $TMP/SeTT_PX`"
+if [ ! -d $TMP ]; then
+ mkdir -p $TMP
+fi
+REDIR=/dev/tty4
+NDIR=/dev/null
+rm -f $TMP/SeTDOS
+touch $TMP/SeTDOS
+
+crunch () { # remove extra whitespace
+ read STRING;
+ echo $STRING
+}
+
+# get_part_size( dev ) - Return the size in K, M, G, T, or P of the named partition.
+get_part_size() {
+ numfmt --to=iec $(blockdev --getsize64 $1)
+}
+
+ntfs_security() {
+ rm -f $TMP/ntfs_security
+ dialog --backtitle "Setting permissions on NTFS partition $DOS_PART" \
+ --title "SET SECURITY FOR NTFS PARTITION $DOS_PART" \
+ --default-item "fmask=177,dmask=077" \
+ --menu "Because users could go snooping through (or destroy, depending on \
+the settings) your Windows partition, you should choose how much access would you \
+like your non-root users to have to partition $DOS_PART. The access level can \
+range from no access at all, to read-only for everyone, to read-write access \
+for every user on the machine. A reasonable default (read-write for root only) \
+is chosen, but you may set this any way that you like." \
+16 77 4 \
+"fmask=177,dmask=077" "Root has read/write access, users have no access (ntfs-3g)" \
+"fmask=333,dmask=222" "Everyone has read only access (built-in kernel ntfs driver)" \
+"fmask=133,dmask=022" "Everyone has read access, but only root can write (ntfs-3g)" \
+"fmask=111,dmask=000" "All users can read/write to any file (ntfs-3g)" \
+2> $TMP/ntfs_security
+ if [ ! $? = 0 ]; then
+ rm -f $TMP/ntfs_security $TMP/mount-point $TMP/SeTDOS
+ echo 1
+ fi
+}
+
+fat_security() {
+ rm -f $TMP/fat_security
+ dialog --backtitle "Setting permissions on FAT partition $DOS_PART" \
+ --title "SET SECURITY FOR FAT PARTITION $DOS_PART" \
+ --default-item "fmask=177,dmask=077" \
+ --menu "Because users could go snooping through (or destroy, depending on \
+the settings) your Windows partition, you should choose how much access would you \
+like your non-root users to have to partition $DOS_PART. The access level can \
+range from no access at all, to read-only for everyone, to read-write access \
+for every user on the machine. A reasonable default (read-write for root only) \
+is chosen, but you may set this any way that you like." \
+18 77 4 \
+"fmask=177,dmask=077" "Root has read/write access, users have no access" \
+"fmask=333,dmask=222" "Everyone has read only access" \
+"fmask=133,dmask=022" "Everyone has read access, but only root can write" \
+"fmask=111,dmask=000" "All users can read/write to any file" \
+2> $TMP/fat_security
+ if [ ! $? = 0 ]; then
+ rm -f $TMP/fat_security $TMP/mount-point $TMP/SeTDOS
+ echo 1
+ fi
+}
+
+# Since the USB installers (both usbboot.img and the ones created using
+# usbimg2disk.sh) present bogus FAT/NTFS partitions, we need a way to
+# filter these from the partition scan. To do this, we'll set a variable
+# $BANHAMMER that contains the name of the device the stick was found on.
+# First, we'll set that to contain some random nonsense that will never
+# be an actual device since reverse grepping for "" won't work.
+BANHAMMER="0xFE11C1A"
+# Look for the usbboot.img stick:
+if [ -L /dev/disk/by-label/USBSLACK ]; then
+ BANHAMMER="$(readlink -f /dev/disk/by-label/USBSLACK)"
+fi
+# Look for the usbimg2disk.sh stick:
+if [ -L /dev/disk/by-label/USBSLACKINS ]; then
+ BANHAMMER="$(readlink -f /dev/disk/by-label/USBSLACKINS | cut -b 1-8)"
+fi
+# Suggested new GPT partition type: Microsoft basic data
+# More research needed... could be FAT32, NTFS, or EXFAT
+DOSLIST="$(probe -l 2> /dev/null | grep -E "DOS|Win(95 F|98 F)|HPFS|W95 F|FAT(12|16)" | grep -Ev "Ext('d|end)" | grep -v "$BANHAMMER" | sort)"
+if [ "$DOSLIST" = "" ]; then # no FAT or NTFS partitions
+ exit
+fi
+dialog --backtitle "Setting up non-Linux partitions." \
+--title "FAT or NTFS PARTITIONS DETECTED" \
+--yesno "Partitions of type FAT or NTFS (commonly used by DOS and \
+Windows) have been found on your \
+system. Would you like to add these partitions to your /etc/fstab \
+so that these partitions are visible from Linux?" \
+8 70
+if [ ! $? = 0 ]; then
+ exit
+fi
+while [ 0 ]; do # main partition selection loop
+ rm -f $TMP/SeTSKIP
+ echo "true" > $TMP/SeTSKIP
+ cat << EOF > $TMP/tempscript
+dialog --backtitle "Selecting non-Linux partitions." \\
+--title "SELECT PARTITION TO ADD TO /etc/fstab" \\
+--ok-label Select --cancel-label Continue \\
+--menu "In order to make these partitions visible from Linux, we \\
+need to add them to your /etc/fstab. Please pick a partition to \\
+add to /etc/fstab, or select '---' to continue with the installation \\
+process." \\
+15 70 5 \\
+EOF
+ echo "$DOSLIST" | while read PARTITION ; do
+ NAME=`echo $PARTITION | crunch | cut -f 1 -d ' '`
+ SIZE=`get_part_size $NAME`
+ if echo $PARTITION | grep Win9 1> $NDIR 2> $NDIR ; then
+ TYPE="FAT32"
+ elif echo $PARTITION | grep "W95 F" 1> $NDIR 2> $NDIR ; then
+ TYPE="FAT32"
+ elif echo $PARTITION | grep NTFS 1> $NDIR 2> $NDIR ; then
+ TYPE="NTFS"
+ elif echo $PARTITION | grep FAT 1> $NDIR 2> $NDIR ; then
+ TYPE="FAT16"
+ fi
+ if cat $TMP/SeTDOS | grep $NAME 1> $NDIR 2> $NDIR ; then
+ ON=`cat $TMP/SeTDOS | grep $NAME | crunch | cut -f 2 -d ' '`
+ echo "\"(IN USE)\" \"$NAME on $ON $TYPE ${SIZE}\" \\" >> $TMP/tempscript
+ else
+ echo "\"$NAME\" \"$TYPE ${SIZE}\" \\" >> $TMP/tempscript
+ echo "false" > $TMP/SeTSKIP
+ fi
+ done
+ echo "\"---\" \"(done, continue with setup)\" \\" >> $TMP/tempscript
+ echo "\"---\" \"(done, continue with setup)\" \\" >> $TMP/tempscript
+ echo "\"---\" \"(done, continue with setup)\" \\" >> $TMP/tempscript
+ echo "\"---\" \"(done, continue with setup)\" \\" >> $TMP/tempscript
+ echo "\"---\" \"(done, continue with setup)\" \\" >> $TMP/tempscript
+ echo "2> $TMP/return" >> $TMP/tempscript
+ if [ "`cat $TMP/SeTSKIP`" = "true" ]; then
+ break
+ fi
+ . $TMP/tempscript
+ if [ ! $? = 0 ]; then
+ rm $TMP/tempscript
+ exit 255 # user abort
+ fi
+ DOS_PART="`cat $TMP/return`"
+ rm -f $TMP/tempscript
+ if [ "$DOS_PART" = "---" ]; then
+ break
+ elif [ "$DOS_PART" = "(IN USE)" ]; then
+ continue
+ fi
+ if echo "$DOSLIST" | grep -w $DOS_PART | grep NTFS 1> $NDIR 2> $NDIR ; then
+ ntfs_security
+ FS_UMASK="$(cat $TMP/ntfs_security)"
+ if [ "$FS_UMASK" = "1" ]; then
+ exit 1
+ else
+ if [ "$FS_UMASK" = "fmask=333,dmask=222" ]; then
+ FS_TYPE=ntfs
+ else
+ FS_TYPE=ntfs-3g
+ fi
+ fi
+ else
+ FS_TYPE=vfat
+ fat_security
+ FS_UMASK="$(cat $TMP/fat_security)"
+ fi
+ dialog --backtitle "Selecting a location to mount $DOS_PART." \
+ --title "PICK MOUNT POINT FOR $DOS_PART" \
+ --inputbox "Now this partition must be mounted somewhere in your \
+ directory tree. Please enter the directory under which \
+ you would like to put it. For instance, you might want to \
+ enter /fat-c or /fat-d or something similar. \
+ NOTE: This \
+ partition won't actually be mounted until you reboot. \
+ Where would you like to mount $DOS_PART?" \
+ 13 65 2> $TMP/mount-point
+ if [ ! $? = 0 ]; then
+ rm -f $TMP/tempmsg $TMP/mount-point $TMP/SeTDOS
+ exit
+ fi
+ NEW_DIR="`cat $TMP/mount-point`"
+ rm -f $TMP/mount-point
+ # If this was left blank or is '/', drop back to the first menu and start over.
+ if [ "$NEW_DIR" = "" -o "$NEW_DIR" = "/" ]; then
+ continue
+ fi
+ if [ ! "`echo $NEW_DIR | cut -b1`" = "/" ]; then
+ NEW_DIR="/$NEW_DIR"
+ fi
+ mkdir -p ${T_PX}$NEW_DIR
+ chmod 755 ${T_PX}$NEW_DIR
+ if echo "$DOSLIST" | grep $DOS_PART | grep NTFS 1> $NDIR 2> $NDIR ; then
+ printf "%-16s %-16s %-11s %-16s %-3s %s\n" "$DOS_PART" "$NEW_DIR" "$FS_TYPE" "$FS_UMASK" "1" "0" >> $TMP/SeTDOS
+ else
+ printf "%-16s %-16s %-11s %-16s %-3s %s\n" "$DOS_PART" "$NEW_DIR" "$FS_TYPE" "$FS_UMASK" "1" "0" >> $TMP/SeTDOS
+ fi
+done # partition adding loop
+rm -f $TMP/SeTSKIP
+cat << EOF > $TMP/tempmsg
+
+Adding this information to your /etc/fstab:
+
+EOF
+cat $TMP/SeTDOS >> $TMP/tempmsg
+dialog --backtitle "Finished setting up non-Linux partitions." \
+--title "DONE ADDING FAT or NTFS PARTITIONS" \
+--exit-label OK \
+--textbox $TMP/tempmsg 15 72