· KLDP.org · KLDP.net · KLDP Wiki · KLDP BBS ·
Jin LiveCD/Make Live

Ä¿³Î

  • /boot /lib/modules
  • initrd ÀÇ vmlinuz
  • config °ü·Ã ÀÛ¾÷
    • ntfs, debug_info
    • loop ´Â ?
    • audit
  • bootsplash, squashfs, unionfs
    • module ·Î ÇÒ °ÍÀΰ¡ ?
    • config_logo (kernel config ¿¡¼­ n À¸·Î º¯°æÇØ¾ß ÇÔ)

bootsplash

squashfs

unionfs

  • http://www.fsl.cs.sunysb.edu/project-unionfs.html
  • ftp://ftp.fsl.cs.sunysb.edu/pub/unionfs/
  • unionfs-20051025-2113.tar.gz »ç¿ë
  • patch-kernel.sh ¼öÇà
    • kernel source ¿¡¼­ make gconfig ¸¦ ÇÏ°í, ¼±Á¤ÇØ¾ß ÇÔ.
    • unionctl, uniondbg ´Â ¾ÆÁ÷ »ç¿ëÇÒ ÇÊ¿ä ¾ø½¿.
  • 2 °³ÀÇ ·¹ÀÌ¾î ¿¡¼­´Â mv °¡ µÇÁö¸¸, 3 °³ÀÇ ·¹À̾ »ç¿ëÇϸé, ¹®Á¦ ÀÖ½¿.
  • unionfs.ko ¸¦ initrd/modules ¿¡ ³Ö¾î¾ß ÇÔ.
  • initrd/init ¿¡¼­ ¼öÇà

artwork

  • icons
  • backgrounds
  • gnome-splash
  • gdm

ÆÐÅ°Áö ¼³Ä¡

/opt/booyo


init


LIVECD.build

  • squashfs ¿¡¼­ »ý¼ºÇÑ mksquashfs º¹»ç
  • mkfilesystem.all ¼öÇà
    • /BASESQFS »ý¼º
  • BASE.mksqfs ¼öÇà
    • LIVECD.Master/LIVECD/base.sqfs
  • Ä¿³Î º¹»ç
    • LIVECD.Master/boot/vmlinuz
  • mkinitrd ·Î À̵¿ÇÏ¿© initrd.gz »ý¼º
    • LIVECD.Master/boot/initrd.gz
  • ÀÌ »óÅ¿¡¼­ boot emulating ÇÒ ¼ö ÀÖÀ½.
    • C ÆÄƼ¼Ç »ý¼º
    • LIVECD.Master/LIVECD ¸¦ / ¿¡ º¹»ç
    • LIVECD.Master/boot ¸¦ / ¿¡ º¹»ç
    • grub.conf ¿¡ Àû¿ë

  • message »ý¼º
    • LIVECD.Master/boot/grub/message
  • stage2_eltorito º¹»ç
    • LIVECD.Master/boot/grub/stage2_eltorito
  • LIVECD.Master/boot/grub/menu.lst »ý¼º
  • index.html »ý¼º
    • LIVECD.Master/index.html
    • MS window »óÅ¿¡¼­ CD ¸¦ ³Ö¾úÀ» ¶§, º¸¿©ÁÖ´Â ³»¿ë.
  • ISO ÆÄÀÏ »ý¼º

