=== modified file 'functions/defaults.sh'
--- old/functions/defaults.sh	2011-06-13 18:38:44 +0000
+++ new/functions/defaults.sh	2011-09-27 14:09:44 +0000
@@ -249,6 +249,9 @@
 	# Setting templates
 	LB_TEMPLATES="${LB_TEMPLATES:-${LB_BASE}/templates}"
 
+	# skip or not skip kernel and initrd for users of lmc
+
+
 	# Setting live build options
 	_BREAKPOINTS="${_BREAKPOINTS:-false}"
 	_COLOR="${_COLOR:-false}"
@@ -287,6 +290,19 @@
 		fi
 	fi
 
+	# skip or not skip kernel and initrd for users of arm and lmc
+	case "${LB_ARCHITECTURES}" in
+		armel)
+			if [ -z "${LB_SKIP_KERNEL_AND_INITRD_SETU}" ]
+			then
+				LB_SKIP_KERNEL_AND_INITRD_SETUP="true"
+			fi
+			;;
+		*)
+			LB_SKIP_KERNEL_AND_INITRD_SETUP="false"
+			;;
+	esac
+
 	# Include packages on base
 	# LB_BOOTSTRAP_INCLUDE
 
@@ -303,6 +319,26 @@
 	# Setting bootstrap keyring
 	# LB_BOOTSTRAP_KEYRING
 
+        # setup use of linaro-media-create
+	# has a board been set?
+	if [ "$LB_LMC_BOARD" ] 
+	then
+		if [  "$LB_LMC_MMC" ] && [ "$LB_LMC_IMAGE_FILE" ] 
+		then
+			Echo_error "Either LB_LMC_MMC OR LB_LMC_IMAGE_FILE must be defined"
+		fi
+
+		if  ! [ "$LB_LMC_HWPACK" ] 
+		then
+			Echo_error "no hwpack specified with use of linaro media create"
+		fi
+
+		if [ "$LB_LMC_IMAGE_FILE"]  &&  ! [ "$LB_LMC_IMAGE_SIZE" ] 
+		then
+			Echo_error "must specify LB_LMC_IMAGE_SIZE with LB_LMC_IMAGE_FILE"
+		fi
+	fi
+
 	# Setting mirror to fetch packages from
 	case "${LB_MODE}" in
 		debian)
@@ -592,10 +628,8 @@
 
 	# Setting linux flavour string
 	case "${LB_ARCHITECTURES}" in
-		armel)
-			Echo_error "There is no default kernel flavour defined for your architecture."
-			Echo_error "Please configure it manually with 'lb config -k FLAVOUR'."
-			exit 1
+		arm|armel)
+			Echo_warning "Producing board independent image for arm|armel."
 			;;
 
 		amd64)
@@ -731,11 +765,11 @@
 	# Set linux packages
 	case "${LB_MODE}" in
 		ubuntu)
-			LB_LINUX_PACKAGES="${LB_LINUX_PACKAGES:-linux}"
+			LB_LINUX_PACKAGES="${LB_LINUX_PACKAGES:-ubuntu-minimal}"
 			;;
 
 		*)
-			LB_LINUX_PACKAGES="${LB_LINUX_PACKAGES:-linux-image-2.6}"
+			LB_LINUX_PACKAGES="${LB_LINUX_PACKAGES:-standard}"
 			;;
 	esac
 
@@ -1163,3 +1197,4 @@
 	fi
 
 }
+

=== modified file 'scripts/build/lb_binary'
--- old/scripts/build/lb_binary	2011-05-21 08:50:31 +0000
+++ new/scripts/build/lb_binary	2011-09-27 14:09:44 +0000
@@ -86,6 +86,7 @@
 lb binary_iso ${*}
 lb binary_net ${*}
 lb binary_tar ${*}
+lb binary_linaro-media-create ${*}
 lb binary_usb ${*}
 lb binary_virtual-hdd ${*}
 

