Firefly开源社区

打印 上一主题 下一主题

[Linux] 编译Ubuntu固件,rootfs文件自动被删除

76

积分

0

威望

0

贡献

技术小白

积分
76

编译Ubuntu固件,rootfs文件自动被删除

发表于 2021-11-24 10:22:46      浏览:1341 | 回复:1        打印      只看该作者   [复制链接] 楼主
使用全自动编译Ubuntu固件的时候,执行recovery这一步的时候,ubunturootfs里面的跟文件系统自动被删除了,导致最后打包报错了,请大神帮忙分析是什么原因:
zgh@linux:~/rk3399_linux_release_v2.5.1_20210301$ ./build.sh
processing option: allff
============================================
TARGET_ARCH=arm64
TARGET_PLATFORM=rk3399
TARGET_UBOOT_CONFIG=firefly-rk3399
TARGET_SPL_CONFIG=
TARGET_KERNEL_CONFIG=firefly_linux_defconfig
TARGET_KERNEL_DTS=rk3399-firefly-aiojd4-lvds
TARGET_TOOLCHAIN_CONFIG=
TARGET_BUILDROOT_CONFIG=
TARGET_RECOVERY_CONFIG=rockchip_rk3399_recovery
TARGET_PCBA_CONFIG=rockchip_rk3399_pcba
TARGET_RAMBOOT_CONFIG=
============================================
============Start building uboot============
TARGET_UBOOT_CONFIG=firefly-rk3399
=========================================
## make firefly-rk3399_defconfig -j8
#
# configuration written to .config
#
scripts/kconfig/conf  --silentoldconfig Kconfig
  CHK     include/config.h
  CFG     u-boot.cfg
  GEN     include/autoconf.mk.dep
  CFG     spl/u-boot.cfg
  CFG     tpl/u-boot.cfg
  GEN     include/autoconf.mk
  GEN     spl/include/autoconf.mk
  GEN     tpl/include/autoconf.mk
  CHK     include/config/uboot.release
  CHK     include/generated/timestamp_autogenerated.h
  CHK     include/config.h
  CFG     u-boot.cfg
  UPD     include/generated/timestamp_autogenerated.h
  CHK     include/generated/version_autogenerated.h
  CHK     include/generated/generic-asm-offsets.h
  CHK     include/generated/asm-offsets.h
  HOSTCC  tools/mkenvimage.o
  HOSTCC  tools/fit_image.o
  HOSTCC  tools/image-host.o
  HOSTCC  tools/dumpimage.o
  HOSTCC  tools/mkimage.o
  HOSTCC  tools/rockchip/boot_merger.o
  HOSTCC  tools/rockchip/loaderimage.o
  HOSTLD  tools/mkenvimage
  HOSTLD  tools/loaderimage
  HOSTLD  tools/dumpimage
  HOSTLD  tools/mkimage
  HOSTLD  tools/boot_merger
  CC      arch/arm/cpu/armv8/fwcall.o
  CC      cmd/version.o
  CC      common/main.o
  LD      arch/arm/cpu/armv8/built-in.o
  LD      cmd/built-in.o
  LD      common/built-in.o
  CC      drivers/usb/gadget/f_fastboot.o
  CC      lib/smbios.o
  CC      lib/display_options.o
  CC      lib/efi_loader/helloworld.o
  LD      lib/efi_loader/helloworld.so
  OBJCOPY lib/efi_loader/helloworld.efi
  LD      drivers/usb/gadget/built-in.o
  LD      lib/built-in.o
  LD      u-boot
  OBJCOPY u-boot.srec
  OBJCOPY u-boot-nodtb.bin
  SYM     u-boot.sym
