Skip to content
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

[4/4] New rsync target #1080

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions build-config/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -502,14 +502,14 @@ ifeq ($(SHIM_ENABLE),yes)
include make/shim.make
endif

ifeq ($(LIBPCAP_ENABLE),yes)
include make/libpcap.make
endif

ifeq ($(TCPDUMP_ENABLE),yes)
include make/tcpdump.make
endif

ifeq ($(RSYNC_ENABLE),yes)
include make/rsync.make
endif

include make/images.make
include make/demo.make

Expand Down
8 changes: 4 additions & 4 deletions build-config/make/images.make
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@ ifeq ($(SECURE_GRUB),no)
GPG_SIGN_SECRING = ''
endif

ifeq ($(LIBPCAP_ENABLE),yes)
PACKAGES_INSTALL_STAMPS += $(LIBPCAP_STAMP)
endif

ifeq ($(TCPDUMP_ENABLE),yes)
PACKAGES_INSTALL_STAMPS += $(TCPDUMP_STAMP)
endif

ifeq ($(RSYNC_ENABLE),yes)
PACKAGES_INSTALL_STAMPS += $(RSYNC_STAMP)
endif

ifndef MAKE_CLEAN
SYSROOT_NEW_FILES = $(shell \
test -d $(ROOTCONFDIR)/default && \
Expand Down
6 changes: 3 additions & 3 deletions build-config/make/libpcap.make
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
# This is a makefile fragment that defines the build of libpcap
#

LIBPCAP_VERSION = 1.10.4
LIBPCAP_TARBALL = libpcap-$(LIBPCAP_VERSION).tar.gz
LIBPCAP_VERSION = 1.10.4
LIBPCAP_TARBALL = libpcap-$(LIBPCAP_VERSION).tar.gz
LIBPCAP_TARBALL_URLS += $(ONIE_MIRROR) \
https://www.tcpdump.org/release
LIBPCAP_BUILD_DIR = $(USER_BUILDDIR)/libpcap
Expand Down Expand Up @@ -91,7 +91,7 @@ libpcap-install: $(LIBPCAP_INSTALL_STAMP)
$(LIBPCAP_INSTALL_STAMP): $(SYSROOT_INIT_STAMP) $(LIBPCAP_BUILD_STAMP)
$(Q) rm -f $@ && eval $(PROFILE_STAMP)
$(Q) echo "==== Installing libpcap in $(SYSROOTDIR) ===="
$(Q) mkdir -p $(SYSROSYSROOTDIROT)/usr/lib/
$(Q) mkdir -p $(SYSROOTDIR)/usr/lib/
$(Q) cp -av $(DEV_SYSROOT)/usr/lib/libpcap.so $(SYSROOTDIR)/usr/lib/
$(Q) cp -av $(DEV_SYSROOT)/usr/lib/libpcap.so.1 $(SYSROOTDIR)/usr/lib/
$(Q) cp -av $(DEV_SYSROOT)/usr/lib/libpcap.so.$(LIBPCAP_VERSION) $(SYSROOTDIR)/usr/lib/
Expand Down
20 changes: 19 additions & 1 deletion build-config/make/openssl.make
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# This is a makefile fragment that defines the build of openssl
#

OPENSSL_VERSION = 1.1.1g
OPENSSL_VERSION ?= 1.1.1g
OPENSSL_TARBALL = openssl-$(OPENSSL_VERSION).tar.gz
OPENSSL_TARBALL_URLS += $(ONIE_MIRROR) \
https://www.openssl.org/source
Expand All @@ -31,10 +31,26 @@ PHONY += openssl openssl-download openssl-source \
openssl-configure openssl-build openssl-install openssl-clean \
openssl-download-clean

ifeq ($(OPENSSL_VERSION),1.1.1g)
OPENSSL_ARCH =
OPENSSL_LIBS = \
engines-1.1 \
libcrypto.so libcrypto.so.1.1 \
libssl.so libssl.so.1.1
else ifeq ($(OPENSSL_VERSION),3.4.0)
ifeq ($(ARCH),arm64)
OPENSSL_ARCH = linux-aarch64
else
OPENSSL_ARCH = linux-$(ARCH)
endif

OPENSSL_LIBS = \
engines \
libcrypto.so libcrypto.so.3 \
libssl.so libssl.so.3
else
$(error OPENSSL_LIBS: Unsupported OpenSSL version: $(OPENSSL_VERSION))
endif

OPENSSL_BINS = openssl

Expand Down Expand Up @@ -63,7 +79,9 @@ $(OPENSSL_CONFIGURE_STAMP): $(OPENSSL_SOURCE_STAMP) $(ZLIB_BUILD_STAMP) \
$(Q) rm -f $@ && eval $(PROFILE_STAMP)
$(Q) echo "==== Configure openssl-$(OPENSSL_VERSION) ===="
$(Q) cd $(OPENSSL_DIR) && PATH='$(CROSSBIN):$(PATH)' \
MACHINE=$(TARGET) RELEASE=$(LINUX_RELEASE) \
$(OPENSSL_DIR)/config \
$(OPENSSL_ARCH) \
--prefix=/usr \
--cross-compile-prefix=$(CROSSPREFIX) \
shared \
Expand Down
130 changes: 130 additions & 0 deletions build-config/make/rsync.make
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
#-------------------------------------------------------------------------------
#
# Copyright (C) 2024 Abhisit Sangjan <[email protected]>
#
# SPDX-License-Identifier: GPL-2.0
#
#-------------------------------------------------------------------------------
#
# This is a makefile fragment that defines the build of rsync
#

include make/openssl.make
include make/popt.make

RSYNC_VERSION = 3.3.0
RSYNC_TARBALL = rsync-$(RSYNC_VERSION).tar.gz
RSYNC_TARBALL_URLS += $(ONIE_MIRROR) \
https://download.samba.org/pub/rsync/src
RSYNC_BUILD_DIR = $(USER_BUILDDIR)/rsync
RSYNC_DIR = $(RSYNC_BUILD_DIR)/rsync-$(RSYNC_VERSION)

RSYNC_SRCPATCHDIR = $(PATCHDIR)/rsync
RSYNC_DOWNLOAD_STAMP = $(DOWNLOADDIR)/rsync-download
RSYNC_SOURCE_STAMP = $(USER_STAMPDIR)/rsync-source
RSYNC_PATCH_STAMP = $(USER_STAMPDIR)/rsync-patch
RSYNC_CONFIGURE_STAMP = $(USER_STAMPDIR)/rsync-configure
RSYNC_BUILD_STAMP = $(USER_STAMPDIR)/rsync-build
RSYNC_INSTALL_STAMP = $(STAMPDIR)/rsync-install
RSYNC_STAMP = $(RSYNC_DOWNLOAD_STAMP) \
$(RSYNC_SOURCE_STAMP) \
$(RSYNC_PATCH_STAMP) \
$(RSYNC_CONFIGURE_STAMP) \
$(RSYNC_BUILD_STAMP) \
$(RSYNC_INSTALL_STAMP)

PHONY += rsync \
rsync-download \
rsync-source \
rsync-patch \
rsync-configure \
rsync-build \
rsync-install \
rsync-clean \
rsync-download-clean

rsync: $(RSYNC_STAMP)

DOWNLOAD += $(RSYNC_DOWNLOAD_STAMP)

rsync-download: $(RSYNC_DOWNLOAD_STAMP)
$(RSYNC_DOWNLOAD_STAMP): $(PROJECT_STAMP)
$(Q) rm -f $@ && eval $(PROFILE_STAMP)
$(Q) echo "==== Getting upstream rsync ===="
$(Q) $(SCRIPTDIR)/fetch-package $(DOWNLOADDIR) $(UPSTREAMDIR) \
$(RSYNC_TARBALL) $(RSYNC_TARBALL_URLS)
$(Q) touch $@

SOURCE += $(RSYNC_SOURCE_STAMP)

rsync-source: $(RSYNC_SOURCE_STAMP)
$(RSYNC_SOURCE_STAMP): $(USER_TREE_STAMP) | $(RSYNC_DOWNLOAD_STAMP)
$(Q) rm -f $@ && eval $(PROFILE_STAMP)
$(Q) echo "==== Extracting upstream rsync ===="
$(Q) $(SCRIPTDIR)/extract-package $(RSYNC_BUILD_DIR) $(DOWNLOADDIR)/$(RSYNC_TARBALL)
$(Q) touch $@

rsync-patch: $(RSYNC_PATCH_STAMP)
$(RSYNC_PATCH_STAMP): $(RSYNC_SRCPATCHDIR)/* $(RSYNC_SOURCE_STAMP)
$(Q) rm -f $@ && eval $(PROFILE_STAMP)
$(Q) echo "==== Patching rsync ===="
$(Q) $(SCRIPTDIR)/apply-patch-series $(RSYNC_SRCPATCHDIR)/series $(RSYNC_DIR)
$(Q) touch $@

ifndef MAKE_CLEAN
RSYNC_NEW_FILES = $( \
shell test -d $(RSYNC_DIR) && \
test -f $(RSYNC_BUILD_STAMP) && \
find -L $(RSYNC_DIR) -newer $(RSYNC_BUILD_STAMP) -type f -print -quit \
)
endif

rsync-configure: $(RSYNC_CONFIGURE_STAMP)
$(RSYNC_CONFIGURE_STAMP): $(RSYNC_PATCH_STAMP) $(OPENSSL_INSTALL_STAMP) $(POPT_INSTALL_STAMP) | $(DEV_SYSROOT_INIT_STAMP)
$(Q) rm -f $@ && eval $(PROFILE_STAMP)
$(Q) echo "==== Configure rsync-$(RSYNC_VERSION) ===="
$(Q) cd $(RSYNC_DIR) && \
$(RSYNC_DIR)/configure \
--host=$(TARGET) \
--prefix=/usr \
--disable-xxhash \
--disable-zstd \
--disable-lz4
$(Q) touch $@

rsync-build: $(RSYNC_BUILD_STAMP)
$(RSYNC_BUILD_STAMP): $(RSYNC_CONFIGURE_STAMP) $(RSYNC_NEW_FILES) | $(DEV_SYSROOT_INIT_STAMP)
$(Q) rm -f $@ && eval $(PROFILE_STAMP)
$(Q) echo "==== Building rsync-$(RSYNC_VERSION) ===="
$(Q) PATH='$(CROSSBIN):$(PATH)' \
$(MAKE) -C $(RSYNC_DIR) \
CC=$(CROSSPREFIX)gcc \
CFLAGS="$(ONIE_CFLAGS) -I $(DEV_SYSROOT)/usr/include"
$(Q) PATH='$(CROSSBIN):$(PATH)' \
$(MAKE) -C $(RSYNC_DIR) install DESTDIR=$(DEV_SYSROOT) \
CC=$(CROSSPREFIX)gcc
$(Q) touch $@

rsync-install: $(RSYNC_INSTALL_STAMP)
$(RSYNC_INSTALL_STAMP): $(SYSROOT_INIT_STAMP) $(RSYNC_BUILD_STAMP)
$(Q) rm -f $@ && eval $(PROFILE_STAMP)
$(Q) echo "==== Installing rsync in $(SYSROOTDIR) ===="
$(Q) mkdir -p $(SYSROOTDIR)/usr/bin/
$(Q) cp -av $(DEV_SYSROOT)/usr/bin/rsync $(SYSROOTDIR)/usr/bin/
$(Q) touch $@

USER_CLEAN += rsync-clean
rsync-clean:
$(Q) rm -rf $(RSYNC_BUILD_DIR)
$(Q) rm -f $(RSYNC_STAMP)
$(Q) echo "=== Finished making $@ for $(PLATFORM)"

DOWNLOAD_CLEAN += rsync-download-clean
rsync-download-clean:
$(Q) rm -f $(RSYNC_DOWNLOAD_STAMP) $(DOWNLOADDIR)/$(RSYNC_TARBALL)

#-------------------------------------------------------------------------------
#
# Local Variables:
# mode: makefile-gmake
# End:
18 changes: 11 additions & 7 deletions build-config/make/tcpdump.make
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
# This is a makefile fragment that defines the build of tcpdump
#

include make/libpcap.make
include make/openssl.make

TCPDUMP_VERSION = 4.99.4
TCPDUMP_TARBALL = tcpdump-$(TCPDUMP_VERSION).tar.gz
TCPDUMP_TARBALL_URLS += $(ONIE_MIRROR) \
Expand Down Expand Up @@ -66,15 +69,16 @@ TCPDUMP_NEW_FILES = $( \
endif

tcpdump-configure: $(TCPDUMP_CONFIGURE_STAMP)
$(TCPDUMP_CONFIGURE_STAMP): $(TCPDUMP_SOURCE_STAMP) $(LIBPCAP_INSTALL_STAMP) | $(DEV_SYSROOT_INIT_STAMP)
$(TCPDUMP_CONFIGURE_STAMP): $(TCPDUMP_SOURCE_STAMP) $(LIBPCAP_INSTALL_STAMP) $(OPENSSL_INSTALL_STAMP) | $(DEV_SYSROOT_INIT_STAMP)
$(Q) rm -f $@ && eval $(PROFILE_STAMP)
$(Q) echo "==== Configure tcpdump-$(TCPDUMP_VERSION) ===="
$(Q) cd $(TCPDUMP_DIR) && PATH='$(CROSSBIN):$(PATH)' \
$(TCPDUMP_DIR)/configure \
--host=$(TARGET) \
--prefix=/usr \
CC=$(CROSSPREFIX)gcc \
LDFLAGS=$(ONIE_LDFLAGS)
$(Q) cd $(TCPDUMP_DIR) && PATH='$(CROSSBIN):$(PATH)' \
$(TCPDUMP_DIR)/configure \
--host=$(TARGET) \
--prefix=/usr \
CC=$(CROSSPREFIX)gcc \
LDFLAGS=$(ONIE_LDFLAGS) \
CFLAGS="$(ONIE_CFLAGS) -I $(DEV_SYSROOT)/usr/include"
$(Q) touch $@

tcpdump-build: $(TCPDUMP_BUILD_STAMP)
Expand Down
28 changes: 28 additions & 0 deletions patches/rsync/dont-use-innetgr.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Don't use innetgr()

From: Abhisit Sangjan <[email protected]>


---
access.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/access.c b/access.c
index b6afce3..7929d2c 100644
--- a/access.c
+++ b/access.c
@@ -37,10 +37,10 @@ static int match_hostname(const char **host_ptr, const char *addr, const char *t
if (!host || !*host)
return 0;

-#ifdef HAVE_INNETGR
- if (*tok == '@' && tok[1])
- return innetgr(tok + 1, host, NULL, NULL);
-#endif
+//#ifdef HAVE_INNETGR
+// if (*tok == '@' && tok[1])
+// return innetgr(tok + 1, host, NULL, NULL);
+//#endif

/* First check if the reverse-DNS-determined hostname matches. */
if (iwildmatch(tok, host))
1 change: 1 addition & 0 deletions patches/rsync/series
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dont-use-innetgr.patch
1 change: 1 addition & 0 deletions upstream/openssl-3.4.0.tar.gz.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5c2f33c3f3601676f225109231142cdc30d44127 openssl-3.4.0.tar.gz
1 change: 1 addition & 0 deletions upstream/rsync-3.3.0.tar.gz.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
e03db4fbaaebc5aa4934468cd31d22963b6ff888 rsync-3.3.0.tar.gz