Skip to contentSkip to conversation

pegtl: Initial recipe

PATCH Superseded Ayoub Zaki 2 participants 4 messages Jul 21, 2019

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Ayoub Zaki

author
#0 lore raw

PATCH 1/2 pegtl: Initial recipe

Introduce the Parsing Expression Grammar Template Library (PEGTL)
a zero-dependency C++ header-only parser combinator library for creating parsers according to the Parsing Expression Grammar (PEG).

---
 meta-oe/recipes-extended/pegtl/pegtl_2.1.4.bb | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 meta-oe/recipes-extended/pegtl/pegtl_2.1.4.bb
meta-oe/recipes-extended/pegtl/pegtl_2.1.4.bb new file +12 -0
new file mode 100644
index 000000000..ca175f868
@@ -0,0 +1,12 @@
+DESCRIPTION="header-only library for creating parsers according to Parsing Expression Grammar"
+HOMEPAGE="https://github.com/taocpp/PEGTL"
+LICENSE="MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=80cb066ab204c7fe022f1cfe0c2c6818"
+
+SRC_URI="https://github.com/taocpp/PEGTL/archive/${PV}.tar.gz"
+SRC_URI[md5sum] = "fe96a704913523763642a2c4c4618091"
+SRC_URI[sha256sum] = "5699558ce06e8fad0530143199eeaefd29128fb4584879975c87947c8ad0395f"
+
+inherit cmake
+
+S="${WORKDIR}/PEGTL-${PV}"
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH 2/2 usbguard: Initial recipe

Introduce the USBGuard software framework that helps to protect against rogue USB devices (a.k.a. BadUSB) by implementing basic whitelisting and blacklisting capabilities based on device attributes.

---
 .../usbguard/usbguard_0.7.4.bb                | 37 +++++++++++++++++++
 1 file changed, 37 insertions(+)
 create mode 100644 meta-oe/recipes-security/usbguard/usbguard_0.7.4.bb
meta-oe/recipes-security/usbguard/usbguard_0.7.4.bb new file +37 -0
new file mode 100644
index 000000000..a77694cc3
@@ -0,0 +1,37 @@
+DESCRIPTION="USBGuard framework helps to protect against BadUSB."
+HOMEPAGE="https://github.com/dkopecek/usbguard"
+LICENSE="GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=8264535c0c4e9c6c335635c4026a8022"
+
+SRC_URI="https://github.com/USBGuard/usbguard/archive/${PN}-${PV}.tar.gz"
+SRC_URI[md5sum] = "ddaa9ae884200c861ad946f34dfd5ab9"
+SRC_URI[sha256sum] = "d37886508583565aae0df6a110b11524c59b39e0deb25ee49fc34274e4784f55"
+
+inherit autotools pkgconfig systemd bash-completion
+
+S= "${WORKDIR}/${PN}-${PN}-${PV}"
+
+DEPENDS = "protobuf-native libxml2-native libxslt-native xmlto-native glib-2.0-native \
+	dbus dbus-glib libqb libseccomp libcap-ng libgcrypt libsodium protobuf pegtl"
+
+EXTRA_OECONF += "--with-bundled-catch"
+
+PACKAGECONFIG ??= "libsodium \
+	${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
+	${@bb.utils.filter('DISTRO_FEATURES', 'polkit', d)}"
+
+PACKAGECONFIG[systemd]   = "--enable-systemd,--disable-systemd"
+PACKAGECONFIG[libsodium] = "--with-crypto-library=sodium"
+PACKAGECONFIG[libgcrypt] = "--with-crypto-library=gcrypt"
+PACKAGECONFIG[polkit]    = "--with-polkit,--without-polkit"
+PACKAGECONFIG[dbus]      = "--with-dbus,--without-dbus"
+
+SYSTEMD_SERVICE_${PN} = "${PN}.service"
+SYSTEMD_PACKAGES += "${PN}"
+
+
+do_install_append(){
+	
+	sed -i 's|/var/log/usbguard/usbguard-audit.log|/var/log/usbguard-audit.log|g' \ 
+						${D}${sysconfdir}/usbguard/usbguard-daemon.conf
+}
Signature · 1 line
2.17.1
#2 lore raw

