|
【技术讨论】
ff_export_rootfs_buildroot导出rootfs成 ext2 格式后,新固件无法启动系统
发表于 2022-9-6 13:40:08
浏览:6583
|
回复:7
打印
只看该作者
[复制链接]
楼主
问题描述及复现步骤:
本帖最后由 music1913 于 2022-9-6 13:48 编辑
最开始,在基于官方的 debian10_2021_0429_1902 镜像上,我加入了一些私有的程序,之后进行打包,打包的基本步骤如下:
1. 拷贝打包工具到 /home/firefly/Download/ff_export_rootfs_buildroot
https://dev.t-firefly.com/forum.php?mod=attachment&aid=NzQzMXxhNzE5MjRjZnwxNjYyNDM5MjMwfDB8MTE4NDMz
2. 通过在 Windows PC 上安装 diskgenius, 将一个 64G 的 U盘 格式化为 ext4 单分区,再将 U盘 插在板子上
3. 在板子上创建文件夹 usb_drive, 并将其 mount 到 U盘
mkdir /media/usb_drive
mount/dev/sda1 /media/usb_drive
4. 开始打包
- ./ff_export_rootfs /media/usb_drive/
复制代码 输出如下:
EXPORT IMAGE SIZE 8568 MBytes
find: '/proc/896/task/896/net': Invalid argument
find: '/proc/896/net': Invalid argument
find: '/proc/936/task/936/net': Invalid argument
find: '/proc/936/net': Invalid argument
find: '/proc/1139/task/1139/net': Invalid argument
find: '/proc/1139/net': Invalid argument
BLOCK_COUNT 9290489
INODE_COUNT 169877
sync...
sync finish
Export rootfs to /media/usb_drive//Firefly_ext4_202206170232.img Success
可见导出结果是一个格式为 ext4 的文件。
5. 压缩
/sbin/e2fsck
/sbin/resize2fs
最终得到一个 5.84G 的文件
6. 更新parameters.txt
0x00C00000@0x00038000(rootfs),0x00060000@0x00C38000(oem)
7. 能成功将上述得到的 rootfs.img 写入板子并成功启动
==========================================================================
今天,我在基于上述镜像固件的系统上,尝试再进行打包(因为我又新加入了一些私有程序),这次有遇到一些不一样的情况:
在上述步骤 4 中,现在有看到 mounting ext2 这样的输出:
./ff_export_rootfs /media/usb_drive/
MEDIA FREE SPACE SIZE 55975 MBytes
EXPORT IMAGE SIZE 8040 MBytes
find: ‘/proc/697/task/1199’: No such file or directory
find: ‘/proc/697/task/1200’: No such file or directory
find: ‘/proc/697/task/1201’: No such file or directory
find: ‘/proc/697/task/1202’: No such file or directory
BLOCK_COUNT 8713964
INODE_COUNT 215955
[ 178.260587] EXT4-fs (loop0): mounting ext2 file system using the ext4 subsystem
[ 178.282640] EXT4-fs (loop0): mounted filesystem without journal. Opts: (null)
sync...
sync finish
e2fsck 1.44.5 (15-Dec-2018)
Export rootfs to /media/usb_drive//Firefly_ext2_202209060150.img Success
可见这次导出的是 ext2 格式的文件,我不确定这次为什么不再是 ext4 了???
先不管它,继续执行压缩,后得到一个 6.53G 的文件,更新 parameters.txt 为:
0x00DAC000@0x00038000(rootfs),0x00060000@0x00DE4000(oem)
最后,将新导出的 rootfs.img 固件重新写入板子后,板子的系统启动出错 EXT4-fs error :
/scripts/init-top/console_setup: line 1: can't open /dev/tty2: No such device or address
/scripts/init-top/console_setup: line 1: can't create /dev/tty3: No such device or address
/scripts/init-top/console_setup: line 1: can't open /dev/tty3: No such device or address
/scripts/init-top/console_setup: line 1: can't create /dev/tty4: No such device or address
/scripts/init-top/console_setup: line 1: can't open /dev/tty4: No such device or address
/scripts/init-top/console_setup: line 1: can't create /dev/tty5: No such device or address
/scripts/init-top/console_setup: line 1: can't open /dev/tty5: No such device or address
/scripts/init-top/console_setup: line 1: can't create /dev/tty6: No such device or address
/scripts/init-top/console_setup: line 1: can't open /dev/tty6: No such device or address
Begin: Loading essential drivers ... done.
Begin: Running /scripts/init-premount ... done.
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/local-premount ... done.
Warning: fsck not present, so skipping root file system
[ 3.590926] EXT4-fs (mmcblk0p6): mounted filesystem without journal. Opts: (null)
done.
Begin: Running /scripts/local-bottom ... done.
Begin: Running /scripts/init-bottom ... Warning: overlayroot: configuring overlayroot with driver=overlay mode=device opts='dev=PARTLABEL=userdata,fstype=ext4,mkfs=1' per kernel cmdline
[ 3.742349] EXT4-fs (mmcblk0p8): warning: mounting unchecked fs, running e2fsck is recommended
[ 3.749444] EXT4-fs (mmcblk0p8): mounted filesystem without journal. Opts: (null)
[[: missing ]]
[ 3.792694] EXT4-fs error (device mmcblk0p6): ext4_lookup:1706: inode #2: comm overlayroot: deleted inode referenced: 169729
[ 3.800716] EXT4-fs error (device mmcblk0p6): ext4_lookup:1706: inode #2: comm overlayroot: deleted inode referenced: 169729
[ 3.801680] EXT4-fs error (device mmcblk0p6): ext4_lookup:1706: inode #2: comm overlayroot: deleted inode referenced: 169729
ln: /root/var/lib/docker: Structure needs cleaning
Success: overlayroot: configured root with 'device:dev=PARTLABEL=userdata,fstype=ext4,mkfs=1' using overlay per kernel cmdline
Warning: Something odd, no /lib/modules/4.19.111 in initramfs.
done.
[ 3.886249] EXT4-fs error (device mmcblk0p6): ext4_lookup:1706: inode #2: comm run-init: deleted inode referenced: 169313
run-init: /sbin/init: Structure needs cleaning
Target filesystem doesn't have requested /sbin/init.
[ 3.890317] EXT4-fs error (device mmcblk0p6): ext4_lookup:1706: inode #2: comm run-init: deleted inode referenced: 169313
run-init: /sbin/init: Structure needs cleaning
run-init: /etc/init: No such file or directory
run-init: /bin/init: No such file or directory
/bin/sh: 0: can't access tty; job control turned off
我不确定是否和 ext2 有关系,但尝试了更改以下强行指定为 ext4:
mount -t ext4 /dev/sda1 /media/usb_drive
##最终测试结果,依然失败。 ./ff_export_rootfs /media/usb_drive/ -t ext4 ##此命令不支持指定为 ext4, 仅支持显示指定为: ext2
还请帮忙看一下
|
-
-
none.zip
154 Bytes, 下载次数: 2, 下载积分: 灯泡 -1 , 经验 -1
|