ubuntu 12.04.4 32/64bit 용 iso 제작 성공

ubuntu-12.04.4-desktop-i386-amd64.iso 제작에 성공했습니다.

다만, http://askubuntu.com/questions/28299/dv…bit-ubuntu 에 나온 방법 그대로하면 100% 실패를 하게되구요,

약간의 customize 가 필요하네요;

  1. ROOT Directory 기준입니다.

  2. Ubuntu iso 파일을 다운받으십시오.
    Ubuntu 버전은 상관이 없으며, 전 12.04.4 버전을 i386 과 amd64 로 받았습니다.
    밑에 버전 숫자만 고쳐주면 됩니다. (13.04, 13.10, 14.04 : 모두 가능합니다.)

  3. iso 파일을 만들기 위한 폴더구조를 생성해야 합니다.
    기본 디렉토리는 / (root) 로 잡았습니다.

$ sudo mkdir -p /ubuntu-12.04-desktop-i386-amd64/boot/{grub,iso}
$ sudo mv ubuntu-12.04.4-desktop-{i386,amd64}.iso /ubuntu-12.04-desktop-i386-amd64/boot/iso/

  1. ubuntu-12.04-desktop-i386-amd64/boot/grub/grub.cfg 파일을 생성후 저장하십시오.

$ sudo touch /ubuntu-12.04-desktop-i386-amd64/boot/grub/grub.cfg
$ sudo vi /ubuntu-12.04-desktop-i386-amd64/boot/grub/grub.cfg

– grub.cfg 파일이 console 창에 열리면

Derived from /boot/grub/loopback.cfg from ubuntu-12.04.4-desktop-i386.iso and ubuntu-12.04.4-desktop-amd64.iso.