start=$(/home/zgh/rk3399_linux_release_v2.5.1_20210301/prebuilts/gcc/linux-x86/aarch64/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-nm u-boot | grep __rel_dyn_start | cut -f 1 -d ' '); end=$(/home/zgh/rk3399_linux_release_v2.5.1_20210301/prebuilts/gcc/linux-x86/aarch64/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-nm u-boot | grep __rel_dyn_end | cut -f 1 -d ' '); tools/relocate-rela u-boot-nodtb.bin 0x00200000 $start $end
make[2]: “arch/arm/dts/rk3399-firefly.dtb”已是最新。
  CAT     u-boot-dtb.bin
  MKIMAGE u-boot.img
  COPY    u-boot.dtb
  MKIMAGE u-boot-dtb.img
  COPY    u-boot.bin
  ALIGN   u-boot.bin
  CC      tpl/common/spl/spl.o
  CC      tpl/arch/arm/mach-rockchip/tpl.o
  CC      spl/arch/arm/cpu/armv8/fwcall.o
  CC      spl/common/spl/spl.o
  CC      tpl/arch/arm/cpu/armv8/fwcall.o
  LD      spl/arch/arm/cpu/armv8/built-in.o
  LD      tpl/arch/arm/cpu/armv8/built-in.o
  LD      tpl/arch/arm/mach-rockchip/built-in.o
  LD      tpl/common/spl/built-in.o
  LD      spl/common/spl/built-in.o
  COPY    spl/u-boot-spl.dtb
  COPY    tpl/u-boot-tpl.dtb
  CC      tpl/lib/display_options.o
  LD      tpl/lib/built-in.o
  CC      spl/lib/display_options.o
  LD      spl/lib/built-in.o
  LD      tpl/u-boot-tpl
  LD      spl/u-boot-spl
  OBJCOPY tpl/u-boot-tpl-nodtb.bin
  CAT     tpl/u-boot-tpl-dtb.bin
  COPY    tpl/u-boot-tpl.bin
  OBJCOPY spl/u-boot-spl-nodtb.bin
  CAT     spl/u-boot-spl-dtb.bin
  COPY    spl/u-boot-spl.bin
  CFGCHK  u-boot.cfg

load addr is 0x200000!
pack input u-boot.bin
pack file size: 946352(924 KB)
crc = 0x84f82744
uboot version: U-Boot 2017.09-g948c63a14e-dirty #zgh (Nov 24 2021 - 09:53:38)
pack uboot.img success!
pack uboot okay! Input: u-boot.bin
out:trust.img
merge success(trust.img)
/home/zgh/rk3399_linux_release_v2.5.1_20210301/u-boot
pack trust okay! Input: /home/zgh/rk3399_linux_release_v2.5.1_20210301/rkbin/RKTRUST/RK3399TRUST.ini
Image Type:   Rockchip RK33 (SD/MMC) boot image
Init Data Size: 153600 bytes
pack loader ok.(rk3399_loader_v1.26.126.bin)(0.00)
/home/zgh/rk3399_linux_release_v2.5.1_20210301/u-boot
pack rk3399_loader_v1.26.126.bin okay! Input: /home/zgh/rk3399_linux_release_v2.5.1_20210301/rkbin/RKBOOT/RK3399MINIALL.ini

Platform RK3399 is build OK, with new .config(make firefly-rk3399_defconfig -j8)
Running build_uboot succeeded.
Skipping build_loader for missing configs:  RK_LOADER_BUILD_TARGET.
============Start building kernel============
TARGET_ARCH          =arm64
TARGET_KERNEL_CONFIG =firefly_linux_defconfig
TARGET_KERNEL_DTS    =rk3399-firefly-aiojd4-lvds
TARGET_KERNEL_CONFIG_FRAGMENT =
==========================================
/home/zgh/rk3399_linux_release_v2.5.1_20210301
#
# configuration written to .config
#
scripts/kconfig/conf  --silentoldconfig Kconfig
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CHK     scripts/mod/devicetable-offsets.h
make[1]: “arch/arm64/boot/dts/rockchip/rk3399-firefly-aiojd4-lvds.dtb”已是最新。
  CHK     include/generated/timeconst.h
  CHK     include/generated/bounds.h
  CHK     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
make[1]: “include/generated/vdso-offsets.h”已是最新。
  CHK     include/generated/compile.h
make[1]: “arch/arm64/boot/Image.lz4”已是最新。
  Image:  kernel.img is ready
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CHK     scripts/mod/devicetable-offsets.h
  CHK     include/generated/timeconst.h
  CHK     include/generated/bounds.h
  CHK     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
make[2]: “include/generated/vdso-offsets.h”已是最新。
  Building modules, stage 2.
  MODPOST 2 modules
  Image:  resource.img (with rk3399-firefly-aiojd4-lvds.dtb logo.bmp ) is ready
  Image:  boot.img (with Image ramdisk.img resource.img) is ready
  Image:  zboot.img (with Image.lz4 ramdisk.img resource.img) is ready
Running build_kernel succeeded.
Skipping build_toolchain for missing configs:  RK_CFG_TOOLCHAIN.
Skipping build_buildroot for missing configs:  RK_CFG_BUILDROOT.
buildroot/output//images/rootfs.ext4 not generated?
Running build_rootfs succeeded.
==========Start building recovery==========
TARGET_RECOVERY_CONFIG=rockchip_rk3399_recovery
========================================
config is rockchip_rk3399_recovery
found kernel image
Top of tree: /home/zgh/rk3399_linux_release_v2.5.1_20210301
===========================================

