meta-agl.md: remove link to meta-agl-extra
[AGL/meta-agl.git] / scripts / .aglsetup_genconfig.bash
index b0d24e5..e95605a 100755 (executable)
@@ -302,6 +302,8 @@ BUILDDIR=$DEFAULT_BUILDDIR
 SETUPSCRIPT=
 FORCE=
 RPMREVISION=
+SETUP_MANIFEST=aglsetup.manifest
+
 while true; do
        case "$1" in
                -m|--machine)      MACHINE=$2; shift 2;;
@@ -407,6 +409,12 @@ function genconfig() {
                append_fragment $BUILDDIR/conf/local.conf $file
                verbose "      + $file"
        done
+       # special fragment to call distro-manifest-generator.sh from 
+       # meta-agl-profile-core/recipes-core/distro-build-manifest/distro-build-manifest.bb
+       append_fragment $BUILDDIR/conf/local.conf /dev/stdin "# generated by $(realpath $BASH_SOURCE)" <<-EOF
+               DISTRO_SETUP_MANIFEST = "$(realpath -Ls $BUILDDIR)/$SETUP_MANIFEST"
+               DISTRO_MANIFEST_GENERATOR = "$(dirname $(realpath $BASH_SOURCE))/distro-manifest-generator.sh"
+       EOF
 
        FRAGMENTS_SETUP=$(sed 's/ /\n/g' <<<$FRAGMENTS_SETUP | sort)
        debug "setup fragments: $FRAGMENTS_SETUP"
@@ -455,6 +463,8 @@ EOF
        $BUILDDIR/conf/setup.* \
        $BUILDDIR/conf/*.log
 
+####### step 1: generate configuration file #######
+
 if [[ -f $BUILDDIR/conf/local.conf || -f $BUILDDIR/conf/bblayers.conf ]]; then
        info "Configuration files already exist:"
        for x in $BUILDDIR/conf/local.conf $BUILDDIR/conf/bblayers.conf; do
@@ -466,6 +476,43 @@ else
        genconfig
 fi
 
+####### step 2: generate aglsetup.manifest #######
+
+infon "Generating setup manifest: $BUILDDIR/$SETUP_MANIFEST ... "
+for x in /etc/os-release /usr/lib/os-release; do
+       [[ -f $x ]] && . $x
+done
+FEATURES_md5=$(echo $FEATURES|md5sum -|awk '{print $1;}')
+cat <<EOF >$BUILDDIR/$SETUP_MANIFEST
+# ----------------------------------------------
+# This fragment has been generated by $SCRIPT at setup time
+
+# distro name
+DIST_DISTRO_NAME="AGL"
+
+# target machine as passed to $SCRIPT
+DIST_MACHINE="$MACHINE"
+
+# features as resolved by $SCRIPT
+DIST_FEATURES="$FEATURES"
+DIST_FEATURES_MD5="${FEATURES_md5}"
+
+# build host information deduced from os-release
+DIST_BUILD_HOST="$(id -un)@$(hostname -f || hostname || hostname -s)"
+DIST_BUILD_OS="${PRETTY_NAME:-${NAME} ${VERSION} [COMPUTED]}"
+
+# meta directory
+DIST_METADIR="$METADIR"
+
+# timestamp
+DIST_SETUP_TS="$(date -u +%Y%m%d_%H%M%S_%Z)"
+
+# ------------ end of $SCRIPT fragment --------
+EOF
+info "OK"
+
+####### step 3: generate agl-init-build-env #######
+
 # always generate setup script in builddir: it can be sourced later manually without re-running the setup
 infon "Generating setup file: $BUILDDIR/agl-init-build-env ... "
 
@@ -482,6 +529,8 @@ unset TEMPLATECONF
 EOF
 info "OK"
 
+####### step 4: generate output script #######
+
 # finally, generate output script if requested by caller
 if [[ -n "$SETUPSCRIPT" ]]; then
        debug "generating setupscript in $SETUPSCRIPT"