Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2 1/1] package/earlyoom: new package
Date: Wed, 10 Jun 2020 23:20:43 +0200	[thread overview]
Message-ID: <20200610232043.0bb71e99@windsurf.home> (raw)
In-Reply-To: <20200608175806.1064874-1-joseph.kogut@gmail.com>

Hello Joseph,

On Mon,  8 Jun 2020 10:58:06 -0700
Joseph Kogut <joseph.kogut@gmail.com> wrote:

> diff --git a/package/earlyoom/Config.in b/package/earlyoom/Config.in
> new file mode 100644
> index 0000000000..1df1cd8f63
> --- /dev/null
> +++ b/package/earlyoom/Config.in
> @@ -0,0 +1,11 @@
> +config BR2_PACKAGE_EARLYOOM
> +	bool "earlyoom"

Are you sure there are not any dependency ? I'm pretty sure at least
"depends on BR2_USE_MMU" is needed, as the code uses fork(). Could you
do a test build with ./utils/test-pkg and see what results it gives ?


> +EARLYOOM_VERSION = 1.6
> +EARLYOOM_SITE = $(call github,rfjakob,earlyoom,v$(EARLYOOM_VERSION))
> +EARLYOOM_LICENSE = MIT
> +EARLYOOM_LICENSE_FILES = LICENSE
> +
> +EARLYOOM_MAKE_OPTS = \
> +	CC=$(TARGET_CC) \

Could you use:

	$(TARGET_CONFIGURE_OPTS)

instead ?

> +	DESTDIR=$(TARGET_DIR) \

Ideally, this should be passed at install time only.

> +	VERSION=$(EARLYOOM_VERSION) \
> +	PREFIX=/usr \
> +	SYSTEMDUNITDIR=/usr/lib/systemd/system
> +
> +define EARLYOOM_CONFIGURE_CMDS
> +	$(SED) "/systemctl/d" $(EARLYOOM_DIR)/Makefile
> +	$(SED) "/chcon/d" $(EARLYOOM_DIR)/Makefile
> +	$(SED) "/update-rc.d/d" $(EARLYOOM_DIR)/Makefile
> +	$(SED) "s/init.d\/earlyoom/init.d\/S01_earlyoom/" \
> +		$(EARLYOOM_DIR)/Makefile

Can we patch the Makefile instead? Ideally, a solution that is
acceptable upstream would be nice. Maybe just some checks in the
Makefile that sees if "make install" is executed as root, and if it is,
do the systemctl, chcon, update-rc.d calls, but not otherwise ?

> +endef
> +
> +define EARLYOOM_BUILD_CMDS
> +	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) earlyoom $(EARLYOOM_MAKE_OPTS)
> +endef
> +
> +define EARLYOOM_INSTALL_INIT_SYSV
> +	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install-initscript $(EARLYOOM_MAKE_OPTS)
> +endef
> +
> +define EARLYOOM_INSTALL_INIT_SYSTEMD
> +	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) install $(EARLYOOM_MAKE_OPTS)
> +endef

Not a big fan of not having an INSTALL_TARGET_CMDS that installs the
binary. Also, the init script provided by earlyoom clearly doesn't work
with Buildroot. It does things such as:

. /lib/lsb/init-functions

which doesn't exist in Buildroot.

So I think I would prefer:

define EARLYOOM_INSTALL_TARGET_CMDS
	... $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install-bin
endef

define EARLYOOM_INSTALL_INIT_SYSTEMD
	manually install the earlyoom.service file
endef

define EARLYOOM_INSTALL_INIT_SYSV
	manually install an init script provided in package/earlyoom
endef

Could you look at adjusting your patch to this ?

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2020-06-10 21:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-29  1:54 [Buildroot] [PATCH 1/1] package/earlyoom: new package Joseph Kogut
2020-05-29 12:09 ` Matthew Weber
2020-06-08 17:19   ` Joseph Kogut
2020-06-08 17:58 ` [Buildroot] [PATCH v2 " Joseph Kogut
2020-06-10 21:20   ` Thomas Petazzoni [this message]
2020-06-10 21:31     ` Joseph Kogut
2020-06-10 23:25       ` Joseph Kogut
2020-06-12 17:40   ` [Buildroot] [PATCH v3 " Joseph Kogut
2020-06-14 15:42     ` Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200610232043.0bb71e99@windsurf.home \
    --to=thomas.petazzoni@bootlin.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox