github.com/canonical/ubuntu-image@v0.0.0-20240430122802-2202fe98b290/internal/statemachine/testdata/gadget_tree_piboot/snap/snapcraft.yaml (about)

     1  name: pi
     2  version: 22-2
     3  summary: Raspberry Pi gadget
     4  description: |
     5    Support files for booting Raspberry Pi.
     6    This gadget snap supports the Raspberry Pi 2B, 3B, 3A+, 3B+, 4B, Compute
     7    Module 3, and the Compute Module 3+ universally.
     8  type: gadget
     9  base: core22
    10  assumes: [kernel-assets]
    11  architectures:
    12    - build-on: [amd64, arm64]
    13      run-on: arm64
    14  
    15  package-repositories:
    16    - type: apt
    17      ppa: snappy-dev/image
    18  
    19  confinement: strict
    20  grade: devel
    21  parts:
    22    gadget:
    23      plugin: nil
    24      source: .
    25      override-build: |
    26        set -x
    27        # unconditionally set the arch-triplet since this snapcraft.yaml will 
    28        # always be used to produce an armhf snap
    29        BUILD_ARCH_TRIPLET=aarch64-linux-gnu
    30        # but only use the cross-compiling sources when actually cross compiling
    31        # as otherwise its just safer to use the build environment - it offers
    32        # much more flexibility.
    33        if [ "$SNAPCRAFT_ARCH_TRIPLET" = "x86_64-linux-gnu" ] || [ -z "$SNAPCRAFT_ARCH_TRIPLET" ]; then
    34          OPTIONAL_ARGS="SERIES_HOST=\"focal\" SOURCES_HOST=\"./helpers/cross-sources.list\" SOURCES_D_HOST=\"./helpers\""
    35        fi
    36        make -C $SNAPCRAFT_PART_SRC core \
    37          DESTDIR=${SNAPCRAFT_PART_INSTALL} \
    38          ARCH="$(dpkg-architecture -t $BUILD_ARCH_TRIPLET -q DEB_HOST_ARCH)" \
    39          ${OPTIONAL_ARGS:-}
    40      prime:
    41        - boot-assets/*
    42        - piboot.conf
    43        - cmdline.txt
    44        - config.txt
    45      build-packages:
    46        - lsb-release
    47        - dpkg-dev
    48        - make
    49    psplash-local:
    50      plugin: dump
    51      prime: [-*]
    52      source: .
    53      stage: [psplash]
    54    psplash:
    55      after: [psplash-local]
    56      source-type: git
    57      source: https://git.yoctoproject.org/psplash
    58      source-commit: 2015f7073e98dd9562db0936a254af5ef56356cf
    59      plugin: nil
    60      override-build: |
    61        set -x
    62        if [ "$SNAPCRAFT_ARCH_TRIPLET" = "x86_64-linux-gnu" ] || [ -z "$SNAPCRAFT_ARCH_TRIPLET" ]; then
    63          # manually set since new snapcraft doesn't like --target-arch when 
    64          # building with lxd/multipass
    65          BUILD_ARCH_TRIPLET=aarch64-linux-gnu
    66        else
    67          BUILD_ARCH_TRIPLET=$SNAPCRAFT_ARCH_TRIPLET
    68        fi
    69        export TREE="${SNAPCRAFT_STAGE:-.}/psplash"
    70        . ${TREE}/config
    71        if ! $(echo "$FONT" | grep -q ^/); then
    72          FONT="${TREE}/${FONT}"
    73        fi
    74        if ! $(echo "$SPLASH" | grep -q ^/); then
    75          SPLASH="${TREE}/${SPLASH}"
    76        fi
    77        git apply ${TREE}/psplash.patch
    78        ${TREE}/font-gen.sh "$FONT"
    79        ./make-image-header.sh "$SPLASH" CORE psplash-core
    80        aclocal
    81        autoreconf --install
    82        if ! dpkg-architecture -t "${SNAPCRAFT_ARCH_TRIPLET}" -e \
    83            $(dpkg-architecture -q DEB_BUILD_ARCH)
    84        then
    85          export CROSS_COMPILE=$(dpkg-architecture \
    86            -t "${BUILD_ARCH_TRIPLET}" -q DEB_HOST_GNU_TYPE)-
    87        else
    88          export CROSS_COMPILE=
    89        fi
    90        ./configure --build=$(dpkg-architecture -q DEB_BUILD_GNU_TYPE) \
    91          --host=${BUILD_ARCH_TRIPLET} CC=${CROSS_COMPILE}gcc || cat config.log
    92        ARCH=$(dpkg-architecture -t "${BUILD_ARCH_TRIPLET}" -q DEB_HOST_ARCH) make
    93        rm -rf $SNAPCRAFT_PART_INSTALL/usr
    94        cp -a $TREE/initrd .
    95        mkdir -p initrd/bin
    96        cp psplash initrd/bin
    97        mkdir -p $SNAPCRAFT_PART_INSTALL/boot-assets
    98        cd initrd && find . | cpio --quiet -o -H newc | lz4 -9 -l >> \
    99          "${SNAPCRAFT_PART_INSTALL}/boot-assets/psplash.img"
   100      build-packages:
   101        - libgdk-pixbuf2.0-dev
   102        - automake
   103        - autoconf
   104        - gcc
   105        - otf2bdf
   106        - libbogl-dev
   107        - ttf-ubuntu-font-family
   108        - cpio
   109        - findutils
   110        - liblz4-tool
   111        - libc-dev
   112        - try:
   113            - gcc-aarch64-linux-gnu:amd64
   114            - libc6-dev-arm64-cross:amd64
   115  
   116  slots:
   117    bcm-gpio-0:
   118      interface: gpio
   119      number: 0
   120    bcm-gpio-1:
   121      interface: gpio
   122      number: 1
   123    bcm-gpio-2:
   124      interface: gpio
   125      number: 2
   126    bcm-gpio-3:
   127      interface: gpio
   128      number: 3
   129    bcm-gpio-4:
   130      interface: gpio
   131      number: 4
   132    bcm-gpio-5:
   133      interface: gpio
   134      number: 5
   135    bcm-gpio-6:
   136      interface: gpio
   137      number: 6
   138    bcm-gpio-7:
   139      interface: gpio
   140      number: 7
   141    bcm-gpio-8:
   142      interface: gpio
   143      number: 8
   144    bcm-gpio-9:
   145      interface: gpio
   146      number: 9
   147    bcm-gpio-10:
   148      interface: gpio
   149      number: 10
   150    bcm-gpio-11:
   151      interface: gpio
   152      number: 11
   153    bcm-gpio-12:
   154      interface: gpio
   155      number: 12
   156    bcm-gpio-13:
   157      interface: gpio
   158      number: 13
   159    bcm-gpio-14:
   160      interface: gpio
   161      number: 14
   162    bcm-gpio-15:
   163      interface: gpio
   164      number: 15
   165    bcm-gpio-16:
   166      interface: gpio
   167      number: 16
   168    bcm-gpio-17:
   169      interface: gpio
   170      number: 17
   171    bcm-gpio-18:
   172      interface: gpio
   173      number: 18
   174    bcm-gpio-19:
   175      interface: gpio
   176      number: 19
   177    bcm-gpio-20:
   178      interface: gpio
   179      number: 20
   180    bcm-gpio-21:
   181      interface: gpio
   182      number: 21
   183    bcm-gpio-22:
   184      interface: gpio
   185      number: 22
   186    bcm-gpio-23:
   187      interface: gpio
   188      number: 23
   189    bcm-gpio-24:
   190      interface: gpio
   191      number: 24
   192    bcm-gpio-25:
   193      interface: gpio
   194      number: 25
   195    bcm-gpio-26:
   196      interface: gpio
   197      number: 26
   198    bcm-gpio-27:
   199      interface: gpio
   200      number: 27
   201    i2c-0:
   202      interface: i2c
   203      path: /dev/i2c-0
   204    i2c-1:
   205      interface: i2c
   206      path: /dev/i2c-1
   207    i2c-2:
   208      interface: i2c
   209      path: /dev/i2c-2
   210    i2c-3:
   211      interface: i2c
   212      path: /dev/i2c-3
   213    i2c-4:
   214      interface: i2c
   215      path: /dev/i2c-4
   216    i2c-5:
   217      interface: i2c
   218      path: /dev/i2c-5
   219    i2c-6:
   220      interface: i2c
   221      path: /dev/i2c-6
   222    bt-serial:
   223      interface: serial-port
   224      path: /dev/ttyAMA0
   225    serial0:
   226      interface: serial-port
   227      path: /dev/ttyS0
   228    serial1:
   229      interface: serial-port
   230      path: /dev/ttyS1
   231    serial2:
   232      interface: serial-port
   233      path: /dev/ttyS2
   234    serial3:
   235      interface: serial-port
   236      path: /dev/ttyS3
   237    serial4:
   238      interface: serial-port
   239      path: /dev/ttyS4
   240    serial5:
   241      interface: serial-port
   242      path: /dev/ttyS5
   243    serial6:
   244      interface: serial-port
   245      path: /dev/ttyS6
   246    serial7:
   247      interface: serial-port
   248      path: /dev/ttyS7
   249    serial8:
   250      interface: serial-port
   251      path: /dev/ttyS8
   252    serial9:
   253      interface: serial-port
   254      path: /dev/ttyS9
   255    spidev0:
   256      interface: spi
   257      path: /dev/spidev0.0
   258    spidev1:
   259      interface: spi
   260      path: /dev/spidev0.1
   261    spidev1-0:
   262      interface: spi
   263      path: /dev/spidev1.0
   264    spidev1-1:
   265      interface: spi
   266      path: /dev/spidev1.1
   267    spidev2-0:
   268      interface: spi
   269      path: /dev/spidev2.0
   270    spidev2-1:
   271      interface: spi
   272      path: /dev/spidev2.1
   273    spidev3-0:
   274      interface: spi
   275      path: /dev/spidev3.0
   276    spidev3-1:
   277      interface: spi
   278      path: /dev/spidev3.1
   279    spidev4-0:
   280      interface: spi
   281      path: /dev/spidev4.0
   282    spidev4-1:
   283      interface: spi
   284      path: /dev/spidev4.1
   285    spidev5-0:
   286      interface: spi
   287      path: /dev/spidev5.0
   288    spidev5-1:
   289      interface: spi
   290      path: /dev/spidev5.1
   291    spidev6-0:
   292      interface: spi
   293      path: /dev/spidev6.0
   294    spidev6-1:
   295      interface: spi
   296      path: /dev/spidev6.1
   297    pwm0:
   298      interface: pwm
   299      chip-number: 0
   300      channel: 0
   301    pwm1:
   302      interface: pwm
   303      chip-number: 0
   304      channel: 1