手机站
网通分站
电信主站
密 码:
用户名:
当前位置 : 主页>网站运营>建站经验>列表

利用BusyBox定制Linux Live CD

来源:互联网 作者:west263.com 时间:2008-04-16
西部数码-全国虚拟主机10强!40余项虚拟主机管理功能,全国领先!双线多线虚拟主机南北访问畅通无阻!免费赠送企业邮局,.CN域名,自助建站480元起,免费试用7天,满意再付款! P4主机租用799元/月.月付免压金!

This file contains device names that permit root logins. For now, it makes sense for root to have lots of capabilities, for testing. "vc/1","vc/2" stands for virtual consoles.

  [etc/securetty]

console

tty

vc/1

vc/2

vc/3

vc/4

vc/5

vc/6

vc/7

vc/8

vc/9

vc/10

vc/11

tty0

tty1

tty2

tty3

tty4

tty5

tty6

Below is a minimal hosts file. If you are running on a local LAN without a DNS server, then, add in additional names. Note, if you ping localhost and get nothing, then, lo may need to be configured: "ifconfig lo 127.0.0.1". If you are not sure what is defined where "ifconfig" will give you a listing.

  [etc/hosts]

127.0.0.1       localhost

# Additional names can be added

#192.168.1.106 squeezel

This is BusyBox's minimal conf.

  [etc/busybox.conf]

[SUID]

su = ssx root.0 # applet su can be run by anyone and runs with euid=0/egid=0

su = ssx        # exactly the same

The following is used for acquiring an IP address via dhcp. The important setting here is the interface, which should be set to "eth0". The script that gets run "_install/usr/share/udhcpc/default.script" is the default BusyBox script for acquiring a dhcp address. Note, "etc/init.d/rcS" runs "/sbin/udhcpc", on bootup. You could remove this and assign a static IP address instead.

  [etc/udhcpd.conf]

# Sample udhcpd configuration file (/etc/udhcpd.conf)

# The start and end of the IP lease block

# The interface that udhcpd will use

interface       eth0            #default: eth0

# The maximim number of leases (includes addressesd reserved

# by OFFER's, DECLINE's, and ARP conficts

#max_leases     254             #default: 254

# If remaining is true (default), udhcpd will store the time

# remaining for each lease in the udhcpd leases file. This is

# for embedded systems that cannot keep time between reboots.

# If you set remaining to no, the absolute time that the lease

# expires at will be stored in the dhcpd.leases file.

#remaining      yes             #default: yes

# The time period at which udhcpd will write out a dhcpd.leases

# file. If this is 0, udhcpd will never automatically write a

# lease file. (specified in seconds)

#auto_time      7200            #default: 7200 (2 hours)

# The amount of time that an IP will be reserved (leased) for if a

# DHCP decline message is received (seconds).

#decline_time   3600            #default: 3600 (1 hour)

# The amount of time that an IP will be reserved (leased) for if an

# ARP conflct occurs. (seconds

#conflict_time  3600            #default: 3600 (1 hour)

# How long an offered address is reserved (leased) in seconds

#offer_time     60              #default: 60 (1 minute)

# If a lease to be given is below this value, the full lease time is

# instead used (seconds).

#min_lease      60              #defult: 60

# The location of the leases file

#lease_file     /var/lib/misc/udhcpd.leases     #defualt: /var/lib/misc/udhcpd.leases

# The location of the pid file

#pidfile        /var/run/udhcpd.pid     #default: /var/run/udhcpd.pid

# Everytime udhcpd writes a leases file, the below script will be called.

# Useful for writing the lease file to flash every few hours.

#notify_file                            #default: (no script)

#notify_file    dumpleases      # <--- usefull for debugging

# The following are bootp specific options, setable by udhcpd.

#siaddr         192.168.0.22            #default: 0.0.0.0

#sname          zorak                   #default: (none)

#boot_file      /var/nfs_root           #default: (none)

# The remainer of options are DHCP options and can be specifed with the

# keyword 'opt' or 'option'. If an option can take multiple items, such

# as the dns option, they can be listed on the same line, or multiple

# lines. The only option with a default is 'lease'.

Copying utmp for the "who" command.

  $ cd proj1/_install/var/run/

$ cp -pav /var/run/utmp .


STEP 6: Libraries

This configuration uses GNU Libc (glibc). In contrast, "uClibc" is smaller and easier to setup with ssh, since ssh or any program that makes a C call to "getpwname" will fail under glibc, if the appropriate Name Service Switch (NSS) files are not copied. Specifically, "/etc/nsswitch.conf", and "/lib/libnss_*" must be copied. Otherwise, runing the simple ssh command will produce the following error:

  $ ssh

you don't exist, go away!

You will get this error even if you have "etc/passwd", "etc/shadow",and "etc/shadow-", because getpwname cannot extract the correct values from "passwd". Here is a sample program to test this behavior. Reference the following program "getpwuid.c" in the following link [ http://prdownloads.sourceforge.net/cpearls/simple_but_common_cpp.tar.gz ] if you are curious about this behavior.

文章整理:西部数码--专业提供域名注册虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!