Explode overlay tar

This commit is contained in:
2021-02-23 00:32:51 +02:00
parent 2a48e50ade
commit 9327fe6000
10 changed files with 690 additions and 1 deletions

View File

@@ -0,0 +1,33 @@
#!/bin/sh
if [ -z "$(ls /sys/class/block/)" ]; then
dialog --msgbox "Butterknife was unable to detect any harddisks,\
are you sure harddisk is connected and we have drivers for it?" 0 0
exit 255
fi
for disk in /sys/class/block/*; do
if [ -d $disk/device ]; then
slug=$(basename $disk)
sector_count=$(cat $disk/size)
sector_size=$(cat $disk/queue/hw_sector_size)
# Hack around these dumbass cardreaders
if [ "$sector_count" == "0" ]; then
continue
fi
size=$(expr $sector_count / 1000000 \* $sector_size / 1000 || true)G
if [ -f $disk/device/model ]; then
echo "$slug \"$(cat $disk/device/model | xargs) ($size)\"";
else
echo "$slug \"$size\"";
fi
fi
done > /tmp/disks
dialog \
--menu "Target disk" 0 0 0 \
--file /tmp/disks