/[gli]/trunk/src/tests/install.py
Gentoo

Contents of /trunk/src/tests/install.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 225 - (show annotations) (download) (as text)
Sat Jan 8 09:35:01 2005 UTC (15 years, 10 months ago) by agaffney
File MIME type: text/x-python
File size: 3458 byte(s)
install.py updates and partition code fixes

1 #!/usr/bin/python
2
3 import sys
4 import GLIUtility
5 import GLIArchitectureTemplate
6 import GLIInstallProfile
7 import GLIClientConfiguration
8
9 def usage():
10 print "Usage: " + sys.argv[0] + " <installprofile.xml> [command [command ...]]\n"
11 print "command is one of:\n"
12 print "\tpartition add, remove, and resize partitions"
13 print "\tmount mount all partitions"
14 print "\tmount_net mount network shares"
15 print "\tunpack unpack stage tarball"
16 print "\tprep_make_conf prepare the make.conf"
17 print "\tportage_tree portage tree magic"
18 print "\tprep_chroot prepare the chroot"
19 print "\tbootstrap duh :P"
20 print "\temerge_system duh :P"
21 print "\ttimezone set timezone"
22 print "\temerge_kernel install the kernel sources"
23 print "\tbuild_kernel build the kernel"
24 print "\tlogger install logger"
25 print "\tcrond install cron daemon"
26 print "\tfstools install filesystem tools"
27 print "\tnetwork configure network"
28 print "\tbootloader install and configure bootloader"
29 print "\tconfig_files update config files"
30 print "\tupdate_rc_conf update rc.conf"
31 print "\tunmount unmount all filesystems"
32
33 def not_working():
34 print "This is a placeholder. This function does nothing right now."
35
36 if len(sys.argv) < 3:
37 usage()
38 sys.exit(1)
39
40 progname = sys.argv.pop(0)
41 xmlfile = sys.argv.pop(0)
42
43 if not GLIUtility.is_file(xmlfile):
44 print "The XML file '" + xmlfile + "' cannot be accessed.\n"
45 usage()
46 sys.exit(1)
47
48 client_profile = GLIClientConfiguration.ClientConfiguration()
49 client_profile.set_root_mount_point(None, "/mnt/gentoo", None)
50 install_profile = GLIInstallProfile.InstallProfile()
51 install_profile.parse(xmlfile)
52
53 template = __import__('templates' + '/' + 'x86ArchitectureTemplate')
54 archtemplate = getattr(template, 'x86ArchitectureTemplate')(client_profile, install_profile, False)
55
56 #archtemplate = GLIArchitectureTemplate.ArchitectureTemplate(install_profile=install_profile)
57
58 operations = {
59 'partition': archtemplate.partition,
60 'mount': archtemplate.mount_local_partitions,
61 'mount_net': archtemplate.mount_network_shares,
62 'unpack': archtemplate.unpack_stage_tarball,
63 'prep_make_conf': archtemplate.configure_make_conf,
64 'portage_tree': archtemplate.install_portage_tree,
65 'prep_chroot': archtemplate.prepare_chroot,
66 'bootstrap': archtemplate.stage1,
67 'emerge_system': archtemplate.stage2,
68 'timezone': archtemplate.set_timezone,
69 'emerge_kernel': archtemplate.emerge_kernel_sources,
70 'build_kernel': archtemplate.build_kernel,
71 'logger': archtemplate.install_logging_daemon,
72 'crond': archtemplate.install_cron_daemon,
73 'fstools': archtemplate.install_filesystem_tools,
74 'network': archtemplate.setup_network_post,
75 'bootloader': archtemplate.install_bootloader,
76 'config_files': archtemplate.update_config_files,
77 'update_rc_conf': archtemplate.configure_rc_conf,
78 'unmount': not_working
79 }
80
81 for action in sys.argv:
82 if operations.has_key(action):
83 operations[action]()
84 else:
85 print "Operation '" + action + "' is not valid"

Properties

Name Value
svn:eol-style native
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.20