=== added file 'scripts/build/lb_binary_linaro-media-create'
--- old/scripts/build/lb_binary_linaro-media-create	1970-01-01 00:00:00 +0000
+++ new/scripts/build/lb_binary_linaro-media-create	2011-09-27 14:35:21 +0000
@@ -0,0 +1,99 @@
+#!/bin/sh
+
+## live-build(7) - System Build Scripts
+## Copyright (C) 2006-2011 Daniel Baumann <daniel@debian.org>
+##
+## live-build comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
+## This is free software, and you are welcome to redistribute it
+## under certain conditions; see COPYING for details.
+
+set -x
+set -e
+
+# Including common functions
+. "${LB_BASE:-/usr/share/live/build}"/scripts/build.sh
+
+# Setting static variables
+DESCRIPTION="$(Echo 'build binary image with Linaro Media Create')"
+HELP=""
+USAGE="${PROGRAM} [--force]"
+
+Arguments "${@}"
+
+# Reading configuration files
+Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
+Set_defaults
+
+
+Echo_message "Begin building binary image with linaro-media-create"
+
+# Requiring stage file
+Require_stagefile .stage/config .stage/bootstrap
+
+if [ "${LB_LMC_BOARD}" ]
+then
+
+	# Checking stage file
+	Check_stagefile .stage/binary_lmc
+
+	# Checking lock file
+	Check_lockfile .lock
+
+	# Creating lock file
+	Create_lockfile .lock
+
+	# Restoring cache
+	Restore_cache cache/packages_binary
+
+	# Installing depends
+	Install_package
+
+	LMC_OPTIONS=" --dev $LB_LMC_BOARD "
+	LMC_OPTIONS="$LMC_OPTIONS --binary binary-tar.tar.gz "
+	LMC_OPTIONS="$LMC_OPTIONS --rootfs $LB_BINARY_FILESYSTEM "
+
+	if [ -f ${LB_LMC_HWPACK} ] 
+	then
+		LMC_OPTIONS="$LMC_OPTIONS --hwpack $LB_LMC_HWPACK "
+	else
+		Echo_message "Error: no hwpack specified"
+	fi
+
+	# Remove old iso image
+	if [ -n "${LB_LMC_IMAGE_FILE}" ]
+	then
+		if [ -f ${LB_LMC_IMAGE_FILE} ]
+		then
+			rm -f ${LB_LMC_IMAGE_FILE}
+		fi
+
+		LMC_OPTIONS="$LMC_OPTIONS --image_file $LB_LMC_IMAGE_FILE "
+
+		Echo_message "linaro-media-create $LMC_OPTIONS"
+
+		linaro-media-create $LMC_OPTIONS
+
+	elif [ -n "${LB_LMC_MMC}" ]
+	then
+		LMC_OPTIONS="$LMC_OPTIONS --mmc $LB_LMC_MMC "
+
+		Echo_message "linaro-media-create $LMC_OPTIONS"
+
+		linaro-media-create $LMC_OPTIONS
+	
+	else
+		Echo_message "Error: Must specify image_file or MMC"
+	fi
+
+
+# Saving cache
+Save_cache cache/packages_binary
+
+# Removing depends
+Remove_package
+
+# board != none
+fi 
+# Creating stage file
+Create_stagefile .stage/binary_lmc
+set +x

=== modified file 'scripts/build/lb_binary_linux-image'
--- old/scripts/build/lb_binary_linux-image	2011-03-09 18:20:42 +0000
+++ new/scripts/build/lb_binary_linux-image	2011-09-27 14:09:44 +0000
@@ -72,18 +72,25 @@
 # Creating directory
 mkdir -p "${DESTDIR}"
 
-# Installing linux-image
-cp chroot/boot/"${LINUX}"-* "${DESTDIR}"
-cp chroot/boot/initrd.img-* "${DESTDIR}"
-
-case "${LB_INITRAMFS}" in
-	live-boot)
-		if [ -e chroot/usr/share/doc/live-boot/parameters.txt ]
-		then
-			cp chroot/usr/share/doc/live-boot/parameters.txt "${DESTDIR}"/parameters
-		fi
-		;;
-esac
+# when making a rootfs, skip this step as it will be done
+# later by another tool like linaro-media-create
+
+if [ "${LB_SKIP_KERNEL_AND_INITRD_SETUP}" == "false" ]
+then
+
+	# Installing linux-image
+	cp chroot/boot/"${LINUX}"-* "${DESTDIR}"
+	cp chroot/boot/initrd.img-* "${DESTDIR}"
+
+	case "${LB_INITRAMFS}" in
+		live-boot)
+			if [ -e chroot/usr/share/doc/live-boot/parameters.txt ]
+			then
+				cp chroot/usr/share/doc/live-boot/parameters.txt "${DESTDIR}"/parameters
+			fi
+			;;
+	esac
+fi
 
 # Creating stage file
 Create_stagefile .stage/binary_linux-image

=== modified file 'scripts/build/lb_chroot'
--- old/scripts/build/lb_chroot	2011-06-11 17:36:46 +0000
+++ new/scripts/build/lb_chroot	2011-09-27 14:09:44 +0000
@@ -60,6 +60,7 @@
 do
 	lb chroot_packagelists ${_PASS} ${*}
 	lb chroot_local-packagelists ${_PASS} ${*}
