Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Sep 2005 00:14:49 GMT
From:      soc-andrew <soc-andrew@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 84455 for review
Message-ID:  <200509290014.j8T0EnIL062402@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=84455

Change 84455 by soc-andrew@soc-andrew_serv on 2005/09/29 00:14:07

	Update the Lua backend to the same snapshot as the libraries in 84408

Affected files ...

.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/200_install.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/400_configure.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/600_upgrade.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/800_netboot.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/Makefile#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/configure/100_choose_where_from.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/configure/200_select_disk.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/configure/300_select_part.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/configure/400_mount_target_system.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/configure/500_menu.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/configure/600_unmount_target_system.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/configure/main.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/configure/menu/100_set_root_password.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/configure/menu/200_add_user.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/configure/menu/300_set_timezone.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/configure/menu/350_set_datetime.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/configure/menu/400_change_console_settings.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/configure/menu/500_install_packages.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/configure/menu/550_remove_packages.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/configure/menu/main.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/install/100_welcome.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/install/200_select_disk.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/install/250_partition_disk.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/install/300_select_part.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/install/400_select_subparts.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/install/410_select_additional_filesystems.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/install/420_preselect_packages.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/install/450_select_packages.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/install/500_install_os.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/install/700_install_bootblocks.lua#2 delete
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/install/800_finished.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/install/900_reboot.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/install/main.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/lib/bitwise.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/lib/cmdchain.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/lib/configvars.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/lib/flow.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/lib/menu.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/lib/mountpoint.lua#2 delete
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/lib/network.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/lib/network_ui.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/lib/package.lua#3 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/lib/package_ui.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/lib/storage.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/lib/storage_ui.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/lib/target_system.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/lib/target_system_ui.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/lib/uinav.lua#3 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/main.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/netboot/500_setup_server.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/netboot/main.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/pit/050_welcome.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/pit/100_select_language.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/pit/400_load_kernel_modules.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/pit/800_configure_network.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/pit/main.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/po/dfuibe_lua.pot#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/po/ru.po#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/upgrade/100_begin_upgrade.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/upgrade/200_select_disk.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/upgrade/300_select_part.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/upgrade/400_mount_target_system.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/upgrade/500_perform_upgrade.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/upgrade/600_unmount_target_system.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/upgrade/main.lua#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/libexec/bsdinstaller/inst/Makefile#2 edit
.. //depot/projects/soc2005/bsdinstaller/src/libexec/bsdinstaller/lib/Makefile#2 edit

Differences ...

==== //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/200_install.lua#2 (text+ko) ====

@@ -1,11 +1,30 @@
--- $Id: 200_install.lua,v 1.8 2005/04/09 19:04:20 cpressey Exp $
+-- $Id: 200_install.lua,v 1.12 2005/08/30 00:39:05 cpressey Exp $
+
+--
+-- Menu.Item scriptlet that generates the install menu item.
+-- Note that, if we detect that we weren't started from the
+-- installation media, we don't provide this menu item.
+--
+
+if not App.conf.booted_from_install_media then
+	return nil, "not booted from install media"
+end
 
 return {
     id = "install_os",
-    name = _("Install %s", App.os.name),
-    short_desc = _("Install %s on this computer system", App.os.name),
+    name = _("Install %s", App.conf.product.name),
+    short_desc = _("Install %s on this computer system",
+		   App.conf.product.name),
     effect = function()
+	--
+	-- Make a recording of the install session.
+	-- XXX this might make more sense elsewhere, like as
+	-- Flow.Steps during the install itself?
+	--
+	CmdChain.record_to(App.expand("${tmp}install-session.sh"))
 	App.descend("install")
+	CmdChain.stop_recording()
+
 	return Menu.CONTINUE
     end
 }

==== //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/400_configure.lua#2 (text+ko) ====