mkinitrd

  • µð·ºÅ丮 ±¸Á¶´Â cloop ¸¦ »ç¿ëÇÒ ¶§¿Í squashfs ¸¦ »ç¿ëÇÒ ¶§°¡ ´Ù¸£´Ù.
  • unionfs ¸¦ »ç¿ëÇÒ ¶§ ´Ù¸£´Ù.
  • mkcpio
    • initrd µð·ºÅ丮¸¦ ÀÌ¿ëÇÏ¿© initrd.gz »ý¼º
  • initrd ¹ØÀÇ ÆÄÀϵé
    • UNIONFS: unionfs file system
    • bootsplash: splash ¿¡ ÀÇÇØ »ý¼ºµÈ ÆÄÀÏ
    • cdrom: cdrom ÀÌ ¸¶¿îÆ® µÇ´Â °÷
    • dev: ¸î°¡Áö ±âº»ÀûÀÎ °Í
      • console, loop0-7, null, pts, shm, zero
      • block µð¹ÙÀ̽º´Â init ¿¡¼­ »ý¼º
      • ³ª¸ÓÁö´Â udevstart °¡ »ý¼º
    • etc
      • ½ÇÁ¦·Î ÃÖ¼Ò ¹«¾ùÀÌ ÀÖ¾î¾ß Çϳª?
      • »ý°¢ÇØ º¼ °Í
      • ld.so.conf
      • mtab
      • rc.d
        • booyo-init, booyo-halt, booyo-services
        • booyo-reboot ´Â booyo-halt ¿¡ ¸µÅ©
        • À̸§ ¹Ù²Ü °Í
    • init
      • loop ¸¦ »ç¿ëÇÒ °æ¿ì¿¡´Â linuxrc ¿©¾ß ÇÔ.
    • modules
      • ÇÊ¿äÇÑ Ä¿³Î µå¶óÀ̹öµé
      • ash-booyo ¸¦ »ç¿ëÇÒ °æ¿ì, insmod, rmmod °¡ ÀÖ¾î¾ß ÇÔ.
        • /sbin/insmod.static
        • /sbin/rmmod.static
      • loop.ko, unionfs.ko, squashfs.ko
    • proc, sys, tmp
    • sbin Àº static ÀÇ ¸µÅ©ÀÓ.
    • bin, lib, usr Àº /base_image/bin,lib,usr ÀÇ ¸µÅ©ÀÓ.
      • cloop ÀÎ °æ¿ì
      • 3 °³ ÀÌ»óÀÇ ·¹À̾ »ç¿ëÇÒ °æ¿ì ´Þ¶óÁú ¼ö ÀÖÀ½
    • static
      • busybox ¿Í ¸µÅ©µé
      • unionctl

busybox

gfxboot

´Ü°èÀû °úÁ¤

  • A partition ¿¡ Desktop ¼³Ä¡
    • root passwd: livecd
  • B partition ¿¡ Workstation ¼³Ä¡
    • root passwd: livecd
  • grub.conf
    • A, B partition ¿¡ ¿øº» Ä¿³Î·Î ºÎÆÃ
    • A, B partition ¿¡ »õ·Î¿î Ä¿³Î·Î ºÎÆÃ
  • A partition ¿øº» Ä¿³Î·Î ºÎÆÃ
    • ³ª¸ÓÁö ºÎºÐ ¼³Á¤
      • user name: livecd
      • userpasswd: livecd
  • B partition ¿øº» Ä¿³Î·Î ºÎÆÃ
    • ³ª¸ÓÁö ºÎºÐ ¼³Á¤
      • user name: livecd
      • userpasswd: livecd
    • Ä¿³Î »ý¼º
    • opt »ý¼º
    • sysvinit »ý¼º
    • A ÆÄƼ¼Ç¿¡ º¹»ç
      • »õ·Î¿î Ä¿³Î, modules
      • opt/booyo
      • artwork
      • init
      • etc/bootsplash
    • LIVECD.build º¹»ç
    • make BASESQFS
    • make base.sqfs
    • initrd.gz »ý¼º
      • kernel º¹»ç
      • µð¹ÙÀ̽º µå¶óÀ̹ö º¹»ç
      • unionfs.ko, squash.ko º¹»ç
      • busybox º¹»ç
      • unionctl º¹»ç
  • emulating ½ÃÇè
  • grub »ý¼º
    • gfxboot, boot/grub/message
    • boot/grub/stage2_eltorito slax °Í º¹»ç
      • ÀÌ°ÍÀ» ¾î¶»°Ô ¸¸µå´ÂÁö ¾Ë¾Æ¾ß ÇÔ.
      • grub ÀÇ Makefile À» º¸¸é µÉ °Í °°Àºµ¥...

ÇØ¾ß ÇÒ ÀÏ

  • bootsplash ÀÇ image ¿¡ ¹®±¸ ³ÖÀ» °Í
    • press F2

ÀÛ¾÷ ³»¿ë 2005.10.30

  • mkfilesystem.tst ¿¡¼­ ´ÙÀ½À» ¾ø¾Ú
mkdir $DEST/dev
mkdir $DEST/media
mkdir $DEST/mnt
mkdir $DEST/proc
mkdir $DEST/sys
mkdir $DEST/tmp
  • init ¿¡ UNIONFS ¸¸µç ÈÄ mkdir media, mnt
  • mklivecdfs »ý¼º
    • /livecd.src/artwork/icons/cpicons ¼öÁ¤

  • make base.sqfs
  • cd /mnt/hdb2/LIVECD
  • cp /LIVECD.build/LIVECD.Master/LIVECD/base.sqfs .
  • cd ../boot
  • sh mkcpio
  • reboot

