Patchwork libpam_1.1.1: remove directory preventing /var/run from being volatile

login
register
mail settings
Submitter Mats Kärrman
Date Dec. 7, 2011, 9:37 a.m.
Message ID <ED3E0BCACD909541BA94A34C4A164D4C401A5055@post.tritech.se>
Download mbox | patch
Permalink /patch/16371/
State Superseded
Headers show

Comments

Mats Kärrman - Dec. 7, 2011, 9:37 a.m.
The libpam make install creates a /var/run/sepermit folder that prevents
the later creation of a sym-link /var/run --> /var/volatile/run. This is
a problem because it causes additional wear to FLASH file systems.

The solution is ~equivalent to the solution applied in libpam recipes of
oe-core but v1.1.1 does not exist there and the corresponding fix was a
part of the original recipes for later versions.

Signed-off-by: Mats Kärrman <mats.karrman@tritech.se>

------
Paul Menzel - Dec. 7, 2011, 9:58 a.m.
Dear Mats,


thank you for sending the patch for OE-classic master.

Am Mittwoch, den 07.12.2011, 09:37 +0000 schrieb Mats Kärrman:
> The libpam make install creates a /var/run/sepermit folder that prevents
> the later creation of a sym-link /var/run --> /var/volatile/run. This is
> a problem because it causes additional wear to FLASH file systems.
> 
> The solution is ~equivalent to the solution applied in libpam recipes of

Does the ~ have any meaning or is it just a typo?

> oe-core but v1.1.1 does not exist there and the corresponding fix was a
> part of the original recipes for later versions.
> 
> Signed-off-by: Mats Kärrman <mats.karrman@tritech.se>
> 
> ------
> 
> diff --git a/recipes/pam/files/05_libpam b/recipes/pam/files/05_libpam
> new file mode 100644
> index 0000000..5ae0c8e
> --- /dev/null
> +++ b/recipes/pam/files/05_libpam
> @@ -0,0 +1,3 @@
> +# Create sepermit folder in volatile fs
> +d root root 0755 /var/run/sepermit none
> +

In OE-core the file name is `99_pam` [1]. Why did the leading number
needed to be changed? Should that be also `05` in OE-core?

> diff --git a/recipes/pam/libpam_1.1.1.bb b/recipes/pam/libpam_1.1.1.bb
> index 09bc554..ba35d0c 100644
> --- a/recipes/pam/libpam_1.1.1.bb
> +++ b/recipes/pam/libpam_1.1.1.bb
> @@ -15,7 +15,7 @@ DEPENDS = "flex flex-native"
>  # PAM is not a lot of use without configuration files and the plugins
>  RRECOMMENDS_${PN} = "libpam-meta libpam-base-files"
> 
> -PR = "r2"
> +PR = "r3"
> 
>  # The project is actually called Linux-PAM but that gives
>  # a bad OE package name because of the upper case characters
> @@ -26,6 +26,7 @@ S = "${WORKDIR}/${p}"
>  SRC_URI = "${KERNELORG_MIRROR}/pub/linux/libs/pam/library/${p}.tar.bz2 \
>             file://pam-nodocs.patch \
>             file://define-HAVE_DBM.patch \
> +           file://05_libpam \
>            "
> 
>  UCLIBC_PATCHES = " file://Linux-PAM-1.1.0-uclibc.patch \
> @@ -71,6 +72,17 @@ python populate_packages_prepend () {
>         packages.append(metapkg)
>         bb.data.setVar('PACKAGES', ' '.join(packages), d)
>  }
> +
> +do_install_append () {
> +    # Remove erroneously created /var/run dir
> +    rm -rf ${D}${localstatedir}/run
> +
> +    # Install volatiles specification to make sure dir is created in run-time
> +    install -d ${D}${sysconfdir}/default
> +    install -d ${D}${sysconfdir}/default/volatiles
> +    install -m 0644  ${WORKDIR}/05_libpam  ${D}${sysconfdir}/default/volatiles/
> +}
> +
>  SRC_URI[md5sum] = "9b3d952b173d5b9836cbc7e8de108bee"
>  SRC_URI[sha256sum] = "608d3eb9d7a5e1a7505fff62e6a583fdb6e52dc05bf54dc9661c5f395


Thanks,

Paul


[1] http://git.openembedded.org/openembedded-core/commit/meta/recipes-extended/pam/libpam/99_pam?id=698cef8322e5a5f18e50ce62f6c9d1f1f846677a
Mats Kärrman - Dec. 7, 2011, 10:12 a.m.
> From: openembedded-devel-bounces@lists.openembedded.org [openembedded-devel-bounces@lists.openembedded.org] on behalf of Paul Menzel [paulepanter@users.sourceforge.net]
> Sent: Wednesday, December 07, 2011 10:58 AM
> To: openembedded-devel@lists.openembedded.org
> Subject: Re: [oe] [PATCH] libpam_1.1.1: remove directory preventing /var/run from being volatile
> 
> Dear Mats,
> 
> 
> thank you for sending the patch for OE-classic master.
> 
> Am Mittwoch, den 07.12.2011, 09:37 +0000 schrieb Mats Kärrman:
> > The libpam make install creates a /var/run/sepermit folder that prevents
> > the later creation of a sym-link /var/run --> /var/volatile/run. This is
> > a problem because it causes additional wear to FLASH file systems.
> >
> > The solution is ~equivalent to the solution applied in libpam recipes of
> 
> Does the ~ have any meaning or is it just a typo?

~ = roughly, more-or-less, approximately (like 05 != 99...)

