From: Michal Sojka Date: Tue, 18 Feb 2020 10:49:30 +0000 (+0100) Subject: Allow configuring the default value of --netif globally in configuration files X-Git-Tag: 20201217~11 X-Git-Url: http://rtime.felk.cvut.cz/gitweb/novaboot.git/commitdiff_plain/e156afd58ba9a5fd169965fa8c49503fe103ddc8 Allow configuring the default value of --netif globally in configuration files --- diff --git a/README.pod b/README.pod index 8fcbeae..0144b88 100644 --- a/README.pod +++ b/README.pod @@ -550,10 +550,11 @@ Port to run the TFTP server on. Implies B<--tftp>. =item --netif=I -Network interface used to deploy files to the target. The default value is -I. This option influences the configuration of the DHCP server started -by B<--dhcp-tftp> and the value that B<$NB_MYIP> get replaced with during -U-Boot conversation. +Network interface used to deploy files to the target. This option +influences the configuration of the DHCP server started by +B<--dhcp-tftp> and the value that B<$NB_MYIP> get replaced with during +U-Boot conversation. The default value is C<$netif> variable from +configuration files, which defaults to I. =item --iso[=filename] @@ -1013,6 +1014,11 @@ Default target (see below) to use when no target is explicitly specified with the B<--target> command line option or B environment variable. +=item $netif + +Default value for the B<--netif> option. If not specified, it defaults +to I. + =item %targets Hash of target definitions to be used with the B<--target> option. The diff --git a/novaboot b/novaboot index c5c9153..f4fcdc9 100755 --- a/novaboot +++ b/novaboot @@ -52,6 +52,7 @@ $CFG::hypervisor_params = "serial"; $CFG::genisoimage = "genisoimage"; $CFG::qemu = 'qemu-system-i386 -cpu coreduo -smp 2'; $CFG::default_target = ''; +$CFG::netif = 'eth0'; %CFG::targets = ( 'qemu' => '--qemu', "tud" => '--server=erwin.inf.tu-dresden.de:~sojka/boot/novaboot --rsync-flags="--chmod=Dg+s,ug+w,o-w,+rX --rsync-path=\"umask 002 && rsync\"" --grub --grub-prefix=(nd)/tftpboot/sojka/novaboot --grub-preamble="timeout 0" --concat --iprelay=141.76.48.80:2324 --scriptmod=s/\\\\bhostserial\\\\b/hostserialpci/g', @@ -145,7 +146,7 @@ $stty = 'raw -crtscts -onlcr -echo 115200'; $reset = 1; # Reset target by default $interaction = 1; # Perform target interaction by default $final_eol = 1; -$netif = 'eth0'; +$netif = $CFG::netif; $remote_expect_timeout = -1; my @expect_seen = (); @@ -1889,10 +1890,11 @@ Port to run the TFTP server on. Implies B<--tftp>. =item --netif=I -Network interface used to deploy files to the target. The default value is -I. This option influences the configuration of the DHCP server started -by B<--dhcp-tftp> and the value that B<$NB_MYIP> get replaced with during -U-Boot conversation. +Network interface used to deploy files to the target. This option +influences the configuration of the DHCP server started by +B<--dhcp-tftp> and the value that B<$NB_MYIP> get replaced with during +U-Boot conversation. The default value is C<$netif> variable from +configuration files, which defaults to I. =item --iso[=filename] @@ -2352,6 +2354,11 @@ Default target (see below) to use when no target is explicitly specified with the B<--target> command line option or B environment variable. +=item $netif + +Default value for the B<--netif> option. If not specified, it defaults +to I. + =item %targets Hash of target definitions to be used with the B<--target> option. The