All of lore.kernel.org
 help / color / mirror / Atom feed
* How do I create a recipe for laying down post-build config files?
@ 2014-06-09 21:44 Jim Rafert
  2014-06-10  8:30 ` Jens Lucius
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Jim Rafert @ 2014-06-09 21:44 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 4116 bytes --]

I'm trying to gather all my post-build tweaks into a recipe that will be built as part of an upper-level layer, so that they are installed after the meta layer is processed.  Many of these could be accomplished as part of .bbappend files for the recipes that originally supply the config files, but I wanted to gather all my customizations in one spot, so that they're easy to find.

The recipe doesn't actually build anything, so there's no do_build task.

This is surely something that is commonly wanted.

Here's my current recipe, in spectra-postbuild_0.1.bb.

When I try to build an image, the build fails with
ERROR: QA Issue: spectra-postbuild: Files/directories were installed but not shipped
  /RELEASE-NOTES.txt

When I disable the installed-vs-shipped QA test,  it fails later when it can't find a package file.

I must be missing something critical here?
SUMMARY = "Post processing of configuration files for SpectraOS"
SECTION = "base"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://${WORKDIR}/COPYRIGHT;md5=349c872e0066155e1818b786938876a4"
RDEPENDS_${PN} = "initscripts"
PR = "r0"

SRC_URI = "file://inittab \
       file://fstab \
       file://rsyslog.conf \
       file://grub.cfg \
       file://mount.sh \
       file://RELEASE-NOTES.txt \
       file://Spectra-OS-Version \
       file://initializeCustomKernelModules \
       file://firewall \
       file://sysctl.conf \
       file://COPYRIGHT \
       "

CONFFILES_${PN} += "${sysconfdir}/init.d/firewall "
CONFFILES_${PN} += "${sysconfdir}/init.d/initializeCustomKernelModules "
FILES_${PN} =  "/RELEASE_NOTES.txt /Spectra-OS-Version "

#INSANE_SKIP_${PN} = "installed-vs-shipped"

do_install () {
    install -m 755 ${WORKDIR}/RELEASE-NOTES.txt ${D}
    install -m 755 ${WORKDIR}/Spectra-OS-Version ${D}
}

pkg_postinst_${PN} () {
    install -d ${D}${sysconfdir}/init.d
    install -d ${D}${sbindir}

    #Install our inittab and fstab
    echo Install our inittab and fstab
    install -m 544 ${WORKDIR}/inittab ${D}/etc/inittab
    install -m 755 ${WORKDIR}/fstab ${D}/etc/fstab
    install -m 755 ${WORKDIR}/rsyslog.conf ${D}/etc/rsyslog.conf
    mkdir -p ${D}/boot/grub
    install -m 755 ${WORKDIR}/grub.cfg ${D}/boot/grub/grub.cfg
        install -d ${D}/etc/udev/scripts
    install -m 755 ${WORKDIR}/mount.sh ${D}/etc/udev/scripts/mount.sh
    chmod 755 ${D}/etc/udev/scripts/mount.sh
    install -m 755 ${WORKDIR}/RELEASE-NOTES.txt ${D}
    install -m 755 ${WORKDIR}/Spectra-OS-Version ${D}

    #Remove unneeded services from startup
    echo Remove unneeded services from startup
    rm ${D}/etc/rc5.d/S20nfsserver
    rm ${D}/etc/rc5.d/S20syslog
    rm ${D}/etc/rc5.d/S70lighttpd

    #Add /dev/sdd to the auto mount blacklist
    chmod 777 ${D}/etc/udev/mount.blacklist
    echo "/dev/sda*" >> ${D}/etc/udev/mount.blacklist
    echo "/dev/sdd*" >> ${D}/etc/udev/mount.blacklist
    echo "/dev/sde*" >> ${D}/etc/udev/mount.blacklist
    chmod 644 ${D}/etc/udev/mount.blacklist

    #Remove /var/log link to /var/volatile/log, persist log.
    rm ${D}/var/log
    mkdir ${D}/var/log
    mv ${D}/etc/default/volatiles/00_core ${D}/etc/default/volatiles/00_core.orig
    grep -v volatile/log ${D}/etc/default/volatiles/00_core.orig |  tee ${D}/etc/default/volatiles/00_core >/dev/null
    rm ${D}/etc/default/volatiles/00_core.orig

    #Create directory for SCST
    mkdir -p ${D}/var/lib/scst/pr
    mkdir -p ${D}/usr/local/bin
    mkdir -p ${D}/etc/logrotate.d
    #Install drivers load script
    echo Install drivers load script
    install -m 755 ${WORKDIR}initializeCustomKernelModules ${D}/etc/init.d
    ln -s ${D}/etc/init.d/initializeCustomKernelModules ${D}/etc/rc5.d/S70initializeCustomKernelModules
    echo Install firewall configuration boot script
    install -m 755 ${WORKDIR}firewall ${D}/etc/init.d
    chmod +x ${D}/etc/init.d/firewall
    ln -s ${D}/etc/init.d/firewall ${D}/etc/rc5.d/S80firewall
    #copy config change for console log level
    install -m 755 ${WORKDIR}sysctl.conf ${D}/etc/sysctl.conf
}



[-- Attachment #2: Type: text/html, Size: 6114 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How do I create a recipe for laying down post-build config files?
  2014-06-09 21:44 How do I create a recipe for laying down post-build config files? Jim Rafert
@ 2014-06-10  8:30 ` Jens Lucius
  2014-06-10  8:53 ` Paul Eggleton
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Jens Lucius @ 2014-06-10  8:30 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 4701 bytes --]

Hi

I am using a very minimal .bb for this.

DESCRIPTION = "Install additional files"
LICENSE = "CLOSED"
SECTION = "base"
PR = "r0"

SRC_URI = "file://autoinstaller.sh"

S = "${WORKDIR}"

do_install () {
     install -d ${D}/usr/bin
     install -m 755 ${S}/autoinstaller.sh ${D}/usr/bin
}

Am 09.06.2014 23:44, schrieb Jim Rafert:
> I'm trying to gather all my post-build tweaks into a recipe that will 
> be built as part of an upper-level layer, so that they are installed 
> after the meta layer is processed.  Many of these could be 
> accomplished as part of .bbappend files for the recipes that 
> originally supply the config files, but I wanted to gather all my 
> customizations in one spot, so that they're easy to find.
>
> The recipe doesn't actually build anything, so there's no do_build task.
>
> This is surely something that is commonly wanted.
>
> Here's my current recipe, in spectra-postbuild_0.1.bb.
>
> When I try to build an image, the build fails with
> ERROR: QA Issue: spectra-postbuild: Files/directories were installed 
> but not shipped
>   /RELEASE-NOTES.txt
>
> When I disable the installed-vs-shipped QA test,  it fails later when 
> it can't find a package file.
>
> I must be missing something critical here?
> SUMMARY = "Post processing of configuration files for SpectraOS"
> SECTION = "base"
> LICENSE = "GPLv2"
> LIC_FILES_CHKSUM = 
> "file://${WORKDIR}/COPYRIGHT;md5=349c872e0066155e1818b786938876a4"
> RDEPENDS_${PN} = "initscripts"
> PR = "r0"
>
> SRC_URI = "file://inittab \
>        file://fstab \
>        file://rsyslog.conf \
>        file://grub.cfg \
>        file://mount.sh \
>        file://RELEASE-NOTES.txt \
>        file://Spectra-OS-Version \
>        file://initializeCustomKernelModules \
>        file://firewall \
>        file://sysctl.conf \
>        file://COPYRIGHT \
>        "
>
> CONFFILES_${PN} += "${sysconfdir}/init.d/firewall "
> CONFFILES_${PN} += "${sysconfdir}/init.d/initializeCustomKernelModules "
> FILES_${PN} =  "/RELEASE_NOTES.txt /Spectra-OS-Version "
>
> #INSANE_SKIP_${PN} = "installed-vs-shipped"
>
> do_install () {
>     install -m 755 ${WORKDIR}/RELEASE-NOTES.txt ${D}
>     install -m 755 ${WORKDIR}/Spectra-OS-Version ${D}
> }
>
> pkg_postinst_${PN} () {
>     install -d ${D}${sysconfdir}/init.d
>     install -d ${D}${sbindir}
>
>     #Install our inittab and fstab
>     echo Install our inittab and fstab
>     install -m 544 ${WORKDIR}/inittab ${D}/etc/inittab
>     install -m 755 ${WORKDIR}/fstab ${D}/etc/fstab
>     install -m 755 ${WORKDIR}/rsyslog.conf ${D}/etc/rsyslog.conf
>     mkdir -p ${D}/boot/grub
>     install -m 755 ${WORKDIR}/grub.cfg ${D}/boot/grub/grub.cfg
>         install -d ${D}/etc/udev/scripts
>     install -m 755 ${WORKDIR}/mount.sh ${D}/etc/udev/scripts/mount.sh
>     chmod 755 ${D}/etc/udev/scripts/mount.sh
>     install -m 755 ${WORKDIR}/RELEASE-NOTES.txt ${D}
>     install -m 755 ${WORKDIR}/Spectra-OS-Version ${D}
>
>     #Remove unneeded services from startup
>     echo Remove unneeded services from startup
>     rm ${D}/etc/rc5.d/S20nfsserver
>     rm ${D}/etc/rc5.d/S20syslog
>     rm ${D}/etc/rc5.d/S70lighttpd
>
>     #Add /dev/sdd to the auto mount blacklist
>     chmod 777 ${D}/etc/udev/mount.blacklist
>     echo "/dev/sda*" >> ${D}/etc/udev/mount.blacklist
>     echo "/dev/sdd*" >> ${D}/etc/udev/mount.blacklist
>     echo "/dev/sde*" >> ${D}/etc/udev/mount.blacklist
>     chmod 644 ${D}/etc/udev/mount.blacklist
>
>     #Remove /var/log link to /var/volatile/log, persist log.
>     rm ${D}/var/log
>     mkdir ${D}/var/log
>     mv ${D}/etc/default/volatiles/00_core 
> ${D}/etc/default/volatiles/00_core.orig
>     grep -v volatile/log ${D}/etc/default/volatiles/00_core.orig |  
> tee ${D}/etc/default/volatiles/00_core >/dev/null
>     rm ${D}/etc/default/volatiles/00_core.orig
>
>     #Create directory for SCST
>     mkdir -p ${D}/var/lib/scst/pr
>     mkdir -p ${D}/usr/local/bin
>     mkdir -p ${D}/etc/logrotate.d
>     #Install drivers load script
>     echo Install drivers load script
>     install -m 755 ${WORKDIR}initializeCustomKernelModules ${D}/etc/init.d
>     ln -s ${D}/etc/init.d/initializeCustomKernelModules 
> ${D}/etc/rc5.d/S70initializeCustomKernelModules
>     echo Install firewall configuration boot script
>     install -m 755 ${WORKDIR}firewall ${D}/etc/init.d
>     chmod +x ${D}/etc/init.d/firewall
>     ln -s ${D}/etc/init.d/firewall ${D}/etc/rc5.d/S80firewall
>     #copy config change for console log level
>     install -m 755 ${WORKDIR}sysctl.conf ${D}/etc/sysctl.conf
> }
>
>
>
>


[-- Attachment #2: Type: text/html, Size: 8954 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How do I create a recipe for laying down post-build config files?
  2014-06-09 21:44 How do I create a recipe for laying down post-build config files? Jim Rafert
  2014-06-10  8:30 ` Jens Lucius
