2008年3月6日 星期四

Cross compile pure-ftpd to arm-linux.

人老了,很多事情會忘記,趁還有記憶的時候寫起來放,才不會哪一天需要時又找不到。

1. In order to pass the configure, modify the configure file first.
--- configure 2006-02-19 22:33:05.000000000 +0800
+++ configure.new 2008-03-06 15:17:24.000000000 +0800
@@ -21376,3 +21376,3 @@ echo "$as_me:$LINENO: checking whether s
echo $ECHO_N "checking whether snprintf is C99 conformant... $ECHO_C" >&6
-if test "$cross_compiling" = yes; then
+if test "$cross_compiling" = no; then
{ { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
@@ -21450,3 +21450,3 @@ echo "$as_me:$LINENO: checking whether g
echo $ECHO_N "checking whether getgroups 0 is sane... $ECHO_C" >&6
-if test "$cross_compiling" = yes; then
+if test "$cross_compiling" = no; then
{ { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
@@ -21518,3 +21518,3 @@ echo "$as_me:$LINENO: checking whether r
echo $ECHO_N "checking whether realpath likes unreadable directories... $ECHO_C" >&6
-if test "$cross_compiling" = yes; then
+if test "$cross_compiling" = no; then
{ { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
@@ -21624,3 +21624,3 @@ echo "$as_me:$LINENO: checking whether y
echo $ECHO_N "checking whether you already have a standard MD5 implementation... $ECHO_C" >&6
-if test "$cross_compiling" = yes; then
+if test "$cross_compiling" = no; then
{ { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
@@ -21693,3 +21693,3 @@ echo "$as_me:$LINENO: checking whether y
echo $ECHO_N "checking whether you already have a standard SHA1 implementation... $ECHO_C" >&6
-if test "$cross_compiling" = yes; then
+if test "$cross_compiling" = no; then
{ { echo "$as_me:$LINENO: error: cannot run test program while cross compiling

2. Configure argument:
--host=arm-linux --prefix=/path CC=arm-linux-gcc-3.4.6
3. After make and make install, copy the binary file to root file system.
/bin/pure-pw
/bin/pure-pwconvert
/bin/pure-statsdecode
/sbin/pure-authd
/sbin/pure-ftpd
/sbin/pure-ftpwho
/sbin/pure-mrtginfo
/sbin/pure-quotacheck
/sbin/pure-uploadscript

4. Copy the config file to /etc.
UnixAuthentication yes
ChrootEveryone no
MaxClientsNumber 10
MaxClientsPerIP 5
DisplayDotFiles yes
NoAnonymous no
AnonymousOnly yes
SyslogFacility ftp
DontResolve yes
MaxIdleTime 15
LimitRecursion 2000 8
AnonymousCanCreateDirs yes
MaxLoad 4
PassivePortRange 40000 90000
AntiWarez yes
Bind ,21
Umask 133:022
MinUID 100
AllowUserFXP no
AllowAnonymousFXP no
ProhibitDotFilesWrite no
ProhibitDotFilesRead no
AutoRename no
AnonymousCantUpload yes
MaxDiskUsage 99
CustomerProof yes
PerUserLimits 1

5. Add "adduser" utility in busybox, and add a new user when system start.
adduser test
6. Edit /etc/syslog.con, and add a new line as below.
ftp.* /var/log/ftplog
7. Done, the FTP daemon should be run.
pure-ftpd 安裝組態設定
柏青哥的Suse Linux - 第十八章 架設FTP Server