From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Thu, 07 Oct 2021 12:23:05 +0200 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by lore.white.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1mYQYL-0006hc-OE for lore@lore.pengutronix.de; Thu, 07 Oct 2021 12:23:05 +0200 Received: from localhost ([127.0.0.1] helo=metis.ext.pengutronix.de) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1mYQYL-0001Ec-FR; Thu, 07 Oct 2021 12:23:05 +0200 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mYQUI-0004ry-MI; Thu, 07 Oct 2021 12:18:54 +0200 Received: from [2a0a:edc0:0:1101:1d::39] (helo=dude03.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1mYQUI-0005zR-4V; Thu, 07 Oct 2021 12:18:54 +0200 Received: from mol by dude03.red.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1mYQUI-00GTXb-1Z; Thu, 07 Oct 2021 12:18:54 +0200 From: Michael Olbrich To: ptxdist@pengutronix.de Date: Thu, 7 Oct 2021 12:18:54 +0200 Message-Id: <20211007101854.3926760-1-m.olbrich@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210909101652.9288-3-ada@thorsis.com> References: <20210909101652.9288-3-ada@thorsis.com> MIME-Version: 1.0 Subject: Re: [ptxdist] [APPLIED] mtd-utils: Introduce systemd unit for ubihealthd X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: Alexander Dahl Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false Thanks, applied as 434bd8a2cee93a599e2d282a152842447aa45cb4. Michael [sent from post-receive hook] On Thu, 07 Oct 2021 12:18:53 +0200, Alexander Dahl wrote: > It's possible to run multiple instances for multiple ubi devices by > creating multiple symlinks. One symlink for the first device ubi0 is > already created. > > Signed-off-by: Alexander Dahl > Message-Id: <20210909101652.9288-3-ada@thorsis.com> > Signed-off-by: Michael Olbrich > > diff --git a/projectroot/usr/lib/systemd/system/ubihealthd@.service b/projectroot/usr/lib/systemd/system/ubihealthd@.service > new file mode 100644 > index 000000000000..f3f0ba25fe05 > --- /dev/null > +++ b/projectroot/usr/lib/systemd/system/ubihealthd@.service > @@ -0,0 +1,13 @@ > +# enable with `systemctl enable ubihealthd@ubi0.service` > + > +[Unit] > +Description=ubihealthd UBI device PEB scan daemon for %I > +BindsTo=dev-%i.device > +After=dev-%i.device > + > +[Service] > +Type=forking > +ExecStart=/usr/sbin/ubihealthd -d /dev/%I -i 120 > + > +[Install] > +WantedBy=multi-user.target > diff --git a/rules/mtd-utils.in b/rules/mtd-utils.in > index 11b0be23f03d..0d8fb5f5a0df 100644 > --- a/rules/mtd-utils.in > +++ b/rules/mtd-utils.in > @@ -294,13 +294,23 @@ config MTD_UTILS_UBIFS_MOUNTHELPER > help > Simplifies attaching an ubi and mounting an ubifs via /etc/fstab. > > -config MTD_UTILS_UBIHEALTHD > +menuconfig MTD_UTILS_UBIHEALTHD > bool > prompt "ubihealthd" > help > Daemon that randomly scans each PEB of a UBI device to ensure that > filesystems with little reading do enough wear leveling. > > +if MTD_UTILS_UBIHEALTHD > + > +config MTD_UTILS_UBIHEALTHD_SYSTEMD_UNIT > + bool > + prompt "install systemd unit files" > + default y > + depends on SYSTEMD > + > +endif > + > config MTD_UTILS_UBIMKVOL > bool > prompt "ubimkvol" > diff --git a/rules/mtd-utils.make b/rules/mtd-utils.make > index 15288acd7ad1..d96ab02b0a7d 100644 > --- a/rules/mtd-utils.make > +++ b/rules/mtd-utils.make > @@ -205,6 +205,12 @@ endif > ifdef PTXCONF_MTD_UTILS_UBIHEALTHD > @$(call install_copy, mtd-utils, 0, 0, 0755, -, \ > /usr/sbin/ubihealthd) > +ifdef PTXCONF_MTD_UTILS_UBIHEALTHD_SYSTEMD_UNIT > + @$(call install_alternative, mtd-utils, 0, 0, 0644, \ > + /usr/lib/systemd/system/ubihealthd@.service) > + @$(call install_link, mtd-utils, ../ubihealthd@.service, \ > + /usr/lib/systemd/system/multi-user.target.wants/ubihealthd@ubi0.service) > +endif > endif > ifdef PTXCONF_MTD_UTILS_UBIMKVOL > @$(call install_copy, mtd-utils, 0, 0, 0755, -, \ _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de