summaryrefslogtreecommitdiff
path: root/webgli
diff options
context:
space:
mode:
authorPreston Cody <codeman@gentoo.org>2006-05-21 01:37:31 +0000
committerPreston Cody <codeman@gentoo.org>2006-05-21 01:37:31 +0000
commitcc71daba9623245ff0df44b378ff7a32767b53f3 (patch)
tree1a5609dab26811c16127940e3b81996b3aa95106 /webgli
parentmissing a {/section} (diff)
downloadscire-cc71daba9623245ff0df44b378ff7a32767b53f3.tar.gz
scire-cc71daba9623245ff0df44b378ff7a32767b53f3.tar.bz2
scire-cc71daba9623245ff0df44b378ff7a32767b53f3.zip
updating svn with current webgli. not sure of any
significant updates here. svn path=/; revision=69
Diffstat (limited to 'webgli')
-rw-r--r--webgli/bootloader.php52
-rw-r--r--webgli/review.php69
-rw-r--r--webgli/templates/bootloader.tpl3
-rw-r--r--webgli/templates_c/%%09^090^090AEC3A%%bootloader.tpl.php105
-rw-r--r--webgli/templates_c/%%45^45E^45E480CD%%index.tpl.php7
-rw-r--r--webgli/templates_c/%%65^655^6551DB6B%%bottom.tpl.php8
6 files changed, 72 insertions, 172 deletions
diff --git a/webgli/bootloader.php b/webgli/bootloader.php
index 10a891a..b8ee33e 100644
--- a/webgli/bootloader.php
+++ b/webgli/bootloader.php
@@ -1,6 +1,7 @@
<?php
include('webgliIP.php');
+include('webgliCF.php');
include('webgliUtility.php');
include('Smarty.class.php');
@@ -13,6 +14,8 @@ $smarty->config_dir = './configs';
$ip = new InstallProfile();
$ip->parse('test.xml');
+$cf = new ClientConfiguration();
+$cf->parse('testcc.xml');
$error_msg = "";
@@ -42,28 +45,33 @@ if ($_POST['setbootloader']) {
$error_msg = "Values saved successfully";
}
}
-$arch = "x86";
-$parts;
-//arch = shared_info.client_profile.get_architecture_template()
-//parts = shared_info.install_profile.get_partition_tables()
-$advanced = $_SESSION['install_profile']['advanced'] or $advanced = True;
-$boot_device = "hda"; //$_SESSION['install_profile']['boot_device'];
-#Bootloader code yanked from the x86ArchTemplate
-//if shared_info.install_profile.get_boot_device():
-/*
- $boot_device = shared_info.install_profile.get_boot_device()
-else:
- boot_device = ""
- foundboot = False
- for device in parts:
- tmp_partitions = parts[device] #.get_install_profile_structure()
- for partition in tmp_partitions:
- mountpoint = tmp_partitions[partition]['mountpoint']
- if (mountpoint == "/boot"):
- foundboot = True
- if (( (mountpoint == "/") and (not foundboot) ) or (mountpoint == "/boot")):
- boot_device = device
+$arch = $cf->get("architecture_template");
+$boot_device = $ip->get("boot_device");
+ #Bootloader code yanked from the x86ArchTemplate
+ $devices = $ip->get("partition_tables");
+ $foundboot = False;
+ $drives = array_keys($devices);
+ sort($drives);
+ foreach ($drives as $drive) {
+ $partlist = $devices[$drive];
+ sort($partlist);
+ foreach( $partlist as $part) {
+ if ($part["mountpoint"] == "/boot") {
+ print "found! <br>";
+ $boot_device = $drive;
+ $foundboot = True;
+ }
+ if ( ($part["mountpoint"] == "/") and (!$foundboot)) {
+ $boot_device = $drive;
+ print "set! $boot_device<br>";
+ }
+ }
+ }
+}
+print "Boot device: $boot_device <br>";
+print substr($boot_device,-1);
+/*
bootloader = shared_info.install_profile.get_boot_loader_pkg()
$arch_loaders = array('x86': [
("grub",(u"GRand Unified Bootloader, newer, RECOMMENDED")),
@@ -81,7 +89,7 @@ bootargs = shared_info.install_profile.get_bootloader_kernel_args()
$smarty->assign('boot_device', $boot_device);
$smarty->assign('bootargs', $bootargs);
$smarty->assign('bootloaders', $bootloaders);
- $smarty->assign('advanced', $advanced);
+ $smarty->assign('advanced', True); #FIXME
$smarty->display('bootloader.tpl');
?>
diff --git a/webgli/review.php b/webgli/review.php
index f439016..4b1af32 100644
--- a/webgli/review.php
+++ b/webgli/review.php
@@ -21,38 +21,51 @@ $data .= "Look carefully at the following settings to check for mistakes.\nThese
#Partitioning
$data .= "Partitioning: \n Key: Minor, Pri/Ext, Filesystem, MkfsOpts, Mountpoint, MountOpts, Size.\n";
$devices = $ip->get("partition_tables"); #shared_info.install_profile.get_partition_tables()
+#var_dump($devices);
$drives = array_keys($devices);
sort($drives);
-/*
foreach ($drives as $drive) {
- $data .= " Drive: " . $drive . $devices[$drive].get_model() . "\n";
- partlist = devices[drive].get_ordered_partition_list()
- tmpparts = devices[drive] #.get_partitions()
- for part in partlist:
- tmppart = tmpparts[part]
- entry = " "
- if tmppart.get_type() == "free":
+ $data .= " Drive: $drive\n";
+ $partlist = $devices[$drive];
+ sort($partlist);
+ #tmpparts = devices[drive] #.get_partitions()
+ foreach( $partlist as $part) {
+ #tmppart = tmpparts[part]
+ $entry = " ";
+ if ($part["type"] == "free") { #tmppart.get_type() == "free":
#partschoice = "New"
- entry .= _(u" - Unallocated space (")
- if tmppart.is_logical():
- entry .= _(u"logical, ")
- entry .= str(tmppart.get_mb()) . "MB)"
- elif tmppart.get_type() == "extended":
- entry .= str(int(tmppart.get_minor()))
- entry .= _(u" - Extended Partition (") . str(tmppart.get_mb()) . "MB)"
- else:
- entry .= str(int(tmppart.get_minor())) . " - "
- if tmppart.is_logical():
- entry .= _(u"Logical (")
- else:
- entry .= _(u"Primary (")
- entry .= tmppart.get_type() . ", "
- entry .= (tmppart.get_mkfsopts() or "none") . ", "
- entry .= (tmppart.get_mountpoint() or "none") . ", "
- entry .= (tmppart.get_mountopts() or "none") . ", "
- entry .= str(tmppart.get_mb()) . "MB)"
- $data .= entry . "\n"
-
+ $entry .= " - Unallocated space (";
+ $entry .= $part["mb"] . "MB)"; #str(tmppart.get_mb()) . "MB)"
+ } elseif ($part["type"] == "extended") {
+ $entry .= $part["minor"]; #tmppart.get_minor()))
+ $entry .= " - Extended Partition (" . $part["mb"] . "MB)"; # str(tmppart.get_mb())
+ } else {
+ $entry .= $part["minor"] . " - "; #str(int(tmppart.get_minor())) . " - "
+ if ($part["minor"] > 4) { #tmppart.is_logical():
+ $entry .= "Logical (";
+ } else {
+ $entry .= "Primary (";
+ }
+ $entry .= $part["type"] . ", "; #tmppart.get_type() . ", "
+ $entry .= $part["mkfsopts"] . ", "; #(tmppart.get_mkfsopts() or "none") . ", "
+ if ($part["mountpoint"]) {
+ $entry .= $part["mountpoint"];
+ } else {
+ $entry .= "none";
+ }
+ $entry .= ", "; #(tmppart.get_mountpoint() or "none") . ", "
+ if ($part["mountopts"]) {
+ $entry .= $part["mountopts"];
+ } else {
+ $entry .= "none";
+ }
+ $entry .= ", "; #(tmppart.get_mountopts() or "none") . ", "
+ $entry .= $part["mb"] . "MB)"; #str(tmppart.get_mb()) . "MB)"
+ }
+ $data .= $entry . "\n";
+ }
+}
+/*
#Network Mounts:
network_mounts = copy.deepcopy(shared_info.install_profile.get_network_mounts())
$data .= "\nNetwork Mounts: \n"
diff --git a/webgli/templates/bootloader.tpl b/webgli/templates/bootloader.tpl
index 2bebdf6..828f312 100644
--- a/webgli/templates/bootloader.tpl
+++ b/webgli/templates/bootloader.tpl
@@ -21,8 +21,7 @@
{if (!$boot_device)}
<br> You need to partition before you can select the boot device.<br>
{/if}
-{if ($boot_device)}
- and $boot_device[-1] != 'a'
+{if ($boot_device and (substr($boot_device,-1) != "a")) }
Your boot device may not be correct. It is currently set to {$boot_device}, but this device may not be the first to boot. Usually boot devices end in 'a' such as hda or sda.
<br>Please confirm your boot device.<br>
{section name=bootdevices loop=bootdevices}
diff --git a/webgli/templates_c/%%09^090^090AEC3A%%bootloader.tpl.php b/webgli/templates_c/%%09^090^090AEC3A%%bootloader.tpl.php
deleted file mode 100644
index ad2583a..0000000
--- a/webgli/templates_c/%%09^090^090AEC3A%%bootloader.tpl.php
+++ /dev/null
@@ -1,105 +0,0 @@
-<?php /* Smarty version 2.6.10, created on 2006-04-14 19:56:49
- compiled from bootloader.tpl */ ?>
-<?php $_smarty_tpl_vars = $this->_tpl_vars;
-$this->_smarty_include(array('smarty_include_tpl_file' => "header.tpl", 'smarty_include_vars' => array('title' => "WebGLI - Bootloader")));
-$this->_tpl_vars = $_smarty_tpl_vars;
-unset($_smarty_tpl_vars);
- ?>
-<p>Bootloader Settings:</p>
-<?php if ($this->_tpl_vars['error_msg']): ?>
-<br><?php echo $this->_tpl_vars['error_msg']; ?>
-<br><br>
-<?php endif; ?>
-<form name="Bloader" method="post" action="" enctype="multipart/form-data">
-<p>To boot successfully into your new Linux system, a bootloader will be needed. If you already have a bootloader you want to use you can select None here. The bootloader choices available are dependent on what GLI supports and what architecture your system is. Choose a bootloader:</p>
-<table width="100%" border="1">
-<?php unset($this->_sections['bl']);
-$this->_sections['bl']['name'] = 'bl';
-$this->_sections['bl']['loop'] = is_array($_loop=$this->_tpl_vars['bootloaders']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
-$this->_sections['bl']['show'] = true;
-$this->_sections['bl']['max'] = $this->_sections['bl']['loop'];
-$this->_sections['bl']['step'] = 1;
-$this->_sections['bl']['start'] = $this->_sections['bl']['step'] > 0 ? 0 : $this->_sections['bl']['loop']-1;
-if ($this->_sections['bl']['show']) {
- $this->_sections['bl']['total'] = $this->_sections['bl']['loop'];
- if ($this->_sections['bl']['total'] == 0)
- $this->_sections['bl']['show'] = false;
-} else
- $this->_sections['bl']['total'] = 0;
-if ($this->_sections['bl']['show']):
-
- for ($this->_sections['bl']['index'] = $this->_sections['bl']['start'], $this->_sections['bl']['iteration'] = 1;
- $this->_sections['bl']['iteration'] <= $this->_sections['bl']['total'];
- $this->_sections['bl']['index'] += $this->_sections['bl']['step'], $this->_sections['bl']['iteration']++):
-$this->_sections['bl']['rownum'] = $this->_sections['bl']['iteration'];
-$this->_sections['bl']['index_prev'] = $this->_sections['bl']['index'] - $this->_sections['bl']['step'];
-$this->_sections['bl']['index_next'] = $this->_sections['bl']['index'] + $this->_sections['bl']['step'];
-$this->_sections['bl']['first'] = ($this->_sections['bl']['iteration'] == 1);
-$this->_sections['bl']['last'] = ($this->_sections['bl']['iteration'] == $this->_sections['bl']['total']);
-?>
-<tr><td><input name="bootloader" type="radio" value="<?php echo $this->_tpl_vars['bootloaders'][$this->_sections['bl']['index']][0]; ?>
-" <?php if ($this->_tpl_vars['bootloaders'][$this->_sections['bl']['index']][0] == $this->_tpl_vars['bootloader']): ?> checked <?php endif; ?> > <?php echo $this->_tpl_vars['bootloaders'][$this->_sections['bl']['index']][0]; ?>
-</td><td><?php echo $this->_tpl_vars['bootloaders'][$this->_sections['bl']['index']][1]; ?>
-</td></tr>
-<?php endfor; endif; ?>
-</table>
-<?php if ($this->_tpl_vars['advanced']): ?>
- <hr>
- Most bootloaders have the ability to install to either the Master Boot Record (MBR) or some other partition. Most people will want their bootloader installed on the MBR for successful boots, but if you have special circumstances, you can have the bootloader installed to the /boot partition instead. Do you want the boot loader installed in the MBR? (YES is RECOMMENDED)
- <p>
-
-<input name="bootmbr" type="checkbox" id="bootmbr" value="True" <?php if ($this->_tpl_vars['bootmbr']): ?> checked <?php endif; ?>> Install to MBR </p>
-<?php endif; ?>
-
-<?php if (( ! $this->_tpl_vars['boot_device'] )): ?>
-<br> You need to partition before you can select the boot device.<br>
-<?php endif; if (( $this->_tpl_vars['boot_device'] )): ?>
- and $boot_device[-1] != 'a'
- Your boot device may not be correct. It is currently set to <?php echo $this->_tpl_vars['boot_device']; ?>
-, but this device may not be the first to boot. Usually boot devices end in 'a' such as hda or sda.
- <br>Please confirm your boot device.<br>
- <?php unset($this->_sections['bootdevices']);
-$this->_sections['bootdevices']['name'] = 'bootdevices';
-$this->_sections['bootdevices']['loop'] = is_array($_loop='bootdevices') ? count($_loop) : max(0, (int)$_loop); unset($_loop);
-$this->_sections['bootdevices']['show'] = true;
-$this->_sections['bootdevices']['max'] = $this->_sections['bootdevices']['loop'];
-$this->_sections['bootdevices']['step'] = 1;
-$this->_sections['bootdevices']['start'] = $this->_sections['bootdevices']['step'] > 0 ? 0 : $this->_sections['bootdevices']['loop']-1;
-if ($this->_sections['bootdevices']['show']) {
- $this->_sections['bootdevices']['total'] = $this->_sections['bootdevices']['loop'];
- if ($this->_sections['bootdevices']['total'] == 0)
- $this->_sections['bootdevices']['show'] = false;
-} else
- $this->_sections['bootdevices']['total'] = 0;
-if ($this->_sections['bootdevices']['show']):
-
- for ($this->_sections['bootdevices']['index'] = $this->_sections['bootdevices']['start'], $this->_sections['bootdevices']['iteration'] = 1;
- $this->_sections['bootdevices']['iteration'] <= $this->_sections['bootdevices']['total'];
- $this->_sections['bootdevices']['index'] += $this->_sections['bootdevices']['step'], $this->_sections['bootdevices']['iteration']++):
-$this->_sections['bootdevices']['rownum'] = $this->_sections['bootdevices']['iteration'];
-$this->_sections['bootdevices']['index_prev'] = $this->_sections['bootdevices']['index'] - $this->_sections['bootdevices']['step'];
-$this->_sections['bootdevices']['index_next'] = $this->_sections['bootdevices']['index'] + $this->_sections['bootdevices']['step'];
-$this->_sections['bootdevices']['first'] = ($this->_sections['bootdevices']['iteration'] == 1);
-$this->_sections['bootdevices']['last'] = ($this->_sections['bootdevices']['iteration'] == $this->_sections['bootdevices']['total']);
-?>
- <input type="radio" name="boot_drive_choice" value="<?php echo $this->_tpl_vars['bootdevices']; ?>
-"><?php echo $this->_tpl_vars['bootdevices']; ?>
-<br>
- <?php endfor; endif; endif; ?>
-
-<br>
-<?php if ($this->_tpl_vars['advanced']): ?>
- <p>If you have any additional optional arguments you want to pass to the kernel at boot, type them here:
- <input name="bootargs" type="text" id="bootargs" value="<?php echo $this->_tpl_vars['bootargs']; ?>
-">
- </p>
-<?php endif; ?>
-<p>
-<input name="setbootloader" type="submit" id="setbootloader" value="Save Bootloader Settings">
-</p>
-</form>
-<?php $_smarty_tpl_vars = $this->_tpl_vars;
-$this->_smarty_include(array('smarty_include_tpl_file' => "bottom.tpl", 'smarty_include_vars' => array()));
-$this->_tpl_vars = $_smarty_tpl_vars;
-unset($_smarty_tpl_vars);
- ?> \ No newline at end of file
diff --git a/webgli/templates_c/%%45^45E^45E480CD%%index.tpl.php b/webgli/templates_c/%%45^45E^45E480CD%%index.tpl.php
deleted file mode 100644
index 61d0f14..0000000
--- a/webgli/templates_c/%%45^45E^45E480CD%%index.tpl.php
+++ /dev/null
@@ -1,7 +0,0 @@
-<?php /* Smarty version 2.6.13, created on 2006-04-16 21:26:33
- compiled from index.tpl */ ?>
-<?php $_smarty_tpl_vars = $this->_tpl_vars;
-$this->_smarty_include(array('smarty_include_tpl_file' => "header.tpl", 'smarty_include_vars' => array('title' => "\"WebGLI - Main Page\",",'advanced' => $this->_tpl_vars['advanced'])));
-$this->_tpl_vars = $_smarty_tpl_vars;
-unset($_smarty_tpl_vars);
- ?> \ No newline at end of file
diff --git a/webgli/templates_c/%%65^655^6551DB6B%%bottom.tpl.php b/webgli/templates_c/%%65^655^6551DB6B%%bottom.tpl.php
deleted file mode 100644
index 879a84a..0000000
--- a/webgli/templates_c/%%65^655^6551DB6B%%bottom.tpl.php
+++ /dev/null
@@ -1,8 +0,0 @@
-<?php /* Smarty version 2.6.13, created on 2006-04-16 21:26:38
- compiled from bottom.tpl */ ?>
- </td>
- </tr>
-</table>
-
-</body>
-</html> \ No newline at end of file