2

I want to create an image that boots up believing that it's in the year 2038 so I can test some epoch stuff on my company's product.

I'm going about this by trying to force a value on the /etc/timestamp file. I'm not sure that's a great strategy for this goal; so if it isn't then I'll ask a separate question about what approach I should take.

I found that image.bbclass has a function called rootfs_upate_timestamp, so I thought to inherit that class and overwrite the function.

Here's the recipe I created. It's located in ./meta-custom-base/recipes-stuff/custom-timestamp/ .

# custom-timestamp.bb

inherit image

rootfs_update_timestamp() {
    echo "20380119000000" > ${IMAGE_ROOTFS}/etc/timestamp
}

The error is a massive wall of red-colored package names, and at the top it reads custom-timestamp is not a part of the base feeds

This layer has other recipes that are getting installed, and I've also added a line to the *image.bbappend like

IMAGE_INSTALL_append = " other-package-that-installs-fine"
IMAGE_INSTALL_append = " custom-timestamp"

So why am I getting this error, and how can I ensure my custom /etc/timestamp gets installed?

DeepDeadpool
  • 1,441
  • 12
  • 36

2 Answers2

0

i think this is a packaging problem, see Martin Jansa's answer in https://yocto.yoctoproject.narkive.com/9Ceqiqs9/error-gtest-not-found-in-the-base-feed for solution (add RDEPENDS_$custom-timestamp="" ) :

That's correct, all files are installed in gtest-dev package.

The problem is the default RDEPENDS from ${PN}-dev to ${PN}

meta/conf/bitbake.conf:RDEPENDS_${PN}-dev = "${PN} (= ${EXTENDPKGV})"

You can either set ALLOW_EMPTY_${PN} = "1" or RDEPENDS_${PN}-dev = ""

Also see bitbake error package not found in base feeds

i am not sure if you can override timestamp with this ...

ralf htp
  • 9,149
  • 4
  • 22
  • 34
  • You're right in that ALLOW_EMPTY_${PN} = "1" fixes the error, but then I don't think the function ever gets called; none of my debugging file-ops ever seem to occur. I'll try the RDEPENDS – DeepDeadpool Apr 08 '19 at 15:49
  • i think you can not change the timestamp like this at all, this is not a bitbake problem, for this you have to at least patch the kernel / write custom kernel module and replace the default. Whenever Linux has network connectivity it gets the system time from an NTP server and so on... – ralf htp Apr 08 '19 at 17:02
0

My situation is only superficially different from this answer.

The difference is that I will be targeting the rootfs-postcommands.bbclass for its rootfs_update_timestamp method.

DeepDeadpool
  • 1,441
  • 12
  • 36