home *** CD-ROM | disk | FTP | other *** search
- /*
- * Module: inst_add_pkg_toinstall.ycp
- *
- * Authors: Andreas Schwab (schwab@suse.de)
- * Klaus Kaempf (kkaempf@suse.de)
- * Mathias Kettner (kettner@suse.de)
- * Stefan Schubert (schubi@suse.de)
- *
- * Purpose:
- *
- * In this module in which packages could be added without checking
- * dependencies and disk-spaces.
- * This packages can not be deselect by the user.
- * This packages have not to be in the common.pkd. It is useful for
- * packages like <kernel>.rpm
- * CAUTION: This packages where added at the end of the list. So they
- * be installed finally.
- * user_settings read: "install_info"
- * "architecture"
- *
- * user_settings write: "install_info"
- *
- * SCR:
- * Read(.probe.byclass.internal.cpu)
- * Read(.probe.byclass.internal.bios)
- * Read(.proc.cpuinfo)
- * Return: -
- *
- * $Id: inst_add_pkg_toinstall.ycp,v 1.6 2000/03/07 17:02:54 kkaempf Exp $
- */
-
- /*
- */
- {
- list install_info = lookup ( user_settings, "install_info" );
-
- // add some architecture specific packages
-
- string architecture = lookup(user_settings, "architecture", "");
-
- // maybe a smp kernel
- boolean have_smp = SCR(`Read(.probe.has_smp));
-
- boolean kernel_installed = false;
-
- // format : <serie>/<file>.<rmp|sgm>, <description>,
- // <CD>, <base_packet>
-
- list k_smp = ["images/k_smp.rpm",
- "kernel with multiprocessor support",
- 1, false ];
-
- list k_eide = ["images/k_eide.rpm",
- "kernel with support for various special eide controllers",
- 1, false ];
-
- list k_laptop = ["images/k_laptop.rpm",
- "kernel with apm support",
- 1, false ];
-
- list k_deflt = ["images/k_deflt.rpm",
- "standard kernel",
- 1, false ];
-
- list k_tga = ["images/k_tga.rpm",
- "kernel with TGA controller",
- 1, false ];
-
- if (architecture == "i386") {
-
- if (have_smp) {
- // smp
- install_info = add (install_info, k_smp);
- kernel_installed = true;
- }
- else {
- // non-smp
-
- // read cpu specific information
- map cpu = select (SCR(`Read(.probe.byclass.internal.cpu)), 0);
- integer cpu_family = lookup (cpu, "family", 0);
- integer cpu_model = lookup (cpu, "model", 0);
- boolean eide_special = lookup (cpu, "eide_special", false);
- boolean pcmcia_support = SCR(`Read(.probe.has_pcmcia));
-
- map bios = select (SCR(`Read(.probe.byclass.internal.bios)), 0);
- boolean apm_supported = lookup (bios, "apm_supported", false);
- boolean apm_enabled = lookup (bios, "apm_enabled", false);
-
- // add some cpu specific packages to be installed
- // install special-(E)IDE-chipset kernel
- if (eide_special) {
- install_info = add(install_info, k_eide);
- kernel_installed = true;
- }
- else if (pcmcia_support && apm_supported && apm_enabled) {
- install_info = add(install_info, k_laptop);
- kernel_installed = true;
- }
- else if (((cpu_family == 5) && (contains (lookup (SCR(`Read(.proc.cpuinfo)), "flags", []), "tsc")))
- || (cpu_family > 5)) {
- install_info = add(install_info, k_deflt);
- kernel_installed = true;
- }
- else {
- install_info = add(install_info, k_i386);
- kernel_installed = true;
- }
-
- }
- }
- else if (architecture == "axp") {
- if (have_smp) {
- // smp
-
- install_info = add (install_info, k_smp);
- kernel_installed = true;
- }
- else {
- // first, the default kernel
- install_info = add (install_info, k_deflt);
- kernel_installed = true;
- // FIXME
- // if (tga_controller_found)
- // pacs_to_install = add(install_info, k_tga);
- }
- }
- else if (architecture == "ppc") {
- if (have_smp) {
- install_info = add (install_info, k_smp);
- kernel_installed = true;
- }
- else {
- install_info = add (install_info, k_deflt);
- kernel_installed = true;
- }
- }
-
- if ( !kernel_installed )
- {
- y2log(.error, "inst_add_pkg_toinstall",1,"ERROR: NO KERNEL WILL BE INSTALLED" );
- }
-
- // writing install_info
- user_settings = add(user_settings, "install_info", install_info);
- _debug ( "Writing install_info: ", install_info );
- }
-