tazpanel rev 635
Use busybox blkid
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sun Sep 27 16:12:27 2020 +0000 (2020-09-27) |
parents | f4650547f496 |
children | cd2735c8e31b |
files | boot.cgi hardware.cgi index.cgi |
line diff
1.1 --- a/boot.cgi Thu Sep 24 11:14:22 2020 +0100 1.2 +++ b/boot.cgi Sun Sep 27 16:12:27 2020 +0000 1.3 @@ -418,7 +418,7 @@ 1.4 <td><select name="instdev"> 1.5 <option value="/dev/null">$(_ 'Choose a partition (optional)')</option> 1.6 EOT 1.7 - blkid | grep -iE "(msdos|vfat|ntfs|ext[234]|xfs|btrfs)" | \ 1.8 + busybox blkid | grep -iE "(msdos|vfat|ntfs|ext[234]|xfs|btrfs)" | \ 1.9 sed -e 's|[A-Z]*ID="[^"]*"||g;s| SEC[^ ]*||;s|LABEL=||;s|:||' \ 1.10 -e 's|TYPE="\([^"]*\)"|\1|;s|/dev/||' | \ 1.11 while read dev label type; do 1.12 @@ -440,7 +440,7 @@ 1.13 echo -n "<option value=\"/dev/$dev\">/dev/$dev " 1.14 echo -n "$(blk2h < /sys/block/$dev/size) " 1.15 echo -n "$(cat /sys/block/$dev/device/model 2>/dev/null) " 1.16 - blkid | grep $dev | sed '/LABEL=/!d;s/.*LABEL="\([^"]*\).*/"\1"/;q' 1.17 + busybox blkid | grep $dev | sed '/LABEL=/!d;s/.*LABEL="\([^"]*\).*/"\1"/;q' 1.18 echo "</option>" 1.19 done 1.20 cat <<EOT
2.1 --- a/hardware.cgi Thu Sep 24 11:14:22 2020 +0100 2.2 +++ b/hardware.cgi Sun Sep 27 16:12:27 2020 +0000 2.3 @@ -434,7 +434,7 @@ 2.4 # action 2.5 action="mount" 2.6 [ -n "$mp" ] && action="umount" 2.7 - type=$(blkid $fs | sed '/ TYPE=/!d;s/.* TYPE="\([^"]*\).*/\1/') 2.8 + type=$(busybox blkid $fs | sed '/ TYPE=/!d;s/.* TYPE="\([^"]*\).*/\1/') 2.9 [ -n "$type" ] || continue 2.10 [ "$type" = "swap" ] && action="swapon" 2.11 if grep -q "^$fs " /proc/swaps; then 2.12 @@ -472,7 +472,7 @@ 2.13 <tr> 2.14 <td>$radio<!-- 2.15 --><label for="${fs##*/}" data-icon="$disktype"> $dsk</label></td> 2.16 - <td>$(blkid $fs | sed '/LABEL=/!d;s/.*LABEL="\([^"]*\).*/\1/')</td> 2.17 + <td>$(busybox blkid $fs | sed '/LABEL=/!d;s/.*LABEL="\([^"]*\).*/\1/')</td> 2.18 <td>$type</td> 2.19 <td>$size</td> 2.20 <td>$av</td> 2.21 @@ -491,7 +491,7 @@ 2.22 fi 2.23 cat <<EOT 2.24 <td>$mp</td> 2.25 - <td>$(blkid $fs | sed '/UUID=/!d;s/.*UUID="\([^"]*\).*/\1/')</td> 2.26 + <td>$(busybox blkid $fs | sed '/UUID=/!d;s/.*UUID="\([^"]*\).*/\1/')</td> 2.27 </tr> 2.28 EOT 2.29 done
3.1 --- a/index.cgi Thu Sep 24 11:14:22 2020 +0100 3.2 +++ b/index.cgi Sun Sep 27 16:12:27 2020 +0000 3.3 @@ -862,8 +862,8 @@ 3.4 cat <<EOT 3.5 <tr> 3.6 <td><span data-icon="@hdd@">${fs#/dev/}</span></td> 3.7 - <td>$(blkid $fs | sed '/LABEL=/!d;s/.*LABEL="\([^"]*\).*/\1/')</td> 3.8 - <td>$(blkid $fs | sed '/TYPE=/!d;s/.*TYPE="\([^"]*\).*/\1/')</td> 3.9 + <td>$(busybox blkid $fs | sed '/LABEL=/!d;s/.*LABEL="\([^"]*\).*/\1/')</td> 3.10 + <td>$(busybox blkid $fs | sed '/TYPE=/!d;s/.*TYPE="\([^"]*\).*/\1/')</td> 3.11 <td>$size</td> 3.12 <td>$av</td> 3.13 <td class="meter"><meter min="0" max="100" value="$(echo $pct | cut -d% -f1)" 3.14 @@ -871,7 +871,7 @@ 3.15 <span>$used - $pct</span> 3.16 </td> 3.17 <td>$mp</td> 3.18 - <td>$(blkid $fs | sed '/UUID=/!d;s/.*UUID="\([^"]*\).*/\1/')</td> 3.19 + <td>$(busybox blkid $fs | sed '/UUID=/!d;s/.*UUID="\([^"]*\).*/\1/')</td> 3.20 </tr> 3.21 EOT 3.22 done