]> rtime.felk.cvut.cz Git - novaboot.git/blobdiff - novaboot
Doc: Rename CONFIGURATION FILE to CONFIGURATION FILES
[novaboot.git] / novaboot
index dadcd40d3f42b7602b876e896e6860d2b06ab96d..3c653c3ec0749e29563d747098675f6e9ed22e27 100755 (executable)
--- a/novaboot
+++ b/novaboot
@@ -27,7 +27,7 @@ use Time::HiRes("usleep");
 use Socket;
 use FileHandle;
 use IPC::Open2;
-use POSIX qw(:errno_h);
+use POSIX qw(:errno_h sysconf);
 use Cwd qw(getcwd abs_path);
 use Expect;
 
@@ -53,9 +53,15 @@ $CFG::default_target = '';
     "ryuglab" => '--target ryu --server=pc-sojkam.felk.cvut.cz:/srv/tftp --remote-cmd="ssh -tt pc-sojkam.felk.cvut.cz \"sterm -d -s 115200 /dev/ttyUSB0\""',
     "ryulocal" => '--target ryu --dhcp-tftp --serial --reset-cmd="if which dtrrts; then dtrrts $NB_SERIAL 0 1; sleep 0.1; dtrrts $NB_SERIAL 1 1; fi"',
     );
-chomp(my $nproc = `nproc`);
-$CFG::scons = "scons -j$nproc";
-$CFG::make = "make -j$nproc";
+
+{
+    my %const;
+    $const{linux}->{_SC_NPROCESSORS_CONF} = 83;
+    my $nproc = sysconf($const{$^O}->{_SC_NPROCESSORS_CONF});
+
+    $CFG::scons = "scons -j$nproc";
+    $CFG::make = "make -j$nproc";
+}
 
 my $builddir;
 
@@ -1207,7 +1213,7 @@ only the B<-t>/B<--target> command line option to select the target.
 Internally, this option expands to the pre-configured options.
 Configuration files are searched at multiple places, which allows to
 have per-system, per-user or per-project configurations. Configuration
-file syntax is described in section L</"CONFIGURATION FILE">.
+file syntax is described in section L</"CONFIGURATION FILES">.
 
 Simple examples of using C<novaboot>:
 
@@ -1256,13 +1262,37 @@ I<script2> configurations.
 
 Novaboot performs its work in several phases. Each phase can be
 influenced by several command line options, certain phases can be
-skipped. The list of phases (in the execution order) and the
-corresponding options follows.
+skipped. The list of phases (in the execution order) is as follows.
+
+=over
+
+=item 1. L<Configuration reading|/Configuration reading phase>
+
+=item 2. L<Command line processing|/Command line processing phase>
+
+=item 3. L<Script preprocessing|/Script preprocessing phase>
+
+=item 4. L<File generation|/File generation phase>
+
+=item 5. L<Target connection|/Target connection check>
+
+=item 6. L<File deployment|/File deployment phase>
+
+=item 7. L<Target power-on and reset|/Target power-on and reset phase>
+
+=item 8. L<Interaction with the bootloader|/Interaction with the bootloader on the target>
+
+=item 9. L<Target interaction|/Target interaction phase>
+
+=back
+
+Each phase is described in the following sections together with the
+command line options that control it.
 
 =head2 Configuration reading phase
 
 After starting, novaboot reads configuration files. Their content is
-described in section L</"CONFIGURATION FILE">. By default,
+described in section L</"CONFIGURATION FILES">. By default,
 configuration is read from multiple locations. First from the system
 configuration directory (F</etc/novaboot.d/>), second from the user
 configuration file (F<~/.config/novaboot>) and third from F<.novaboot>
@@ -1325,7 +1355,7 @@ Print short (B<-h>) or long (B<--help>) help.
 This option serves as a user configurable shortcut for other novaboot
 options. The effect of this option is the same as specifying the
 options stored in the C<%targets> configuration variable under key
-I<target>. See also L</"CONFIGURATION FILE">.
+I<target>. See also L</"CONFIGURATION FILES">.
 
 When this option is not given, novaboot tries to determine the target
 to use from either B<NOVABOOT_TARGET> environment variable or from
@@ -1925,7 +1955,7 @@ intermediate output.
 
 =back
 
-=head1 CONFIGURATION FILE
+=head1 CONFIGURATION FILES
 
 Novaboot can read its configuration from one or more files. By
 default, novaboot looks for files in F</etc/novaboot.d>, file