From owner-p4-projects@FreeBSD.ORG Thu Sep 28 11:42:49 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DFA3F16A47B; Thu, 28 Sep 2006 11:42:48 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9D4FB16A415 for ; Thu, 28 Sep 2006 11:42:48 +0000 (UTC) (envelope-from soc-andrew@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9B4E943D68 for ; Thu, 28 Sep 2006 11:42:42 +0000 (GMT) (envelope-from soc-andrew@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k8SBggFG079648 for ; Thu, 28 Sep 2006 11:42:42 GMT (envelope-from soc-andrew@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k8SBggPZ079645 for perforce@freebsd.org; Thu, 28 Sep 2006 11:42:42 GMT (envelope-from soc-andrew@freebsd.org) Date: Thu, 28 Sep 2006 11:42:42 GMT Message-Id: <200609281142.k8SBggPZ079645@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to soc-andrew@freebsd.org using -f From: soc-andrew To: Perforce Change Reviews Cc: Subject: PERFORCE change 106813 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Sep 2006 11:42:49 -0000 http://perforce.freebsd.org/chv.cgi?CH=106813 Change 106813 by soc-andrew@soc-andrew_serv on 2006/09/28 11:41:51 Update the pre-install tasks to the newer snapshot Affected files ... .. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/pit/050_welcome.lua#3 edit .. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/pit/100_select_language.lua#3 edit .. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/pit/150_configure_console.lua#2 edit .. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/pit/400_load_kernel_modules.lua#3 edit .. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/pit/800_configure_network.lua#3 edit .. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/pit/main.lua#3 edit Differences ... ==== //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/pit/050_welcome.lua#3 (text+ko) ==== @@ -1,74 +1,73 @@ --- $Id: 050_welcome.lua,v 1.10 2005/08/26 04:25:25 cpressey Exp $ +-- $Id: 050_welcome.lua,v 1.12 2006/09/13 23:43:26 cpressey Exp $ -- -- "Welcome screen" for the BSD Installer. -- -return { - id = "welcome", - name = _("Welcome Screen"), - effect = function(step) - local result = App.ui:present({ - id = "welcome", - name = _("Welcome to the BSD Installer!"), - short_desc = _( - "Welcome to the BSD Installer!\n\n" .. - "Before we begin, you will be asked a few questions " .. - "so that this installation environment can be set up " .. - "to suit your needs.\n\n" .. - "You will then be presented a menu of items from which " .. - "you may select to install a new system, or configure " .. - "or upgrade an existing system." - ), - actions = { - { - id = "ok", - name = _("Proceed"), - short_desc = _("Set up the installation environment and continue") - }, - { - id = "skip", - accelerator = "ESC", - -- - -- XXX This should really be something more like this: - -- name = _("Skip to %s", step:get_upper_name()) - -- ...but current technical limitations prevent this. - -- (The pre-install tasks are invoked explicitly from - -- the main script, and not from the Select Task menu.) - -- - name = _("Skip to Select Task Menu"), - short_desc = _("Don't configure the environment; accept the default settings and continue") - }, - { - id = "reboot", - name = _("Reboot"), - short_desc = _("Reboot this computer") - }, - { - id = "exit", - name = _("Exit to %s", App.conf.media_name), - short_desc = _("Cancel this process and return to a command prompt") - } - } - }).action_id +id = "welcome" +name = _("Welcome Screen") + +effect = function(step) + local result = App.ui:present({ + id = "welcome", + name = _("Welcome to the BSD Installer!"), + short_desc = _( + "Welcome to the BSD Installer!\n\n" .. + "Before we begin, you will be asked a few questions " .. + "so that this installation environment can be set up " .. + "to suit your needs.\n\n" .. + "You will then be presented a menu of items from which " .. + "you may select to install a new system, or configure " .. + "or upgrade an existing system." + ), + actions = { + { + id = "ok", + name = _("Proceed"), + short_desc = _("Set up the installation environment and continue") + }, + { + id = "skip", + accelerator = "ESC", + -- + -- XXX This should really be something more like this: + -- name = _("Skip to %s", step:get_upper_name()) + -- ...but current technical limitations prevent this. + -- (The pre-install tasks are invoked explicitly from + -- the main script, and not from the Select Task menu.) + -- + name = _("Skip to Select Task Menu"), + short_desc = _("Don't configure the environment; accept the default settings and continue") + }, + { + id = "reboot", + name = _("Reboot"), + short_desc = _("Reboot this computer") + }, + { + id = "exit", + name = _("Exit to %s", App.conf.media_name), + short_desc = _("Cancel this process and return to a command prompt") + } + } + }).action_id - if result == "ok" then - return step:next() - elseif result == "skip" then - return nil - elseif result == "reboot" then - if TargetSystemUI.ask_reboot{ - cancel_desc = _("Return to %s", step:get_name()) - } then - App.state.do_reboot = true - return nil - else - return step - end - return nil - elseif result == "exit" then - App.state.do_exit = true - return nil + if result == "ok" then + return step:next() + elseif result == "skip" then + return nil + elseif result == "reboot" then + if App.state.source:ask_reboot{ + cancel_desc = _("Return to %s", step:get_name()) + } then + App.state.do_reboot = true + return nil + else + return step end + return nil + elseif result == "exit" then + App.state.do_exit = true + return nil end -} +end ==== //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/pit/100_select_language.lua#3 (text+ko) ==== @@ -1,120 +1,121 @@ --- $Id: 100_select_language.lua,v 1.18 2005/08/28 23:36:49 cpressey Exp $ +-- $Id: 100_select_language.lua,v 1.19 2006/09/13 23:43:26 cpressey Exp $ + +id = "select_language" +name = _("Select Language") -- -- If gettext isn't enabled, skip this Step - just don't return anything -- from this scriptlet, and the Flow object will not generate a Step. -- -if not GetText then - return nil +condition = function() + if not GetText then + return false, "GetText module is not available" + end + return true end -return { - id = "select_language", - name = _("Select Language"), - effect = function(step) - local actions = { - { - id = "default", - name = _("Default (English)"), - short_desc = _("Do not apply any language translation"), - accelerator = "ESC" - } - } +effect = function(step) + local actions = { + { + id = "default", + name = _("Default (English)"), + short_desc = _("Do not apply any language translation"), + accelerator = "ESC" + } + } + + -- + -- Load list of available languages from configuration file. + -- + local languages = App.conf.languages + + -- + -- If no languages are available, just skip this step. + -- + if not languages or table.getn(languages) == 0 then + return step:next() + end + + -- + -- Create actions for this dialog box, corresponding to available + -- languages. + -- XXX sort languages table by id, first + -- XXX also create table indexed by id, for lookup in messages? + -- + local i, lang_tab + for i, lang_tab in languages do + table.insert(actions, { + id = lang_tab.id, + name = lang_tab.name, + short_desc = lang_tab.short_desc + }) + end - -- - -- Load list of available languages from configuration file. - -- - local languages = App.conf.languages + local sel_lang_id = App.ui:present({ + id = "select_language", + name = _("Select Language"), + short_desc = _("Please select the language you wish you use."), + role = "menu", + actions = actions + }).action_id + if sel_lang_id == "default" then + App.state.lang_id = nil + else -- - -- If no languages are available, just skip this step. + -- Set up appropriate keymap, screenmap, and console fonts. -- - if not languages or table.getn(languages) == 0 then - return step:next() + if not App.ui:set("lang_syscons", sel_lang_id) then + App.ui:inform(_( + "Unable to apply console settings " .. + "for language '%s'.", sel_lang_id + )) + return step end -- - -- Create actions for this dialog box, corresponding to available - -- languages. - -- XXX sort languages table by id, first - -- XXX also create table indexed by id, for lookup in messages? + -- Set up appropriate environment variables. -- - local i, lang_tab - for i, lang_tab in languages do - table.insert(actions, { - id = lang_tab.id, - name = lang_tab.name, - short_desc = lang_tab.short_desc - }) + if not App.ui:set("lang_envars", sel_lang_id) then + App.ui:inform(_( + "Unable to set environment variables " .. + "for language '%s'.", sel_lang_id + )) + return step end - local sel_lang_id = App.ui:present({ - id = "select_language", - name = _("Select Language"), - short_desc = _("Please select the language you wish you use."), - role = "menu", - actions = actions - }).action_id + if not App.ui:set("lang", sel_lang_id) then + App.ui:inform(_( + "Unable to inform the user interface that " .. + "it should now use language '%s'.", sel_lang_id + )) + return step + end - if sel_lang_id == "default" then - App.state.lang_id = nil - else - -- - -- Set up appropriate keymap, screenmap, and console fonts. - -- - if not App.ui:set("lang_syscons", sel_lang_id) then - App.ui:inform(_( - "Unable to apply console settings " .. - "for language '%s'.", sel_lang_id - )) - return step - end + -- + -- Finally, let gettext know about the change of + -- the selected language: + -- + GetText.notify_change() - -- - -- Set up appropriate environment variables. - -- - if not App.ui:set("lang_envars", sel_lang_id) then - App.ui:inform(_( - "Unable to set environment variables " .. - "for language '%s'.", sel_lang_id - )) - return step - end + -- + -- And record it in App.state so that future decisions + -- can be made based on it: + -- + App.state.lang_id = sel_lang_id - if not App.ui:set("lang", sel_lang_id) then - App.ui:inform(_( - "Unable to inform the user interface that " .. - "it should now use language '%s'.", sel_lang_id - )) - return step - end - - -- - -- Finally, let gettext know about the change of - -- the selected language: - -- - GetText.notify_change() - - -- - -- And record it in App.state so that future decisions - -- can be made based on it: - -- - App.state.lang_id = sel_lang_id - - -- - -- Record the associated console settings, too. - -- - for i, lang_tab in languages do - if lang_tab.id == App.state.lang_id then - App.state.vidfont = lang_tab.vidfont - App.state.scrnmap = lang_tab.scrnmap - App.state.keymap = lang_tab.keymap - break - end - end - + -- + -- Record the associated console settings, too. + -- + for i, lang_tab in languages do + if lang_tab.id == App.state.lang_id then + App.state.vidfont = lang_tab.vidfont + App.state.scrnmap = lang_tab.scrnmap + App.state.keymap = lang_tab.keymap + break + end end + end - return step:next() - end -} + return step:next() +end ==== //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/pit/150_configure_console.lua#2 (text+ko) ==== @@ -1,13 +1,11 @@ --- $Id: 150_configure_console.lua,v 1.4 2005/08/04 22:00:40 cpressey Exp $ +-- $Id: 150_configure_console.lua,v 1.6 2006/09/13 23:43:26 cpressey Exp $ + +id = "configure_console" +name = _("Configure Console") -return { - id = "configure_console", - name = _("Configure Console"), - effect = function(step) - TargetSystemUI.configure_console{ - ts = App.state.source, - allow_cancel = false - } - return step:next() - end -} +effect = function(step) + App.state.source:configure_console{ + allow_cancel = false + } + return step:next() +end ==== //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/pit/400_load_kernel_modules.lua#3 (text+ko) ==== @@ -1,52 +1,51 @@ --- $Id: 400_load_kernel_modules.lua,v 1.5 2005/07/20 04:26:39 cpressey Exp $ +-- $Id: 400_load_kernel_modules.lua,v 1.6 2006/09/13 23:43:26 cpressey Exp $ -return { - id = "load_kernel_modules", - name = _("Load Kernel Modules"), - effect = function(step) - -- - -- Select a file. - -- - local dir = App.expand("${root}${MODULES_DIR}") +id = "load_kernel_modules" +name = _("Load Kernel Modules") - local filename = App.ui:select_file{ - title = _("Select Kernel Module to Load"), - short_desc = _( - "You may wish to load some kernel modules before " .. - "using the system (for example, to enable network " .. - "interfaces which require drivers which are not " .. - "included in the kernel by default.) You may " .. - "select a kernel module to load here." - ), - cancel_desc = _("Do not Load any Further Kernel Modules"), - cancel_pos = "top", - dir = dir, - predicate = function(filename) - return string.find(filename, "%.ko$") - end - } +effect = function(step) + -- + -- Select a file. + -- + local dir = App.expand("${root}${MODULES_DIR}") - if filename == "cancel" then - return step:next() - else - local cmds = CmdChain.new() + local filename = App.ui:select_file{ + title = _("Select Kernel Module to Load"), + short_desc = _( + "You may wish to load some kernel modules before " .. + "using the system (for example, to enable network " .. + "interfaces which require drivers which are not " .. + "included in the kernel by default.) You may " .. + "select a kernel module to load here." + ), + cancel_desc = _("Do not Load any Further Kernel Modules"), + cancel_pos = "top", + dir = dir, + predicate = function(filename) + return string.find(filename, "%.ko$") + end + } - cmds:add("${root}${KLDLOAD} ${root}modules/" .. filename) + if filename == "cancel" then + return step:next() + else + local cmds = CmdChain.new() - if cmds:execute() then - App.ui:inform(_( - "Kernel module '%s' was successfully loaded.", - filename - )) - else - App.ui:inform(_( - "Warning: kernel module '%s' could not " .. - "successfully be loaded.", - filename - )) - end + cmds:add("${root}${KLDLOAD} ${root}modules/" .. filename) - return step + if cmds:execute() then + App.ui:inform(_( + "Kernel module '%s' was successfully loaded.", + filename + )) + else + App.ui:inform(_( + "Warning: kernel module '%s' could not " .. + "successfully be loaded.", + filename + )) end + + return step end -} +end ==== //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/pit/800_configure_network.lua#3 (text+ko) ==== @@ -1,37 +1,36 @@ --- $Id: 800_configure_network.lua,v 1.17 2005/08/28 23:36:49 cpressey Exp $ +-- $Id: 800_configure_network.lua,v 1.18 2006/09/13 23:43:26 cpressey Exp $ -return { - id = "configure_network", - name = _("Configure your Network"), - req_state = { "net_if" }, - effect = function(step) - local actions, ifname, ni, result +id = "configure_network" +name = _("Configure your Network") +req_state = { "net_if" } - if App.state.net_if:ip_addr_count() > 0 then - -- - -- Looks like at least one interface is 'up'; - -- we assume that means it's already been - -- configured. - -- - return step:next() - end +effect = function(step) + local actions, ifname, ni, result - if not App.ui:confirm(_( - "You have not yet configured your network settings. " .. - "Would you like to do so now? (Having an operational " .. - "network connection will enhance the ability of " .. - "subsequent tasks, such as installing.)" - )) then - return step:next() - end + if App.state.net_if:ip_addr_count() > 0 then + -- + -- Looks like at least one interface is 'up'; + -- we assume that means it's already been + -- configured. + -- + return step:next() + end - ni = NetworkUI.select_interface(App.state.net_if) - if not ni then - return step:next() - end + if not App.ui:confirm(_( + "You have not yet configured your network settings. " .. + "Would you like to do so now? (Having an operational " .. + "network connection will enhance the ability of " .. + "subsequent tasks, such as installing.)" + )) then + return step:next() + end - NetworkUI.configure_interface(ni) - + ni = NetworkUI.select_interface(App.state.net_if) + if not ni then return step:next() end -} + + NetworkUI.configure_interface(ni) + + return step:next() +end ==== //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/pit/main.lua#3 (text+ko) ==== @@ -1,8 +1,8 @@ -- pit/main.lua --- $Id: main.lua,v 1.10 2005/04/22 04:57:07 cpressey Exp $ +-- $Id: main.lua,v 1.11 2006/09/02 16:36:55 cpressey Exp $ -- Flow for "pre-install tasks" Flow.new{ id = "pre_install_tasks", name = _("Pre-Install Tasks") -}:populate("."):run() +}:populate("."):present()