aboutsummaryrefslogtreecommitdiff
path: root/96boards-reference-grub-efi-arm64.yaml
blob: 797182cdf3d3bf657e34dd114874523385f49791 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
- job:
    name: 96boards-reference-grub-efi-arm64
    project-type: freestyle
    defaults: global
    logrotate:
        daysToKeep: 30
        numToKeep: 30
    properties:
        - authorization:
            anonymous:
                - job-read
                - job-extended-read
                - job-workspace
            linaro:
                - job-read
                - job-extended-read
                - job-build
                - job-cancel
    disabled: false
    node: docker-jessie-arm64
    display-name: 'DELETE ME'
    wrappers:
        - timestamps
    builders:
        - linaro-publish-token
        - shell: |
            #!/bin/bash

            set -ex

            trap cleanup_exit INT TERM EXIT

            cleanup_exit()
            {
              cd ${WORKSPACE}
              rm -rf out
            }

            GRUB_EFI_BIN_PKG=grub-efi-arm64-bin
            echo "deb http://repo.linaro.org/ubuntu/linaro-overlay jessie main" > local.list
            sudo cp local.list /etc/apt/sources.list.d/
            sudo apt-get update
            sudo apt-get install -y --no-install-recommends $GRUB_EFI_BIN_PKG python-requests

            mkdir out

            cat << EOF > out/grub.configfile
            search.fs_label rootfs root
            set prefix=(\$root)'/boot/grub'
            configfile \$prefix/grub.cfg
            EOF

            cat << EOF > out/grub-sd.configfile
            set root=(hd1,msdos2)
            set prefix=(\$root)'/boot/grub'
            configfile \$prefix/grub.cfg
            EOF

            GRUB_MODULES="boot chain configfile echo efinet eval ext2 fat font gettext gfxterm gzio help linux loadenv lsefi normal part_gpt part_msdos read regexp search search_fs_file search_fs_uuid search_label terminal terminfo test tftp time"
            grub-mkimage \
              --verbose \
              --config=out/grub.configfile \
              --output=out/grubaa64.efi \
              --format=arm64-efi \
              $GRUB_MODULES

            grub-mkimage \
              --verbose \
              --config=out/grub-sd.configfile \
              --output=out/grubaa64-sd.efi \
              --format=arm64-efi \
              $GRUB_MODULES

            # Build information
            cat > out/HEADER.textile << EOF

            h4. Reference Platform - GRUB UEFI

            GRUB UEFI build consumed by the Reference Platform Builds

            Build Description:
            * Build URL: "$BUILD_URL":$BUILD_URL
            * Grub modules used:

            EOF
            echo -n "bc. " >> out/HEADER.textile
            echo $GRUB_MODULES >> out/HEADER.textile
            cat >> out/HEADER.textile << EOF

            * Grub config used (roofs search with label):

            EOF
            echo -n "bc. " >> out/HEADER.textile
            cat out/grub.configfile >> out/HEADER.textile
            cat >> out/HEADER.textile << EOF

            * Grub config used (sdcard):

            EOF
            echo -n "bc. " >> out/HEADER.textile
            cat out/grub-sd.configfile >> out/HEADER.textile
            cat >> out/HEADER.textile << EOF

            * $GRUB_EFI_BIN_PKG package:

            EOF
            echo -n "bc. " >> out/HEADER.textile
            apt-cache show $GRUB_EFI_BIN_PKG >> out/HEADER.textile

            # Create MD5SUMS file
            (cd out && md5sum g* > MD5SUMS.txt)

            # Publish
            test -d ${HOME}/bin || mkdir ${HOME}/bin
            wget https://git.linaro.org/ci/publishing-api.git/blob_plain/HEAD:/linaro-cp.py -O ${HOME}/bin/linaro-cp.py
            time python ${HOME}/bin/linaro-cp.py \
              --server ${PUBLISH_SERVER} \
              --link-latest \
              out reference-platform/components/grub/${BUILD_NUMBER}
    publishers:
        - email:
            recipients: 'fathi.boudra@linaro.org riku.voipio@linaro.org'