From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6529810911033556992 X-Received: by 2002:a1c:ed0f:: with SMTP id l15-v6mr200820wmh.24.1536758150647; Wed, 12 Sep 2018 06:15:50 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:8012:: with SMTP id b18-v6ls476767wmd.11.gmail; Wed, 12 Sep 2018 06:15:50 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbZ2P8Vsiwg3Bu9xADQ/bsMftlXka3r8MYAb3LtMBqxXHrVvwI5XLaLx3ZPzP7VqkKPfJXV X-Received: by 2002:a1c:99cf:: with SMTP id b198-v6mr204585wme.14.1536758150156; Wed, 12 Sep 2018 06:15:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536758150; cv=none; d=google.com; s=arc-20160816; b=yv6qT04W1TVz5p3T9oAtNOaebCbln+nGwog4/RkVxhxcp0IOfXfMwbRI4gwBqRUtc0 reTC/HyMdDvpcvfXN88x+Nwt9Z8Y2BguduZyb40fyr57o/L/kEkfBCVOVgI5EWtTJfjC 0rMopNCXIHGdYu7sJEuXVVM1PeLg2oaO7vwdPa8ejhenMysK1HP2whE9M4ZoRDEOirEq OrFbEAfehC3jNAyNuti4j6zeq80g225Tu1nW75fC+zN+8gk08C6zrRcgmpz6qM6ddxIg p+kskUHDYMQnvQdinSA2PpOj8rOTE8R9nvOkYiKxKsIPXhMsrZHPJ5HfChDDP5ip4Pl3 syWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date; bh=Sg4jEteJE3gYbgWzdX0uPcw7GhVNANuhwBc40pHTREs=; b=uMv9Lv6hLjXqxeG2V6IQ3ngExGkAvCAiUZRwpqlIA3pprTmeg67x3nNRYSgKbuReN7 sWrkKC1vHD2DUFyzQpAMTqhJuE+xGIPZy5jrLgpQ0XzIOxe/aKB0gzYtoHkPZtdVHpXN miG3Y3C2qZiuwva9upUL2y3rygpIwc9ACU7FLnOL0NANIxccKMsSOUjnQcDfuv8e4lfK 1l/RQHHkqINtYIOmIuN0rlvp181s/HxfuGayGr4GcvTbkI8CFNjKQowjiRKh0TZa7wJa DQPR02/qsj21Puld528vG/RfXIDJ76OWhn/kbGElXY7eU9aDOyo5jsEugMjEhLls8uTI /K+Q== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from goliath.siemens.de (goliath.siemens.de. [192.35.17.28]) by gmr-mx.google.com with ESMTPS id y139-v6si449589wmc.3.2018.09.12.06.15.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Sep 2018 06:15:50 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) client-ip=192.35.17.28; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id w8CDFnCg017686 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 Sep 2018 15:15:49 +0200 Received: from md1pvb1c.ad001.siemens.net (md1pvb1c.ad001.siemens.net [139.25.68.40]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id w8CDFn4S018722; Wed, 12 Sep 2018 15:15:49 +0200 Date: Wed, 12 Sep 2018 15:15:48 +0200 From: Henning Schild To: Alexander Smirnov Cc: Subject: Re: [PATCH v3 1/4] kernel/module: Add AUTOLOAD option Message-ID: <20180912151548.6357ab81@md1pvb1c.ad001.siemens.net> In-Reply-To: <20180307104655.19315-1-asmirnov@ilbers.de> References: <20180306124055.15990-2-asmirnov@ilbers.de> <20180307104655.19315-1-asmirnov@ilbers.de> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: Ym2jFb6bM2wR Am Wed, 7 Mar 2018 13:46:55 +0300 schrieb Alexander Smirnov : > Add possibility to set kernel module to be autoloaded. > File '/etc/modules' is created by kmod package, which is dependency of > kernel image, so there is no need to add explicit deps to kernel > module. > > Signed-off-by: Alexander Smirnov > --- > meta/recipes-kernel/linux-module/files/debian/control | 2 +- > meta/recipes-kernel/linux-module/module.inc | 7 +++++++ > 2 files changed, 8 insertions(+), 1 deletion(-) > > diff --git a/meta/recipes-kernel/linux-module/files/debian/control > b/meta/recipes-kernel/linux-module/files/debian/control index > 707f857..1ee634c 100644 --- > a/meta/recipes-kernel/linux-module/files/debian/control +++ > b/meta/recipes-kernel/linux-module/files/debian/control @@ -7,5 +7,5 > @@ Maintainer: ISAR project > Package: @PN@ > Architecture: any > -Depends: linux-image-@KERNEL_NAME@ > +Depends: linux-image-@KERNEL_NAME@, kmod > Description: @DESCRIPTION@ > diff --git a/meta/recipes-kernel/linux-module/module.inc > b/meta/recipes-kernel/linux-module/module.inc index aa232f7..ec1c4b0 > 100644 --- a/meta/recipes-kernel/linux-module/module.inc > +++ b/meta/recipes-kernel/linux-module/module.inc > @@ -13,6 +13,8 @@ DEPENDS += "linux-headers-${KERNEL_NAME}" > > SRC_URI += "file://debian/" > > +AUTOLOAD ?= "0" > + > inherit dpkg > > dpkg_runbuild_prepend() { > @@ -21,4 +23,9 @@ dpkg_runbuild_prepend() { > -e 's/@KERNEL_NAME@/${KERNEL_NAME}/g' \ > -e 's/@DESCRIPTION@/${DESCRIPTION}/g' \ > ${WORKDIR}/${S}/debian/changelog > ${WORKDIR}/${S}/debian/control + > + if [ ${AUTOLOAD} = "1" ]; then > + echo "echo ${PN} >> /etc/modules" >> > ${WORKDIR}/${S}/debian/postinst > + chmod +x ${WORKDIR}/${S}/debian/postinst > + fi > } The current approach is broken because the script is not idempotent. Uninstalling the package will not unpatch /etc/modules. And installing a second time will result in a second entry. So we do need an extra postrm to make the package idempotent. And if we are on systemd, we should create /etc/modules-load.d/ instead. (detect systemd at post(rm|inst) runtime). Henning Henning