· KLDP.org · KLDP.net · KLDP Wiki · KLDP BBS ·
Booyo LiveCD/Ana Conda

BooyoLiveCD/AnaConda


* boot:
  • kernel_name options
  • label_name options
  • Function key

* isolinux.cfg

* ks.cfg

* command

FC3 install CD 의 옵션

커널 옵션: 아주 많음. mem=128M, ramdisk_size=8192

memtest86

installer 옵션 text mediacheck, rescue, dd, askmethod, updates, resolution=<width>x<height>, nofb, noprobe, skipddc, lores

* CD 의 내용
CentOS  RELEASE-NOTES-en       RPM-GPG-KEY-centos4  images    yumgroups.xml
GPL     RELEASE-NOTES-en.html  centosdocs-man.css   isolinux
NOTES   RPM-GPG-KEY            headers              repodata

* isolinux 의 내용
boot.cat     initrd.img    memtest      rescue.msg  vmlinuz
boot.msg     isolinux.bin  options.msg  snake.msg
general.msg  isolinux.cfg  param.msg    splash.lss

* initrd.img
  • mv initrd.img initrd.gz
  • gunzip initrd.gz
  • mkdir tmp
  • mount -o loop initrd tmp

* tmp 의 구조 ( initrd.img 의 내용 )
bin  dev  etc  linuxrc  lost+found  modules  proc  sbin  selinux  sys  tmp  var

linuxrc


* linuxrc 는 sbin/init 에 link 되어 있음
  • sbin 밑의 halt, poweroff, shutdown 은 init 에 link 되어 있음.
  • linux rescue 의 경우 이외에 사용가능한가?
  • anaconda/loader2/init.c 가 source 임
    • /proc, /dev/pts, /sys 를 마운트
    • console(/dev/console) 에 해당하는 것을 찾아 device 에 assign.
    • 호스트명 설정 localhost.localdomain
    • / 파일시스템을 r/w 로 다시 마운트 (어떻게 마운트를 할까?)
mount("/", "/", "ext2", MS_REMOUNT | MS_MGC_VAL, NULL)
  • /tmp 마운트: mount("none", "/tmp", "ramfs", 0, NULL)
  • /sbin/loader 수행
  • 화면 출력
  • printstr("Greetings.\n");
  • printf("anaconda installer init version %s starting\n", VERSION);
  • printf("mounting /proc filesystem... ");
  • printf("creating /dev filesystem... ");
  • printf("mounting /dev/pts (unix98 pty) filesystem... ");
  • printf("mounting /sys filesystem... ");
  • printf("trying to remount root filesystem read write... ");
  • printf("running install...\n");
  • *argvp++ = "/sbin/loader";
  • printf("running %s\n", argvc0);
  • execve(argvc0, argvc, env);


loader


* insmod, modprobe, rmmod 가 loader 에 link 되어 있음.
  • linux rescue 이외의 경우에 사용가능한가?
  • anaconda/loader2/load.c 가 source 임.
  • insmod, modprobe, rmmod 는 modstubs.c 에 있음.

    • 옵션 점검 및 설정 cmdline, ksfile, test, mediacheck, virtpconsole
    • 모듈관련 작업
      • /modules/module-info 를 읽어 modinfo 에 저장
      • /proc/modules 를 읽어 modloaded 에 저장
      • /modules/modules.dep 을 읽어 modDeps 에 저장
    • console 을 위한 모듈, font, keymap 을 올림.
      • iSeries vio console 점검 필요(PowerPC 의 iSeries 머신)
    • load modules: cramfs:vfat:nfs:loop:isofs:floppy:edd
    • ide, scsi, dasd 설정
      • cdrom:ide-cd
      • scsi_mod:sd_mod:sr_mod
      • dasd_mod, dasd_diag_mod:dasd_fba_mod:dasd_eckd_mod
    • usb 초기화
      • usb controller 가 있는지 점검
      • doPwMount("/proc/bus/usb", "/proc/bus/usb", "usbfs", 0, 0,
        NULL, NULL, 0, 0)
      • usb-storage
    • firewire 초기화
      • firewire controller 이 있는지 점검
      • 있으면 관련 모듈 로드
    • read /modules/pcitable
    • language set (loader 의 언어)
    • cmdline 에 입력된 모듈 로드
    • 디바이스 검색 (probeDevices)
    • doLoaderMain (CD-ROM 검색, 파일시스템 올리는 듯 함)
      • cdinstall.c
      • findAnacondaCD
      • setupCdrom: base 밑의 stage2.img 를 mount 함
      • queryCDMediaCheck
