5 tempfile
=`mktemp 2> /dev/null` || tempfile
=/tmp
/test$$
6 trap "rm -f $tempfile" 0 1 2 5 15
11 for drv
in $
(find /dev
-maxdepth 1 -name "[hs]d[a-z]" -o -name "ub[a-z]" |
sort); do
12 LC_ALL
=C sfdisk
-d $drv 2> /dev
/null |
grep "^/dev/" | \
14 if echo "$LINE" |
grep -q "type=83"; then
15 DEVICE
=$
(echo "$LINE" | cut
-d : -f 1 |
tr -d " ")
16 DEVNAME
=$
(basename $DEVICE)
18 (cd /dev
/disk
/by-id
; ls -l ata-
* usb-
* scsi-
* 2> /dev
/null | \
19 sed -n -e 's%.*[[:space:]]\+\(ata-.*\)%\1%p' -e 's%.*[[:space:]]\+\(usb-.*\)%\1%p' \
20 -e 's%.*[[:space:]]\+\(scsi-.*\)%\1%p' |
grep "/$DEVNAME$") |
read -r DEV_ID LNK_S LNK
22 if [ -n "$DEV_ID" ]; then
24 eval $
(echo "$LINE" | cut
-d : -f 2 | cut
-d , -f 2 |
tr -d " ")
25 echo -n "$(expr $size \* 512 / 1048576)MB "
32 $DIALOG --backtitle "Create filesystem on device" \
34 --menu "Select partition" 20 70 15 \
35 `lslinpart` 2> $tempfile
39 choice
=`cat $tempfile`
42 if [ ! -z "$choice" ]; then
43 DEV
=`realpath /dev/disk/by-id/$choice`
45 $DIALOG --backtitle "Create filesystem on device" \
46 --title "" --clear --default-item ext4 \
47 --menu "Select filesystem to create ($DEV)" 20 61 15 \
48 `find /sbin -name "mkfs.*" | cut -d "." -f 2 | grep -v "bfs\|cramfs\|ext4dev" | sort | sed 's/.*/& </'` 2> $tempfile
52 choice
=`cat $tempfile`
55 if [ ! -z "$choice" ]; then
56 [ "$choice" = "xfs" ] && mkfsopt
="-f"
57 [ "$choice" = "jfs" ] && mkfsopt
="-q"
58 [ "$choice" = "reiserfs" ] && mkfsopt
="-q"
59 [ "$choice" = "reiser4" ] && mkfsopt
="-y"
60 mkfs.
$choice $mkfsopt $DEV