Skip to content

Commit 7b7e999

Browse files
committed
More a sync point then a specific feature "add" as raw development
is still underway. Script generally runs but with 'assumptions' that are fairly horrible. (IE images directory being populated by hand) Currently the 4.19 kernel is generally the only version that is meaningful for this exercise. vendor.img file has kernel modules installed by updating the image and then reconverting to a sparse image. This is yet to be tested that the results are actually valid. Signed-off-by: Tom Gall <tom.gall@linaro.org>
1 parent 1a71933 commit 7b7e999

File tree

1 file changed

+38
-3
lines changed

1 file changed

+38
-3
lines changed

gki-builder.sh

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ while [ "$1" != "" ]; do
5757
shift
5858
done
5959

60+
export ROOTPATH=${PWD}
61+
6062
if [ "$VERSION" = "4.9" ]; then
6163
if [ "$ANDROID_VERSION" = "AOSP" ]; then
6264
export KERNEL_BRANCH=android-hikey-linaro-4.9
@@ -146,13 +148,21 @@ if [ "$skipdownloads" = "1" ]; then
146148
else
147149
make mrproper
148150
fi
151+
cd ..
152+
149153
# git checkout master
150154
# git clean -fd
151155
# git pull
152156
# git checkout "$KERNEL_BRANCH"
153157
# git pull
154158

155159
else
160+
if [ "$cont" != "1" ]; then
161+
mkdir -p images
162+
fi
163+
# populate those here
164+
#
165+
156166

157167
if [ "$PASTRY_BUILD" = "1" ]; then
158168
if [ "$VERSION" = "4.19" ]; then
@@ -174,20 +184,31 @@ else
174184
else
175185
git checkout -b "$KERNEL_BRANCH" origin/"$KERNEL_BRANCH"
176186
fi
177-
187+
cd ..
178188
fi
179-
cd ..
180189

181190

182191
export CLANG_TRIPLE=aarch64-linux-gnu-
183192
export CROSS_COMPILE=aarch64-linux-android-
184193

194+
# setup vendor.img and ramdisk.img
195+
cd images
196+
if [ "$cont" != "1" ]; then
197+
mkdir -p v
198+
fi
199+
# mkdir -p r
200+
simg2img vendor.img vendor.raw
201+
sudo mount -t ext4 -o loop vendor.raw v
202+
cd ..
203+
204+
185205
cd "$KERNEL_DIR"
186206

187207
if [ "$cont" != "1" ]; then
188208
# copy kernel config for any version besides AOSP
189209
if [ "$VERSION" = "4.19" ]; then
190-
ARCH=arm64 scripts/kconfig/merge_config.sh arch/arm64/configs/hikey_defconfig ../configs/${CONFIG_FRAGMENTS_PATH}/${ANDROID_KERNEL_CONFIG_DIR}/android-base.config ../configs/${CONFIG_FRAGMENTS_PATH}/${ANDROID_KERNEL_CONFIG_DIR}/android-recommended-arm64.config
210+
# ARCH=arm64 scripts/kconfig/merge_config.sh arch/arm64/configs/hikey_defconfig ../configs/${CONFIG_FRAGMENTS_PATH}/${ANDROID_KERNEL_CONFIG_DIR}/android-base.config ../configs/${CONFIG_FRAGMENTS_PATH}/${ANDROID_KERNEL_CONFIG_DIR}/android-recommended-arm64.config
211+
cp arch/arm64/configs/hikey_defconfig .config
191212
elif [ "$ANDROID_VERSION" = "P" ]; then
192213
cp ../LinaroAndroidKernelConfigs/${ANDROID_VERSION}/${VERSION}/hikey_defconfig .config
193214
else # AOSP BUILD
@@ -203,13 +224,19 @@ if [ "$usegcc" = "1" ]; then
203224
fi
204225

205226
if [ "$VERSION" = "4.19" ]; then
227+
make ARCH=arm64 CC="${C_COMPILER}" HOSTCC="${C_COMPILER}" oldconfig
228+
make ARCH=arm64 CC="${C_COMPILER}" HOSTCC="${C_COMPILER}" -j$(nproc) prepare
206229
make ARCH=arm64 CC="${C_COMPILER}" HOSTCC="${C_COMPILER}" -j$(nproc) Image
207230
make ARCH=arm64 CC="${C_COMPILER}" HOSTCC="${C_COMPILER}" -j$(nproc) dtbs
208231
# make ARCH=arm64 CC=clang HOSTCC=clang -j$(nproc) Image
209232
# make ARCH=arm64 CC=clang HOSTCC=clang -j$(nproc) dtbs
210233
cat arch/arm64/boot/Image arch/arm64/boot/dts/hisilicon/hi6220-hikey.dtb > arch/arm64/boot/Image-dtb
234+
make ARCH=arm64 CC=clang HOSTCC=clang -j$(nproc) modules
235+
sudo make ARCH=arm64 CC=clang HOSTCC=clang -j$(nproc) modules_install INSTALL_MOD_PATH=${ROOTPATH}/images/v/ V=1
211236
else
212237
make ARCH=arm64 CC=clang HOSTCC=clang -j$(nproc) Image-dtb
238+
make ARCH=arm64 CC=clang HOSTCC=clang -j$(nproc) modules
239+
sudo make ARCH=arm64 CC=clang HOSTCC=clang -j$(nproc) modules_install INSTALL_MOD_PATH=${ROOTPATH}/images/v/ V=1
213240
fi
214241

215242
cd ..
@@ -218,7 +245,15 @@ if [ "$skipdownloads" != "1" ]; then
218245
wget -q ${REFERENCE_BUILD_URL}/ramdisk.img -O ramdisk.img
219246
fi
220247

248+
# now package
249+
cd images
250+
# sudo ./make_ext4fs -s -l 1024M -a vendor new.vendor.img v/
251+
# sudo /lkft/tgall/960/out/soong/host/linux-x86/bin/make_f2fs -S 822083584 -l vendor vendor.new
252+
sudo umount ./v
253+
img2simg vendor.raw vendor.new.img
221254

255+
## umount ./r
256+
cd ..
222257

223258
python mkbootimg --kernel ${PWD}/"$KERNEL_DIR"/arch/arm64/boot/Image-dtb --cmdline "${CMD}" --os_version P --os_patch_level 2018-09-01 --ramdisk ./ramdisk.img --output boot.img
224259
#

0 commit comments

Comments
 (0)