summaryrefslogtreecommitdiffstats
path: root/zarb-ml/mageia-dev/attachments/20120109/d93f433f/attachment.obj
diff options
context:
space:
mode:
Diffstat (limited to 'zarb-ml/mageia-dev/attachments/20120109/d93f433f/attachment.obj')
-rw-r--r--zarb-ml/mageia-dev/attachments/20120109/d93f433f/attachment.obj71
1 files changed, 71 insertions, 0 deletions
diff --git a/zarb-ml/mageia-dev/attachments/20120109/d93f433f/attachment.obj b/zarb-ml/mageia-dev/attachments/20120109/d93f433f/attachment.obj
new file mode 100644
index 000000000..f2bd56e85
--- /dev/null
+++ b/zarb-ml/mageia-dev/attachments/20120109/d93f433f/attachment.obj
@@ -0,0 +1,71 @@
+(is_xen) enable to detect if we run under XEN
+(should better check through cpuid...)
+
+(hasCPU_virt_support) detect whether we've HW support for virt or not
+
+(_is_kernelServer_supported) split it out of _is_kernelServer_needed()
+
+(_bestKernelXEN_extensions) select kernel-server or kernel-xen-pvps
+when running under XEN (depending on virt HW support presence)
+
+(_bestKernel_extensions) use _bestKernelXEN_extensions() in order to
+select the proper kernel for XEN
+
+diff -up ./detect_devices.pm.tv ./detect_devices.pm
+--- ./detect_devices.pm.tv 2012-01-09 10:33:40.946242888 +0100
++++ ./detect_devices.pm 2012-01-09 10:40:47.668522223 +0100
+@@ -1213,6 +1213,10 @@ sub is_vmware() {
+ any { $_->{driver} =~ /Card:VMware/ } detect_devices::pci_probe();
+ }
+
++sub is_xen() {
++ -f '/proc/xen/capabilities';
++}
++
+ sub is_netbook_nettop() {
+ my @cpus = getCPUs();
+ (any { $_->{'model name'} =~ /(\bIntel\(R\) Atom\(TM\)\B)/i } @cpus) ||
+@@ -1254,6 +1258,10 @@ sub hasCPUMicrocode() {
+ return $hasCPUMicrocode;
+ }
+
++sub hasCPU_virt_support() {
++ has_cpu_flag('svm') || has_cpu_flag('vmx');
++}
++
+ sub hasCPUFreq() {
+ require cpufreq;
+ to_bool(cpufreq::get_modules())
+diff -up ./install/pkgs.pm.tv ./install/pkgs.pm
+--- ./install/pkgs.pm.tv 2012-01-09 10:30:32.527118304 +0100
++++ ./install/pkgs.pm 2012-01-09 10:44:48.727700307 +0100
+@@ -105,12 +105,19 @@ sub packageByName {
+ $best;
+ }
+
+-sub _is_kernelServer_needed() {
++sub _is_kernelServer_supported() {
+ # forbid selecting kernel-server if not having PAE since PAE support is mandatory for kernel-server:
+- return if !detect_devices::has_cpu_flag('pae');
++ detect_devices::has_cpu_flag('pae');
++}
++sub _is_kernelServer_needed() {
++ return if !_is_kernelServer_supported();
+ arch() =~ /i.86/ && detect_devices::dmi_detect_memory() > 3.8 * 1024 || detect_devices::isServer();
+ }
+
++sub _bestKernelXEN_extensions() {
++ _is_kernelServer_supported() && detect_devices::hasCPU_virt_support() ? '-server' : '-xen-pvps';
++}
++
+ sub _bestKernel_extensions {
+ my ($o_match_all_hardware) = @_;
+
+@@ -118,6 +125,7 @@ sub _bestKernel_extensions {
+ $o_match_all_hardware ? (arch() =~ /i.86/ ? '-desktop586' : '-desktop') :
+ detect_devices::is_xbox() ? '-xbox' :
+ detect_devices::is_i586() ? '-desktop586' :
++ detect_devices::is_xen() ? _bestKernelXEN_extensions() :
+ _is_kernelServer_needed() ? '-server' :
+ '-desktop';
+ } \ No newline at end of file