From 682657248c654c54ac87edc9bf0a95fb59ff0b1e Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 23 Apr 2022 09:23:44 -0700 Subject: gradm: Upgrade to 3.1-202111052217 Fix build when using usrmerge distro features Signed-off-by: Khem Raj --- .../gradm/0001-make-Define-SBINDIR-flag.patch | 69 ++++++++++++++++++++++ .../gradm/gradm_3.1-201903191516.bb | 50 ---------------- .../gradm/gradm_3.1-202111052217.bb | 51 ++++++++++++++++ 3 files changed, 120 insertions(+), 50 deletions(-) create mode 100644 meta-oe/recipes-support/gradm/gradm/0001-make-Define-SBINDIR-flag.patch delete mode 100644 meta-oe/recipes-support/gradm/gradm_3.1-201903191516.bb create mode 100644 meta-oe/recipes-support/gradm/gradm_3.1-202111052217.bb (limited to 'meta-oe') diff --git a/meta-oe/recipes-support/gradm/gradm/0001-make-Define-SBINDIR-flag.patch b/meta-oe/recipes-support/gradm/gradm/0001-make-Define-SBINDIR-flag.patch new file mode 100644 index 0000000000..1c0f3bfbae --- /dev/null +++ b/meta-oe/recipes-support/gradm/gradm/0001-make-Define-SBINDIR-flag.patch @@ -0,0 +1,69 @@ +From 12bc62ac26df012fc143913b6e046a3cf5127db2 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 23 Apr 2022 09:20:49 -0700 +Subject: [PATCH] make: Define SBINDIR flag + +Provides a facility to control install locations of /sbin elements from +environment + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + Makefile | 17 +++++++++-------- + 1 file changed, 9 insertions(+), 8 deletions(-) + +diff --git a/Makefile b/Makefile +index deed94c..9190fe9 100644 +--- a/Makefile ++++ b/Makefile +@@ -25,6 +25,7 @@ MKNOD=/bin/mknod + CC=/usr/bin/gcc + FIND=/usr/bin/find + LIBS := $(shell if [ "`uname -m`" != "sparc64" -a "`uname -m`" != "x86_64" ]; then echo "-lfl" ; else echo "" ; fi) ++SBINDIR=/sbin + OPT_FLAGS := -O2 + # for older versions of grsecurity, comment the above line and uncomment the below: + #OPT_FLAGS := $(shell if [ "`uname -m`" != "sparc64" ] && [ "`uname -m`" != "x86_64" ]; then echo "-O2" ; else echo "-O2 -m64" ; fi) +@@ -136,15 +137,15 @@ lex.learn_pass1.o: lex.learn_pass1.c learn_pass1.tab.h + lex.learn_pass2.o: lex.learn_pass2.c learn_pass2.tab.h + + install: $(GRADM_BIN) gradm.8 policy grlearn +- @mkdir -p $(DESTDIR)/sbin ++ @mkdir -p $(DESTDIR)$(SBINDIR) + @echo "Installing gradm..." +- @$(INSTALL) -m 0755 $(GRADM_BIN) $(DESTDIR)/sbin ++ @$(INSTALL) -m 0755 $(GRADM_BIN) $(DESTDIR)$(SBINDIR) + @if [ -f $(GRADM_PAM) ] ; then \ + echo "Installing gradm_pam..." ; \ +- $(INSTALL) -m 4755 $(GRADM_PAM) $(DESTDIR)/sbin ; \ ++ $(INSTALL) -m 4755 $(GRADM_PAM) $(DESTDIR)$(SBINDIR) ; \ + fi + @echo "Installing grlearn..." +- @$(INSTALL) -m 0700 grlearn $(DESTDIR)/sbin ++ @$(INSTALL) -m 0700 grlearn $(DESTDIR)$(SBINDIR) + @mkdir -p -m 700 $(DESTDIR)$(GRSEC_DIR) + @if [ ! -f $(DESTDIR)$(GRSEC_DIR)/policy ] ; then \ + if [ -f $(DESTDIR)$(GRSEC_DIR)/acl ] ; then \ +@@ -170,15 +171,15 @@ install: $(GRADM_BIN) gradm.8 policy grlearn + echo "KERNEL==\"grsec\", MODE=\"0622\"" >> $(DESTDIR)/etc/udev/rules.d/80-grsec.rules ; \ + echo "LABEL=\"permissions_end\"" >> $(DESTDIR)/etc/udev/rules.d/80-grsec.rules ; \ + fi +- @if [ -f $(DESTDIR)/sbin/udevadm ] ; then \ +- $(DESTDIR)/sbin/udevadm trigger --action=change ; \ ++ @if [ -f $(DESTDIR)$(SBINDIR)/udevadm ] ; then \ ++ $(DESTDIR)$(SBINDIR)/udevadm trigger --action=change ; \ + fi + @echo "Installing gradm manpage..." + @mkdir -p $(DESTDIR)$(MANDIR)/man8 + @$(INSTALL) -m 0644 gradm.8 $(DESTDIR)$(MANDIR)/man8/$(GRADM_BIN).8 +- @if [ -x /sbin/$(GRADM_BIN) ] ; then \ ++ @if [ -x $(SBINDIR)/$(GRADM_BIN) ] ; then \ + if [ -z $(DESTDIR) ] && [ ! -f $(GRSEC_DIR)/pw ] ; then \ +- /sbin/$(GRADM_BIN) -P ; \ ++ $(SBINDIR)/$(GRADM_BIN) -P ; \ + fi \ + fi + @true +-- +2.36.0 + diff --git a/meta-oe/recipes-support/gradm/gradm_3.1-201903191516.bb b/meta-oe/recipes-support/gradm/gradm_3.1-201903191516.bb deleted file mode 100644 index 0513f0dca0..0000000000 --- a/meta-oe/recipes-support/gradm/gradm_3.1-201903191516.bb +++ /dev/null @@ -1,50 +0,0 @@ -SUMMARY = "Administration program for the grsecurity RBAC syste" -DESCRIPTION = "\ -gradm is the userspace RBAC parsing and authentication program for \ -grsecurity grsecurity aims to be a complete security system. gradm \ -performs several tasks for the RBAC system including authenticated \ -via a password to the kernel and parsing rules to be passed to the \ -kernel" -HOMEPAGE = "http://grsecurity.net/index.php" -SECTION = "admin" -LICENSE = "GPL-2.0-only" -LIC_FILES_CHKSUM = "file://LICENSE;md5=4641e94ec96f98fabc56ff9cc48be14b" -DEPENDS = "flex-native bison-native ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" - -SRC_URI = "http://grsecurity.net/stable/${BP}.tar.gz \ - file://0001-Makefile-remove-strip.patch \ - file://0001-Makefile-Append-instead-of-overriding-LDFLAGS.patch \ - " -SRC_URI[md5sum] = "5099c715433981d5a3eed8ded7c5bbc0" -SRC_URI[sha256sum] = "d3a0b6383ff97a2054941d71133c737efae66afdd8eef59346c031ae15c75ff3" - -S = "${WORKDIR}/gradm" - -inherit autotools-brokensep - -do_compile() { - oe_runmake 'CC=${CC}' \ - 'LIBS=' \ - 'OPT_FLAGS=${CFLAGS}' \ - 'LLEX=${STAGING_BINDIR_NATIVE}/lex' \ - 'FLEX=${STAGING_BINDIR_NATIVE}/flex' \ - 'BISON=${STAGING_BINDIR_NATIVE}/bison' \ - ${@bb.utils.contains('DISTRO_FEATURES', 'pam', ' ', 'nopam', d)} -} - -do_install() { - oe_runmake 'CC=${CC}' \ - 'DESTDIR=${D}' \ - 'LIBS=' \ - 'LLEX=${STAGING_BINDIR_NATIVE}/lex' \ - 'FLEX=${STAGING_BINDIR_NATIVE}/flex' \ - 'BISON=${STAGING_BINDIR_NATIVE}/bison' \ - install - - # The device nodes are generated by postinstall or udev - rm -rf ${D}/dev -} - -pkg_postinst_ontarget:${PN}() { - /bin/mknod -m 0622 /dev/grsec c 1 13 -} diff --git a/meta-oe/recipes-support/gradm/gradm_3.1-202111052217.bb b/meta-oe/recipes-support/gradm/gradm_3.1-202111052217.bb new file mode 100644 index 0000000000..c82b529f96 --- /dev/null +++ b/meta-oe/recipes-support/gradm/gradm_3.1-202111052217.bb @@ -0,0 +1,51 @@ +SUMMARY = "Administration program for the grsecurity RBAC syste" +DESCRIPTION = "\ +gradm is the userspace RBAC parsing and authentication program for \ +grsecurity grsecurity aims to be a complete security system. gradm \ +performs several tasks for the RBAC system including authenticated \ +via a password to the kernel and parsing rules to be passed to the \ +kernel" +HOMEPAGE = "http://grsecurity.net/index.php" +SECTION = "admin" +LICENSE = "GPL-2.0-only" +LIC_FILES_CHKSUM = "file://LICENSE;md5=4641e94ec96f98fabc56ff9cc48be14b" +DEPENDS = "flex-native bison-native ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" + +SRC_URI = "http://grsecurity.net/stable/${BP}.tar.gz \ + file://0001-Makefile-remove-strip.patch \ + file://0001-Makefile-Append-instead-of-overriding-LDFLAGS.patch \ + file://0001-make-Define-SBINDIR-flag.patch \ + " +SRC_URI[sha256sum] = "2459290f367a47c8a1ce4ea2ec08359799ea33dc15ed4436439596ce88284fb9" + +S = "${WORKDIR}/gradm" + +inherit autotools-brokensep + +do_compile() { + oe_runmake 'CC=${CC}' \ + 'LIBS=' \ + 'OPT_FLAGS=${CFLAGS}' \ + 'LLEX=${STAGING_BINDIR_NATIVE}/lex' \ + 'FLEX=${STAGING_BINDIR_NATIVE}/flex' \ + 'BISON=${STAGING_BINDIR_NATIVE}/bison' \ + ${@bb.utils.contains('DISTRO_FEATURES', 'pam', ' ', 'nopam', d)} +} + +do_install() { + oe_runmake 'CC=${CC}' \ + 'DESTDIR=${D}' \ + 'SBINDIR=${base_sbindir}' \ + 'LIBS=' \ + 'LLEX=${STAGING_BINDIR_NATIVE}/lex' \ + 'FLEX=${STAGING_BINDIR_NATIVE}/flex' \ + 'BISON=${STAGING_BINDIR_NATIVE}/bison' \ + install + + # The device nodes are generated by postinstall or udev + rm -rf ${D}/dev +} + +pkg_postinst_ontarget:${PN}() { + /bin/mknod -m 0622 /dev/grsec c 1 13 +} -- cgit v1.2.3-54-g00ecf