mirror of
https://git.yoctoproject.org/poky
synced 2026-04-13 14:02:21 +02:00
populate_sdk.bbclass/meta-toolchain: Made populate_sdk task more generic
Move the populate_sdk task out of meta-toolchain. Made it more generic to support rpm/deb package format. This commit is dependant on a series of commit: 2ea0406e4516fc59dff86cb4adc35c82cb774c2f 7ffa45b7cfea24dae1b51f40cfc807bf78b21b66 bf201a74c243942af3fcae6f174496bdd819dbc0 3d29933f2925efe8a84f10efdf50396031c33ae4 3d29933f2925efe8a84f10efdf50396031c33ae4 9c724dbf57e610a9e06bbdce38383dee3ac49281 Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
This commit is contained in:
committed by
Richard Purdie
parent
63e220c1e8
commit
d22b4357c9
82
meta/classes/populate_sdk.bbclass
Normal file
82
meta/classes/populate_sdk.bbclass
Normal file
@@ -0,0 +1,82 @@
|
||||
inherit meta toolchain-scripts
|
||||
inherit populate_sdk_${IMAGE_PKGTYPE}
|
||||
|
||||
SDK_DIR = "${WORKDIR}/sdk"
|
||||
SDK_OUTPUT = "${SDK_DIR}/image"
|
||||
SDK_DEPLOY = "${TMPDIR}/deploy/sdk"
|
||||
|
||||
SDKTARGETSYSROOT = "${SDKPATH}/sysroots/${TARGET_SYS}"
|
||||
|
||||
TOOLCHAIN_HOST_TASK ?= "task-sdk-host task-cross-canadian-${TRANSLATED_TARGET_ARCH}"
|
||||
TOOLCHAIN_TARGET_TASK ?= "task-poky-standalone-sdk-target task-poky-standalone-sdk-target-dbg"
|
||||
TOOLCHAIN_OUTPUTNAME ?= "${SDK_NAME}-toolchain-${DISTRO_VERSION}"
|
||||
|
||||
RDEPENDS = "${TOOLCHAIN_TARGET_TASK} ${TOOLCHAIN_HOST_TASK}"
|
||||
DEPENDS = "virtual/fakeroot-native sed-native"
|
||||
|
||||
PID = "${@os.getpid()}"
|
||||
|
||||
EXCLUDE_FROM_WORLD = "1"
|
||||
|
||||
fakeroot do_populate_sdk() {
|
||||
rm -rf ${SDK_OUTPUT}
|
||||
mkdir -p ${SDK_OUTPUT}
|
||||
|
||||
populate_sdk_${IMAGE_PKGTYPE}
|
||||
|
||||
# Don't ship any libGL in the SDK
|
||||
rm -rf ${SDK_OUTPUT}/${SDKPATHNATIVE}${libdir_nativesdk}/libGL*
|
||||
|
||||
# Can copy pstage files here
|
||||
# target_pkgs=`cat ${SDK_OUTPUT}/${SDKTARGETSYSROOT}/var/lib/opkg/status | grep Package: | cut -f 2 -d ' '`
|
||||
|
||||
# Fix or remove broken .la files
|
||||
#rm -f ${SDK_OUTPUT}/${SDKPATHNATIVE}/lib/*.la
|
||||
rm -f ${SDK_OUTPUT}/${SDKPATHNATIVE}${libdir_nativesdk}/*.la
|
||||
|
||||
# Link the ld.so.cache file into the hosts filesystem
|
||||
ln -s /etc/ld.so.cache ${SDK_OUTPUT}/${SDKPATHNATIVE}/etc/ld.so.cache
|
||||
|
||||
# Setup site file for external use
|
||||
siteconfig=${SDK_OUTPUT}/${SDKPATH}/site-config-${MULTIMACH_TARGET_SYS}
|
||||
touch $siteconfig
|
||||
for sitefile in ${CONFIG_SITE} ; do
|
||||
cat $sitefile >> $siteconfig
|
||||
done
|
||||
|
||||
toolchain_create_sdk_env_script
|
||||
|
||||
# Add version information
|
||||
versionfile=${SDK_OUTPUT}/${SDKPATH}/version-${MULTIMACH_TARGET_SYS}
|
||||
touch $versionfile
|
||||
echo 'Distro: ${DISTRO}' >> $versionfile
|
||||
echo 'Distro Version: ${DISTRO_VERSION}' >> $versionfile
|
||||
echo 'Metadata Revision: ${METADATA_REVISION}' >> $versionfile
|
||||
echo 'Timestamp: ${DATETIME}' >> $versionfile
|
||||
|
||||
# Package it up
|
||||
mkdir -p ${SDK_DEPLOY}
|
||||
cd ${SDK_OUTPUT}
|
||||
tar --owner=root --group=root -cj --file=${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.bz2 .
|
||||
}
|
||||
|
||||
populate_sdk_log_check() {
|
||||
for target in $*
|
||||
do
|
||||
lf_path="${WORKDIR}/temp/log.do_$target.${PID}"
|
||||
|
||||
echo "log_check: Using $lf_path as logfile"
|
||||
|
||||
if test -e "$lf_path"
|
||||
then
|
||||
${IMAGE_PKGTYPE}_log_check $target $lf_path
|
||||
else
|
||||
echo "Cannot find logfile [$lf_path]"
|
||||
fi
|
||||
echo "Logfile is clean"
|
||||
done
|
||||
}
|
||||
|
||||
do_populate_sdk[nostamp] = "1"
|
||||
do_populate_sdk[recrdeptask] = "do_package_write"
|
||||
addtask populate_sdk before do_build after do_install
|
||||
Reference in New Issue
Block a user