CubieBoard中文论坛

 找回密码
 立即注册
搜索
热搜: unable
查看: 6503|回复: 0

CB4/CB5移动文件系统到U盘或USB硬盘

[复制链接]
发表于 2016-4-23 18:14:41 | 显示全部楼层 |阅读模式
本帖最后由 sunbeyond 于 2016-4-26 15:16 编辑

我们知道在CB1,CB2,CB3 转移文件系统到sata或硬盘,可以通过修改uEnv.txt来指定相关文件系统挂载节点。
CB4,CB5我们是没有发现uEnv.txt 这个文件, uEnv.txt 修改的位置对应为uboot启动参数。所以只要修改uboot源码相应参数指定文件系统挂载就可以把CB4/CB5文件系统移动u盘/硬盘。


1. uboot源码都放在github上

https://github.com/cubieboard/CC-A80-u-boot
https://github.com/cubieboard/Cubietruck_Plus-u-boot

2. 修改uboot, 编译参考上面github readme。

CB4 对应uboot参数修改
sam@cubie:/work/a83/brandy/u-boot-2011.09$ git diff
diff --git a/u-boot-2011.09/include/configs/sun8iw6p1.h b/u-boot-2011.09/include
index 4687474..3cc79d3 100755
--- a/u-boot-2011.09/include/configs/sun8iw6p1.h
+++ b/u-boot-2011.09/include/configs/sun8iw6p1.h
@@ -324,7 +324,7 @@
        "bootcmd=run setargs_mmc boot_normal\0" \
        "console=ttyS0,115200\0" \
        "console1=tty0\0" \
-       "mmc_root=/dev/mmcblk0p2\0" \
+       "mmc_root=/dev/sda\0" \
        "loglevel=8\0" \
        "setargs_mmc=setenv bootargs console=${console1} console=${console} root
        "loglevel=${loglevel}\0" \

CB5 对应uboot参数修改

sam@cubie:/work/a80-linux-sdk/u-boot/include/configs$ git diff
diff --git a/include/configs/sun9iw1p1.h b/include/configs/sun9iw1p1.h
index fbd95d5..3d3773e 100755
--- a/include/configs/sun9iw1p1.h
+++ b/include/configs/sun9iw1p1.h
@@ -305,7 +305,7 @@
        "bootcmd=run setargs_cubie boot_normal\0" \
        "console=ttyS0,115200\0" \
        "console1=tty1\0" \
-       "mmc_root=/dev/mmcblk0p2\0" \
+       "mmc_root=/dev/sda\0" \
        "init=/init\0" \
        "loglevel=8\0" \
        "setargs_cubie=setenv bootargs console=${console1} console=${console}

3.   文件系统备份到u盘

格式化u盘为ext4格式

#mkfs.ext4 /dev/sda  (/dev/sda对应u盘节点)
#mount /dev/sda /mnt

通过如下命令把CB4/CB5文件系统备份到u盘

#cat > .install-exclude <<EOF
/dev/*
/proc/*
/sys/*
/media/*
/mnt/*
/run/*
/tmp/*
/boot/*
EOF
$apt-get install rsync
$rsync -aH --exclude-from=.install-exclude / /mnt
$sync
$umount /mnt

在我测试中:我是直接解压文件系统压缩包到u盘里面也是一样的。


4.  把编译好的uboot bin文件拷贝到板子/root/boot-file

Cubietruck_Plus-u-boot/u-boot-2011.09/boot0_sdcard_sun8iw6p1.bin --> /root/boot-file/u-boot-spl-sun8iw6p1.bin

系统启动在tfcard:

Cubietruck_Plus-u-boot/u-boot-2011.09/u-boot-sun8iw6p1.bin --> /root/boot-file/u-boot-sun8iw6p1.bin

系统启动在emmc:

Cubietruck_Plus-u-boot/u-boot-2011.09/u-boot-sun8iw6p1.bin --> /root/boot-file/u-boot-sun8iw6p1-card2.bin

#apt-get install  dos2unix (update_sys_config.sh 脚本需用该工具,注意一定要安装,update_sys_config.sh 运行失败会导致系统启动不了,得重新刷机)


# cd /root/boot-file
系统启动在tfcard:
#update_sys_config.sh tfcard
#sync
# reboot

系统启动在emmc:
#update_sys_config.sh emmc
#sync
# reboot

5.重启之后文件系统转移到u盘








回复

使用道具 举报

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

本版积分规则

QQ|Archiver|手机版|粤ICP备13051116号|cubie.cc---深刻的嵌入式技术讨论社区

GMT+8, 2024-5-9 06:19 , Processed in 0.019263 second(s), 15 queries .

Powered by Discuz! X3.4

© 2001-2012 Comsenz Inc. | Style by Coxxs

返回顶部