1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 # T2 SDE: target/reference/build.sh
5 # Copyright (C) 2004 - 2020 The T2 SDE Project
7 # More information can be found in the files COPYING and README.
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; version 2 of the License. A copy of the
12 # GNU General Public License can be found in the file COPYING.
13 # --- T2-COPYRIGHT-NOTE-END ---
15 build_result
="$build_toolchain/result"
19 # Rebuild command line without '$cmd_maketar'
21 cmd_buildpkg
="./scripts/Build-Pkg -$stagelevel -cfg $config"
22 cmd_buildpkg
="$cmd_buildpkg $cmd_root $cmd_prefix $pkg_name"
30 if [ -f "$build_root/var/adm/cache/$pkg_name" ] ; then
31 dir
="$build_result/package/$pkg_tree/$pkg_name" ; mkdir
-p $dir
32 cp $build_root/var
/adm
/cache
/$pkg_name $dir/$pkg_name.cache
40 echo_header
"Finishing build."
42 mkdir
-p "$build_result/scripts"
44 echo_status
"Copying error logs and t2-debug data."
45 mkdir
-p $build_result/{errors
,t2-debug
,dep-debug
}
46 cp $build_root/var
/adm
/t2-debug
/* $build_result/t2-debug
/
47 cp $build_root/var
/adm
/dep-debug
/* $build_result/dep-debug
/
48 cp $build_root/var
/adm
/logs
/*.err
$build_result/errors
/
50 echo_status
"Creating package database ..."
51 admdir
="build/${SDECFG_ID}/var/adm"
52 create_package_db
$admdir build
/${SDECFG_ID}/TOOLCHAIN
/pkgs \
53 build
/${SDECFG_ID}/TOOLCHAIN
/pkgs
/packages.db
55 echo_status
"Creating isofs.txt file .."
56 cat << EOT > build/${SDECFG_ID}/TOOLCHAIN/isofs.txt
57 DISK1 $admdir/cache/ ${SDECFG_SHORTID}/info/cache/
58 DISK1 $admdir/cksums/ ${SDECFG_SHORTID}/info/cksums/
59 DISK1 $admdir/dependencies/ ${SDECFG_SHORTID}/info/dependencies/
60 DISK1 $admdir/descs/ ${SDECFG_SHORTID}/info/descs/
61 DISK1 $admdir/flists/ ${SDECFG_SHORTID}/info/flists/
62 DISK1 $admdir/md5sums/ ${SDECFG_SHORTID}/info/md5sums/
63 DISK1 $admdir/packages/ ${SDECFG_SHORTID}/info/packages/
64 EVERY build/${SDECFG_ID}/TOOLCHAIN/pkgs/packages.db ${SDECFG_SHORTID}/pkgs/packages.db
65 SPLIT build/${SDECFG_ID}/TOOLCHAIN/pkgs/ ${SDECFG_SHORTID}/pkgs/
68 echo_header
"Reference build finished."
70 cat <<- EOT > build/${SDECFG_ID}/TOOLCHAIN/result/copy-cache.sh
72 cd $base/build/${SDECFG_ID}/TOOLCHAIN/result
73 find package -type f | while read fn
74 do [ -f ../../../\${fn%.cache}.desc ] && cp -v \$fn ../../../\$fn; done
77 chmod +x build
/${SDECFG_ID}/TOOLCHAIN
/result
/copy-cache.sh
79 echo_status
"Results are stored in the directory"
80 echo_status
"build/$SDECFG_ID/TOOLCHAIN/result/."