Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

More ui-lib conversion, TB swap file support

  • Loading branch information...
commit 274a280cd9d1b9d84c6b255134372bcf7022052f 1 parent 12fe3da
@jcameron jcameron authored
View
3  mount/freebsd-lib.pl
@@ -943,7 +943,8 @@ sub check_options
sub create_swap
{
local($out, $bl);
-$bl = $_[1] * ($_[2] eq "g" ? 1024*1024 :
+$bl = $_[1] * ($_[2] eq "t" ? 1024*1024*1024 :
+ $_[2] eq "g" ? 1024*1024 :
$_[2] eq "m" ? 1024 : 1);
$out = &backquote_logged("dd if=/dev/zero of=$_[0] bs=1024 count=$bl 2>&1");
if ($?) { return "dd failed : $out"; }
View
14 mount/lang/en
@@ -138,6 +138,11 @@ solaris_autohosts=All NFS exports
solaris_autoxfn=Federated Naming Service
solaris_server=Server Name
solaris_share=Share Name
+solaris_lvm=LVM Device
+solaris_vg=Volume group
+solaris_lv=Logical volume
+solaris_vxfs=VXFS device
+solaris_hfs=HFS device
solaris_ro=Read-Only?
solaris_nosuid=Disallow setuid programs?
solaris_grpid=Files inherit parent GID?
@@ -175,7 +180,7 @@ solaris_nrr=Ignore Unix attributes?
solaris_notraildot=Ignore trailing dot?
solaris_nomaplcase=Use lower case?
solaris_foldcase=Force lower case?
-solaris_noopts=No Options Available
+solaris_noopts=No options available
solaris_size=Size
solaris_largebsize=Use large page block size?
solaris_max=Maximum
@@ -308,7 +313,7 @@ linux_posix=Allow names that differ only in case?
linux_conv2=OS/2-Unix newline conversion
linux_rock=Ignore Unix Attributes?
linux_mode=File permissions for non-Unix CDs
-linux_noopts=No Options Available
+linux_noopts=No options available
linux_timeout=Idle time before unmount
linux_pid_file=Write PID to file
linux_secs=seconds
@@ -408,7 +413,7 @@ irix_proto=NFS protocol
irix_port=NFS port
irix_timeo=Timeout
irix_retrans=Number of Retransmissions
-irix_noopts=No Options Available
+irix_noopts=No options available
irix_quota=Enable quotas?
irix_noatime=Update access times?
irix_wsync=All modifications are synchronous?
@@ -468,4 +473,7 @@ freebsd_part=Partition
freebsd_scsi=SCSI disk
freebsd_other=Other device
+cswap_file=The swap file $1 does not exist.
+cswap_size=Create and mount a swap file with size
+
__norefs=1
View
3  mount/linux-lib.pl
@@ -2374,7 +2374,8 @@ sub write_smbopts
sub create_swap
{
local($out, $bl);
-$bl = $_[1] * ($_[2] eq "g" ? 1024*1024 :
+$bl = $_[1] * ($_[2] eq "t" ? 1024*1024*1024 :
+ $_[2] eq "g" ? 1024*1024 :
$_[2] eq "m" ? 1024 : 1);
$out = &backquote_logged("dd if=/dev/zero of=$_[0] bs=1024 count=$bl 2>&1");
if ($?) { return "dd failed : $out"; }
View
25 mount/mount-lib.pl
@@ -93,21 +93,20 @@ sub join_options
# to a creation program, and then redirected back to the original mount cgi
sub swap_form
{
+local ($file) = @_;
&ui_print_header(undef, "Create Swap File", "");
-print "<form action=create_swap.cgi>\n";
-foreach $k (keys %in) {
- print "<input type=hidden name=\"$k\" value=\"$in{$k}\">\n";
+print &ui_form_start("create_swap.cgi");
+foreach my $k (keys %in) {
+ print &ui_hidden($k, $in{$k});
}
-print "<input type=hidden name=cswap_file value=\"$_[0]\">\n";
-print "The swap file <tt>$_[0]</tt> does not exist.<p>\n";
-print "Create and mount a swap file with size <input name=cswap_size size=6>\n";
-print "<select name=cswap_units>\n";
-print "<option value=k> kB\n";
-print "<option value=m selected> MB\n";
-print "<option value=g> GB\n";
-print "</select>\n";
-print "<input type=submit value=\"Create\"></form>\n";
-&ui_print_footer("", "mount list");
+print &ui_hidden("cswap_file", $file);
+print &text('cswap_file', "<tt>$file</tt>"),"<p>\n";
+print $text{'cswap_size'},"\n";
+print &ui_textbox("cswap_size", undef, 6)," ",
+ &ui_select("cswap_units", "m",
+ [ [ "m", "MB" ], [ "g", "GB" ], [ "t", "TB" ] ])."\n";
+print &ui_form_end([ [ undef, $text{'create'} ] ]);
+&ui_print_footer("", $text{'index_return'});
exit;
}
View
3  mount/netbsd-lib.pl
@@ -723,7 +723,8 @@ sub check_options
sub create_swap
{
local($out, $bl);
-$bl = $_[1] * ($_[2] eq "g" ? 1024*1024 :
+$bl = $_[1] * ($_[2] eq "t" ? 1024*1024*1024 :
+ $_[2] eq "g" ? 1024*1024 :
$_[2] eq "m" ? 1024 : 1);
$out = &backquote_logged("dd if=/dev/zero of=$_[0] bs=1024 count=$bl 2>&1");
if ($?) { return "dd failed : $out"; }
View
3  mount/openbsd-lib.pl
@@ -725,7 +725,8 @@ sub check_options
sub create_swap
{
local($out, $bl);
-$bl = $_[1] * ($_[2] eq "g" ? 1024*1024 :
+$bl = $_[1] * ($_[2] eq "t" ? 1024*1024*1024 :
+ $_[2] eq "g" ? 1024*1024 :
$_[2] eq "m" ? 1024 : 1);
$out = &backquote_logged("dd if=/dev/zero of=$_[0] bs=1024 count=$bl 2>&1");
if ($?) { return "dd failed : $out"; }
View
63 mount/solaris-lib.pl
@@ -462,13 +462,11 @@ sub generate_location
elsif ($type eq "tmpfs" || $type eq "xmemfs") {
# Location is irrelevant for tmpfs and xmemfs filesystems
}
-elsif ($_[0] eq "ufs") {
+elsif ($type eq "ufs") {
# Mounted from a normal disk, raid (MD) device or from
# somewhere else
- print "<tr> <td valign=top><b>$text{'solaris_ufs'}</b></td>\n";
- print "<td colspan=3>\n";
&foreign_require("format");
-
+ local ($ufs_dev, $ufs_md);
if ($_[1] =~ /^\/dev\/dsk\/c([0-9]+)t([0-9]+)d([0-9]+)s([0-9]+)$/ ||
$_[1] =~ /^\/dev\/dsk\/c([0-9]+)d([0-9]+)s([0-9]+)$/) {
$ufs_dev = 0;
@@ -478,58 +476,59 @@ sub generate_location
}
elsif ($_[1] =~ /^\/dev\/md\/dsk\/d([0-9]+)$/) {
$ufs_dev = 1;
+ $ufs_md = $1;
}
else {
$ufs_dev = 2;
}
+ local @opts;
+ # Regular disk
local $found;
local $sel = &format::partition_select("ufs_disk", $_[1], 0,
$ufs_dev ? \$found : undef);
- printf "<input type=radio name=ufs_dev value=0 %s> %s : %s<br>\n",
- $ufs_dev == 0 ? "checked" : "", $text{'solaris_scsi'}, $sel;
+ push(@opts, [ 0, $text{'solaris_scsi'}, $sel ]);
- printf "<input type=radio name=ufs_dev value=1 %s> %s :\n",
- $ufs_dev == 1 ? "checked" : "",
- $text{'solaris_raid'};
- printf "%s <input name=ufs_md size=3 value=\"%s\"><br>\n",
- $text{'solaris_unit'},
- $_[1] =~ /^\/dev\/md\/dsk\/d([0-9]+)$/ ? $1 : "";
- printf "<input type=radio name=ufs_dev value=2 %s> %s :\n",
- $ufs_dev == 2 ? "checked" : "", $text{'solaris_otherdev'};
- printf "<input name=ufs_path size=20 value=\"%s\"><br>\n",
- $ufs_dev == 2 ? $_[1] : "";
- print "</td> </tr>\n";
+ # RAID device
+ push(@opts, [ 1, $text{'solaris_raid'},
+ $text{'solaris_unit'}." ".
+ &ui_textbox("ufs_md", $ufs_md, 5) ]);
+
+ # Something else
+ push(@opts, [ 2, $text{'solaris_otherdev'},
+ &ui_textbox("ufs_path", $ufs_dev == 2 ? $loc : "", 40) ]);
+ print &ui_table_row($text{'solaris_ufs'},
+ &ui_radio_table("ufs_dev", $ufs_dev, \@opts));
}
-elsif ($_[0] eq "swap") {
+elsif ($type eq "swap") {
# Swapping to a disk partition or a file
- print "<tr> <td valign=top><b>$text{'solaris_swapfile'}</b></td>\n";
- print "<td colspan=3>\n";
&foreign_require("format");
-
- if ($_[1] =~ /^\/dev\/dsk\/c([0-9]+)t([0-9]+)d([0-9]+)s([0-9]+)$/ ||
- $_[1] =~ /^\/dev\/dsk\/c([0-9]+)d([0-9]+)s([0-9]+)$/) {
+ local ($swap_dev);
+ if ($loc =~ /^\/dev\/dsk\/c([0-9]+)t([0-9]+)d([0-9]+)s([0-9]+)$/ ||
+ $loc =~ /^\/dev\/dsk\/c([0-9]+)d([0-9]+)s([0-9]+)$/) {
$swap_dev = 0;
}
- elsif ($_[1] eq "") {
+ elsif ($loc eq "") {
$swap_dev = 0;
}
else {
$swap_dev = 1;
}
+ local @opts;
+ # Regular disk
local $found;
local $sel = &format::partition_select("swap_disk", $_[1], 0,
$swap_dev ? \$found : undef);
- printf "<input type=radio name=swap_dev value=0 %s> %s : %s<br>\n",
- $swap_dev == 0 ? "checked" : "", $text{'solaris_scsi'}, $sel;
-
- printf "<input type=radio name=swap_dev value=1 %s> %s :\n",
- $swap_dev == 1 ? "checked" : "", $text{'solaris_file'};
- printf "<input name=swap_path size=20 value=\"%s\"><br>\n",
- $swap_dev == 1 ? $_[1] : "";
- print "</td> </tr>\n";
+ push(@opts, [ 0, $text{'solaris_scsi'}, $sel ]);
+
+ # Other path
+ push(@opts, [ 1, $text{'solaris_file'},
+ &ui_textbox("swap_path", $swap_dev == 1 ? $loc : "", 40)
+ ]);
+ print &ui_table_row($text{'solaris_swapfile'},
+ &ui_radio_table("swap_dev", $swap_dev, \@opts));
}
elsif ($_[0] eq "hsfs" || $_[0] eq "udfs") {
# Mounting a SCSI cdrom or DVD
Please sign in to comment.
Something went wrong with that request. Please try again.