@ 2014-06-10  8:53 ` Paul Eggleton
  2014-06-10  8:58 ` Alex J Lennon
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Paul Eggleton @ 2014-06-10  8:53 UTC (permalink / raw)
  To: Jim Rafert; +Cc: yocto

Hi Jim,

On Monday 09 June 2014 21:44:00 Jim Rafert wrote:
> I'm trying to gather all my post-build tweaks into a recipe that will be
> built as part of an upper-level layer, so that they are installed after the
> meta layer is processed.  Many of these could be accomplished as part of
> .bbappend files for the recipes that originally supply the config files,
> but I wanted to gather all my customizations in one spot, so that they're
> easy to find.
> 
> The recipe doesn't actually build anything, so there's no do_build task.
> 
> This is surely something that is commonly wanted.
> 
> Here's my current recipe, in spectra-postbuild_0.1.bb.
> 
> When I try to build an image, the build fails with
> ERROR: QA Issue: spectra-postbuild: Files/directories were installed but not
> shipped /RELEASE-NOTES.txt
> 
> When I disable the installed-vs-shipped QA test,  it fails later when it
> can't find a package file.

In general, disabling installed-vs-shipped is not the right thing to do. What 
it's trying to tell you is that you've installed a file in do_install and then 
haven't packaged it in any package, which means it can never end up in the 
final image.

