# HG changeset patch # User Pascal Bellard # Date 1250517600 -7200 # Node ID d8c2f18f96c2315c099b0b88afd9542fa58db19e # Parent 648f7c61a977cfdddb517878ad9b7e2ad778e502 mountbox: add read-only status diff -r 648f7c61a977 -r d8c2f18f96c2 lib/libmountbox --- a/lib/libmountbox Sat Aug 15 22:20:22 2009 +0200 +++ b/lib/libmountbox Mon Aug 17 16:00:00 2009 +0200 @@ -13,10 +13,17 @@ Output commands: list-mounted List all mounted devices in suitable GTK tree format. list-umounted List all umounted in suitable GTK tree format. + create-file Create an empty file with predefined size. + add-old-crypto Create loop-eas device. + remove-crypto Delete a crypto device. GTKdialog boxes mounted-fs-infos Display a mounted devices infos with actions. - umounted-fs-infos Display a umounted devices infos with actions.\n" + umounted-fs-infos Display a umounted devices infos with actions. + remove-loop Confirmation box. + new-file Parameter box for file creation. + cryptomgr Manage crypto device with devmapper. + add-crypto Pass phrase dialog.\n" } # Format df -h output for GTK tree. @@ -79,9 +86,11 @@ # for dev in `df -h | grep ^/dev/ | cut -d " " -f 1` do + RO='read-only' + mount | grep $dev | grep -q '(rw' && RO='' RES=`df -h $dev | unwrap | grep ^$dev` mounted_fs_data - echo "$dev | $SIZE | $USED | $AVAILABLE | $PCT | $MOUNTED_ON" + echo "$dev | $SIZE | $USED | $AVAILABLE | $PCT | $MOUNTED_ON | $RO" done ;; list-umounted) # List all umounted fs found by: fdisk -l @@ -185,7 +194,25 @@ pcmanfm $MOUNTED_ON & MOUNTED_DEVICE - + " +if mount | grep $MOUNTED_ON | grep -q '(rw'; then + MOUNTED_DEVICE="$MOUNTED_DEVICE + " +else + MOUNTED_DEVICE="$MOUNTED_DEVICE + " +fi +MOUNTED_DEVICE="$MOUNTED_DEVICE + @@ -368,9 +402,6 @@ " gtkdialog --center --program=REMOVE_DEVICE ;; - add-loop) - losetup -o $OFFSET $(losetup -f) $FILE - ;; create-file) file=$2 size=$3 @@ -512,8 +543,12 @@ DEV=/dev/dm-$(ls -l /dev/mapper/$name | awk '{ print $6 }') MOUNT=$(mount | egrep "^$DEV|/dev/mapper/$name" | awk '{ print $3 }') getdevinfo $DEV + case "$name" in + *crypto*) item="item icon=\"passwd\"";; + *) item="item icon=\"drive-harddisk\"";; + esac CRYPTO_MANAGER="$CRYPTO_MANAGER - $name|$DEV | $SIZE | $TYPE | $LABEL | $MOUNT | $UUID + <$item>$name|$DEV | $SIZE | $TYPE | $LABEL | $MOUNT | $UUID " done < /dev/null) diff -r 648f7c61a977 -r d8c2f18f96c2 tinyutils/mountbox --- a/tinyutils/mountbox Sat Aug 15 22:20:22 2009 +0200 +++ b/tinyutils/mountbox Mon Aug 17 16:00:00 2009 +0200 @@ -63,7 +63,7 @@ 520120 MOUNTED - ' + ' # /dev/root RES=`df -h / | grep rootfs` @@ -152,7 +152,6 @@ /usr/lib/slitaz/libmountbox cryptomgr - refresh:MOUNTED refresh:DEVICE