]> xenbits.xensource.com Git - people/aperard/osstest.git/commitdiff
kickstart and cmdline changes for CentOS 6
authorAnthony PERARD <anthony.perard@citrix.com>
Thu, 14 Dec 2017 15:41:45 +0000 (15:41 +0000)
committerAnthony PERARD <anthony.perard@citrix.com>
Mon, 18 Dec 2017 16:47:18 +0000 (16:47 +0000)
Osstest/CentOS.pm

index d4e7358aa0e1875c6c08b3766cebb256746e5bef..dd6d9d68797b186c8245301e6a41632c5654dda4 100644 (file)
@@ -47,12 +47,21 @@ our %kickstart_cmds;
 sub kickstart_installcmdline_core ($$;@) {
     my ($tho, $ks_url, %xopts) = @_;
 
-    my @cl= qw(debug inst.text);
-    push @cl, "inst.ks=$ks_url";
-
-    # FIXME: CentOS installer forward syslog only via TCP, osstest listen on UPD.
-    push @cl, "inst.syslog=$r{syslog_server}"
-        if ($r{syslog_server});
+    my @cl= qw(debug);
+    if ($ho->{CentosRelease} >= 7) {
+        push @cl, "inst.text";
+        push @cl, "inst.ks=$ks_url";
+
+        # FIXME: CentOS installer forward syslog only via TCP, osstest listen on UPD.
+        push @cl, "inst.syslog=$r{syslog_server}"
+            if ($r{syslog_server});
+    } else {
+        # CentOS 6
+        push @cl, qw(text ksdevice=bootif);
+        push @cl, "ks=$ks_url";
+        push @cl, "syslog=$r{syslog_server}"
+            if ($r{syslog_server});
+    }
 
     return @cl;
 }
@@ -132,25 +141,30 @@ END
     }
 
     my $ntpserver = get_target_property($ho,'NtpServer');
-    if ($ntpserver) {
+    if ($ho->{CentosRelease} >= 7 and $ntpserver) {
         $ntpserver = "--ntpservers=$ntpserver";
+    } else {
+        $ntpserver = '';
     }
     my $kickstart_file = <<"END";
 #version=RHEL7
 # System authorization information
 auth --enableshadow --passalgo=sha512
 # License agreement
-eula --agreed
+#eula --agreed #! not for centos6
 # Use text mode install
 text
 # Keyboard layouts
-keyboard --vckeymap=us --xlayouts='us'
+# if centos7:
+#keyboard --vckeymap=us --xlayouts='us'
+if centos6:
+keyboard u
 # System language
 lang en_GB.UTF-8
 # Do not configure the X Window System
 skipx
 # System timezone
-timezone $c{Timezone} --isUtc $ntpserver
+timezone $c{Timezone} --utc $ntpserver
 # Reboot after installation
 reboot
 
@@ -196,13 +210,16 @@ zerombr
 clearpart --all --drives=$disk
 # Disk partitioning information
 part /boot --asprimary --size=$c{HostDiskBoot} --fstype=ext3 --ondrive=$disk
-part pv.01 --grow --ondrive=$disk
+part pv.01 --grow --ondrive=$disk --size=22000 # On centos6, --size is needed it is the minimum
 volgroup $vgname pv.01
 logvol /    --name=root --size=$c{HostDiskRoot} --vgname=$vgname --fstype=ext4
 logvol swap --name=swap --size=$c{HostDiskSwap} --vgname=$vgname
 
 # System bootloader configuration
-bootloader --location=mbr --boot-drive=$disk
+#if centos7 # is boot-drive usefull ? driveorder also exist on redhat7
+#bootloader --location=mbr --boot-drive=$disk
+#if centos6 # is driveorder usefull?
+bootloader --location=mbr --driveorder=$disk
 END
 
     kickstart_hook_command($ho, 'post', $sfx, <<END);
@@ -239,11 +256,13 @@ ed
 %end
 END
 
+    if ($ho->{CentosRelease} >= 7) {
     # Disable kdump
     $kickstart_file .= <<END;
 %addon com_redhat_kdump --disable
 %end
 END
+    }
 
     return create_webfile($ho, "kickstart$sfx", $kickstart_file);
 }