diff options
Diffstat (limited to 'meta/classes/bootimg.bbclass')
-rw-r--r-- | meta/classes/bootimg.bbclass | 27 |
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 | ||
81 | build_iso() { | 89 | build_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 | ||