gstreamer

    7  rpm -ivh indent-2.2.9-8.i386.rpm
    8  rpm -ivh libIDL-devel-0.8.5-2.i386.rpm
    9  rpm -ivh ORBit2-devel-2.12.1-3.i386.rpm
   10  rpm -ivh GConf2-devel-2.10.0-4.i386.rpm
   11  rpm -ivh gstreamer-plugins-*
   12  rpm -ivh gstreamer-plugins-devel-0.8.8-6.i386.rpm

  • ainit root start
  • /etc/alsa/ainit.conf
    • overwrite = yes overwrite=no

  • cd /usr/bin
  • ln -s gdk-pixbuf-query-loaders-32 gdk-pixbuf-query-loaders

  • rebuildfstab º¼ °Í
  • halt °ËÅäÇÒ °Í

  • inittab ´Â »ì¾Æ Àִµ¥, booyo-init, booyo-halt µîÀº ¾ø¾îÁú±î?

init, halt, reboot

  • /
SQFS UNIONFS
cdrom dev ramdisk static swap

media mnt proc sys
home -> /ramdisk/home
root -> /ramdisk/root
tmp -> /ramdisk/tmp

bin -> /UNIONFS/bin
boot -> /UNIONFS/boot
etc -> /UNIONFS/etc
lib -> /UNIONFS/lib
misc -> /UNIONFS/misc
opt -> /UNIONFS/opt
sbin -> /UNIONFS/sbin
selinux -> /UNIONFS/selinux
srv -> /UNIONFS/srv
usr -> /UNIONFS/usr
var -> /UNIONFS/var
  • SQFS
    • bin boot etc home lib misc opt root sbin
    • selinux srv usr var
  • UNIONFS
    • bin boot etc home lib misc opt root sbin
    • selinux srv tmp usr var
  • initrd
SQFS UNIONFS bootsplash cdrom init modules
sbin -> static
static
bin -> /SQFS/bin
boot -> /SQFS/boot
lib -> /SQFS/lib
opt -> /SQFS/opt
usr -> /SQFS/usr
dev etc media mnt proc root sys tmp
  • UNIONFS ·Î ¸µÅ©µÇ¾î ÀÖ´Â °Í
    • bin, boot, etc, lib, misc, opt, sbin,
    • selinux, srv, usr, var
[root@localhost UNIONFS]# cat /proc/mounts
rootfs / rootfs rw 0 0
none /sys sysfs rw 0 0
/dev/hdb2 /cdrom ext2 ro 0 0
/dev/loop0 /SQFS squashfs ro 0 0
/ramdisk /ramdisk tmpfs rw 0 0
/UNIONFS /UNIONFS unionfs rw,dirs=/ramdisk=rw:/SQFS=ro,debug=0,delete=whiteout,copyup=preserve 0 0
/proc /proc proc rw,nodiratime 0 0
/proc/bus/usb /proc/bus/usb usbfs rw 0 0
none /dev tmpfs rw 0 0
none /dev/pts devpts rw 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0
  • \/dev
    \/ramdisk

