* Run-time discovery of machine for image compatibility check @ 2015-09-30 21:31 Eystein Måløy Stenberg 2015-09-30 23:42 ` Daniel. 2015-10-01 0:45 ` Khem Raj 0 siblings, 2 replies; 6+ messages in thread From: Eystein Måløy Stenberg @ 2015-09-30 21:31 UTC (permalink / raw) To: yocto Hi, Before starting a bitbake build, we input the MACHINE variable in local.conf (e.g. MACHINE ?= beaglebone). Is there a way to detect this variable at run-time? I.e. if I have built the image, written it to a device, and I'm now logged in to it. The reason I want this is that I'm working on a project to deploy image updates (remotely), and I only want to write the image if the device is compatible with the image file. So I need to know both the hardware/board type and what the image target is (assuming this is the MACHINE variable alone). Then I will only write the image if they are the same. Also, do you think using the MACHINE variable is the right approach for this problem? Maybe someone has had a similar problem? I'm new to Yocto, sorry if I'm asking something obvious (but I could not find an answer in the docs). Thanks! -- Eystein ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Run-time discovery of machine for image compatibility check 2015-09-30 21:31 Run-time discovery of machine for image compatibility check Eystein Måløy Stenberg @ 2015-09-30 23:42 ` Daniel. 2015-10-01 0:45 ` Khem Raj 1 sibling, 0 replies; 6+ messages in thread From: Daniel. @ 2015-09-30 23:42 UTC (permalink / raw) To: Eystein Måløy Stenberg; +Cc: yocto [-- Attachment #1: Type: text/plain, Size: 1503 bytes --] Hi in my case I have a machine for each board and I choose the right device-tree at "machine".conf. So MACHINE can be determined by the device tree Im running. Other option would be echoing the machine to /etc/issue of the image. I do this with DISTRO_VERSION. You can use ROOTFS_POSTPROCESS_COMMAND to achieve this. Regards Em 30/09/2015 18:32, "Eystein Måløy Stenberg" <eystein@mender.io> escreveu: > Hi, > > Before starting a bitbake build, we input the MACHINE variable in > local.conf (e.g. MACHINE ?= beaglebone). > > Is there a way to detect this variable at run-time? I.e. if I have built > the image, written it to a device, and I'm now logged in to it. > > The reason I want this is that I'm working on a project to deploy image > updates (remotely), and I only want to write the image if the device is > compatible with the image file. So I need to know both the > hardware/board type and what the image target is (assuming this is the > MACHINE variable alone). Then I will only write the image if they are > the same. > > Also, do you think using the MACHINE variable is the right approach for > this problem? Maybe someone has had a similar problem? > > I'm new to Yocto, sorry if I'm asking something obvious (but I could not > find an answer in the docs). > > Thanks! > > -- > > Eystein > -- > _______________________________________________ > yocto mailing list > yocto@yoctoproject.org > https://lists.yoctoproject.org/listinfo/yocto > [-- Attachment #2: Type: text/html, Size: 2000 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Run-time discovery of machine for image compatibility check 2015-09-30 21:31 Run-time discovery of machine for image compatibility check Eystein Måløy Stenberg 2015-09-30 23:42 ` Daniel. @ 2015-10-01 0:45 ` Khem Raj 2015-11-11 2:28 ` Eystein Måløy Stenberg 1 sibling, 1 reply; 6+ messages in thread From: Khem Raj @ 2015-10-01 0:45 UTC (permalink / raw) To: Eystein Måløy Stenberg; +Cc: yocto [-- Attachment #1: Type: text/plain, Size: 1790 bytes --] > On Sep 30, 2015, at 2:31 PM, Eystein Måløy Stenberg <eystein@mender.io> wrote: > > Hi, > > Before starting a bitbake build, we input the MACHINE variable in > local.conf (e.g. MACHINE ?= beaglebone). > > Is there a way to detect this variable at run-time? I.e. if I have built > the image, written it to a device, and I'm now logged in to it. There is no standard bill of materials that you will find on images. Everyone produces it per own needs. The reason is that we do not have a one OTA mechanism recommended or preferred in OpenEmbedded or maintained by yocto project. May be this could be a thing to consider come future right now, there were other big fish to fry around workflow. OTA firmware upgrade, could be big thing for next release or there after. I don’t have a better answer for you at the moment. You have to work with device firmware manufacturer and see if they have put some image info into the image in some form. > > The reason I want this is that I'm working on a project to deploy image > updates (remotely), and I only want to write the image if the device is > compatible with the image file. So I need to know both the > hardware/board type and what the image target is (assuming this is the > MACHINE variable alone). Then I will only write the image if they are > the same. > > Also, do you think using the MACHINE variable is the right approach for > this problem? Maybe someone has had a similar problem? > > I'm new to Yocto, sorry if I'm asking something obvious (but I could not > find an answer in the docs). > > Thanks! > > -- > > Eystein > -- > _______________________________________________ > yocto mailing list > yocto@yoctoproject.org > https://lists.yoctoproject.org/listinfo/yocto [-- Attachment #2: Message signed with OpenPGP using GPGMail --] [-- Type: application/pgp-signature, Size: 211 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Run-time discovery of machine for image compatibility check 2015-10-01 0:45 ` Khem Raj @ 2015-11-11 2:28 ` Eystein Måløy Stenberg 2015-11-11 16:50 ` Smith, Virgil 0 siblings, 1 reply; 6+ messages in thread From: Eystein Måløy Stenberg @ 2015-11-11 2:28 UTC (permalink / raw) To: Khem Raj; +Cc: yocto Thanks to everyone on the input on this issue. I eventually solved it by using an image feature called "buildinfo". In case someone come across a similar need in the future I've created these two blog post to advertise buildinfo it a bit more and show how to use it: * https://www.mender.io/blog/build-info-yocto-1 * https://www.mender.io/blog/build-info-yocto-2 On 30/09/15 17:45, Khem Raj wrote: > >> On Sep 30, 2015, at 2:31 PM, Eystein Måløy Stenberg <eystein@mender.io> wrote: >> >> Hi, >> >> Before starting a bitbake build, we input the MACHINE variable in >> local.conf (e.g. MACHINE ?= beaglebone). >> >> Is there a way to detect this variable at run-time? I.e. if I have built >> the image, written it to a device, and I'm now logged in to it. > > There is no standard bill of materials that you will find on images. Everyone produces it > per own needs. The reason is that we do not have a one OTA mechanism recommended or preferred > in OpenEmbedded or maintained by yocto project. May be this could be a thing to consider come future > right now, there were other big fish to fry around workflow. OTA firmware upgrade, could be big thing for next release > or there after. > > I don’t have a better answer for you at the moment. You have to work with device firmware manufacturer > and see if they have put some image info into the image in some form. > >> >> The reason I want this is that I'm working on a project to deploy image >> updates (remotely), and I only want to write the image if the device is >> compatible with the image file. So I need to know both the >> hardware/board type and what the image target is (assuming this is the >> MACHINE variable alone). Then I will only write the image if they are >> the same. >> >> Also, do you think using the MACHINE variable is the right approach for >> this problem? Maybe someone has had a similar problem? >> >> I'm new to Yocto, sorry if I'm asking something obvious (but I could not >> find an answer in the docs). >> >> Thanks! >> >> -- >> >> Eystein >> -- >> _______________________________________________ >> yocto mailing list >> yocto@yoctoproject.org >> https://lists.yoctoproject.org/listinfo/yocto > -- Eystein ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Run-time discovery of machine for image compatibility check 2015-11-11 2:28 ` Eystein Måløy Stenberg @ 2015-11-11 16:50 ` Smith, Virgil 2015-11-14 2:12 ` Eystein Måløy Stenberg 0 siblings, 1 reply; 6+ messages in thread From: Smith, Virgil @ 2015-11-11 16:50 UTC (permalink / raw) To: Eystein Måløy Stenberg; +Cc: yocto@yoctoproject.org The recommendations on your blog suggest modifying image-buildinfo.bbclass to change IMAGE_BUILDINFO_VARS. You /should/ be able to avoid this by simply adding something like IMAGE_BUILDINFO_VARS_append = " MACHINE DEVICE_MODEL DEVICE_TYPE" or IMAGE_BUILDINFO_VARS = "DISTRO DISTRO_VERSION MACHINE DEVICE_MODEL DEVICE_TYPE" to local.conf. The first version should extend the value whereas the second should completely replace it. This should work because image-buildinfo.bbclass used the ?= operator to set the variable. For the same reason you should NOT use += to extend the variable, but should use _append instead. This should be easier to maintain when updating your 'version of yocto'. NOTE: In /extreme/ summary this would mean Add the following to local.conf INHERIT += "image-buildinfo" DEVICE_MODEL = "some-extra-identifying-details" IMAGE_BUILDINFO_VARS_append = " MACHINE DEVICE_MODEL" to get a /etc/build file in your resulting image with information similar to the build configuration summary bitbake outputs during a build. > -----Original Message----- > From: yocto-bounces@yoctoproject.org [mailto:yocto- > bounces@yoctoproject.org] On Behalf Of Eystein Måløy Stenberg > Sent: Tuesday, November 10, 2015 8:29 PM > To: Khem Raj > Cc: yocto@yoctoproject.org > Subject: Re: [yocto] Run-time discovery of machine for image compatibility > check > > Thanks to everyone on the input on this issue. I eventually solved it by using an > image feature called "buildinfo". > > In case someone come across a similar need in the future I've created these two > blog post to advertise buildinfo it a bit more and show how to use it: > > * https://www.mender.io/blog/build-info-yocto-1 > * https://www.mender.io/blog/build-info-yocto-2 > > On 30/09/15 17:45, Khem Raj wrote: > > > >> On Sep 30, 2015, at 2:31 PM, Eystein Måløy Stenberg <eystein@mender.io> > wrote: > >> > >> Hi, > >> > >> Before starting a bitbake build, we input the MACHINE variable in > >> local.conf (e.g. MACHINE ?= beaglebone). > >> > >> Is there a way to detect this variable at run-time? I.e. if I have > >> built the image, written it to a device, and I'm now logged in to it. > > > > There is no standard bill of materials that you will find on images. > > Everyone produces it per own needs. The reason is that we do not have > > a one OTA mechanism recommended or preferred in OpenEmbedded or > > maintained by yocto project. May be this could be a thing to consider > > come future right now, there were other big fish to fry around workflow. OTA > firmware upgrade, could be big thing for next release or there after. > > > > I don’t have a better answer for you at the moment. You have to work > > with device firmware manufacturer and see if they have put some image info > into the image in some form. > > > >> > >> The reason I want this is that I'm working on a project to deploy > >> image updates (remotely), and I only want to write the image if the > >> device is compatible with the image file. So I need to know both the > >> hardware/board type and what the image target is (assuming this is > >> the MACHINE variable alone). Then I will only write the image if they > >> are the same. > >> > >> Also, do you think using the MACHINE variable is the right approach > >> for this problem? Maybe someone has had a similar problem? > >> > >> I'm new to Yocto, sorry if I'm asking something obvious (but I could > >> not find an answer in the docs). > >> > >> Thanks! > >> > >> -- > >> > >> Eystein > >> -- > >> _______________________________________________ > >> yocto mailing list > >> yocto@yoctoproject.org > >> https://lists.yoctoproject.org/listinfo/yocto > > > > -- > > Eystein > -- > _______________________________________________ > yocto mailing list > yocto@yoctoproject.org > https://lists.yoctoproject.org/listinfo/yocto ________________________________ Notice to recipient: This email is meant for only the intended recipient of the transmission, and may be a communication privileged by law, subject to export control restrictions or that otherwise contains proprietary information. If you receive this email by mistake, please notify us immediately by replying to this message and then destroy it and do not review, disclose, copy or distribute it. Thank you in advance for your cooperation. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Run-time discovery of machine for image compatibility check 2015-11-11 16:50 ` Smith, Virgil @ 2015-11-14 2:12 ` Eystein Måløy Stenberg 0 siblings, 0 replies; 6+ messages in thread From: Eystein Måløy Stenberg @ 2015-11-14 2:12 UTC (permalink / raw) To: Smith, Virgil; +Cc: yocto@yoctoproject.org Virgil, Thank you for pointing this out, I've updated the post to override the variable instead! On 11/11/15 08:50, Smith, Virgil wrote: > The recommendations on your blog suggest modifying image-buildinfo.bbclass to change IMAGE_BUILDINFO_VARS. > You /should/ be able to avoid this by simply adding something like > > IMAGE_BUILDINFO_VARS_append = " MACHINE DEVICE_MODEL DEVICE_TYPE" > or > IMAGE_BUILDINFO_VARS = "DISTRO DISTRO_VERSION MACHINE DEVICE_MODEL DEVICE_TYPE" > to local.conf. > > The first version should extend the value whereas the second should completely replace it. > This should work because image-buildinfo.bbclass used the ?= operator to set the variable. > For the same reason you should NOT use += to extend the variable, but should use _append instead. > > This should be easier to maintain when updating your 'version of yocto'. > > > NOTE: In /extreme/ summary this would mean > > Add the following to local.conf > INHERIT += "image-buildinfo" > DEVICE_MODEL = "some-extra-identifying-details" > IMAGE_BUILDINFO_VARS_append = " MACHINE DEVICE_MODEL" > > to get a /etc/build file in your resulting image with information similar to the build configuration summary bitbake outputs during a build. > > > >> -----Original Message----- >> From: yocto-bounces@yoctoproject.org [mailto:yocto- >> bounces@yoctoproject.org] On Behalf Of Eystein Måløy Stenberg >> Sent: Tuesday, November 10, 2015 8:29 PM >> To: Khem Raj >> Cc: yocto@yoctoproject.org >> Subject: Re: [yocto] Run-time discovery of machine for image compatibility >> check >> >> Thanks to everyone on the input on this issue. I eventually solved it by using an >> image feature called "buildinfo". >> >> In case someone come across a similar need in the future I've created these two >> blog post to advertise buildinfo it a bit more and show how to use it: >> >> * https://www.mender.io/blog/build-info-yocto-1 >> * https://www.mender.io/blog/build-info-yocto-2 >> >> On 30/09/15 17:45, Khem Raj wrote: >>> >>>> On Sep 30, 2015, at 2:31 PM, Eystein Måløy Stenberg <eystein@mender.io> >> wrote: >>>> >>>> Hi, >>>> >>>> Before starting a bitbake build, we input the MACHINE variable in >>>> local.conf (e.g. MACHINE ?= beaglebone). >>>> >>>> Is there a way to detect this variable at run-time? I.e. if I have >>>> built the image, written it to a device, and I'm now logged in to it. >>> >>> There is no standard bill of materials that you will find on images. >>> Everyone produces it per own needs. The reason is that we do not have >>> a one OTA mechanism recommended or preferred in OpenEmbedded or >>> maintained by yocto project. May be this could be a thing to consider >>> come future right now, there were other big fish to fry around workflow. OTA >> firmware upgrade, could be big thing for next release or there after. >>> >>> I don’t have a better answer for you at the moment. You have to work >>> with device firmware manufacturer and see if they have put some image info >> into the image in some form. >>> >>>> >>>> The reason I want this is that I'm working on a project to deploy >>>> image updates (remotely), and I only want to write the image if the >>>> device is compatible with the image file. So I need to know both the >>>> hardware/board type and what the image target is (assuming this is >>>> the MACHINE variable alone). Then I will only write the image if they >>>> are the same. >>>> >>>> Also, do you think using the MACHINE variable is the right approach >>>> for this problem? Maybe someone has had a similar problem? >>>> >>>> I'm new to Yocto, sorry if I'm asking something obvious (but I could >>>> not find an answer in the docs). >>>> >>>> Thanks! >>>> >>>> -- >>>> >>>> Eystein >>>> -- >>>> _______________________________________________ >>>> yocto mailing list >>>> yocto@yoctoproject.org >>>> https://lists.yoctoproject.org/listinfo/yocto >>> >> >> -- >> >> Eystein >> -- >> _______________________________________________ >> yocto mailing list >> yocto@yoctoproject.org >> https://lists.yoctoproject.org/listinfo/yocto > > ________________________________ > > Notice to recipient: This email is meant for only the intended recipient of the transmission, and may be a communication privileged by law, subject to export control restrictions or that otherwise contains proprietary information. If you receive this email by mistake, please notify us immediately by replying to this message and then destroy it and do not review, disclose, copy or distribute it. Thank you in advance for your cooperation. > -- Eystein ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-11-14 2:12 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-09-30 21:31 Run-time discovery of machine for image compatibility check Eystein Måløy Stenberg 2015-09-30 23:42 ` Daniel. 2015-10-01 0:45 ` Khem Raj 2015-11-11 2:28 ` Eystein Måløy Stenberg 2015-11-11 16:50 ` Smith, Virgil 2015-11-14 2:12 ` Eystein Måløy Stenberg
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.