diff options
Diffstat (limited to 'source/installer/sources/initrd/sbin/probe')
-rwxr-xr-x | source/installer/sources/initrd/sbin/probe | 73 |
1 files changed, 57 insertions, 16 deletions
diff --git a/source/installer/sources/initrd/sbin/probe b/source/installer/sources/initrd/sbin/probe index 3b481432f..a0c25ac10 100755 --- a/source/installer/sources/initrd/sbin/probe +++ b/source/installer/sources/initrd/sbin/probe @@ -140,24 +140,14 @@ list_amiraid() { fi } -#list_mmc() { -# # find drive -# DRV=`expr $2 / 8` -# NUM=`expr $2 % 8` -# if [ "$NUM" = "0" ]; then -# fdisk -l /dev/mmcblk$DRV >> $TMP/SeTfdisk -# #output_gpt_partitions /dev/mmcblk$DRV >> $TMP/SeTfdisk -# else -# return -# fi -#} list_mmc() { local device # Filter out any partitions on the block device, as we'll use # fdisk to capture those: - lsblk -o name,type -ripnd /dev/mmcblk* | egrep 'disk$' | awk '{print $1}' | while read device ; do - fdisk -l $device >> $TMP/SeTfdisk - done + grep -qE 'mmcblk[0-9]' /proc/partitions && { + lsblk -o name,type -Mripnd /dev/mmcblk* | grep -E 'disk$' | awk '{print $1}' | while read device ; do + fdisk -l $device >> $TMP/SeTfdisk + done ;} } list_nvme() { @@ -324,6 +314,9 @@ list_lvm # List CRYPT volumes: list_crypt +# List MMC (e.g. SD cards) partitions: +list_mmc + ## This is obsolete, since fdisk handles GPT now. ## List GPT partitions: #cat /proc/partitions | while read line ; do @@ -412,8 +405,6 @@ if cat /proc/partitions | grep -E '/|[0-9]' 1>/dev/null 2>/dev/null ; then # new list_cciss $(( $MAJOR - 104 )) $MINOR elif [ "$MAJOR" = "114" ]; then list_ataraid $MAJOR $MINOR - elif [ "$MAJOR" = "179" ]; then - list_mmc $MAJOR $MINOR elif [ "$MAJOR" = "259" ]; then if echo $line | grep -q p; then list_nvme $DEVNAME @@ -443,4 +434,54 @@ sed -i -e "s/Linux filesystem/Linux/g" $TMP/SeTfdisk sed -i -e "s/EFI System/EFI System Partition/g" $TMP/SeTfdisk sed -i -e "s,EFI (FAT-12/16/32),EFI System Partition,g" $TMP/SeTfdisk +# Filter out reserved file system labels for Slackware ARM/AArch64 and the +# Slackware A-i-O (All in One Offline) Installer file systems. +# This prevents them from being offered as candidates for formatting/mounting +# during the installation. +# +# Labels: +# +# Used within the OS: +# ------------------- +# SLKhwm_bw = Hardware Model Bootware - native Bootware for the RPi +# SLKefi = FAT32 file system, /boot/efi mountpoint within the OS for Hardware Models +# that use UEFI firmware. +# +# SLKins = Media (usually a USB stick) containing the Slackware install media +# This FS label isn't required to locate the media, but it's helpful +# as a way to exclude the media from the list of candidates. +# This label is included within the Installation Guide for the USB +# media installation option. +# +# Used only within the Slackware Installer environment +# ---------------------------------------------------- +# SLKins_aio-pkgs = +# The label of the partition on the All-In-One Installer that contains the +# Slackware packages. +# SLKins_efi = FAT32 file system for the Installer EFI partition, for Hardware Models +# that use UEFI firmware. +# The contents of this are deployed by 'grub-install', which is called from +# the Hardware Model's 'sdcards.build' plugin. +# This is not used within the installed OS. +# SLKins_boot = ext4 file system containing the GRUB configuration to boot the +# Slackware Installer, for Hardware Models using UEFI firmware. +# +# 'SLKroot' is used to identify the OS root file system on ARM, but we don't +# filter it out because it's *supposed* to appear as a candidate within the +# menu. Whilst we don't ship any images that contain a file system with this label, +# the user might be reinstalling, thus would never be presented with the partition. +# +# SLKboot = Slackware OS /boot partition, but is only reserved only on ARM/AArch64: +[[ "$( uname -m )" =~ a(rm*|arch64) ]] && aexc="boot|" + +awk '/^\/dev\// {print $1}' /var/log/setup/tmp/SeTfdisk | while read device; do + # The wrapping of e2label is because whilst it handles other file system types, + # it includes verbosity about the filesystem type; where as for ext filesystems + # it outputs only the label. + { ( e2label ${device} 2>/dev/null | tail -n1 | rev \ + | awk '{print $1}' | rev | tr -d "'" | \ + grep -Eq "^SLK(${aexc}ins|ins_aio-pkgs|ins_efi|ins_boot|efi|hwm_bw)$" ) && sed -i '\|^'"${device}\s"'|d' $TMP/SeTfdisk ;} +done + +# Dump the discovered storage: cat $TMP/SeTfdisk |