Skip to content

Build OPKG #1

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

Merged
merged 8 commits into from
Nov 28, 2022
Merged
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
12 changes: 3 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,9 @@ jobs:
- name: Cache downloads
uses: actions/cache@v2
with:
path: buildroot/dl
path: dl
key: buildroot-dl

- name: Setup out of tree build
run: make O=$PWD -C $PWD/buildroot allnoconfig

- name: Setup build configuration
run: make BR2_DEFCONFIG=$PWD/defconfig defconfig

- name: Download packages to build
run: make source

Expand All @@ -36,5 +30,5 @@ jobs:

- uses: actions/upload-artifact@v3
with:
name: rootfs
path: images/rootfs.tar.gz
name: package
path: '*.ipk'
34 changes: 34 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
ROOT_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))

PACKAGE = ptp4l_3.1.1_armhf.ipk

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we possibly get this from BR2_PACKAGE_PTP4L_VERSION ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in next pull request

BUILDROOT_SRC_DIR = $(ROOT_DIR)/buildroot
BUILDROOT_BUILD_DIR = $(ROOT_DIR)/build
BUILDROOT_DL_DIR = $(ROOT_DIR)/build
BUILDROOT_CONFIG = $(BUILDROOT_BUILD_DIR)/.config
BUILDROOT_DEFCONFIG = $(ROOT_DIR)/defconfig
BUILDROOT_MAKE = $(MAKE) -C $(BUILDROOT_BUILD_DIR)
PTP4L = $(BUILDROOT_BUILD_DIR)/target/usr/sbin/ptp4l
OPKG_BUILD = $(BUILDROOT_BUILD_DIR)/host/bin/opkg-build

.PHONY: all
all: $(PACKAGE)

$(BUILDROOT_CONFIG): .gitmodules $(BUILDROOT_DEFCONFIG)
$(MAKE) -C $(BUILDROOT_SRC_DIR) O=$(BUILDROOT_BUILD_DIR) BR2_DL_DIR=$(BUILDROOT_DL_DIR) allnoconfig
$(MAKE) -C $(BUILDROOT_BUILD_DIR) BR2_DEFCONFIG=$(BUILDROOT_DEFCONFIG) defconfig

.PHONY: source
source: $(BUILDROOT_CONFIG)
$(MAKE) -C $(BUILDROOT_BUILD_DIR) source

$(PTP4L) $(OPKG_BUILD): $(BUILDROOT_CONFIG)
$(MAKE) -C $(BUILDROOT_BUILD_DIR)

package/bin/ptp4l: $(PTP4L)
install -D $< $@

package/CONTROL/control: control
install -D $< $@

$(PACKAGE): package/CONTROL/control package/bin/ptp4l
$(OPKG_BUILD) package
5 changes: 5 additions & 0 deletions control
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Package: ptp4l
Architecture: armhf
Version: 3.1.1
Maintainer: Scortex <tech@scortex.io>
Description: PTP4Linux built for Wago
1 change: 1 addition & 0 deletions defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ BR2_ROOTFS_DEVICE_CREATION_STATIC=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_LINUXPTP=y
BR2_TARGET_ROOTFS_TAR_GZIP=y
BR2_PACKAGE_HOST_OPKG_UTILS=y