X-Git-Url: https://iankelling.org/git/?p=automated-distro-installer;a=blobdiff_plain;f=devbyid;h=9a02442dd4063d8604b616dc00129d8200147d94;hp=e3443898795c52d5c8569c02e538b8765c23ecf2;hb=a027429011d313e0d9156fef9451f5a55a588163;hpb=442bbc2cfd5c4f81f7de11a0b5b8145204cdea32 diff --git a/devbyid b/devbyid deleted file mode 100755 index e344389..0000000 --- a/devbyid +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -# input eg: /dev/sda1 or /dev/sda -# output: /dev/disk/by-id/model+serial, or if no link exists, the same as input - -short_dev=$1 - -# devices are identified by model+serial num, -# and wwn. model+serial gives me more info, so use that. -shopt -s extglob -for id in /dev/disk/by-id/!(wwn*); do - [[ -e $id ]] || break # if we matched nothing - if [[ $(readlink -f $id) == "$short_dev" ]]; then - printf '%s\n' "$id" - exit - fi -done -# a vm may not have a by-id link. -printf '%s\n' "$short_dev" diff --git a/devbyid b/devbyid new file mode 120000 index 0000000..9a02442 --- /dev/null +++ b/devbyid @@ -0,0 +1 @@ +fai/config/distro-install-common/devbyid \ No newline at end of file