●ビルド手順
	本ビルド手順は、2023/05/16の時点で検証しています。
	以降は、リンク切れが発生する可能性があるため、ご了承ください。

ⅰ. Base環境の取得

	1.repoを取得します。
		$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo_howtobuild
		$ chmod a+rwx ~/bin/repo_howtobuild

	2.Base環境のrepoを初期化します。
		$ repo_howtobuild init -u https://git.codelinaro.org/clo/le/mdm/manifest.git -b caf_migration/release -m LE.BR.1.2.1-65700-9x07.xml
		
	3.ManifestFileのリンク切れを最新化します。
		$ sed -i "s/caf/clo/" .repo/manifests/LE.BR.1.2.1-65700-9x07.xml
		$ sed -i "s/quic/clo/" .repo/manifests/LE.BR.1.2.1-65700-9x07.xml
		$ sed -i "s/git:\/\/codeaurora/https:\/\/git.codelinaro/" .repo/manifests/LE.BR.1.2.1-65700-9x07.xml
		$ sed -i "s/source.codeaurora.org\/\" name=\"clo\" review=\"codeaurora/git.codelinaro.org\" name=\"clo\" review=\"codelinaro/" .repo/manifests/LE.BR.1.2.1-65700-9x07.xml
		$ sed -i "s/name=\"device\/qcom\/common\"/name=\"clo\/la\/device\/qcom\/common\" path=\"device\/qcom\/common\"/" .repo/manifests/LE.BR.1.2.1-65700-9x07.xml
		$ sed -i "s/name=\"platform/name=\"clo\/la\/platform/" .repo/manifests/LE.BR.1.2.1-65700-9x07.xml
		$ sed -i "s/name=\"kernel/name=\"clo\/la\/kernel/" .repo/manifests/LE.BR.1.2.1-65700-9x07.xml
		$ sed -i "s/platform\/build/platform\/build_repo/" .repo/manifests/LE.BR.1.2.1-65700-9x07.xml
		$ sed -i "s/LE.BR.1.2.1/caf_migration\/LE.BR.1.2.1/" .repo/manifests/LE.BR.1.2.1-65700-9x07.xml
		$ sed -i '/compat-wireless/s/mdm/caf_migration\/mdm/g' .repo/manifests/LE.BR.1.2.1-65700-9x07.xml
		$ sed -i '/extras/s/lp/caf_migration\/lp/g' .repo/manifests/LE.BR.1.2.1-65700-9x07.xml
		
		※repo_howtobuildに指定するManifestFileについては下記のURLで一覧が公開されています。
		https://git.codelinaro.org/clo/le/mdm/manifest
		
	4.Base環境のソースコードを取得します。
		$ repo_howtobuild sync

