加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
build-ddr3-emmc.sh 4.14 KB
一键复制 编辑 原始数据 按行查看 历史
KuDianWanJia 提交于 2023-03-18 10:24 . NONE
##############
# Build Uboot
## EMMC
compile_Uboot_EMMC()
{
echo "================ Build Uboot ================="
cd opensource/uboot/u-boot-2016.11
make ARCH=arm CROSS_COMPILE=arm-himix200-linux- hi3516cv500_emmc_defconfig
make ARCH=arm CROSS_COMPILE=arm-himix200-linux- -j 20
make -C ../../../Tools/pc/hi_gzip
cp ../../../Tools/pc/hi_gzip/bin/gzip arch/arm/cpu/armv7/hi3516cv500/hw_compressed/ -rf
cp ../../../Tools/pc/uboot_tools/reg_info_hi3516cv500_emmc.bin .reg
make ARCH=arm CROSS_COMPILE=arm-himix200-linux- u-boot-z.bin
#opensource/uboot/u-boot-2016.11下生成的u-boot-hi3516dv300.bin即为可用的u-boot镜像
cp u-boot-hi3516cv500.bin ../../../Image/EMMC/ -rf
cd ../../../
}
## NAND
compile_Uboot_NAND()
{
echo "================ Build Uboot ================="
cd opensource/uboot/u-boot-2016.11
make ARCH=arm CROSS_COMPILE=arm-himix200-linux- hi3516cv500_defconfig
make ARCH=arm CROSS_COMPILE=arm-himix200-linux- -j 20
make -C ../../../Tools/pc/hi_gzip
cp ../../../Tools/pc/hi_gzip/bin/gzip arch/arm/cpu/armv7/hi3516cv500/hw_compressed/ -rf
cp ../../../Tools/pc/uboot_tools/reg_info_hi3516cv500_nand.bin .reg
make ARCH=arm CROSS_COMPILE=arm-himix200-linux- u-boot-z.bin
#opensource/uboot/u-boot-2016.11下生成的u-boot-hi3516dv300.bin即为可用的u-boot镜像
cp u-boot-hi3516cv500.bin ../../../Image/NAND/ -rf
cd ../../../
}
##############
# Build Kernel
## EMMC
compile_Kernel_EMMC()
{
echo "================ Build Kernel ================="
cd opensource/kernel/linux-4.9.y-smp
cp arch/arm/configs/hi3516cv500_emmc_smp_defconfig .config
make ARCH=arm CROSS_COMPILE=arm-himix200-linux- uImage
make ARCH=arm CROSS_COMPILE=arm-himix200-linux- modules
cp arch/arm/boot/uImage ../../../Image/EMMC/uImage_hi3516cv500_smp -rf
cd ../../../
}
## NAND
compile_Kernel_NAND()
{
echo "================ Build Kernel ================="
cd opensource/kernel/linux-4.9.y-smp
cp arch/arm/configs/hi3516cv500_smp_defconfig .config
make ARCH=arm CROSS_COMPILE=arm-himix200-linux- uImage
make ARCH=arm CROSS_COMPILE=arm-himix200-linux- modules
cp arch/arm/boot/uImage ../../../Image/NAND/uImage_hi3516cv500_smp -rf
cd ../../../
}
##############
# MAKE ROOTFS
make_rootfs_EMMC()
{
echo "================ MAKE ROOTFS ================="
mkdir -p rootfs/{boot,dev,home,komod,lost+found,mnt,nfsroot,opt,proc,share,sharefs,sys,tmp}
mkdir -p rootfs/usr/{lib,share}
Tools/make_ext4fs -l 500M -s Image/EMMC/rootfs_hi3516cv500_500M.ext4 rootfs
}
make_rootfs_NAND()
{
echo "================ MAKE ROOTFS ================="
mkdir -p rootfs/{boot,dev,home,komod,lost+found,mnt,nfsroot,opt,proc,share,sharefs,sys,tmp}
mkdir -p rootfs/usr/{lib,share}
Tools/mkyaffs2image100 rootfs Image/NAND/rootfs_uclibc_2k_4bit.yaffs2 1 2
Tools/mkyaffs2image100 rootfs Image/NAND/rootfs_uclibc_2k_24bit.yaffs2 1 4
Tools/mkyaffs2image100 rootfs Image/NAND/rootfs_uclibc_4k_4bit.yaffs2 2 2
Tools/mkyaffs2image100 rootfs Image/NAND/rootfs_uclibc_4k_24bit.yaffs2 2 2
}
clean()
{
echo "================ Clean U-boot ================="
make -C opensource/uboot/u-boot-2016.11 clean
echo "================ Clean Kernel ================="
make -C opensource/kernel/linux-4.9.y-smp clean
make -C Tools/pc/hi_gzip/ clean
}
distclean()
{
echo "================ Distclean U-boot ================="
make -C opensource/uboot/u-boot-2016.11 distclean
echo "================ Distclean Kernel ================="
make -C opensource/kernel/linux-4.9.y-smp distclean
# rm -rf Image/EMMC/*
# rm -rf Image/NAND/*
}
if [ X$1 == Xclean ]; then
clean
elif [ X$1 == Xdistclean ]; then
distclean
elif [ X$1 == XEMMC ]; then
compile_Uboot_EMMC
compile_Kernel_EMMC
make_rootfs_EMMC
elif [ X$1 == XNAND ]; then
compile_Uboot_NAND
compile_Kernel_NAND
make_rootfs_NAND
else
echo "========== Build =========== "
echo "0) ./build-ddr3-emmc.sh EMMC "
echo "1) ./build-ddr3-emmc.sh NAND "
echo "========== Clean =========== "
echo "0) ./build-ddr3-emmc.sh clean "
echo "1) ./build-ddr3-emmc.sh distclean "
fi
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化