From c20afb45728242b2d72cefc58680576e2051cee3 Mon Sep 17 00:00:00 2001 From: Patrick Liu Date: Fri, 5 Mar 2021 18:00:10 +0800 Subject: Update buildstamp paths again after alignment --- units/info/jobs.pxu | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) (limited to 'units/info') diff --git a/units/info/jobs.pxu b/units/info/jobs.pxu index 2693598..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 /etc/buildstamp ]; then - cat /etc/buildstamp - elif [ -s /.disk/info ]; then - cat /.disk/info - 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 -- cgit v1.2.3