=== modified file 'zsh-functions/confz_fs_init' --- zsh-functions/confz_fs_init 2017-11-18 22:36:28 +0000 +++ zsh-functions/confz_fs_init 2017-02-02 00:53:52 +0000 @@ -4,20 +4,6 @@ # confz functions for dealing with filesystem and mounting # -# smartctl -i /dev/sda | while IFS=':' read foo bar; do P '***' ${${foo:l}// /_} ${bar/# #}; done - -fs_smartctl_probe() { - (($+smartctl_probed)) && (($smartctl_probed) && return 0 - local dev item val rest - typeset -g smartctl_probed - typeset -ga smartctl_devices - typeset -gA smartctl_info - smartctl --scan | while read dev rest; do - smartctl_devices+=( $dev ) - smartctl -i $dev | while IFS=':' read item val; do smartctl_info[${dev}:${${item:l}// /_}]=${val/# #}; done - done - smartctl_probed=1 -} # helper for probing devices fs_blkid_probe() { @@ -114,37 +100,6 @@ done <<<"$out" } -# Find disks by their IDs -confz_disk_id_check() { - # arguments: device device_model serial_number - if ! (($+vars[device] + $+vars[device_model] + $+vars[serial_number])); then - die "$0: requires one or more arguments: device device_model serial_number" - fi - - do_command=( true ) - fs_smartctl_probe - local device - local -a found - - for device in $smartctl_devices; do - if (($+vars[device])); then - [[ $vars[device] != $device]] && continue - fi - if (($+vars[device_model])); then - [[ $vars[device_model] != $smartctl_info[${device}:device_model] ]] && continue - fi - if (($+vars[serial_number])); then - [[ $vars[serial_number] != $smartctl_info[${device}:serial_number] ]] && continue - fi - found+=( $device $smartctl_info[${device}:device_model] $smartctl_info[${device}:serial_number] ) - done - - (( $#found )) || die "$0: found no matching devices" - [[ $#found != 3 ]] || die "$0: found too many matching devices" - vars[device]=$found[0] - vars[device_model]=$found[1] - vars[serial_number]=$found[2] -} # check for DOS-style MBR on device confz_disklabel_dos_check() {