diff options
Diffstat (limited to 'backend')
-rw-r--r-- | backend/modules/hdmap | 9 | ||||
-rw-r--r-- | backend/modules/partitions | 11 |
2 files changed, 18 insertions, 2 deletions
diff --git a/backend/modules/hdmap b/backend/modules/hdmap index 3056b93..ef669a3 100644 --- a/backend/modules/hdmap +++ b/backend/modules/hdmap @@ -339,8 +339,9 @@ function prepare_partitions_for_install() done <<<"$cfg_hdmap" } -function get_full_hd_map() +function fill_hdmap() { + cfg_set hdmap "$( ( echo "$cfg_hdmap" root_disk="$(get_disk "$(hdmap_get device of mountpoint /)")" @@ -360,6 +361,10 @@ function get_full_hd_map() echo "$part:/media/$(basename "$part")::auto" fi done - ) | sort -u -t: -k1,1 + for part in $(list_dm_partitions) + do + echo "$part:::" + done + ) | sort -u -t: -k1,1)" } diff --git a/backend/modules/partitions b/backend/modules/partitions index 0d59323..c869053 100644 --- a/backend/modules/partitions +++ b/backend/modules/partitions @@ -36,6 +36,17 @@ function list_all_partitions() awk -vli="$(awk '{if($2=="sd") print $1;}' /proc/devices)" 'BEGIN{m=split(li,list," ")}{for(i=1;i<=m;i++) if($1==list[i]&&$2%16!=0) print "/dev/"$4;}' /proc/partitions } +# Synopsis: list_dm_partitions +# +# This function lists all device-mapper partitions +# Output example: +# /dev/mapper/volg-home +# /dev/mapper/cryptoroot +function list_dm_partitions() +{ + ls /dev/mapper/* 2>/dev/null | fmt -w1 | grep -v "/control$" +} + # Synopsis: (e.g.) list_all_partitions | partitions_usage_details # # This function lists usage details for a list of partitions from STDIN |