Naming images


Damien LEFEVRE
 

Hi,

In my build system the generated images are in this format:

imagename-machine-timestamp.img

For release builds, I'd like to replace the time stamp with the image version. I could rename the image after the build but is there a better way?

I found a BUILDNAME variable but it has no effect.

Also should the timestamp written in /etc/version match the one from the image name?

For some reason for me it doesn't. /etc/version is 20180309123456 while the one from the image name is 20210329064542.

-Damien


Quentin Schulz
 

Hi Damien,

On Mon, Mar 29, 2021 at 03:33:09PM +0300, Damien LEFEVRE wrote:
Hi,

In my build system the generated images are in this format:

imagename-machine-timestamp.img

For release builds, I'd like to replace the time stamp with the image
version. I could rename the image after the build but is there a better way?
IMAGE_NAME variable is the one specifying the name which should be used
for the final image. c.f. https://docs.yoctoproject.org/ref-manual/variables.html#term-IMAGE_NAME

By default, its value is "${IMAGE_BASENAME}-${MACHINE}${IMAGE_VERSION_SUFFIX}"

IMAGE_VERSION_SUFFIX is by default set to "-${DATETIME}" as documented
here: https://docs.yoctoproject.org/ref-manual/variables.html#term-IMAGE_VERSION_SUFFIX

Therefore to put the image version, you just need to change
IMAGE_VERSION_SUFFIX to what you want it to contain.

Cheers,
Quentin


Damien LEFEVRE
 

Thanks Quentin! That's just what I needed.

Do you know if there's a variable to control the content of /etc/version?

Cheers,
-Damien

On Mon, Mar 29, 2021 at 4:14 PM Quentin Schulz <quentin.schulz@...> wrote:
Hi Damien,

On Mon, Mar 29, 2021 at 03:33:09PM +0300, Damien LEFEVRE wrote:
> Hi,
>
> In my build system the generated images are in this format:
>
> imagename-machine-timestamp.img
>
> For release builds, I'd like to replace the time stamp with the image
> version. I could rename the image after the build but is there a better way?
>

IMAGE_NAME variable is the one specifying the name which should be used
for the final image. c.f. https://docs.yoctoproject.org/ref-manual/variables.html#term-IMAGE_NAME

By default, its value is "${IMAGE_BASENAME}-${MACHINE}${IMAGE_VERSION_SUFFIX}"

IMAGE_VERSION_SUFFIX is by default set to "-${DATETIME}" as documented
here: https://docs.yoctoproject.org/ref-manual/variables.html#term-IMAGE_VERSION_SUFFIX

Therefore to put the image version, you just need to change
IMAGE_VERSION_SUFFIX to what you want it to contain.

Cheers,
Quentin