UBUNTU: snapcraft.yaml: convert prepare, build and install to override-build

Message ID 1533567046-18118-2-git-send-email-paolo.pisati@canonical.com
State New
Headers show
Series
  • UBUNTU: snapcraft.yaml: convert prepare, build and install to override-build
Related show

Commit Message

Paolo Pisati Aug. 6, 2018, 2:50 p.m.
BugLink: http://bugs.launchpad.net/bugs/1785647

Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
---
 snapcraft.yaml | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Stefan Bader Aug. 16, 2018, 9:15 a.m. | #1
On 06.08.2018 16:50, Paolo Pisati wrote:
> BugLink: http://bugs.launchpad.net/bugs/1785647
> 
> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
> ---
>  snapcraft.yaml | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/snapcraft.yaml b/snapcraft.yaml
> index a5b4147..f5181ce6 100644
> --- a/snapcraft.yaml
> +++ b/snapcraft.yaml
> @@ -17,12 +17,11 @@ parts:
>      kconfigflavour: raspi2
>      kconfigs:
>        - CONFIG_DEBUG_INFO=n
> +    kernel-image-target: zImage
>      override-build: |
>        cp debian/scripts/retpoline-extract-one \
>          $SNAPCRAFT_PART_BUILD/scripts/ubuntu-retpoline-extract-one
>        snapcraftctl build
> -    kernel-image-target: zImage
> -    install: |
>        tar -C $SNAPCRAFT_PART_INSTALL/dtbs -f $SNAPCRAFT_PART_INSTALL/dtbs/overlays.tgz -czv overlays
>        rm -rf $SNAPCRAFT_PART_INSTALL/dtbs/overlays
>    firmware:
> @@ -43,13 +42,13 @@ parts:
>      source: .
>      after:
>        - firmware
> -    prepare: |
> +    override-build: |
>        PKGS="http://ppa.launchpad.net/snappy-dev/image/ubuntu/dists/xenial/main/binary-armhf/Packages.gz"
>        PKGPATH="$(wget -q -O- $PKGS|zcat|grep-dctrl raspberrypi-wireless-firmware |\
>          grep Filename|tail -1| sed 's/^Filename: //')"
>        wget http://ppa.launchpad.net/snappy-dev/image/ubuntu/$PKGPATH
>        dpkg -x $(basename $PKGPATH) unpack/
> -    install: |
> +      snapcraftctl build
>        mkdir -p $SNAPCRAFT_PART_INSTALL/firmware/brcm
>        mv unpack/usr/share/doc/raspberrypi-wireless-firmware $SNAPCRAFT_PART_INSTALL/firmware/rpi-wlanfw-licenses
>        mv unpack/lib/firmware/brcm/* $SNAPCRAFT_PART_INSTALL/firmware/brcm
>

Patch

diff --git a/snapcraft.yaml b/snapcraft.yaml
index a5b4147..f5181ce6 100644
--- a/snapcraft.yaml
+++ b/snapcraft.yaml
@@ -17,12 +17,11 @@  parts:
     kconfigflavour: raspi2
     kconfigs:
       - CONFIG_DEBUG_INFO=n
+    kernel-image-target: zImage
     override-build: |
       cp debian/scripts/retpoline-extract-one \
         $SNAPCRAFT_PART_BUILD/scripts/ubuntu-retpoline-extract-one
       snapcraftctl build
-    kernel-image-target: zImage
-    install: |
       tar -C $SNAPCRAFT_PART_INSTALL/dtbs -f $SNAPCRAFT_PART_INSTALL/dtbs/overlays.tgz -czv overlays
       rm -rf $SNAPCRAFT_PART_INSTALL/dtbs/overlays
   firmware:
@@ -43,13 +42,13 @@  parts:
     source: .
     after:
       - firmware
-    prepare: |
+    override-build: |
       PKGS="http://ppa.launchpad.net/snappy-dev/image/ubuntu/dists/xenial/main/binary-armhf/Packages.gz"
       PKGPATH="$(wget -q -O- $PKGS|zcat|grep-dctrl raspberrypi-wireless-firmware |\
         grep Filename|tail -1| sed 's/^Filename: //')"
       wget http://ppa.launchpad.net/snappy-dev/image/ubuntu/$PKGPATH
       dpkg -x $(basename $PKGPATH) unpack/
-    install: |
+      snapcraftctl build
       mkdir -p $SNAPCRAFT_PART_INSTALL/firmware/brcm
       mv unpack/usr/share/doc/raspberrypi-wireless-firmware $SNAPCRAFT_PART_INSTALL/firmware/rpi-wlanfw-licenses
       mv unpack/lib/firmware/brcm/* $SNAPCRAFT_PART_INSTALL/firmware/brcm