aboutsummaryrefslogtreecommitdiffstats
path: root/classes/bootfs-image.bbclass
blob: cbb6c4c723aa8e885148a51d615d0a5c134d2a1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#############################################################################
##
## Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
##
## This file is part of the Qt Enterprise Embedded Scripts of the Qt
## framework.
##
## $QT_BEGIN_LICENSE$
## Commercial License Usage Only
## Licensees holding valid commercial Qt license agreements with Digia
## with an appropriate addendum covering the Qt Enterprise Embedded Scripts,
## may use this file in accordance with the terms contained in said license
## agreement.
##
## For further information use the contact form at
## http://qt.digia.com/contact-us.
##
##
## $QT_END_LICENSE$
##
#############################################################################

BOOTFS_NAME = "${IMAGE_BASENAME}-boot-${MACHINE}-${DATETIME}"
BOOTFS_LINK_NAME = "${IMAGE_BASENAME}-boot-${MACHINE}"

BOOTFS_DEPENDS ?= ""

fakeroot do_bootfs () {
	if [ -z "${BOOTFS_CONTENT}" ]; then
		exit 0
	fi

	mkdir -p ${S}/bootfs

	for item in ${BOOTFS_CONTENT}; do
		src=`echo $item | awk -F':' '{ print $1 }'`
		dst=`echo $item | awk -F':' '{ print $2 }'`

		install -m 0755 ${DEPLOY_DIR_IMAGE}/$src ${S}/bootfs/$dst
	done

	cd ${S}/bootfs
	rm -f ${DEPLOY_DIR_IMAGE}/${BOOTFS_NAME}.tar.gz ${DEPLOY_DIR_IMAGE}/${BOOTFS_LINK_NAME}.tar.gz

	tar czvf ${DEPLOY_DIR_IMAGE}/${BOOTFS_NAME}.tar.gz .
	ln -s ${BOOTFS_NAME}.tar.gz ${DEPLOY_DIR_IMAGE}/${BOOTFS_LINK_NAME}.tar.gz
}

addtask bootfs before do_rootfs

do_bootfs[depends] += "${BOOTFS_DEPENDS}"