diff mbox series

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

Message ID 1535108033-28056-1-git-send-email-paolo.pisati@canonical.com
State New
Headers show
Series [v2] UBUNTU: snapcraft.yaml: convert prepare, build and install to override-build | expand

Commit Message

Paolo Pisati Aug. 24, 2018, 10:53 a.m. UTC
While here, take care of a mismerge and remove the duplicated 'firmware' part.

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

Comments

Kleber Sacilotto de Souza Aug. 24, 2018, 11:10 a.m. UTC | #1
On 08/24/18 12:53, Paolo Pisati wrote:
> While here, take care of a mismerge and remove the duplicated 'firmware' part.
> 
> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>

Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>

> ---
>  snapcraft.yaml | 20 +++-----------------
>  1 file changed, 3 insertions(+), 17 deletions(-)
> 
> diff --git a/snapcraft.yaml b/snapcraft.yaml
> index b873b68..f5181ce6 100644
> --- a/snapcraft.yaml
> +++ b/snapcraft.yaml
> @@ -17,25 +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
> -  firmware:
> -    plugin: nil
> -    stage-packages:
> -      - linux-firmware
> -    organize:
> -      lib/firmware: firmware
> -    prime:
> -      - -usr
> -      - -lib
> -    build-packages:
> -      - cpio
> -      - libssl-dev
> -      - dpkg-dev
> -    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:
> @@ -56,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
>
Kleber Sacilotto de Souza Aug. 24, 2018, 11:14 a.m. UTC | #2
On 08/24/18 12:53, Paolo Pisati wrote:
> While here, take care of a mismerge and remove the duplicated 'firmware' part.
> 
> Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
> ---
>  snapcraft.yaml | 20 +++-----------------
>  1 file changed, 3 insertions(+), 17 deletions(-)
> 
> diff --git a/snapcraft.yaml b/snapcraft.yaml
> index b873b68..f5181ce6 100644
> --- a/snapcraft.yaml
> +++ b/snapcraft.yaml
> @@ -17,25 +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
> -  firmware:
> -    plugin: nil
> -    stage-packages:
> -      - linux-firmware
> -    organize:
> -      lib/firmware: firmware
> -    prime:
> -      - -usr
> -      - -lib
> -    build-packages:
> -      - cpio
> -      - libssl-dev
> -      - dpkg-dev
> -    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:
> @@ -56,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
> 

Applied to xenial/raspi2 branch, adding the missing BugLink reference.

Thanks,
Kleber
diff mbox series

Patch

diff --git a/snapcraft.yaml b/snapcraft.yaml
index b873b68..f5181ce6 100644
--- a/snapcraft.yaml
+++ b/snapcraft.yaml
@@ -17,25 +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
-  firmware:
-    plugin: nil
-    stage-packages:
-      - linux-firmware
-    organize:
-      lib/firmware: firmware
-    prime:
-      - -usr
-      - -lib
-    build-packages:
-      - cpio
-      - libssl-dev
-      - dpkg-dev
-    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:
@@ -56,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