summaryrefslogtreecommitdiffstats
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:26:14 +0100
commit3b19f90bdfca520a6e00057cacb103f8a55feac6 (patch)
tree6d14c46a4cc04097a04aae9fd1adb7a22c838449 /meta/classes/bootimg.bbclass
parent463c9f4d3abeaa46ba8aa2b287b62c907c39359b (diff)
downloadpoky-3b19f90bdfca520a6e00057cacb103f8a55feac6.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. (From OE-Core rev: b0ac481dda99d8f4be8015964fcb2cb01afce08c) 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 @@
18# an hdd) 18# an hdd)
19 19
20# External variables (also used by syslinux.bbclass) 20# External variables (also used by syslinux.bbclass)
21# ${INITRD} - indicates a filesystem image to use as an initrd (optional) 21# ${INITRD} - indicates a list of filesystem images to concatenate and use as an initrd (optional)
22# ${COMPRESSISO} - Transparent compress ISO, reduce size ~40% if set to 1 22# ${COMPRESSISO} - Transparent compress ISO, reduce size ~40% if set to 1
23# ${NOISO} - skip building the ISO image if set to 1 23# ${NOISO} - skip building the ISO image if set to 1
24# ${NOHDD} - skip building the HDD image if set to 1 24# ${NOHDD} - skip building the HDD image if set to 1
@@ -67,9 +67,17 @@ populate() {
67 67
68 # Install bzImage, initrd, and rootfs.img in DEST for all loaders to use. 68 # Install bzImage, initrd, and rootfs.img in DEST for all loaders to use.
69 install -m 0644 ${STAGING_KERNEL_DIR}/bzImage ${DEST}/vmlinuz 69 install -m 0644 ${STAGING_KERNEL_DIR}/bzImage ${DEST}/vmlinuz
70 70
71 if [ -n "${INITRD}" ] && [ -s "${INITRD}" ]; then 71 # initrd is made of concatenation of multiple filesystem images
72 install -m 0644 ${INITRD} ${DEST}/initrd 72 if [ -n "${INITRD}" ]; then
73 rm -f ${DEST}/initrd
74 for fs in ${INITRD}
75 do
76 if [ -s "${fs}" ]; then
77 cat ${fs} >> ${DEST}/initrd
78 fi
79 done
80 chmod 0644 ${DEST}/initrd
73 fi 81 fi
74 82
75 if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then 83 if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then
@@ -80,10 +88,19 @@ populate() {
80 88
81build_iso() { 89build_iso() {
82 # Only create an ISO if we have an INITRD and NOISO was not set 90 # Only create an ISO if we have an INITRD and NOISO was not set
83 if [ -z "${INITRD}" ] || [ ! -s "${INITRD}" ] || [ "${NOISO}" = "1" ]; then 91 if [ -z "${INITRD}" ] || [ "${NOISO}" = "1" ]; then
84 bbnote "ISO image will not be created." 92 bbnote "ISO image will not be created."
85 return 93 return
86 fi 94 fi
95 # ${INITRD} is a list of multiple filesystem images
96 for fs in ${INITRD}
97 do
98 if [ ! -s "${fs}" ]; then
99 bbnote "ISO image will not be created. ${fs} is invalid."
100 return
101 fi
102 done
103
87 104
88 populate ${ISODIR} 105 populate ${ISODIR}
89 106