| … | |
… | |
| 14 | active_selection = 1 |
14 | active_selection = 1 |
| 15 | radio_stages = [None, None, None, None] |
15 | radio_stages = [None, None, None, None] |
| 16 | _helptext = """ |
16 | _helptext = """ |
| 17 | <b><u>Stage</u></b> |
17 | <b><u>Stage</u></b> |
| 18 | |
18 | |
| 19 | Gentoo has traditionally provided three differently-sized stage tarballs to |
19 | The Stage 3 tarball is the recommended (and only supported) tarball for Gentoo \ |
| 20 | install Gentoo. |
20 | installations. It contains a complete base system and is already optimized for \ |
|
|
21 | whatever architecture/processor you download the stage3 for. While Gentoo still \ |
|
|
22 | offers stage1 and stage2 tarballs, the official installation method uses the \ |
|
|
23 | stage3 tarball. |
| 21 | |
24 | |
| 22 | The Stage 1 is the smallest to download but takes the longest to compile because |
|
|
| 23 | it builds all the standard C libraries and compiler from scratch (meant for |
|
|
| 24 | those who are totally obsessed with optimization). |
|
|
| 25 | |
|
|
| 26 | The Stage 2 tarball is slightly bigger but still requires the compilation of the |
|
|
| 27 | base system from scratch. This stage is rarely used by anybody. |
|
|
| 28 | |
|
|
| 29 | The Stage 3 tarball is the recommended tarball for Gentoo instllations. It |
|
|
| 30 | contains a complete base system and is already optimized for whatever |
|
|
| 31 | architecture/processor you download the stage3 for. While Gentoo still offers |
|
|
| 32 | stage1 and stage2 tarballs, the official installation method uses the stage3 |
|
|
| 33 | tarball. |
|
|
| 34 | |
|
|
| 35 | The Livecd also provides many programs using GRP, which will package up the |
25 | The Livecd also provides many programs using GRP, which will package up the \ |
| 36 | livecd files and install them as binaries. This is useful for getting large |
26 | livecd files and install them as binaries. This is useful for getting large \ |
| 37 | applications like gnome installed quickly. If doing a GRP install, the Dynamic |
27 | applications like gnome installed quickly. If doing a GRP install, the Dynamic \ |
| 38 | stage3 is also recommended. Dynamic creates a stage3 tarball on the fly from |
28 | stage3 is also recommended. Dynamic creates a stage3 tarball on the fly from \ |
| 39 | the contents of the Livecd, and does not involve any downloading, but can be a |
29 | the contents of the Livecd, and does not involve any downloading, but can be a \ |
| 40 | bit slow. |
30 | bit slow. |
| 41 | |
31 | |
| 42 | <b>For those doing a networkless installation, you must select "Dynamic" and |
32 | <b>For those doing a networkless installation, you must select "Dynamic" and \ |
| 43 | "GRP Install" from the Stage screen.</b> Otherwise select a stage and click |
33 | "GRP Install" from the Stage screen.</b> Otherwise select a stage and click \ |
| 44 | the "..." to browse for a tarball location. |
34 | the "..." to browse for a tarball location. |
| 45 | |
35 | |
| 46 | In the URI Browser, select the type (such as http) and then press the "..." next |
36 | In the URI Browser, select the type (such as http) and then press the "..." next \ |
| 47 | to Host to choose a mirror address. Once your host has been selected the path |
37 | to Host to choose a mirror address. Once your host has been selected the path \ |
| 48 | below should change automatically and you should be able to browse through the |
38 | below should change automatically and you should be able to browse through the \ |
| 49 | folders to find your stage tarball. The path to the tarballs is usually |
39 | folders to find your stage tarball. The path to the tarballs is usually \ |
| 50 | /releases/{architecture ex. x86}/current/stages/{sub-arch}/filename.tar.bz2 |
40 | /releases/{architecture ex. x86}/current/stages/{sub-arch}/filename.tar.bz2 \ |
| 51 | """ |
41 | """ |
| 52 | |
42 | |
| 53 | def __init__(self, controller): |
43 | def __init__(self, controller): |
| 54 | GLIScreen.GLIScreen.__init__(self, controller) |
44 | GLIScreen.GLIScreen.__init__(self, controller) |
| 55 | |
45 | |
| 56 | self.has_systempkgs = GLIUtility.is_file("/usr/livecd/systempkgs.txt") |
46 | self.has_systempkgs = GLIUtility.is_file("/usr/livecd/systempkgs.txt") |
| 57 | |
47 | |
| 58 | vert = gtk.VBox(False, 0) |
48 | vert = gtk.VBox(False, 0) |
| 59 | vert.set_border_width(10) |
49 | vert.set_border_width(10) |
| 60 | |
50 | |
| 61 | content_str = """Here, you will select which stage you would like to start your install from. |
|
|
| 62 | Each option has a brief description beside it. |
|
|
| 63 | """ |
|
|
| 64 | content_label = gtk.Label(content_str) |
|
|
| 65 | vert.pack_start(content_label, expand=False, fill=False, padding=0) |
|
|
| 66 | self.radio_stages[1] = gtk.RadioButton(None, "Stage 1") |
51 | self.radio_fetchstage = gtk.RadioButton(None, "Fetch stage from internet") |
| 67 | self.radio_stages[1].set_name("1") |
52 | self.radio_fetchstage.set_name("fetch") |
| 68 | self.radio_stages[1].connect("toggled", self.stage_selected, "1") |
53 | self.radio_fetchstage.connect("toggled", self.stage_selected, "fetch") |
| 69 | self.radio_stages[1].set_size_request(100, -1) |
54 | # self.radio_fetchstage.set_size_request(100, -1) |
| 70 | hbox = gtk.HBox(False, 0) |
55 | hbox = gtk.HBox(False, 0) |
| 71 | hbox.pack_start(self.radio_stages[1], expand=False, fill=False, padding=5) |
56 | hbox.pack_start(self.radio_fetchstage, expand=False, fill=False, padding=5) |
| 72 | tmplabel = gtk.Label("The entire system will be compiled from scratch with your CHOST and CFLAGS settings (unsupported)") |
|
|
| 73 | tmplabel.set_line_wrap(True) |
|
|
| 74 | hbox.pack_start(tmplabel, expand=False, fill=False, padding=20) |
|
|
| 75 | vert.pack_start(hbox, expand=False, fill=False, padding=10) |
|
|
| 76 | self.radio_stages[2] = gtk.RadioButton(self.radio_stages[1], "Stage 2") |
|
|
| 77 | self.radio_stages[2].set_name("2") |
|
|
| 78 | self.radio_stages[2].connect("toggled", self.stage_selected, "2") |
|
|
| 79 | self.radio_stages[2].set_size_request(100, -1) |
|
|
| 80 | hbox = gtk.HBox(False, 0) |
|
|
| 81 | hbox.pack_start(self.radio_stages[2], expand=False, fill=False, padding=5) |
|
|
| 82 | tmplabel = gtk.Label("Most of the system will be compiled with your CHOST and CFLAGS settings. Don't use this option unless you have a good reason (unsupported)") |
|
|
| 83 | tmplabel.set_line_wrap(True) |
|
|
| 84 | hbox.pack_start(tmplabel, expand=False, fill=False, padding=20) |
|
|
| 85 | vert.pack_start(hbox, expand=False, fill=False, padding=10) |
|
|
| 86 | |
|
|
| 87 | self.radio_stages[3] = gtk.RadioButton(self.radio_stages[1], "Stage 3") |
|
|
| 88 | self.radio_stages[3].set_name("3") |
|
|
| 89 | self.radio_stages[3].connect("toggled", self.stage_selected, "3") |
|
|
| 90 | self.radio_stages[3].set_size_request(100, -1) |
|
|
| 91 | hbox = gtk.HBox(False, 0) |
|
|
| 92 | hbox.pack_start(self.radio_stages[3], expand=False, fill=False, padding=5) |
|
|
| 93 | tmplabel = gtk.Label("The base system will be installed using precompiled packages. You can recompile later with your custom settings if you choose. This is the fastest option") |
|
|
| 94 | tmplabel.set_line_wrap(True) |
|
|
| 95 | hbox.pack_start(tmplabel, expand=False, fill=False, padding=20) |
|
|
| 96 | vert.pack_start(hbox, expand=False, fill=False, padding=10) |
|
|
| 97 | |
|
|
| 98 | self.check_grp = gtk.CheckButton("GRP Install") |
|
|
| 99 | self.check_grp.set_sensitive(False) |
|
|
| 100 | self.check_grp.set_size_request(100, -1) |
|
|
| 101 | hbox = gtk.HBox(False, 0) |
|
|
| 102 | hbox.pack_start(self.check_grp, expand=False, fill=False, padding=5) |
|
|
| 103 | tmplabel = gtk.Label("Any extra packages installed (beyond the stage3) will be installed using binaries from the LiveCD that you are installing from") |
|
|
| 104 | tmplabel.set_line_wrap(True) |
|
|
| 105 | hbox.pack_start(tmplabel, expand=False, fill=False, padding=20) |
|
|
| 106 | vert.pack_start(hbox, expand=False, fill=False, padding=10) |
|
|
| 107 | |
|
|
| 108 | self.check_dynamic = gtk.CheckButton("Dynamic") |
|
|
| 109 | self.check_dynamic.set_sensitive(False) |
|
|
| 110 | self.check_dynamic.connect("toggled", self.dynamic_checked) |
|
|
| 111 | self.check_dynamic.set_size_request(100, -1) |
|
|
| 112 | if not self.has_systempkgs: |
|
|
| 113 | self.check_dynamic.set_sensitive(False) |
|
|
| 114 | hbox = gtk.HBox(False, 0) |
|
|
| 115 | hbox.pack_start(self.check_dynamic, expand=False, fill=False, padding=5) |
|
|
| 116 | tmplabel = gtk.Label("The stage3 will be generated from the packages on the LiveCD") |
|
|
| 117 | tmplabel.set_line_wrap(True) |
|
|
| 118 | hbox.pack_start(tmplabel, expand=False, fill=False, padding=20) |
|
|
| 119 | vert.pack_start(hbox, expand=False, fill=False, padding=10) |
57 | vert.pack_start(hbox, expand=False, fill=False, padding=10) |
| 120 | |
58 | |
| 121 | hbox = gtk.HBox(False, 0) |
59 | hbox = gtk.HBox(False, 0) |
| 122 | hbox.pack_start(gtk.Label("Stage tarball URI:"), expand=False, fill=False, padding=5) |
60 | # hbox.pack_start(gtk.Label("Stage tarball URI:"), expand=False, fill=False, padding=30) |
| 123 | self.entry_stage_tarball_uri = gtk.Entry() |
61 | self.entry_stage_tarball_uri = gtk.Entry() |
| 124 | self.entry_stage_tarball_uri.set_width_chars(50) |
62 | self.entry_stage_tarball_uri.set_width_chars(70) |
| 125 | hbox.pack_start(self.entry_stage_tarball_uri, expand=False, fill=False, padding=10) |
63 | hbox.pack_start(self.entry_stage_tarball_uri, expand=False, fill=False, padding=30) |
| 126 | self.browse_uri = gtk.Button(" ... ") |
64 | self.browse_uri = gtk.Button("Browse") |
| 127 | self.browse_uri.connect("clicked", self.browse_uri_clicked) |
65 | self.browse_uri.connect("clicked", self.browse_uri_clicked) |
| 128 | hbox.pack_start(self.browse_uri, expand=False, fill=False, padding=5) |
66 | hbox.pack_start(self.browse_uri, expand=False, fill=False, padding=0) |
|
|
67 | vert.pack_start(hbox, expand=False, fill=False, padding=5) |
|
|
68 | |
|
|
69 | # self.check_grp = gtk.CheckButton("GRP Install") |
|
|
70 | # self.check_grp.set_sensitive(False) |
|
|
71 | # self.check_grp.set_size_request(100, -1) |
|
|
72 | # hbox = gtk.HBox(False, 0) |
|
|
73 | # hbox.pack_start(self.check_grp, expand=False, fill=False, padding=5) |
|
|
74 | # tmplabel = gtk.Label("Any extra packages installed (beyond the stage3) will be installed using binaries from the LiveCD that you are installing from") |
|
|
75 | # tmplabel.set_line_wrap(True) |
|
|
76 | # hbox.pack_start(tmplabel, expand=False, fill=False, padding=20) |
|
|
77 | # vert.pack_start(hbox, expand=False, fill=False, padding=10) |
|
|
78 | |
|
|
79 | self.radio_dynamicstage = gtk.RadioButton(self.radio_fetchstage, "Build stage from files on LiveCD") |
|
|
80 | self.radio_dynamicstage.set_name("dynamic") |
|
|
81 | self.radio_dynamicstage.connect("toggled", self.stage_selected, "dynamic") |
|
|
82 | # self.radio_dynamicstage.set_size_request(100, -1) |
|
|
83 | hbox = gtk.HBox(False, 0) |
|
|
84 | hbox.pack_start(self.radio_dynamicstage, expand=False, fill=False, padding=5) |
| 129 | vert.pack_end(hbox, expand=False, fill=False, padding=0) |
85 | vert.pack_start(hbox, expand=False, fill=False, padding=40) |
| 130 | |
86 | |
| 131 | self.add_content(vert) |
87 | self.add_content(vert) |
| 132 | |
88 | |
| 133 | def browse_uri_clicked(self, widget): |
89 | def browse_uri_clicked(self, widget): |
| 134 | uribrowser = URIBrowser.URIBrowser(self, self.entry_stage_tarball_uri) |
90 | uribrowser = URIBrowser.URIBrowser(self, self.entry_stage_tarball_uri) |
| 135 | uribrowser.run(self.entry_stage_tarball_uri.get_text()) |
91 | uribrowser.run(self.entry_stage_tarball_uri.get_text()) |
| 136 | |
92 | |
| 137 | def stage_selected(self, widget, data=None): |
93 | def stage_selected(self, widget, data=None): |
| 138 | self.active_selection = int(data) |
94 | if data == "fetch": |
| 139 | self.entry_stage_tarball_uri.set_sensitive(True) |
95 | self.entry_stage_tarball_uri.set_sensitive(True) |
| 140 | if int(data) == 3: |
|
|
| 141 | self.check_grp.set_sensitive(True) |
|
|
| 142 | if self.has_systempkgs: |
|
|
| 143 | self.check_dynamic.set_sensitive(True) |
|
|
| 144 | if self.check_dynamic.get_active(): |
|
|
| 145 | self.entry_stage_tarball_uri.set_sensitive(False) |
|
|
| 146 | self.browse_uri.set_sensitive(False) |
96 | self.browse_uri.set_sensitive(True) |
| 147 | else: |
97 | else: |
| 148 | self.check_grp.set_sensitive(False) |
|
|
| 149 | self.check_dynamic.set_sensitive(False) |
|
|
| 150 | |
|
|
| 151 | def dynamic_checked(self, widget): |
|
|
| 152 | if widget.get_active() and self.active_selection == 3: |
|
|
| 153 | self.entry_stage_tarball_uri.set_sensitive(False) |
98 | self.entry_stage_tarball_uri.set_sensitive(False) |
| 154 | self.browse_uri.set_sensitive(False) |
99 | self.browse_uri.set_sensitive(False) |
| 155 | else: |
|
|
| 156 | self.entry_stage_tarball_uri.set_sensitive(True) |
|
|
| 157 | self.browse_uri.set_sensitive(True) |
|
|
| 158 | |
100 | |
| 159 | def activate(self): |
101 | def activate(self): |
| 160 | self.controller.SHOW_BUTTON_EXIT = True |
102 | self.controller.SHOW_BUTTON_EXIT = True |
| 161 | self.controller.SHOW_BUTTON_HELP = True |
|
|
| 162 | self.controller.SHOW_BUTTON_BACK = True |
103 | self.controller.SHOW_BUTTON_BACK = False |
| 163 | self.controller.SHOW_BUTTON_FORWARD = True |
104 | self.controller.SHOW_BUTTON_FORWARD = True |
| 164 | self.controller.SHOW_BUTTON_FINISH = False |
105 | self.controller.SHOW_BUTTON_FINISH = False |
| 165 | self.active_selection = int(self.controller.install_profile.get_install_stage()) or 3 |
106 | # self.active_selection = int(self.controller.install_profile.get_install_stage()) or 3 |
| 166 | self.radio_stages[self.active_selection].set_active(True) |
107 | # self.radio_stages[self.active_selection].set_active(True) |
| 167 | self.entry_stage_tarball_uri.set_text(self.controller.install_profile.get_stage_tarball_uri()) |
108 | self.entry_stage_tarball_uri.set_text(self.controller.install_profile.get_stage_tarball_uri()) |
| 168 | self.check_grp.set_active(self.controller.install_profile.get_grp_install()) |
109 | # self.check_grp.set_active(self.controller.install_profile.get_grp_install()) |
| 169 | self.check_dynamic.set_active(self.controller.install_profile.get_dynamic_stage3()) |
110 | # self.check_dynamic.set_active(self.controller.install_profile.get_dynamic_stage3()) |
| 170 | if self.controller.install_type == "networkless": |
111 | # if self.controller.install_type == "networkless": |
| 171 | self.radio_stages[1].set_sensitive(False) |
112 | # self.radio_stages[1].set_sensitive(False) |
| 172 | self.radio_stages[2].set_sensitive(False) |
113 | # self.radio_stages[2].set_sensitive(False) |
| 173 | self.entry_stage_tarball_uri.set_sensitive(False) |
114 | # self.entry_stage_tarball_uri.set_sensitive(False) |
| 174 | self.browse_uri.set_sensitive(False) |
115 | # self.browse_uri.set_sensitive(False) |
| 175 | self.check_grp.set_active(True) |
116 | # self.check_grp.set_active(True) |
| 176 | self.check_grp.set_sensitive(False) |
117 | # self.check_grp.set_sensitive(False) |
| 177 | self.check_dynamic.set_active(True) |
118 | # self.check_dynamic.set_active(True) |
| 178 | self.check_dynamic.set_sensitive(False) |
119 | # self.check_dynamic.set_sensitive(False) |
| 179 | |
120 | |
| 180 | def deactivate(self): |
121 | def deactivate(self): |
| 181 | if not self.check_dynamic.get_active(): |
122 | # if not self.check_dynamic.get_active(): |
| 182 | if not self.entry_stage_tarball_uri.get_text(): |
123 | # if not self.entry_stage_tarball_uri.get_text(): |
| 183 | msgdlg = gtk.MessageDialog(parent=self.controller.window, type=gtk.MESSAGE_QUESTION, buttons=gtk.BUTTONS_YES_NO, message_format="You did not enter a stage tarball URI. You cannot complete an installation until you set this value. Continue?") |
124 | # msgdlg = gtk.MessageDialog(parent=self.controller.window, type=gtk.MESSAGE_QUESTION, buttons=gtk.BUTTONS_YES_NO, message_format="You did not enter a stage tarball URI. You cannot complete an installation until you set this value. Continue?") |
| 184 | resp = msgdlg.run() |
125 | # resp = msgdlg.run() |
| 185 | msgdlg.destroy() |
126 | # msgdlg.destroy() |
| 186 | if resp == gtk.RESPONSE_NO: |
127 | # if resp == gtk.RESPONSE_NO: |
| 187 | return False |
128 | # return False |
| 188 | elif not GLIUtility.validate_uri(self.entry_stage_tarball_uri.get_text()): |
129 | # elif not GLIUtility.validate_uri(self.entry_stage_tarball_uri.get_text()): |
| 189 | msgdlg = gtk.MessageDialog(parent=self.controller.window, type=gtk.MESSAGE_QUESTION, buttons=gtk.BUTTONS_YES_NO, message_format="The stage tarball URI you entered does not exist. You cannot complete an installation until this value is a valid. Continue?") |
130 | # msgdlg = gtk.MessageDialog(parent=self.controller.window, type=gtk.MESSAGE_QUESTION, buttons=gtk.BUTTONS_YES_NO, message_format="The stage tarball URI you entered does not exist. You cannot complete an installation until this value is a valid. Continue?") |
| 190 | resp = msgdlg.run() |
131 | # resp = msgdlg.run() |
| 191 | msgdlg.destroy() |
132 | # msgdlg.destroy() |
| 192 | if resp == gtk.RESPONSE_NO: |
133 | # if resp == gtk.RESPONSE_NO: |
| 193 | return False |
134 | # return False |
| 194 | elif self.active_selection == 3 and self.check_grp.get_active() and self.has_systempkgs: |
135 | # elif self.active_selection == 3 and self.check_grp.get_active() and self.has_systempkgs: |
| 195 | msgdlg = gtk.MessageDialog(parent=self.controller.window, type=gtk.MESSAGE_QUESTION, buttons=gtk.BUTTONS_YES_NO, message_format="When doing a GRP install, it is recommended to use the Dynamic option instead of selecting your own tarball. Continue?") |
136 | # msgdlg = gtk.MessageDialog(parent=self.controller.window, type=gtk.MESSAGE_QUESTION, buttons=gtk.BUTTONS_YES_NO, message_format="When doing a GRP install, it is recommended to use the Dynamic option instead of selecting your own tarball. Continue?") |
| 196 | resp = msgdlg.run() |
137 | # resp = msgdlg.run() |
| 197 | msgdlg.destroy() |
138 | # msgdlg.destroy() |
| 198 | if resp == gtk.RESPONSE_NO: |
139 | # if resp == gtk.RESPONSE_NO: |
| 199 | return False |
140 | # return False |
| 200 | self.controller.install_profile.set_install_stage(None, self.active_selection, None) |
141 | # self.controller.install_profile.set_install_stage(None, self.active_selection, None) |
| 201 | if self.active_selection == 3: |
142 | # if self.active_selection == 3: |
| 202 | self.controller.install_profile.set_grp_install(None, self.check_grp.get_active(), None) |
143 | # self.controller.install_profile.set_grp_install(None, self.check_grp.get_active(), None) |
| 203 | self.controller.install_profile.set_dynamic_stage3(None, self.check_dynamic.get_active(), None) |
144 | # self.controller.install_profile.set_dynamic_stage3(None, self.check_dynamic.get_active(), None) |
| 204 | else: |
145 | # else: |
| 205 | self.controller.install_profile.set_grp_install(None, False, None) |
146 | # self.controller.install_profile.set_grp_install(None, False, None) |
| 206 | try: self.controller.install_profile.set_stage_tarball_uri(None, self.entry_stage_tarball_uri.get_text(), None) |
147 | # try: self.controller.install_profile.set_stage_tarball_uri(None, self.entry_stage_tarball_uri.get_text(), None) |
| 207 | except: pass |
148 | # except: pass |
| 208 | return True |
149 | return True |