setup-storage and AOE => fails at Use of uninitialized value in multiplication (*) at /usr/share/fai/setup-storage//Sizes.pm line 618.

Jean Spirat jeanspirat at squirk.org
Thu Jan 29 15:18:16 CET 2009


to isolate the error message from the complete log this is:

INTERNAL ERROR in setup-storage:
end < start
Please report this error to the Debian Bug Tracking System.

it was just that my test partition was too small for the config i had, 
the message is not very clear :)


in /usr/share/fai/setup-storage/Sizes.pm i suggest a change from  ligne 
77/706:
($end >= $start) or &FAI::internal_error("end < start");
to
($end >= $start) or &FAI::internal_error("end < start  $end < $start, is 
the sum of the partitions size not > to the size of your disk ?");



------------------------------------------------------------------------------------------------------------------------

So to wrapup, here are my changes for AOE support in setup-storage:

/usr/share/fai/setup-storage/Init.pm


################################################################################
#
# @brief Check, whether $dev is a physical device, and extract sub-parts
#
# @param $dev Device string
#
# @return 1, if it the matches the regexp, and disk device string, and
# partition number, if any, otherwise -1
#
################################################################################
sub phys_dev {
  my ($dev) = @_;
  ( $FAI::debug > 0 ) and print "--- debug : $dev\n";
  if ($dev =~ m{^/dev/(etherd/e\d+\.\d+)p(\d+)?$})
  {
    ( $FAI::debug > 0 ) and print "--- debug : $dev - $1 - $2 .\n";
    defined("$2") or return (1, "/dev/$1", -1);
    return (1, "/dev/$1", $2);
  }
  elsif ($dev =~ m{^/dev/(i2o/hd[a-t]|sd[a-t]{1,2}|hd[a-t]|vd[a-t])(\d+)?$})
  {
    defined($2) or return (1, "/dev/$1", -1);
    return (1, "/dev/$1", $2);
  }
  elsif ($dev =~ 
m{^/dev/(cciss/c\dd\d|ida/c\dd\d|rd/c\dd\d|ataraid/d\d)p(\d+)?$})
  {
    defined($2) or return (1, "/dev/$1", -1);
    return (1, "/dev/$1", $2);
  }
  return (0, "", -2);
}



later in the same file:


################################################################################
#
# @brief Convert a device name and a partition id to a proper device name,
# handling cciss and the like
#
# @param $dev Device name of disk
# @param $id Partition id
#
# @return Full device name
#
################################################################################
sub make_device_name {

  my ($dev, $p) = @_;


  $dev .= "p" if ($dev =~
    m{^/dev/(cciss/c\dd\d|ida/c\dd\d|rd/c\dd\d|ataraid/d\d)$});

  $dev .= "p" if ($dev =~
    m{^/dev/(etherd/e\d+\.\d+)$} );

  ( $FAI::debug > 0 ) and print "--- debug dev,part: $dev - $p\n";

  $dev .= $p;
  internal_error("Invalid device $dev") unless (&FAI::phys_dev($dev))[0];
  return $dev;
}



and also in /usr/lib/fai/disk-info:


changed the regex to:

egrep ' etherd/e[[:digit:]]+\.[[:digit:]]+\b| i2o/hd.\b| cciss/c.d.\b| 
ida/c.d.\b| rd/c.d.\b| hd.\b| sd[a-z]{1,2}\b|/disc\b| vd.\b' 
/proc/partitions | diskandsize



hope this will help the community. Thanks for the FAI product it rocks ! :)

Jean.



More information about the linux-fai mailing list