Booyo LiveCD/Rcdot Sysinit
BooyoLiveCD/rc.sysinit ¶To do something instead of anaconda
clock
/usr/share/zoneinfo/Asia/Seoul 을 /etc/localtime 로 복사할 것.
Build, or linuxrc or here
rm /etc/X11/xorg.cong /etc/sysconfig/hwconf /etc/sysconfig/mouse
kmodule 을 변경하여 사용해야 함. initscripts-7.93.2
pcmcia
knoppix-autoconfig
if checkbootparam "nopcmcia"; then
echo " ${BLUE}Skipping PCMCIA detection as requested on boot commandline.${NORMAL}"
else modprobe pcmcia_core >/dev/null 2>&1
# Try Cardbus or normal PCMCIA socket drivers
modprobe yenta_socket >/dev/null 2>&1 || modprobe i82365 >/dev/null 2>&1 || modprobe tcic >/dev/null 2>&1
if [ "$?" = "0" ]; then
echo " ${GREEN}PCMCIA found, starting cardmgr.${NORMAL}"
modprobe ds >/dev/null 2>&1
cardmgr >/dev/null 2>&1 && sleep 4
fi
fi
anaconda
def createPcmciaConfig(path, test = 0):
f = open(path, "w")
pcic = pcicType(test = test)
if (pcic):
f.write("PCMCIA=yes\n")
f.write("PCIC=%s\n" % (pcic,))
else:
f.write("PCMCIA=no\n")
f.write("PCIC=\n")
f.write("PCIC_OPTS=\n")
f.write("CORE_OPTS=\n")
f.close()
def pcicType(test = 0):
devs = kudzu.probe(kudzu.CLASS_SOCKET, kudzu.BUS_PCI, 0)
if devs:
log("Found a pcic controller of type: yenta_socket")
return "yenta_socket"
# lets look for non-PCI socket controllers now
devs = kudzu.probe(kudzu.CLASS_SOCKET, kudzu.BUS_MISC, 0)
if devs and devs[0].driver not in ["ignore", "unknown", "disabled"]:
log("Found a pcic controller of type: %s", devs[0].driver)
return devs[0].driver
log("No pcic controller detected")
return None
knoppix-autoconfig 의 부분이 추가되어야 함.
여기에 /etc/sysconfig/pcmcia 에 쓰는 부분을 추가해야 함.
kmodule 뒤에 추가하는 것이 맞는지?
berry 의 경우 관련 드라이브를 모두 blacklist 에 넣어 놓았슴.
kernel
bootloader 를 설치하면 생성됨. installer 에서 고려해야 함.
desktop, system-config-securitylevel, firstboot, installinfo, installinfo.rpmsave
network-scripts/ifcfg-*
network
# < Fat-Client-Version: DHCP Broadcast for IP address >
if checkbootparam "nodhcp"; then
echo " ${BLUE}Skipping DHCP broadcast/network detection as requested on boot commandline.${NORMAL}"
elif checkbootparam "ip"; then
IP="$(getbootparam ip 2>/dev/null)"
DEVICE=eth0
echo " ${GREEN}Network device ${MAGENTA}$DEVICE${GREEN} detected, IP is ${YELLOW}${IP}${GREEN}.${NORMAL}"
cat << EOM > /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=$IP
NETMASK=255.255.255.0
EOM
sed "s/#GATEWAY=192.168.1.1/GATEWAY=${IP%.*}.1/g" /etc/sysconfig/network > /tmp/network && mv /tmp/network /etc/sysconfig/network
ifup eth0
else
NETDEVICES="$(awk -F: '/eth.:|tr.:/{print $1}' /proc/net/dev 2>/dev/null)"
# for DEVICE in $NETDEVICES
for DEVICE in "eth0"
do
echo -n " ${GREEN}Network device ${MAGENTA}$DEVICE${GREEN} detected, DHCP broadcasting for IP.${NORMAL}"
trap 2 3 11
dhclient $DEVICE >/dev/null 2>&1 &
trap "" 2 3 11
sleep 1
echo " ${BLUE}(Backgrounding)${NORMAL}"
done
fi
/etc
inittab, fstab, mdadm.conf, mtab, resolv.conf, hosts, reconfigSys, mtab,
arch,
FC3 rc.sysinit ¶
/etc/fstab 에 /, /proc, /sys. /dev/pts 가 있어야 된다는 것을 의미하는 것 같다. mount -f / mount -f /proc mount -f /sys >/dev/null 2>&1 mount -f /dev/pts [ -f /proc/bus/usb/devices ] && mount -f -t usbfs usbfs /proc/bus/usb [ -e /dev/.devfsd ] && mount -f -t devfs devfs /dev
mkinitrd copies /sbin/udev.static to the initrd /sbin/udev and symlinks it to /sbin/udevstart.
After the kernel boots, it executes the nash script of the initrd. This mounts a tmpfs filesystem on /dev/. Instead of hotplug /sbin/udev is called in the initrd phase. udevstart creates all device nodes for the devices, which are compiled in the kernel and for the modules, which are loaded by nash.
Problems
The whole udev and hotplug infrastructure is not available in initrd. Thus no hotplug scripts, udev rules, and permissions and no /etc/dev.d/ scripts are executed for any hotplug event, which is sent from the kernel.
rc.sysinit
First, if SELinux is loaded and enabled, the context of /dev/ is set. rc.sysinit calls /sbin/start_udev. start_udev mounts a tmpfs filesystem on /dev/, if there is none already mounted. Then it creates some device nodes, which need module autoloading, or where there is no kernel module. After that /sbin/udevstart is called again, which simulates the hotplug events in the initrd phase, to apply the whole udev rules and permissions. After that rc.sysinit parses the ouput of /sbin/kmodule and loads every module. This should provide device nodes for all hardware found on your computer.
Console User Permissions
/etc/dev.d/default/pam_console.dev is called whenever a device node is created and calls /sbin/pam_console_setowner with the filename (and an optional symlink) of the device node. This sets the permissions for console users like specified in /etc/security/console.perms.
/etc/init.d/functions ¶set variable
전체 흐름 ¶hwsetup 전에 해야 할 일
|
The Tree of Learning bears the noblest fruit, but noble fruit tastes bad. |