+	lb chroot_packages ${_PASS} ${*}
 	lb chroot_local-packages ${_PASS} ${*}
 	lb chroot_install-packages ${_PASS} ${*}
 	lb chroot_local-tasklists ${_PASS} ${*}
@@ -92,6 +93,7 @@
 lb chroot_debianchroot remove ${*}
 lb chroot_sysfs remove ${*}
 lb chroot_selinuxfs remove ${*}
+lb chroot_packages remove ${*}
 lb chroot_proc remove ${*}
 lb chroot_devpts remove ${*}
 lb chroot_cache save ${*}

=== added file 'scripts/build/lb_chroot_packages'
--- old/scripts/build/lb_chroot_packages	1970-01-01 00:00:00 +0000
+++ new/scripts/build/lb_chroot_packages	2011-09-27 14:09:44 +0000
@@ -0,0 +1,65 @@
+#!/bin/sh
+
+# lb_chroot_packages(1) - queue install of packages into chroot
+# Copyright (C) 2006-2010 Daniel Baumann <daniel@debian.org>
+#
+# live-helper comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
+# This is free software, and you are welcome to redistribute it
+# under certain conditions; see COPYING for details.
+
+set -e
+
+# Including common functions
+. "${LB_BASE:-/usr/share/live/build}"/scripts/build.sh
+
+# Setting static variables
+DESCRIPTION="$(Echo 'queue install of packages into chroot')"
+HELP=""
+USAGE="${PROGRAM} {install|remove} [--force]"
+
+Arguments "${@}"
+
+# Reading configuration files
+Read_conffiles config/all config/common config/bootstrap config/chroot config/binary config/source
+Set_defaults
+
+# Requiring stage file
+Require_stagefile .stage/config .stage/bootstrap
+
+case "${1}" in
+	install)
+		Echo_message "Begin queueing installation of packages..."
+
+		# Checking stage file
+		Check_stagefile .stage/chroot_packages
+
+		# Checking lock file
+		Check_lockfile .lock
+
+		# Creating lock file
+		Create_lockfile .lock
+
+		if [ -n "${LB_PACKAGES}" ] && [ "${LB_PACKAGES}" != "none" ]
+		then
+		echo ${LB_PACKAGES} >> chroot/root/chroot_packages
+
+		# Creating stage file
+		Create_stagefile .stage/chroot_packages
+		fi
+		;;
+
+	remove)
+		Echo_message "remove chroot_packages from chroot..."
+
+		# Checking lock file
+		Check_lockfile .lock
+
+		# Creating lock file
+		Create_lockfile .lock
+
+		rm -rf chroot/root/chroot_packages
+		;;
+	
+	*)
+		;;
+esac