FYI we've been putting together a section for the manual in the upcoming 1.7 
release that attempts to explain each warning and what to do to resolve it; 
here is a preview:

http://www.yoctoproject.org/docs/1.7/ref-manual/ref-manual.html#ref-qa-checks

If "fails later when it can't find a package file" means during do_rootfs, this 
is almost certainly because the package ended up empty and thus wasn't created 
(we don't create empty packages unless ALLOW_EMPTY for the package is set to 
"1", but generally the fix is to ensure the files you expect to be packaged into 
the package are actually packaged).

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How do I create a recipe for laying down post-build config files?
  2014-06-09 21:44 How do I create a recipe for laying down post-build config files? Jim Rafert
  2014-06-10  8:30 ` Jens Lucius
  2014-06-10  8:53 ` Paul Eggleton
@ 2014-06-10  8:58 ` Alex J Lennon
  2014-06-11 15:04   ` Jim Rafert
  2014-06-10 15:02 ` Maxim Radugin
  2014-06-13 22:02 ` Jim Rafert
  4 siblings, 1 reply; 7+ messages in thread
From: Alex J Lennon @ 2014-06-10  8:58 UTC (permalink / raw)
  To: Jim Rafert; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 1514 bytes --]


On 09/06/2014 22:44, Jim Rafert wrote:
> I'm trying to gather all my post-build tweaks into a recipe that will
> be built as part of an upper-level layer, so that they are installed
> after the meta layer is processed.  Many of these could be
> accomplished as part of .bbappend files for the recipes that
> originally supply the config files, but I wanted to gather all my
> customizations in one spot, so that they're easy to find.
>
> The recipe doesn't actually build anything, so there's no do_build task.
>
> This is surely something that is commonly wanted.
>
> Here's my current recipe, in spectra-postbuild_0.1.bb.
>
> When I try to build an image, the build fails with
> ERROR: QA Issue: spectra-postbuild: Files/directories were installed
> but not shipped
>   /RELEASE-NOTES.txt
>
> When I disable the installed-vs-shipped QA test,  it fails later when
> it can't find a package file.
>
> I must be missing something critical here?
> SUMMARY = "Post processing of configuration files for SpectraOS"
> SECTION = "base"
> LICENSE = "GPLv2"
> LIC_FILES_CHKSUM =
> "file://${WORKDIR}/COPYRIGHT;md5=349c872e0066155e1818b786938876a4"
> RDEPENDS_${PN} = "initscripts"
> PR = "r0"
>
> SRC_URI = "file://inittab \
>        file://fstab \
>        file://rsyslog.conf \
>        file://grub.cfg \
>        file://mount.sh \
>        file://RELEASE-NOTES.txt \