Re: [meta-oe][PATCH 2/2] usbguard: Initial recipe

Quoted 15 lines · Ayoub Zaki

Introduce the USBGuard software framework that helps to protect against rogue USB devices (a.k.a. BadUSB) by implementing basic whitelisting and blacklisting capabilities based on device attributes.

---
  .../usbguard/usbguard_0.7.4.bb                | 37 +++++++++++++++++++
  1 file changed, 37 insertions(+)

create mode 100644 meta-oe/recipes-security/usbguard/usbguard_0.7.4.bb

meta-oe/recipes-security/usbguard/usbguard_0.7.4.bb new file +0 -0
new file mode 100644
index 000000000..a77694cc3

meta-oe/recipes-security/usbguard/usbguard_0.7.4.bb line 6

Quoted 6 lines
meta-oe/recipes-security/usbguard/usbguard_0.7.4.bb new file +6 -0
@@ -0,0 +1,37 @@
+DESCRIPTION="USBGuard framework helps to protect against BadUSB."
+HOMEPAGE="https://github.com/dkopecek/usbguard"
+LICENSE="GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=8264535c0c4e9c6c335635c4026a8022"
+
+SRC_URI="https://github.com/USBGuard/usbguard/archive/${PN}-${PV}.tar.gz"

Its better to use BP instead of PN-PV do it will work with multilib as well

meta-oe/recipes-security/usbguard/usbguard_0.7.4.bb line 12

Quoted 6 lines
meta-oe/recipes-security/usbguard/usbguard_0.7.4.bb new file +6 -0
+SRC_URI[md5sum] = "ddaa9ae884200c861ad946f34dfd5ab9"
+SRC_URI[sha256sum] = "d37886508583565aae0df6a110b11524c59b39e0deb25ee49fc34274e4784f55"
+
+inherit autotools pkgconfig systemd bash-completion
+
+S= "${WORKDIR}/${PN}-${PN}-${PV}"

this should also be ${BPN}-${BP}

Quoted 25 lines
meta-oe/recipes-security/usbguard/usbguard_0.7.4.bb new file +25 -0
+
+DEPENDS = "protobuf-native libxml2-native libxslt-native xmlto-native glib-2.0-native \
+	dbus dbus-glib libqb libseccomp libcap-ng libgcrypt libsodium protobuf pegtl"
+
+EXTRA_OECONF += "--with-bundled-catch"
+
+PACKAGECONFIG ??= "libsodium \
+	${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
+	${@bb.utils.filter('DISTRO_FEATURES', 'polkit', d)}"
+
+PACKAGECONFIG[systemd]   = "--enable-systemd,--disable-systemd"
+PACKAGECONFIG[libsodium] = "--with-crypto-library=sodium"
+PACKAGECONFIG[libgcrypt] = "--with-crypto-library=gcrypt"
+PACKAGECONFIG[polkit]    = "--with-polkit,--without-polkit"
+PACKAGECONFIG[dbus]      = "--with-dbus,--without-dbus"
+
+SYSTEMD_SERVICE_${PN} = "${PN}.service"
+SYSTEMD_PACKAGES += "${PN}"
+
+
+do_install_append(){
+	
+	sed -i 's|/var/log/usbguard/usbguard-audit.log|/var/log/usbguard-audit.log|g' \
+						${D}${sysconfdir}/usbguard/usbguard-daemon.conf
+}
author
#3 lore raw

Re: [meta-oe][PATCH 2/2] usbguard: Initial recipe

Hi,

Quoted 11 lines · Khem Raj
Quoted 9 lines · Ayoub Zaki

Introduce the USBGuard software framework that helps to protect against rogue USB devices (a.k.a. BadUSB) by implementing basic whitelisting and blacklisting capabilities based on device attributes.