menuentry "Try Ubuntu without installing (32-bit)" {
loopback iso /boot/iso/ubuntu-12.04.4-desktop-i386.iso
linux (iso)/casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper iso-scan/filename=/boot/iso/ubuntu-12.04.4-desktop-i386.iso quiet splash –
initrd (iso)/casper/initrd.lz
}
menuentry "Try Ubuntu without installing (64-bit)" {
set gfxpayload=keep
loopback iso /boot/iso/ubuntu-12.04.4-desktop-amd64.iso
linux (iso)/casper/vmlinuz.efi file=/cdrom/preseed/ubuntu.seed boot=casper iso-scan/filename=/boot/iso/ubuntu-12.04.4-desktop-amd64.iso quiet splash –
initrd (iso)/casper/initrd.lz
}
menuentry "Install Ubuntu (32-bit)" {
loopback iso /boot/iso/ubuntu-12.04.4-desktop-i386.iso
linux (iso)/casper/vmlinuz file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity iso-scan/filename=/boot/iso/ubuntu-12.04.4-desktop-i386.iso quiet splash –
initrd (iso)/casper/initrd.lz
}
menuentry "Install Ubuntu (64-bit)" {
loopback iso /boot/iso/ubuntu-12.04.4-desktop-amd64.iso
linux (iso)/casper/vmlinuz.efi file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity iso-scan/filename=/boot/iso/ubuntu-12.04.4-desktop-amd64.iso quiet splash –
initrd (iso)/casper/initrd.lz
}
menuentry "Check disc for defects (32-bit)" {
loopback iso /boot/iso/ubuntu-12.04.4-desktop-i386.iso
linux (iso)/casper/vmlinuz boot=casper integrity-check iso-scan/filename=/boot/iso/ubuntu-12.04.4-desktop-i386.iso quiet splash –
initrd (iso)/casper/initrd.lz
}
menuentry "Check disc for defects (64-bit)" {
loopback iso /boot/iso/ubuntu-12.04.4-desktop-amd64.iso
linux (iso)/casper/vmlinuz.efi boot=casper integrity-check iso-scan/filename=/boot/iso/ubuntu-12.04.4-desktop-amd64.iso quiet splash –
initrd (iso)/casper/initrd.lz
}
menuentry "Test memory" {
loopback iso /boot/iso/ubuntu-12.04.4-desktop-i386.iso
linux16 (iso)/install/mt86plus
}

  1. iso 이미지를 생성합니다. (xorriso를 install 해야 할수도 있습니다.)
    (저는 xorriso를 설치해야 했지만, https://apps.ubuntu.com/cat/applications/xorriso/ 의 하단에 "Download Ubuntu" 버튼을 누르니 알아서 설치 창까지 뜹니다. "확인"만 해주시면 되요)

$ sudo grub-mkrescue --output ubuntu-12.04.4-desktop-i386-amd64.iso /ubuntu-12.04-desktop-i386-amd64

  1. iso 이미지가 생성되었습니다. 32-bit or 64-bit 모두 선택이 가능합니다.
    용량은 15,000,804kb (win8.1 기준) 입니다.

PS :
iso 이미지를 생성하고 나면 /boot/iso/ 경로에 ubuntu_0.iso 등으로 파일명이 지정될수도 있습니다.
그럴때는 쿨하게 UltraISO Portable 등으로 파일명을 수정해주시면 됩니다.

PS 2 :
이제… 사용방법을 알아봐야겠습니다. - _ -;;
통합방법이 적혀 있는 링크 (상단참조) 에는 동작 스크린샷까지 확인이 되어 있는데요.
DVD 가 아닌, YUMI 로 MultiBooting USB 를 만들다 보면,
"YUMI couldn’t find a configuration file. 블라블라…" 등의 메세지가 출력되며 오류를 뱉어 냅니다.
DVD 용 package 를 USB 용으로 어떻게 바꿔야 하는지. 연구를 좀 해봐야 겠네요…

grub 내부 명령중에 cpuid 명령이 있습니다.
이를 사용하면, cpu가 비트수에 따라 따로 처리할 수 있습니다.
또 12.04는 상관없지만, 최근 버전의 우분투의 경우, 커널파일명이 vmlinuz에서 vmlinuz.efi로 바뀌었습니다.

[code:14g4fh3s]
set ver="12.04.4"
if cpuid -l; then
set arch=amd64
set bits=64
else
set arch=i386
set bits=32
fi
isofile=/boot/iso/ubuntu-${ver}-${arch}.iso

menuentry "Try Ubuntu without installing (${bits}-bit)" {
loopback lo /boot/iso/ubuntu-${ver}-desktop-${arch}.iso
if [ -f (lo)/casper/vmlinuz.efi ]; then
set kernel=(lo)/casper/vmlinuz.efi
else
set kernel=(lo)/casper/vmlinuz
fi
linux ${kernel} file=/cdrom/preseed/ubuntu.seed boot=casper iso-scan/filename=${isofile} quiet splash –
initrd (lo)/casper/initrd.lz
}
[/code:14g4fh3s]

GRUB만 잘 쪼물딱거려도 할 수 있는게 정말 많습니다.

참고하시라고, 아래 소스를 올려봅니다.
이것은 자동으로, /ubuntu-cd를 검색해서, ISO목록을 서브메뉴로 보여주고, 최신 버전의 iso이미지를 디폴트로 선택해줍니다.
또한 /boot-images를 검색해, ISO목록을 서브메뉴로 보여줍니다. 여기 들어가는 ISO파일은 grub4dos를 사용해서 부팅하기에,
리눅스 부팅이미지가 아닌, ghost나 trueimage등의 부팅이미지로도 부팅이 가능합니다.
그리고, 하드디스크의 boot 파티션을 검색해서, 최신의 커널로 자동부팅할 수 있게 해줍니다.

저는 이런식으로, USB를 만들어 놓고, 그안에 각종 ISO이미지를 넣어놓아 복구용 USB로 사용합니다.
AcronisTrueImage.iso
Ghost.15.iso
Hirens.BootCD.iso
MiniTool.PartionWizard.HomeEdition.BootCD.iso
NTBOOT.iso
SystemRescueCD.iso
WIN7.UserPE.2.iso
snoopy.Ghost.iso
win7pe.iso
win8re.iso
이런 이미지들을 사용합니다. ^^

[code:ifjxsdcx]
####################################################################

Define Variables

####################################################################
set bootopts="boot=casper locale=ko_KR.utf8 file=/cdrom/preseed/ubuntu.seed quiet splash noprompt noeject –"
set instopts="locale=ko_KR only-ubiquity"
set ramdopts="toram root=/dev/shm"

set iso_dir=/boot-images
set ubuntu_iso_dir=/ubuntu-cd
set grub4dos_dir=/grub4dos

####################################################################

Initialize

####################################################################
function pause {
echo $*
read
}

insmod normal
insmod regexp

set pager=1
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray

set arch=i386
set use_amd64=
if cpuid -l; then
set arch=amd64
set use_amd64=amd64
fi
export arch

function searchex {
search $*
clear
}

function load_gfx {
insmod all_video

set gfxmode="auto"
set gfxplayload="keep"
loadfont $prefix/fonts/unicode.pf2
terminal_output gfxterm

}

#load_gfx

function load_fs_driver {
insmod extcmd
insmod part_msdos
insmod ext2
insmod fat
insmod ntfs
insmod loopback
}

export ubuntu_iso_dir
export grub4dos_dir
export iso_dir

function detect_ubuntu_iso_dev {
insmod regexp

set ubuntu_iso_dev=
if [ -n "${ubuntu_iso_dir}" ]; then
	for dev in (*,*); do
		if [ -d "${dev}${ubuntu_iso_dir}" ]; then
			set ubuntu_iso_dev=$dev
			export ubuntu_iso_dev
			return 0
		fi
	done
fi

set ubuntu_iso_dir=
export ubuntu_iso_dir
export ubuntu_iso_dev

return 1

}

function select_ubuntu_iso {
insmod regexp
#loopback -d tmp_iso
#loopback tmp_iso "$1"
set ubuntu_iso_selected=""
set selected_ubuntu_iso_tag=""
if [ -n "$1" ]; then
set ubuntu_iso_selected="$1"
regexp -s x "^./([^/])$" "$1"
if [ -n "$x" ]; then
set selected_ubuntu_iso_tag=" (${x})"
fi
fi
export ubuntu_iso_selected
export selected_ubuntu_iso_tag
export ubuntu_iso_dev

configfile "${rescue_cfg}"

}

function is_e2fs {
insmod regexp
insmod functional_test

if regexp "," $1; then
	probe -s fs -f $1
	if  [ "$fs" = "btrfs" ]; then
		return 0
	elif regexp "^ext" $fs; then
		return 0
	fi
fi
return 1

}

function cmp_ver {
insmod regexp

regexp -s v1 "([0-9][0-9\.-]+[0-9])" "$1"
regexp -s v2 "([0-9][0-9\.-]+[0-9])" "$2"

if [ -z "$v1" -a -z "$v2" ]; then
	set ret=100
	export ret
	return
elif [ -z "$v1" ]; then
	set ret=102
	export ret
	return
elif [ -z "$v2" ]; then
	set ret=101
	export ret
	return
fi

set s1=$v1
set s2=$v2
set ret=101

while true; do
	set v1=
	set v2=
	regexp -s v1 "([0-9]+)" "$s1"
	regexp -s v2 "([0-9]+)" "$s2"

	if [ -z "$v1" -a -z "$v2" ]; then
		set ret=1
		break
	elif [ -z "$v1" ]; then
		set ret=0
		break
	elif [ -z "$v2" ]; then
		set ret=2
		break
	elif [ $v1 -eq $v2 ]; then
		continue	
	elif [ $v1 -gt $v2]; then
		set ret=2
		break
	else
		set ret=0
		break
	fi

	regexp -s s1 "[0-9]+[^0-9]*([0-9].*)" "$s1"
	regexp -s s2 "[0-9]+[^0-9]*([0-9].*)" "$s2"
done

if [ -z "$ret"]; then
	set ret=1
fi
export ret

}

function find_proper_file {
set udir="$1"
set pat_prefix="$2"
set pat_suffix="$3"
if [ -z "$udir" ]; then
set udir=${ubuntu_iso_dir}
fi
#set udir=/${udir#/}

set tmp_var=

insmod regexp
insmod functional_test

for f in ${udir}/${pat_prefix}*${pat_suffix}; do
	if [ ! -f "$f" ]; then
		set ret=
		export ret
		return
	fi
	cmp_ver $tmp_var $f
	if [ ${ret} -ge 100 ]; then
		continue
	elif [ ${ret} -lt 1 ]; then
		set tmp_var="$f"
		continue
	fi
done
if [ -z "$tmp_var" ]; then
	set tmp_var="$f"
fi
set ret="$tmp_var"
export ret

}

function detect_linux_dev {
set linux_root_dev=
set linux_boot_dev=
set linux_boot_dir=
insmod regexp
insmod functional_test

for d in (*,*); do
	if is_e2fs "$d"; then
		if [ -z "$linux_root_dev" -a -f "${d}/sbin/init" ]; then
			set linux_root_dev="$d"
			export linux_root_dev
		fi

		if [ -z "$linux_boot_dev" ]; then
			if [ -f "${d}/grub/grub.cfg" ]; then
				set linux_boot_dev="$d"
				set linux_boot_dir=
				export linux_boot_dev
				export linux_boot_dir
			elif [ -f "${d}/boot/grub/grub.cfg" ]; then
				set linux_boot_dev="$f"
				set linux_boot_dir=/boot
				export linux_boot_dev
				export linux_boot_dir
			fi
		fi
		if [ -n "$linux_boot_dev" -a -n "$linux_root_dev" ]; then
			return 0
		fi
	fi
done
if [ -z "$linux_boot_dev" -a -z "$linux_root_dev" ]; then
	return 1
else
	return 0
fi

}

function detect_ubuntu_iso {
insmod regexp
set success=0
set ubuntu_loop=

set udir="$1"
if [ -z "$udir" ]; then
	set udir=${ubuntu_iso_dir}
fi
#set udir=/${udir#/}
regexp -s dev "^(\([^\)]*\)).*\$" "$udir"
if [ -z "$dev" ]; then
	if detect_ubuntu_iso_dev; then
		if [ -z "${ubuntu_iso_dev}" ]; then
			return 1
		else
			set udir="${ubuntu_iso_dev}${udir}"
		fi
	fi
fi

for dist in ubuntu kbuntu lubuntu xubuntu; do 
	for xarch in ${arch} ${use_amd64} i386; do
		for type in desktop server; do
			#if searchex -s ubuntu_loop -f "${udir}/${dist}-${ret}-${type}-${arch}.iso"; then
			find_proper_file "${udir}" "${dist}-" "-${type}-${xarch}.iso"

			if [ -n "$ret" ]; then
				#set ubuntu_loop="${udir}/${dist}-${ret}-${type}-${xarch}.iso"
				set ubuntu_loop="$ret"
				set success=1
				break 3
			fi
		done
	done
done
if [ -z "$ubuntu_loop" ]; then
	searchex -s ubuntu_loop -f "${udir}/ubuntu.iso"
fi
export ubuntu_loop

}

function search_grub4dos {
searchex -s grub4dos_dev -f ${grub4dos_dir}/grub.exe
export grub4dos_dev
}

function boot_legacy_iso {
set iso_file="$1"
set iso_dir2="$2"
if [ -z "$2" ]; then
set iso_dir2="${iso_dir}"
fi
search_grub4dos
set boot_legacy_cmd="find --set-root ${iso_dir2}/${iso_file}; map ${iso_dir2}/${iso_file} (0xff); map --hook; chainloader (0xff)"
linux16 ($grub4dos_dev)${grub4dos_dir}/grub.exe --config-file=""find --set-root ${iso_dir2}/${iso_file}; map ${iso_dir2}/${iso_file} (0xff); map --hook; chainloader (0xff)""
}

function ubuntu_auto_select {
insmod regexp
if [ -z "${ubuntu_iso_selected}" ]; then
if [ -z "${ubuntu_iso_dev}" ]; then
detect_ubuntu_iso_dev
fi

	detect_ubuntu_iso ${ubuntu_iso_dev}${ubuntu_iso_dir}
	set ubuntu_iso_selected=${ubuntu_loop}
else
	set ubuntu_loop=${ubuntu_iso_selected}
fi

if [ -n "${ubuntu_loop}" ]; then
	regexp -s ubuntu_iso "^[^/]*(/.*)\$" ${ubuntu_loop}
	regexp -s x "^.*/([^/]*)\$" "${ubuntu_loop}"
	if [ -n "$x" ]; then
		set selected_ubuntu_iso_tag=" (${x})"
	fi

fi
export ubuntu_iso

}

function ubuntu_iso_automount {
ubuntu_auto_select
loopback lo ${ubuntu_loop}
}

set ubuntu_iso_menu="Select Ubuntu ISO"
if [ -z "${ubuntu_iso_selected}" ]; then
ubuntu_auto_select
if [ -z "$ubuntu_iso_dev" ]; then
set ubuntu_iso_menu="----------- No Ubuntu ISO directory found! ----------"
else
set ubuntu_iso_menu="Select Ubuntu ISO"
fi
fi

####################################################################

Boot menu configuration

####################################################################

separator use like this

menuentry " " --source="set ret=;"

#================================================

Ubuntu ISO selection

just select ubuntu iso for booting

#================================================
submenu "${ubuntu_iso_menu}${selected_ubuntu_iso_tag}" {
load_fs_driver
insmod regexp
insmod functional_test

detect_ubuntu_iso_dev

if [ -n "$ubuntu_iso_dev" ]; then
	menuentry "Cancel selected" --source="select_ubuntu_iso"
	for img in ${ubuntu_iso_dev}${ubuntu_iso_dir}/ubuntu*.iso;
	do
		regexp -s img_name "^.*/([^/]*)\$" $img
		menuentry "$img_name" --source="select_ubuntu_iso $img"
	done
fi

}

#================================================

Ubuntu ISO booting

#================================================
set menu_title=‘Ubuntu Live (Auto Detect)’
if [ -z "${ubuntu_iso_dir}" ]; then menu_title=‘’; fi
menuentry "${menu_title}" {
if [ -n "${ubuntu_iso_dir}" ]; then
load_fs_driver
ubuntu_iso_automount

	if [ -n "${ubuntu_iso}" ]; then
		if [ -f (lo)/casper/vmlinuz.efi ]; then
			linux (lo)/casper/vmlinuz.efi persistent iso-scan/filename="${ubuntu_iso}" $bootopts
		else
			linux (lo)/casper/vmlinuz persistent iso-scan/filename="${ubuntu_iso}" $bootopts
		fi
		initrd (lo)/casper/initrd.lz
	else
		echo "Error: file not found ($ubuntu_iso)!"
	fi
fi

}

set menu_title=‘Try Ubuntu without Install (RAMDISK/Auto Detect)’
if [ -z "${ubuntu_iso_dir}" ]; then menu_title=‘’; fi
menuentry "${menu_title}" {
if [ -n "${ubuntu_iso_dir}" ]; then
load_fs_driver
ubuntu_iso_automount

	if [ -n "${ubuntu_iso}" ]; then
		if [ -f (lo)/casper/vmlinuz.efi ]; then
			linux (lo)/casper/vmlinuz.efi iso-scan/filename="${ubuntu_iso}" $ramdopts $bootopts
		else
			linux (lo)/casper/vmlinuz iso-scan/filename="${ubuntu_iso}" $ramdopts $bootopts
		fi
		initrd (lo)/casper/initrd.lz
	else
		echo "Error: file not found ($ubuntu_iso)!"
	fi
fi

}

set menu_title=‘Try Ubuntu without Install (Auto Detect)’
if [ -z "${ubuntu_iso_dir}" ]; then menu_title=‘’; fi
menuentry "${menu_title}" {
if [ -n "${ubuntu_iso_dir}" ]; then
load_fs_driver
ubuntu_iso_automount

	if [ -n "${ubuntu_iso}" ]; then
		if [ -f (lo)/casper/vmlinuz.efi ]; then
			linux (lo)/casper/vmlinuz.efi iso-scan/filename="${ubuntu_iso}" $bootopts
		else
			linux (lo)/casper/vmlinuz iso-scan/filename="${ubuntu_iso}" $bootopts
		fi
		initrd (lo)/casper/initrd.lz
	else
		echo "Error: file not found ($ubuntu_iso)!"
	fi
fi

}

set menu_title=‘Install Ubuntu (RAMDISK/Auto Detect)’
if [ -z "${ubuntu_iso_dir}" ]; then menu_title=‘’; fi
menuentry "${menu_title}" {
if [ -n "${ubuntu_iso_dir}" ]; then
load_fs_driver
ubuntu_iso_automount

	if [ -n "${ubuntu_iso}" ]; then
		if [ -f (lo)/casper/vmlinuz.efi ]; then
			linux (lo)/casper/vmlinuz.efi iso-scan/filename="${ubuntu_iso}" $instopts $ramdopts $bootopts
		else
			linux (lo)/casper/vmlinuz iso-scan/filename="${ubuntu_iso}" $instopts $ramdopts $bootopts
		fi
		initrd (lo)/casper/initrd.lz
	else
		echo "Error: file not found ($ubuntu_iso)!"
	fi
fi

}

set menu_title=‘Install Ubuntu (Auto Detect)’
if [ -z "${ubuntu_iso_dir}" ]; then menu_title=‘’; fi
menuentry "${menu_title}" {
if [ -n "${ubuntu_iso_dir}" ]; then
load_fs_driver
ubuntu_iso_automount

	if [ -n "${ubuntu_iso}" ]; then
		if [ -f (lo)/casper/vmlinuz.efi ]; then
			linux (lo)/casper/vmlinuz.efi iso-scan/filename="${ubuntu_iso}" $instopts $bootopts
		else
			linux (lo)/casper/vmlinuz iso-scan/filename="${ubuntu_iso}" $instopts $bootopts
		fi
		initrd (lo)/casper/initrd.lz
	else
		echo "Error: file not found ($ubuntu_iso)!"
	fi
fi

}

#================================================

Custom ISO booting

#================================================
#menuentry ‘System rescue CD’ {

load_fs_driver

searchex -s -f /boot-images/SystemRescueCD.iso

loopback lo /boot-images/SystemRescueCD.iso

linux (lo)/isolinux/rescuecd isoloop="/boot-images/SystemRescueCD.iso"

initrd (lo)/isolinux/initram.igz

#}

#menuentry ‘Snoopy Ghost’ {

boot_legacy_iso ‘snoopy.ghost.iso’

#}

#================================================

compose menuentry from list of ISO in $iso_dir

if select then Boot from ISO in $iso_dir

#================================================
set boot_iso_menu="Boot from ISO"
if [ -z "${iso_dir}" -o ! -d "(hd0,1)${iso_dir}" ]; then
set boot_iso_menu="----------- No ISO directory found! ----------"
set iso_dir=
export boot_iso_menu
export iso_dir
fi
submenu "${boot_iso_menu}" {
load_fs_driver
insmod regexp
insmod functional_test
insmod normal

export iso_dir

if [ -n "${iso_dir}" ]; then
	if [ -d "(hd0,1)${iso_dir}" ]; then
		for img in (hd0,1)${iso_dir}/*.iso;
		do
			regexp -s img_name "^.*/([^/]*)\$" $img
			menuentry "$img_name" --source="boot_legacy_iso $img_name"
		done
	fi
fi

}

#================================================

Auto-Detecting OS

#================================================
menuentry "Linux (Auto-detect)" {
load_fs_driver
insmod regexp
insmod functional_test
insmod normal
insmod probe

detect_linux_dev

if [ -n "$linux_root_dev" -a -n "$linux_boot_dev" ]; then
	#for f in ($grub_bootdev)/vmlinuz* ($grub_bootdev)/boot/vmlinuz*; do set kernel=$f; break; done
	#for f in ($grub_bootdev)/initrd* ($grub_bootdev)/boot/initrd*; do set initrd=$f; break; done

	#xxxxxxxxxx
	find_proper_file ${linux_boot_dev}${linux_boot_dir} System.map-
	if [ -n "$ret" ]; then
		regexp -s ret ".*/System.map-([^/]+)\$" $ret
	fi

	set root=${linux_boot_dev}
	set kernel=${linux_boot_dev}${linux_boot_dir}/vmlinuz-${ret}
	set initrd=${linux_boot_dev}${linux_boot_dir}/initrd.img-${ret}

	probe -s rootuuid $linux_root_dev -u
	linux $kernel root=UUID=$rootuuid quiet splash
	initrd $initrd
else
	echo "Error: linux partition is not found!"
fi

}

menuentry "Windows XP/2k NTLDR (Auto-detect)" {
load_fs_driver
insmod ntldr

#search -s grub4dos_dev -f /grub4dos/grub.exe
#linux16 ($grub4dos_dev)/grub4dos/grub.exe --config-file=""map () (hd0)\; map (hd0) ()\; map --hook\; find --ignore-floppies --ignore-cd --set-root /ntldr\; chainloader /ntldr""

if searchex -s -f /ntldr; then
	ntldr /ntldr
else
	echo "Error: windows NT boot loader not found!"
fi

}

menuentry "Windows 7/8/Vista BootMgr (Auto-detect)" {
load_fs_driver
insmod ntldr

if searchex -s -f /bootmgr; then
	ntldr /bootmgr
else
	echo "Error: windows Boot manager not found!"
fi

}

menuentry "DOS (Auto-detect)" {
load_fs_driver

#searchex -s grub4dos_dev -f /grub4dos/grub.exe
#linux16 ($grub4dos_dev)/grub4dos/grub.exe --config-file=""map () (hd0)\; map (hd0) ()\; map --hook\; find --ignore-floppies --ignore-cd --set-root /ntldr\; chainloader /ntldr""

set dossys=
if [ search -f /io.sys ]; then
	set dossys=/io.sys
elif [ search -f /kernel.sys ]; then
	set dossys=/kernel.sys
fi

if [ -n "$dossys" ]; then
	linux16 (${grub4dos_dev}${grub4dos_dir})/grub.exe --configfile="find --set-root ${dossys};chainloader ${dossys}"


	set root=(${dossys})
	chainloader ${dossys}
else
	echo "Error: DOS system not found!"
fi

}

#================================================

Change boot loader to Grub4DOS

#================================================
menuentry ‘Chainload GRUB4DOS’ {
load_fs_driver

search_grub4dos
if [ -n "$grub4dos_dev" ]; then
	set root=(${grub4dos_dev})
	linux16 ${grub4dos_dir}/grub.exe --config-file=""find --set-root /menu.lst --ignore-floppies --ignore-cd\; configfile /menu.lst""
fi

}

[/code:ifjxsdcx]

뜨허억…

Shell Script 기능 분석하는 시간도 제법 걸리겠네요;;

대단하십니다- +_+