Browse Source

Merge pull request #119 from drewmoseley/v2

BBB EMMC and multiple config command line support
2.0.x
Mirza Krak 5 years ago
committed by GitHub
parent
commit
0006f37e87
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      .gitignore
  2. 9
      configs/beaglebone_black_debian_emmc_config
  3. 4
      configs/beaglebone_black_debian_sdcard_config
  4. 10
      mender-convert-extract
  5. 10
      mender-convert-modify
  6. 10
      mender-convert-package
  7. 9
      modules/config.sh

1
.gitignore

@ -3,3 +3,4 @@ input
work work
rootfs_overlay_demo/* rootfs_overlay_demo/*
tests tests
mender_local_config

9
configs/beaglebone_black_debian_emmc_config

@ -0,0 +1,9 @@
# Binaries generated with the following script:
#
# https://github.com/drewmoseley/mender-convert-integration-scripts/blob/master/build-uboot-bbb.sh
#
BEAGLEBONE_BLACK_BINARIES="beaglebone-black-integration-debian-emmc-2018.07.004.tar"
source configs/beaglebone_black_base_config
MENDER_STORAGE_TOTAL_SIZE_MB="3648"
MENDER_DEVICE_TYPE="beaglebone-emmc"
MENDER_STORAGE_DEVICE="/dev/mmcblk1p"

4
configs/beaglebone_black_debian_sdcard_config

@ -2,5 +2,7 @@
# #
# https://github.com/drewmoseley/mender-convert-integration-scripts/blob/master/build-uboot-bbb.sh # https://github.com/drewmoseley/mender-convert-integration-scripts/blob/master/build-uboot-bbb.sh
# #
BEAGLEBONE_BLACK_BINARIES="beaglebone-black-integration-debian-2018.07.002.tar" BEAGLEBONE_BLACK_BINARIES="beaglebone-black-integration-debian-sdcard-2018.07.004.tar"
source configs/beaglebone_black_base_config source configs/beaglebone_black_base_config
MENDER_DEVICE_TYPE="beaglebone-sdcard"
MENDER_STORAGE_DEVICE="/dev/mmcblk0p"

10
mender-convert-extract

@ -19,6 +19,8 @@ echo "Running $(basename $0): $@"
source modules/bootstrap.sh source modules/bootstrap.sh
source modules/disk.sh source modules/disk.sh
declare -a configs
disk_image="" disk_image=""
while (( "$#" )); do while (( "$#" )); do
case "$1" in case "$1" in
@ -27,7 +29,7 @@ while (( "$#" )); do
shift 2 shift 2
;; ;;
-c | --config) -c | --config)
configs+="${2}" configs+=("${2}")
shift 2 shift 2
;; ;;
-d | --disk-image) -d | --disk-image)
@ -50,7 +52,11 @@ if [ ! -e ${disk_image} ]; then
log_fatal "File not found: ${disk_image}" log_fatal "File not found: ${disk_image}"
fi fi
source modules/config.sh "${configs[@]}" # Note the use of %q formatting here. This is a bash feature to add
# proper quoting to the strings so that spaces and special characters
# will be treated properly. Primarily for supporting spaces in
# pathnames and avoid splitting those into multiple parameters.
source modules/config.sh $(printf "%q " "${configs[@]}")
MKFS_VFAT="/usr/bin/mkfs.vfat" MKFS_VFAT="/usr/bin/mkfs.vfat"
if [ ! -f ${MKFS_VFAT} ]; then if [ ! -f ${MKFS_VFAT} ]; then

10
mender-convert-modify

@ -39,6 +39,8 @@ source modules/bootstrap.sh
source modules/disk.sh source modules/disk.sh
source modules/probe.sh source modules/probe.sh
declare -a configs
while (( "$#" )); do while (( "$#" )); do
case "$1" in case "$1" in
-o | --overlay) -o | --overlay)
@ -46,7 +48,7 @@ while (( "$#" )); do
shift 2 shift 2
;; ;;
-c | --config) -c | --config)
configs+="${2}" configs+=("${2}")
shift 2 shift 2
;; ;;
-d | --disk-image) -d | --disk-image)
@ -59,7 +61,11 @@ while (( "$#" )); do
esac esac
done done
source modules/config.sh "${configs[@]}" # Note the use of %q formatting here. This is a bash feature to add
# proper quoting to the strings so that spaces and special characters
# will be treated properly. Primarily for supporting spaces in
# pathnames and avoid splitting those into multiple parameters.
source modules/config.sh $(printf "%q " "${configs[@]}")
boot_part=$(disk_boot_part) boot_part=$(disk_boot_part)
root_part=$(disk_root_part) root_part=$(disk_root_part)

10
mender-convert-package

@ -38,6 +38,8 @@ echo "Running $(basename $0): $@"
source modules/bootstrap.sh source modules/bootstrap.sh
source modules/disk.sh source modules/disk.sh
declare -a configs
while (( "$#" )); do while (( "$#" )); do
case "$1" in case "$1" in
-o | --overlay) -o | --overlay)
@ -45,7 +47,7 @@ while (( "$#" )); do
shift 2 shift 2
;; ;;
-c | --config) -c | --config)
configs+="${2}" configs+=("${2}")
shift 2 shift 2
;; ;;
-d | --disk-image) -d | --disk-image)
@ -58,7 +60,11 @@ while (( "$#" )); do
esac esac
done done
source modules/config.sh "${configs[@]}" # Note the use of %q formatting here. This is a bash feature to add
# proper quoting to the strings so that spaces and special characters
# will be treated properly. Primarily for supporting spaces in
# pathnames and avoid splitting those into multiple parameters.
source modules/config.sh $(printf "%q " "${configs[@]}")
PARTED="/usr/bin/parted" PARTED="/usr/bin/parted"
if [ ! -f ${PARTED} ]; then if [ ! -f ${PARTED} ]; then

9
modules/config.sh

@ -14,7 +14,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
for config in configs/mender_convert_config "$@"; do # Read in the array of config files to process
log_info "Using configuration file: ${config}" read -a configs <<< "${@}"
source ${config} configs=( "configs/mender_convert_config" "${configs[@]}" )
for config in "${configs[@]}"; do
log_info "Using configuration file: ${config}"
source "${config}"
done done

Loading…
Cancel
Save