-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DHCP Relay]: Add support for custom Option 82 circuit_id of the form '<hostname>:<portname>' #747
Merged
Merged
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
3a2b6d6
Add isc-dhcp-relay .deb package to image build process, along with my…
jleveque f4a8bfb
Install custom isc-dhcp-relay in dhcp_relay docker
jleveque f633656
Install isc-dhcp-relay build dependencies in sonic-slave Docker conta…
jleveque 1d2f244
Copy the built .deb package to the destination directory
jleveque fc3560e
Add dependencies for isc-dhcp-relay
jleveque fe394ba
Change Option 82 string to '<hostname>:<portname>'
jleveque b551b56
Install dependencies of .deb files implicitly in Dockerfile
jleveque 938474f
Add docker-dhcp-relay/Dockerfile to .gitignore
jleveque a2579da
Remove unused line
jleveque 28b45f3
Remove unnecessary space
jleveque File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
FROM docker-config-engine | ||
|
||
# Make apt-get non-interactive | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# Update apt's cache of available packages | ||
RUN apt-get update | ||
|
||
{% if docker_dhcp_relay_debs.strip() -%} | ||
# Copy built Debian packages | ||
{%- for deb in docker_dhcp_relay_debs.split(' ') %} | ||
COPY debs/{{ deb }}{{' '}} debs/ | ||
{%- endfor %} | ||
|
||
# Install built Debian packages and implicitly install their dependencies | ||
{%- for deb in docker_dhcp_relay_debs.split(' ') %} | ||
#RUN dpkg -i debs/{{ deb }} | ||
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; }; dpkg_apt debs/{{ deb }} | ||
{%- endfor %} | ||
{%- endif %} | ||
|
||
# Clean up | ||
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y | ||
RUN rm -rf /debs | ||
|
||
COPY ["start.sh", "isc-dhcp-relay.sh", "/usr/bin/"] | ||
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"] | ||
COPY ["isc-dhcp-relay.j2", "/usr/share/sonic/templates/"] | ||
|
||
ENTRYPOINT ["/usr/bin/supervisord"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# isc-dhcp packages | ||
|
||
ISC_DHCP_VERSION = 4.3.1-6 | ||
|
||
export ISC_DHCP_VERSION | ||
|
||
ISC_DHCP_COMMON = isc-dhcp-common_$(ISC_DHCP_VERSION)_amd64.deb | ||
$(ISC_DHCP_COMMON)_SRC_PATH = $(SRC_PATH)/isc-dhcp | ||
SONIC_MAKE_DEBS += $(ISC_DHCP_COMMON) | ||
|
||
ISC_DHCP_RELAY = isc-dhcp-relay_$(ISC_DHCP_VERSION)_amd64.deb | ||
$(eval $(call add_derived_package,$(ISC_DHCP_COMMON),$(ISC_DHCP_RELAY))) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
.ONESHELL: | ||
SHELL = /bin/bash | ||
.SHELLFLAGS += -e | ||
|
||
MAIN_TARGET = isc-dhcp-common_$(ISC_DHCP_VERSION)_amd64.deb | ||
DERIVED_TARGETS = isc-dhcp-relay_$(ISC_DHCP_VERSION)_amd64.deb | ||
|
||
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : | ||
# Remove any stale files | ||
rm -rf ./isc-dhcp | ||
|
||
# Clone isc-dhcp repo | ||
git clone git://anonscm.debian.org/pkg-dhcp/isc-dhcp.git | ||
pushd ./isc-dhcp | ||
git checkout -f debian/4.3.1-6 | ||
popd | ||
|
||
# Apply patch | ||
patch -p1 < isc-dhcp-4.3.1_dhcrelay-custom-circuit_id-remote_id-and-bridge-iface-support.patch | ||
|
||
# Build source and Debian packages | ||
pushd ./isc-dhcp | ||
dpkg-buildpackage -rfakeroot -b -us -uc | ||
popd | ||
|
||
# Move the newly-built .deb packages to the destination directory | ||
mv $* $(DERIVED_TARGETS) $(DEST)/ | ||
|
||
$(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET) | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks like commented code. it's confusing. Someone didn't removed old code, or necessary code wasn't uncommented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the confusion. I was looking as the wrong comment!