=== modified file 'scripts/build/lb_config'
--- old/scripts/build/lb_config	2011-06-13 18:38:44 +0000
+++ new/scripts/build/lb_config	2011-09-27 14:09:44 +0000
@@ -90,6 +90,11 @@
 \t    [--keyring-packages PACKAGE|\"PACKAGES\"]\n\
 \t    [-k|--linux-flavours FLAVOUR|\"FLAVOURS\"]\n\
 \t    [--linux-packages \"PACKAGES\"]\n\
+\t    [--lmc-board \"ARM BOARD\"]\n\
+\t    [--lmc-hwpack \"HARDWARE PACK\"]\n\
+\t    [--lmc-mmc \"MMC\"]\n\
+\t    [--lmc-image_file \"IMAGE FILE\"]\n\
+\t    [--lmc-image_size \"IMAGE SIZE\"]\n\
 \t    [--losetup losetup|losetup.orig]\n\
 \t    [--memtest memtest86+|memtest86|none]\n\
 \t    [-m|--parent-mirror-bootstrap URL]\n\
@@ -123,6 +128,7 @@
 \t    [--net-cow-server IP|HOSTNAME]\n\
 \t    [--net-tarball true|false]\n\
 \t    [-p|--package-lists LIST|\"LISTS\"]\n\
+\t    [--packages PACKAGE|\"PACKAGES\"]\n\
 \t    [--quiet]\n\
 \t    [-r|--repositories REPOSITORY|\"REPOSITORIES\"]\n\
 \t    [--root-command sudo]\n\
@@ -159,7 +165,7 @@
 		mirror-binary-security:,mirror-binary-volatile:,mirror-binary-backports:,mirror-debian-installer:,
 		archive-areas:,parent-archive-areas:,chroot-filesystem:,exposed-root:,virtual-root-size:,
 		gzip-options:,hooks:,interactive:,keyring-packages:,linux-flavours:,linux-packages:,
-		package-lists:,tasks:,security:,volatile:,backports:,binary-filesystem:,binary-images:,
+		package-lists:,packages:,tasks:,security:,volatile:,backports:,binary-filesystem:,binary-images:,
 		apt-indices:,bootappend-install:,bootappend-live:,bootloader:,checksums:,compression:,build-with-chroot:,
 		debian-installer:,debian-installer-distribution:,debian-installer-preseedfile:,debian-installer-gui:,
 		grub-splash:,hostname:,isohybrid-options:,iso-application:,iso-preparer:,iso-publisher:,
@@ -167,7 +173,8 @@
 		net-root-path:,net-root-server:,net-cow-filesystem:,net-cow-mountoptions:,net-cow-path:,
 		net-cow-server:,net-tarball:,swap-file-path:,swap-file-size:,syslinux-theme:,
 		username:,win32-loader:,source:,source-images:,breakpoints,conffile:,debug,force,
-		help,ignore-system-defaults,quiet,usage,verbose,version"
+		help,ignore-system-defaults,quiet,usage,verbose,version,lmc-board:,
+                lmc-hwpack:,lmc-mmc:,lmc-image-file:,lmc-image_size:"
 	# Remove spaces added by indentation
 	LONG_OPTIONS="$(echo ${LONG_OPTIONS} | tr -d ' ')"
 	ARGUMENTS="$(getopt --longoptions ${LONG_OPTIONS} --name="${PROGRAM}" --options a:f:d:m:l:k:p:b:e:r:s:c:huv --shell sh -- "${@}")"
@@ -557,6 +564,36 @@
 				shift 2
 				;;
 
+			--lmc-board)
+				LB_LMC_BOARD="${2}"
+				shift 2
+				;;
+
+			--lmc-hwpack)
+				LB_LMC_HWPACK="${2}"
+				shift 2
+				;;
+
+			--lmc-mmc)
+				LB_LMC_MMC="${2}"
+				shift 2
+				;;
+
+			--lmc-image-file)
+				LB_LMC_IMAGE_FILE="${2}"
+				shift 2
+				;;
+
+			--lmc-image-size)
+				LB_LMC_IMAGE_SIZE="${2}"
+				shift 2
+				;;
+
+			--packages)
+				LB_PACKAGES="${2}"
+				shift 2
+				;;
+
 			-p|--package-lists)
 				LB_PACKAGE_LISTS="${2}"
 				shift 2
@@ -985,6 +1022,10 @@
 # (Default: ${LB_TEMPLATES})
 LB_TEMPLATES="${LB_TEMPLATES}"
 
+# \$LB_SKIP_KERNEL_AND_INITRD_SETUP: enable skipping need of initrd and kernel
+# (Default: ${LB_SKIP_KERNEL_AND_INITRD_SETUP})
+LB_SKIP_KERNEL_AND_INITRD_SETUP="${LB_SKIP_KERNEL_AND_INITRD_SETUP}"
+
 # live-build options
 
 # \$_BREAKPOINTS: enable breakpoints
@@ -1197,6 +1238,10 @@
 # (Default: empty)
 LB_REPOSITORIES="${LB_REPOSITORIES}"
 
+# \$LB_PACKAGES: set packages to install
+# (Default: empty)
+LB_PACKAGES="${LB_PACKAGES}"
+
 # \$LB_PACKAGE_LISTS: set package list to install
 # (Default: ${LB_PACKAGE_LISTS})
 LB_PACKAGE_LISTS="${LB_PACKAGE_LISTS}"
@@ -1373,6 +1418,23 @@
 # \$LB_USERNAME: set username
 # (Default: ${LB_USERNAME})
 LB_USERNAME="${LB_USERNAME}"
+
+# LB_LMC_BOARD : board name to pass to lmc
+# (Default: none) none also means don't use lmc
+LB_LMC_BOARD="${LB_LMC_BOARD}"
+
+# LB_LMC_HWPACK: name of hwpack to use
+LB_LMC_HWPACK="${LB_LMC_HWPACK}"
+
+# LB_LMC_MMC name of device to write to
+# choose MMC or FILE not both
+LB_LMC_MMC="${LB_LMC_MMC}"
+
+# LB_LMC_IMAGE_FILE name of file to write image to
+LB_LMC_IMAGE_FILE="${LB_LMC_IMAGE_FILE}"
+
+# LB_LMC_IMAGE_SIZE size of file to write to
+LB_LMC_IMAGE_SIZE="${LB_LMC_IMAGE_SIZE}"
 EOF
 
 # Creating lb_source_* configuration

