This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "IPFire 2.x development tree".
The branch, master has been updated via 784d72a2897cfdc614973aa5314032b5a93ad864 (commit) from 20c5535cf791d06c2ef2a0b49e6073fab182e810 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 784d72a2897cfdc614973aa5314032b5a93ad864 Author: Michael Tremer michael.tremer@ipfire.org Date: Mon Nov 29 01:22:57 2010 +0100
extrahd: Use UUID instead of device nodes.
-----------------------------------------------------------------------
Summary of changes: config/extrahd/extrahd.pl | 4 ++-- html/cgi-bin/extrahd.cgi | 8 +++++--- src/scripts/scanhd | 6 +++++- 3 files changed, 12 insertions(+), 6 deletions(-)
Difference in files: diff --git a/config/extrahd/extrahd.pl b/config/extrahd/extrahd.pl index e4b2a48..5f623fd 100644 --- a/config/extrahd/extrahd.pl +++ b/config/extrahd/extrahd.pl @@ -57,10 +57,10 @@ if ( "$ARGV[0]" eq "mount" ) { { @deviceline = split( /;/, $deviceentry ); if ( "$ARGV[1]" eq "$deviceline[2]" ) { - print "Insert /dev/$deviceline[0] ($deviceline[1]) --> $deviceline[2] into /etc/fstab!\n"; + print "Insert $deviceline[0] ($deviceline[1]) --> $deviceline[2] into /etc/fstab!\n"; unless ( -d $deviceline[2] ) { system("/bin/mkdir -p $deviceline[2] && chmod 0777 $deviceline[2]"); } open(FILE, ">>$fstab"); - print FILE "/dev/$deviceline[0]\t$deviceline[2]\t$deviceline[1]\tdefaults\t0\t0\n"; + print FILE "$deviceline[0]\t$deviceline[2]\t$deviceline[1]\tdefaults\t0\t0\n"; close(FILE); } } diff --git a/html/cgi-bin/extrahd.cgi b/html/cgi-bin/extrahd.cgi index 741cba6..fd35554 100644 --- a/html/cgi-bin/extrahd.cgi +++ b/html/cgi-bin/extrahd.cgi @@ -58,6 +58,7 @@ $extrahdsettings{'PATH'} = ''; $extrahdsettings{'FS'} = ''; $extrahdsettings{'DEVICE'} = ''; $extrahdsettings{'ACTION'} = ''; +$extrahdsettings{'UUID'} = '';
&General::readhash("${General::swroot}/extrahd/settings", %extrahdsettings); &Header::getcgihash(%extrahdsettings); @@ -89,7 +90,7 @@ if ($extrahdsettings{'ACTION'} eq $Lang::tr{'add'}) if ( "$ok" eq "true" ) { open(FILE, ">> $devicefile" ) or die "Unable to write $devicefile"; print FILE <<END -$extrahdsettings{'DEVICE'};$extrahdsettings{'FS'};$extrahdsettings{'PATH'}; +UUID=$extrahdsettings{'UUID'};$extrahdsettings{'FS'};$extrahdsettings{'PATH'}; END ; system("/usr/local/bin/extrahdctrl mount $extrahdsettings{'PATH'}"); @@ -138,12 +139,12 @@ END { @deviceline = split( /;/, $deviceentry ); my $color="$Header::colourred"; - if ( `/bin/mount | /bin/fgrep $deviceline[2] | /bin/fgrep /dev/$deviceline[0]` ) { + if ( `/bin/mountpoint $deviceline[2]` ) { $color=$Header::colourgreen; } print <<END <tr><td colspan="5"> - <tr><td align='center'><font color=$color><b>/dev/$deviceline[0]</b></font> + <tr><td align='center'><font color=$color><b>$deviceline[0]</b></font> <td align='center'>$deviceline[1] <td align='center'>$deviceline[2] <td align='center'> @@ -217,6 +218,7 @@ END <td align="center"><input type='text' name='PATH' value=/mnt/harddisk /> <td align="center"> <input type='hidden' name='DEVICE' value='$partitionline[0]' /> + <input type='hidden' name='UUID' value='$partitionline[2]' /> <input type='hidden' name='ACTION' value=$Lang::tr{'add'} /> <input type='image' alt=$Lang::tr{'add'} src='/images/add.gif' /> </form> diff --git a/src/scripts/scanhd b/src/scripts/scanhd index f7f50d3..9ae6e93 100644 --- a/src/scripts/scanhd +++ b/src/scripts/scanhd @@ -5,7 +5,11 @@ case "$1" in /sbin/kudzu -qps -c HD | egrep "desc|device:" | awk -F': ' '{print $2}' | sed -e '/"$/a\' -e "s/$/;/g" | tr "\n" "XX" | sed -e "s/XX/\n/g" -e "s/;X/;/g" > /var/ipfire/extrahd/scan ;; partitions) - cat /proc/partitions | awk '{print $4 ";" $3 ";"}' | grep -v name | grep -v "^;;$" > /var/ipfire/extrahd/partitions + cat /proc/partitions | awk '{print $4 " " $3 }' | grep -v name | grep -v "^[:space:]*$" | \ + while read device size; do + [ -z "${device}" ] && continue + echo "${device};${size};$(blkid -s UUID -o value /dev/${device});" + done > /var/ipfire/extrahd/partitions ;; *) echo "Usage: $0 (ide|partitions)"
hooks/post-receive -- IPFire 2.x development tree