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,12 @@
#!/bin/sh
partition_slug=$(echo $1 | cut -d "/" -f 3)
sys_part="/sys/block/*/$partition_slug"
sys_disk=$(dirname $sys_part)
sector_count=$(cat $sys_part/size)
sector_size=$(cat $sys_disk/queue/hw_sector_size)
size=$(expr $sector_count / 1000000 \* $sector_size / 1000)G
if [ $size == "G" ]; then
size=$(expr $sector_count / 1000 \* $sector_size / 1000)M
fi
echo $size