[root@localhost root]# cat /etc/mtab
/dev/root / tmpfs rw 0 0
usbfs /proc/bus/usb usbfs rw 0 0
/dev/hdb2 /cdrom ext2 ro 0 0
/ramdisk /ramdisk tmpfs rw 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0

  • etc ¸¦ SQFS ÀÇ »óÅ·Π¾µ ¼ö ÀÖµµ·Ï ¸¸µé °Í
  • ramdisk °¡ Áö¿öÁö´Â °Í °°À½.
  • ¼öÁ¤ÇØ¾ß ÇÒ °Í
    • init, booyo-halt
    • make process ( /sbin/init À» /etc ¿¡ º¹»ç.
      • /etc/rc.d ¹ØÀÇ ÆÄÀϵéÀ» SQFS ·Î À̵¿
      • SQFS °¡ Á¦ÀÏ ³ªÁß¿¡ umount µÇµµ·Ï ÇØ¾ß ÇÑ´Ù.

adios

EjectCD()
{
    local EJECT=$1 SQUASHFS

    #just in case they are mounted, umount any squashfs mounts
    for SQUASHFS in `grep squash /proc/mounts | cut -d' ' -f2`; do
        umount $SQUASHFS
    done
    umount $BOOTCD_DIR

    if [ "X${EJECT}" = "Xmessage-only" ]; then
        echo; echo "You may now eject the CD."
    else
        eject /dev/cdrom
    fi
}
Reboot()
{
    Shutdown -r
}
Shutdown()
{
    local HOW=$1

    UnmountAllPartitions
    grep -q cdrom /proc/mounts && EjectCD
    echo
    case $HOW in
        -r) echo "Rebooting system ... "; reboot -f;;
        *) echo "Halting system ... "; halt -f -p;;
    esac
}
{{{
[root@localhost cdrom]# ls -l
ÇÕ°è 24
drwxr-xr-x  1 root root  791  5¿ù 17 10:28 bin
lrwxrwxrwx  1 root root    8  7¿ù 19 12:55 boot -> ../boot/
lrwxrwxrwx  1 root root    7  7¿ù 19 12:55 etc -> ../etc/
lrwxrwxrwx  1 root root    8  7¿ù 19 12:55 home -> ../home/
drwxr-xr-x  1 root root   10  6¿ù 20 11:50 initrd
drwxr-xr-x  1 root root 2127  6¿ù 10 14:29 lib
lrwxrwxrwx  1 root root    9  7¿ù 19 12:55 media -> ../media/
lrwxrwxrwx  1 root root    8  7¿ù 19 12:55 misc -> ../misc/
lrwxrwxrwx  1 root root    7  7¿ù 19 12:55 mnt -> ../mnt/
lrwxrwxrwx  1 root root    7  7¿ù 19 12:55 opt -> ../opt/
lrwxrwxrwx  1 root root    8  7¿ù 19 12:55 proc -> ../proc/
lrwxrwxrwx  1 root root    8  7¿ù 19 12:55 root -> ../root/
drwxr-xr-x  1 root root 2539  7¿ù  4 13:27 sbin
lrwxrwxrwx  1 root root   11  7¿ù 19 12:55 selinux -> ../selinux/
lrwxrwxrwx  1 root root    7  7¿ù 19 12:55 srv -> ../srv/
lrwxrwxrwx  1 root root    7  7¿ù 19 12:55 sys -> ../sys/
lrwxrwxrwx  1 root root   12  7¿ù 19 12:55 tftpboot -> ../tftpboot/
lrwxrwxrwx  1 root root    7  7¿ù 19 12:55 tmp -> ../tmp/
lrwxrwxrwx  1 root root    7  7¿ù 19 12:55 usr -> ../usr/
drwxr-xr-x  1 root root  308  7¿ù 14 13:28 var

initrd

drwxr-xr-x   2 root root  4096  5¿ù 25 15:14 adios
lrwxrwxrwx   1 root root    11 10¿ù 29 23:15 bin -> initrd/bin/
drwxr-xr-x   3 root root  4096  5¿ù 31 17:13 boot
drwxr-xr-x  19 root root  8192  5¿ù 25 15:58 dev
lrwxrwxrwx   1 root root    11 10¿ù 29 23:15 etc -> initrd/etc/
drwxr-xr-x   7 root root  4096 11¿ù  1 20:32 initrd
-rw-r--r--   1 root root   964  8¿ù 15 21:04 kk
lrwxrwxrwx   1 root root    11 10¿ù 29 23:15 lib -> initrd/lib/
-rwxr-xr-x   1 root root 74412  7¿ù 20 12:53 linuxrc
drwxr-xr-x   5 root root  4096  5¿ù 25 16:01 media
drwxr-xr-x   2 root root  4096  5¿ù 25 15:14 misc
drwxr-xr-x  16 root root  4096  7¿ù  8 12:10 mnt
drwxr-xr-x   2 root root  4096  5¿ù 25 15:14 opt
drwxr-xr-x   2 root root  4096  5¿ù 25 15:14 proc
drwxr-xr-x   2 root root  4096  5¿ù 31 17:07 root
lrwxrwxrwx   1 root root    12 10¿ù 29 23:15 sbin -> initrd/sbin/
drwxr-xr-x   2 root root  4096  5¿ù 25 15:14 selinux
drwxr-xr-x   2 root root  4096  5¿ù 25 15:14 srv
drwxr-xr-x   2 root root  4096  5¿ù 25 15:14 sys
drwxrwxrwt   2 root root  4096  5¿ù 25 15:14 tmp
lrwxrwxrwx   1 root root    11 10¿ù 29 23:15 usr -> initrd/usr/
drwxr-xr-x   4 root root  4096  5¿ù 25 16:02 var
}}}
{{{
PrepareRealRootFilesystem()
# This function is called just before we exit the initrd environment.
# It replaces the initrd/busybox files with the real root filesystem files so
# that the kernel can start the init process and so on, as per a normal linux
# session.  Plus a heap of other stuff.
{
    local SQFS SQFS_DIRS DIR

    [ $USE_UNIONFS = TRUE ] && modprobe unionfs >/dev/null

-----
    # special case of loopback files not recommended
        # setup links into /var       
        rm -f etc; rm -rf boot root tmp
        ln -s var/boot var/etc var/home var/root var/tftpboot var/tmp /

        if [ $ADIOSMOUNTED = FALSE ]; then
            MountSquashFS adios /
            ADIOSMOUNTED=TRUE
        fi

        # Replace busybox stuff with the real root files located in /adios and /var
        if [ -f ${BOOTCD_DIR}/usr.sqfs ]; then
            busybox rm -f usr
            busybox mkdir usr
            # allow for ext3 loopback filesystem similar to MountSquashFS usr /
            if busybox [ $USE_UNIONFS = TRUE ]; then
                busybox mkdir -p /mnt/usr /tmp/usr_cow
                /initrd/bin/mount -r -o loop -t squashfs ${BOOTCD_DIR}/usr.sqfs /mnt/usr
                /initrd/bin/mount -t unionfs -o dirs=/tmp/usr_cow:/mnt/usr none /usr
                busybox echo "Mounting usr.sqfs on /usr with unionfs"
            else
                /initrd/bin/mount -r -o loop -t squashfs ${BOOTCD_DIR}/usr.sqfs /usr
                busybox echo "Mounting usr.sqfs on /usr"
            fi
            busybox [ -f /usr/usr.loop ] &&
                ( busybox umount /usr; \
                  busybox mkdir -p /mnt/usr; \
                  /initrd/bin/mount -r -o loop -t squashfs ${BOOTCD_DIR}/usr.sqfs /mnt/usr; \
                  /initrd/bin/mount -r -o loop /mnt/usr/usr.loop /usr )
        else
            busybox rm -f usr
            busybox echo "Linking /usr to /adios/usr"
            busybox ln -s adios/usr /usr
        fi
        busybox rm -f bin lib sbin #remove links
        busybox ln -s adios/bin adios/lib adios/sbin /
        # magic for /mnt for UML children
        busybox ln -s /var /etc /mnt

        USE_UNIONFS=FALSE
        # mount all the sqfs files in /opt (if any)
        [ "$SQFS_DIR" != "$BOOTCD_DIR" ] && SQFS_DIRS="$BOOTCD_DIR $SQFS_DIR" || SQFS_DIRS=$BOOTCD_DIR
        for DIR in $SQFS_DIRS; do
            for SQFS in `ls ${DIR}/opt/*.sqfs`; do
                SQFS=`basename ${SQFS%%.sqfs}`
                mkdir -p /opt/${SQFS}
                MountSquashFS $SQFS /opt/ $DIR
            done
        done
----
    chmod 755 /var

    # Delete files in initrd that are no longer needed.  However we need to
    # keep some files (eg busybox) coz they're used again at shutdown.
    if [ $TRIMINITRD = "TRUE" ]; then
        (rm -f /linuxrc /initrd/info /initrd/harddriveinstall)
        (cd /initrd/sbin; rm -f *fsck *e2fs lvm)
        (cd /initrd/usr; rm -rf share; rm -rf local)
    fi

    # Stuff to do on the *real* root filesystem.  However we can only modify
    # files under /var because the rest are in read-only squashfs files.

    if [ $FIRST_BOOT = TRUE -o $REDETECT_HARDWARE = TRUE ]; then
        cat /initrd/etc/fstab > /etc/fstab
        (cd /etc; rm -f asound.state modprobe.conf* sysconfig/hwconf X11/xorg.conf*)
    fi
    [ $RUNLEVEL_CHANGED -eq 1 ] && sed -i "s#id:.#id:${RUNLEVEL}#" /etc/inittab
    [ $DM_CHANGED -eq 1 ] && sed -i "s#^DISPLAYMANAGER=.*#DISPLAYMANAGER=${DM}#" /etc/sysconfig/desktop
    [ $RHGB_CHANGED -eq 1 ] && sed -i "s#^GRAPHICAL=.*#GRAPHICAL=${RHGB}#" /etc/sysconfig/init
    if [ $AUTOLOGIN_CHANGED -eq 1 ]; then
        sed -i "s/^\(AutoLoginEnable=\).*$/\1${AUTOLOGIN}/" /etc/X11/xdm/kdmrc
        sed -i "s/^\(AutomaticLoginEnable=\).*$/\1${AUTOLOGIN}/" /etc/X11/gdm/gdm.conf
    fi
    if [ $DESKTOP_CHANGED -eq 1 ]; then
        sed -i "s#^DESKTOP=.*#DESKTOP=${DESKTOP}#" /etc/sysconfig/desktop
        sed -i "s#^Session=.*#Session=${DESKTOP}#" /home/adios/.dmrc
        chown adios.users /home/adios/.dmrc
    fi
    if [ $LANG_CHANGED -eq 1 ]; then
        sed -i "s#^LANG=.*#LANG=${LANG}.utf8#" /etc/sysconfig/i18n
        sed -i "s#^SUPPORTED=.*#SUPPORTED=${LANG}.utf8:${LANG}:${LANG%%_??}#" /etc/sysconfig/i18n
    fi
    if [ $KEYTABLE_CHANGED -eq 1 ]; then
        sed -i "s#^KEYTABLE=.*#KEYTABLE=${KEYTABLE}#" /etc/sysconfig/keyboard
    fi
    if [ $UMLBRIDGE = TRUE ]; then
        echo "/usr/local/sbin/umlbridge" >> /etc/rc.d/rc.local
    fi
    if [ $LAB_SERVER = TRUE ]; then
        echo "/usr/local/sbin/labserver" >> /etc/rc.d/rc.local
    fi
    if [ "$CMDS" ]; then
        echo "Executing: ${CMDS}"
        eval "$CMDS"
        sync
    fi

    # Setup X here so we can use rhgb (plus I don't really like the way fedora
    # now runs system-config-display via kudzu)
    if [ $RUNLEVEL -gt 3 -a ! -f $X_CONFIG_FILE ]; then
        echo -n "Configuring X ... "
        case $RESOLUTION in
            system-config-display)
                system-config-display ;;
            Xorg)
                Xorg -configure >/dev/null
                egrep -v "ModulePath|FontPath" /x.conf.new | \
                sed 's#\(.*RgbPath.*$\)#\1\n\tFontPath\t\"unix/:7100\"#g' > $X_CONFIG_FILE
                rm -f /x.conf.new ;;
            *)  system-config-display --set-resolution=$RESOLUTION --set-depth=$DEPTH ;;
        esac
    fi

    # fix init and halt before starting
    # Makefile to add link for /sbin/init to /initrd/sbin/init
    # Makefile to rm /var/etc/init.d/halt; ln -s /initrd/bin/busybox

    # needs to be done before SELinux stuff so it gets labelled correctly
    ln -s $REAL_ROOT_DEVNAME /dev/root
    echo $REAL_ROOT_DEVNUM > /proc/sys/kernel/real-root-dev

    if [ $SECURITY = lids -a $FIRST_BOOT = TRUE ]; then
        echo -n "Updating LIDS dev/inode data ... "
        lidsconf -U >/dev/null
        lidsconf -U BOOT >/dev/null
        lidsconf -U POSTBOOT >/dev/null
        lidsconf -U SHUTDOWN >/dev/null
        lidsconf -C >/dev/null
        echo "Done."
    elif [ $SECURITY = selinux ]; then
        echo -n "Updating SELinux file labels ... "
        if [ $FIRST_BOOT = TRUE ]; then
            # make sure none of the selinux config files have future timestamps
            hwclock --hctosys --localtime
            find /etc/selinux -exec touch {} \;
            # need to create /tmp/uml and give it the correct label
            mkdir /var/tmp/uml
            chown adios.users /var/tmp/uml
        fi
        # files in / are non-persistent and need to be relabelled each time
        setfiles -q /etc/selinux/strict/src/policy/file_contexts/file_contexts /        # and make sure all files in /var have the correct labels
        setfiles -q /etc/selinux/strict/src/policy/file_contexts/file_contexts /var
        sync
        echo "Done."
    fi

    Debug on

    if [ $REAL_ROOTFS_SHELL = TRUE ]; then
        echo
        echo -e "${WHITE}Dropping out to a shell on the real root filesystem."
        echo -e "The init process will start when you exit this shell.${NORMAL}"        echo
        sh
    fi
    echo
}
}}}
{{{
TypicalLinuxrc
FindAdiosCD
PrepareRealRootFilesystem

}}}
 * busybox ÀÇ ash ÀÇ ÇൿÀº ÀÌÇØÇÒ ¼ö ¾øÀ½.
 * squashfs ·Î SQFS ¿¡ ¿Ã¸° ÈÄ Àý´ë°æ·Î¸¦ »ç¿ëÇÏ¿© ¸í·ÉÀ» ¼öÇàÇÒ °æ¿ì not found °¡ ³ª¿È.
 * bin µð·ºÅ丮¸¦ ¸ÕÀú /SQFS/bin À¸·Î ¸µÅ© ½ÃÄѳõÀº °æ¿ì´Â ¼öÇàÀÌ µÊ.

