Re: [yocto] How to patch a driver in Linux source tree

2018-04-13 Thread Jeremy Thien
SRC_URI = " file://your-patch-path"

Then place the patch in files subdirectory.

So your tree should look something like:

/recipes-kernel/linux/
  linux-raspberrypi_4.4.bbappend
  files/


Instead of "files", it might be named "linux-raspberrypi".

Hope this helps,
Jeremy

On Fri, Apr 13, 2018 at 2:41 PM Greg Wilson-Lindberg 
wrote:

> I'm working on a raspberry pi3 Yocto build from Qt's boot2qt project, it's
> running Yocto version 2.2.3, and Linux kernel 4.4.50. I need to back port
> some changes to a file in drivers/net/can/spi. I confused about where and
> how I set up the patch file.
>
> I have a linux-raspberrypi_4.4.bbappend file. Do I put the patch file in
> that, and If so, how do I indicate the path to the file?
>
>
> Thanks for the help and enlightenment,
>
> Greg Wilson-Lindberg
> --
> ___
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>
-- 
Jeremy Thien
Director of Engineering | Adtec Digital
jeremy.th...@adtecdigital.net | mobile: +1 (904) 910-1749
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Re: [yocto] trouble getting systemd oneshot to run

2018-03-15 Thread Jeremy Thien
Agreed. I would expect the service file to be in
/lib/systemd/system/canstart.service and a symbolic link in
/etc/systemd/system/network.target.wants/canstart.service.

If those are both present, then the problem is in the service file. If the
symbolic link is missing, try "systemctl enable canstart.service" to see if
there is any useful information. "systemctl start canstart.service" and
"systemctl status canstart.service" may also help.

In my particular service file, I wanted to start after networking is up so
I followed this post
<https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/>. In the
Install section, I have "WantedBy=multi-user.target". In the Unit section,
I have "After=network-online.target" and "Wants=network-online.target".

On Wed, Mar 14, 2018 at 10:28 PM Khem Raj  wrote:

