第七章 快速启动模式 fastboot

由于fastboot模式下,rootfs是运行于内存中的,要求内存足够,所以源码中默认fastboot模式是供SSD202使用的,如果SSD201要用,则需要修改Release_to_customer.sh:

# vi Release_to_customer.sh
#build project
cd ${RELEASEDIR}/project
if [ "${flashtype}" = "nor" ]; then
    if [ "${fastboot}" = "fastboot" ]; then
        echo test fastboot
        ./setup_config.sh ./configs/nvr/i2m/8.2.1/nor.glibc-ramfs.011a.64
    else
        if [ "${project}" = "ssd201" ]; then
            ./setup_config.sh ./configs/nvr/i2m/8.2.1/nor.glibc-squashfs.011a.64
        fi
        if [ "${project}" = "ssd202" ]; then
            ./setup_config.sh ./configs/nvr/i2m/8.2.1/nor.glibc-squashfs.011a.128
        fi
    fi
else
    if [ "${fastboot}" = "fastboot" ]; then
        echo fast project
        if [ "${project}" = "ssd201" ]; then 
            ./setup_config.sh ./configs/nvr/i2m/8.2.1/spinand.ram-glibc-squashfs.011a.64
        elif [ "${project}" = "ssd202" ]; then    
            ./setup_config.sh ./configs/nvr/i2m/8.2.1/spinand.ram-glibc-squashfs.011a.128
        fi
    else
        if [ "${project}" = "ssd201" ]; then
            ./setup_config.sh ./configs/nvr/i2m/8.2.1/spinand.glibc.011a.64
        fi
        if [ "${project}" = "ssd202" ]; then
            ./setup_config.sh ./configs/nvr/i2m/8.2.1/spinand.glibc.011a.128
        fi
    fi

fi

为了使系统启动尽可能地快,我们需要将耗时的任务关闭或等系统启动后再执行:

# vi project/image/configs/i2m/rootfs_fastboot.mk

配置如下:

    echo "busybox telnetd&" >> $(OUTPUTDIR)/rootfs/etc/profile
    #echo \/customer\/bin\/zkgui \& >> $(OUTPUTDIR)/rootfs/etc/profile;
    #echo sleep 8 >> $(OUTPUTDIR)/rootfs/etc/profile;
    #echo /customer/demo.sh >> $(OUTPUTDIR)/rootfs/etc/profile;

编译:

# ./Release_to_customer.sh -f nand -p ssd201 -q fastboot

更新启动后,可以看到启动过程跳过了 uboot。

关闭网络功能,也能加快开机时间:

# setenv autoestar 0
# saveenv
文档更新时间: 2021-01-13 14:22   作者:Aeeditor