Skip to content

Commit dc910eb

Browse files
committed
onieprom: Create proper package
1 parent 3f7b33e commit dc910eb

File tree

8 files changed

+394
-3
lines changed

8 files changed

+394
-3
lines changed

board/common/post-image.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
# Only for regular builds, not bootloader-only builds
44
if [ "$BR2_TARGET_ROOTFS_SQUASHFS" = "y" ]; then
5-
cp "$BR2_EXTERNAL_INFIX_PATH/board/common/rootfs/usr/bin/onieprom" "$BINARIES_DIR/"
6-
75
# Quick intro for beginners, with links to more information
86
cp "$BR2_EXTERNAL_INFIX_PATH/board/common/README.txt" "$BINARIES_DIR/"
97
fi

package/Config.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ source "$BR2_EXTERNAL_INFIX_PATH/package/lowdown/Config.in"
2929
source "$BR2_EXTERNAL_INFIX_PATH/package/mcd/Config.in"
3030
source "$BR2_EXTERNAL_INFIX_PATH/package/mdns-alias/Config.in"
3131
source "$BR2_EXTERNAL_INFIX_PATH/package/netbrowse/Config.in"
32+
source "$BR2_EXTERNAL_INFIX_PATH/package/onieprom/Config.in"
3233
source "$BR2_EXTERNAL_INFIX_PATH/package/podman/Config.in"
3334
source "$BR2_EXTERNAL_INFIX_PATH/package/python-libyang/Config.in"
3435
source "$BR2_EXTERNAL_INFIX_PATH/package/python-statd/Config.in"

package/onieprom/Config.in

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
menuconfig BR2_PACKAGE_ONIEPROM
2+
bool "onieprom"
3+
default y
4+
select BR2_PACKAGE_HOST_PYTHON3
5+
select BR2_PACKAGE_DBUS_PYTHON
6+
help
7+
ONIE EEPROM parser/generator
8+
9+
config BR2_PACKAGE_ONIEPROM_INSTALL_IMAGES
10+
bool "install onieprom in images"
11+
depends on BR2_PACKAGE_ONIEPROM
12+
default y
13+
help
14+
Install the onieprom script in the images direcory. Useful
15+
when the release is destined for someone who will have to
16+
create ONIE EEPROM binaries for deployment during
17+
manufacturing.

package/onieprom/onieprom.mk

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
ONIEPROM_VERSION = 1.0
2+
ONIEPROM_SITE_METHOD = local
3+
ONIEPROM_SITE = $(BR2_EXTERNAL_INFIX_PATH)/src/onieprom
4+
ONIEPROM_LICENSE = GPLv2
5+
ONIEPROM_LICENSE_FILES = COPYING
6+
ONIEPROM_DEPENDENCIES = host-python3 python3 host-python-poetry-core
7+
ONIEPROM_SETUP_TYPE = pep517 # poetry
8+
ONIEPROM_INSTALL_IMAGES = $(if $(BR2_PACKAGE_ONIEPROM_INSTALL_IMAGES),YES,NO)
9+
10+
define ONIEPROM_INSTALL_IMAGES_CMDS
11+
@cp $(@D)/onieprom/onieprom.py $(BINARIES_DIR)/onieprom
12+
@chmod +x $(BINARIES_DIR)/onieprom
13+
endef
14+
15+
$(eval $(python-package))

src/onieprom/COPYING

Lines changed: 339 additions & 0 deletions
Large diffs are not rendered by default.

src/onieprom/onieprom/__init__.py

Whitespace-only changes.
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def unpack_vendor(ext):
181181

182182
return d
183183

184-
if __name__ == "__main__":
184+
def main():
185185
import argparse
186186
import json
187187
import os
@@ -216,3 +216,6 @@ def unpack_vendor(ext):
216216
args.outfile.buffer.write(into_tlv(json.load(args.infile)))
217217
else:
218218
args.outfile.write(json.dumps(from_tlv(args.infile)))
219+
220+
if __name__ == "__main__":
221+
main()

src/onieprom/pyproject.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[tool.poetry]
2+
name = "infix-onieprom"
3+
version = "1.0"
4+
description = "ONIE EEPROM parser/generator"
5+
license = "GPLv2"
6+
authors = [
7+
"KernelKit developers"
8+
]
9+
packages = [
10+
{ include = "onieprom" }
11+
]
12+
13+
[build-system]
14+
requires = ["poetry-core>=1.0.0"]
15+
build-backend = "poetry.core.masonry.api"
16+
17+
[tool.poetry.scripts]
18+
onieprom = "onieprom:main"

0 commit comments

Comments
 (0)