WD MyCloud编译的busybox-1.23.2中增加parted-3.0/parted-2.3

参考更优雅的(不拆硬盘)拯救死翘翘了的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

参考链接


Building a minimal RootFS with Busybox, GLIBC and DropBear

发布者

《WD MyCloud编译的busybox-1.23.2中增加parted-3.0/parted-2.3》上有8条评论

    1. 建议先不要增加这些附加应用,只编译纯镜像,等纯镜像能正常运行后,再增加附加工具,另外这些附加工具不需要打包进入镜像,可以独立编译成可执行程序,然后在系统进入后,通过 “tftp -g -r mkfs.ext3 192.168.0.1” 这样的命令从PC机的TFTP目录里面远程拉取

        1. 不打包进入镜像就是独立的程序,打包进镜像就不是独立的,这个只是在教程的最后一步选择是不是进入镜像而已,一般是把需要的ulibc打包进入系统,其他的都依赖ulibc,不需要打包,到时候只需要下载一个可执行程序,而不需要下载太多的其他依赖,当然如果静态编译,那ulibc都不需要了。

    1. 见笑了,忘记把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

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注