busybox-1.24.1.tar.bz2
1, modify Makefile
Find the following 2 places to change to
ARCH? = Arm
Cross_compile? = arm-linux-
2. Open the Configuration menu
Make Menuconfig
Here are some configurations, turn on TAB completion, check ifconfig, turn on the driver loading function, etc.
You can search by/after entering characters
Error 1
Miscutils/i2c_tools.c:at Top level:
Miscutils/i2c_tools.c:1046:error: ' I2c_func_smbus_pec ' undeclared here (not in a function)
Miscutils/i2c_tools.c:1046:error:initializer element is not constant
Miscutils/i2c_tools.c:1046:error: (Near initialization for ' I2c_funcs_tab[12].value ')
Miscutils/i2c_tools.c:1047:error:initializer element is not constant
Miscutils/i2c_tools.c:1047:error: (Near initialization for ' i2c_funcs_tab[12] ')
Miscutils/i2c_tools.c:1049:error:initializer element is not constant
Miscutils/i2c_tools.c:1049:error: (Near initialization for ' i2c_funcs_tab[13] ')
Miscutils/i2c_tools.c:1051:error:initializer element is not constant
Miscutils/i2c_tools.c:1051:error: (Near initialization for ' i2c_funcs_tab[14] ')
Miscutils/i2c_tools.c:1052:error:initializer element is not constant
Miscutils/i2c_tools.c:1052:error: (Near initialization for ' i2c_funcs_tab[15] ')
MAKE[1]: * * * [MISCUTILS/I2C_TOOLS.O] Error 1
Make: * * * [miscutils] Error 2
Method:
Make Menuconfig Remove the I²c-related modules
Error 2
miscutils/ionice.c:in function ' Ioprio_set ':
Miscutils/ionice.c:23:error: ' Sys_ioprio_set ' undeclared (first use of this function)
Miscutils/ionice.c:23:error: (Each undeclared identifier was reported only once
Miscutils/ionice.c:23:error:for each function it appears in.)
miscutils/ionice.c:in function ' Ioprio_get ':
Miscutils/ionice.c:28:error: ' Sys_ioprio_get ' undeclared (first use of this function)
MAKE[1]: * * * [MISCUTILS/IONICE.O] Error 1
Make: * * * [miscutils] Error 2
Method:
Make menuconfig remove Ionice related modules
Error 3
Miscutils/nandwrite.c:91:error:dereferencing pointer to incomplete type
Miscutils/nandwrite.c:97:error: ' Memgetbadblock ' undeclared (first use of this function)
Miscutils/nandwrite.c:97:error: (Each undeclared identifier was reported only once
Miscutils/nandwrite.c:97:error:for each function it appears in.)
Miscutils/nandwrite.c:102:error:dereferencing pointer to incomplete type
miscutils/nandwrite.c:in function ' Nandwrite_main ':
Miscutils/nandwrite.c:117:error:storage size of ' meminfo ' isn ' t known
Miscutils/nandwrite.c:118:error:storage size of ' oob ' isn ' t known
Miscutils/nandwrite.c:145:error: ' Memgetinfo ' undeclared (first use of this function)
Miscutils/nandwrite.c:252:error: ' Memreadoob ' undeclared (first use of this function)
miscutils/nandwrite.c:117:warning:unused variable ' meminfo '
miscutils/nandwrite.c:118:warning:unused variable ' OOB '
MAKE[1]: * * * [MISCUTILS/NANDWRITE.O] Error 1
Method:
Make Menuconfig remove Nandwrite,nanddump module
Error 4
Miscutils/ubi_tools.c:67:26:mtd/ubi-user.h:no such file or directory
miscutils/ubi_tools.c:in function ' Ubi_tools_main ':
Miscutils/ubi_tools.c:106:error: ' Ubi_dev_num_auto ' undeclared (first use of this function)
Miscutils/ubi_tools.c:106:error: (Each undeclared identifier was reported only once
Miscutils/ubi_tools.c:106:error:for each function it appears in.)
Miscutils/ubi_tools.c:107:error: ' Ubi_vol_num_auto ' undeclared (first use of this function)
Miscutils/ubi_tools.c:115:error:field ' attach_req ' has incomplete type
Miscutils/ubi_tools.c:116:error:field ' mkvol_req ' has incomplete type
Miscutils/ubi_tools.c:117:error:field ' rsvol_req ' has incomplete type
Miscutils/ubi_tools.c:181:error: ' Ubi_iocatt ' undeclared (first use of this function)
Miscutils/ubi_tools.c:194:error: ' Ubi_iocdet ' undeclared (first use of this function)
Miscutils/ubi_tools.c:237:error: ' Ubi_dynamic_volume ' undeclared (first use of this function)
Miscutils/ubi_tools.c:239:error: ' Ubi_static_volume ' undeclared (first use of this function)
Method:
Make menuconfig remove UBI related modules
Error 5
util-linux/umount.c:in function ' Umount_main ':
Util-linux/umount.c:87:error: ' Mnt_detach ' undeclared (first use of this function)
Util-linux/umount.c:87:error: (Each undeclared identifier was reported only once
Util-linux/umount.c:87:error:for each function it appears in.)
MAKE[1]: * * * [UTIL-LINUX/UMOUNT.O] Error 1
Make: * * * [Util-linux] Error 2
Method:
Umount here can not be removed, because this function is needed to open the source to see
Mnt_force//Mnt_detach (from Linux/fs.h) must match
//Opt_force and Opt_lazy.
85 {
bug[typedef Char
(Opt_force! = Mnt_force | | Opt_lazy! = Mnt_detach)? -1:1
88];
Open ARM GCC Include/linux/fs.h did not find these 2 definitions
Find this include/linux/fs.h from the Linux kernel source
Find this inside.
#define MNT_FORCE0X00000001/* attempt to forcibily Umount */
#define MNT_DETACH0X00000002/* Just Detach from the tree * *
Write this right here as 2 times make
Error 6
COREUTILS/LIB.A (SYNC.O) (. text.sync_main+0x80): In function ' Sync_main ':
: Undefined reference to ' SYNCFS '
Collect2:ld returned 1 exit status
Make: * * * [busybox_unstripped] Error 1
Solve:
VI./COREUTILS/SYNC.C
/*
* SYNCFS is documented to only fail with EBADF,
* which can ' t happen here. So, no error checks.
*/
86-row SYNCFS (FD);
18 lines//config:bool "enable-d and-f flags (requres SYNCFS (2) in libc)"
There's no such function in finding a arm-libc.
Downloaded busybox-1.23.0.tar.bz2 found the same name file, found this content is obviously much simpler. Replace the 1.24 with the 1.23 version.
#include "Libbb.h"
/* This is a nofork applet. Be very careful! */
int sync_main (int argc, char **argv) main_externally_visible;
int sync_main (int argc unused_param, char **argv if_not_desktop (Unused_param))
{
/* coreutils-6.9 Compat */
Bb_warn_ignoring_args (argv[1]);
Sync ();
return exit_success;
}
The second compilation passed the
YOUR linker does not support--sort-section,alignment
Trying Libraries:crypt m
Library crypt is not needed, excluding it
Library m is needed, can ' t exclude it (yet)
Final Link with:m
Installation
Make config_prefix=/opt/fs_1.24 Install
Making/dev/Device nodes
cd/opt/fs_1.24
mkdir Dev
Mknod Console C 5 1
Mknod NULL C 1 3
Create etc and startup directories
Cd..
mkdir etc/init.d-p
To create a startup script
Vi/etc/inittab
Console::askfirst:-/bin/sh
:: Sysinit:/etc/init.d/rcs
Edit startup script start Fstab mount device node, etc.
VI Etc/init.d/rcs
#!/bin/sh
Mount-a
Mkdir/dev/pts
Mount-t devpts devpts/dev/pts
Echo/sbin/mdev >/proc/sys/kernel/hotplug
Mdev-s
Create an auto mount file
mkdir tmp
mkdir SYS
VI Etc/vi fstab
#device mount-point type Optionos dump fsck order
PROC/PROC proc Defaults 0 0
Tmpfs/tmp TMPFS Defaults 0 0
Sysfs/sys Sysfs Defaults 0 0
Tmpfs/dev TMPFS Defaults 0 0
Copy C Library
MkDir Lib
Cd/opt/gcc/arm-linux/lib
CP *.so*/opt/fs_1.24/lib/-D
Make it, and start it with NFS.
# BusyBox--help
BusyBox v1.24.1 (2016-03-10 09:37:27 CST) multi-call binary.
BusyBox is copyrighted by many authors between 1998-2015.
Licensed under GPLv2. See source distribution for detailed
Copyright notices.
The configuration was successful.
Rmmod An error occurs, create a directory as prompted.
Rmmod:can ' t change directory to '/lib/modules ': No such file or directory
Mkdir/lib/modules
Rmmod:can ' t change directory to ' 2.6.22.6 ': No such file or directory
mkdir/lib/modules/2.6.22.6
Compiling busybox-1.24.1