summaryrefslogtreecommitdiff
diff options
authorPMR <pmr@pmr-lander>2021-03-25 08:34:26 +0000
committerPMR <pmr@pmr-lander>2021-03-25 08:34:26 +0000
commited4ddd3028057928e1d7320e78ab0ab7c69c7f7e (patch)
tree05b3176052ca336b7a4d052ea6c40c57c28dd58f
parent66ec706a40dbbbf31d8c8c766513819b5e89657c (diff)
parentc20afb45728242b2d72cefc58680576e2051cee3 (diff)
Merge #399054 from ~patliu/plainbox-provider-checkbox:update-buildstamp-path
Update buildstamp paths for iot and pc project
-rw-r--r--units/info/jobs.pxu35
1 files changed, 20 insertions, 15 deletions
diff --git a/units/info/jobs.pxu b/units/info/jobs.pxu
index ba6b376..40d31af 100644
--- a/units/info/jobs.pxu
+++ b/units/info/jobs.pxu
@@ -346,25 +346,30 @@ _description: Attaches information about disk partitions
plugin: attachment
category_id: com.canonical.plainbox::info
id: info/buildstamp
+template-engine: jinja2
estimated_duration: 0.1
_description: Attaches the buildstamp identifier for the OS
_summary: Attaches the buildstamp identifier for the OS
command:
- if [ -s /var/lib/ubuntu_dist_channel ]; then
- cat /var/lib/ubuntu_dist_channel
- elif [ -s /etc/buildstamp ]; then
- cat /etc/buildstamp
- elif [ -s /run/mnt/ubuntu-seed/.disk/info ]; then
- cat /run/mnt/ubuntu-seed/.disk/info
- elif [ -s /etc/media-info ]; then
- cat /etc/media-info
- elif [ -s /writable/system-data/etc/buildstamp ]; then
- cat /writable/system-data/etc/buildstamp
- elif [ -e /var/lib/snapd/seed/seed.yaml ]; then
- echo && date -r /var/lib/snapd/seed/seed.yaml -R
- else
- exit 1
- fi
+ {%- if __on_ubuntucore__ %}
+ if [ -s /run/mnt/ubuntu-seed/.disk/info ]; then
+ cat /run/mnt/ubuntu-seed/.disk/info
+ elif [ -s /writable/system-data/etc/buildstamp ]; then
+ cat /writable/system-data/etc/buildstamp
+ elif [ -e /var/lib/snapd/seed/seed.yaml ]; then
+ echo && date -r /var/lib/snapd/seed/seed.yaml -R
+ fi
+ {% else -%}
+ if [ -s /.disk/info ]; then # Ubuntu Classic
+ cat /.disk/info
+ elif [ -s /etc/media-info ]; then
+ cat /etc/media-info
+ elif [ -s /var/lib/ubuntu_dist_channel ]; then # PC projects
+ cat /var/lib/ubuntu_dist_channel
+ else
+ exit 1
+ fi
+ {% endif -%}
plugin: shell
category_id: com.canonical.plainbox::info