forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ntp]: build ntp with various fixes (sonic-net#6037)
- NTP Bug 1970 (UNLINK_EXPR_SLIST empty list) Fix - ENOBUFS log message level set to WARN - Fix audit message seen on console apparmor - add force-confold option when install ntp Signed-off-by: Guohan Lu <[email protected]> Co-authored-by: Prabhu Sreenivasan <prabhu.sreenivasan@broadcom>
- Loading branch information
Showing
12 changed files
with
149 additions
and
1 deletion.
There are no files selected for viewing
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,10 @@ | ||
|
||
SPATH := $($(NTP)_SRC_PATH) | ||
DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/ntp.mk rules/ntp.dep | ||
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) | ||
DEP_FILES += $(shell git ls-files $(SPATH)) | ||
|
||
$(NTP)_CACHE_MODE := GIT_CONTENT_SHA | ||
$(NTP)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) | ||
$(NTP)_DEP_FILES := $(DEP_FILES) | ||
|
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,11 @@ | ||
# ntp package | ||
|
||
NTP_VERSION = 4.2.8p12+dfsg | ||
export NTP_VERSION | ||
|
||
NTP = ntp_$(NTP_VERSION)-4+deb10u2_amd64.deb | ||
$(NTP)_SRC_PATH = $(SRC_PATH)/ntp | ||
SONIC_MAKE_DEBS += $(NTP) | ||
SONIC_STRETCH_DEBS += $(NTP) | ||
|
||
export NTP |
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,5 @@ | ||
*+dfsg | ||
*.buildinfo | ||
*.changes | ||
*.xz | ||
*.deb |
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,48 @@ | ||
.ONESHELL: | ||
SHELL = /bin/bash | ||
.SHELLFLAGS += -e | ||
|
||
MAIN_TARGET = $(NTP) | ||
|
||
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : | ||
# Remove any stale files | ||
rm -rf ./ntp-$(NTP_VERSION) ./ntp_$(NTP_VERSION).orig.tar.xz ./ntp_$(NTP_VERSION)-4.debian.tar.xz | ||
|
||
# Get ntp release, debian files | ||
wget http://deb.debian.org/debian/pool/main/n/ntp/ntp_$(NTP_VERSION).orig.tar.xz | ||
wget http://deb.debian.org/debian/pool/main/n/ntp/ntp_$(NTP_VERSION)-4.debian.tar.xz | ||
|
||
# UnTar ntp release | ||
xzcat ntp_$(NTP_VERSION).orig.tar.xz | tar -xvf - | ||
|
||
pushd ./ntp-4.2.8p12 | ||
|
||
# UnTar debian files | ||
xzcat ../ntp_$(NTP_VERSION)-4.debian.tar.xz | tar -xvf - | ||
|
||
# Add the additional patch | ||
cp ../patch/bug1970-UNLINK_EXPR_SLIST_empty_list.patch debian/patches/ | ||
cp ../patch/update_ENOBUFS_log_level.patch debian/patches/ | ||
cat ../patch/series >> debian/patches/series | ||
|
||
# Update the changelog | ||
cat ../patch/changelog debian/changelog > debian/changelog.new | ||
rm debian/changelog ; mv debian/changelog.new debian/changelog | ||
|
||
# The debian mirror build likely took place on a system without | ||
# libevent installed, thus adding the below for SONiC | ||
sed -i 's/--with-locfile=legacy/--with-locfile=legacy --enable-local-libevent/' debian/rules | ||
|
||
# Fix the apparmor profile to avoid the following message | ||
# "Failed name lookup - disconnected path" | ||
# and go into learning mode. | ||
sed -i 's/\/usr\/sbin\/ntpd {/\/usr\/sbin\/ntpd flags=(attach_disconnected complain) {/' debian/apparmor-profile | ||
|
||
# Build source and Debian packages with the symbols | ||
dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) | ||
|
||
popd | ||
|
||
# Move the newly-built .deb packages to the destination directory | ||
mv $* $(DEST)/ | ||
|
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,26 @@ | ||
Bug 1970 UNLINK_EXPR_SLIST() causes crash if list is empty | ||
|
||
From: Arun Barboza <[email protected]> | ||
|
||
|
||
--- | ||
include/ntp_lists.h | 6 +++++- | ||
1 file changed, 5 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/include/ntp_lists.h b/include/ntp_lists.h | ||
index d741974..f90bf23 100644 | ||
--- a/include/ntp_lists.h | ||
+++ b/include/ntp_lists.h | ||
@@ -184,7 +184,11 @@ do { \ | ||
do { \ | ||
entrytype **ppentry; \ | ||
\ | ||
- ppentry = &(listhead); \ | ||
+ if (!listhead) { \ | ||
+ (punlinked) = NULL; \ | ||
+ break; \ | ||
+ } \ | ||
+ else ppentry = &(listhead); \ | ||
\ | ||
while (!(expr)) \ | ||
if (*ppentry != NULL && \ |
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,12 @@ | ||
ntp (1:4.2.8p12+dfsg-4+deb10u2) stretch; urgency=medium | ||
|
||
* Adjust the ENOBUFS syslog level on the Netlink routing to LOG_WARNING. | ||
|
||
-- Arun Barboza <[email protected]> Mon, 09 Sep 2019 10:15:35 -0700 | ||
|
||
ntp (1:4.2.8p12+dfsg-4+deb10u1) stretch; urgency=medium | ||
|
||
* Apply Bug1970 fix for UNLINK_EXPR_SLIST_empty_list from dev branch. | ||
|
||
-- Arun Barboza <[email protected]> Tue, 25 Jun 2019 14:35:24 -0700 | ||
|
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,3 @@ | ||
# This series applies on GIT commit d09f041a49c61971f59fc29f505446c63aea51b1 | ||
bug1970-UNLINK_EXPR_SLIST_empty_list.patch | ||
update_ENOBUFS_log_level.patch |
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,22 @@ | ||
Adjust the ENOBUFS syslog level on the Netlink routing to LOG_WARNING. | ||
|
||
From: Arun Barboza <[email protected]> | ||
|
||
|
||
--- | ||
ntpd/ntp_io.c | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
Index: b/ntpd/ntp_io.c | ||
=================================================================== | ||
--- a/ntpd/ntp_io.c | ||
+++ b/ntpd/ntp_io.c | ||
@@ -4709,7 +4709,7 @@ process_routing_msgs(struct asyncio_read | ||
|
||
if (cnt < 0) { | ||
if (errno == ENOBUFS) { | ||
- msyslog(LOG_ERR, | ||
+ msyslog(LOG_WARNING, | ||
"routing socket reports: %m"); | ||
} else { | ||
msyslog(LOG_ERR, |