易截截图软件、单文件、免安装、纯绿色、仅160KB

Linux下用Busy Box制作Ramdisk全过程

  -------------------------------------------------------------------------------------------------------
//By:yuyongbao
//QQ:673360056
Linux下用Busy Box制作Ramdisk全过程
1 建立根文件系统结构
#mkdir rootfs
#cd rootfs
#mkdir bin dev etc lib proc sbin tmp usr var
#chmod 1777 tmp
#mkdir usr/bin usr/lib usr/sbin
#mkdir var/lib var/lock var/log var/run var/tmp
#chmod 1777 var/tmp
2 准备链接库
#cd ${OBJ_LIB}/lib (${OBJ_LIB}是交叉编译环境的目录)
#for file in libc libcrypt libdl libm \
>libpthread libresolv libutil
>do
>cp $file-*.so /home/fortis/rootfs/lib
>cp -d $file.so.[*0-9] /home/fortis/rootfs/lib
>done
#cp -d ld*.so* /home/fortis/rootfs/lib
3 使用busybox制作系统应用程序
3.1 下载busybox(http://www.busybox.net/)并解压。
3.2 进入解压后的目录,配置Busybox
$make menuconfig
Busybox Settings >
General Configuration >
[*] Support for devfs
Build Options >
[*] Build BusyBox as a static binary (no shared libs)
/* 将busybox编译为静态连接,少了启动时找动态库的麻烦 */
[*] Do you want to build BusyBox with a Cross Compiler?
(/usr/local/arm/3.3.2/bin/armlinux)
Cross Compiler prefix/* 指定交叉编译工具路径 */
Init Utilities >
[*] init
[*] Support reading an inittab file
/* 支持init读取/etc/inittab配置文件,一定要选上 */
Shells >
Choose your default shell (ash) >
/* (X) ash 选中ash,这样生成的时候才会生成bin/sh文件
* 看看我们前头的linuxrc脚本的头一句:
* #!/bin/sh 是由bin/sh来解释执行的
*/
[*] ash
Coreutils >
[*] cp
[*] cat
[*] ls
[*] mkdir
[*] echo (basic SuSv3 version taking no options)
[*] env
[*] mv
[*] pwd
[*] rm
[*] touch
Editors >
[*] vi
Linux System Utilities >
[*] mount
[*] umount
[*] Support loopback mounts
[*] Support for the old /etc/mtab file
Networking Utilities >
[*] inetd
/*
* 支持inetd超级服务器
*/
3.3 编译并安装Busybox
$make TARGET_ARCH=arm CROSS=armlinux\
PREFIX=/home/arm/dev_home/


相关文档:

Linux——NFS网络文件系统

NFS网络文件系统是通过文件系统实现资源共享的一种最重要的方式。
c/s 客户机   服务器
B/S 浏览器   服务器
NFS服务端配置:
编辑/etc/exports文件以配置开放路径。/home/share      192.168.0.123(ro)/(rw).
/etc/init.d/portmap  restart
/etc/init.d/nfs&nb ......

Linux LS命令详细介绍

  ls
  ls 命令可以说是linux下最常用的命令之一。它有众多的选项,其中有很多是很有用的,你是否熟悉呢?下面列出了 ls 命令的绝大多数选项。
  -a 列出目录下的所有文件,包括以 . 开头的隐含文件。
  -b 把文件名中不可输出的字符用反斜杠加字符编号(就象在C语言里一样)的形式列出。
  -c 输出文件的 i 节 ......

Linux——linux命令集


NO
分类
PS1
命令名
用法及参数
功能注解
1
显示目录信息
#
ls
ls -a
列出当前目录下的所有文件,包括以.头的隐含文件
#
ls
ls -l或ll
列出当前目录下文件的详细信息
#
ls
ls -a
显示所有文件,包含隐藏。
#
ls
ls -al
显示所有文件的详细信息。
2
查看路径
#
pwd
pwd
......

Linux获取本机IP、MAC示例程序

#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/ioctl.h>
#include <net/if.h>
#include <stdio.h>
#include <string>
#include <iostream>
#include <cstring>
using namespace std;
void peek_interfaces(int ......

linux getopts命令,处理shell脚本参数

#!/bin/bash
while getopts "ab:cd:" Option
# b and d take arguments
#
do
case $Option in
a) echo -e "a = $OPTIND";;
b) echo -e "b = $OPTIND $OPTARG";;
c) echo -e "c = $OPTIND";;
d) echo -e "d = $OPTIND $OPTARG";;
esac
done
shift $(($OPTIND - 1)) ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号