#TARGET_BOARD=rk3399
#OUTPUT_DIR=output/rockchip_rk3399_recovery
#CONFIG=rockchip_rk3399_recovery_defconfig

===========================================
make: Entering directory '/home/zgh/rk3399_linux_release_v2.5.1_20210301/buildroot'
  GEN     /home/zgh/rk3399_linux_release_v2.5.1_20210301/buildroot/output/rockchip_rk3399_recovery/Makefile
/home/zgh/rk3399_linux_release_v2.5.1_20210301/buildroot/build/defconfig_hook.py -m /home/zgh/rk3399_linux_release_v2.5.1_20210301/buildroot/configs/rockchip_rk3399_recovery_defconfig /home/zgh/rk3399_linux_release_v2.5.1_20210301/buildroot/output/rockchip_rk3399_recovery/.rockchipconfig
BR2_DEFCONFIG='' KCONFIG_AUTOCONFIG=/home/zgh/rk3399_linux_release_v2.5.1_20210301/buildroot/output/rockchip_rk3399_recovery/build/buildroot-config/auto.conf KCONFIG_AUTOHEADER=/home/zgh/rk3399_linux_release_v2.5.1_20210301/buildroot/output/rockchip_rk3399_recovery/build/buildroot-config/autoconf.h KCONFIG_TRISTATE=/home/zgh/rk3399_linux_release_v2.5.1_20210301/buildroot/output/rockchip_rk3399_recovery/build/buildroot-config/tristate.config BR2_CONFIG=/home/zgh/rk3399_linux_release_v2.5.1_20210301/buildroot/output/rockchip_rk3399_recovery/.config HOST_GCC_VERSION="7" BUILD_DIR=/home/zgh/rk3399_linux_release_v2.5.1_20210301/buildroot/output/rockchip_rk3399_recovery/build SKIP_LEGACY= BR2_DEFCONFIG=/home/zgh/rk3399_linux_release_v2.5.1_20210301/buildroot/configs/rockchip_rk3399_recovery_defconfig /home/zgh/rk3399_linux_release_v2.5.1_20210301/buildroot/output/rockchip_rk3399_recovery/build/buildroot-config/conf --defconfig=/home/zgh/rk3399_linux_release_v2.5.1_20210301/buildroot/output/rockchip_rk3399_recovery/.rockchipconfig Config.in
/home/zgh/rk3399_linux_release_v2.5.1_20210301/buildroot/output/rockchip_rk3399_recovery/.rockchipconfig:65:warning: override: reassigning to symbol BR2_PACKAGE_UPDATE
/home/zgh/rk3399_linux_release_v2.5.1_20210301/buildroot/output/rockchip_rk3399_recovery/.rockchipconfig:66:warning: override: reassigning to symbol BR2_PACKAGE_RKSCRIPT
/home/zgh/rk3399_linux_release_v2.5.1_20210301/buildroot/output/rockchip_rk3399_recovery/.rockchipconfig:70:warning: override: reassigning to symbol BR2_PACKAGE_EXFAT
/home/zgh/rk3399_linux_release_v2.5.1_20210301/buildroot/output/rockchip_rk3399_recovery/.rockchipconfig:71:warning: override: reassigning to symbol BR2_PACKAGE_EXFAT_UTILS
/home/zgh/rk3399_linux_release_v2.5.1_20210301/buildroot/output/rockchip_rk3399_recovery/.rockchipconfig:73:warning: override: reassigning to symbol BR2_PACKAGE_NTFS_3G
#
# configuration written to /home/zgh/rk3399_linux_release_v2.5.1_20210301/buildroot/output/rockchip_rk3399_recovery/.config
#
make: Leaving directory '/home/zgh/rk3399_linux_release_v2.5.1_20210301/buildroot'
====Start build rockchip_rk3399_recovery====
2021-11-24T09:54:28 >>>   Finalizing target directory
2021-11-24T09:54:30 >>>   Sanitizing RPATH in target tree
2021-11-24T09:54:31 >>>   Copying overlay board/rockchip/rk3399/fs-overlay-64/
2021-11-24T09:54:31 >>>   Copying overlay board/rockchip/common/base
2021-11-24T09:54:31 >>>   Copying overlay board/rockchip/common/recovery
2021-11-24T09:54:31 >>>   Executing post-build script build/post.sh
2021-11-24T09:54:31 >>>   Generating root filesystem image rootfs.cpio
2021-11-24T09:54:34 >>>   Generating root filesystem image rootfs.ext2
2021-11-24T09:54:35 >>>   Generating root filesystem image rootfs.squashfs
2021-11-24T09:54:36 >>>   Generating root filesystem image rootfs.tar
Done in 14s
log saved on /home/zgh/rk3399_linux_release_v2.5.1_20210301/br.log
====Build rockchip_rk3399_recovery ok!====
pack recovery.img...done.
you take 0:17.77 to build recovery
====Build recovery ok!====
Running build_recovery succeeded.
Skipping build_ramboot for missing configs:  RK_CFG_RAMBOOT.
Running build_all succeeded.
/usr/bin/fakeroot
warning: /home/zgh/rk3399_linux_release_v2.5.1_20210301/ubunturootfs/ubuntu_18.04_arm64_NOGPUVPU_ext4_v2.03-28-g6eebc47_20201204-0948_MINIMAL.img not found!