FILES_${PN} =  "/RELEASE_NOTES.txt /Spectra-OS-Version "

RELEASE-NOTES vs RELEASE_NOTES

Cheers,

Alex

[-- Attachment #2: Type: text/html, Size: 3259 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How do I create a recipe for laying down post-build config files?
  2014-06-09 21:44 How do I create a recipe for laying down post-build config files? Jim Rafert
                   ` (2 preceding siblings ...)
  2014-06-10  8:58 ` Alex J Lennon
@ 2014-06-10 15:02 ` Maxim Radugin
  2014-06-13 22:02 ` Jim Rafert
  4 siblings, 0 replies; 7+ messages in thread
From: Maxim Radugin @ 2014-06-10 15:02 UTC (permalink / raw)
  To: Jim Rafert; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 5252 bytes --]

Hello Jim,

I don't think this is a good idea to put all the config files for different
packages in one recipe.
IMHO you should use .bbappend file for each recipe you are
overriding/modifying files for, otherwise you can run into situation when,
you recipe gets installed before, for example, grub.
Then your config will be overwritten by grub.cfg provided in grub package
(this is just an example, I'm not sure grub provides default one).

I wonder why you don't get another QA warning that you are overwriting
files that were installed by different package.

It is OK to put your specific files in such recipe, like RELEASE-NOTES.txt,
etc.

BR,
Maxim.



On Tue, Jun 10, 2014 at 12:44 AM, Jim Rafert <jimr@spectralogic.com> wrote:

>  I'm trying to gather all my post-build tweaks into a recipe that will be
> built as part of an upper-level layer, so that they are installed after the
> meta layer is processed.  Many of these could be accomplished as part of
> .bbappend files for the recipes that originally supply the config files,
> but I wanted to gather all my customizations in one spot, so that they're
> easy to find.
>
> The recipe doesn't actually build anything, so there's no do_build task.
>
> This is surely something that is commonly wanted.
>
> Here's my current recipe, in spectra-postbuild_0.1.bb.
>
> When I try to build an image, the build fails with
> ERROR: QA Issue: spectra-postbuild: Files/directories were installed but
> not shipped
>   /RELEASE-NOTES.txt
>
> When I disable the installed-vs-shipped QA test,  it fails later when it
> can't find a package file.
>
> I must be missing something critical here?
> SUMMARY = "Post processing of configuration files for SpectraOS"
> SECTION = "base"
> LICENSE = "GPLv2"
> LIC_FILES_CHKSUM =
> "file://${WORKDIR}/COPYRIGHT;md5=349c872e0066155e1818b786938876a4"
> RDEPENDS_${PN} = "initscripts"
> PR = "r0"
>
> SRC_URI = "file://inittab \
>        file://fstab \
>        file://rsyslog.conf \
>        file://grub.cfg \
>        file://mount.sh \
>        file://RELEASE-NOTES.txt \
>        file://Spectra-OS-Version \
>        file://initializeCustomKernelModules \
>        file://firewall \
>        file://sysctl.conf \
>        file://COPYRIGHT \
>        "
>
> CONFFILES_${PN} += "${sysconfdir}/init.d/firewall "
> CONFFILES_${PN} += "${sysconfdir}/init.d/initializeCustomKernelModules "
> FILES_${PN} =  "/RELEASE_NOTES.txt /Spectra-OS-Version "
>
> #INSANE_SKIP_${PN} = "installed-vs-shipped"
>
> do_install () {
>     install -m 755 ${WORKDIR}/RELEASE-NOTES.txt ${D}
>     install -m 755 ${WORKDIR}/Spectra-OS-Version ${D}
> }
>
> pkg_postinst_${PN} () {
>     install -d ${D}${sysconfdir}/init.d
>     install -d ${D}${sbindir}
>
>     #Install our inittab and fstab
>     echo Install our inittab and fstab
>     install -m 544 ${WORKDIR}/inittab ${D}/etc/inittab
>     install -m 755 ${WORKDIR}/fstab ${D}/etc/fstab
>     install -m 755 ${WORKDIR}/rsyslog.conf ${D}/etc/rsyslog.conf
>     mkdir -p ${D}/boot/grub
>     install -m 755 ${WORKDIR}/grub.cfg ${D}/boot/grub/grub.cfg
>         install -d ${D}/etc/udev/scripts
>     install -m 755 ${WORKDIR}/mount.sh ${D}/etc/udev/scripts/mount.sh
>     chmod 755 ${D}/etc/udev/scripts/mount.sh
>     install -m 755 ${WORKDIR}/RELEASE-NOTES.txt ${D}
>     install -m 755 ${WORKDIR}/Spectra-OS-Version ${D}
>
>     #Remove unneeded services from startup
>     echo Remove unneeded services from startup
>     rm ${D}/etc/rc5.d/S20nfsserver
>     rm ${D}/etc/rc5.d/S20syslog
>     rm ${D}/etc/rc5.d/S70lighttpd
>
>     #Add /dev/sdd to the auto mount blacklist
>     chmod 777 ${D}/etc/udev/mount.blacklist
>     echo "/dev/sda*" >> ${D}/etc/udev/mount.blacklist
>     echo "/dev/sdd*" >> ${D}/etc/udev/mount.blacklist
>     echo "/dev/sde*" >> ${D}/etc/udev/mount.blacklist
>     chmod 644 ${D}/etc/udev/mount.blacklist
>
>     #Remove /var/log link to /var/volatile/log, persist log.
>     rm ${D}/var/log
>     mkdir ${D}/var/log
>     mv ${D}/etc/default/volatiles/00_core
> ${D}/etc/default/volatiles/00_core.orig
>     grep -v volatile/log ${D}/etc/default/volatiles/00_core.orig |  tee
> ${D}/etc/default/volatiles/00_core >/dev/null
>     rm ${D}/etc/default/volatiles/00_core.orig
>
>     #Create directory for SCST
>     mkdir -p ${D}/var/lib/scst/pr
>     mkdir -p ${D}/usr/local/bin
>     mkdir -p ${D}/etc/logrotate.d
>     #Install drivers load script
>     echo Install drivers load script
>     install -m 755 ${WORKDIR}initializeCustomKernelModules ${D}/etc/init.d
>     ln -s ${D}/etc/init.d/initializeCustomKernelModules
> ${D}/etc/rc5.d/S70initializeCustomKernelModules
>     echo Install firewall configuration boot script
>     install -m 755 ${WORKDIR}firewall ${D}/etc/init.d
>     chmod +x ${D}/etc/init.d/firewall
>     ln -s ${D}/etc/init.d/firewall ${D}/etc/rc5.d/S80firewall
>     #copy config change for console log level
>     install -m 755 ${WORKDIR}sysctl.conf ${D}/etc/sysctl.conf
> }
>
>
>
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>
>

[-- Attachment #2: Type: text/html, Size: 6720 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How do I create a recipe for laying down post-build config files?
  2014-06-10  8:58 ` Alex J Lennon
@ 2014-06-11 15:04   ` Jim Rafert
  0 siblings, 0 replies; 7+ messages in thread
From: Jim Rafert @ 2014-06-11 15:04 UTC (permalink / raw)
  To: Alex J Lennon; +Cc: yocto

[-- Attachment #1: Type: text/plain, Size: 1868 bytes --]

Thanks, Alex.

You have sharp eyes, my friend.  I had been struggling with this one so long, I guess I was not looking for typos.

-Jim-


________________________________
From: Alex J Lennon [ajlennon@dynamicdevices.co.uk]
Sent: Tuesday, June 10, 2014 2:58 AM
To: Jim Rafert
Cc: yocto@yoctoproject.org
Subject: Re: [yocto] How do I create a recipe for laying down post-build config files?


On 09/06/2014 22:44, Jim Rafert wrote:
I'm trying to gather all my post-build tweaks into a recipe that will be built as part of an upper-level layer, so that they are installed after the meta layer is processed.  Many of these could be accomplished as part of .bbappend files for the recipes that originally supply the config files, but I wanted to gather all my customizations in one spot, so that they're easy to find.

The recipe doesn't actually build anything, so there's no do_build task.

This is surely something that is commonly wanted.

Here's my current recipe, in spectra-postbuild_0.1.bb.

When I try to build an image, the build fails with
ERROR: QA Issue: spectra-postbuild: Files/directories were installed but not shipped
  /RELEASE-NOTES.txt

When I disable the installed-vs-shipped QA test,  it fails later when it can't find a package file.

I must be missing something critical here?
SUMMARY = "Post processing of configuration files for SpectraOS"
SECTION = "base"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://${WORKDIR}/COPYRIGHT;md5=349c872e0066155e1818b786938876a4"<UrlBlockedError.aspx>
RDEPENDS_${PN} = "initscripts"
PR = "r0"

SRC_URI = "file://inittab \
       file://fstab \
       file://rsyslog.conf \
       file://grub.cfg \
       file://mount.sh \
       file://RELEASE-NOTES.txt \

FILES_${PN} =  "/RELEASE_NOTES.txt /Spectra-OS-Version "

RELEASE-NOTES vs RELEASE_NOTES

Cheers,

Alex

[-- Attachment #2: Type: text/html, Size: 3779 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: How do I create a recipe for laying down post-build config files?
  2014-06-09 21:44 How do I create a recipe for laying down post-build config files? Jim Rafert
                   ` (3 preceding siblings ...)
  2014-06-10 15:02 ` Maxim Radugin
@ 2014-06-13 22:02 ` Jim Rafert
  4 siblings, 0 replies; 7+ messages in thread
From: Jim Rafert @ 2014-06-13 22:02 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 5478 bytes --]

Well, now that I've resolved my spelling error, the build succeeds, but my pkg_postinst_${PN} () function doesn't seem to run.

I suppose I'm resigned to making .bbappend recipes to lay down my revised version of the config files.
at least they can all be localized in a layer.  Sometimes you just have to bite the bullet and do things
the right way.

However, I don't know how to go about removing files and links after the build is done, and running transformative scripts on other files. For example, see the following code examples that I want to
replicate.


    #Remove unneeded services from startup
    echo Remove unneeded services from startup
    rm ${D}/etc/rc5.d/S20nfsserver
    rm ${D}/etc/rc5.d/S20syslog
    rm ${D}/etc/rc5.d/S70lighttpd

    #Remove /var/log link to /var/volatile/log, persist log.
    rm ${D}/var/log
    mkdir ${D}/var/log
    mv ${D}/etc/default/volatiles/00_core ${D}/etc/default/volatiles/00_core.orig
    grep -v volatile/log ${D}/etc/default/volatiles/00_core.orig |  tee ${D}/etc/default/volatiles/00_core >/dev/null
    rm ${D}/etc/default/volatiles/00_core.orig

Any ideas how to do this?

-Jim-
________________________________
From: Jim Rafert
Sent: Monday, June 09, 2014 3:44 PM
To: yocto@yoctoproject.org
Subject: How do I create a recipe for laying down post-build config files?

I'm trying to gather all my post-build tweaks into a recipe that will be built as part of an upper-level layer, so that they are installed after the meta layer is processed.  Many of these could be accomplished as part of .bbappend files for the recipes that originally supply the config files, but I wanted to gather all my customizations in one spot, so that they're easy to find.

The recipe doesn't actually build anything, so there's no do_build task.

This is surely something that is commonly wanted.

Here's my current recipe, in spectra-postbuild_0.1.bb.

When I try to build an image, the build fails with
ERROR: QA Issue: spectra-postbuild: Files/directories were installed but not shipped
  /RELEASE-NOTES.txt

When I disable the installed-vs-shipped QA test,  it fails later when it can't find a package file.

I must be missing something critical here?
SUMMARY = "Post processing of configuration files for SpectraOS"
SECTION = "base"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://${WORKDIR}/COPYRIGHT;md5=349c872e0066155e1818b786938876a4"
RDEPENDS_${PN} = "initscripts"
PR = "r0"

SRC_URI = "file://inittab \
       file://fstab \
       file://rsyslog.conf \
       file://grub.cfg \
       file://mount.sh \
       file://RELEASE-NOTES.txt \
       file://Spectra-OS-Version \
       file://initializeCustomKernelModules \
       file://firewall \
       file://sysctl.conf \
       file://COPYRIGHT \
       "

CONFFILES_${PN} += "${sysconfdir}/init.d/firewall "
CONFFILES_${PN} += "${sysconfdir}/init.d/initializeCustomKernelModules "
FILES_${PN} =  "/RELEASE_NOTES.txt /Spectra-OS-Version "

#INSANE_SKIP_${PN} = "installed-vs-shipped"

do_install () {
    install -m 755 ${WORKDIR}/RELEASE-NOTES.txt ${D}
    install -m 755 ${WORKDIR}/Spectra-OS-Version ${D}
}

pkg_postinst_${PN} () {
    install -d ${D}${sysconfdir}/init.d
    install -d ${D}${sbindir}

    #Install our inittab and fstab
    echo Install our inittab and fstab
    install -m 544 ${WORKDIR}/inittab ${D}/etc/inittab
    install -m 755 ${WORKDIR}/fstab ${D}/etc/fstab
    install -m 755 ${WORKDIR}/rsyslog.conf ${D}/etc/rsyslog.conf
    mkdir -p ${D}/boot/grub
    install -m 755 ${WORKDIR}/grub.cfg ${D}/boot/grub/grub.cfg
        install -d ${D}/etc/udev/scripts
    install -m 755 ${WORKDIR}/mount.sh ${D}/etc/udev/scripts/mount.sh
    chmod 755 ${D}/etc/udev/scripts/mount.sh
    install -m 755 ${WORKDIR}/RELEASE-NOTES.txt ${D}
    install -m 755 ${WORKDIR}/Spectra-OS-Version ${D}

    #Remove unneeded services from startup
    echo Remove unneeded services from startup
    rm ${D}/etc/rc5.d/S20nfsserver
    rm ${D}/etc/rc5.d/S20syslog
    rm ${D}/etc/rc5.d/S70lighttpd

    #Add /dev/sdd to the auto mount blacklist
    chmod 777 ${D}/etc/udev/mount.blacklist
    echo "/dev/sda*" >> ${D}/etc/udev/mount.blacklist
    echo "/dev/sdd*" >> ${D}/etc/udev/mount.blacklist
    echo "/dev/sde*" >> ${D}/etc/udev/mount.blacklist
    chmod 644 ${D}/etc/udev/mount.blacklist

    #Remove /var/log link to /var/volatile/log, persist log.
    rm ${D}/var/log
    mkdir ${D}/var/log
    mv ${D}/etc/default/volatiles/00_core ${D}/etc/default/volatiles/00_core.orig
    grep -v volatile/log ${D}/etc/default/volatiles/00_core.orig |  tee ${D}/etc/default/volatiles/00_core >/dev/null
    rm ${D}/etc/default/volatiles/00_core.orig

    #Create directory for SCST
    mkdir -p ${D}/var/lib/scst/pr
    mkdir -p ${D}/usr/local/bin
    mkdir -p ${D}/etc/logrotate.d
    #Install drivers load script
    echo Install drivers load script
    install -m 755 ${WORKDIR}initializeCustomKernelModules ${D}/etc/init.d
    ln -s ${D}/etc/init.d/initializeCustomKernelModules ${D}/etc/rc5.d/S70initializeCustomKernelModules
    echo Install firewall configuration boot script
    install -m 755 ${WORKDIR}firewall ${D}/etc/init.d
    chmod +x ${D}/etc/init.d/firewall
    ln -s ${D}/etc/init.d/firewall ${D}/etc/rc5.d/S80firewall
    #copy config change for console log level
    install -m 755 ${WORKDIR}sysctl.conf ${D}/etc/sysctl.conf
}



[-- Attachment #2: Type: text/html, Size: 8323 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-06-13 22:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-09 21:44 How do I create a recipe for laying down post-build config files? Jim Rafert
2014-06-10  8:30 ` Jens Lucius
2014-06-10  8:53 ` Paul Eggleton
2014-06-10  8:58 ` Alex J Lennon
2014-06-11 15:04   ` Jim Rafert
2014-06-10 15:02 ` Maxim Radugin
2014-06-13 22:02 ` Jim Rafert

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.