Merge "Migrate dhcp-config to Debian"

This commit is contained in:
Zuul 2021-12-15 22:34:57 +00:00 committed by Gerrit Code Review
commit bfc03f1ef0
12 changed files with 138 additions and 0 deletions

View File

@ -0,0 +1,5 @@
dhcp-config (1.0-1) unstable; urgency=medium
* Initial release
-- Iago Regiani <Iago.RodriguezRegiani@windriver.com> Mon, 4 Oct 2021 08:50:58 -0300

View File

@ -0,0 +1,13 @@
Source: dhcp-config
Section: admin
Priority: optional
Maintainer: StarlingX Developers <starlingx-discuss@lists.starlingx.io>
Build-Depends: debhelper-compat (= 13)
Standards-Version: 4.4.1
Homepage: https://www.starlingx.io
Package: dhcp-config
Architecture: any
Depends: ${misc:Depends}, isc-dhcp-client
Description: StarlingX configuration files - dhcp-config
Package of dhcp-config to system folder.

View File

@ -0,0 +1,27 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: dhcp-config
Source: https://opendev.org/starlingx/config-files
Files: *
Copyright: (c) 2013-2021 Wind River Systems, Inc
License: Apache-2
Files: debian/*
Copyright: 2021 Wind River Systems, Inc
License: Apache-2
License: Apache-2
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
.
https://www.apache.org/licenses/LICENSE-2.0
.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
.
On Debian-based systems the full text of the Apache version 2.0 license
can be found in `/usr/share/common-licenses/Apache-2.0'.

View File

@ -0,0 +1,2 @@
dhclient.conf /usr/share/starlingx
dhclient-enter-hooks /etc/dhcp/

View File

@ -0,0 +1,8 @@
#!/bin/sh
set -e
cp /usr/share/starlingx/dhclient.conf /etc/dhcp/dhclient.conf
chmod 0755 /etc/dhcp/dhclient-enter-hooks
#DEBHELPER#

View File

@ -0,0 +1,8 @@
#!/bin/sh
set -e
dpkg-divert --remove --package dhcp-config --rename \
/etc/dhcp/dhclient.conf
#DEBHELPER#

View File

@ -0,0 +1,9 @@
#!/bin/sh
set -e
dpkg-divert --add --package dhcp-config --rename \
--divert /etc/dhcp/dhclient.conf.old \
/etc/dhcp/dhclient.conf
#DEBHELPER#

View File

@ -0,0 +1,5 @@
#!/usr/bin/make -f
#export DH_VERBOSE = 1
%:
dh $@

View File

@ -0,0 +1 @@
3.0 (quilt)

View File

@ -0,0 +1,7 @@
---
debname: dhcp-config
debver: 1.0-1
src_path: source-debian
revision:
dist: $STX_DIST
PKG_GITREVCOUNT: true

View File

@ -0,0 +1,32 @@
#!/bin/bash
#
# /etc/dhclient-enter-hooks
#
# This file is sourced by /sbin/dhclient-script.
#
# Select wrs-install-uuid from ipv4 or ipv6
if [ -n "$new_dhcp6_wrs_install_uuid" ]; then
wrs_install_uuid=$new_dhcp6_wrs_install_uuid
else
wrs_install_uuid=$new_wrs_install_uuid
fi
# Enforce wrs-install-uuid on management and infrastrucure interfaces
source /etc/platform/platform.conf
if [ -n "$wrs_install_uuid" ]; then
if [ "$nodetype" == "controller" ]; then
source /etc/build.info
file="/var/www/pages/feed/rel-$SW_VERSION/install_uuid"
INSTALL_UUID=$(cat "$file")
fi
if [ "$INSTALL_UUID" != "$wrs_install_uuid" ]; then
exit_status=1
fi
elif [ "$interface" == "$management_interface" -o \
"$interface" == "$infrastructure_interface" ]; then
if [ "$nodetype" != "controller" -o \
-e "/etc/platform/.initial_config_complete" ]; then
exit_status=1
fi
fi

View File

@ -0,0 +1,21 @@
# Default dhclient.conf file
#
option wrs-install-uuid code 224 = string;
option dhcp6.wrs-install-uuid code 224 = string;
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, host-name,
interface-mtu, fqdn, dhcp6.fqdn, wrs-install-uuid,
dhcp6.wrs-install-uuid, netbios-name-servers, netbios-scope,
dhcp6.name-servers;
timeout 30;
#Changed for CGCS to improve Dead office recovery (DOR behavior)
# retry: every 30 seconds
retry 5;
# By default, use a hardware address based client-id for both IPv4 and IPv6.
# We change this via puppet to ensure that interfaces that share the same MAC
# are not using the same client-id value.
send dhcp6.client-id = concat(00:03:00, hardware);
send dhcp-client-identifier = concat(00:03:00, hardware);