summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2019-07-23 07:25:31 -0400
committerDaniil Baturin <daniil@baturin.org>2019-07-23 07:25:31 -0400
commit2e3ce45a0218a626434891ba3db16d977fbf8f0e (patch)
tree24ecc077759c0dfc8bc557915cb5002d2fae0385 /scripts
parent0beae43d41a6bd8e1997c7a0013fb9263d7774f9 (diff)
parent995b5071d15f0a5a9d8c5f261f188e5252a966a4 (diff)
downloadvyatta-cfg-system-2e3ce45a0218a626434891ba3db16d977fbf8f0e.tar.gz
vyatta-cfg-system-2e3ce45a0218a626434891ba3db16d977fbf8f0e.zip
Merge branch 'current' into equuleus
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/install/install-get-partition6
-rwxr-xr-xscripts/install/install-postinst-new6
-rwxr-xr-xscripts/vyatta-grub-setup6
-rwxr-xr-xscripts/vyatta-interfaces.pl27
-rwxr-xr-xscripts/vyatta_net_name2
5 files changed, 41 insertions, 6 deletions
diff --git a/scripts/install/install-get-partition b/scripts/install/install-get-partition
index b3f2741e..560125c2 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 ]; then
+ 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
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"
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/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";