[Fai-commit] r4458 - trunk/bin
lange at alioth.debian.org
lange at alioth.debian.org
Wed Jul 18 15:40:08 UTC 2007
Author: lange
Date: 2007-07-18 15:40:08 +0000 (Wed, 18 Jul 2007)
New Revision: 4458
Modified:
trunk/bin/fai-chboot
Log:
add initrd support
Modified: trunk/bin/fai-chboot
===================================================================
--- trunk/bin/fai-chboot 2007-07-17 22:12:14 UTC (rev 4457)
+++ trunk/bin/fai-chboot 2007-07-18 15:40:08 UTC (rev 4458)
@@ -239,7 +239,7 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub mkpxecfg {
- my ($host,$kernel,$rootfs) = @_;
+ my ($host,$kernel,$rootfs,$initrd) = @_;
my ($ipadr,$hex) = host2hex($host);
warn "$host has $ipadr in hex $hex\n" if $verbose;
@@ -263,7 +263,7 @@
$kernel
EOM
- $append="append $bootprot root=$rootfs $opt_k $flags\n";
+ $append="append $initrd $bootprot $rootfs $opt_k $flags $action\n";
print FILE $append if $rootfs;
close FILE;
}
@@ -419,12 +419,16 @@
chomp $tftproot;
$tftproot = '/srv/tftp/fai' unless $tftproot;
+$kernelsuffix = (glob "$tftproot/vmlinuz*")[0];
+$kernelsuffix=~ s/.+vmlinuz-//;
if ($opt_i) {
# create config so host will boot the install kernel
- $kernelname = 'kernel vmlinuz-install';
- $rootfs = "/dev/nfs nfsroot=$nfsroot,v3,tcp,rsize=32768,wsize=32768";
- $bootprot = "ip=dhcp $action";
+ $kernelname = "kernel vmlinuz-$kernelsuffix";
+ $initrd = "initrd=initrd.img-$kernelsuffix";
+ $rootfs = "root=/dev/nfs nfsroot=$nfsroot,v3,tcp,rsize=32768,wsize=32768";
+ $bootprot = "ip=dhcp boot=live";
+
} elsif ($opt_o) {
$kernelname = 'localboot 0';
$rootfs = '';
@@ -433,15 +437,15 @@
} else {
$kernelname = shift;
$kernelname = "kernel $kernelname";
- $rootfs = shift or die "No rootfs specified.\n";
+# $rootfs = shift or die "No rootfs specified.\n";
}
$opt_F and $opt_f="verbose,sshd,createvt";
$opt_B and $opt_f="verbose,sshd,reboot";
$opt_f and $flags="FAI_FLAGS=$opt_f";
-warn "append parameters: $bootprot $opt_k $flags\n" if $verbose;
-warn "Booting $kernelname\nrootfs is $rootfs\n" if $verbose;
+warn "Booting $kernelname\n" if $verbose;
+warn " append $initrd $bootprot $opt_k $flags\n\n" if $verbose;
$opt_k && print "Kernel parameters: $opt_k\n";
die "No host specified.\n" unless @ARGV;
-foreach (@ARGV) { mkpxecfg($_,$kernelname,$rootfs); }
+foreach (@ARGV) { mkpxecfg($_,$kernelname,$rootfs,$initrd); }
More information about the Fai-commit
mailing list