> On Wed, Mar 14, 2018 at 3:20 PM Greg Wilson-Lindberg 
> wrote:
>
>> I changed it to look like:
>>
>> PACKAGES += "${PN}-service"
>>
>> FILES_${PN} = "${datadir}/*"
>> FILES_${PN}-service = "${systemd_system_unitdir}/canstart.service"
>>
>> do_install () {
>> if test -e ${WORKDIR}/can_start.sh &&
>>test -e ${WORKDIR}/canstart.service; then
>> install -d ${D}${datadir}/canstart
>> install -m 0755 ${WORKDIR}/can_start.sh ${D}${datadir}/canstart
>> install -d ${D}${systemd_system_unitdir}
>> install -m 0644 ${WORKDIR}/canstart.service 
>> ${D}${systemd_system_unitdir}
>> sed -i -e 's|@SCRIPTDIR@|${datadir}/canstart|g' 
>> ${D}${systemd_system_unitdir}/canstart.service
>> fi}
>>
>> SYSTEMD_PACKAGES = "${PN}-service"
>> SYSTEMD_SERVICE_${PN}-service = "canstart.service"
>> SYSTEMD_AUTO_ENABLE_${PN}-service = "enable"
>>
>> Still got the same results, my task is not running at startup.
>> To make sure that there wasn't some problem in running the script, I
>> changed the ExecStart to echo to a file in /tmp. Nothing there. The
>> .service file is not being executed.
>> I've obviously got something totally messed up, but I'm darned if I
>> understand what it is.
>>
>>
> You can check with systemctl status and other commands on the service on
> running system and might find more details
>
>>
>> --
>> *From:* Jeremy Thien 
>> *Sent:* Wednesday, March 14, 2018 1:08 PM
>> *To:* Greg Wilson-Lindberg
>> *Cc:* yocto@yoctoproject.org
>> *Subject:* Re: [yocto] trouble getting systemd oneshot to run
>>
>> I am no expert, but I have a similar recipe. It might be over
>> complicated, but I put the script in one package and the service in another
>> something like:
>>
>> PACKAGES += "${PN}-service"
>> FILES_${PN} = "${datadir}/canstart/canstart.sh "
>> FILES_${PN}-service = "${systemd_unitdir}/system/canstart.service "
>> SYSTEMD_PACKAGES = ${PN}-service"
>> SYSTEMD_SERVICE_${PN}-service = canstart.service"
>> SYSTEMD_AUTO_ENABLE_${PN}-service = "enable"
>>
>> Of course, this requires image to install both canstart and
>> canstart-service.
>>
>> Hope this helps,
>> Jeremy Thien
>>
>> On Wed, Mar 14, 2018 at 3:21 PM Greg Wilson-Lindberg <
>> gwil...@sakuraus.com> wrote:
>>
>>> I'm building yocto for a raspberry pi3 from Qt's b2qt version.
>>>
>>>
>>> I'm running into two problems, I've got all of the files copying to the
>>> correct locations but the .service is not running at startup. I used
>>> connman-conf.bb as the template for my .bb file:
>>>
>>>
>>> SUMMARY="recipe to create CAN bus startup service"
>>>
>>> LICENSE = "CLOSED"
>>> LIC_FILES_CHKSUM = ""
>>>
>>> inherit systemd
>>>
>>> SRC_URI = "file://can_start.sh \   file://canstart.service \"
>>>
>>> S = "${WORKDIR}"
>>>
>>> PACKAGE_ARCH = "${MACHINE_ARCH}"
>>>
>>> FILES_${PN} = "${datadir}/*"
>>> do_install () {
>>> if test -e ${WORKDIR}/can_start.sh &&
>>>test -e ${WORKDIR}/canstart.service; then
>>> install -d ${D}${datadir}/canstart
>>> install -m 0755 ${WORKDIR}/can_start.sh ${D}${datadir}/canstart
>>> install -d ${D}${systemd_system_unitdir}
>>> install -m 0644 ${WORKDIR}/canstart.service 
>>&

Re: [yocto] trouble getting systemd oneshot to run

2018-03-14 Thread Jeremy Thien
I am no expert, but I have a similar recipe. It might be over complicated,
but I put the script in one package and the service in another something
like:

PACKAGES += "${PN}-service"
FILES_${PN} = "${datadir}/canstart/canstart.sh "
FILES_${PN}-service = "${systemd_unitdir}/system/canstart.service "
SYSTEMD_PACKAGES = ${PN}-service"
SYSTEMD_SERVICE_${PN}-service = canstart.service"
SYSTEMD_AUTO_ENABLE_${PN}-service = "enable"

Of course, this requires image to install both canstart and
canstart-service.

Hope this helps,
Jeremy Thien

On Wed, Mar 14, 2018 at 3:21 PM Greg Wilson-Lindberg 
wrote:

> I'm building yocto for a raspberry pi3 from Qt's b2qt version.
>
>
> I'm running into two problems, I've got all of the files copying to the
> correct locations but the .service is not running at startup. I used
> connman-conf.bb as the template for my .bb file:
>
>
> SUMMARY="recipe to create CAN bus startup service"
>
> LICENSE = "CLOSED"
> LIC_FILES_CHKSUM = ""
>
> inherit systemd
>
> SRC_URI = "file://can_start.sh \   file://canstart.service \"
>
> S = "${WORKDIR}"
>
> PACKAGE_ARCH = "${MACHINE_ARCH}"
>
> FILES_${PN} = "${datadir}/*"
> do_install () {
> if test -e ${WORKDIR}/can_start.sh &&
>test -e ${WORKDIR}/canstart.service; then
> install -d ${D}${datadir}/canstart
> install -m 0755 ${WORKDIR}/can_start.sh ${D}${datadir}/canstart
> install -d ${D}${systemd_system_unitdir}
> install -m 0644 ${WORKDIR}/canstart.service 
> ${D}${systemd_system_unitdir}
> sed -i -e 's|@SCRIPTDIR@|${datadir}/canstart|g' 
> ${D}${systemd_system_unitdir}/canstart.service
> fi}
>
> SYSTEMD_SERVICE_${PN} = "canstart.service"
>
>
> Service file:
>
> [Unit]
> Description=Startup CAN bus interface
>
> [Service]
> Type=oneshot
> ExecStart=@SCRIPTDIR@/can_start.sh
>
> [Install]
> WantedBy=network.target
>
>
> From looking at the connman-conf sample I'm setting everything up
> correctly and the service should default to running on startup but it is
> not.
>
> The second 'problem' is really just perplexing, if I dump the variables S
> contains a path to a directory in my root not "${WORKDIR}".
>
> Any and all help with this would be greatly appreciated.
>
>
> Regards,
>
> Greg Wilson-Lindberg
> --
> ___
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>
-- 
Jeremy Thien
Director of Engineering | Adtec Digital
jeremy.th...@adtecdigital.net | mobile: +1 (904) 910-1749
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Re: [yocto] Yocto - Building initramfs to run a shell script for the support of IMA/EVM

2017-01-23 Thread Jeremy Thien
Sorry, mangled the name. It should be initramfs-debug-image. It is very
simple, but you have to handle switch root yourself.

On Mon, Jan 23, 2017 at 9:08 AM Jeremy Thien  wrote:

> I suggest the debug-iniramfs-image from meta-openembedded/meta-initramfs.
>
> On Sun, Jan 22, 2017, 6:42 AM Patrick Ohly  wrote:
>
> On Fri, 2017-01-20 at 12:44 +, Eswaran Vinothkumar (BEG-PT/PJ-IOT1)
> wrote:
> > We are using initramfs to run a script which before mounting the root
> > file system checks for ima policy and also responsible for loading the
> > evm-keys. In short, the initramfs contains a script which is executed
> > before mounting the main root file system.
>
> Ostro OS does the same, with IMA activated via a plugin for the
> initramfs-framework (a set of scripts in OE-core).
>
> meta-integrity:
> https://github.com/01org/meta-intel-iot-security/tree/master/meta-integrity
>
> IMA plugin:
>
> https://github.com/01org/meta-intel-iot-security/tree/master/meta-integrity/recipes-core/initrdscripts
>
> Full initramfs using this is ostro-initramfs.bb in:
>
> https://github.com/ostroproject/ostro-os/tree/master/meta-ostro/recipes-image/images
>
> Perhaps this will give you some ideas how to do this, or can even be
> used as-is?
>
> --
> Best Regards, Patrick Ohly
>
> The content of this message is my personal opinion only and although
> I am an employee of Intel, the statements I make here in no way
> represent Intel's position on the issue, nor am I authorized to speak
> on behalf of Intel on this matter.
>
>
>
> --
> _______
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>
> --
> Jeremy Thien
> Adtec Digital
> adtecdigital.com
> jeremy.th...@adtecdigital.net
>
-- 
Jeremy Thien
Adtec Digital
adtecdigital.com
jeremy.th...@adtecdigital.net
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


Re: [yocto] Yocto - Building initramfs to run a shell script for the support of IMA/EVM

2017-01-23 Thread Jeremy Thien
I suggest the debug-iniramfs-image from meta-openembedded/meta-initramfs.

On Sun, Jan 22, 2017, 6:42 AM Patrick Ohly  wrote:

> On Fri, 2017-01-20 at 12:44 +, Eswaran Vinothkumar (BEG-PT/PJ-IOT1)
> wrote:
> > We are using initramfs to run a script which before mounting the root
> > file system checks for ima policy and also responsible for loading the
> > evm-keys. In short, the initramfs contains a script which is executed
> > before mounting the main root file system.
>
> Ostro OS does the same, with IMA activated via a plugin for the
> initramfs-framework (a set of scripts in OE-core).
>
> meta-integrity:
> https://github.com/01org/meta-intel-iot-security/tree/master/meta-integrity
>
> IMA plugin:
>
> https://github.com/01org/meta-intel-iot-security/tree/master/meta-integrity/recipes-core/initrdscripts
>
> Full initramfs using this is ostro-initramfs.bb in:
>
> https://github.com/ostroproject/ostro-os/tree/master/meta-ostro/recipes-image/images
>
> Perhaps this will give you some ideas how to do this, or can even be
> used as-is?
>
> --
> Best Regards, Patrick Ohly
>
> The content of this message is my personal opinion only and although
> I am an employee of Intel, the statements I make here in no way
> represent Intel's position on the issue, nor am I authorized to speak
> on behalf of Intel on this matter.
>
>
>
> --
> _______
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>
-- 
Jeremy Thien
Adtec Digital
adtecdigital.com
jeremy.th...@adtecdigital.net
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto


[yocto] oe-publish-sdk fails for remote publishing

2016-12-14 Thread Jeremy Thien
I am running Ubuntu 16.04 and poky (?) v2.2. I am working my way through
eSDK setup. When I use oe-publish-sdk I get this error. My default shell is
dash.

ubuntu@myhost:fsl-community-bsp/build$ oe-publish-sdk tmp/deploy/sdk/
poky-glibc-x86_64-core-image-minimal-cortexa7hf-neon-toolchain-ext-2.2.sh
${ESDK_HOST}:/sdkdata/
INFO: Copying the SDK to destination
poky-glibc-x86_64-core-image-minimal-cortexa7hf-neon-toolchain-ext-2.2.sh

100%  305MB 152.4MB/s   00:02
INFO: Unpacking SDK
Poky (Yocto Project Reference Distro) Extensible SDK installer version 2.2
==
The directory "/sdkdata" already contains a SDK for this architecture.
If you continue, existing files will be overwritten! Proceed[y/N]? Y
Extracting SDK.done
Setting it up...
Extracting buildtools...
done
SDK has been successfully set up and is ready to be used.
Each time you wish to use the SDK in a new shell session, you need to
source the environment setup script e.g.
 $ . /sdkdata/environment-setup-cortexa7hf-neon-poky-linux-gnueabi
INFO: Successfully unpacked /sdkdata/
poky-glibc-x86_64-core-image-minimal-cortexa7hf-neon-toolchain-ext-2.2.sh to
/sdkdata/
bash: -c: line 1: syntax error: unexpected end of file
/bin/sh: 2: *.pyo > .gitignore; fi; git add -A .; git config user.email
o...@oe.oe && git config user.name OE && git commit -q -m "init repo" ||
true; git update-server-info: not found
ERROR: Failed to set up layer git repo

This diff is my correction. I modified "pyc\n" to "pyc\\\n".

diff --git a/scripts/oe-publish-sdk b/scripts/oe-publish-sdk
index 4fe8974..c6b83be 100755
--- a/scripts/oe-publish-sdk
+++ b/scripts/oe-publish-sdk
@@ -116,7 +116,7 @@ def publish(args):
 if not is_remote:
 cmd = 'set -e; mkdir -p %s/layers; cd %s/layers; if [ ! -e .git ];
then git init .; mv .git/hooks/post-update.sample .git/hooks/post-update;
echo "*.pyc\n*.pyo" > .gitignore; fi; git add -A .; git config user.email
"o...@oe.oe" && git config user.name "OE" && git commit -q -m "init repo" ||
true; git update-server-info' % (destination, destination)
 else:
-cmd = "ssh %s 'set -e; mkdir -p %s/layers; cd %s/layers; if [ ! -e
.git ]; then git init .; mv .git/hooks/post-update.sample
.git/hooks/post-update; echo '*.pyc\n*.pyo' > .gitignore; fi; git add -A .;
git config user.email 'o...@oe.oe' && git config user.name 'OE' && git commit
-q -m \"init repo\" || true; git update-server-info'" % (host, destdir,
destdir)
+cmd = "ssh %s 'set -e; mkdir -p %s/layers; cd %s/layers; if [ ! -e
.git ]; then git init .; mv .git/hooks/post-update.sample
.git/hooks/post-update; echo '*.pyc\\\n*.pyo' > .gitignore; fi; git add -A
.; git config user.email 'o...@oe.oe' && git config user.name 'OE' && git
commit -q -m \"init repo\" || true; git update-server-info'" % (host,
destdir, destdir)
 ret = subprocess.call(cmd, shell=True)
 if ret == 0:
 logger.info('SDK published successfully')

I am happy to correct my environment if I am using the tool wrong or to
submit the change according to the documentation. (In that case, should I
submit to openembedded-devel? Should I create a bug first?)

Thanks!
Jeremy
-- 
Jeremy Thien
Adtec Digital
adtecdigital.com
jeremy.th...@adtecdigital.net
-- 
___
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto