/[gli]/branches/overhaul/src/fe/gtk/Kernel.py
Gentoo

Contents of /branches/overhaul/src/fe/gtk/Kernel.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1623 - (show annotations) (download) (as text)
Fri Jan 19 10:19:38 2007 UTC (7 years, 6 months ago) by agaffney
File MIME type: text/x-python
File size: 7187 byte(s)
remove Help button
rearrange Stage screen
1 # Copyright 1999-2005 Gentoo Foundation
2 # This source code is distributed under the terms of version 2 of the GNU
3 # General Public License as published by the Free Software Foundation, a copy
4 # of which can be found in the main directory of this project.
5
6 import gtk
7 import GLIScreen
8 import URIBrowser
9
10 class Panel(GLIScreen.GLIScreen):
11
12 title = "Kernel Sources"
13 active_selection = None
14 kernel_sources = {}
15 sources = [("gentoo-sources", "These are the vanilla sources patched with the Gentoo patchset. These are generally considered stable."),
16 ("vanilla-sources", "These are the kernel sources straight from kernel.org without patches (except where necessary)"),
17 ("hardened-sources", "These are the vanilla sources patched with the hardened patchset. This results in a more secure system. Do not use these unless you have read the hardened guide first."),
18 ("livecd-kernel", "This will install the LiveCD's kernel/initrd into your new system. Use this option to get your system up and running quickly. You should not tell the installer to emerge any packages that require kernel sources as they won't be present.")]
19 _helptext = """
20 <b><u>Choosing a Kernel</u></b>
21
22 The core around which all distributions are built is the Linux kernel. It is the
23 layer between the user programs and your system hardware. Gentoo provides its
24 users several possible kernel sources. A full listing with description is
25 available at the Gentoo Kernel Guide at
26 http://www.gentoo.org/doc/en/gentoo-kernel.xml.
27
28 For x86-based systems we have, amongst other kernels, vanilla-sources (the
29 default kernel source as developed by the linux-kernel developers),
30 gentoo-sources (kernel source patched with performance-enhancing features) (less
31 stable),
32
33 livecd-kernel: This will copy the currently running kernel over to the new
34 system, just as if genkernel had created your kernel. This is generally
35 recommended since it is much faster than genkernel and just as good, except that
36 once your system is installed you will eventually need to recreate a kernel
37 again.
38
39 If you're not concerned about time, select vanilla-sources or gentoo-sources if
40 you're feeling lucky. If you have a pre-made .config file, you can specify it in
41 the entry field at the bottom, and it will be used when the kernel is built.
42 """
43
44 #For non-livecd-kernel sources, selecting Enable Bootsplash gives you a colorful
45 #background image in a frame buffer.
46
47 def __init__(self, controller):
48 GLIScreen.GLIScreen.__init__(self, controller)
49 vert = gtk.VBox(False, 0)
50 vert.set_border_width(10)
51
52 content_str = """Here, you will select which kernel sources package you would like to use. Each option has
53 a brief description beside it.
54 """
55 content_label = gtk.Label(content_str)
56 vert.pack_start(content_label, expand=False, fill=False, padding=0)
57
58 for source in self.sources:
59 parent = None
60 name, descr = source
61 if name != self.sources[0][0]:
62 parent = self.kernel_sources[self.sources[0][0]]
63 self.kernel_sources[name] = gtk.RadioButton(parent, name)
64 self.kernel_sources[name].set_name(name)
65 self.kernel_sources[name].connect("toggled", self.kernel_selected, name)
66 self.kernel_sources[name].set_size_request(150, -1)
67 hbox = gtk.HBox(False, 0)
68 hbox.pack_start(self.kernel_sources[name], expand=False, fill=False, padding=0)
69 tmplabel = gtk.Label(descr)
70 tmplabel.set_line_wrap(True)
71 hbox.pack_start(tmplabel, expand=False, fill=False, padding=20)
72 vert.pack_start(hbox, expand=False, fill=False, padding=10)
73
74 # hbox = gtk.HBox(False, 0)
75 # self.bootsplash_check = gtk.CheckButton("Enable bootsplash")
76 # self.bootsplash_check.set_size_request(150, -1)
77 # hbox.pack_start(self.bootsplash_check, expand=False, fill=False, padding=0)
78 # tmplabel = gtk.Label("This enables a colorful background image during system boot.")
79 # tmplabel.set_line_wrap(True)
80 # hbox.pack_start(tmplabel, expand=False, fill=False, padding=20)
81
82 hbox = gtk.HBox(False, 0)
83 hbox.pack_start(gtk.Label("Kernel config URI:"), expand=False, fill=False, padding=5)
84 self.kernel_config_uri = gtk.Entry()
85 self.kernel_config_uri.set_width_chars(50)
86 hbox.pack_start(self.kernel_config_uri, expand=False, fill=False, padding=10)
87 self.browse_uri = gtk.Button(" ... ")
88 self.browse_uri.connect("clicked", self.browse_uri_clicked)
89 hbox.pack_start(self.browse_uri, expand=False, fill=False, padding=5)
90 vert.pack_end(hbox, expand=False, fill=False, padding=0)
91
92 self.add_content(vert)
93
94 def browse_uri_clicked(self, widget):
95 uribrowser = URIBrowser.URIBrowser(self, self.kernel_config_uri)
96 uribrowser.run(self.kernel_config_uri.get_text())
97
98 def kernel_selected(self, widget, data=None):
99 self.active_selection = data
100 if data == "livecd-kernel":
101 # self.bootsplash_check.set_sensitive(False)
102 self.kernel_config_uri.set_sensitive(False)
103 self.browse_uri.set_sensitive(False)
104 else:
105 # self.bootsplash_check.set_sensitive(True)
106 self.kernel_config_uri.set_sensitive(True)
107 self.browse_uri.set_sensitive(True)
108
109 def activate(self):
110 self.controller.SHOW_BUTTON_EXIT = True
111 # self.controller.SHOW_BUTTON_HELP = True
112 self.controller.SHOW_BUTTON_BACK = True
113 self.controller.SHOW_BUTTON_FORWARD = True
114 self.controller.SHOW_BUTTON_FINISH = False
115 self.active_selection = self.controller.install_profile.get_kernel_source_pkg() or "gentoo-sources"
116 self.kernel_sources[self.active_selection].set_active(True)
117 # self.bootsplash_check.set_active(self.controller.install_profile.get_kernel_bootsplash())
118 # if self.controller.install_type == "networkless":
119 if self.controller.install_profile.get_grp_install():
120 self.active_selection = "livecd-kernel"
121 self.kernel_sources[self.active_selection].set_active(True)
122 # self.bootsplash_check.set_active(False)
123 for kernel_source in self.kernel_sources:
124 if not kernel_source == "livecd-kernel":
125 self.kernel_sources[kernel_source].set_sensitive(False)
126 # self.bootsplash_check.set_sensitive(False)
127
128 def deactivate(self):
129 self.controller.install_profile.set_kernel_source_pkg(None, self.active_selection, None)
130 # For now
131 self.controller.install_profile.set_kernel_build_method(None, "genkernel", None)
132 if self.kernel_config_uri.get_text():
133 self.controller.install_profile.set_kernel_config_uri(None, self.kernel_config_uri.get_text(), None)
134 # if self.active_selection == "livecd-kernel":
135 self.controller.install_profile.set_kernel_bootsplash(None, False, None)
136 # else:
137 # self.controller.install_profile.set_kernel_bootsplash(None, self.bootsplash_check.get_active(), None)
138 # if self.bootsplash_check.get_active() and not self.controller.install_profile.get_bootloader_kernel_args():
139 # proc_cmdline = open("/proc/cmdline", "r")
140 # cmdline = proc_cmdline.readline().strip()
141 # proc_cmdline.close()
142 # vga = None
143 # splash = None
144 # for x in cmdline.split(" "):
145 # parts = x.split("=")
146 # if len(parts) < 2: continue
147 # if parts[0] == "vga":
148 # vga = parts[1]
149 # elif parts[0] == "splash":
150 # splash = parts[1]
151 # self.controller.install_profile.set_bootloader_kernel_args(None, "vga=%s splash=%s CONSOLE=/dev/tty1 quiet" % (vga, splash), None)
152 return True

Properties

Name Value
svn:eol-style native

  ViewVC Help
Powered by ViewVC 1.1.20