3
## live-build(7) - System Build Scripts
4
## Copyright (C) 2006-2011 Daniel Baumann <daniel@debian.org>
6
## live-build comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
7
## This is free software, and you are welcome to redistribute it
8
## under certain conditions; see COPYING for details.
13
# Including common functions
14
. "${LB_BASE:-/usr/share/live/build}"/scripts/build.sh
16
# Setting static variables
17
DESCRIPTION="$(Echo 'build binary image with Linaro Media Create')"
19
USAGE="${PROGRAM} [--force]"
23
# Reading configuration files
24
Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
28
Echo_message "Begin building binary image with linaro-media-create"
30
# Requiring stage file
31
Require_stagefile .stage/config .stage/bootstrap
33
if [ "${LB_LMC_BOARD}" ]
37
Check_stagefile .stage/binary_lmc
46
Restore_cache cache/packages_binary
51
LMC_OPTIONS=" --dev $LB_LMC_BOARD "
53
LMC_OPTIONS="$LMC_OPTIONS --binary binary-tar.tar.gz "
55
if [ -f ${LB_LMC_HWPACK} ]
57
LMC_OPTIONS="$LMC_OPTIONS --hwpack $LB_LMC_HWPACK "
59
Echo_message "Error: no hwpack specified"
62
# Remove old iso image
63
if [ -n "${LB_LMC_IMAGE_FILE}" ]
65
if [ -f ${LB_LMC_IMAGE_FILE} ]
67
rm -f ${LB_LMC_IMAGE_FILE}
70
LMC_OPTIONS="$LMC_OPTIONS --image_file $LB_LMC_IMAGE_FILE "
72
Echo_message "linaro-media-create $LMC_OPTIONS"
74
linaro-media-create $LMC_OPTIONS
76
elif [ -n "${LB_LMC_MMC}" ]
78
LMC_OPTIONS="$LMC_OPTIONS --mmc $LB_LMC_MMC "
80
Echo_message "linaro-media-create $LMC_OPTIONS"
82
linaro-media-create $LMC_OPTIONS
85
Echo_message "Error: Must specify image_file or MMC"
90
Save_cache cache/packages_binary
98
Create_stagefile .stage/binary_lmc