¹¹½¨»ù±¾µÄǶÈëʽLinux¸ùÎļþϵͳ
¹¹½¨»ù±¾µÄǶÈëʽLinux¸ùÎļþϵͳ
¹¹½¨»ù±¾µÄǶÈëʽLinux¸ùÎļþϵͳ
£¨1£©´´½¨¸ùÎļþϵͳµÄ»ù±¾Ä¿Â¼½á¹¹¡£
ÎÒ°ÑÕâ¸ö¹ý³Ì×ö³ÉÁËshell½Å±¾(ÎļþÃûΪmkroot) £¬ºÜ·½±ã£¡
#! /bin/sh
echo "creatint rootfs dir......"
mkdir rootfs
cd rootfs
echo "making dir : bin dev etc lib proc sbin sys usr"
mkdir bin dev etc lib proc sbin sys usr #±Ø±¸µÄ8¸öĿ¼
mkdir usr/bin usr/lib usr/sbin lib/modules
# Don't use mknod ,unless you run this Script as root !
# mknod -m 600 dev/console c 5 1
# mknod -m 666 dev/null c 1 3
echo "making dir : mnt tmp var"
mkdir mnt tmp var
chmod 1777 tmp
mkdir mnt/etc mnt/jffs2 mnt/yaffs mnt/data mnt/temp
mkdir var/lib var/lock var/log var/run var/tmp
chmod 1777 var/tmp
echo "making dir : home root boot"
mkdir home root boot
echo "done"
ÔÚÄãÏëÒª½¨Á¢¸ùÎļþϵͳµÄµØ·½£¬ÔËÐУº
[tekkamanninja@Tekkaman-Ninja nfs]$ ./mkroot
creatint rootfs dir......
making dir : bin dev etc lib proc sbin sys usr
making dir : mnt tmp var
making dir : home root boot
done
[tekkamanninja@Tekkaman-Ninja nfs]$ cd rootfs/dev/
[tekkamanninja@Tekkaman-Ninja dev]$ su
¿ÚÁ
[root@Tekkaman-Ninja dev]# mknod -m 600 console c 5 1;mknod -m 666 null c 1 3;exit
exit
[tekkamanninja@Tekkaman-Ninja dev]$
£¨2£©ÅäÖᢱàÒëºÍ°²×°Busybox-1.9.1-----ÎÒûÓñ¾ÎÄÕµÄbusyboxÅäÖ㬲μûͬÎļþ¼ÐϵÄÎĵµ£¬ÎÒµÄÊǾ²Ì¬µÄ£¬Èç¹ûÒÔºóÒª¸Ä³É¶¯Ì¬µÄ£¬¿É²Î¼û±¾ÎÄÕÂ
[tekkamanninja@Tekkaman-Ninja source]$ tar -xjvf busybox-1.9.1.tar.bz2
ÐÞ¸ÄMakefileÎļþ£º
[tekkamanninja@Tekkaman-Ninja busybox-1.9.1]$ pwd
/home/tekkamanninja/working/source/busybox-1.9.1
[tekkamanninja@Tekkaman-Ninja bu
Ïà¹ØÎĵµ£º
¿ªÊ¼ÔÚlinuxÏÂ×öcÓïÑÔ¿ª·¢
±¾ÆªÎÄÕÂÖ¼ÔÚ½éÉÜÈçºÎ¿ªÊ¼ÔÚlinuxÏÂÃæ½øÐÐCÓïÑÔ³ÌÐòÉè¼Æ£¬ÒÔ¼°ÈçºÎʹÓóÌÐòÉè¼Æ¼°µ÷ÊÔ¹¤¾ß½øÐбàдC³ÌÐò¡£Ñ§»áʹÓÃgcc¼°gdbµÈ¹¤¾ß½øÐÐlinuxϵÄc±àдºÍµ÷ÊÔ¡£
ÔÚ¿ªÊ¼Ö®Ç°£¬Ê×ÏÈҪ˵Ã÷µÄÊÇ£¬linux¿ª·¢³ÌÐò×îÖ÷ÒªµÄ±à¼Æ÷ÊÇvi/vim±à¼Æ÷£¬µ±È»»¹ÓÐemacs,gedit£¬Ö»ÊÇvi/vimµÄÓû§ÊµÔÚÊÇѹµ¹ÐԵĶàÊ ......
»¨ÁËÒ»¸öÖÜÄ©µÄʱ¼äÁгöÀ´µÄ¡£¹²Ïí³öÀ´£¬Ï£Íû´ó¼Ò»¨¼¸·ÖÖÓ¿´¿´¡£ÕâÒ²ËãÊÇLINUXϱȽÏʵÓõIJéÕÒ·½Ê½ÁË
which(Ñ°ÕÒ“Ö´ÐÐÎļþ”)
[root@localhost home]# which [-a] command
-a : ½«ËùÓпÉÕÒµ½µÄÃüÁî¾ùÁгö£¬¶ø²»½ö½öÁгöµÚÒ»¸öÕÒµ½µÄÃüÁîÃû³Æ
·¶Àý£º
[root@localhost home]# which passwd
/usr/bin/passwd ......
ÔÚÖ´ÐÐmake menuconfig ÃüÁî½øÐÐÄÚºËÅäÖÃʱ£¬Êä³öÏÂÃæµÄ³ö´íÐÅÏ¢£º
yyh:~/clfs/sources/linux-2.6.17.13$ make ARCH=i386 CROSS_COMPILE=${CLFS_TARGET}- menuconfig
HOSTCC scripts/basic/fixdep
HOSTCC scripts/basic/split-include
HOSTCC scripts/basic/docproc
HOSTCC scripts/kconfig/conf.o
HOSTCC scri ......
HOSTCC scripts/mod/sumversion.o
scripts/mod/sumversion.c: In function ‘get_src_version’:
scripts/mod/sumversion.c:384: error: ‘PATH_MAX’ undeclared (first use in
this function)
scripts/mod/sumversion.c:384: error: (Each undeclared identifier is reported
only once
script ......
µÚÒ»ÌìÉϰ࣬ÕùÈ¡Ò»¸öÔÂÄÚlinux¸øŪÊìϤÁË
ÌøתÃüÁcd /tmpÌøתµ½tmpĿ¼ cd ../../ Ìøתµ½¸úĿ¼
н¨Îļþ£º touch test.html н¨Ò»¸ötest.html Îļþ
×°µÄÊÇredhatϵͳ ĬÈϵÄapache·þÎñûÓдò¿ª£¬ÐèÒª´òÃüÁî
/etc/init.d/{·þÎñÃû} start»ò ......