[Fai-commit] r2933 - in trunk: lib scripts

fai-repository at svn.debian.org fai-repository at svn.debian.org
Sat Oct 8 23:24:23 UTC 2005


Author: lange
Date: 2005-10-08 23:24:23 +0000 (Sat, 08 Oct 2005)
New Revision: 2933

Added:
   trunk/lib/device2grub
Removed:
   trunk/scripts/device2grub
Log:
move to lib directory


Copied: trunk/lib/device2grub (from rev 2932, trunk/scripts/device2grub)

Deleted: trunk/scripts/device2grub
===================================================================
--- trunk/scripts/device2grub	2005-10-08 20:28:00 UTC (rev 2932)
+++ trunk/scripts/device2grub	2005-10-08 23:24:23 UTC (rev 2933)
@@ -1,35 +0,0 @@
-#! /usr/bin/perl
-# copyright Thomas Lange 2001, lange at debian.org
-# map "normal" device notation to grub notation
-
-# TODO: read from stdin if no parameter given
-
-use strict;
-my $grubdevice;
-my %map;
-
-my $device=shift;
-my $devicemap="$ENV{target}/boot/grub/device.map";
-
-open (DEVICEMAP,"<$devicemap") || die "Can't open $devicemap\n";
-while (<DEVICEMAP>) {
-  my ($grubdevice,$olddevice) = split;
-  $map{$olddevice} = $grubdevice;
-}
-
-$device=~ m#^(/dev/[sh]d\D)(\d*)$# || die "Can't match device: $device\n";
-my ($disk,$partition) = ($1,$2);
-
-if ($map{$disk}) {
-  $grubdevice=$map{$disk};
-} else {
-  die "No match in $devicemap for $disk\n"; 
-}
-
-if ($partition) {
-  $partition--;
-  $grubdevice=~s/\)/,$partition\)/;
-}
-
-print "$grubdevice\n";
-exit 0;




More information about the Fai-commit mailing list