http://www.hackerschool.org/HS_Boards/zboard.php?id=Free_Lectures&no=1400 [º¹»ç]
¿ø¹® ÁÖ¼Ò:http://kjwon15.comoj.com/xe/?document_srl=1229
BT4¿Í BT3ÀÌ ¿ö³« Â÷ÀÌ°¡ ¸¹ÀÌ ³ª±â ¶§¹®¿¡(BT3:slax±â¹Ý,BT4:ubuntu±â¹Ý)¸ÖƼºÎÆÃÀ» ÇÏ°í ½Í¾ú´Ù.
±×·¡¼ Çغ¸°í Àؾî¹ö¸®Áö ¾Êµµ·Ï ÀÛ¼ºÇØ µÐ´Ù.
ÀÏ´Ü USB(4GBÀÌ»ó ±ÇÀå)À» ÆÄƼ¼ÇÀ» ³ª´«´Ù.
ÀÏ´Ü ÆíÇÏ°Ô sdb1,sdb2¶ó°í ºÎ¸£°Ú´Ù.
1. BT4 ÀνºÅç
ÀÏ´Ü sdb1¿¡ BT4¸¦ º¹»çÇØ ³Ö´Â´Ù.
±×¸®°í /boot/grubÆú´õ¿¡ stage1,stage2ÆÄÀÏÀ» º¹»çÇØ ³Ö´Â´Ù.(¿ìºÐÅõ¿¡ ÀÖ´Ù.)
±×¸®°í sudo grub
¾Ë¾Æ¼ grub¸¦ ¼³Ä¡ÇØ ÁØ´Ù.
ÀÏ´Ü ³ëÆ®ºÏ¿¡ USB¸¦ ²È¾Æ¼ ºÎÆÃÀÌ µÇ´ÂÁö º¸ÀÚ.
2. BT3 ÀνºÅç ¼³Á¤ ¹Ù²Ù±â
ÀÏ´Ü BT3¸¦ sdb2¿¡ º¹»çÇØ ³Ö´Â´Ù.
±×¸®°í /boot/bootinst.sh¸¦ ¼öÁ¤ÇÑ´Ù.
ÀüüÆÄÀÏ:
view source
print?
01.#!/bin/bash
02.
03.set -e
04.TARGET=""
05.MBR=""
06.
07.# Find out which partition or disk are we using
08.MYMNT=$(cd -P $(dirname $0) ; pwd)
09.while [ "$MYMNT" != "" -a "$MYMNT" != "." -a "$MYMNT" != "/" ]; do
10. TARGET=$(egrep "[^[:space:]]+[[:space:]]+$MYMNT[[:space:]]+" /proc/mounts | cut -d " " -f 1)
11. if [ "$TARGET" != "" ]; then break; fi
12. MYMNT=$(dirname "$MYMNT")
13.done
14.
15.if [ "$TARGET" = "" ]; then
16. echo "Can't find device to install to."
17. echo "Make sure you run this script from a mounted device."
18. exit 1
19.fi
20.
21.#MBR=$(echo "$TARGET" | sed -r "s/[0-9]+\$//g")
22.MBR=$TARGET
23.NUM=${TARGET:${#MBR}}
24.cd "$MYMNT"
25.
26.clear
27.echo "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
28.echo " Welcome to Slax boot installer "
29.echo "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
30.echo
31.echo "This installer will setup disk $TARGET to boot only Slax."
32.if [ "$MBR" != "$TARGET" ]; then
33. echo
34. echo "Warning! Master boot record (MBR) of $MBR will be overwritten."
35. echo "If you use $MBR to boot any existing operating system, it will not work"
36. echo "anymore. Only Slax will boot from this device. Be careful!"
37.fi
38.echo
39.echo "Press any key to continue, or Ctrl+C to abort..."
40.echo $MBR
41.echo $TARGET
42.read junk
43.clear
44.
45.echo "Flushing filesystem buffers, this may take a while..."
46.sync
47.
48.# setup MBR if the device is not in superfloppy format
49.if [ "$MBR" != "$TARGET" ]; then
50. echo "Setting up MBR on $MBR..."
51. ./boot/syslinux/lilo -S /dev/null -M $MBR ext # this must be here to support -A for extended partitions
52. echo "Activating partition $TARGET..."
53. ./boot/syslinux/lilo -S /dev/null -A $MBR $NUM
54. echo "Updating MBR on $MBR..." # this must be here because LILO mbr is bad. mbr.bin is from syslinux
55. cat ./boot/syslinux/mbr.bin > $MBR
56.fi
57.
58.echo "Setting up boot record for $TARGET..."
59../boot/syslinux/syslinux -d boot/syslinux $TARGET
60.
61.echo "Disk $TARGET should be bootable now. Installation finished."
62.
63.echo
64.echo "Read the information above and then press any key to exit..."
65.read junk
¼öÁ¤ÇÑ ºÎºÐÀº ´ÙÀ½°ú °°´Ù.
#MBR=$(echo "$TARGET" | sed -r "s/[0-9]+\$//g")
MBR=$TARGET
¿ø·¡ sdbÁ¤µµ·Î µÇ¾ß ÇÒ $MBRÀ» sdb2Á¤µµ·Î ¹Ù²ãÁÖ´Â ¿ªÇÒÀÌ´Ù..
ÀÌÀ¯´Â MBR¿¡ ±ò¸é ºÎÆ®·Î´õÀÎ grub°¡ ¾ø¾îÁö±â ¶§¹®ÀÌ´Ù.
3. BT3 ÀνºÅç
ÀνºÅçÀ» ÇÑ´Ù.
sudo ./bootinst.sh
4. grub¿¡ BT3·Î ³Ñ¾î°¡´Â ½ºÅ©¸³Æ® ÀÛ¼º..
ÀÏ´Ü ³òºÏÀ¸·Î ºÎÆÃÇØ º¸¸é ¾Ë°ÚÁö¸¸ BT3·Î ³Ñ¾î°¥ ¼ö°¡ ¾ø´Ù.
±×·¡¼ ´ÙÀ½°ú °°Àº ÁÙÀ» /boot/grub/menu.lst¿¡ Ãß°¡ÇÑ´Ù.
title Boot the BT3
root (hd0,1)
chainloader +1
¶æÀº ù¹ø°ÇϵåÀÇ 2¹ø° ÆÄƼ¼ÇÀÇ ·Î´õ·Î ³Ñ¾î°¡¶ó.. Á¤µµ.
ÀÌ·¸°Ô ÇÏ°í ÀúÀå.
5. È®ÀÎ
³òºÏÀ̳ª ÄÄÀ̳ª¿¡ ³Ö°í ºÎÆÃÀ» Çغ¸ÀÚ.
¸Þ´º°¡ ¶ß¸é ¸Ç ¹ØÀÇ Boot the BT3 À» ´·¯ÁØ´Ù(¿ì¸®°¡ ÀÛ¼ºÇÑ °ÍÀ» Å×½ºÆ®ÇÏ·Á°í)
±×·¯¸é ¶Ç´Ù½Ã ¸Þ´º°¡ ¶ß¸é¼ À̶§ ¾Æ¹«°Å³ª °í¸£¸é (memtest°°Àº°Å ¸»°í) BT3°¡ ºÎÆõǴ°ÍÀ» ¾Ë ¼ö ÀÖ´Ù. |
Hit : 8142 Date : 2010/02/22 04:55
|