LinuxÒÁµéÔ°ÂÛ̳'s Archiver

postman ·¢±íÓÚ 2006-8-18 11:05

¡¾ÇóÖú¡¿ÈçºÎÔÚrc.sysinitÖлñÈ¡Äں˰汾ºÅ£¿

¿´µ½Ì³×ÓÀï2.4Éý¼¶2.6µÄÌû×Ó,Ϊ¹²ÓÃоÉÄÚºË,ÔÚrc.sysinit½Å±¾ÖмÓÁËÈçÏ´úÂëÀ´ÅжÏÄں˰汾,´Ó¶ø¼ÓÔØ²»Í¬Ä£¿é,µ«ÊÇÔÚBASHÏÂʧ°Ü,Çë½Ì¸÷λÈçºÎ²ÅÄÜÕýÈ·»ñµÃÄں˰汾ºÅ?

Ô­´úÂëÈçÏÂ:
#
# ----- KERNEL 2.6.x support ------
# This is for compatibility between kernel-2.4.x and kernel-2.6.x
#
UNAME=`uname -r`
KERNELVER=${UNAME:0:3}
if [ "$KERNELVER" = "2.6" ]; then
#
# This is kernel-2.6.x
#
.......
else
#
# This is kernel-2.4.x
#
......
fi

dearvoid ·¢±íÓÚ 2006-8-18 11:10

Ôõôʧ°ÜµÄ?

postman ·¢±íÓÚ 2006-8-18 11:20

ºÃÏóÊÇKERNELVERÖ±½ÓÈ¡ÁË'una',¶ø²»ÊÇuname -a´«»ØµÄ°æ±¾ºÅ

dearvoid ·¢±íÓÚ 2006-8-18 11:25

Did you notice the difference between [color=red]'[/color] and [color=red]`[/color] ?

postman ·¢±íÓÚ 2006-8-18 13:57

¸ÕÊÔÁË,ȷʵÊÇÕâ¸öÔ­Òò,¶àлÁË!!!

li-jiahuan ·¢±íÓÚ 2006-8-18 22:56

ÔÚknoppixµÄ/etc/init.d/knoppix-autoconfigÀï¾­³£ÓÐÀàËÆÕâÑùµÄ¶«Î÷
[code]
[0 No.2018 root@deb ~]# cat /proc/version
Linux version 2.6.17.3 (root@deb) (gcc version 4.0.4 20060507 (prerelease) (Debian 4.0.3-3)) #1 PREEMPT Sat Jul 1 20:50:22 CST 2006

[0 No.2019 root@deb ~]# a=$(< /proc/version)

[0 No.2020 root@deb ~]# case $a in *2.6.*) echo Kernel 2.6 ;; esac
Kernel 2.6
               
[0 No.2013 huan@deb ~]$      
[/code]

ÁíÍâ
/etc/init.d/knoppix-autoconfigÀïÓÐÕâôһ¶Î
[code]
# Kernel 2.6
[ -d /sys/devices ] || mount -t sysfs /sys /sys 2>/dev/null
[/code]
Õâ¸öÅжÏÓ¦¸Ã¿ÉÒÔ¿ÉÈ¡µÄ°É

Ò³: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.