参考更优雅的(不拆硬盘)拯救死翘翘了的WD MyCloud(Ubuntu 17.10)配置编译出来的镜像中缺少parted
,无法创建GPT
分区,我们在此介绍一下如何增加parted-3.0/parted-2.3
的功能。
首先参考Ubuntu 17.10上使用crosstool-ng-1.23.0建立WD MyCloud修复工具编译环境(uClibc)创建我们需要的编译工具。
接着参考更优雅的(不拆硬盘)拯救死翘翘了的WD MyCloud(Ubuntu 17.10)配置编译出启动镜像。
然后下载并编译libuuid-1.0.3
的源代码
然后下载并编译parted-3.0/parted-2.3
的源代码
完成后,打包我们刚刚构建的应用
重新打包uImage
镜像
其他操作参照更优雅的(不拆硬盘)拯救死翘翘了的WD MyCloud(Ubuntu 17.10)。
上面涉及到的源代码,如果不能下载成功,可以从本站下载一份代码拷贝。点击这里下载libuuid-1.0.3,点击这里下载parted-2.3, 点击这里下载parted-3.0
sed -i 's/_GL_WARN_ON_USE[ \t]*(gets/\/\/_GL_WARN_ON_USE (gets/g' ~/parted-2.3/lib/stdio.in.h
经核查2.3目录不存在,可以略过么?
建议先不要增加这些附加应用,只编译纯镜像,等纯镜像能正常运行后,再增加附加工具,另外这些附加工具不需要打包进入镜像,可以独立编译成可执行程序,然后在系统进入后,通过 “tftp -g -r mkfs.ext3 192.168.0.1” 这样的命令从PC机的TFTP目录里面远程拉取
那重新编译独立程序有单独的教程么?
不打包进入镜像就是独立的程序,打包进镜像就不是独立的,这个只是在教程的最后一步选择是不是进入镜像而已,一般是把需要的ulibc打包进入系统,其他的都依赖ulibc,不需要打包,到时候只需要下载一个可执行程序,而不需要下载太多的其他依赖,当然如果静态编译,那ulibc都不需要了。
cp -r ~/parted-3.0/parted_arm/* ~/mycloud/extrafiles
这一步的时候,没有parted_arm这个目录...configure的时候没报错啊....囧
见笑了,忘记把2.3 wget回来了。现在都有了,但是变成报错了:
make all-recursive
make[3]: Entering directory '/home/zijing/.local/share/Trash/files/parted-3.0/lib'
make[4]: Entering directory '/home/zijing/.local/share/Trash/files/parted-3.0/lib'
CC exitfail.lo
CC fd-hook.lo
CC freading.lo
In file included from freading.h:18:0,
from freading.c:20:
./stdio.h:1050:1: error: 'gets' undeclared here (not in a function); did you mean 'fgets'?
_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
^
Makefile:1306: recipe for target 'freading.lo' failed
make[4]: *** [freading.lo] Error 1
make[4]: Leaving directory '/home/zijing/.local/share/Trash/files/parted-3.0/lib'
Makefile:1327: recipe for target 'all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory '/home/zijing/.local/share/Trash/files/parted-3.0/lib'
Makefile:1124: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/home/zijing/.local/share/Trash/files/parted-3.0/lib'
Makefile:1118: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/zijing/.local/share/Trash/files/parted-3.0'
Makefile:1042: recipe for target 'all' failed
make: *** [all] Error 2
这个问题,请仔细看文章,里面有代码修改的,修改的代码其中一个地方就是解决这个问题
编译编译 parted-3.0/parted-2.3 最后make的时候就这样了