Firefly开源社区

12
发表新贴

【技术分享】Lubuntu镜像制作

263

积分

22

威望

24

贡献

技术达人

Rank: 2

积分
263
QQ
发表于 2016-5-13 12:06:06     
本帖最后由 hongyin 于 2016-5-13 13:37 编辑

看到有些朋友不知道怎么把基于官方lubuntu系统搭建好的环境制作成镜像文件,官方的教程又没有,本着人人为我,我为人人的精神,在此把自己的经验分享出来供大家参考,具体步骤如下:

1、找一个至少预留2G空间以上的U盘用来存放最终生成的文件;


2、插入优盘,系统会自动挂载到/media/usb目录下;

3、进入U盘挂载目录下,创建一个新文件夹“myrootfs”后并进入;

4、创建一个大小2G(可调整)的空镜像文件: dd if=/dev/zero of=linuxroot.img bs=1M count=2048

5、格式化成ext4文件系统格式,卷标为linuxroot: mkfs.ext4 -F -L linuxroot linuxroot.img

6、挂载空镜像文件: mount -o loop linuxroot.img /opt

7、挂载 Lubuntu系统分区: mount /dev/mmcblk0p5 /mnt

8、复制 Lubuntu根文件系统到空镜像文件: cp -a /mnt/*  /opt

9、创建一个启动标记文件: touch /opt/firstboot

10、最后umount掉所有自己挂载的点。

至此,最终的镜像文件就制作完成了,下面就剩下打包的事情了,打包的可以参考
官方教程:http://wiki.t-firefly.com/index. ... ze_android_firmware
有什么不懂的可以相互交流。








已有 1评分威望 +9 灯泡 +10 贡献 +12 收起 理由
sunlei + 9 + 10 + 12 给力

查看全部评分

回复

使用道具 举报

950

积分

95

威望

72

贡献

超级版主

Rank: 8Rank: 8

积分
950
发表于 2016-5-16 09:45:05     
:victory:好贴,感谢分享
回复

使用道具 举报

23

积分

0

威望

0

贡献

游客

积分
23
发表于 2016-5-23 23:43:28     
本帖最后由 superxingzheng 于 2016-5-23 23:56 编辑

我根据hongyin的提示把板子里的root弄到了9G大小的linuxroot.img里,然后根据http://wiki.t-firefly.com/index. ... ze_android_firmware 把这个linuxroot.img 替换到从官网下载的Firefly-RK3288_Ubuntu14.04_201512031755.img里。最后板子启动的时候遇到如下错误:
[    6.836140] hub 3-1:1.0: USB hub found
[    6.858777] hub 3-1:1.0: 4 ports detected
[    6.874961] 2, baud is:115200
[    6.880143] Freeing unused kernel memory: 2368K (c0a9c000 - c0cec000)
Loading, please wait...
[    6.906364] udevd[147]: starting version 175
Begin: Loading essential drivers ... FATAL: Could not load /lib/modules/3.10.0/modules.dep: No such file or directory
FATAL: Could not load /lib/modules/3.10.0/modules.dep: No such file or directory
FATAL: Could not load /lib/modules/3.10.0/modules.dep: No such file or directory
FATAL: Could not load /lib/modules/3.10.0/modules.dep: No such file or directory
done.
Begin: Running /scripts/init-premount ... done.
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
ext4
Begin: Running /scripts/local-premount ... FATAL: Could not load /lib/modules/3.10.0/modules.dep: No such file or directory
done.
FATAL: Could not load /lib/modules/3.10.0/modules.dep: No such file or directory
[    8.040147] JBD2: no valid journal superblock found
[    8.049623] EXT4-fs (mmcblk0p5): error loading journal
mount: mounting /dev/block/mtd/by-name/linuxroot on /root failed: Invalid argument
Begin: Running /scripts/local-bottom ... done.
done.
Begin: Running /scripts/init-bottom ... mount: mounting /dev on /root/dev failed: No such file or directory
done.
mount: mounting /sys on /root/sys failed: No such file or directory
mount: mounting /proc on /root/proc failed: No such file or directory
Target filesystem doesn't have requested /sbin/init.
No init found. Try passing init= bootarg.
FATAL: Could not load /lib/modules/3.10.0/modules.dep: No such file or directory
FATAL: Could not load /lib/modules/3.10.0/modules.dep: No such file or directory
/bin/sh: can't access tty; job control turned off
(initramfs) [   11.751428] [otg id chg] last id -1 current id 1
[   11.773911] PortPower off
[   11.794151] rk_battery_charger_detect_cb , battery_charger_detect 6
[   11.917758] Using Buffer DMA mode
[   11.922865] Periodic Transfer Interrupt Enhancement - disabled
[   11.930489] Multiprocessor Interrupt Enhancement - disabled
[   11.937847] OTG VER PARAM: 0, OTG VER FLAG: 0
[   11.944053] ^^^^^^^^^^^^^^^^^Device Mode
[   11.987771] es8323_create file error
[   12.440211] ***************vbus detect*****************
[   12.465902] rk_battery_charger_detect_cb , battery_charger_detect 1
[  592.980432]
[  592.980432] rk_fb_switch_screen lcdc_id 0 type 1 enable 0
[  592.980470] VGA SUSPEND
[  592.980544] rk_iommu ff930300.vopb_mmu: (vopb) Disabled
[  592.980558] rk_iommu ff930300.vopb_mmu: rockchip_iommu_detach_device: Detached IOMMU with pgtable 0x2e23b000
[  593.005209] rk3288-lcdc lcdc0: blank mode:1


是不是跟改了linux root的大小有关? 生成img之前,有没有哪里需要调整?



回复

使用道具 举报

263

积分

22

威望

24

贡献

技术达人

Rank: 2

积分
263
QQ
发表于 2016-5-26 10:18:08     
superxingzheng 发表于 2016-5-23 23:43
我根据hongyin的提示把板子里的root弄到了9G大小的linuxroot.img里,然后根据http://wiki.t-firefly.com/in ...

应该不是调整大小的问题,感觉像是你cp的时候出问题了,还有大小最好是2的整数倍,尽量控制在8192M以内,太大不确定会不会有问题。
回复

使用道具 举报

12

积分

0

威望

0

贡献

游客

积分
12
发表于 2016-5-31 10:03:48     
你好 我在CP的时候报错:no space left on device,请问你有没有遇到过类似问题,怎么解决?
回复

使用道具 举报

166

积分

0

威望

0

贡献

技术小白

积分
166
发表于 2016-11-28 10:13:19     
请问最后为什么要touch /opt/firstboot?
如果没有做会怎么样?
回复

使用道具 举报

208

积分

13

威望

10

贡献

技术达人

Rank: 2

积分
208
发表于 2016-12-20 17:34:24     
mlt911213 发表于 2016-11-28 10:13
请问最后为什么要touch /opt/firstboot?
如果没有做会怎么样?

firstboot是一个标志文件,ubuntu文件系统中 、/usr/local/bin/XXX.sh 中会根据这个文件是否存在而执行resize2fs这个命令
回复

使用道具 举报

166

积分

0

威望

0

贡献

技术小白

积分
166
发表于 2016-12-21 14:58:22     
orbbec-wmy 发表于 2016-12-20 17:34
firstboot是一个标志文件,ubuntu文件系统中 、/usr/local/bin/XXX.sh 中会根据这个文件是否存在而执行re ...

明白了,谢谢
回复

使用道具 举报

37

积分

0

威望

0

贡献

游客

积分
37
发表于 2017-3-31 17:18:14     
orbbec-wmy 发表于 2016-12-20 17:34
firstboot是一个标志文件,ubuntu文件系统中 、/usr/local/bin/XXX.sh 中会根据这个文件是否存在而执行re ...

可以说明/usr/local/bin/first-boot-recovery.sh 是由谁调用的呢
回复

使用道具 举报

221

积分

0

威望

0

贡献

技术达人

Rank: 2

积分
221
QQ
发表于 2017-5-11 21:15:47     
按照你的方法,为甚么没有图形界面啊。我的板子是RK3288,
回复

使用道具 举报

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

本版积分规则

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