=== 2005. 11. 2 ===
{{{
[root@localhost root]# cat /proc/mounts
rootfs / rootfs rw 0 0
none /sys sysfs rw 0 0
/dev/hdb2 /mnt/hdb2 ext2 ro 0 0
/dev/loop0 /SQFS squashfs ro 0 0
/dev/loop2 /USRFS squashfs ro 0 0
/ramdisk /ramdisk tmpfs rw 0 0
/UNIONFS /UNIONFS unionfs rw,dirs=/ramdisk/base=rw:/SQFS=ro,debug=0,delete=whiteout,copyup=preserve 0 0
none /UNIONFS1 unionfs rw,dirs=/ramdisk/usr=rw:/USRFS=ro,debug=0,delete=whiteout,copyup=preserve 0 0
/proc /proc proc rw,nodiratime 0 0
/proc/bus/usb /proc/bus/usb usbfs rw 0 0
none /dev tmpfs rw 0 0
none /dev/pts devpts rw 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0
/dev/hdb1 /mnt/hdb1 ext2 rw,nosuid,nodev 0 0
}}}
[root@localhost root]# cat /etc/mtab
/dev/root / ext2 rw 0 0
usbfs /proc/bus/usb usbfs rw 0 0
/ramdisk /ramdisk tmpfs rw 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0
/dev/hdb1 /mnt/hdb1 ext2 rw,nosuid,nodev 0 0
[root@localhost root]# cat /etc/fstab
# This file is edited by fstab-sync - see 'man fstab-sync' for details
/dev/root /     ext2    defaults        1 1
none    /proc   proc    defaults        0 0
none    /sys    sysfs   noauto          0 0
none    /dev/pts        devpts  defaults        0 0
/dev/hdb2 /mnt/hdb2 ext2 noauto 0 0
# Added by BOOYO
/dev/hdb1 /mnt/hdb1 ext2 noauto,users,exec 0 0