please set correct  RK_ROOTFS_IMG  in  device/rockchip/.BoardConfig.mk

create parameter...done.
/home/zgh/rk3399_linux_release_v2.5.1_20210301/device/rockchip/rk3399/parameter-4.19.txt
0x00002000@0x00004000(uboot),0x00002000@0x00006000(trust),0x00002000@0x00008000(misc),0x00010000@0x0000a000(boot),0x00010000@0x0001a000(recovery),0x00010000@0x0002a000(backup),0x00020000@0x0003a000(oem),0x00c00000@0x0005a000(rootfs),-@0x00c5a000(userdata:grow)
create recovery.img...done.
create misc.img...done.
Source buildroot/build/envsetup.sh
Top of tree: /home/zgh/rk3399_linux_release_v2.5.1_20210301
No available configs for: /home/zgh/rk3399_linux_release_v2.5.1_20210301/device/rockchip/oem/oem_normal
Making /home/zgh/rk3399_linux_release_v2.5.1_20210301/rockdev/oem.img from /home/zgh/rk3399_linux_release_v2.5.1_20210301/device/rockchip/oem/oem_normal (auto sized)
Making /home/zgh/rk3399_linux_release_v2.5.1_20210301/rockdev/oem.img from /home/zgh/rk3399_linux_release_v2.5.1_20210301/device/rockchip/oem/oem_normal with size(17M)
0+0 records in
0+0 records out
0 bytes copied, 2.2429e-05 s, 0.0 kB/s
mke2fs 1.44.1 (24-Mar-2018)
Discarding device blocks: done                           
Creating filesystem with 17408 1k blocks and 4368 inodes
Filesystem UUID: 162e3adb-726f-4163-b474-296bcd70e013
Superblock backups stored on blocks:
        8193

Allocating group tables: done                           
Writing inode tables: done                           
Copying files into the device: done
Writing superblocks and filesystem accounting information: done

tune2fs 1.44.1 (24-Mar-2018)
Setting maximal mount count to -1
Setting interval between checks to 0 seconds
Source buildroot/build/envsetup.sh
Top of tree: /home/zgh/rk3399_linux_release_v2.5.1_20210301
No available configs for: /home/zgh/rk3399_linux_release_v2.5.1_20210301/device/rockchip/userdata/userdata_normal
Making /home/zgh/rk3399_linux_release_v2.5.1_20210301/rockdev/userdata.img from /home/zgh/rk3399_linux_release_v2.5.1_20210301/device/rockchip/userdata/userdata_normal (auto sized)
Making /home/zgh/rk3399_linux_release_v2.5.1_20210301/rockdev/userdata.img from /home/zgh/rk3399_linux_release_v2.5.1_20210301/device/rockchip/userdata/userdata_normal with size(5M)
0+0 records in
0+0 records out
0 bytes copied, 2.2193e-05 s, 0.0 kB/s
mke2fs 1.44.1 (24-Mar-2018)
Discarding device blocks: done                           
Creating filesystem with 5120 1k blocks and 1280 inodes

Allocating group tables: done                           
Writing inode tables: done                           
Copying files into the device: done
Writing superblocks and filesystem accounting information: done

