aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/bootimg.bbclass
diff options
context:
space:
mode:
authorNitin A Kamble <nitin.a.kamble@intel.com>2014-07-29 11:34:45 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-08-02 09:21:14 +0100
commitb0ac481dda99d8f4be8015964fcb2cb01afce08c (patch)
treec137548c368478322bfa5f539bad9c2e5530fdb2 /meta/classes/bootimg.bbclass
parentd4b350fcdedf29692673e09a0c1850cdbbe29739 (diff)
downloadopenembedded-core-contrib-b0ac481dda99d8f4be8015964fcb2cb01afce08c.tar.gz
INITRD var: make it a list of filesystem images
The initrd image used by the Linux kernel is list of file system images concatenated together and presented as a single initrd file at boot time. So far the initrd is a single filesystem image. But in cases like to support early microcode loading, the initrd image need to have multiple filesystem images concatenated together. This commit is extending the INITRD variable from a single filesystem image to a list of filesystem images to satisfy the need mentioned above. Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/bootimg.bbclass')
-rw-r--r--meta/classes/bootimg.bbclass27
1 files changed, 22 insertions, 5 deletions
diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
index d52aacea81..7b3ce65910 100644
--- a/meta/classes/bootimg.bbclass
+++ b/meta/classes/bootimg.bbclass
@@ -18,7 +18,7 @@
# an hdd)
# External variables (also used by syslinux.bbclass)
-# ${INITRD} - indicates a filesystem image to use as an initrd (optional)
+# ${INITRD} - indicates a list of filesystem images to concatenate and use as an initrd (optional)
# ${COMPRESSISO} - Transparent compress ISO, reduce size ~40% if set to 1
# ${NOISO} - skip building the ISO image if set to 1
# ${NOHDD} - skip building the HDD image if set to 1
@@ -67,9 +67,17 @@ populate() {
# Install bzImage, initrd, and rootfs.img in DEST for all loaders to use.
install -m 0644 ${STAGING_KERNEL_DIR}/bzImage ${DEST}/vmlinuz
-
- if [ -n "${INITRD}" ] && [ -s "${INITRD}" ]; then
- install -m 0644 ${INITRD} ${DEST}/initrd
+
+ # initrd is made of concatenation of multiple filesystem images
+ if [ -n "${INITRD}" ]; then
+ rm -f ${DEST}/initrd
+ for fs in ${INITRD}
+ do
+ if [ -s "${fs}" ]; then
+ cat ${fs} >> ${DEST}/initrd
+ fi
+ done
+ chmod 0644 ${DEST}/initrd
fi
if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then
@@ -80,10 +88,19 @@ populate() {
build_iso() {
# Only create an ISO if we have an INITRD and NOISO was not set
- if [ -z "${INITRD}" ] || [ ! -s "${INITRD}" ] || [ "${NOISO}" = "1" ]; then
+ if [ -z "${INITRD}" ] || [ "${NOISO}" = "1" ]; then
bbnote "ISO image will not be created."
return
fi
+ # ${INITRD} is a list of multiple filesystem images
+ for fs in ${INITRD}
+ do
+ if [ ! -s "${fs}" ]; then
+ bbnote "ISO image will not be created. ${fs} is invalid."
+ return
+ fi
+ done
+
populate ${ISODIR}