Çö »óÅÂ

  • °ú°ÅÀÇ init À» initrd/sbin/ ¿¡ º¹»ç
  • halt, reboot, poweroff ´Â ¿©±â¿¡ ¸µÅ©
  • initrd/init ¿¡¼­´Â /sbin/init ¸¦ ¼öÇà

Á¶»çÇÒ °Í

  • squashfs mount ÇÑ ÈÄ¿¡ ¼öÇà.
    • cat /SQFS/etc/ld.so.cache > /etc/ld.so.cache
PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:."
  • export PATH
  • ÀÌ ºÎºÐ¿¡¼­ ¸í·É¾î·Î ¸µÅ©¸¦ º¯°æÇϸé ÀÌÈÄÀÇ ¸í·É¾î¸¦ ãÁö ¸øÇÔ.
  • hash -r
  • ¸í·É¾î·Î ¸µÅ©¸¦ ¹Ù²Ü °æ¿ì ¹®Á¦°¡ ÀÖ½¿.
  • initrd ÀÇ µð·ºÅ丮¸¦ ¸ÕÀú ¸µÅ© ½ÃÄÑ ³õÀº °æ¿ì´Â ¼öÇàµÊ.
  • unionfs ¸¦ mount ÇÑ ÈÄ¿¡ ¼öÇà.
 for i in bin etc lib sbin usr; do
  if /USRFS/usr/bin/test -d /$i; then
   mv /$i /$i.old && \
   /SQFS/lib/ld-linux.so.2 --library-path /SQFS/lib /SQFS/bin/ln -snf /UNIONFS/$i /$i && \
   rm -rf /$i.old
  else

   ln -snf /UNIONFS/$i /$i
  fi
 done
  • ld-linux.so.2 ÀÌ ÇÏ´Â ÀÏÀÌ ¹«¾ùÀΰ¡?

