home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 May / Chip_2000-05_cd2.bin / suse / inst-sys / lib / YaST2 / clients / inst_add_pkg_toinstall.ycp < prev    next >
Encoding:
Text File  |  2000-03-30  |  4.0 KB  |  148 lines

  1. /*
  2.  * Module:         inst_add_pkg_toinstall.ycp
  3.  *
  4.  * Authors:         Andreas Schwab (schwab@suse.de)
  5.  *            Klaus Kaempf (kkaempf@suse.de)
  6.  *                      Mathias Kettner (kettner@suse.de)
  7.  *             Stefan Schubert (schubi@suse.de)
  8.  *
  9.  * Purpose: 
  10.  * 
  11.  * In this module in which packages could be added without checking 
  12.  * dependencies and disk-spaces. 
  13.  * This packages can not be deselect by the user.
  14.  * This packages have not to be in the common.pkd. It is useful for
  15.  * packages like <kernel>.rpm
  16.  * CAUTION: This packages where added at the end of the list. So they
  17.  * be installed finally.
  18.  * user_settings read:     "install_info"
  19.  *                      "architecture"
  20.  *
  21.  * user_settings write: "install_info"
  22.  *            
  23.  * SCR:                   
  24.  *            Read(.probe.byclass.internal.cpu)
  25.  *            Read(.probe.byclass.internal.bios)
  26.  *            Read(.proc.cpuinfo)
  27.  * Return:        -
  28.  *
  29.  * $Id: inst_add_pkg_toinstall.ycp,v 1.6 2000/03/07 17:02:54 kkaempf Exp $
  30.  */ 
  31.  
  32. /*
  33.  */
  34. {  
  35.   list install_info = lookup ( user_settings, "install_info" );
  36.  
  37.   // add some architecture specific packages
  38.  
  39.   string architecture = lookup(user_settings, "architecture", "");
  40.  
  41.   // maybe a smp kernel
  42.   boolean have_smp = SCR(`Read(.probe.has_smp));
  43.  
  44.   boolean kernel_installed = false;
  45.  
  46.   // format : <serie>/<file>.<rmp|sgm>, <description>,
  47.   //          <CD>, <base_packet>
  48.  
  49.   list k_smp = ["images/k_smp.rpm",
  50.         "kernel with multiprocessor support",
  51.         1, false ];
  52.  
  53.   list k_eide = ["images/k_eide.rpm",
  54.          "kernel with support for various special eide controllers",
  55.         1, false ];
  56.  
  57.   list k_laptop = ["images/k_laptop.rpm",
  58.            "kernel with apm support",
  59.            1, false ];
  60.  
  61.   list k_deflt = ["images/k_deflt.rpm",
  62.            "standard kernel",
  63.            1, false ];
  64.  
  65.   list k_tga = ["images/k_tga.rpm",
  66.            "kernel with TGA controller",
  67.            1, false ];
  68.  
  69.   if (architecture == "i386") {
  70.  
  71.     if (have_smp) {
  72.       // smp
  73.         install_info = add (install_info, k_smp);
  74.         kernel_installed = true;
  75.     }
  76.     else {
  77.       // non-smp
  78.     
  79.       // read cpu specific information
  80.       map cpu = select (SCR(`Read(.probe.byclass.internal.cpu)), 0);
  81.       integer cpu_family = lookup (cpu, "family", 0);
  82.       integer cpu_model = lookup (cpu, "model", 0);
  83.       boolean eide_special = lookup (cpu, "eide_special", false);
  84.       boolean pcmcia_support = SCR(`Read(.probe.has_pcmcia));
  85.  
  86.       map bios = select (SCR(`Read(.probe.byclass.internal.bios)), 0);
  87.       boolean apm_supported = lookup (bios, "apm_supported", false);
  88.       boolean apm_enabled = lookup (bios, "apm_enabled", false);
  89.  
  90.           // add some cpu specific packages to be installed
  91.       // install special-(E)IDE-chipset kernel
  92.       if (eide_special) {
  93.           install_info = add(install_info, k_eide);
  94.           kernel_installed = true;
  95.       }
  96.       else if (pcmcia_support && apm_supported && apm_enabled) {
  97.           install_info = add(install_info, k_laptop);
  98.           kernel_installed = true;
  99.       }
  100.       else if (((cpu_family == 5) && (contains (lookup (SCR(`Read(.proc.cpuinfo)), "flags", []), "tsc")))
  101.            || (cpu_family > 5)) {
  102.           install_info = add(install_info, k_deflt);
  103.           kernel_installed = true;
  104.       }
  105.       else {
  106.           install_info = add(install_info, k_i386);
  107.           kernel_installed = true;
  108.       }
  109.  
  110.     }
  111.     }
  112.     else if (architecture == "axp") {
  113.     if (have_smp) {
  114.         // smp
  115.  
  116.         install_info = add (install_info, k_smp);
  117.         kernel_installed = true;
  118.     }
  119.     else {
  120.         // first, the default kernel
  121.         install_info = add (install_info, k_deflt);
  122.         kernel_installed = true;
  123.         // FIXME
  124.         // if (tga_controller_found)
  125.         // pacs_to_install = add(install_info, k_tga);
  126.     }
  127.     }
  128.     else if (architecture == "ppc") {
  129.     if (have_smp) {
  130.         install_info = add (install_info, k_smp);
  131.         kernel_installed = true;
  132.     }
  133.     else {
  134.         install_info = add (install_info, k_deflt);
  135.         kernel_installed = true;
  136.     }
  137.     }
  138.  
  139.     if ( !kernel_installed )
  140.     {
  141.     y2log(.error, "inst_add_pkg_toinstall",1,"ERROR: NO KERNEL WILL BE INSTALLED" );
  142.     }
  143.  
  144.     // writing install_info
  145.     user_settings = add(user_settings, "install_info",  install_info);
  146.    _debug ( "Writing install_info: ", install_info );
  147. }
  148.