• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2
3# Copyright (c) 2021 HiHope Open Source Organization .
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#     http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16set -e
17BOOT_LINUX=${1}/kernel/src_tmp/linux-5.10
18OUT_IMAGE=${1}/rk3588/packages/phone/images/
19IMAGE_SIZE=64  # 64M
20IMAGE_BLOCKS=4096
21
22BUILD_PATH=boot_linux
23EXTLINUX_PATH=${BUILD_PATH}/extlinux
24EXTLINUX_CONF=${EXTLINUX_PATH}/extlinux.conf
25TOYBRICK_DTB=toybrick.dtb
26
27function make_boot_image()
28{
29        blocks=${IMAGE_BLOCKS}
30        block_size=$((${IMAGE_SIZE} * 1024 * 1024 / ${blocks}))
31        echo "blocks = ${blocks}  block_size ${block_size}"
32        if [ "`uname -m`" == "aarch64" ]; then
33                echo y | sudo mke2fs -b ${block_size} -d boot_linux -i 8192 -t ext2 boot_linux.img ${blocks}
34        else
35                genext2fs -B ${blocks} -b ${block_size} -d boot_linux -i 8192 -U boot_linux.img
36        fi
37
38        return $?
39}
40
41cd ${BOOT_LINUX}
42make_boot_image
43cd -
44cp ${BOOT_LINUX}/boot_linux.img ${OUT_IMAGE}
45