3 # Create a new filesystem
5 require './format-lib.pl';
6 $access{'view'} && &error($text{'ecannot'});
8 &can_edit_disk($in{'dev'}) || &error($text{'newfs_ecannot'});
9 &error_setup($text{'newfs_err'});
11 $cmd .= &opt_check("ufs_a", '\d+', "-a");
12 $cmd .= &opt_check("ufs_b", '\d+', "-b");
13 $cmd .= &opt_check("ufs_c", '\d+', "-c");
14 $cmd .= &opt_check("ufs_d", '\d+', "-d");
15 $cmd .= &opt_check("ufs_f", '\d+', "-f");
16 $cmd .= &opt_check("ufs_i", '\d+', "-i");
17 $cmd .= &opt_check("ufs_m", '\d+', "-m");
18 $cmd .= &opt_check("ufs_n", '\d+', "-n");
19 $cmd .= $in{ufs_o} ? " -o $in{ufs_o}" : "";
20 $cmd .= &opt_check("ufs_r", '\d+', "-r");
21 $cmd .= &opt_check("ufs_s", '\d+', "-s");
22 $cmd .= &opt_check("ufs_t", '\d+', "-t");
23 $cmd .= &opt_check("ufs_cb", '\d+', "-C");
24 $in{dev} =~ s/dsk/rdsk/g;
27 &ui_print_header(undef, $text{'newfs_title'}, "");
29 print &text('newfs_exec', "<tt>$cmd</tt>"),"<p>\n";
31 open(MKFS, "$cmd 2>&1 </dev/null |");
32 while(<MKFS>) { print; }
35 if ($?) { print "$text{'newfs_failed'} <p>\n"; }
36 else { print "$text{'newfs_ok'} <p>\n"; }
38 &ui_print_footer("", $text{'index_return'});