So, to install new packages on the My Cloud you need to build them from source on another system, copy the obtained deb packages on the My Cloud and install.
WD provides a GPL source package of the latest firmware on their website, which contains a build environment to perform this operation. This is totally at the end-user own risk, since no support at all is provided by WD and installing 3rd party software may void warrany.
An additional problem is that the build environment provided by WD has a "minor" problem that causes the building process of most packages to fail because of a GCC compiler segmentation fault.
This guide shows how to deal with this problem and, in general, how to create a build environment to easily do the task.
Some Linux knowledge is needed.
NOTE 1: as of now, this procedure is surely needed to build packages for the 4.x firmware; however, by experience, I find out that it's a useful procedure even if you are sticking with the 3.x firmware; so the guide explains how to build packages for both firmware versions
NOTE 2: in principle, it should be possible to build packages directly on the My Cloud, instead of using an external system; however I don't think it's a good idea to try this, because of many reasons, including: the My Cloud system is surely slower than a regular PC to compile packages; you would need to install all the development tools on the My Cloud itself (and this may require in turn to build them on another system first...)
Step 1: prepare the build system (required only once)
The build environment must be a Linux system, either Debian-based or Ubuntu-based. I personally suggest to create a virtual machine with such a system in it. This guide will take this route.Download and install VirtualBox (https://www.virtualbox.org/) on your phisical system (either Linux, Windows or Mac). Start VirtualBox and create a new virtual machine for a Debian 64-bit. The default settings suggested by VirtualBox regarding memory, disk size and VM configuration should be ok to start.
After the VM is ready, download a Debian Wheezy 64-bit ISO image; I suggest the netinst image, which is the smaller one. Right now, Debian 7.8.0 is available and the direct links are:
- http://cdimage.debian.org/debian-cd/7.8.0/amd64/is
o-cd/debian-7.8.0-amd64-netinst.iso (download via HTTP)
注意,强烈推荐用最新的Debian 8.3系统来进行编译,就目前的编译经验来讲,Debian 8.3所使用的Qemu修正了大量的BUG,尤其是编译期间出现的大量的"段错误(Segment fault)",7.8版本上完全无法通过编译的软件,在8.3上轻松编译通过。
Boot the VM with the downloaded ISO mounted in and install just the Debian base system (nothing else is required). Refer to VirtualBox and Debian websites for documentation on how to perform these operations.
Once the guest VM is installed, we need to make just a couple little tunings. First of all, Debian Wheezy comes with qemu-user-static package version 1.1.2. Qemu is an environment needed to emulate an actual ARM system on another platform, like the AMD64 platform our build system consists of. It's a good idea to update Qemu to version 2.x from the wheezy-backports repository. To do this, start the build system and login. Then:
1 2 3 4 |
# sudo su # sudo echo "deb http://security.debian.org/ wheezy-backports main contrib non-free" >>/etc/apt/sources.list # sudo apt-get update # sudo apt-get -t wheezy-backports install qemu-user-static |
对于国内的用户,使用官方源可能无法更新,建议如下设置
1 2 3 4 |
# sudo su # sudo echo "deb http://mirrors.163.com/debian/ wheezy-backports main contrib non-free" >>/etc/apt/sources.list # sudo apt-get update # sudo apt-get -t wheezy-backports install qemu-user-static |
如果使用现在最新的Debian 8.3版本,则不需要继续在backports中安装qemu了,执行如下命令即可。
1 2 |
# sudo apt-get update # sudo apt-get install qemu-user-static |
This should also install binfmt-support, which is another packages needed by the build environment. If this is not the case, also type:
1 |
# sudo apt-get install binfmt-support |
Now, let's prepare the actual build environment. Let's create a folder in the /root directory of the build system and download the WD My Cloud 4.x firmware source package from WD website.
1 2 3 4 |
# cd /root # mkdir wdmc-build # cd wdmc-build # wget http://download.wdc.com/gpl/gpl-source-sequoia-04.01.02-417.zip?v=7111 -O gpl-source-sequoia-04.01.02-417.zip |
In case the link changes, refer to WD My Cloud support page to find the new one: http://support.wdc.com/product/download.asp?groupi
I then suggest to create different folders for different build scenarios. These are the possibilities:
- the target system may be firmware 3.x (4k) or firmware 4.x (64k)
- the source package base may be wheezy (Debian stable) or jessie (Debian testing); wheezy contains older packages, but that should run happily in My Cloud (which has a Wheezy in it!), while jessie contains newer packages that might also work and provide updated versions of many applications; I would personally recommend to build packages from wheezy, unless you absolutely need a newer version that is only in jessie
I don't recommend to mix things, so I would create different folders for any different combination. You're free to create just the one you are interested in, so among the following commands type fhe first ones, then only the block of commands of the combination(s) you're interested in, then the last command:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# cd /root/wdmc-build # unzip gpl-source-sequoia-04.01.02-417.zip packages/build_tools/debian/* # mkdir 64k-wheezy # cp -R packages/build_tools/debian/* ./64k-wheezy # echo '#!/bin/bash' >>64k-wheezy/build.sh # echo './build-armhf-package.sh --pagesize=64k $1 wheezy' >>64k-wheezy/build.sh # chmod a+x ./64k-wheezy/build.sh # mkdir 64k-jessie # cp -R packages/build_tools/debian/* ./64k-jessie # echo '#!/bin/bash' >>64k-jessie/build.sh # echo './build-armhf-package.sh --pagesize=64k $1 jessie' >>64k-jessie/build.sh # chmod a+x ./64k-jessie/build.sh # mkdir 4k-wheezy # cp -R packages/build_tools/debian/* ./4k-wheezy # echo '#!/bin/bash' >>4k-wheezy/build.sh # echo './build-armhf-package.sh --pagesize=4k $1 wheezy' >>4k-wheezy/build.sh # chmod a+x ./4k-wheezy/build.sh # mkdir 4k-jessie # cp -R packages/build_tools/debian/* ./4k-jessie # echo '#!/bin/bash' >>4k-jessie/build.sh # echo './build-armhf-package.sh --pagesize=4k $1 jessie' >>4k-jessie/build.sh # chmod a+x ./4k-jessie/build.sh # rm -rf packages/ |
In this way, in every folder will be created a build.sh script that passes the right parameters to the WD provided script, requiring only the name of the package to build. This would work straight away if there weren't the problem with qemu I mentioned in the beginning, so another step is required to finish the prepare phase. Again, only type commands for the scenario(s) you're interested in:
64k-wheezy:
1 2 3 4 |
# cd /root/wdmc-build/64k-wheezy # ./setup.sh bootstrap/wheezy-bootstrap_1.24.14_armhf.tar.gz build # mv build/usr/bin/qemu-arm-static build/usr/bin/qemu-arm-static_orig # cp /usr/bin/qemu-arm-static build/usr/bin/qemu-arm-static |
64k-jessie:
1 2 3 |
# cd /root/wdmc-build/64k-jessie # ./setup.sh bootstrap/jessie-bootstrap_5.14.14_armhf.tar.gz build # cp /usr/bin/qemu-arm-static build/usr/bin/qemu-arm-static |
4k-wheezy:
1 2 3 4 |
# cd /root/wdmc-build/4k-wheezy # ./setup.sh bootstrap/wheezy-bootstrap_1.24.14_armhf.tar.gz build # mv build/usr/bin/qemu-arm-static build/usr/bin/qemu-arm-static_orig # cp /usr/bin/qemu-arm-static build/usr/bin/qemu-arm-static |
4k-jessie:
1 2 3 |
# cd /root/wdmc-build/4k-jessie # ./setup.sh bootstrap/jessie-bootstrap_5.14.14_armhf.tar.gz build # cp /usr/bin/qemu-arm-static build/usr/bin/qemu-arm-static |
The meaning of the above is the following: prepare an emulated ARM system and replace the qemu-arm-static binary provided by the bootstrap with the recent one we've installed in our actual build system.
Ignore any errors produced by setup.sh: that script is really buggy and many things it tries to do seem to be useless, unless we apply the mentioned qemu fix.
As a final step, I would recommend to edit the sources file list within the armhf build subsystem in order to be able to build packages that are in any of the distribution repositories. To do this, type the following:
1 2 |
# cd /root/wdmc-build # nano <scenario>/build/etc/apt/sources.list |
by replacing <scenario> with the desired one (64k-wheezy, 64k-jessie, 4k-wheezy, 4k-jessie); the nano editor will open, then replace the contents of the existing file with the following:
For 64k-wheezy and 4k-wheezy:
1 2 3 4 5 6 7 8 9 |
deb http://security.debian.org/ wheezy/updates main contrib non-free deb-src http://security.debian.org/ wheezy/updates main contrib non-free deb http://ftp.debian.org/debian wheezy-updates main contrib non-free deb-src http://ftp.debian.org/debian wheezy-updates main contrib non-free deb http://ftp.debian.org/debian wheezy main contrib non-free deb-src http://ftp.debian.org/debian wheezy main contrib non-free #deb http://ftp.debian.org/debian wheezy-backports main contrib non-free #deb-src http://ftp.debian.org/debian wheezy-backports main contrib non-free |
For 64k-jessie and 4k-jessie:
1 2 3 4 5 6 |
deb http://security.debian.org/ jessie/updates main contrib non-free deb-src http://security.debian.org/ jessie/updates main contrib non-free deb http://ftp.debian.org/debian jessie-updates main contrib non-free deb-src http://ftp.debian.org/debian jessie-updates main contrib non-free deb http://ftp.debian.org/debian jessie main contrib non-free deb-src http://ftp.debian.org/debian jessie main contrib non-free |
In case of wheezy, uncomment the last two lines if you want to build package versions from wheezy-backports. I don't know however if additional changes to the build.sh script (or better to the WD provided one) are needed to instruct apt to download and build the source from the backports repository. I don't have tried it yet. Anyway, I would recommend to leave those two lines commented unless you actually need something from the backports repository.
Save the file by hitting Ctrl+X, Y, Enter.
Now you're ready to build your first package!
如果使用现在最新的Debian 8.3版本,需要把主机的域名解析的配置文件,复制到编译的对应目录,否则会造成无法解析域名(当然,也可以自行编辑一个正确的resolv.conf
文件,指定域名解析服务器地址)。
1 2 |
# cd /root/wdmc-build # cp /etc/resolv.conf <scenario>/build/etc/ |
Optional additional step (not strictly required) for wheezy scenarios
You may also want to use an updated C++ compiler to build packages in the wheezy scenarios. Debian Wheezy provides g++ package 4.6, but 4.7 is also available. With the following commands you can install the new version and then switch from one to the other using update-alternatives:
1 2 3 4 5 6 7 8 9 10 11 12 |
# cd /root/wdmc-build/<scenario> # chroot build # apt-get update # apt-get install g++ g++-4.7 # update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++.4.6 10 # update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.7 20 # update-alternatives --install /usr/bin/gcc g++ /usr/bin/gcc-4.6 10 # update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 20 # rm /usr/bin/cpp # update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-4.6 10 # update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-4.7 20 # exit |
After these commands, the default C++ compiler will be version 4.7. You can then switch to the old version by typing:
1 2 3 4 5 6 |
# cd /root/wdmc-build/<scenario> # chroot build # update-alternatives --set cpp /usr/bin/cpp-4.6 # update-alternatives --set gcc /usr/bin/gcc-4.6 # update-alternatives --set g++ /usr/bin/g++-4.6 # exit |
Or use
1 |
update-alternatives --config <command> |
to get an interactive prompt.
- 编译 git-lfs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
$ cd ~/wdmc-build/64k-wheezy $ sudo apt-get update $ sudo apt-get upgrade $ sudo chroot build $ mount -t proc none /proc $ mount -t devtmpfs none /dev $ mount -t devpts none /dev/pts $ export DEBIAN_FRONTEND=noninteractive $ export DEBCONF_NONINTERACTIVE_SEEN=true $ export LC_ALL=C $ export LANGUAGE=C $ export LANG=C $ export DEB_CFLAGS_APPEND='-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE' $ export DEB_BUILD_OPTIONS=nocheck # 安装依赖 $ apt-get update $ apt-get upgrade $ apt-get install golang $ apt-get install dh-golang $ cd root $ git clone https://github.com/git-lfs/git-lfs.git $ cd git-lfs $ dpkg-buildpackage -d -b -uc |
- 编译 amule
amule
默认编译的时候是包含GUI
界面的,但是WD MyCloud
是用不到界面的,实际上GTK+
部分目前也没办法编译通过。
首先,执行一次编译,让脚本自动把需要的依赖安装配置完成,方便我们的后续处理
1 2 3 4 5 |
$ cd ~/wdmc-build/64k-wheezy $ su $ ./build.sh amule |
amule
编译完成后,把依赖的wxWidgets2.8
等依赖库编译完成后,只能安装命令行版本的amule
,安装命令如下:
1 |
$ apt-get install amule-daemon |
- 编译 nut-2.7.2
ups不间断电源网络服务
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
$ cd ~/wdmc-build/64k-wheezy $ sudo chroot build $ mount -t proc none /proc $ mount -t devtmpfs none /dev $ mount -t devpts none /dev/pts $ export DEBIAN_FRONTEND=noninteractive $ export DEBCONF_NONINTERACTIVE_SEEN=true $ export LC_ALL=C $ export LANGUAGE=C $ export LANG=C $ export DEB_CFLAGS_APPEND='-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE' $ export DEB_BUILD_OPTIONS=nocheck $ cd root $ mkdir nut-2.7.2 $ cd nut-2.7.2 $ wget http://deb.debian.org/debian/pool/main/n/nut/nut_2.7.2-4.dsc $ wget http://deb.debian.org/debian/pool/main/n/nut/nut_2.7.2.orig.tar.gz $ wget http://deb.debian.org/debian/pool/main/n/nut/nut_2.7.2-4.debian.tar.xz # 也可本站下载源代码 # wget https://www.mobibrw.com/wp-content/uploads/2014/09/nut_2.7.2-4.dsc # wget https://www.mobibrw.com/wp-content/uploads/2014/09/nut_2.7.2.orig_.tar.gz -O nut_2.7.2.orig.tar.gz # wget https://www.mobibrw.com/wp-content/uploads/2014/09/nut_2.7.2-4.debian.tar.xz $ tar xzvf nut_2.7.2.orig.tar.gz $ tar xvf nut_2.7.2-4.debian.tar.xz -C nut-2.7.2/ $ cd nut-2.7.2 $ dpkg-buildpackage -d -b -uc |
如果发生如下错误:
1 2 3 4 |
dh_installman -pnut-server debian/tmp/usr/share/man/man8/bcmxcp_usb.8: No such file or directory at /usr/bin/dh_installman line 128, <IN> line 60. make: *** [binary-install/nut-server] Error 2 dpkg-buildpackage: error: debian/rules binary gave error exit status 2 |
执行如下命令修复后重新编译:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
$ sed -i "/^debian\/tmp\/usr\/share\/man\/man8\/bcmxcp_usb.8/d" debian/nut-server.manpages $ sed -i "/^debian\/tmp\/usr\/share\/man\/man8\/richcomm_usb.8/d" debian/nut-server.manpages $ sed -i "/^debian\/tmp\/usr\/share\/man\/man8\/tripplite_usb.8/d" debian/nut-server.manpages $ sed -i "/^debian\/tmp\/usr\/share\/man\/man8\/usbhid-ups.8/d" debian/nut-server.manpages $ sed -i "/^debian\/tmp\/usr\/share\/man\/man8\/blazer_usb.8/d" debian/nut-server.manpages $ sed -i "/^debian\/tmp\/usr\/share\/man\/man8\/nutdrv_atcl_usb.8/d" debian/nut-server.manpages $ sed -i "/^debian\/tmp\/usr\/share\/man\/man8\/riello_usb.8/d" debian/nut-server.manpages |
如果发生如下错误:
1 2 3 |
dh_install: nut-server missing files (debian/tmp/*/udev/rules.d/52-nut-usbups.rules), aborting make: *** [binary-install/nut-server] Error 2 dpkg-buildpackage: error: debian/rules binary gave error exit status 2 |
执行如下命令修复后重新编译:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
$ sed -i "/^debian\/tmp\/\*\/udev\/rules.d\/52-nut-usbups.rules/d" debian/nut-server.install $ sed -i "/^debian\/tmp\/debian\/tmp\/lib\/nut\/usbhid-ups/d" debian/nut-server.install $ sed -i "/^debian\/tmp\/lib\/nut\/usbhid-ups/d" debian/nut-server.install $ sed -i "/^debian\/tmp\/lib\/nut\/blazer_usb/d" debian/nut-server.install $ sed -i "/^debian\/tmp\/debian\/tmp\/lib\/nut\/tripplite_usb/d" debian/nut-server.install $ sed -i "/^debian\/tmp\/lib\/nut\/tripplite_usb/d" debian/nut-server.install $ sed -i "/^debian\/tmp\/lib\/nut\/bcmxcp_usb/d" debian/nut-server.install $ sed -i "/^debian\/tmp\/lib\/nut\/richcomm_usb/d" debian/nut-server.install $ sed -i "/^debian\/tmp\/lib\/nut\/nutdrv_atcl_usb/d" debian/nut-server.install $ sed -i "/^debian\/tmp\/lib\/nut\/riello_usb/d" debian/nut-server.install |
如果发生如下错误:
1 2 3 4 |
dh_installman -pnut-snmp debian/tmp/usr/share/man/man8/snmp-ups.8: No such file or directory at /usr/bin/dh_installman line 128. make: *** [binary-install/nut-snmp] Error 2 dpkg-buildpackage: error: debian/rules binary gave error exit status 2 |
执行如下命令修复后重新编译:
1 |
$ sed -i "/^debian\/tmp\/usr\/share\/man\/man8\/snmp-ups.8/d" debian/nut-snmp.manpages |
如果发生如下错误:
1 2 3 4 5 |
dh_install -pnut-snmp /bin/cp: cannot stat `debian/tmp/debian/tmp/lib/nut/snmp-ups': No such file or directory dh_install: cp -a debian/tmp/debian/tmp/lib/nut/snmp-ups debian/nut-snmp//lib/nut/ returned exit code 1 make: *** [binary-install/nut-snmp] Error 2 dpkg-buildpackage: error: debian/rules binary gave error exit status 2 |
执行如下命令修复后重新编译:
1 |
$ sed -i "/^debian\/tmp\/lib\/nut\/snmp-ups/d" debian/nut-snmp.install |
如果发生如下错误:
1 2 3 4 |
dh_installman -pnut-ipmi debian/tmp/usr/share/man/man8/nut-ipmipsu.8: No such file or directory at /usr/bin/dh_installman line 128. make: *** [binary-install/nut-ipmi] Error 2 dpkg-buildpackage: error: debian/rules binary gave error exit status 2 |
执行如下命令修复后重新编译:
1 |
$ sed -i "/^debian\/tmp\/usr\/share\/man\/man8\/nut-ipmipsu.8/d" debian/nut-ipmi.manpages |
如果发生如下错误:
1 2 3 4 5 |
dh_install -pnut-ipmi /bin/cp: cannot stat `debian/tmp/debian/tmp/lib/nut/nut-ipmipsu': No such file or directory dh_install: cp -a debian/tmp/debian/tmp/lib/nut/nut-ipmipsu debian/nut-ipmi//lib/nut/ returned exit code 1 make: *** [binary-install/nut-ipmi] Error 2 dpkg-buildpackage: error: debian/rules binary gave error exit status 2 |
执行如下命令修复后重新编译:
1 2 3 |
$ sed -i "/^debian\/tmp\/lib\/nut\/nut-ipmipsu/d" debian/nut-ipmi.install $ sed -i "/^debian\/tmp\/\*\/udev\/rules.d\/52-nut-ipmipsu.rules/d" debian/nut-ipmi.install |
如果发生如下错误:
1 2 3 4 |
dh_installman -pnut-xml debian/tmp/usr/share/man/man8/netxml-ups.8: No such file or directory at /usr/bin/dh_installman line 128. make: *** [binary-install/nut-xml] Error 2 dpkg-buildpackage: error: debian/rules binary gave error exit status 2 |
执行如下命令修复后重新编译:
1 |
$ sed -i "/^debian\/tmp\/usr\/share\/man\/man8\/netxml-ups.8/d" debian/nut-xml.manpages |
如果发生如下错误:
1 2 3 4 5 |
dh_install -pnut-xml /bin/cp: cannot stat `debian/tmp/debian/tmp/lib/nut/netxml-ups': No such file or directory dh_install: cp -a debian/tmp/debian/tmp/lib/nut/netxml-ups debian/nut-xml//lib/nut/ returned exit code 1 make: *** [binary-install/nut-xml] Error 2 dpkg-buildpackage: error: debian/rules binary gave error exit status 2 |
执行如下命令修复后重新编译:
1 |
$ sed -i "/^debian\/tmp\/lib\/nut\/netxml-ups/d" debian/nut-xml.install |
如果发生如下错误:
1 2 3 4 5 |
dh_installexamples -pnut-powerman-pdu dh_installman -pnut-powerman-pdu debian/tmp/usr/share/man/man8/powerman-pdu.8: No such file or directory at /usr/bin/dh_installman line 128. make: *** [binary-install/nut-powerman-pdu] Error 2 dpkg-buildpackage: error: debian/rules binary gave error exit status 2 |
执行如下命令修复后重新编译:
1 |
$ sed -i "/^debian\/tmp\/usr\/share\/man\/man8\/powerman-pdu.8/d" debian/nut-powerman-pdu.manpages |
如果发生如下错误:
1 2 3 4 5 6 |
dh_bugfiles -pnut-powerman-pdu dh_install -pnut-powerman-pdu /bin/cp: cannot stat `debian/tmp/debian/tmp/lib/nut/powerman-pdu': No such file or directory dh_install: cp -a debian/tmp/debian/tmp/lib/nut/powerman-pdu debian/nut-powerman-pdu//lib/nut/ returned exit code 1 make: *** [binary-install/nut-powerman-pdu] Error 2 dpkg-buildpackage: error: debian/rules binary gave error exit status 2 |
执行如下命令修复后重新编译:
1 |
$ sed -i "/^debian\/tmp\/lib\/nut\/powerman-pdu/d" debian/nut-powerman-pdu.install |
- 编译 libnspr4-4.12
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
$ cd ~/wdmc-build/64k-wheezy $ sudo chroot build $ mount -t proc none /proc $ mount -t devtmpfs none /dev $ mount -t devpts none /dev/pts $ export DEBIAN_FRONTEND=noninteractive $ export DEBCONF_NONINTERACTIVE_SEEN=true $ export LC_ALL=C $ export LANGUAGE=C $ export LANG=C $ export DEB_CFLAGS_APPEND='-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE' $ export DEB_BUILD_OPTIONS=nocheck $ cd root $ mkdir nspr_4.12 $ cd nspr_4.12 $ wget http://deb.debian.org/debian/pool/main/n/nspr/nspr_4.12-1+debu8u1.dsc $ wget http://deb.debian.org/debian/pool/main/n/nspr/nspr_4.12.orig.tar.gz $ wget http://deb.debian.org/debian/pool/main/n/nspr/nspr_4.12-1+debu8u1.debian.tar.xz # 也可本站下载源代码 # wget https://www.mobibrw.com/wp-content/uploads/2014/09/nspr_4.12-1debu8u1.dsc -O nspr_4.12-1+debu8u1.dsc # wget https://www.mobibrw.com/wp-content/uploads/2014/09/nspr_4.12-1debu8u1.debian.tar.xz -O nspr_4.12-1+debu8u1.debian.tar.xz # wget https://www.mobibrw.com/wp-content/uploads/2014/09/nspr_4.12.orig_.tar.gz -O nspr_4.12.orig.tar.gz $ tar xzvf nspr_4.12.orig.tar.gz $ tar xvf nspr_4.12-1+debu8u1.debian.tar.xz -C nspr-4.12/ $ cd nspr-4.12/ $ dpkg-buildpackage -d -b -uc |
- 编译 libnss3-3.26
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# 64k-wheezy 的gcc 版本只有4.6,无法编译通过,需要更高版本的GCC $ cd ~/wdmc-build/64k-jessie $ sudo chroot build $ mount -t proc none /proc $ mount -t devtmpfs none /dev $ mount -t devpts none /dev/pts $ export DEBIAN_FRONTEND=noninteractive $ export DEBCONF_NONINTERACTIVE_SEEN=true $ export LC_ALL=C $ export LANGUAGE=C $ export LANG=C $ export DEB_CFLAGS_APPEND='-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE' $ export DEB_BUILD_OPTIONS=nocheck $ cd root $ mkdir nss_3.26 $ cd nss_3.26 $ wget http://security.debian.org/debian-security/pool/updates/main/n/nss/nss_3.26-1+debu8u4.dsc $ wget http://security.debian.org/debian-security/pool/updates/main/n/nss/nss_3.26.orig.tar.gz $ wget http://security.debian.org/debian-security/pool/updates/main/n/nss/nss_3.26-1+debu8u4.debian.tar.xz # 也可本站下载源代码 # wget https://www.mobibrw.com/wp-content/uploads/2014/09/nss_3.26-1debu8u4.dsc -O nss_3.26-1+debu8u4.dsc # wget https://www.mobibrw.com/wp-content/uploads/2014/09/nss_3.26.orig_.tar.gz -O nss_3.26.orig.tar.gz # wget https://www.mobibrw.com/wp-content/uploads/2014/09/nss_3.26-1debu8u4.debian.tar.xz -O nss_3.26-1+debu8u4.debian.tar.xz $ tar xzvf nss_3.26.orig.tar.gz $ tar xvf nss_3.26-1+debu8u4.debian.tar.xz -C nss-3.26/ $ cd nss-3.26/ $ dpkg-buildpackage -d -b -uc |
- 编译 tcp-wrappers-7.6
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
$ cd ~/wdmc-build/64k-wheezy $ sudo chroot build $ mount -t proc none /proc $ mount -t devtmpfs none /dev $ mount -t devpts none /dev/pts $ export DEBIAN_FRONTEND=noninteractive $ export DEBCONF_NONINTERACTIVE_SEEN=true $ export LC_ALL=C $ export LANGUAGE=C $ export LANG=C $ export DEB_CFLAGS_APPEND='-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE' $ export DEB_BUILD_OPTIONS=nocheck $ cd root $ mkdir tcp-wrappers $ cd tcp-wrappers $ wget http://deb.debian.org/debian/pool/main/t/tcp-wrappers/tcp-wrappers_7.6.q-25.dsc $ wget http://deb.debian.org/debian/pool/main/t/tcp-wrappers/tcp-wrappers_7.6.q.orig.tar.gz $ wget http://deb.debian.org/debian/pool/main/t/tcp-wrappers/tcp-wrappers_7.6.q-25.debian.tar.xz # 也可本站下载源代码 # wget https://www.mobibrw.com/wp-content/uploads/2014/09/tcp-wrappers_7.6.q-25.dsc # wget https://www.mobibrw.com/wp-content/uploads/2014/09/tcp-wrappers_7.6.q.orig_.tar.gz -O tcp-wrappers_7.6.q.orig.tar.gz # wget https://www.mobibrw.com/wp-content/uploads/2014/09/tcp-wrappers_7.6.q-25.debian.tar.xz $ tar xzvf tcp-wrappers_7.6.q.orig.tar.gz $ tar xvf tcp-wrappers_7.6.q-25.debian.tar.xz -C tcp_wrappers_7.6/ $ cd tcp_wrappers_7.6 $ dpkg-buildpackage -d -b -uc |
- 编译 apcupsd-3.14.12
ups不间断电源网络服务(需要先编译[tcp-wrappers-7.6])
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
$ cd ~/wdmc-build/64k-wheezy $ sudo chroot build $ mount -t proc none /proc $ mount -t devtmpfs none /dev $ mount -t devpts none /dev/pts $ export DEBIAN_FRONTEND=noninteractive $ export DEBCONF_NONINTERACTIVE_SEEN=true $ export LC_ALL=C $ export LANGUAGE=C $ export LANG=C $ export DEB_CFLAGS_APPEND='-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE' $ export DEB_BUILD_OPTIONS=nocheck $ cd root $ mkdir apcupsd $ cd apcupsd $ wget http://deb.debian.org/debian/pool/main/a/apcupsd/apcupsd_3.14.12-1.1.dsc $ wget http://deb.debian.org/debian/pool/main/a/apcupsd/apcupsd_3.14.12.orig.tar.gz $ wget http://deb.debian.org/debian/pool/main/a/apcupsd/apcupsd_3.14.12-1.1.diff.gz # 也可本站下载源代码 # wget https://www.mobibrw.com/wp-content/uploads/2014/09/apcupsd_3.14.12-1.1.dsc # wget https://www.mobibrw.com/wp-content/uploads/2014/09/apcupsd_3.14.12-1.1.diff_.gz -O apcupsd_3.14.12-1.1.diff.gz # wget https://www.mobibrw.com/wp-content/uploads/2014/09/apcupsd_3.14.12.orig_.tar.gz -O apcupsd_3.14.12.orig.tar.gz $ gunzip -d -v apcupsd_3.14.12-1.1.diff.gz $ tar xzvf apcupsd_3.14.12.orig.tar.gz $ cd apcupsd-3.14.12 $ git apply ../apcupsd_3.14.12-1.1.diff # libwrap0 $ dpkg --install libwrap0_7.6.q-25_armhf.deb $ dpkg-buildpackage -d -b -uc |
- 编译 e2fsprogs-1.42.13
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
$ cd ~/wdmc-build/64k-wheezy $ sudo chroot build $ mount -t proc none /proc $ mount -t devtmpfs none /dev $ mount -t devpts none /dev/pts $ export DEBIAN_FRONTEND=noninteractive $ export DEBCONF_NONINTERACTIVE_SEEN=true $ export LC_ALL=C $ export LANGUAGE=C $ export LANG=C $ export DEB_CFLAGS_APPEND='-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE' $ export DEB_BUILD_OPTIONS=nocheck $ cd root $ wget https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/snapshot/e2fsprogs-1.42.13.tar.gz $ wget http://security.debian.org/debian-security/pool/updates/main/e/e2fsprogs/e2fsprogs_1.42.12-2+deb8u2.debian.tar.xz # 也可本站下载源代码 # wget https://www.mobibrw.com/wp-content/uploads/2014/09/e2fsprogs-1.42.13.tar.gz # wget https://www.mobibrw.com/wp-content/uploads/2014/09/e2fsprogs_1.42.12-2deb8u2.debian.tar.xz -O e2fsprogs_1.42.12-2+deb8u2.debian.tar.xz $ tar xvf e2fsprogs-1.42.13.tar.gz $ cp e2fsprogs_1.42.12-2+deb8u2.debian.tar.xz e2fsprogs-1.42.13/ $ cd e2fsprogs-1.42.13 # 删除代码中原有的debian编译文件,我们需要使用debian修改过的配置文件才能成功编译 $ rm -rf debian $ tar xvf e2fsprogs_1.42.12-2+deb8u2.debian.tar.xz # 安装依赖 "configure: error: external blkid library not found" $ apt-get install libblkid-dev $ dpkg-buildpackage -d -b -uc |
参考链接
GUIDE-Building-packages-for-the-new-firmware-someone-tried-it