installer-mode: generic disk detection with lsblk (was major:minor)
Etienne Dublé
3 years ago
0 | 0 |
debootstick (2.6) unpublished; urgency=medium
|
1 | 1 |
|
2 | 2 |
* Fix support for migrating to NVMe devices (thanks to F.Lavratti)
|
|
3 |
* Installer-mode: generic disk detection with lsblk
|
3 | 4 |
|
4 | 5 |
debootstick (2.5) unstable; urgency=medium
|
5 | 6 |
|
86 | 86 |
get_higher_capacity_devices()
|
87 | 87 |
{
|
88 | 88 |
threshold=$1
|
89 | |
cat /proc/partitions | while read major minor size name
|
90 | |
do
|
91 | |
if [ "$major" = "8" ] || [ "$major" = "259" ]
|
|
89 |
lsblk -lno PATH,TYPE | grep -w disk | while read device type
|
|
90 |
do
|
|
91 |
device_size=$(get_device_capacity "$device")
|
|
92 |
if [ $device_size -gt $threshold ]
|
92 | 93 |
then
|
93 | |
if [ "$((minor % 16))" -eq 0 -a $((size*1024)) -gt $threshold ]
|
94 | |
then
|
95 | |
echo /dev/$name
|
96 | |
fi
|
|
94 |
echo $device
|
97 | 95 |
fi
|
98 | 96 |
done
|
99 | 97 |
}
|