gcc-linaro-arm-linux-gnueabihf-4.7交叉编译arm版ntpdate
下载交叉编译工具链
wget https://releases.linaro.org/archive/13.04/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.7-2013.04-20130415_linux.tar.xz
tar xvf gcc-linaro-arm-linux-gnueabihf-4.7-2013.04-20130415_linux.tar.xz
mv gcc-linaro-arm-linux-gnueabihf-4.7-2013.04-20130415_linux /opt/arm4.7
export PATH=$PATH:/opt/arm4.7/bin
arm-linux-gnueabihf-gcc -v
下载编译ntp源码
curl -O http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-4.2.8p15.tar.gz
tar xvf ntp-4.2.8p15.tar.gz
cd ntp-4.2.8p15/
./configure --prefix=$(pwd)/install --enable-shared --disable-static --with-yielding-select=manual --disable-main --host=arm-linux-gnueabihf
make -j8 && make install
cd install/bin
tree
├── calc_tickadj
├── ntpd
├── ntpdate
├── ntpdc
├── ntp-keygen
├── ntpq
├── ntptime
├── ntptrace
├── ntp-wait
├── sntp
├── tickadj
└── update-leap
file ntpdate
ntpdate: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.6.31, BuildID[sha1]=9328736beb4fb0486437079703193de9cd35042b, with debug_info, not stripped
将ntpdate复制到目标设备上面,运行即可。
./ntpdate time.apple.com