rc = newtWinChoice(_("CD Found"), _("OK"),
                       _("Skip"),
       _("To begin testing the CD media before installation press %s.\n\n"
         "Choose %s to skip the media test and start the installation."), _("OK"), _("Skip"));
  • selinux 관련 작업
  • 다시 모듈을 올리는 작업을 함. (kickstart 때문인듯함)
  • 다시 ide, scsi 를 하고 busProbe 함. (kickstart 때문인듯함)
  • agpgartInitialize

  • initializeParallelPort
  • usbInitializeMouse
  • set environment (python path...)
  • set anaconda path and options
    • rescue, serial, T, graphical, C, expert, noselinux, selinux
    • kickstart, virtpconsole, lang, keymap, module
buf = sdupprintf(_("Running anaconda, the %s system installer - please wait...\n"), getProductName());
        printf("%s", buf);
  • anaconda 수행
    • execv(anacondaArgs0, anacondaArgs);

/base/stage2.img


* loader2/loader.c
  • main
  • doLoaderMain
  • fineAnacondaCD
* loader2/cdinstall.c
  • findAnacondaCD
  • setupCdrom
  • mountStage2
* loader2/method.c
  • mountStage2
  • mountLoopback
* mount -o loop stage2.img tpm

* tmp 의 구조
etc  lib  modules  proc  usr  var
[root@localhost etc]# ls
fonts  gtk-2.0  ld.so.cache  nsswitch.conf  passwd        protocols  selinux
group  joe      man.config   pango          prelink.conf  rpm        services
[root@localhost usr]# ls
X11R6  bin  lib  sbin  share

