@@ -84,22 +84,9 @@ deploy_build () {
84
84
cp -v " $YOCTO_BUILD_DEPLOY /kernel_modules_headers.tar.gz" " $_deploy_dir " || true
85
85
cp -v " $YOCTO_BUILD_DEPLOY /kernel_source.tar.gz" " $_deploy_dir " || true
86
86
cp -v " $MACHINE .svg" " $_deploy_dir /logo.svg"
87
- if [ " ${_compressed} " != ' true' ]; then
88
- # uncompressed, just copy and we're done
89
- cp -v $( readlink --canonicalize " $YOCTO_BUILD_DEPLOY /$_deploy_artifact " ) " $_deploy_dir /image/balena.img"
90
- if [ -n " $_deploy_flasher_artifact " ]; then
91
- cp -v " $_deploy_dir /image/balena.img" " $_deploy_dir /image/balena-raw.img"
92
- cp -v $( readlink --canonicalize " $YOCTO_BUILD_DEPLOY /$_deploy_flasher_artifact " ) " $_deploy_dir /image/balena-flasher.img"
93
- elif [ " $_image " = " resin-image-flasher" ]; then
94
- # backwards compatibility - deployFlasherArtifact is not set and deployArtifact contains flasher
95
- cp -v " $_deploy_dir /image/balena.img" " $_deploy_dir /image/balena-flasher.img"
96
- else
97
- cp -v " $_deploy_dir /image/balena.img" " $_deploy_dir /image/balena-raw.img"
98
- fi
99
- return
100
- fi
101
87
102
- if [ " ${_archive} " = ' true' ]; then
88
+ if [ " ${_archive} " = ' true' ] && [ " ${_compressed} " = ' true' ]; then
89
+ # Archive and we are done
103
90
cp -rv " $YOCTO_BUILD_DEPLOY " /" $_deploy_artifact " /* " $_deploy_dir " /image/
104
91
(cd " $_deploy_dir /image/" && zip -r " ../$_deploy_artifact .zip" .)
105
92
if [ -n " $_deploy_flasher_artifact " ]; then
@@ -109,28 +96,40 @@ deploy_build () {
109
96
if [ " $_remove_compressed_file " = " true" ]; then
110
97
rm -rf $_deploy_dir /image
111
98
fi
99
+ return
100
+ fi
101
+
102
+ cp -v $( readlink --canonicalize " $YOCTO_BUILD_DEPLOY /$_deploy_artifact " ) " $_deploy_dir /image/balena-raw.img"
103
+ if [ -n " $_deploy_flasher_artifact " ]; then
104
+ cp -v $( readlink --canonicalize " $YOCTO_BUILD_DEPLOY /$_deploy_flasher_artifact " ) " $_deploy_dir /image/balena-flasher.img"
105
+ elif [ " $_image " = " resin-image-flasher" ]; then
106
+ # deployFlasherArtifact is not set and deployArtifact contains flasher
107
+ mv " $_deploy_dir /image/balena-raw.img" " $_deploy_dir /image/balena-flasher.img"
108
+ fi
109
+
110
+ # Create the unflagged balena.img for backwards compatibility
111
+ if [ " $_image " = " resin-image-flasher" ]; then
112
+ cp -v " $_deploy_dir /image/balena-flasher.img" " $_deploy_dir /image/balena.img"
112
113
else
113
- cp -v $( readlink --canonicalize " $YOCTO_BUILD_DEPLOY /$_deploy_artifact " ) " $_deploy_dir /image/balena.img"
114
- (cd " $_deploy_dir /image" && zip balena.img.zip balena.img)
115
- if [ -n " $_deploy_flasher_artifact " ]; then
116
- cp -v " $_deploy_dir /image/balena.img" " $_deploy_dir /image/balena-raw.img"
117
- (cd " $_deploy_dir /image" && zip balena-raw.img.zip balena-raw.img)
118
- cp -v $( readlink --canonicalize " $YOCTO_BUILD_DEPLOY /$_deploy_flasher_artifact " ) " $_deploy_dir /image/balena-flasher.img"
119
- (cd " $_deploy_dir /image" && zip balena-flasher.img.zip balena-flasher.img)
120
- elif [ " $_image " = " resin-image-flasher" ]; then
121
- # backwards compatibility - deployFlasherArtifact is not set and deployArtifact contains flasher
122
- cp -v " $_deploy_dir /image/balena.img" " $_deploy_dir /image/balena-flasher.img"
123
- (cd " $_deploy_dir /image" && zip balena-flasher.img.zip balena-flasher.img)
124
- else
125
- cp -v " $_deploy_dir /image/balena.img" " $_deploy_dir /image/balena-raw.img"
126
- (cd " $_deploy_dir /image" && zip balena-raw.img.zip balena-raw.img)
114
+ cp -v " $_deploy_dir /image/balena-raw.img" " $_deploy_dir /image/balena.img"
115
+ fi
116
+
117
+ if [ " ${_compressed} " != ' true' ]; then
118
+ # uncompressed, just copy and we're done
119
+ return
120
+ fi
121
+
122
+ for filename in balena.img balena-raw.img balena-flasher.img; do
123
+ if [ ! -f " $_deploy_dir /image/$filename " ]; then
124
+ continue
127
125
fi
126
+
127
+ (cd " $_deploy_dir /image" && zip " $filename .zip" " $filename " )
128
+
128
129
if [ " $_remove_compressed_file " = " true" ]; then
129
- rm -rf $_deploy_dir /image/balena.img
130
- rm -rf $_deploy_dir /image/balena-raw.img
131
- rm -rf $_deploy_dir /image/balena-flasher.img
130
+ rm -rf " $_deploy_dir /image/$filename "
132
131
fi
133
- fi
132
+ done
134
133
135
134
if [ -d " ${WORKSPACE} /layers/meta-balena/tests" ]
136
135
then
0 commit comments