adios

  • PutVar "ram"
  • PrepareRealRootFilesystem

==== PutVar ===
  • exec >/dev/null
  • MountSquashFS adios /
  • exec >/dev/console
  • ADIOSMOUNTED=TRUE
  • PutVarInRAM
    • mount -t tmpfs -o size=${VAR_MEM}M none /var
    • cp -af /adios/var/* /var
  • umount /adios
  • umount /mnt/adios
  • ADIOSMOUNTED=FALSE
  • modprobe unionfs >/dev/null
  • rm -f etc; rm -rf boot root tmp
  • ln -s var/boot var/etc var/home var/root var/tftpboot var/tmp /
  • MountSquashFS adios /
  • ADIOSMOUNTED=TRUE
  • busybox rm -f usr
  • busybox mkdir usr
  • busybox mkdir -p /mnt/usr /tmp/usr_cow
  • /initrd/bin/mount -r -o loop -t squashfs ${BOOTCD_DIR}/usr.sqfs /mnt/usr
  • /initrd/bin/mount -t unionfs -o dirs=/tmp/usr_cow:/mnt/usr none /usr
  • busybox rm -f bin lib sbin #remove links
  • busybox ln -s adios/bin adios/lib adios/sbin /
  • busybox ln -s /var /etc /mnt
  • chmod 755 /var
  • cat /initrd/etc/fstab > /etc/fstab
  • ln -s $REAL_ROOT_DEVNAME /dev/root
  • echo $REAL_ROOT_DEVNUM > /proc/sys/kernel/real-root-dev

¼ø¼­

  • sh mkfilesystem.all
  • sh makelivecdfs
  • cd /ALLSQFS
  • cp packages
  • sh install °¢°¢ÀÇ µð·ºÅ丮¿¡¼­
  • sh mkfilesystem.live
  • sh mkfilesystem.usr
  • sh USR.mksqfs
  • sh LIVE.mksqfs

morphix

title Morphix
kernel (cd)/boot/vmlinuz lang=us ramdisk_size=100000 init=/etc/init noapic acpi=off apm=power-off  vga=791 splash=silent initrd=miniroot.gz quiet BOOT_IMAGE=morphix

title Morphix | ACPI on
kernel (cd)/boot/vmlinuz lang=us ramdisk_size=100000 init=/etc/init noapic vga=791 splash=silent initrd=miniroot.gz  quiet BOOT_IMAGE=morphix

title Morphix | Failsafe mode
kernel (cd)/boot/vmlinuz lang=us ramdisk_size=100000 init=/etc/init acpi=off vga=normal nosound noapic noscsi nodma noapm nousb nopcmcia nofirewire noagp nomce nodhcp xmodule=vesa initrd=miniroot.gz BOOT_IMAGE=morphix

title Morphix | Expert mode
kernel (cd)/boot/vmlinuz lang=us ramdisk_size=100000 init=/etc/init noapic acpi=off apm=power-off vga=normal initrd=miniroot.gz BOOT_IMAGE=expert

title Morphix | Copy media to ram before booting
kernel (cd)/boot/vmlinuz lang=us ramdisk_size=100000 init=/etc/init noapic acpi=off apm=power-off vga=791 splash=silent initrd=miniroot.gz quiet BOOT_IMAGE=morphix toram

title Morphix | Boot from USB v1 device
kernel (cd)/boot/vmlinuz lang=us usbboot1 ramdisk_size=100000 init=/etc/init noapic acpi=off apm=power-off  vga=791 splash=silent initrd=miniroot.gz quiet BOOT_IMAGE=morphix

title Morphix | Boot from USB v2 device
kernel (cd)/boot/vmlinuz lang=us usbboot2 ramdisk_size=100000 init=/etc/init noapic acpi=off apm=power-off  vga=791 splash=silent initrd=miniroot.gz quiet BOOT_IMAGE=morphix

title Morphix | Boot using persistant home
kernel (cd)/boot/vmlinuz lang=us home=scan ramdisk_size=100000 init=/etc/init noapic acpi=off apm=power-off  vga=791 splash=silent initrd=miniroot.gz quiet BOOT_IMAGE=morphix

title Submenu -> Supported languages
configfile (cd)/boot/grub/lang.lst

title Submenu -> More boot options
configfile (cd)/boot/grub/options.lst

title Memtest | Memory diagnostic tool
kernel (cd)/boot/memtest

ID
Password
Join
You will be married within a year.


sponsored by andamiro
sponsored by cdnetworks
sponsored by HP

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2005-11-06 03:17:56
Processing time 0.0177 sec