0

According to this page, one can pull the kernel sources from the following location in Google Cloud Storage.

gs://cos-tools/<build-number>/

I am trying to find the source for a running instance of the Container-Optimized OS, but I have not found documentation describing how to extract a build number from the running instance. The output of uname -r is 4.4.111+ but I do not know how to map this to a build number that I can use for pulling the source.

How does one find the build number?

merlin2011
  • 71,677
  • 44
  • 195
  • 329

2 Answers2

1

Inside the running COS instance, you can find the version in /etc/lsb-release.

$ cat /etc/lsb-release | grep CHROMEOS_RELEASE_VERSION
CHROMEOS_RELEASE_VERSION=10452.101.0

Then, in a machine with gsutil installed and configured

$ gsutil ls gs://cos-tools/10452.101.0/
gs://cos-tools/10452.101.0/kernel-src.tar.gz
gs://cos-tools/10452.101.0/kernel-src.tar.gz.md5
Yann C.
  • 1,315
  • 12
  • 17
0

The best way would be to look at /etc/os-release:

$ cat /etc/os-release | grep BUILD_ID
BUILD_ID=12607.7.0

See this Chromium OS design doc for more details of the meaning of all the fields in /etc/lsb-release and /etc/os-release in Chromium OS, and whether you can rely on it or not. Container-optimized OS is based on Chromium OS.

Xuewei Zhang
  • 496
  • 3
  • 10