@@ -1,10 +1,25 @@
--- $Id: 400_configure.lua,v 1.5 2005/04/09 19:04:20 cpressey Exp $
+-- $Id: 400_configure.lua,v 1.7 2005/08/26 04:25:24 cpressey Exp $
 
 return {
     id = "configure_installed_system",
     name = _("Configure an Installed System"),
-    short_desc = _("Configure a %s OS that has already been installed", App.os.name),
+    short_desc = _("Configure an existing %s installation",
+		   App.conf.product.name),
     effect = function()
+	--
+	-- If there is currently a target system mounted,
+	-- unmount it before starting.
+	--
+	if App.state.target ~= nil and App.state.target:is_mounted() then
+		if not App.state.target:unmount() then
+			App.ui:inform(
+			    _("Warning: already-mounted target system could " ..
+			      "not be correctly unmounted first.")
+			)
+			return step:prev()
+		end
+	end
+
 	App.descend("configure")
 	return Menu.CONTINUE
     end

==== //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/600_upgrade.lua#2 (text+ko) ====


==== //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/800_netboot.lua#2 (text+ko) ====


==== //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/Makefile#2 (text+ko) ====

@@ -1,41 +1,61 @@
-# BSD Makefile for dfuibe_lua.
-# $Id: Makefile,v 1.44 2005/04/21 10:04:12 den Exp $
+# Makefile for dfuibe_lua.
+# $Id: Makefile,v 1.55 2005/08/27 08:04:49 cpressey Exp $
+
+BASE?=../..
+include ${BASE}/Config
 
 PACKAGE=	dfuibe_lua
 
-.if defined(WITH_NLS)
-LOCALEDIR=	/usr/local/share/locale
+LUA?=		../../platform/lua
+COMPAT?=	../../lib/lua/compat-5.1
+
+MEDIAROOT?=	/usr/release/root
+OSNAME?=        DragonFly
+
 LANGUAGES=	ru
-.endif
 
 all:
-	@echo "No building required."
+	@echo "Nothing to build."
+
+clean:
+	rm -rf po/*.mo *.core
 
-# XXX this will probably be a little nightmarish to do right...
-in_cvs: all
+strip: all
+	@echo "Nothing to strip."
 
-clean:
-	rm -rf so/*.so po/*.mo
+nls: all mo
 
 pot:
 	cat `find . -name '*.lua' ! -regex '\./scripts/test/main.lua'` | \
 	    sed 's|\-\-|//|' | sed 's/\.\.//' | \
 	    xgettext -s -C --no-location --keyword=_ -o po/${PACKAGE}.pot -
 
+mo:
+	for _language in ${LANGUAGES}; do \
+		msgfmt -o po/$${_language}.mo po/$${_language}; \
+	done
+
+test:
+	su root -c "env LD_LIBRARY_PATH='../../lib/libaura:../../lib/libdfui:$(LUA)/lib' \
+	LUA_PATH='../../lib/lua/?/?.lua;../../lib/lua/luasocket/lua/?.lua' \
+	LUA_CPATH='../../lib/lua/posix/?.so;../../lib/lua/pty/?.so;../../lib/lua/dfui/?.so;../../lib/lua/luasocket/?.so' \
+	$(LUA)/bin/lua -lcompat-5.1 main.lua \
+	./conf/BSDInstaller.lua ./conf/${OSNAME}.lua \
+	dir.root=${MEDIAROOT} booted_from_install_media=true"
+
 # Create directory layout for binary distribution.
 
-DESTDIR?=/tmp/${PROG}
-distribution:
+distribution: strip
 	mkdir -p ${DESTDIR}/share/dfuibe_lua
 	cp *.lua ${DESTDIR}/share/dfuibe_lua/
 	for _subdir in lib conf pit install configure upgrade netboot; do \
-		mkdir -p ${DESTDIR}/dfuibe_lua/$${_subdir}; \
-		cp $${_subdir}/*.lua ${DESTDIR}/dfuibe_lua/$${_subdir}; \
+		mkdir -p ${DESTDIR}/share/dfuibe_lua/$${_subdir}; \
+		cp $${_subdir}/*.lua ${DESTDIR}/share/dfuibe_lua/$${_subdir}; \
 	done
-.if defined(WITH_NLS)
+
+distribution_nls: nls
 	for _language in ${LANGUAGES}; do \
 		mkdir -p ${DESTDIR}/share/locale/$${_language}/LC_MESSAGES; \
 		cp po/$${_language}.mo \
 		    ${LOCALEDIR}/$${_language}/LC_MESSAGES/${PROG}.mo; \
 	done
-.endif

==== //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/configure/100_choose_where_from.lua#2 (text+ko) ====

@@ -1,9 +1,33 @@
--- $Id: 100_choose_where_from.lua,v 1.10 2005/06/18 00:52:07 cpressey Exp $
+-- $Id: 100_choose_where_from.lua,v 1.16 2005/08/30 00:39:05 cpressey Exp $
+
+--
+-- Allow the user to select which system to configure.
+--
+-- If this detects that it was started from the install media, this
+-- step does not apply; that is, we're not allowed to configure the
+-- running system in this case (it is assumed to be immutable) and
+-- we skip straight to selecting which disk/partition to configure.
+--
+
+if App.conf.booted_from_install_media then
+	return nil, "was booted from install media"
+end
 
 return {
     id = "choose_target_system",
     name = _("Choose Target System"),
     effect = function(step)
+	--
+	-- If the user has already selected a TargetSystem (e.g. they are
+	-- coming here directly from the end of an install,) skip ahead.
+	--
+	if App.state.target ~= nil then
+		return step:next()
+	end
+
+	--
+	-- Ask the user where to configure.
+	--
 	local action_id = App.ui:present({
 	    id = "choose_target_system",
 	    name = _("Choose Target System"),

==== //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/configure/200_select_disk.lua#2 (text+ko) ====

@@ -1,10 +1,26 @@
--- $Id: 200_select_disk.lua,v 1.10 2005/06/15 00:18:42 cpressey Exp $
+-- $Id: 200_select_disk.lua,v 1.15 2005/08/26 04:25:24 cpressey Exp $
+
+--
+-- Allow the user to select the disk where the OS installation
+-- they want to configure resides.
+--
 
 return {
     id = "select_disk",
     name = _("Select Disk"),
     req_state = { "storage" },
     effect = function(step)
+	--
+	-- If the user has already selected a TargetSystem (e.g. they are
+	-- coming here directly from the end of an install,) skip ahead.
+	--
+	if App.state.target ~= nil then
+		return step:next()
+	end
+
+	--
+	-- Allow the user to select a disk.
+	--
 	App.state.sel_disk = nil
 	App.state.sel_part = nil
 
@@ -15,9 +31,9 @@
 		    "attached to this computer.  If you wish to "	..
 		    "configure an installation of %s "			..
 		    "on an unorthodox storage device, you will have to " ..
-		    "exit to a LiveCD command prompt and configure it "	..
+		    "exit to a %s command prompt and configure it "	..
 		    "manually, using the file /README as a guide.",
-		    App.os.name)
+		    App.conf.product.name, App.conf.media_name)
 		)
 		return nil
 	end
@@ -27,7 +43,7 @@
 	    short_desc = _(
 	        "Select the disk on which the installation of %s " ..
 		"that you wish to configure resides.",
-	        App.os.name),
+	        App.conf.product.name),
 	    cancel_desc = _("Return to %s", step:get_prev_name())
 	})
 

==== //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/configure/300_select_part.lua#2 (text+ko) ====

@@ -1,23 +1,48 @@
--- $Id: 300_select_part.lua,v 1.9 2005/06/15 00:18:42 cpressey Exp $
+-- $Id: 300_select_part.lua,v 1.13 2005/08/26 04:25:24 cpressey Exp $
+
+--
+-- Allow the user to select the BIOS partition where the OS
+-- they want to configure resides.
+--
 
 return {
     id = "select_part",
     name = _("Select Partition"),
     req_state = { "storage", "sel_disk" },
     effect = function(step)
+	--
+	-- If the user has already selected a TargetSystem (e.g. they are
+	-- coming here directly from the end of an install,) skip ahead.
+	--
+	if App.state.target ~= nil then
+		return step:next()
+	end
+
+	--
+	-- Allow the user to select a partition.
+	--
 	App.state.sel_part = nil
-
 	local pd = StorageUI.select_part({
 	    dd = App.state.sel_disk,
 	    short_desc = _(
 		"Select the primary partition of %s " ..
 		"on which the installation of %s resides.",
 		App.state.sel_disk:get_name(),
-		App.os.name),
+		App.conf.product.name),
 	   cancel_desc = _("Return to %s", step:get_prev_name())
 	})
 
 	if pd then
+		if pd:is_mounted() then
+			App.ui:inform(_(
+			    "One or more subpartitions on the selected "	..
+			    "primary partition already in use (they are "	..
+			    "currently mounted in the filesystem.) "		..
+			    "You should unmount them before proceeding."
+			))
+			return step
+		end
+
 		App.state.sel_part = pd
 		return step:next()
 	else

==== //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/configure/400_mount_target_system.lua#2 (text+ko) ====

@@ -1,4 +1,8 @@
--- $Id: 400_mount_target_system.lua,v 1.18 2005/06/15 00:18:42 cpressey Exp $
+-- $Id: 400_mount_target_system.lua,v 1.22 2005/08/04 22:00:40 cpressey Exp $
+
+--
+-- Mount the chosen system as the target system for configuration.
+--
 
 return {
     id = "mount_target_system",
@@ -7,19 +11,14 @@
     req_state = { "storage", "sel_disk", "sel_part" },
     effect = function(step)
 	--
-	-- If there is a target system mounted, unmount it before starting.
+	-- If the user has already mounted a TargetSystem (e.g. they are
+	-- coming here directly from the end of an install,) skip ahead.
 	--
 	if App.state.target ~= nil and App.state.target:is_mounted() then
-		if not App.state.target:unmount() then
-			App.ui:inform(
-			    _("Warning: already-mounted target system could " ..
-			      "not be correctly unmounted first.")
-			)
-			return step:prev()
-		end
+		return step:next()
 	end
 
-	App.state.target = TargetSystemUI.new{
+	App.state.target = TargetSystem.new{
 	    partition  = App.state.sel_part,
 	    base       = "mnt"
 	}
@@ -30,6 +29,7 @@
 		    "The target system could not be successfully probed:\n\n%s",
 		    errmsg
 		))
+		App.state.target = nil
 		return step:prev()
 	end
 	local ok, errmsg = App.state.target:mount()
@@ -39,6 +39,7 @@
 		    "The target system could not be successfully mounted:\n\n%s",
 		    errmsg
 		))
+		App.state.target = nil
 		return step:prev()
 	end
 

==== //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/configure/500_menu.lua#2 (text+ko) ====

@@ -1,4 +1,8 @@
--- $Id: 500_menu.lua,v 1.7 2005/06/15 00:18:42 cpressey Exp $
+-- $Id: 500_menu.lua,v 1.8 2005/07/08 21:24:09 cpressey Exp $
+
+--
+-- Display the configuration menu.
+--
 
 return {
     id = "configuration_menu",

==== //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/configure/600_unmount_target_system.lua#2 (text+ko) ====

@@ -1,4 +1,8 @@
--- $Id: 600_unmount_target_system.lua,v 1.7 2005/06/15 00:18:42 cpressey Exp $
+-- $Id: 600_unmount_target_system.lua,v 1.9 2005/07/13 04:32:22 cpressey Exp $
+
+--
+-- Unmount the target system once we are done with it.
+--
 
 return {
     id = "unmount_target_system",
@@ -7,6 +11,7 @@
     req_state = { "target" },
     effect = function(step)
 	if App.state.target:unmount() then
+		App.state.target = nil
 		return step:next()
 	else
 		App.ui:inform(

==== //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/configure/main.lua#2 (text+ko) ====

@@ -1,6 +1,9 @@
 -- configure/main.lua
--- $Id: main.lua,v 1.12 2005/04/22 04:57:06 cpressey Exp $
--- Main segment of the configurator.
+-- $Id: main.lua,v 1.13 2005/07/08 21:24:09 cpressey Exp $
+
+--
+-- Flow drive for Configuration Flow.
+--
 
 Flow.new{
     id = "configure",

==== //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/configure/menu/100_set_root_password.lua#2 (text+ko) ====

@@ -1,10 +1,10 @@
--- $Id: 100_set_root_password.lua,v 1.9 2005/04/23 02:55:36 cpressey Exp $
+-- $Id: 100_set_root_password.lua,v 1.10 2005/08/04 22:00:40 cpressey Exp $
 
 return {
     id = "set_root_password",
     name = _("Set Root Password"),
     effect = function()
-	App.state.target:ui_set_root_password()
+	TargetSystemUI.set_root_password(App.state.target)
 	return Menu.CONTINUE
     end
 }

==== //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/configure/menu/200_add_user.lua#2 (text+ko) ====

@@ -1,10 +1,10 @@
--- $Id: 200_add_user.lua,v 1.11 2005/04/23 02:55:36 cpressey Exp $
+-- $Id: 200_add_user.lua,v 1.12 2005/08/04 22:00:40 cpressey Exp $
 
 return {
     id = "add_user",
     name = _("Add User"),
     effect = function()
-	App.state.target:ui_add_user()
+	TargetSystemUI.add_user(App.state.target)
 	return Menu.CONTINUE
     end
 }

==== //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/configure/menu/300_set_timezone.lua#2 (text+ko) ====


==== //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/configure/menu/350_set_datetime.lua#2 (text+ko) ====


==== //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/configure/menu/400_change_console_settings.lua#2 (text+ko) ====

@@ -1,163 +1,14 @@
--- $Id: 400_change_console_settings.lua,v 1.5 2005/06/16 01:07:30 cpressey Exp $
-
-local set_keyboard_map = function()
-	local cmds, files, dir, filename, full_filename
+-- $Id: 400_change_console_settings.lua,v 1.8 2005/08/04 22:00:40 cpressey Exp $
 
-	--
-	-- Select a file.
-	--
-	dir = App.expand("${root}${base}usr/share/syscons/keymaps",
-	    {
-		base = App.state.target:get_base()
-	    }
-	)
-
-	filename = App.ui:select_file{
-	    title = _("Select Keyboard Map"),
-	    short_desc = _(
-		"Select a keyboard map appropriate to your keyboard layout."
-	    ),
-	    cancel_desc = _("Return to Utilities Menu"),
-	    dir = dir,
-	    predicate = function(filename)
-		return string.find(filename, "%.kbd$")
-	    end
-	}
-	if filename == "cancel" then
-		return false
-	end
-	filename = dir .. "/" .. filename
-
-	cmds = CmdChain.new()
-	cmds:add{
-	    cmdline = "${root}${KBDCONTROL} -l ${filename} < /dev/ttyv0",
-	    replacements = { filename = filename }
-	}
-	if cmds:execute() then
-		--[[
-			snprintf(filename, 256, "/usr/share/syscons/keymaps/%s", s);
-			snprintf(keymapname, 256, filename_noext(basename(filename)));
-			config_var_set(rc_conf, "keymap", keymapname);
-		]]--
-
-		return true
-	else
-		App.ui:inform(_(
-		    "Errors occurred; keyboard map was not successfully set."
-		))
-	end
-end
-
-local set_video_font = function()
-	local cmds, files, dir, filename, full_filename
-
-	--
-	-- Select a file.
-	--
-	dir = App.expand("${root}${base}usr/share/syscons/fonts",
-	    {
-		base = App.state.target:get_base()
-	    }
-	)
-
-	filename = App.ui:select_file{
-	    title = _("Select Console Font"),
-	    short_desc = _("Select a font appropriate to your video monitor and language."),
-	    cancel_desc = _("Return to Utilities Menu"),
-	    dir = dir,
-	    predicate = function(filename)
-		return string.find(filename, "%.fnt$")
-	    end
-	}
-	if filename == "cancel" then
-		return false
-	end
-	filename = dir .. "/" .. filename
-
-	cmds = CmdChain.new()
-	cmds:add{
-	    cmdline = "${root}${VIDCONTROL} -f ${filename} < /dev/ttyv0",
-	    replacements = { filename = filename }
-	}
-	if cmds:execute() then
-		local found, len, w, h = string.find(filename, "(%d+)x(%d+)")
-		if found then
-			w = tonumber(w)
-			h = tonumber(h)
-			--[[
-			snprintf(variable, 256, "font8x%d", by);
-			snprintf(filename, 256, "/usr/share/syscons/fonts/%s", s);
-			snprintf(fontname, 256, filename_noext(basename(filename)));
-			config_var_set(rc_conf, variable, fontname);
-			]]--
-		end
-
-		return true
-	else
-		App.ui:inform(_(
-		    "Errors occurred; video font was not successfully set."
-		))
-	end
-end
-
-
-local set_screen_map = function()
-	local cmds, files, dir, filename, full_filename
-
-	--
-	-- Select a file.
-	--
-	dir = App.expand("${root}${base}usr/share/syscons/scrnmaps",
-	    {
-		base = App.state.target:get_base()
-	    }
-	)
-
-	filename = App.ui:select_file{
-	    title = _("Select Screen Map"),
-	    short_desc = _(
-		"Select a mapping for translating characters as they " ..
-		"appear on your video console screen."
-	    ),
-	    cancel_desc = _("Return to Utilities Menu"),
-	    dir = dir,
-	    predicate = function(filename)
-		return string.find(filename, "%.scm$")
-	    end
-	}
-	if filename == "cancel" then
-		return false
-	end
-	filename = dir .. "/" .. filename
-
-	cmds = CmdChain.new()
-	cmds:add{
-	    cmdline = "${root}${VIDCONTROL} -l ${filename} < /dev/ttyv0",
-	    replacements = { filename = filename }
-	}
-	if cmds:execute() then
-		--[[
-		snprintf(filename, 256, "/usr/share/syscons/scrnmaps/%s", s);
-		snprintf(scrnmapname, 256, filename_noext(basename(filename)));
-		config_var_set(rc_conf, "scrnmap", scrnmapname);
-		]]--
-
-		return true
-	else
-		App.ui:inform(_(
-		    "Errors occurred; screen map was not successfully set."
-		))
-	end
-end
-
 return {
     id = "change_console_settings",
     name = _("Change Console Settings"),
     effect = function()
-	if set_video_font() and set_screen_map() and set_keyboard_map() then
-		-- everything was set.
-		-- XXX write to rc.conf ?
-	end
+        TargetSystemUI.configure_console{
+	    ts = App.state.target,
+	    allow_cancel = true,
+	    cancel_desc = _("Return to Configure Menu")
+	}
 	return Menu.CONTINUE
     end
 }

==== //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/configure/menu/500_install_packages.lua#2 (text+ko) ====

@@ -1,9 +1,21 @@
--- $Id: 500_install_packages.lua,v 1.14 2005/06/14 20:49:27 cpressey Exp $
+-- $Id: 500_install_packages.lua,v 1.18 2005/08/26 04:25:24 cpressey Exp $
 
 local install_packages = function()
 	local ok
+
+	--
+	-- Discover the packages installed on the installation medium
+	-- (available_pkgs) and those merely included in the directory
+	-- /usr/ports/packages/All on the installation medium
+	-- (included_pkgs).  Take their union into available_pkgs.
+	--
 	local available_pkgs = Package.Set.new()
-	available_pkgs:enumerate_installed_on(App.state.source)
+	available_pkgs:enumerate_present_on(App.state.source)
+
+	--
+	-- Figure out which packages are already installed, so that
+	-- the user is not asked if they want to install them again.
+	--
 	local installed_pkgs = Package.Set.new()
 	installed_pkgs:enumerate_installed_on(App.state.target)
 	local pkgs_not_yet_installed = available_pkgs:copy()
@@ -12,8 +24,9 @@
 
 	if pkgs_not_yet_installed:size() == 0 then
 		App.ui:inform(_(
-		    "All packages present on the installation medium " ..
-		    "are already installed on this system."
+		    "All packages present on the %s " ..
+		    "are already installed on this system.",
+		    App.conf.media_name
 		))
 		return
 	end
@@ -21,7 +34,7 @@
 	ok, sel_pkgs = PackageUI.select_packages{
 	    name = _("Select Packages"),
 	    short_desc = _("Select the packages you wish to install from " ..
-			    "the LiveCD onto the HDD."),
+			    "the %s onto the HDD.", App.conf.media_name),
 	    checkbox_name = _("Install?"),
 	    ok_name = _("Install these Packages"),
 	    cancel_name = _("Cancel"),

==== //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/configure/menu/550_remove_packages.lua#2 (text+ko) ====


==== //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/configure/menu/main.lua#2 (text+ko) ====


==== //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/install/100_welcome.lua#2 (text+ko) ====

@@ -1,4 +1,8 @@
--- $Id: 100_welcome.lua,v 1.12 2005/06/18 00:52:07 cpressey Exp $
+-- $Id: 100_welcome.lua,v 1.14 2005/08/26 04:25:24 cpressey Exp $
+
+--
+-- Show welcome information.
+--
 
 return {
     id = "welcome",
@@ -21,7 +25,7 @@
 		"NOTE! As with any installation process, YOU ARE "		..
 		"STRONGLY ENCOURAGED TO BACK UP ANY IMPORTANT DATA ON THIS "	..
 		"COMPUTER BEFORE PROCEEDING!",
-		App.os.name, App.os.name, App.os.name),
+		App.conf.product.name, App.conf.product.name, App.conf.product.name),
 	    long_desc = _(
 		"Some situations in which you might not wish to use this "	..
 		"installer are:\n\n"						..
@@ -30,12 +34,12 @@
 		"- you want to install %s "					..
 		"onto a ``dangerously dedicated'' disk; or\n"			..
 		"- you want full and utter control over the install process.",
-		App.os.name, App.os.name),
+		App.conf.product.name, App.conf.product.name),
 
 	    actions = {
 		{
 		    id = "proceed",
-		    name = _("Install %s", App.os.name),
+		    name = _("Install %s", App.conf.product.name),
 		    effect = function()
 			return step:next()
 		    end

==== //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/install/200_select_disk.lua#2 (text+ko) ====

@@ -1,4 +1,8 @@
--- $Id: 200_select_disk.lua,v 1.29 2005/06/15 00:36:24 cpressey Exp $
+-- $Id: 200_select_disk.lua,v 1.34 2005/08/26 04:25:24 cpressey Exp $
+
+--
+-- Select disk onto which to install.
+--
 
 return {
     id = "select_disk",
@@ -15,37 +19,25 @@
 		    "for installation (IDE or SCSI) attached to this "	..
 		    "computer.  If you wish to install %s"		..
 		    " on an unorthodox storage device, you will have to " ..
-		    "exit to a LiveCD command prompt and install it "	..
+		    "exit to a %s command prompt and install it "	..
 		    "manually, using the file /README as a guide.",
-		    App.os.name)
+		    App.conf.product.name, App.conf.media_name)
 		)
 		return nil
 	end
 
-	local dd = StorageUI.select_disk({
+	local dd = StorageUI.select_disk{
 	    sd = App.state.storage,
 	    short_desc = _("Select a disk on which to install %s.",
-	        App.os.name),
+	        App.conf.product.name),
 	    cancel_desc = _("Return to %s", step:get_prev_name())
-	})
+	}
 
 	if dd then
-		if dd:is_mounted() then
-			App.ui:inform(
-			    _("One or more subpartitions of one or more " ..
-			    "primary partitions of the selected disk "	  ..
-			    "are already in use (they are currently "	  ..
-			    "mounted on mountpoints in the filesystem.) " ..
-			    "You should either unmount them before "	  ..
-			    "proceeding, or select a different disk to "  ..
-			    "install %s on.", App.os.name))
-			return step
-		end
-
 		App.state.sel_disk = dd
 
 		local disk_min_capacity = Storage.Capacity.new(
-		    App.load_conf("limits").part_min
+		    App.conf.limits.part_min
 		)
 		if disk_min_capacity:exceeds(dd:get_capacity()) then
 			App.ui:inform(_(
@@ -56,7 +48,7 @@
 			    dd:get_name(),
 			    dd:get_capacity():format(),
 			    disk_min_capacity:format(),
-			    App.os.name)
+			    App.conf.product.name)
 			)
 		end
 

==== //depot/projects/soc2005/bsdinstaller/src/contrib/bsdinstaller/backend/lua/install/250_partition_disk.lua#2 (text+ko) ====

@@ -1,19 +1,17 @@
--- $Id: 250_partition_disk.lua,v 1.45 2005/06/18 22:13:53 cpressey Exp $
+-- $Id: 250_partition_disk.lua,v 1.78 2005/08/26 04:25:24 cpressey Exp $
 
-local sysid_list = {
-    { "DragonFly/FreeBSD",	165 },
-    { "OpenBSD",		166 },
-    { "NetBSD", 		169 },
-    { "MS-DOS", 		15  },
-    { "Linux",			131 },
-    { "Plan9",                  57  }
-}
+--
+-- Partition editor.
+--
+-- XXX This should probably be split up into more than one step.
+-- XXX This should probably be compartmentalized into StorageUI.
+--
 
 local options_list = {}
 local sysid_to_name_map = {}
 local name_to_sysid_map = {}
 local i, l
-for i, l in ipairs(sysid_list) do
+for i, l in ipairs(App.conf.sysids) do
 	local name, sysid = l[1], l[2]
 	table.insert(options_list, name)
 	sysid_to_name_map[sysid] = name
@@ -21,6 +19,19 @@
 end
 
 --
+-- Return a list of datasets apropos for formatting just one big partition.
+--
+local populate_one_big_partition = function(dd)
+	return {
+		{
+			sectors   = "*",
+			sysid     = sysid_to_name_map[App.conf.default_sysid],
+			active    = "Y"
+		}
+	}
+end
+
+--
 -- Get a list of datasets by examining what is currently in the disk
 -- representation (i.e. in the Storage.Disk structure, which was
 -- presumably gotten from Storage.System:survey() at some point.)
@@ -28,6 +39,7 @@
 local populate_from_disk = function(dd)
 	local pd
 	local list = {}
+	local active_pd = nil
 
 	local toyn = function(bool)
 		if bool then
@@ -37,18 +49,63 @@
 		end
 	end
 
+	local offset = dd:get_geometry_sec()
+
+	--
+	-- Look for the active partition.
+	--
 	for pd in dd:get_parts() do
-		local capstring = pd:get_capacity():format()
+		if pd:is_active() then
+			active_pd = pd
+			break
+		end
+	end
+
+	--
+	-- If none was found, assume the first as the active partition.
+	--
+	if not active_pd then
+		for pd in dd:get_parts() do
+			active_pd = pd
+			break
+		end
+	end
+
+	for pd in dd:get_parts() do
+		local start = pd:get_start()
+		local sectors = pd:get_capacity():in_units("S")
 		local sysid = sysid_to_name_map[pd:get_sysid()] or
 				tostring(pd:get_sysid())
 
+		if start ~= offset then
+			App.ui:inform(_(
+			    "WARNING: The partition layout currently "	..
+			    "on this disk is non-standard.  It may "	..
+			    "have gaps in between partitions, or the "	..
+			    "partitions may be listed in something "	..
+			    "other than strictly increading order. "	..
+			    "\n\nWhile %s can handle this situation, "	..
+			    "this installer's partition editor cannot "	..
+			    "at present. You will be given the option "	..
+			    "to completely repartition this disk, but "	..
+			    "if you wish to retain any existing "	..
+			    "information on the disk, you should exit "	..
+			    "the installer and use a tool such as "	..
+			    "`fdisk' to manually create a %s partition " ..
+			    "on it before continuing.",
+			    App.conf.product.name, App.conf.product.name
+			))
+			return populate_one_big_partition(dd)
+		end
+		offset = offset + sectors
+
 		--
 		-- Create the dataset.
 		--
 		table.insert(list, {
-			capstring = capstring,
+			sectors = tostring(sectors),
 			sysid = sysid,
-			active = toyn(pd:is_active())
+			active = toyn(pd == active_pd)
 		})
 	end
 
@@ -56,21 +113,6 @@
 end
 
 --
--- Return a list of datasets apropos for formatting just one big partition.
---
-local populate_one_big_partition = function(dd)
-	return {
-		{
-			capstring = "*",
-			-- XXX the following should be in a conf file,
-			-- XXX as it is different for each OS:
-			sysid     = sysid_to_name_map[165],
-			active    = "Y"
-		}
-	}
-end
-
---
 -- Actually show the partition editor and let the user edit partitions.
 -- This does not do any setup or validation.
 --
@@ -79,8 +121,8 @@
 
 	local fields_list = {
 		{
-		    id = "capstring",
-		    name = _("Capacity")
+		    id = "sectors",

>>> TRUNCATED FOR MAIL (1000 lines) <<<



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200509290014.j8T0EnIL062402>