---
  .../usbguard/usbguard_0.7.4.bb                | 37 +++++++++++++++++++

  1 file changed, 37 insertions(+)

  create mode 100644 meta-oe/recipes-security/usbguard/usbguard_0.7.4.bb

Quoted 16 lines
Quoted 12 lines
meta-oe/recipes-security/usbguard/usbguard_0.7.4.bb new file +4 -0
new file mode 100644
index 000000000..a77694cc3
@@ -0,0 +1,37 @@
+DESCRIPTION="USBGuard framework helps to protect against BadUSB."
+HOMEPAGE="https://github.com/dkopecek/usbguard"
+LICENSE="GPLv2"
+LIC_FILES_CHKSUM = 

"file://LICENSE;md5=8264535c0c4e9c6c335635c4026a8022"

meta-oe/recipes-security/usbguard/usbguard_0.7.4.bb line 6

Quoted 2 lines
meta-oe/recipes-security/usbguard/usbguard_0.7.4.bb new file +2 -0
+
+SRC_URI="https://github.com/USBGuard/usbguard/archive/${PN}-${PV}.tar.gz" 

Its better to use BP instead of PN-PV do it will work with multilib as well

Okay.

Quoted 10 lines

meta-oe/recipes-security/usbguard/usbguard_0.7.4.bb line 12

Quoted 8 lines
meta-oe/recipes-security/usbguard/usbguard_0.7.4.bb new file +2 -0
+SRC_URI[md5sum] = "ddaa9ae884200c861ad946f34dfd5ab9"
+SRC_URI[sha256sum] = 

"d37886508583565aae0df6a110b11524c59b39e0deb25ee49fc34274e4784f55"

meta-oe/recipes-security/usbguard/usbguard_0.7.4.bb new file +4 -0
+
+inherit autotools pkgconfig systemd bash-completion
+
+S= "${WORKDIR}/${PN}-${PN}-${PV}"

this should also be ${BPN}-${BP}

I'll fix that and resend a v2.

Thanks!

Quoted 21 lines
Quoted 21 lines
meta-oe/recipes-security/usbguard/usbguard_0.7.4.bb new file +2 -0
+
+DEPENDS = "protobuf-native libxml2-native libxslt-native 

xmlto-native glib-2.0-native \
+    dbus dbus-glib libqb libseccomp libcap-ng libgcrypt libsodium protobuf pegtl"

meta-oe/recipes-security/usbguard/usbguard_0.7.4.bb new file +15 -0
+
+EXTRA_OECONF += "--with-bundled-catch"
+
+PACKAGECONFIG ??= "libsodium \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'polkit', d)}"
+
+PACKAGECONFIG[systemd]   = "--enable-systemd,--disable-systemd"
+PACKAGECONFIG[libsodium] = "--with-crypto-library=sodium"
+PACKAGECONFIG[libgcrypt] = "--with-crypto-library=gcrypt"
+PACKAGECONFIG[polkit]    = "--with-polkit,--without-polkit"
+PACKAGECONFIG[dbus]      = "--with-dbus,--without-dbus"
+
+SYSTEMD_SERVICE_${PN} = "${PN}.service"
+SYSTEMD_PACKAGES += "${PN}"
Quoted 8 lines
Quoted 8 lines
meta-oe/recipes-security/usbguard/usbguard_0.7.4.bb new file +5 -0
+
+
+do_install_append(){
+
+    sed -i 

's|/var/log/usbguard/usbguard-audit.log|/var/log/usbguard-audit.log|g' \
+ ${D}${sysconfdir}/usbguard/usbguard-daemon.conf
+}

Mit freundlichen Grüßen / Kind regards

Signature · 10 lines
Ayoub Zaki
Embedded Systems Consultant

Vaihinger Straße 2/1
D-71634 Ludwigsburg

Mobile   : +4917662901545
Email    : [email protected]
Homepage : https://embexus.com
VAT No.  : DE313902634