Compare commits
2 Commits
master
...
remote-sst
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa22dbf4d3 | ||
|
|
5f0b014af3 |
@@ -6,10 +6,7 @@
|
|||||||
# dropping helpful information. In these situations one wants to debug NOW
|
# dropping helpful information. In these situations one wants to debug NOW
|
||||||
# without further waiting or quirky activities.
|
# without further waiting or quirky activities.
|
||||||
#
|
#
|
||||||
# To achieve, a debug sysroot is build with low cost:
|
# To achieve, a machine specific debug sysroot is build
|
||||||
#
|
|
||||||
# * All files are hard-linked to recipe's ${WORKDIR}/package
|
|
||||||
# * Additional build time for task do_copysourcestosysroot for most recipes is < 1s
|
|
||||||
#
|
#
|
||||||
# to enable debug sysroot build set:
|
# to enable debug sysroot build set:
|
||||||
# 'INHERIT += "instant-remote-debug"'
|
# 'INHERIT += "instant-remote-debug"'
|
||||||
@@ -30,10 +27,10 @@
|
|||||||
# -> Dialog 'Start Debugger' opens
|
# -> Dialog 'Start Debugger' opens
|
||||||
# * At the first session a so called 'Kit' has to be set up (1st line -> 'Manage').
|
# * At the first session a so called 'Kit' has to be set up (1st line -> 'Manage').
|
||||||
# The settings are kept so 1.-6. have to be done once only.
|
# The settings are kept so 1.-6. have to be done once only.
|
||||||
# 1. Create a Kit by 'Add' -> further dilaog opens
|
# 1. Create a Kit by 'Add' -> further dialog opens
|
||||||
# 2. Select an name for the Kit e.g 'OE'
|
# 2. Select an name for the Kit e.g 'OE'
|
||||||
# 3. Set sysroot (see INSTANT_REMOTE_PATH below):
|
# 3. Set sysroot (see INSTANT_REMOTE_PATH below):
|
||||||
# ${TMPDIR}/sysroot-instant-remote-${MACHINE}
|
# ${TMPDIR}/sysroot-instant-remote-${MACHINE_ARCH}
|
||||||
# 4. Select compilers (it is not necessary for debug but without QTCreator won't enable Kit) for C and C++ e.g:
|
# 4. Select compilers (it is not necessary for debug but without QTCreator won't enable Kit) for C and C++ e.g:
|
||||||
# C: '<TMDIR>/sysroot-instant-native/usr/bin/arm-mortsgna-linux-gnueabi/arm-mortsgna-linux-gnueabi-gcc'
|
# C: '<TMDIR>/sysroot-instant-native/usr/bin/arm-mortsgna-linux-gnueabi/arm-mortsgna-linux-gnueabi-gcc'
|
||||||
# C++: '<TMDIR>/sysroot-instant-native/usr/bin/arm-mortsgna-linux-gnueabi/arm-mortsgna-linux-gnueabi-g++'
|
# C++: '<TMDIR>/sysroot-instant-native/usr/bin/arm-mortsgna-linux-gnueabi/arm-mortsgna-linux-gnueabi-g++'
|
||||||
@@ -47,43 +44,33 @@
|
|||||||
#
|
#
|
||||||
# Happy debugging!!
|
# Happy debugging!!
|
||||||
#
|
#
|
||||||
# TODO:
|
|
||||||
# * Class won't work with rm_work.bbclass / rm_work_and_downloads.bbclass
|
|
||||||
# -> Implement error message
|
|
||||||
# * Class does not work properly when package data is taken from sstate cache
|
|
||||||
# -> Help appreciated
|
|
||||||
# * Class does not work properly for when changing machine
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# ensure necessary gdb recipes are build
|
# ensure necessary gdb recipes are build
|
||||||
EXTRA_IMAGEDEPENDS += "gdb-cross-${TARGET_ARCH} gdb"
|
EXTRA_IMAGEDEPENDS += "gdb-cross-${TARGET_ARCH} gdb"
|
||||||
|
|
||||||
# This is where instant sysroot is installed into
|
# This is where instant sysroot is installed into
|
||||||
INSTANT_REMOTE_PATH = "${TMPDIR}/sysroot-instant-remote-${MACHINE}"
|
INSTANT_REMOTE_PATH = "${TMPDIR}/sysroot-instant-remote-${MACHINE_ARCH}"
|
||||||
|
WORK_REMOTE_PATH = "${WORKDIR}/sysroot-instant-remote"
|
||||||
|
|
||||||
addtask copysourcestosysroot before do_packagedata after do_package
|
python __anonymous () {
|
||||||
|
if d.getVar('CLASSOVERRIDE') != 'class-target':
|
||||||
|
bb.build.deltask('do_copysourcestosysroot', d)
|
||||||
|
}
|
||||||
|
|
||||||
do_copysourcestosysroot() {
|
do_copysourcestosysroot() {
|
||||||
# remove old source code / files in old manifest
|
if [ ! -d "${WORKDIR}/packages-split" -o ! -d ${WORKDIR}/package ]; then
|
||||||
rm -rf ${INSTANT_REMOTE_PATH}/usr/src/debug/${PN}
|
exit 0
|
||||||
if [ -f ${INSTANT_REMOTE_PATH}/manifests/${PN} ] ; then
|
|
||||||
# remove old files from sysroot
|
|
||||||
for file in `cat ${INSTANT_REMOTE_PATH}/manifests/${PN}` ; do
|
|
||||||
rm -f ${INSTANT_REMOTE_PATH}/$file
|
|
||||||
done
|
|
||||||
# remove old manifest
|
|
||||||
rm ${INSTANT_REMOTE_PATH}/manifests/${PN}
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ---------- link source code files ----------
|
# ---------- link source code files ----------
|
||||||
if [ -d ${WORKDIR}/package/usr/src/debug/${PN} ] ; then
|
if [ -d ${WORKDIR}/package/usr/src/debug/${PN} ] ; then
|
||||||
mkdir -p ${INSTANT_REMOTE_PATH}/usr/src/debug/${PN}
|
mkdir -p ${WORK_REMOTE_PATH}/usr/src/debug/${PN}
|
||||||
cd ${WORKDIR}/package/usr/src/debug/${PN}
|
cd ${WORKDIR}/package/usr/src/debug/${PN}
|
||||||
find . -print0 | cpio --null -pdlu ${INSTANT_REMOTE_PATH}/usr/src/debug/${PN}
|
find . -print0 | cpio --null -pdlu ${WORK_REMOTE_PATH}/usr/src/debug/${PN}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ---------- names of binaries and debuginfo -> manifest ----------
|
# ---------- names of binaries and debuginfo -> manifest ----------
|
||||||
mkdir -p ${INSTANT_REMOTE_PATH}/manifests
|
mkdir -p ${WORK_REMOTE_PATH}/manifests
|
||||||
# get path to library-link once only
|
# get path to library-link once only
|
||||||
if [ "${PN}" = "glibc-locale" ] ; then
|
if [ "${PN}" = "glibc-locale" ] ; then
|
||||||
PACK_SPLIT_LIB_LINK_SEARCH_PATH=`find ${WORKDIR}/packages-split -mindepth 1 -maxdepth 1 -type d ! -name '*-dbg' ! -name '*-dev' ! -name '*-staticdev' ! -name '*-doc' ! -name 'glibc*-localedata-*' ! -name 'glibc-charmap-*' ! -name 'locale-base-*'`
|
PACK_SPLIT_LIB_LINK_SEARCH_PATH=`find ${WORKDIR}/packages-split -mindepth 1 -maxdepth 1 -type d ! -name '*-dbg' ! -name '*-dev' ! -name '*-staticdev' ! -name '*-doc' ! -name 'glibc*-localedata-*' ! -name 'glibc-charmap-*' ! -name 'locale-base-*'`
|
||||||
@@ -115,8 +102,8 @@ do_copysourcestosysroot() {
|
|||||||
filestripped=`echo $file | sed -e 's:\.debug/::'`
|
filestripped=`echo $file | sed -e 's:\.debug/::'`
|
||||||
fi
|
fi
|
||||||
# keep files in manifest
|
# keep files in manifest
|
||||||
echo $file >> ${INSTANT_REMOTE_PATH}/manifests/${PN}
|
echo $file >> ${WORK_REMOTE_PATH}/manifests/${PN}
|
||||||
echo $filestripped >> ${INSTANT_REMOTE_PATH}/manifests/${PN}
|
echo $filestripped >> ${WORK_REMOTE_PATH}/manifests/${PN}
|
||||||
# check for so-file links
|
# check for so-file links
|
||||||
if echo $filestripped | grep -q '\.so'; then
|
if echo $filestripped | grep -q '\.so'; then
|
||||||
soname=`basename $filestripped`
|
soname=`basename $filestripped`
|
||||||
@@ -124,7 +111,7 @@ do_copysourcestosysroot() {
|
|||||||
for link in `find $packsplit -lname $soname` ; do
|
for link in `find $packsplit -lname $soname` ; do
|
||||||
# do 'root' path
|
# do 'root' path
|
||||||
link=`echo $link | sed -e 's:'$packsplit'::'`
|
link=`echo $link | sed -e 's:'$packsplit'::'`
|
||||||
echo $link >> ${INSTANT_REMOTE_PATH}/manifests/${PN}
|
echo $link >> ${WORK_REMOTE_PATH}/manifests/${PN}
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
@@ -135,37 +122,37 @@ do_copysourcestosysroot() {
|
|||||||
for include in `find ${WORKDIR}/packages-split/${PN}-dev/${includedir} -type f` ; do
|
for include in `find ${WORKDIR}/packages-split/${PN}-dev/${includedir} -type f` ; do
|
||||||
# do 'root' path
|
# do 'root' path
|
||||||
include=`echo $include | sed -e 's:'${WORKDIR}/packages-split/${PN}-dev/'::'`
|
include=`echo $include | sed -e 's:'${WORKDIR}/packages-split/${PN}-dev/'::'`
|
||||||
echo $include >> ${INSTANT_REMOTE_PATH}/manifests/${PN}
|
echo $include >> ${WORK_REMOTE_PATH}/manifests/${PN}
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ---------- link to files in package folder from manifest ----------
|
# ---------- link to files in package folder from manifest ----------
|
||||||
if [ -f ${INSTANT_REMOTE_PATH}/manifests/${PN} ] ; then
|
if [ -f ${WORK_REMOTE_PATH}/manifests/${PN} ] ; then
|
||||||
cd ${WORKDIR}/package
|
cd ${WORKDIR}/package
|
||||||
for file in `cat ${INSTANT_REMOTE_PATH}/manifests/${PN}` ; do
|
for file in `cat ${WORK_REMOTE_PATH}/manifests/${PN}` ; do
|
||||||
file=`echo $file | cut -c 2-`
|
file=`echo $file | cut -c 2-`
|
||||||
if [ -e $file ] ; then
|
if [ -e $file ] ; then
|
||||||
echo -n $file | cpio --null -pdlu ${INSTANT_REMOTE_PATH}
|
echo -n $file | cpio --null -pdlu ${WORK_REMOTE_PATH}
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# remove source code links
|
addtask copysourcestosysroot after do_package before do_build
|
||||||
do_clean[cleandirs] += "${INSTANT_REMOTE_PATH}/usr/src/debug/${PN}"
|
SSTATETASKS += "do_copysourcestosysroot"
|
||||||
|
|
||||||
do_clean_append() {
|
do_copysourcestosysroot[sstate-inputdirs] = "${WORK_REMOTE_PATH}"
|
||||||
# remove binaries from mainfest
|
do_copysourcestosysroot[sstate-outputdirs] = "${INSTANT_REMOTE_PATH}"
|
||||||
manifest = "%s/manifests/%s" % (d.expand("${INSTANT_REMOTE_PATH}"), d.expand("${PN}"))
|
|
||||||
if os.path.isfile(manifest):
|
|
||||||
bb.note("Removing all files from manifest " + manifest)
|
|
||||||
manifestfile = open(manifest, "r")
|
|
||||||
for filetoremove in manifestfile:
|
|
||||||
filetoremove = filetoremove.rstrip()
|
|
||||||
filetoremove = d.expand("${INSTANT_REMOTE_PATH}") + filetoremove
|
|
||||||
if os.path.isfile(filetoremove):
|
|
||||||
os.remove(filetoremove)
|
|
||||||
manifestfile.close()
|
|
||||||
|
|
||||||
os.remove(manifest)
|
# same as do package
|
||||||
|
do_copysourcestosysroot[vardeps] = "${PACKAGEBUILDPKGD} ${PACKAGESPLITFUNCS} ${PACKAGEFUNCS} ${@gen_packagevar(d)}"
|
||||||
|
|
||||||
|
do_copysourcestosysroot[stamp-extra-info] = "${MACHINE_ARCH}"
|
||||||
|
do_copysourcestosysroot[cleandirs] = "${WORK_REMOTE_PATH}"
|
||||||
|
|
||||||
|
python do_copysourcestosysroot_setscene () {
|
||||||
|
sstate_setscene(d)
|
||||||
}
|
}
|
||||||
|
addtask do_copysourcestosysroot_setscene
|
||||||
|
|
||||||
|
do_build[recrdeptask] += "do_copysourcestosysroot"
|
||||||
|
|||||||
Reference in New Issue
Block a user