/usr/bin
[root@localhost bin]# ls
Xvnc       du               ln           mount          reset     test
[          echo             load_policy  mpartition     rlogin    time
anaconda   egrep            loadkeys     mrd            rm        top
ash        emacs            losetup      mren           rmdir     touch
awk        env              ls           msh            rmmod     tr
basename   expr             lsattr       mshowfat       route     traceroute
bash       false            lsmod        mt             rpm       true
bunzip2    fgrep            makedevs     mtools         rpm2cpio  tty
busybox    find             mattrib      mtype          rsh       umount
bzcat      free             mbadblocks   mv             scp       uname
bzip2      ftp              mcd          mzip           sed       uniq
cat        grep             mcopy        nc             sftp      unzip
chattr     gunzip           md5sum       open           sh        uptime
chgrp      gzip             mdel         openvt         shred     usleep
chmod      halt             mdeltree     pico           sleep     vi
chown      head             mdir         pidof          sort      vncconfig
chroot     hexdump          mdu          ping           ssh       vncpasswd
chvt       hostname         mformat      pivot_root     strings   wc
clear      id               minfo        ps             stty      wget
cmp        ifconfig         mini-wm      pump           swapoff   which
cp         install          mkdir        pwd            swapon    whoami
cpio       jmacs            mknod        python         sync      xargs
cut        joe              mktemp       python2.3      syslinux  yes
date       jpico            mlabel       raidstart      tac       zcat
dd         kill             mmd          raidstop       tail
deallocvt  killall          mmount       rcp            tar
df         kudzu-probe      mmove        rdate          tee
dirname    less             modprobe     readlink       telnet
dmesg      list-harddrives  more         rescue-startx  termidx

/usr/sbin
[root@localhost sbin]# ls
arp        dump       hdparm       mdadm       mkswap     rrestore
badblocks  e2fsck     hwclock      mkdosfs     mtr        sfdisk
chroot     e2label    ifconfig     mke2fs      parted     traceroute
clock      fdisk      load_policy  mkfs.ext2   prelink    tune2fs
ddcprobe   fsck       lspci        mkfs.ext3   resize2fs
debugfs    fsck.ext2  lvm          mkfs.msdos  restore
dmidecode  fsck.ext3  lvm.static   mkfs.vfat   route


anaconda


boot 옵션으로 줄 수 있는 것은 하드웨어 검색 disable, 인스톨 미디어 시험, 인스톨 방법 선택 등이 있슴.


anaconda 를 분석하지만, live CD 를 만드는데 필요한 부분만 분석합니다.

/sbin/loader 가 옵션을 추가하여 anaconda 를 call 하는듯함.

path append argument parsing try:
(args, extra) = isys.getopt(theargs, 'CGTRxtdr:fm:',
[ 'graphical', 'text', 'test', 'debug', 'nofallback',
'method=', 'rootpath=', 'pcic=', "overhead=", 'testpath=', 'mountfs', 'traceonly', 'kickstart=', 'lang=', 'keymap=', 'kbdtype=', 'module=', 'class=', 'expert', 'serial', 'lowres', 'nofb', 'rescue', 'nomount', 'autostep', 'resolution=', 'skipddc', 'noselinux', 'selinux', 'vnc', 'vncconnect=', 'vnc=', 'cmdline', 'headless', 'virtpconsole='])

archtecture 가 s390 일 경우 isHeadless = 1 anaconda 를 call 하기 전에 이미 화면에 의해 setting 이 되는가?
language, keyboard, 설치 or upgrade, 설치유형, 디스크파티션, 부트로더, 네트워크, 방화벽 selinux, 추가언어, 시간대
anaconda 에서 메뉴 화면 디스플레이하고 setting 하는듯함.

if not isHeadless:
try:
import xsetup import rhpl.xhwstate as xhwstate
except ImportError:
isHeadless = 1
import rhpl.keyboard as keyboard

import rhpl.xserver as xserver skipddcprobe = skipddc or (x_already_set and flags.test) skipmouseprobe = not ('DISPLAY' not in os.environ or flags.setupFilesystems)

(videohw, monitorhw, mousehw) = xserver.probeHW(skipDDCProbe=skipddcprobe,
skipMouseProbe = skipmouseprobe)

try:
xcfg = xhwstate.XF86HardwareState(defcard=videohw,
defmon=monitorhw)

kbd = keyboard.Keyboard() if keymap:
kbd.set(keymap)

xsetup_failed = xserver.startXServer(videohw, monitorhw, mousehw, kbd,
runres, xStartedCB=doStartupX11Actions, xQuitCB=doShutdownX11Actions, logfile=xlogfile)

if mousehw:
id.setMouse(mousehw)

if videohw:
id.setVideoCard(videohw)

if monitorhw:
id.setMonitor(monitorhw)

xsetup = xsetup.XSetup(xcfg)

id.setXSetup(xsetup)

if kbd:
id.setKeyboard(kbd)

instClass.setInstallData(id)

if lang:
dispatch.skipStep("language", permanent = 1) instClass.setLanguage(id, lang)

if keymap:
dispatch.skipStep("keyboard", permanent = 1) instClass.setKeyboard(id, keymap)

rhpl


xserver probeHW
videocard.VideoCardInfo
cards = kudzu.probe (kudzu.CLASS_VIDEO,
kudzu.BUS_PCI | kudzu.BUS_SBUS, kudzu.PROBE_ALL);

monitor.MonitorInfo
/usr/sbin/ddcprobe
mouse.Mouse
list = kudzu.probe(kudzu.CLASS_MOUSE, kudzu.BUS_UNSPEC,
kudzu.PROBE_ALL)


bootloader.py


instbootloader

etc/sysconfig

cbq
rhn
networking
spamassassin - need check
selinux -> ../selinux/config
apm-scripts
netdump_id_dsa.pub - need check
netdump_id_dsa - need check
network-scripts
  ifcfg-eth0 - need check
network - need check
keyboard - need check
i18n - need check
authconfig - need check
desktop - 0

system-config-securitylevel - need check
iptables-config - need check
clock - need check
firstboot
hwconf - need check

* /usr/lib/anaconda-runtime/pkgorder /root/aster2.5 i386 CentOS | tee pkgorder.txt



sponsored by andamiro
sponsored by cdnetworks
sponsored by HP

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2010-02-03 17:35:46
Processing time 0.0137 sec