From 290fc6e53317a26e57a8b91cde808af39e531cea Mon Sep 17 00:00:00 2001 From: mtudosoiu Date: Tue, 4 Jun 2019 21:20:20 +0300 Subject: T1392: improve VyOS boot time by changing {hot,cold}plug calls --- scripts/vyatta_net_name | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/vyatta_net_name b/scripts/vyatta_net_name index 53ae9fba..e50cae8f 100755 --- a/scripts/vyatta_net_name +++ b/scripts/vyatta_net_name @@ -21,7 +21,7 @@ use Sys::Syslog qw(:standard :macros); use Fcntl qw(:flock); my $BOOTFILE = "/opt/vyatta/etc/config/config.boot"; -my $VYATTACFG = "/opt/vyatta/config/active"; +my $VYATTACFG = "/opt/vyatta/config/active/interfaces"; my $UDEVDIR = "/run/udev/"; my $VYATTAUDEV = $UDEVDIR . "vyatta"; -- cgit v1.2.3 From 52856255026d37001e9a4b7749110a0e49ef2c5d Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Wed, 12 Jun 2019 12:37:24 +0200 Subject: Force create raid without answering the question if you want to create it. Update initramfs to include raidconfig avoiding md127 being created on reboot. --- scripts/install/install-get-partition | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/install/install-get-partition b/scripts/install/install-get-partition index b3f2741e..9f6473e1 100755 --- a/scripts/install/install-get-partition +++ b/scripts/install/install-get-partition @@ -302,12 +302,16 @@ check_for_new_raid () { echo "Creating RAID-1 group on partitions: /dev/${drive1}${data_dev} /dev/${drive2}${data_dev}" raid_dev=md0 - mdadm --create /dev/$raid_dev --level=1 --raid-disks=2 --metadata=0.90 \ + yes|mdadm --create /dev/$raid_dev --level=1 --raid-disks=2 --metadata=0.90 \ /dev/${drive1}${data_dev} /dev/${drive2}${data_dev} if [ $? = 0 -a -e /dev/$raid_dev ]; then echo "RAID-1 group created successfully:" cat /proc/mdstat | grep --after-context 2 ^$raid_dev | sed -e 's/^/\t/' + if [ -e /usr/sbin/update-initramfs.orig.initramfs-tools ] + echo "Updating initramfs to include the raid config:" + /usr/sbin/update-initramfs.orig.initramfs-tools -u + fi else echo "Unable to create RAID-1 group!" return -- cgit v1.2.3 From 97985e233201aaee08aeba39abcec5188edc769e Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Wed, 12 Jun 2019 13:27:38 +0200 Subject: fix if statement --- scripts/install/install-get-partition | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install/install-get-partition b/scripts/install/install-get-partition index 9f6473e1..560125c2 100755 --- a/scripts/install/install-get-partition +++ b/scripts/install/install-get-partition @@ -308,7 +308,7 @@ check_for_new_raid () { if [ $? = 0 -a -e /dev/$raid_dev ]; then echo "RAID-1 group created successfully:" cat /proc/mdstat | grep --after-context 2 ^$raid_dev | sed -e 's/^/\t/' - if [ -e /usr/sbin/update-initramfs.orig.initramfs-tools ] + if [ -e /usr/sbin/update-initramfs.orig.initramfs-tools ]; then echo "Updating initramfs to include the raid config:" /usr/sbin/update-initramfs.orig.initramfs-tools -u fi -- cgit v1.2.3 From 444975cec833fd6788c89e4ce47475cce948cf87 Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Tue, 18 Jun 2019 13:55:44 +0200 Subject: [ installer ] T1446: on installing with efi skip the xen extra checks, they use dmidecode which will not work in efi mode Get the UUID of the correct partition based on the install type (bios/efi) --- scripts/install/install-postinst-new | 6 ++++-- scripts/vyatta-grub-setup | 6 +++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/install/install-postinst-new b/scripts/install/install-postinst-new index ae723627..85eba45f 100755 --- a/scripts/install/install-postinst-new +++ b/scripts/install/install-postinst-new @@ -263,8 +263,10 @@ fi # Install grub install_grub -# Perform additional configuration if installing on Xen -check_for_xen_extras +if [ ! -d /sys/firmware/efi ]; then + # Perform additional configuration if installing on Xen + check_for_xen_extras +fi # # Only start the mdadm daemon if we have the root filesystem running diff --git a/scripts/vyatta-grub-setup b/scripts/vyatta-grub-setup index 236b41ea..de67ba60 100755 --- a/scripts/vyatta-grub-setup +++ b/scripts/vyatta-grub-setup @@ -163,7 +163,11 @@ fi fi if [ ${ROOT_PARTITION:0:2} = "md" ]; then - uuid_root_disk=`/sbin/tune2fs -l /dev/${root_disk}1 | grep UUID | awk '{print $3}'` + if [ -d /sys/firmware/efi ]; then + uuid_root_disk=`/sbin/tune2fs -l /dev/${root_disk}3 | grep UUID | awk '{print $3}'` + else + uuid_root_disk=`/sbin/tune2fs -l /dev/${root_disk}1 | grep UUID | awk '{print $3}'` + fi uuid_root_md=`/sbin/tune2fs -l /dev/md${ROOT_PARTITION#md} | grep UUID | awk '{print $3}'` echo "" echo -e "insmod part_msdos" -- cgit v1.2.3 From 842f2974d483bb37fc32b5766cb4edb5f21ec2fe Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Sun, 30 Jun 2019 20:18:15 +0200 Subject: T1430: initial implementation of IPv4 DHCP client id and hostname options. --- scripts/vyatta-interfaces.pl | 27 +++++++++++++++++++++- .../node.tag/dhcp-options/client-id/node.def | 2 ++ .../node.tag/dhcp-options/host-name/node.def | 2 ++ .../bonding/node.tag/dhcp-options/node.def | 1 + .../vif-s/node.tag/dhcp-options/client-id/node.def | 2 ++ .../vif-s/node.tag/dhcp-options/host-name/node.def | 2 ++ .../node.tag/vif-s/node.tag/dhcp-options/node.def | 1 + .../vif-c/node.tag/dhcp-options/client-id/node.def | 2 ++ .../vif-c/node.tag/dhcp-options/host-name/node.def | 2 ++ .../node.tag/vif-c/node.tag/dhcp-options/node.def | 1 + .../vif/node.tag/dhcp-options/client-id/node.def | 2 ++ .../vif/node.tag/dhcp-options/host-name/node.def | 2 ++ .../node.tag/vif/node.tag/dhcp-options/node.def | 1 + .../node.tag/dhcp-options/client-id/node.def | 2 ++ .../node.tag/dhcp-options/host-name/node.def | 2 ++ .../bridge/node.tag/dhcp-options/node.def | 1 + .../node.tag/dhcp-options/client-id/node.def | 2 ++ .../node.tag/dhcp-options/host-name/node.def | 2 ++ .../ethernet/node.tag/dhcp-options/node.def | 1 + .../vif-s/node.tag/dhcp-options/client-id/node.def | 2 ++ .../vif-s/node.tag/dhcp-options/host-name/node.def | 2 ++ .../node.tag/vif-s/node.tag/dhcp-options/node.def | 1 + .../vif-c/node.tag/dhcp-options/client-id/node.def | 2 ++ .../vif-c/node.tag/dhcp-options/host-name/node.def | 2 ++ .../node.tag/vif-c/node.tag/dhcp-options/node.def | 1 + .../vif/node.tag/dhcp-options/client-id/node.def | 2 ++ .../vif/node.tag/dhcp-options/host-name/node.def | 2 ++ .../node.tag/vif/node.tag/dhcp-options/node.def | 1 + .../node.tag/dhcp-options/client-id/node.def | 2 ++ .../node.tag/dhcp-options/host-name/node.def | 2 ++ .../pseudo-ethernet/node.tag/dhcp-options/node.def | 1 + .../vif-s/node.tag/dhcp-options/client-id/node.def | 2 ++ .../vif-s/node.tag/dhcp-options/host-name/node.def | 2 ++ .../node.tag/vif-s/node.tag/dhcp-options/node.def | 1 + .../vif-c/node.tag/dhcp-options/client-id/node.def | 2 ++ .../vif-c/node.tag/dhcp-options/host-name/node.def | 2 ++ .../node.tag/vif-c/node.tag/dhcp-options/node.def | 1 + .../vif/node.tag/dhcp-options/client-id/node.def | 2 ++ .../vif/node.tag/dhcp-options/host-name/node.def | 2 ++ .../node.tag/vif/node.tag/dhcp-options/node.def | 1 + 40 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 templates/interfaces/bonding/node.tag/dhcp-options/client-id/node.def create mode 100644 templates/interfaces/bonding/node.tag/dhcp-options/host-name/node.def create mode 100644 templates/interfaces/bonding/node.tag/dhcp-options/node.def create mode 100644 templates/interfaces/bonding/node.tag/vif-s/node.tag/dhcp-options/client-id/node.def create mode 100644 templates/interfaces/bonding/node.tag/vif-s/node.tag/dhcp-options/host-name/node.def create mode 100644 templates/interfaces/bonding/node.tag/vif-s/node.tag/dhcp-options/node.def create mode 100644 templates/interfaces/bonding/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/client-id/node.def create mode 100644 templates/interfaces/bonding/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/host-name/node.def create mode 100644 templates/interfaces/bonding/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/node.def create mode 100644 templates/interfaces/bonding/node.tag/vif/node.tag/dhcp-options/client-id/node.def create mode 100644 templates/interfaces/bonding/node.tag/vif/node.tag/dhcp-options/host-name/node.def create mode 100644 templates/interfaces/bonding/node.tag/vif/node.tag/dhcp-options/node.def create mode 100644 templates/interfaces/bridge/node.tag/dhcp-options/client-id/node.def create mode 100644 templates/interfaces/bridge/node.tag/dhcp-options/host-name/node.def create mode 100644 templates/interfaces/bridge/node.tag/dhcp-options/node.def create mode 100644 templates/interfaces/ethernet/node.tag/dhcp-options/client-id/node.def create mode 100644 templates/interfaces/ethernet/node.tag/dhcp-options/host-name/node.def create mode 100644 templates/interfaces/ethernet/node.tag/dhcp-options/node.def create mode 100644 templates/interfaces/ethernet/node.tag/vif-s/node.tag/dhcp-options/client-id/node.def create mode 100644 templates/interfaces/ethernet/node.tag/vif-s/node.tag/dhcp-options/host-name/node.def create mode 100644 templates/interfaces/ethernet/node.tag/vif-s/node.tag/dhcp-options/node.def create mode 100644 templates/interfaces/ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/client-id/node.def create mode 100644 templates/interfaces/ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/host-name/node.def create mode 100644 templates/interfaces/ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/node.def create mode 100644 templates/interfaces/ethernet/node.tag/vif/node.tag/dhcp-options/client-id/node.def create mode 100644 templates/interfaces/ethernet/node.tag/vif/node.tag/dhcp-options/host-name/node.def create mode 100644 templates/interfaces/ethernet/node.tag/vif/node.tag/dhcp-options/node.def create mode 100644 templates/interfaces/pseudo-ethernet/node.tag/dhcp-options/client-id/node.def create mode 100644 templates/interfaces/pseudo-ethernet/node.tag/dhcp-options/host-name/node.def create mode 100644 templates/interfaces/pseudo-ethernet/node.tag/dhcp-options/node.def create mode 100644 templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/dhcp-options/client-id/node.def create mode 100644 templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/dhcp-options/host-name/node.def create mode 100644 templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/dhcp-options/node.def create mode 100644 templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/client-id/node.def create mode 100644 templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/host-name/node.def create mode 100644 templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/node.def create mode 100644 templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/dhcp-options/client-id/node.def create mode 100644 templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/dhcp-options/host-name/node.def create mode 100644 templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/dhcp-options/node.def diff --git a/scripts/vyatta-interfaces.pl b/scripts/vyatta-interfaces.pl index 808015fd..f6fa717a 100755 --- a/scripts/vyatta-interfaces.pl +++ b/scripts/vyatta-interfaces.pl @@ -157,16 +157,41 @@ sub get_mtu { return $intf->mtu(); } +sub get_dhcp_client_id { + my $name = shift; + my $intf = new Vyatta::Interface($name); + my $config = new Vyatta::Config; + $config->setLevel($intf->path()); + return $config->returnValue("dhcp-options client-id"); +} + +sub get_dhcp_hostname { + my $name = shift; + my $intf = new Vyatta::Interface($name); + my $config = new Vyatta::Config; + $config->setLevel($intf->path()); + return $config->returnValue("dhcp-options host-name"); +} + sub dhcp_update_config { my ($conf_file, $intf) = @_; my $output = dhcp_conf_header(); - my $hostname = get_hostname(); + my $hostname = get_dhcp_hostname($intf); + if (!defined($hostname)) { + $hostname = get_hostname(); + } $output .= "interface \"$intf\" {\n"; if (defined($hostname)) { $output .= "\tsend host-name \"$hostname\";\n"; } + + my $client_id = get_dhcp_client_id($intf); + if (defined($client_id)) { + $output .= "\tsend dhcp-client-identifier \"$client_id\";\n"; + } + $output .= "\trequest subnet-mask, broadcast-address, routers, domain-name-servers"; my $domainname = is_domain_name_set(); if (!defined($domainname)) { diff --git a/templates/interfaces/bonding/node.tag/dhcp-options/client-id/node.def b/templates/interfaces/bonding/node.tag/dhcp-options/client-id/node.def new file mode 100644 index 00000000..85ebe6e3 --- /dev/null +++ b/templates/interfaces/bonding/node.tag/dhcp-options/client-id/node.def @@ -0,0 +1,2 @@ +type: txt +help: DHCP client identifier diff --git a/templates/interfaces/bonding/node.tag/dhcp-options/host-name/node.def b/templates/interfaces/bonding/node.tag/dhcp-options/host-name/node.def new file mode 100644 index 00000000..80d28fbd --- /dev/null +++ b/templates/interfaces/bonding/node.tag/dhcp-options/host-name/node.def @@ -0,0 +1,2 @@ +type: txt +help: DHCP client host name (overrides the system host name) diff --git a/templates/interfaces/bonding/node.tag/dhcp-options/node.def b/templates/interfaces/bonding/node.tag/dhcp-options/node.def new file mode 100644 index 00000000..e90406df --- /dev/null +++ b/templates/interfaces/bonding/node.tag/dhcp-options/node.def @@ -0,0 +1 @@ +help: DHCP options diff --git a/templates/interfaces/bonding/node.tag/vif-s/node.tag/dhcp-options/client-id/node.def b/templates/interfaces/bonding/node.tag/vif-s/node.tag/dhcp-options/client-id/node.def new file mode 100644 index 00000000..85ebe6e3 --- /dev/null +++ b/templates/interfaces/bonding/node.tag/vif-s/node.tag/dhcp-options/client-id/node.def @@ -0,0 +1,2 @@ +type: txt +help: DHCP client identifier diff --git a/templates/interfaces/bonding/node.tag/vif-s/node.tag/dhcp-options/host-name/node.def b/templates/interfaces/bonding/node.tag/vif-s/node.tag/dhcp-options/host-name/node.def new file mode 100644 index 00000000..80d28fbd --- /dev/null +++ b/templates/interfaces/bonding/node.tag/vif-s/node.tag/dhcp-options/host-name/node.def @@ -0,0 +1,2 @@ +type: txt +help: DHCP client host name (overrides the system host name) diff --git a/templates/interfaces/bonding/node.tag/vif-s/node.tag/dhcp-options/node.def b/templates/interfaces/bonding/node.tag/vif-s/node.tag/dhcp-options/node.def new file mode 100644 index 00000000..e90406df --- /dev/null +++ b/templates/interfaces/bonding/node.tag/vif-s/node.tag/dhcp-options/node.def @@ -0,0 +1 @@ +help: DHCP options diff --git a/templates/interfaces/bonding/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/client-id/node.def b/templates/interfaces/bonding/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/client-id/node.def new file mode 100644 index 00000000..85ebe6e3 --- /dev/null +++ b/templates/interfaces/bonding/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/client-id/node.def @@ -0,0 +1,2 @@ +type: txt +help: DHCP client identifier diff --git a/templates/interfaces/bonding/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/host-name/node.def b/templates/interfaces/bonding/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/host-name/node.def new file mode 100644 index 00000000..80d28fbd --- /dev/null +++ b/templates/interfaces/bonding/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/host-name/node.def @@ -0,0 +1,2 @@ +type: txt +help: DHCP client host name (overrides the system host name) diff --git a/templates/interfaces/bonding/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/node.def b/templates/interfaces/bonding/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/node.def new file mode 100644 index 00000000..e90406df --- /dev/null +++ b/templates/interfaces/bonding/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/node.def @@ -0,0 +1 @@ +help: DHCP options diff --git a/templates/interfaces/bonding/node.tag/vif/node.tag/dhcp-options/client-id/node.def b/templates/interfaces/bonding/node.tag/vif/node.tag/dhcp-options/client-id/node.def new file mode 100644 index 00000000..85ebe6e3 --- /dev/null +++ b/templates/interfaces/bonding/node.tag/vif/node.tag/dhcp-options/client-id/node.def @@ -0,0 +1,2 @@ +type: txt +help: DHCP client identifier diff --git a/templates/interfaces/bonding/node.tag/vif/node.tag/dhcp-options/host-name/node.def b/templates/interfaces/bonding/node.tag/vif/node.tag/dhcp-options/host-name/node.def new file mode 100644 index 00000000..80d28fbd --- /dev/null +++ b/templates/interfaces/bonding/node.tag/vif/node.tag/dhcp-options/host-name/node.def @@ -0,0 +1,2 @@ +type: txt +help: DHCP client host name (overrides the system host name) diff --git a/templates/interfaces/bonding/node.tag/vif/node.tag/dhcp-options/node.def b/templates/interfaces/bonding/node.tag/vif/node.tag/dhcp-options/node.def new file mode 100644 index 00000000..e90406df --- /dev/null +++ b/templates/interfaces/bonding/node.tag/vif/node.tag/dhcp-options/node.def @@ -0,0 +1 @@ +help: DHCP options diff --git a/templates/interfaces/bridge/node.tag/dhcp-options/client-id/node.def b/templates/interfaces/bridge/node.tag/dhcp-options/client-id/node.def new file mode 100644 index 00000000..85ebe6e3 --- /dev/null +++ b/templates/interfaces/bridge/node.tag/dhcp-options/client-id/node.def @@ -0,0 +1,2 @@ +type: txt +help: DHCP client identifier diff --git a/templates/interfaces/bridge/node.tag/dhcp-options/host-name/node.def b/templates/interfaces/bridge/node.tag/dhcp-options/host-name/node.def new file mode 100644 index 00000000..80d28fbd --- /dev/null +++ b/templates/interfaces/bridge/node.tag/dhcp-options/host-name/node.def @@ -0,0 +1,2 @@ +type: txt +help: DHCP client host name (overrides the system host name) diff --git a/templates/interfaces/bridge/node.tag/dhcp-options/node.def b/templates/interfaces/bridge/node.tag/dhcp-options/node.def new file mode 100644 index 00000000..e90406df --- /dev/null +++ b/templates/interfaces/bridge/node.tag/dhcp-options/node.def @@ -0,0 +1 @@ +help: DHCP options diff --git a/templates/interfaces/ethernet/node.tag/dhcp-options/client-id/node.def b/templates/interfaces/ethernet/node.tag/dhcp-options/client-id/node.def new file mode 100644 index 00000000..85ebe6e3 --- /dev/null +++ b/templates/interfaces/ethernet/node.tag/dhcp-options/client-id/node.def @@ -0,0 +1,2 @@ +type: txt +help: DHCP client identifier diff --git a/templates/interfaces/ethernet/node.tag/dhcp-options/host-name/node.def b/templates/interfaces/ethernet/node.tag/dhcp-options/host-name/node.def new file mode 100644 index 00000000..80d28fbd --- /dev/null +++ b/templates/interfaces/ethernet/node.tag/dhcp-options/host-name/node.def @@ -0,0 +1,2 @@ +type: txt +help: DHCP client host name (overrides the system host name) diff --git a/templates/interfaces/ethernet/node.tag/dhcp-options/node.def b/templates/interfaces/ethernet/node.tag/dhcp-options/node.def new file mode 100644 index 00000000..e90406df --- /dev/null +++ b/templates/interfaces/ethernet/node.tag/dhcp-options/node.def @@ -0,0 +1 @@ +help: DHCP options diff --git a/templates/interfaces/ethernet/node.tag/vif-s/node.tag/dhcp-options/client-id/node.def b/templates/interfaces/ethernet/node.tag/vif-s/node.tag/dhcp-options/client-id/node.def new file mode 100644 index 00000000..85ebe6e3 --- /dev/null +++ b/templates/interfaces/ethernet/node.tag/vif-s/node.tag/dhcp-options/client-id/node.def @@ -0,0 +1,2 @@ +type: txt +help: DHCP client identifier diff --git a/templates/interfaces/ethernet/node.tag/vif-s/node.tag/dhcp-options/host-name/node.def b/templates/interfaces/ethernet/node.tag/vif-s/node.tag/dhcp-options/host-name/node.def new file mode 100644 index 00000000..80d28fbd --- /dev/null +++ b/templates/interfaces/ethernet/node.tag/vif-s/node.tag/dhcp-options/host-name/node.def @@ -0,0 +1,2 @@ +type: txt +help: DHCP client host name (overrides the system host name) diff --git a/templates/interfaces/ethernet/node.tag/vif-s/node.tag/dhcp-options/node.def b/templates/interfaces/ethernet/node.tag/vif-s/node.tag/dhcp-options/node.def new file mode 100644 index 00000000..e90406df --- /dev/null +++ b/templates/interfaces/ethernet/node.tag/vif-s/node.tag/dhcp-options/node.def @@ -0,0 +1 @@ +help: DHCP options diff --git a/templates/interfaces/ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/client-id/node.def b/templates/interfaces/ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/client-id/node.def new file mode 100644 index 00000000..85ebe6e3 --- /dev/null +++ b/templates/interfaces/ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/client-id/node.def @@ -0,0 +1,2 @@ +type: txt +help: DHCP client identifier diff --git a/templates/interfaces/ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/host-name/node.def b/templates/interfaces/ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/host-name/node.def new file mode 100644 index 00000000..80d28fbd --- /dev/null +++ b/templates/interfaces/ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/host-name/node.def @@ -0,0 +1,2 @@ +type: txt +help: DHCP client host name (overrides the system host name) diff --git a/templates/interfaces/ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/node.def b/templates/interfaces/ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/node.def new file mode 100644 index 00000000..e90406df --- /dev/null +++ b/templates/interfaces/ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/node.def @@ -0,0 +1 @@ +help: DHCP options diff --git a/templates/interfaces/ethernet/node.tag/vif/node.tag/dhcp-options/client-id/node.def b/templates/interfaces/ethernet/node.tag/vif/node.tag/dhcp-options/client-id/node.def new file mode 100644 index 00000000..85ebe6e3 --- /dev/null +++ b/templates/interfaces/ethernet/node.tag/vif/node.tag/dhcp-options/client-id/node.def @@ -0,0 +1,2 @@ +type: txt +help: DHCP client identifier diff --git a/templates/interfaces/ethernet/node.tag/vif/node.tag/dhcp-options/host-name/node.def b/templates/interfaces/ethernet/node.tag/vif/node.tag/dhcp-options/host-name/node.def new file mode 100644 index 00000000..80d28fbd --- /dev/null +++ b/templates/interfaces/ethernet/node.tag/vif/node.tag/dhcp-options/host-name/node.def @@ -0,0 +1,2 @@ +type: txt +help: DHCP client host name (overrides the system host name) diff --git a/templates/interfaces/ethernet/node.tag/vif/node.tag/dhcp-options/node.def b/templates/interfaces/ethernet/node.tag/vif/node.tag/dhcp-options/node.def new file mode 100644 index 00000000..e90406df --- /dev/null +++ b/templates/interfaces/ethernet/node.tag/vif/node.tag/dhcp-options/node.def @@ -0,0 +1 @@ +help: DHCP options diff --git a/templates/interfaces/pseudo-ethernet/node.tag/dhcp-options/client-id/node.def b/templates/interfaces/pseudo-ethernet/node.tag/dhcp-options/client-id/node.def new file mode 100644 index 00000000..85ebe6e3 --- /dev/null +++ b/templates/interfaces/pseudo-ethernet/node.tag/dhcp-options/client-id/node.def @@ -0,0 +1,2 @@ +type: txt +help: DHCP client identifier diff --git a/templates/interfaces/pseudo-ethernet/node.tag/dhcp-options/host-name/node.def b/templates/interfaces/pseudo-ethernet/node.tag/dhcp-options/host-name/node.def new file mode 100644 index 00000000..80d28fbd --- /dev/null +++ b/templates/interfaces/pseudo-ethernet/node.tag/dhcp-options/host-name/node.def @@ -0,0 +1,2 @@ +type: txt +help: DHCP client host name (overrides the system host name) diff --git a/templates/interfaces/pseudo-ethernet/node.tag/dhcp-options/node.def b/templates/interfaces/pseudo-ethernet/node.tag/dhcp-options/node.def new file mode 100644 index 00000000..e90406df --- /dev/null +++ b/templates/interfaces/pseudo-ethernet/node.tag/dhcp-options/node.def @@ -0,0 +1 @@ +help: DHCP options diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/dhcp-options/client-id/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/dhcp-options/client-id/node.def new file mode 100644 index 00000000..85ebe6e3 --- /dev/null +++ b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/dhcp-options/client-id/node.def @@ -0,0 +1,2 @@ +type: txt +help: DHCP client identifier diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/dhcp-options/host-name/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/dhcp-options/host-name/node.def new file mode 100644 index 00000000..80d28fbd --- /dev/null +++ b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/dhcp-options/host-name/node.def @@ -0,0 +1,2 @@ +type: txt +help: DHCP client host name (overrides the system host name) diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/dhcp-options/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/dhcp-options/node.def new file mode 100644 index 00000000..e90406df --- /dev/null +++ b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/dhcp-options/node.def @@ -0,0 +1 @@ +help: DHCP options diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/client-id/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/client-id/node.def new file mode 100644 index 00000000..85ebe6e3 --- /dev/null +++ b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/client-id/node.def @@ -0,0 +1,2 @@ +type: txt +help: DHCP client identifier diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/host-name/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/host-name/node.def new file mode 100644 index 00000000..80d28fbd --- /dev/null +++ b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/host-name/node.def @@ -0,0 +1,2 @@ +type: txt +help: DHCP client host name (overrides the system host name) diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/node.def new file mode 100644 index 00000000..e90406df --- /dev/null +++ b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/vif-c/node.tag/dhcp-options/node.def @@ -0,0 +1 @@ +help: DHCP options diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/dhcp-options/client-id/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/dhcp-options/client-id/node.def new file mode 100644 index 00000000..85ebe6e3 --- /dev/null +++ b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/dhcp-options/client-id/node.def @@ -0,0 +1,2 @@ +type: txt +help: DHCP client identifier diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/dhcp-options/host-name/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/dhcp-options/host-name/node.def new file mode 100644 index 00000000..80d28fbd --- /dev/null +++ b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/dhcp-options/host-name/node.def @@ -0,0 +1,2 @@ +type: txt +help: DHCP client host name (overrides the system host name) diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/dhcp-options/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/dhcp-options/node.def new file mode 100644 index 00000000..e90406df --- /dev/null +++ b/templates/interfaces/pseudo-ethernet/node.tag/vif/node.tag/dhcp-options/node.def @@ -0,0 +1 @@ +help: DHCP options -- cgit v1.2.3 From eebb654d64fc8dafeecbda93414436a51881f776 Mon Sep 17 00:00:00 2001 From: runborg Date: Fri, 5 Jul 2019 22:23:59 +0200 Subject: T1499: Allow for usage of systemd interface mappings (#103) * T1499: Allow for usage of systemd interface mappings * T1499: Fix not working regex in ethernet interface parsing --- sysconf/netdevice | 4 ++++ templates/interfaces/ethernet/node.def | 3 ++- templates/interfaces/tunnel/node.tag/dhcp-interface/node.def | 2 +- templates/system/ipv6/strict-dad/node.def | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/sysconf/netdevice b/sysconf/netdevice index 417732c7..e9349789 100644 --- a/sysconf/netdevice +++ b/sysconf/netdevice @@ -2,6 +2,10 @@ lo loopback eth ethernet lan ethernet +eno ethernet +ens ethernet +enp ethernet +enx ethernet ifb input peth pseudo-ethernet br bridge diff --git a/templates/interfaces/ethernet/node.def b/templates/interfaces/ethernet/node.def index b4e60340..2d66a11b 100644 --- a/templates/interfaces/ethernet/node.def +++ b/templates/interfaces/ethernet/node.def @@ -4,7 +4,8 @@ type: txt help: Ethernet interface name allowed: /opt/vyatta/sbin/vyatta-interfaces.pl --show=ethernet val_help: ; Ethernet interface name -syntax:expression: pattern $VAR(@) "^(eth|lan)[0-9]+$" \ + /proc/sys/net/ipv6/conf/all/accept_dad" sudo sh -c "echo 1 > /proc/sys/net/ipv6/conf/default/accept_dad" - for ifname in /sys/class/net/eth* ; do + for ifname in /sys/class/net/eth* /sys/class/net/en* ; do if [ -d $ifname ]; then ifname=${ifname#/sys/class/net/} sudo sh -c "echo 1 > /proc/sys/net/ipv6/conf/$ifname/accept_dad" -- cgit v1.2.3 From 41c1291ee3e8bead09305ff120d8d28e4a21d030 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Mon, 8 Jul 2019 11:57:21 +0200 Subject: T1465: remove custom priority from "vti vtiX ip" that was causing priority inversion. --- gen-interface-templates.pl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gen-interface-templates.pl b/gen-interface-templates.pl index 8e08f6ad..dab604a8 100755 --- a/gen-interface-templates.pl +++ b/gen-interface-templates.pl @@ -50,9 +50,7 @@ my %interface_hash = ( # Hash table to check if the priority needs to set @ root # of the node.def which is generated. -my %interface_prio = ( - 'vti/node.tag' => '901', -); +my %interface_prio = (); sub gen_template { my ( $inpath, $outpath, $ifname, $gen_prio, $prio, $depth ) = @_; -- cgit v1.2.3 From ec407d330649e687da42edcca46b6ea544f65458 Mon Sep 17 00:00:00 2001 From: Eshenko Dmitriy Date: Fri, 19 Jul 2019 01:29:26 +0300 Subject: Fix T1491 --- templates/interfaces/bonding/node.tag/primary/node.def | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/interfaces/bonding/node.tag/primary/node.def b/templates/interfaces/bonding/node.tag/primary/node.def index f80c6b8f..f91b1d6c 100644 --- a/templates/interfaces/bonding/node.tag/primary/node.def +++ b/templates/interfaces/bonding/node.tag/primary/node.def @@ -3,5 +3,8 @@ priority: 320 # must be after ethernet bond-group commit:expression: exec \ "grep -s $VAR(@) /sys/class/net/$VAR(../@)/bonding/slaves" \ ; "Ethernet interface must be part of the bonding group" +commit:expression: exec \ + "grep -E '(^active-backup|balance-tlb|balance-alb)' /sys/class/net/$VAR(../@)/bonding/mode" \ + ; "Bonding must have mode active-backup, transmit-load-balance or adaptive-load-balance" update: sudo sh -c "echo $VAR(@) >/sys/class/net/$VAR(../@)/bonding/primary" help: Primary device interface -- cgit v1.2.3 From a75a3556642c5ca96c35dec3f9ce1cb173ed0875 Mon Sep 17 00:00:00 2001 From: Eshenko Dmitriy Date: Fri, 19 Jul 2019 01:35:14 +0300 Subject: Update node.def --- templates/interfaces/bonding/node.tag/primary/node.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/interfaces/bonding/node.tag/primary/node.def b/templates/interfaces/bonding/node.tag/primary/node.def index f91b1d6c..98a18a48 100644 --- a/templates/interfaces/bonding/node.tag/primary/node.def +++ b/templates/interfaces/bonding/node.tag/primary/node.def @@ -4,7 +4,7 @@ commit:expression: exec \ "grep -s $VAR(@) /sys/class/net/$VAR(../@)/bonding/slaves" \ ; "Ethernet interface must be part of the bonding group" commit:expression: exec \ - "grep -E '(^active-backup|balance-tlb|balance-alb)' /sys/class/net/$VAR(../@)/bonding/mode" \ + "grep -E '(^active-backup|^balance-tlb|^balance-alb)' /sys/class/net/$VAR(../@)/bonding/mode" \ ; "Bonding must have mode active-backup, transmit-load-balance or adaptive-load-balance" update: sudo sh -c "echo $VAR(@) >/sys/class/net/$VAR(../@)/bonding/primary" help: Primary device interface -- cgit v1.2.3