Skip to content

Commit 4466018

Browse files
committed
v3.0
1 parent 6c24a2e commit 4466018

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1236
-382
lines changed

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,27 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
180180
- Improved method for downloading latest kernel firmware
181181
- Fixed Miscellaneous bugs
182182

183+
## [3.0.0] - 2022-08-23
184+
### Added
185+
- Added default option of IPXE based booting mechanism which enables a broader spectrum of hardware.
186+
- Enabled option for static IP addresses for specific MAC addresses to achieve scaling in farms.
187+
- Added option for disabling selected services while building.
188+
- Added options for enabling local path Git repository for profiles.
189+
190+
### Changed
191+
- Fixed ubuntu/alpine moving firmware retrieval mechanism
192+
- Fixed alpine UOS build
193+
- Fixed flashing progress on flash.usb
194+
- Improved network scanning for DHCP
195+
- Reduced the image size of the USB device for flashing
196+
- Enhanced Code Quality
197+
- Fixed Miscellaneous bugs
198+
199+
### Known Problem
200+
- Missing instructions of how to build the boot.wim, boot.sdi and BCD from Microsoft ADK
201+
202+
203+
183204

184205
[1.5.1]: https://github.com/intel/Edge-Software-Provisioner/compare/v1.5...v1.5.1
185206
[1.6.0]: https://github.com/intel/Edge-Software-Provisioner/compare/v1.5.1...v1.6
@@ -195,3 +216,4 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
195216
[2.5.2]: https://github.com/intel/Edge-Software-Provisioner/compare/v2.5.1...v2.5.2
196217
[2.5.3]: https://github.com/intel/Edge-Software-Provisioner/compare/v2.5.2...v2.5.3
197218
[2.5.4]: https://github.com/intel/Edge-Software-Provisioner/compare/v2.5.3...v2.5.4
219+
[3.0.0]: https://github.com/intel/Edge-Software-Provisioner/compare/v2.5.4...v3.0

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ Target Devices will be connected on the same LAN as the Edge Software Provisione
158158
docker-compose up -d
159159
```
160160

161-
To simplify further, you can use the example `examples/deply.sh` script to deploy Edge Software Provisioner in a one line command like the following example command (NOTE: you must move deploy.sh and the docker-compose.yml into your github repo for the following to work):
161+
To simplify further, you can use the example `examples/deploy.sh` script to deploy Edge Software Provisioner in a one line command like the following example command (NOTE: you must move deploy.sh and the docker-compose.yml into your github repo for the following to work):
162162
```bash
163163
wget -O- https://github.com/myuser/esp/raw/branch/master/deploy.sh | bash -s -
164164
```

build.sh

Lines changed: 118 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ printHelp() {
3333
printMsg " ${T_BOLD}-s${T_RESET}, --skip-build-uos Skips building the Micro Operating System (uOS)"
3434
printMsg " ${T_BOLD}-S${T_RESET}, --skip-image-builds Skips building all images and uOS"
3535
printMsg " ${T_BOLD}-e${T_RESET}, --skip-image-embedded Skips embedding custom files into uOS"
36+
printMsg " ${T_BOLD}-n${T_RESET}, --skip-net Skips network autodetection and verification"
37+
printMsg " ${T_BOLD}-g${T_RESET}, --skip-git Skips starting Gitea service"
3638
printMsg " ${T_BOLD}-k${T_RESET}, --uos-kernel Valid input value is [ intel | intel.signed | clearlinux | ubuntu | ubuntu.signed | fedora | redhat | alpine ]. Defaults to 'intel'. 'redhat' requires a licensed rhel system."
3739
printMsg " ${T_BOLD}-c${T_RESET}, --clean-uos will clean the intermediary docker images used during building of uOS"
3840
printMsg " ${T_BOLD}-b${T_RESET}, --skip-backups Skips the creation of backup files inside the data directory when re-running build.sh"
@@ -56,6 +58,8 @@ export SKIP_BACKUPS="false"
5658
export SKIP_PROFILES="false"
5759
export SKIP_PROFILE_BUILDS="false"
5860
export SKIP_PROFILE_EMBEDDED="false"
61+
export SKIP_NET="false"
62+
export SKIP_GIT="false"
5963
export SINGLE_PROFILE=""
6064
export BOOT_PROFILE=""
6165
export FROM_CONTAINER="false"
@@ -81,6 +85,10 @@ while (( "$#" )); do
8185
shift 1;;
8286
"-P" | "--skip-profiles" ) export SKIP_PROFILES="true"
8387
shift 1;;
88+
"-n" | "--skip-net" ) export SKIP_NET="true"
89+
shift 1;;
90+
"-g" | "--skip-git" ) export SKIP_GIT="true"
91+
shift 1;;
8492
"-k" | "--uos-kernel" ) export UOS_KERNEL=$2
8593
shift 2;;
8694
"-C" | "--from-container" ) export FROM_CONTAINER="true"
@@ -165,7 +173,7 @@ fi
165173
if [[ "${PUSH}" != "" ]]; then
166174
export BUILD_IMAGES="false"
167175
export SKIP_PROFILES="true"
168-
if (docker images | grep ${PUSH}/builder-core >/dev/null 2>&1); then
176+
if (docker images | grep ${PUSH}/builder-core > /dev/null 2>&1); then
169177
printBanner "Pushing container images. (NOTE: run 'docker login' first if login required otherwise this command will fail.)"
170178
logMsg "Pushing container images..."
171179
for image in $(docker images | grep ${PUSH}/builder- | grep -v none | awk '{print $1}'); do
@@ -221,7 +229,10 @@ getSecretInfo
221229
source "scripts/templateutils.sh"
222230

223231
if [[ ! -z "${builder_config_dynamic_profile_enabled+x}" ]]; then
224-
if [[ "${builder_config_dynamic_profile_enabled}" == "true" ]]; then
232+
if [[ "${builder_config_disable_dyn_profile-x}" == "true" ]] && [[ "${builder_config_dynamic_profile_enabled}" == "true" ]]; then
233+
printErrMsg "Dynamic Profile is enabled in 'conf/config.yml' but 'disable_dyn_profile' container build is set to 'true'. Please set 'disable_dyn_profile' to 'false' and run './build.sh -S' again."
234+
exit
235+
elif [[ "${builder_config_dynamic_profile_enabled}" == "true" ]]; then
225236
export DYNAMIC_PROFILE="true"
226237
fi
227238
fi
@@ -326,52 +337,72 @@ if [[ "${BUILD_IMAGES}" == "true" ]]; then
326337
# reduces the footprint of our application
327338

328339
# Build the aws-cli image
329-
run "(1/12) Building builder-aws-cli" \
330-
"docker build --rm ${DOCKER_BUILD_ARGS} -t builder-aws-cli dockerfiles/aws-cli" \
331-
${LOG_FILE}
332-
333-
# Build the wget image
334-
run "(2/12) Building builder-wget" \
335-
"docker build --rm ${DOCKER_BUILD_ARGS} -t builder-wget dockerfiles/wget" \
336-
${LOG_FILE}
340+
if [[ "${builder_config_disable_aws_cli-x}" == "true" ]]; then
341+
printMsg "(1/11) SKIPPING: Building builder-aws-cli"
342+
logMsg "(1/11) SKIPPING: Building builder-aws-cli"
343+
else
344+
run "(1/11) Building builder-aws-cli" \
345+
"docker build --rm ${DOCKER_BUILD_ARGS} -t builder-aws-cli dockerfiles/aws-cli" \
346+
${LOG_FILE}
347+
fi
337348

338349
# Build the git image
339-
run "(3/12) Building builder-git" \
350+
run "(2/11) Building builder-git" \
340351
"docker build --rm ${DOCKER_BUILD_ARGS} -t builder-git dockerfiles/git" \
341352
${LOG_FILE}
342353

343354
# Build the dnsmasq image
344-
run "(4/12) Building builder-dnsmasq (~10 min)" \
345-
"docker build --rm ${DOCKER_BUILD_ARGS} -t builder-dnsmasq dockerfiles/dnsmasq" \
346-
${LOG_FILE}
355+
if [[ "${builder_config_disable_dnsmasq-x}" == "true" ]]; then
356+
printMsg "(3/11) SKIPPING: Building builder-dnsmasq"
357+
logMsg "(3/11) SKIPPING: Building builder-dnsmasq"
358+
else
359+
run "(3/11) Building builder-dnsmasq (~10 min)" \
360+
"docker build --rm ${DOCKER_BUILD_ARGS} -t builder-dnsmasq dockerfiles/dnsmasq" \
361+
${LOG_FILE}
362+
fi
347363

348364
# Build the squid image
349-
run "(5/12) Building builder-squid" \
365+
run "(4/11) Building builder-squid" \
350366
"docker build --rm ${DOCKER_BUILD_ARGS} -t builder-squid dockerfiles/squid" \
351367
${LOG_FILE}
352368

353369
# Build the web image
354-
run "(6/12) Building builder-web" \
370+
run "(5/11) Building builder-web" \
355371
"docker build --rm ${DOCKER_BUILD_ARGS} -t builder-web dockerfiles/nginx" \
356372
${LOG_FILE}
357373

358374
# Build the gitea image
359-
run "(7/12) Building builder-gitea" \
360-
"docker build --rm ${DOCKER_BUILD_ARGS} -t builder-gitea dockerfiles/gitea" \
361-
${LOG_FILE}
375+
if [[ "${builder_config_disable_gitea-x}" == "true" ]]; then
376+
printMsg "(6/11) SKIPPING: Building builder-gitea"
377+
logMsg "(6/11) SKIPPING: Building builder-gitea"
378+
else
379+
run "(6/11) Building builder-gitea" \
380+
"docker build --rm ${DOCKER_BUILD_ARGS} -t builder-gitea dockerfiles/gitea" \
381+
${LOG_FILE}
382+
fi
362383

363384
# Build the qemu image
364-
run "(8/12) Building builder-qemu" \
365-
"docker build --rm ${DOCKER_BUILD_ARGS} -t builder-qemu dockerfiles/qemu" \
366-
${LOG_FILE}
385+
if [[ "${builder_config_disable_qemu-x}" == "true" ]]; then
386+
printMsg "(7/11) SKIPPING: Building builder-qemu"
387+
logMsg "(7/11) SKIPPING: Building builder-qemu"
388+
else
389+
run "(7/11) Building builder-qemu" \
390+
"docker build --rm ${DOCKER_BUILD_ARGS} -t builder-qemu dockerfiles/qemu" \
391+
${LOG_FILE}
392+
fi
367393

368394
# Build the smb image
369-
run "(9/12) Building builder-smb" \
370-
"docker build --rm ${DOCKER_BUILD_ARGS} -t builder-smb dockerfiles/smb" \
371-
${LOG_FILE}
395+
if [[ "${builder_config_disable_smb-x}" == "true" ]]; then
396+
printMsg "(8/11) SKIPPING: Building builder-smb"
397+
logMsg "(8/11) SKIPPING: Building builder-smb"
398+
else
399+
run "(8/11) Building builder-smb" \
400+
"docker build --rm ${DOCKER_BUILD_ARGS} -t builder-smb dockerfiles/smb" \
401+
${LOG_FILE}
402+
fi
372403

373404
# Build the core image
374-
run "(10/12) Building builder-core" \
405+
run "(9/11) Building builder-core" \
375406
"docker run -t --rm ${DOCKER_RUN_ARGS} --privileged -v $(pwd):/work alpine sh -c 'apk update && apk add --no-cache rsync && \
376407
cd /work && \
377408
mkdir -p dockerfiles/core/files/conf/ && \
@@ -381,31 +412,48 @@ if [[ "${BUILD_IMAGES}" == "true" ]]; then
381412
rsync -rtc ./scripts ./dockerfiles/core/files/ && \
382413
rsync -rtc ./template ./dockerfiles/core/files/ && \
383414
rsync -rtc ./*.sh ./dockerfiles/core/files/ && \
384-
mkdir -p ./dockerfiles/core/files/data/srv/tftp/images/ && \
385-
rsync -rtc ./data/srv/tftp/images/uos ./dockerfiles/core/files/data/srv/tftp/images/'; \
415+
mkdir -p ./dockerfiles/core/files/data/srv/tftp/images/uos/ && \
416+
rsync -rtc ./data/srv/tftp/images/uos/initrd ./dockerfiles/core/files/data/srv/tftp/images/uos/initrd && \
417+
rsync -rtc ./data/srv/tftp/images/uos/vmlinuz ./dockerfiles/core/files/data/srv/tftp/images/uos/vmlinuz'; \
386418
docker build --rm ${DOCKER_BUILD_ARGS} -t builder-core dockerfiles/core" \
387419
${LOG_FILE}
388420

389421
# Build the certbot image
390-
run "(11/12) Building builder-certbot" \
391-
"docker run -t --rm ${DOCKER_RUN_ARGS} --privileged -v $(pwd):/work alpine sh -c 'apk update && apk add --no-cache rsync && \
392-
cd /work && \
393-
rsync -rtc ./scripts ./dockerfiles/certbot/'; \
394-
docker build --rm ${DOCKER_BUILD_ARGS} -t builder-certbot dockerfiles/certbot" \
395-
${LOG_FILE}
422+
if [[ "${builder_config_disable_certbot-x}" == "true" ]]; then
423+
printMsg "(10/11) SKIPPING: Building builder-certbot"
424+
logMsg "(10/11) SKIPPING: Building builder-certbot"
425+
else
426+
run "(10/11) Building builder-certbot" \
427+
"docker run -t --rm ${DOCKER_RUN_ARGS} --privileged -v $(pwd):/work alpine sh -c 'apk update && apk add --no-cache rsync && \
428+
cd /work && \
429+
rsync -rtc ./scripts ./dockerfiles/certbot/'; \
430+
docker build --rm ${DOCKER_BUILD_ARGS} -t builder-certbot dockerfiles/certbot" \
431+
${LOG_FILE}
432+
fi
396433

397434
# Build the dynamic profile image
398-
run "(12/12) Building dynamic profile service" \
399-
"docker build --rm ${DOCKER_BUILD_ARGS} -t builder-dyn-profile dockerfiles/dyn-profile" \
400-
${LOG_FILE}
435+
if [[ "${builder_config_disable_dyn_profile-x}" == "true" ]]; then
436+
printMsg "(11/11) SKIPPING: Building builder-dyn-profile"
437+
logMsg "(11/11) SKIPPING: Building builder-dyn-profile"
438+
else
439+
run "(11/11) Building dynamic profile service" \
440+
"docker build --rm ${DOCKER_BUILD_ARGS} -t builder-dyn-profile dockerfiles/dyn-profile" \
441+
${LOG_FILE}
442+
fi
401443

402444
else
403445
printDatedInfoMsg "Skipping Build of ${C_GREEN}Utility Images..."
404446
logMsg "Skipping Build of Utility Images..."
405447
fi
406448

407-
printBanner "Checking ${C_GREEN}Network Config..."
408-
logMsg "Checking Network Config..."
449+
450+
if [[ "${SKIP_NET}" == "true" ]]; then
451+
printBanner "Skipping ${C_GREEN}Network Config Check..."
452+
logMsg "Skipping Network Config Check..."
453+
else
454+
printBanner "Checking ${C_GREEN}Network Config..."
455+
logMsg "Checking Network Config..."
456+
fi
409457
# This function will ensure that the config options for
410458
# network options that users can specify in conf/config.yml
411459
# are set to _something_ non-empty.
@@ -416,9 +464,15 @@ verifyNetworkConfig
416464
# files for a profile, rendering templates for a profile, etc.
417465
source "scripts/profileutils.sh"
418466
source "scripts/pxemenuutils.sh"
419-
printBanner "Starting ${C_GREEN}Gitea..."
420-
logMsg "Starting Gitea..."
421-
startGitea
467+
468+
if [[ "${SKIP_GIT}" == "true" ]] || [[ "${builder_config_disable_gitea-x}" == "true" ]]; then
469+
printBanner "Skipping ${C_GREEN}Starting Gitea..."
470+
logMsg "Skipping Starting Gitea..."
471+
else
472+
printBanner "Starting ${C_GREEN}Gitea..."
473+
logMsg "Starting Gitea..."
474+
startGitea
475+
fi
422476

423477
if [[ "${SKIP_PROFILES}" == "false" ]]; then
424478
printBanner "Synchronizing ${C_GREEN}Profiles..."
@@ -435,22 +489,29 @@ printBanner "Rendering ${C_GREEN}System Templates..."
435489
logMsg "Rendering System Templates..."
436490

437491
if [[ "${DYNAMIC_PROFILE}" == "false" ]]; then
438-
# Begin the process of generating a temporary
439-
# pxelinux.cfg/default file
440-
printBanner "Generating ${C_GREEN}PXE Menu..."
441-
logMsg "Generating PXE Menu..."
442-
genPxeMenuHead
443-
profilesActions genProfilePxeMenu
444-
genPxeMenuTail
445-
446-
renderSystemNetworkTemplates
447-
updatePxeMenu
492+
# Begin the process of generating a temporary
493+
# pxelinux.cfg/default file
494+
printBanner "Generating ${C_GREEN}PXE Menu..."
495+
logMsg "Generating PXE Menu..."
496+
genPxeMenuHead
497+
profilesActions genProfilePxeMenu
498+
genPxeMenuTail
499+
500+
logMsg "Generating IPXE Menu..."
501+
genIpxeMenuHead
502+
profilesActions genProfileIpxeMenu
503+
genIpxeMenuMiddle
504+
profilesActions genProfileIpxeGoto
505+
506+
renderSystemNetworkTemplates
507+
updatePxeMenu
508+
updateIpxeMenu
448509
else
449-
source "scripts/dynamicprofile.sh"
450-
logMsg "Setting up DynamicProfile without PXE boot menu..."
451-
renderSystemNetworkTemplates
452-
setDynamicProfileArgs
453-
exportProfileInfo
510+
source "scripts/dynamicprofile.sh"
511+
logMsg "Setting up DynamicProfile without PXE boot menu..."
512+
renderSystemNetworkTemplates
513+
setDynamicProfileArgs
514+
exportProfileInfo
454515
fi
455516
# Finishing message
456517
printBanner "${C_GREEN}Build Complete!"

conf/config.sample.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
# If omitted, defaults to 8.8.8.8
2121
# Note that the primary DNS is always host_ip
22-
2322
# network_dns_primary: 8.8.4.4
2423
# network_dns_secondary: 8.8.8.8
2524

@@ -54,6 +53,26 @@
5453
# user: ""
5554
# token: ""
5655

56+
# This section is used to enable the support to assign fixed ip addresses based on mac addresses.
57+
# The template array below shows how it should be configured. The dnsmasq.conf file of ESP will
58+
# then be adapted to have the "dhcp-host" entries.
59+
60+
# ip_mapping:
61+
# - mac: 00:11:22:33:44:55
62+
# ip: 192.168.100.200
63+
# - mac: 01:12:23:24:25:26
64+
# ip: 192.168.100.220
65+
66+
# This section is used to disable services not being used. By default they are all enabled.
67+
# disable_uos_wifi: false
68+
# disable_gitea: false
69+
# disable_aws_cli: false
70+
# disable_qemu: false
71+
# disable_smb: false
72+
# disable_certbot: false
73+
# disable_dnsmasq: false
74+
# disable_dyn_profile: false
75+
5776
# Please make sure to define ALL of the variables below, even if they
5877
# are empty. Otherwise, this application will not be configured properly.
5978
profiles:

conf/config.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,26 @@
5454
# user: ""
5555
# token: ""
5656

57+
# This section is used to enable the support to assign fixed ip addresses based on mac addresses.
58+
# The template array below shows how it should be configured. The dnsmasq.conf file of ESP will
59+
# then be adapted to have the "dhcp-host" entries.
60+
61+
# ip_mapping:
62+
# - mac: 00:11:22:33:44:55
63+
# ip: 192.168.100.200
64+
# - mac: 01:12:23:24:25:26
65+
# ip: 192.168.100.220
66+
67+
# This section is used to disable services not being used. By default they are all enabled.
68+
# disable_uos_wifi: false
69+
# disable_gitea: false
70+
# disable_aws_cli: false
71+
# disable_qemu: false
72+
# disable_smb: false
73+
# disable_certbot: false
74+
# disable_dnsmasq: false
75+
# disable_dyn_profile: false
76+
5777
# Please make sure to define ALL of the variables below, even if they
5878
# are empty. Otherwise, this application will not be configured properly.
5979
profiles:

0 commit comments

Comments
 (0)