ⅱ. ソースコードのビルド

	1.***_kernel_***.tar.gzを解凍し、Base環境に上書きしてください。
		$ tar xvf ***_kernel_***.tar.gz
		$ cp -rf kernel/* ＜Base環境＞/

	2.***_opensource_***.tar.gzを解凍し、Base環境に上書きしてください。
		$ tar xvf ***_opensource_***.tar.gz
		$ cp -rf opensource/* ＜Base環境＞/

	3.Quallcom Proprietary Build Ruleを無効化します。
		$ find -type f -name "*.bb" -or -name "*.bbappend" -or -name "*.inc" | xargs sed -i 's/ qcommon //g'
		$ find -type f -name "*.bb" -or -name "*.bbappend" -or -name "*.inc" | xargs sed -i 's/qcommon //g'
		$ find -type f -name "*.bb" -or -name "*.bbappend" -or -name "*.inc" | xargs sed -i 's/ qcommon//g'
		$ find -type f -name "*.bb" -or -name "*.bbappend" -or -name "*.inc" | xargs sed -i -z 's/inherit\n/inherit autotools\n/g'

	4.リンク切れのURLを最新化します。
		○ site.conf 更新
		$ sed -i "s/{CAF_MIRROR}/{CLO_MIRROR}/" oe-core/meta-msm/conf/site.conf
		$ sed -i '41a CLO_MIRROR = "https://codelinaro.jfrog.io/artifactory/codelinaro-le/"' oe-core/meta-msm/conf/site.conf
		$ sed -i '42a CLO_LE_GIT = "git://git.codelinaro.org/clo/le"' oe-core/meta-msm/conf/site.conf
		$ sed -i '43a CLO_LA_GIT = "git://git.codelinaro.org/clo/la"' oe-core/meta-msm/conf/site.conf

		○ prelink_git.bbappend 更新
		$ sed -i -e '1,5 s/\ \\$//g' oe-core/meta-msm/recipes/prelink/prelink_git.bbappend
		$ sed -i -e '1,5 s/\"$//g' oe-core/meta-msm/recipes/prelink/prelink_git.bbappend
		$ sed -i -e "s/\${CAF_GIT}/\${CLO_LE_GIT}/" -e "s/protocol=git/protocol=https/" -e "s/branch=yocto/branch=caf_migration\/yocto/" oe-core/meta-msm/recipes/prelink/prelink_git.bbappend
		$ sed -i -e "2,5 s/           file:/SRC_URI =+ \"file:/" oe-core/meta-msm/recipes/prelink/prelink_git.bbappend
		$ sed -i -e '1,5 s/$/\"/g' oe-core/meta-msm/recipes/prelink/prelink_git.bbappend

		○ update-rc.d_0.7.bbappend 更新
		$ sed -i '4d' oe-core/meta-msm/recipes/update-rc.d/update-rc.d_0.7.bbappend
		$ sed -i -e '1,3 s/\ \\$//g' oe-core/meta-msm/recipes/update-rc.d/update-rc.d_0.7.bbappend
		$ sed -i -e '1,3 s/\"$//g' oe-core/meta-msm/recipes/update-rc.d/update-rc.d_0.7.bbappend
		$ sed -i -e "s/\${CAF_GIT}/\${CLO_LE_GIT}/" -e "s/protocol=git/protocol=https/" -e "s/branch=github/branch=caf_migration\/github/" oe-core/meta-msm/recipes/update-rc.d/update-rc.d_0.7.bbappend
		$ sed -i -e "2,3 s/           file:/SRC_URI =+ \"file:/" oe-core/meta-msm/recipes/update-rc.d/update-rc.d_0.7.bbappend
		$ sed -i -e '1,3 s/$/\"/g' oe-core/meta-msm/recipes/update-rc.d/update-rc.d_0.7.bbappend

		○ kern-tools-native_git.bbappend 更新
		$ sed -i -e "s/\${CAF_GIT}/\${CLO_LE_GIT}/" -e "s/protocol=git/protocol=https/" -e "s/branch=yocto/branch=caf_migration\/yocto/" oe-core/meta-msm/recipes/kern-tools/kern-tools-native_git.bbappend

		○ ethtool_git.bb 更新
		$ sed -i -e "s/\${CAF_GIT}/\${CLO_LE_GIT}/" -e "s/protocol=git/protocol=https/" -e "s/branch=korg/branch=caf_migration\/korg/" oe-core/meta-msm/recipes/ethtool/ethtool_git.bb

		○ lttng-ust_2.6.0.bbappend 更新
		$ sed -i '2d' oe-core/meta-msm/recipes/lttng/lttng-ust_2.6.0.bbappend
		$ sed -i -e '1,1 s/\ \\$//g' oe-core/meta-msm/recipes/lttng/lttng-ust_2.6.0.bbappend
		$ sed -i -e "s/\${CAF_GIT}/\${CLO_LE_GIT}/" -e "s/protocol=git/protocol=https/" -e "s/branch=lttng/branch=caf_migration\/lttng/" oe-core/meta-msm/recipes/lttng/lttng-ust_2.6.0.bbappend
		$ sed -i -e '1,1 s/$/\"/g' oe-core/meta-msm/recipes/lttng/lttng-ust_2.6.0.bbappend

	5.GitリポジトリのURL書き換え設定を行います。
		$ git config --global http.sslverify false

	6.ビルド
		$ cd oe-core
		$ source build/conf/set_bb_env.sh
		$ export MACHINE=mdm9607
		$ bitbake ${PACKAGE}

	注）PACKAGEには、ビルド対象のパッケージ名を入力してください。パッケージ名は下記のとおりです。
		また、製品に含まれているパッケージをご確認のうえ選択してください。
		
		attr, base-files, base-passwd, busybox, conntrack-tools, cryptodev-linux, ddclient, 
		dnsmasq, e2fsprogs, ebtables, ethtool, glib-2.0, glibc, init-ifupdown, initscripts, 
		iproute2, iptables, iputils, kbd, keymaps, libatomic-ops, libcap, libcheck, 
		libnetfilter-conntrack, libnfnetlink, libnl, libsepol, liburcu, linux-libc-headers, 
		linux-quic, lttng-ust, lzo, mtd-utils, netbase, opkg-utils, perl, pkgconfig, ppp, 
		readline, sysvinit, sysvinit-inittab, tinyproxy, update-rc.d, util-linux, ca-certificates, 
		avahi, dbus, libnss-mdns, wireless-tools, libdaemon

[END]