diff options
author | Patrick Liu <patrick.liu@canonical.com> | 2021-03-05 18:00:10 +0800 |
---|---|---|
committer | Patrick Liu <patrick.liu@canonical.com> | 2021-03-08 13:29:11 +0800 |
commit | c20afb45728242b2d72cefc58680576e2051cee3 (patch) | |
tree | ad20bc1edddbc4ca7b2517d84fedcf1d36d19678 /units/info | |
parent | 36dc75a2c98ca03f7b47a9b8515d88449c15c9d7 (diff) |
Update buildstamp paths again after alignment
Diffstat (limited to 'units/info')
-rw-r--r-- | units/info/jobs.pxu | 35 |
1 files changed, 20 insertions, 15 deletions
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 |