> 
> > oe-core but v1.1.1 does not exist there and the corresponding fix was a
> > part of the original recipes for later versions.
> >
> > Signed-off-by: Mats Kärrman <mats.karrman@tritech.se>
> >
> > ------
> >
> > diff --git a/recipes/pam/files/05_libpam b/recipes/pam/files/05_libpam
> > new file mode 100644
> > index 0000000..5ae0c8e
> > --- /dev/null
> > +++ b/recipes/pam/files/05_libpam
> > @@ -0,0 +1,3 @@
> > +# Create sepermit folder in volatile fs
> > +d root root 0755 /var/run/sepermit none
> > +
> 
> In OE-core the file name is `99_pam` [1]. Why did the leading number
> needed to be changed? Should that be also `05` in OE-core?

Number sets the order that files are parsed to create volatile directories. I fixed and tested my build without looking at oe-core and thought that 05 was a good number as there were only a 00 file to begin with. Only later I decided to contribute back and then I found that the problem was already solved in oe-core but I didn't bother to change my fix to match oe-core because I didn't think it matter, sorry...

> 
> > diff --git a/recipes/pam/libpam_1.1.1.bb b/recipes/pam/libpam_1.1.1.bb
> > index 09bc554..ba35d0c 100644
> > --- a/recipes/pam/libpam_1.1.1.bb
> > +++ b/recipes/pam/libpam_1.1.1.bb
> > @@ -15,7 +15,7 @@ DEPENDS = "flex flex-native"
> >  # PAM is not a lot of use without configuration files and the plugins
> >  RRECOMMENDS_${PN} = "libpam-meta libpam-base-files"
> >
> > -PR = "r2"
> > +PR = "r3"
> >
> >  # The project is actually called Linux-PAM but that gives
> >  # a bad OE package name because of the upper case characters
> > @@ -26,6 +26,7 @@ S = "${WORKDIR}/${p}"
> >  SRC_URI = "${KERNELORG_MIRROR}/pub/linux/libs/pam/library/${p}.tar.bz2 \
> >             file://pam-nodocs.patch \
> >             file://define-HAVE_DBM.patch \
> > +           file://05_libpam \
> >            "
> >
> >  UCLIBC_PATCHES = " file://Linux-PAM-1.1.0-uclibc.patch \
> > @@ -71,6 +72,17 @@ python populate_packages_prepend () {
> >         packages.append(metapkg)
> >         bb.data.setVar('PACKAGES', ' '.join(packages), d)
> >  }
> > +
> > +do_install_append () {
> > +    # Remove erroneously created /var/run dir
> > +    rm -rf ${D}${localstatedir}/run
> > +
> > +    # Install volatiles specification to make sure dir is created in run-time
> > +    install -d ${D}${sysconfdir}/default
> > +    install -d ${D}${sysconfdir}/default/volatiles
> > +    install -m 0644  ${WORKDIR}/05_libpam  ${D}${sysconfdir}/default/volatiles/
> > +}
> > +
> >  SRC_URI[md5sum] = "9b3d952b173d5b9836cbc7e8de108bee"
> >  SRC_URI[sha256sum] = "608d3eb9d7a5e1a7505fff62e6a583fdb6e52dc05bf54dc9661c5f395
> 
> 
> Thanks,
> 
> Paul
> 
> 
> [1] http://git.openembedded.org/openembedded-core/commit/meta/recipes-extended/pam/libpam/99_pam?id=698cef8322e5a5f18e50ce62f6c9d1f1f846677a
> 

I'll send a new patch shortly.

// Mats

Patch

diff --git a/recipes/pam/files/05_libpam b/recipes/pam/files/05_libpam
new file mode 100644
index 0000000..5ae0c8e
--- /dev/null
+++ b/recipes/pam/files/05_libpam
@@ -0,0 +1,3 @@ 
+# Create sepermit folder in volatile fs
+d root root 0755 /var/run/sepermit none
+
diff --git a/recipes/pam/libpam_1.1.1.bb b/recipes/pam/libpam_1.1.1.bb
index 09bc554..ba35d0c 100644
--- a/recipes/pam/libpam_1.1.1.bb
+++ b/recipes/pam/libpam_1.1.1.bb
@@ -15,7 +15,7 @@  DEPENDS = "flex flex-native"
 # PAM is not a lot of use without configuration files and the plugins
 RRECOMMENDS_${PN} = "libpam-meta libpam-base-files"

-PR = "r2"
+PR = "r3"

 # The project is actually called Linux-PAM but that gives
 # a bad OE package name because of the upper case characters
@@ -26,6 +26,7 @@  S = "${WORKDIR}/${p}"
 SRC_URI = "${KERNELORG_MIRROR}/pub/linux/libs/pam/library/${p}.tar.bz2 \
            file://pam-nodocs.patch \
            file://define-HAVE_DBM.patch \
+           file://05_libpam \
           "

 UCLIBC_PATCHES = " file://Linux-PAM-1.1.0-uclibc.patch \
@@ -71,6 +72,17 @@  python populate_packages_prepend () {
        packages.append(metapkg)
        bb.data.setVar('PACKAGES', ' '.join(packages), d)
 }
+
+do_install_append () {
+    # Remove erroneously created /var/run dir
+    rm -rf ${D}${localstatedir}/run
+
+    # Install volatiles specification to make sure dir is created in run-time
+    install -d ${D}${sysconfdir}/default
+    install -d ${D}${sysconfdir}/default/volatiles
+    install -m 0644  ${WORKDIR}/05_libpam  ${D}${sysconfdir}/default/volatiles/
+}
+
 SRC_URI[md5sum] = "9b3d952b173d5b9836cbc7e8de108bee"
 SRC_URI[sha256sum] = "608d3eb9d7a5e1a7505fff62e6a583fdb6e52dc05bf54dc9661c5f395