LOG(" * Found [$F] => partitioning instructions.\n");
my @fdisk = ('d', 1, 'd', 2, 'd', 3, 'd', 4, 'd', 5, 'd', 6);
my $cnt = 0;
open(DB, "$SRC/$Entity/$F");
while(<DB>)
{
s/^\s*//;
s/\s*$//;
s/\s/ /g;
while(m/ /)
{
s/ / /g;
}
next if(m/^\;/);
my @fields = split(/ /, $_);
next unless($#fields >= 2);
my($PNumber, $PSize, $PType, $PLabel, $PBoot) = @fields;
push(@fdisk, 'n', 'p', $PNumber, '');
if($PSize eq "+")
{
push(@fdisk, '');
}
else
{
push(@fdisk, "+$PSize");
}
push(@fdisk, 't');
if($cnt > 0)
{
push(@fdisk, $PNumber);
}
push(@fdisk, $PType);
if($PBoot eq "*")
{
push(@fdisk, 'a', $PNumber);
}
if($PLabel)
{
$CMD_Label .= ";ntfslabel -f /dev/$Dev$PNumber ".
substr($PLabel, 0, 8);
}
++ $cnt;
}
close(DB);
push(@fdisk, 'w');
LOG(" * Found [$F] => partitioning instructions.\n");
my @fdisk = ('u', 'd', 1, 'd', 2, 'd', 3, 'd', 4, 'd', 5, 'd', 6);
my $cnt = 0;
open(DB, "$SRC/$Entity/$F");
while(<DB>)
{
s/^\s*//;
s/\s*$//;
s/\s/ /g;
while(m/ /)
{
s/ / /g;
}
next if(m/^\;/);
my @fields = split(/ /, $_);
next unless($#fields >= 2);
my($PNumber, $PSize, $PType, $PLabel, $PBoot) = @fields;
# Partitions numbers > 4 are logical and contained within an extended partition
if($PNumber > 4)
{
push(@fdisk, 'n', 'l', '');
}
else
{
if($PType eq "f") # We may want to check for more than one partition type ID to decide it is extended.
{
push(@fdisk, 'n', 'e', $PNumber, '');
}
else
{
push(@fdisk, 'n', 'p', $PNumber, '');
}
}
if($PSize eq "+")
{
push(@fdisk, '');
}
else
{
push(@fdisk, "+$PSize");
}
push(@fdisk, 't');
if($cnt > 0)
{
push(@fdisk, $PNumber);
}
push(@fdisk, $PType);
if($PBoot eq "*")
{
push(@fdisk, 'a', $PNumber);
}
if($PLabel)
{
$CMD_Label .= ";ntfslabel -f /dev/$Dev$PNumber ".
substr($PLabel, 0, 8);
}
++ $cnt;
}
close(DB);
push(@fdisk, 'w');LABEL PING
MENU LABEL PING
KERNEL kernel
APPEND vga=normal devfs=nomount pxe ramdisk_size=33000 load_ramdisk=1 init=/linuxrc prompt_ramdisk=0
initrd=initrd.gz root=/dev/ram0 rw noacpi noapm pci=noacpi lba acpi=off apm=off
IPAPPEND 1
($IP,$Server,$Gateway,$Netnask)=split/:/Return to PING / General Discussions
Users browsing this forum: Google [Bot] and 1 guest