tune2fs 1.44.1 (24-Mar-2018)
Setting maximal mount count to -1
Setting interval between checks to 0 seconds
create uboot.img...done.
create idbloader.img...done.
create trust.img...done.
create loader...done.
create boot.img...done.
Image: image in rockdev is ready
Make image ok!
File name is  BOARDCONFIGUBUNTU-GPT
Rename the file? [N|y]Make update.img
start to make update.img...
Resize rootfs partition size
dumpe2fs 1.44.1 (24-Mar-2018)
dumpe2fs: No such file or directory while trying to open /home/zgh/rk3399_linux_release_v2.5.1_20210301/ubunturootfs/Firefly_Ubuntu_18.04.5_LTS_DESKTOP_ext4_202012301242_PYTHON3.5-RKNN-OPENCV.img
./mkupdate.sh: line 37: >>9: syntax error: operand expected (error token is ">>9")
Android Firmware Package Tool v1.66
------ PACKAGE ------
Add file: ./package-file
Add file: ./package-file done,offset=0x800,size=0x28a,userspace=0x1
Add file: ./Image/MiniLoaderAll.bin
Add file: ./Image/MiniLoaderAll.bin done,offset=0x1000,size=0x7194e,userspace=0xe4
Add file: ./Image/parameter.txt
Add file: ./Image/parameter.txt done,offset=0x73000,size=0x20d,userspace=0x1
Add file: ./Image/trust.img
Add file: ./Image/trust.img done,offset=0x73800,size=0x400000,userspace=0x800
Add file: ./Image/uboot.img
Add file: ./Image/uboot.img done,offset=0x473800,size=0x400000,userspace=0x800
Add file: ./Image/misc.img
Add file: ./Image/misc.img done,offset=0x873800,size=0xc000,userspace=0x18
Add file: ./Image/boot.img
Add file: ./Image/boot.img done,offset=0x87f800,size=0x1ea4000,userspace=0x3d48
Add file: ./Image/recovery.img
Add file: ./Image/recovery.img done,offset=0x2723800,size=0x1e80800,userspace=0x3d01
Add file: ./Image/rootfs.img
Error:<AddFile> open file failed,err=2!
------ FAILED ------
Press any key to quit:
ERROR: Running build_updateimg failed!
ERROR: exit code 1 from line 1207:
    ./mkupdate.sh


另外BoardConfig的配置内容如下:
  1 #!/bin/bash
  2
  3 # Target arch
  4 export RK_ARCH=arm64
  5 # Uboot defconfig
  6 export RK_UBOOT_DEFCONFIG=firefly-rk3399
  7 # Kernel defconfig
  8 export RK_KERNEL_DEFCONFIG=firefly_linux_defconfig
  9 # Kernel dts
10 export RK_KERNEL_DTS=rk3399-firefly-aiojd4-lvds
11 # boot image type
12 export RK_BOOT_IMG=boot.img
13 # kernel image path
14 export RK_KERNEL_IMG=kernel/arch/arm64/boot/Image
15 # parameter for GPT table
16 export RK_PARAMETER=parameter-4.19.txt
17 # Recovery config
18 export RK_CFG_RECOVERY=rockchip_rk3399_recovery
19 # ramboot config
20 export RK_CFG_RAMBOOT=
21 # Pcba config
22 export RK_CFG_PCBA=rockchip_rk3399_pcba
23 # Build jobs
24 export RK_JOBS=12
25 # target chip
26 export RK_TARGET_PRODUCT=rk3399
27 # Set rootfs type, including ext2 ext4 squashfs
28 export RK_ROOTFS_TYPE=ext4
29 # yocto machine
30 export RK_YOCTO_MACHINE=rockchip-rk3399-sapphire-excavator
31 # rootfs image path
32 export RK_ROOTFS_IMG=ubunturootfs/ubuntu_18.04_arm64_NOGPUVPU_ext4_v2.03-28-    g6eebc47_20201204-0948_MINIMAL.img
33 # Set ramboot image type
34 export RK_RAMBOOT_TYPE=
35 # Set oem partition type, including ext2 squashfs
36 export RK_OEM_FS_TYPE=ext2
37 # Set userdata partition type, including ext2, fat
38 export RK_USERDATA_FS_TYPE=ext2
39 #OEM config
40 export RK_OEM_DIR=oem_normal
41 #userdata config
42 export RK_USERDATA_DIR=userdata_normal
43 #misc image
44 export RK_MISC=wipe_all-misc.img
45 #choose enable distro module
46 export RK_DISTRO_MODULE=
47 # Define pre-build script for this board
48 export RK_BOARD_PRE_BUILD_SCRIPT=app-build.sh

回复

使用道具 举报

82

积分

0

威望

0

贡献

技术小白

积分
82
发表于 2021-12-23 21:14:29        只看该作者  沙发
哈哈,我也遇到这个问题了{:5_246:}

按WIKI中关于安装rootfs的说明,安装后就解决了,希望对你有帮助{:4_162:}
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

友情链接 : 爱板网 电子发烧友论坛 云汉电子社区 粤ICP备14022046号-2
快速回复 返回顶部 返回列表