2005-08-31 10:45:47 +00:00
|
|
|
#
|
|
|
|
# Creates a root filesystem out of IPKs
|
|
|
|
#
|
|
|
|
# This rootfs can be mounted via root-nfs or it can be put into an cramfs/jffs etc.
|
2007-01-08 21:06:47 +00:00
|
|
|
# See image.bbclass for a usage of this.
|
2005-08-31 10:45:47 +00:00
|
|
|
#
|
|
|
|
|
2009-07-15 12:43:33 +00:00
|
|
|
EXTRAOPKGCONFIG ?= ""
|
2009-07-15 11:57:10 +00:00
|
|
|
ROOTFS_PKGMANAGE = "opkg opkg-collateral ${EXTRAOPKGCONFIG}"
|
2008-05-20 14:58:34 +00:00
|
|
|
ROOTFS_PKGMANAGE_BOOTSTRAP = "run-postinsts"
|
|
|
|
|
2009-11-10 14:55:23 +00:00
|
|
|
do_rootfs[depends] += "opkg-native:do_populate_sysroot opkg-utils-native:do_populate_sysroot"
|
2007-08-21 09:37:30 +00:00
|
|
|
do_rootfs[recrdeptask] += "do_package_write_ipk"
|
2013-03-07 03:26:13 +00:00
|
|
|
rootfs_ipk_do_rootfs[vardepsexclude] += "BUILDNAME"
|
2005-08-31 10:45:47 +00:00
|
|
|
|
2012-06-23 00:38:30 +00:00
|
|
|
do_rootfs[lockfiles] += "${WORKDIR}/ipk.lock"
|
|
|
|
|
2008-10-02 09:42:27 +00:00
|
|
|
OPKG_PREPROCESS_COMMANDS = "package_update_index_ipk; package_generate_ipkg_conf"
|
|
|
|
|
Rework installation of dev, dbg, doc, and locale packages
Use a similar mechanism that was previously used to install locales at
rootfs generation time to install other "complementary" packages (e.g.
*-dev packages) - i.e. install all of the explicitly requested packages
and their dependencies, then get a list of the packages that were
installed, and use that list to install the complementary packages. This
has been implemented by using a list of globs which should make it
easier to extend in future.
The previous locale package installation code assumed that the locale
packages did not have any dependencies that were not already installed;
now that we are installing non-locale packages this is no longer
correct. In practice only the rpm backend actually made use of this
assumption, so it needed to be changed to call into the existing package
backend code to do the complementary package installation rather than
calling rpm directly.
This fixes the doc-pkgs IMAGE_FEATURES feature to work correctly, and
also ensures that all dev/dbg packages get installed for
dev-pkgs/dbg-pkgs respectively even if the dependency chains between
those packages was not ensuring that already.
The code has also been adapted to work correctly with the new
SDK-from-image functionality. To that end, an SDKIMAGE_FEATURES variable
has been added to allow specifying what extra image features should go
into the SDK (extra, because by virtue of installing all of the packages
in the image into the target part of the SDK, we already include all of
IMAGE_FEATURES) with a default value of "dev-pkgs dbg-pkgs".
Fixes [YOCTO #2614].
(From OE-Core rev: 72d1048a8381fa4a8c4c0d082047536727b4be47)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-09 13:15:08 +00:00
|
|
|
OPKG_POSTPROCESS_COMMANDS = "ipk_insert_feed_uris; "
|
2008-10-01 15:38:55 +00:00
|
|
|
|
2013-02-04 22:06:52 +00:00
|
|
|
OPKGLIBDIR = "${localstatedir}/lib"
|
2010-08-26 04:39:07 +00:00
|
|
|
|
2013-02-04 22:06:52 +00:00
|
|
|
MULTILIBRE_ALLOW_REP = "${OPKGLIBDIR}/opkg"
|
2011-07-11 12:14:15 +00:00
|
|
|
|
2007-09-01 15:25:40 +00:00
|
|
|
fakeroot rootfs_ipk_do_rootfs () {
|
2013-01-31 08:36:55 +00:00
|
|
|
#set -x
|
2007-09-01 15:25:40 +00:00
|
|
|
|
2008-10-08 22:20:14 +00:00
|
|
|
rm -f ${IPKGCONF_TARGET}
|
2008-10-08 16:49:57 +00:00
|
|
|
touch ${IPKGCONF_TARGET}
|
|
|
|
|
2008-10-01 15:52:19 +00:00
|
|
|
${OPKG_PREPROCESS_COMMANDS}
|
2007-09-01 15:25:40 +00:00
|
|
|
|
2008-06-05 21:18:11 +00:00
|
|
|
mkdir -p ${T}/
|
2011-07-11 12:14:15 +00:00
|
|
|
|
2012-12-06 11:38:59 +00:00
|
|
|
export INSTALL_CONF_IPK="${IPKGCONF_TARGET}"
|
|
|
|
export INSTALL_ROOTFS_IPK="${IMAGE_ROOTFS}"
|
2013-02-04 22:06:52 +00:00
|
|
|
STATUS=${IMAGE_ROOTFS}${OPKGLIBDIR}/opkg/status
|
|
|
|
mkdir -p ${IMAGE_ROOTFS}${OPKGLIBDIR}/opkg
|
2011-07-11 12:14:15 +00:00
|
|
|
|
2012-12-06 11:38:59 +00:00
|
|
|
opkg-cl ${OPKG_ARGS} update
|
2011-07-11 12:14:15 +00:00
|
|
|
|
|
|
|
# prime the status file with bits that we don't want
|
|
|
|
for i in ${BAD_RECOMMENDATIONS}; do
|
2012-12-06 11:38:59 +00:00
|
|
|
pkginfo="`opkg-cl ${OPKG_ARGS} info $i`"
|
2011-07-11 12:14:15 +00:00
|
|
|
if [ ! -z "$pkginfo" ]; then
|
2013-02-19 21:31:52 +00:00
|
|
|
# Take just the first package stanza as otherwise only
|
|
|
|
# the last one will have the right Status line.
|
|
|
|
echo "$pkginfo" | awk "/^Package:/ { print } \
|
|
|
|
/^Architecture:/ { print } \
|
|
|
|
/^Version:/ { print } \
|
|
|
|
/^$/ { exit } \
|
|
|
|
END { print \"Status: deinstall hold not-installed\n\" }" - >> $STATUS
|
2011-07-11 12:14:15 +00:00
|
|
|
else
|
|
|
|
echo "Requested ignored recommendation $i is not a package"
|
|
|
|
fi
|
|
|
|
done
|
2008-11-06 16:23:32 +00:00
|
|
|
|
2011-01-30 04:56:40 +00:00
|
|
|
#install
|
|
|
|
export INSTALL_PACKAGES_ATTEMPTONLY_IPK="${PACKAGE_INSTALL_ATTEMPTONLY}"
|
|
|
|
export INSTALL_PACKAGES_LINGUAS_IPK="${LINGUAS_INSTALL}"
|
|
|
|
export INSTALL_TASK_IPK="rootfs"
|
|
|
|
|
2012-12-06 11:38:59 +00:00
|
|
|
|
2011-11-08 06:19:37 +00:00
|
|
|
export INSTALL_PACKAGES_IPK="${PACKAGE_INSTALL}"
|
2011-01-30 04:56:40 +00:00
|
|
|
|
|
|
|
#post install
|
2005-08-31 10:45:47 +00:00
|
|
|
export D=${IMAGE_ROOTFS}
|
2006-09-19 09:04:09 +00:00
|
|
|
export OFFLINE_ROOT=${IMAGE_ROOTFS}
|
2005-08-31 10:45:47 +00:00
|
|
|
export IPKG_OFFLINE_ROOT=${IMAGE_ROOTFS}
|
2008-03-20 17:17:08 +00:00
|
|
|
export OPKG_OFFLINE_ROOT=${IPKG_OFFLINE_ROOT}
|
2012-09-18 15:47:59 +00:00
|
|
|
export INTERCEPT_DIR=${WORKDIR}/intercept_scripts
|
|
|
|
export NATIVE_ROOT=${STAGING_DIR_NATIVE}
|
2008-03-20 17:17:08 +00:00
|
|
|
|
2011-12-15 21:08:49 +00:00
|
|
|
package_install_internal_ipk
|
|
|
|
|
2009-07-15 11:57:10 +00:00
|
|
|
# Distro specific packages should create this
|
|
|
|
#mkdir -p ${IMAGE_ROOTFS}/etc/opkg/
|
|
|
|
#grep "^arch" ${IPKGCONF_TARGET} >${IMAGE_ROOTFS}/etc/opkg/arch.conf
|
2005-08-31 10:45:47 +00:00
|
|
|
|
Rework installation of dev, dbg, doc, and locale packages
Use a similar mechanism that was previously used to install locales at
rootfs generation time to install other "complementary" packages (e.g.
*-dev packages) - i.e. install all of the explicitly requested packages
and their dependencies, then get a list of the packages that were
installed, and use that list to install the complementary packages. This
has been implemented by using a list of globs which should make it
easier to extend in future.
The previous locale package installation code assumed that the locale
packages did not have any dependencies that were not already installed;
now that we are installing non-locale packages this is no longer
correct. In practice only the rpm backend actually made use of this
assumption, so it needed to be changed to call into the existing package
backend code to do the complementary package installation rather than
calling rpm directly.
This fixes the doc-pkgs IMAGE_FEATURES feature to work correctly, and
also ensures that all dev/dbg packages get installed for
dev-pkgs/dbg-pkgs respectively even if the dependency chains between
those packages was not ensuring that already.
The code has also been adapted to work correctly with the new
SDK-from-image functionality. To that end, an SDKIMAGE_FEATURES variable
has been added to allow specifying what extra image features should go
into the SDK (extra, because by virtue of installing all of the packages
in the image into the target part of the SDK, we already include all of
IMAGE_FEATURES) with a default value of "dev-pkgs dbg-pkgs".
Fixes [YOCTO #2614].
(From OE-Core rev: 72d1048a8381fa4a8c4c0d082047536727b4be47)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-09 13:15:08 +00:00
|
|
|
rootfs_install_complementary
|
|
|
|
|
2008-10-01 15:52:19 +00:00
|
|
|
${OPKG_POSTPROCESS_COMMANDS}
|
2008-06-06 14:13:40 +00:00
|
|
|
${ROOTFS_POSTINSTALL_COMMAND}
|
2013-02-12 16:12:38 +00:00
|
|
|
|
|
|
|
install -d ${IMAGE_ROOTFS}/${sysconfdir}
|
|
|
|
echo ${BUILDNAME} > ${IMAGE_ROOTFS}/${sysconfdir}/version
|
|
|
|
|
|
|
|
${ROOTFS_POSTPROCESS_COMMAND}
|
|
|
|
|
2011-05-24 14:49:10 +00:00
|
|
|
if ${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "true", "false" ,d)}; then
|
2013-11-21 07:34:41 +00:00
|
|
|
delayed_postinsts="$(delayed_postinsts)"
|
|
|
|
if [ -n "$delayed_postinsts" ]; then
|
|
|
|
bberror "The following packages could not be configured offline and rootfs is read-only: $delayed_postinsts"
|
2011-05-24 14:49:10 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2013-02-04 22:06:52 +00:00
|
|
|
rm -f ${IMAGE_ROOTFS}${OPKGLIBDIR}/opkg/lists/*
|
2012-10-21 15:40:43 +00:00
|
|
|
log_check rootfs
|
2005-08-31 10:45:47 +00:00
|
|
|
}
|
|
|
|
|
2013-05-21 11:17:19 +00:00
|
|
|
rootfs_ipk_do_rootfs[vardeps] += "delayed_postinsts"
|
|
|
|
|
|
|
|
delayed_postinsts () {
|
|
|
|
cat ${STATUS}|grep -e "^Package:" -e "^Status:"|sed -ne 'N;s/Package: \(.*\)\nStatus:.*unpacked/\1/p'
|
|
|
|
}
|
|
|
|
|
|
|
|
save_postinsts () {
|
2013-10-04 15:48:19 +00:00
|
|
|
# Scripts need to be ordered when executed, this ensures numeric order
|
|
|
|
# If we ever run into needing more the 899 scripts, we'll have to
|
|
|
|
# change num to start with 1000.
|
|
|
|
num=100
|
2013-05-21 11:17:19 +00:00
|
|
|
for p in $(delayed_postinsts); do
|
|
|
|
install -d ${IMAGE_ROOTFS}${sysconfdir}/ipk-postinsts
|
2013-10-04 15:48:19 +00:00
|
|
|
cp ${IMAGE_ROOTFS}${OPKGLIBDIR}/opkg/info/$p.postinst ${IMAGE_ROOTFS}${sysconfdir}/ipk-postinsts/$num-$p
|
|
|
|
num=`echo \$((num+1))`
|
2013-05-21 11:17:19 +00:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2007-06-26 11:35:20 +00:00
|
|
|
remove_packaging_data_files() {
|
2013-02-04 22:06:52 +00:00
|
|
|
rm -rf ${IMAGE_ROOTFS}${OPKGLIBDIR}/opkg
|
2012-10-21 15:40:43 +00:00
|
|
|
# We need the directory for the package manager lock
|
2013-02-04 22:06:52 +00:00
|
|
|
mkdir ${IMAGE_ROOTFS}${OPKGLIBDIR}/opkg
|
2007-06-26 11:35:20 +00:00
|
|
|
}
|
2008-06-05 20:51:43 +00:00
|
|
|
|
2011-12-22 14:46:32 +00:00
|
|
|
rootfs_install_packages() {
|
2012-12-06 11:38:59 +00:00
|
|
|
opkg-cl ${OPKG_ARGS} install `cat $1`
|
2008-06-05 20:51:43 +00:00
|
|
|
}
|
|
|
|
|
2013-08-24 16:01:20 +00:00
|
|
|
rootfs_uninstall_packages() {
|
2013-05-21 11:17:19 +00:00
|
|
|
opkg-cl ${OPKG_ARGS} --force-depends remove $@
|
|
|
|
}
|
|
|
|
|
2008-10-01 15:38:55 +00:00
|
|
|
ipk_insert_feed_uris () {
|
|
|
|
|
2008-10-08 16:49:57 +00:00
|
|
|
echo "Building from feeds activated!"
|
2008-10-01 15:38:55 +00:00
|
|
|
|
2008-10-08 16:49:57 +00:00
|
|
|
for line in ${IPK_FEED_URIS}
|
|
|
|
do
|
|
|
|
# strip leading and trailing spaces/tabs, then split into name and uri
|
|
|
|
line_clean="`echo "$line"|sed 's/^[ \t]*//;s/[ \t]*$//'`"
|
|
|
|
feed_name="`echo "$line_clean" | sed -n 's/\(.*\)##\(.*\)/\1/p'`"
|
|
|
|
feed_uri="`echo "$line_clean" | sed -n 's/\(.*\)##\(.*\)/\2/p'`"
|
2008-10-01 15:38:55 +00:00
|
|
|
|
2008-10-08 16:49:57 +00:00
|
|
|
echo "Added $feed_name feed with URL $feed_uri"
|
2008-10-01 15:38:55 +00:00
|
|
|
|
2008-10-08 16:49:57 +00:00
|
|
|
# insert new feed-sources
|
|
|
|
echo "src/gz $feed_name $feed_uri" >> ${IPKGCONF_TARGET}
|
2011-12-06 20:19:30 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
# Allow to use package deploy directory contents as quick devel-testing
|
|
|
|
# feed. This creates individual feed configs for each arch subdir of those
|
|
|
|
# specified as compatible for the current machine.
|
|
|
|
# NOTE: Development-helper feature, NOT a full-fledged feed.
|
|
|
|
if [ -n "${FEED_DEPLOYDIR_BASE_URI}" ]; then
|
|
|
|
for arch in ${PACKAGE_ARCHS}
|
|
|
|
do
|
|
|
|
echo "src/gz local-$arch ${FEED_DEPLOYDIR_BASE_URI}/$arch" >> ${IMAGE_ROOTFS}/etc/opkg/local-$arch-feed.conf
|
|
|
|
done
|
|
|
|
fi
|
2008-10-01 15:38:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
python () {
|
2009-11-08 22:32:43 +00:00
|
|
|
|
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
|
|
|
if d.getVar('BUILD_IMAGES_FROM_FEEDS', True):
|
|
|
|
flags = d.getVarFlag('do_rootfs', 'recrdeptask')
|
2008-10-01 15:38:55 +00:00
|
|
|
flags = flags.replace("do_package_write_ipk", "")
|
|
|
|
flags = flags.replace("do_deploy", "")
|
2009-11-10 14:55:23 +00:00
|
|
|
flags = flags.replace("do_populate_sysroot", "")
|
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata:
sed \
-e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \
-e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \
-e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \
-e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \
-i `grep -ril bb.data *`
(From OE-Core rev: b22831fd63164c4db9c0b72934d7d734a6585251)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-09 15:00:01 +00:00
|
|
|
d.setVarFlag('do_rootfs', 'recrdeptask', flags)
|
|
|
|
d.setVar('OPKG_PREPROCESS_COMMANDS', "package_generate_archlist\nipk_insert_feed_uris")
|
|
|
|
d.setVar('OPKG_POSTPROCESS_COMMANDS', '')
|
2008-10-01 15:38:55 +00:00
|
|
|
}
|
|
|
|
|