@@ -226,37 +226,57 @@ function build_odroid_h4 {
226
226
DEFCONFIG=" configs/config.hardkernel_odroid_h4"
227
227
FW_VERSION=$( cat ${DEFCONFIG} | grep CONFIG_LOCALVERSION | cut -d ' =' -f 2 | tr -d ' "' )
228
228
229
- # Without following sequence workspce would be created by docker with root
230
- # privilidges and build will fail.
231
- # Target directory
232
- TARGET_DIR=" payloads/external/edk2/workspace/Dasharo"
233
- mkdir -p " $TARGET_DIR "
234
- chown -R $( id -u) :$( id -g) " $TARGET_DIR "
235
- chmod -R 755 " $TARGET_DIR "
236
-
237
229
# checkout several submodules needed by these boards (some others are checked
238
230
# out by coreboot's Makefile)
239
231
git submodule update --init --force --checkout \
240
232
3rdparty/dasharo-blobs
241
233
242
- # do not do distclean, because it removes all downloaded artifacts
243
- docker run --rm -t -u $UID -v $PWD :/home/coreboot/coreboot \
244
- -v $HOME /.ssh:/home/coreboot/.ssh \
245
- --network none \
246
- ${EDK2_REPO_PATH: +-v $EDK2_REPO_PATH :/ home/ coreboot/ coreboot/ payloads/ external/ edk2/ workspace/ Dasharo} \
247
- -w /home/coreboot/coreboot ${DASHARO_SDK} \
248
- /bin/bash -c " make clean"
234
+ if [ " ${AIRGAP} " -eq 1 ]; then
235
+ docker run --rm -t -u $UID -v $PWD :/home/coreboot/coreboot \
236
+ -v $HOME /.ssh:/home/coreboot/.ssh \
237
+ -w /home/coreboot/coreboot ${DASHARO_SDK} \
238
+ /bin/bash -c " make clean"
239
+ else
240
+ docker run --rm -t -u $UID -v $PWD :/home/coreboot/coreboot \
241
+ -v $HOME /.ssh:/home/coreboot/.ssh \
242
+ -w /home/coreboot/coreboot ${DASHARO_SDK} \
243
+ /bin/bash -c " make distclean"
244
+ fi
249
245
250
246
cp $DEFCONFIG .config
251
247
252
248
echo " Building Dasharo compatbile with Hardkernel ODROID H4 (version $FW_VERSION )"
253
249
254
- docker run --rm -t -u $UID -v $PWD :/home/coreboot/coreboot \
255
- -v $HOME /.ssh:/home/coreboot/.ssh \
256
- --network none \
257
- ${EDK2_REPO_PATH: +-v $EDK2_REPO_PATH :/ home/ coreboot/ coreboot/ payloads/ external/ edk2/ workspace/ Dasharo} \
258
- -w /home/coreboot/coreboot ${DASHARO_SDK} \
259
- /bin/bash -c " make olddefconfig && make -j$( nproc) "
250
+ if [ " ${AIRGAP} " -eq 1 ]; then
251
+
252
+ # In this situation we assume that provided repository is ready to be used
253
+ # and nothing should be downloaded during build process.
254
+
255
+ if [ -d " ${EDK2_REPO_PATH} " ]; then
256
+ # Without following sequence workspce would be created by docker with root
257
+ # privilidges and build will fail.
258
+ # Target directory
259
+ TARGET_DIR=" payloads/external/edk2/workspace/Dasharo"
260
+ mkdir -p " $TARGET_DIR "
261
+ chown -R $( id -u) :$( id -g) " $TARGET_DIR "
262
+ chmod -R 755 " $TARGET_DIR "
263
+ docker run --rm -t -u $UID -v $PWD :/home/coreboot/coreboot \
264
+ -v $HOME /.ssh:/home/coreboot/.ssh \
265
+ --network none \
266
+ ${EDK2_REPO_PATH: +-v $EDK2_REPO_PATH :/ home/ coreboot/ coreboot/ payloads/ external/ edk2/ workspace/ Dasharo} \
267
+ -e BUILD_TIMELESS=${BUILD_TIMELESS} \
268
+ -w /home/coreboot/coreboot ${DASHARO_SDK} \
269
+ /bin/bash -c " make olddefconfig && make -j$( nproc) "
270
+ else
271
+ echo " EDK2_REPO_PATH is not defined in AIRGAP!"
272
+ exit 1
273
+ fi
274
+ else
275
+ docker run --rm -t -u $UID -v $PWD :/home/coreboot/coreboot \
276
+ -v $HOME /.ssh:/home/coreboot/.ssh \
277
+ -w /home/coreboot/coreboot ${DASHARO_SDK} \
278
+ /bin/bash -c " make olddefconfig && make -j$( nproc) "
279
+ fi
260
280
261
281
cp build/coreboot.rom hardkernel_odroid_h4_${FW_VERSION} .rom
262
282
if [ $? -eq 0 ]; then
@@ -272,37 +292,57 @@ function build_odroid_h4_btg {
272
292
DEFCONFIG=" configs/config.hardkernel_odroid_h4_btg"
273
293
FW_VERSION=$( cat ${DEFCONFIG} | grep CONFIG_LOCALVERSION | cut -d ' =' -f 2 | tr -d ' "' )
274
294
275
- # Without following sequence workspce would be created by docker with root
276
- # privilidges and build will fail.
277
- # Target directory
278
- TARGET_DIR=" payloads/external/edk2/workspace/Dasharo"
279
- mkdir -p " $TARGET_DIR "
280
- chown -R $( id -u) :$( id -g) " $TARGET_DIR "
281
- chmod -R 755 " $TARGET_DIR "
282
-
283
295
# checkout several submodules needed by these boards (some others are checked
284
296
# out by coreboot's Makefile)
285
297
git submodule update --init --force --checkout \
286
298
3rdparty/dasharo-blobs
287
299
288
- # do not do distclean, because it removes all downloaded artifacts
289
- docker run --rm -t -u $UID -v $PWD :/home/coreboot/coreboot \
290
- -v $HOME /.ssh:/home/coreboot/.ssh \
291
- --network none \
292
- ${EDK2_REPO_PATH: +-v $EDK2_REPO_PATH :/ home/ coreboot/ coreboot/ payloads/ external/ edk2/ workspace/ Dasharo} \
293
- -w /home/coreboot/coreboot ${DASHARO_SDK} \
294
- /bin/bash -c " make clean"
300
+ if [ " ${AIRGAP} " -eq 1 ]; then
301
+ docker run --rm -t -u $UID -v $PWD :/home/coreboot/coreboot \
302
+ -v $HOME /.ssh:/home/coreboot/.ssh \
303
+ -w /home/coreboot/coreboot ${DASHARO_SDK} \
304
+ /bin/bash -c " make clean"
305
+ else
306
+ docker run --rm -t -u $UID -v $PWD :/home/coreboot/coreboot \
307
+ -v $HOME /.ssh:/home/coreboot/.ssh \
308
+ -w /home/coreboot/coreboot ${DASHARO_SDK} \
309
+ /bin/bash -c " make distclean"
310
+ fi
295
311
296
312
cp $DEFCONFIG .config
297
313
298
314
echo " Building Dasharo compatbile with Hardkernel ODROID H4 (version $FW_VERSION )"
299
315
300
- docker run --rm -t -u $UID -v $PWD :/home/coreboot/coreboot \
301
- -v $HOME /.ssh:/home/coreboot/.ssh \
302
- --network none \
303
- ${EDK2_REPO_PATH: +-v $EDK2_REPO_PATH :/ home/ coreboot/ coreboot/ payloads/ external/ edk2/ workspace/ Dasharo} \
304
- -w /home/coreboot/coreboot ${DASHARO_SDK} \
305
- /bin/bash -c " make olddefconfig && make -j$( nproc) "
316
+ if [ " ${AIRGAP} " -eq 1 ]; then
317
+
318
+ # In this situation we assume that provided repository is ready to be used
319
+ # and nothing should be downloaded during build process.
320
+
321
+ if [ -d " ${EDK2_REPO_PATH} " ]; then
322
+ # Without following sequence workspce would be created by docker with root
323
+ # privilidges and build will fail.
324
+ # Target directory
325
+ TARGET_DIR=" payloads/external/edk2/workspace/Dasharo"
326
+ mkdir -p " $TARGET_DIR "
327
+ chown -R $( id -u) :$( id -g) " $TARGET_DIR "
328
+ chmod -R 755 " $TARGET_DIR "
329
+ docker run --rm -t -u $UID -v $PWD :/home/coreboot/coreboot \
330
+ -v $HOME /.ssh:/home/coreboot/.ssh \
331
+ --network none \
332
+ ${EDK2_REPO_PATH: +-v $EDK2_REPO_PATH :/ home/ coreboot/ coreboot/ payloads/ external/ edk2/ workspace/ Dasharo} \
333
+ -e BUILD_TIMELESS=${BUILD_TIMELESS} \
334
+ -w /home/coreboot/coreboot ${DASHARO_SDK} \
335
+ /bin/bash -c " make olddefconfig && make -j$( nproc) "
336
+ else
337
+ echo " EDK2_REPO_PATH is not defined in AIRGAP!"
338
+ exit 1
339
+ fi
340
+ else
341
+ docker run --rm -t -u $UID -v $PWD :/home/coreboot/coreboot \
342
+ -v $HOME /.ssh:/home/coreboot/.ssh \
343
+ -w /home/coreboot/coreboot ${DASHARO_SDK} \
344
+ /bin/bash -c " make olddefconfig && make -j$( nproc) "
345
+ fi
306
346
307
347
cp build/coreboot.rom hardkernel_odroid_h4_${FW_VERSION} .rom
308
348
if [ $? -eq 0 ]; then
0 commit comments