|
|

楼主 |
发表于 2008-7-12 09:38:45
|
显示全部楼层
嗯,看了一下代码,实现思路跟版主提供文档里的差不多。
这个脚本的局限性是必须使用Win机器制作这个LiveUSB盘。
而版主提供的那个是使用Linux制作的。^_^。
- E:\GentooUSB>type fixgt2.bat
- @echo off
- rem This batch file was created by Lance 2007 http://pendrivelinux.com
- rem Edited 19/09/2007 for Gentoo Linux by Brendan Jocson http://metacrome.com
- rem 7-Zip 1999-2007 Igor Pavlovis http://7-zip.org
- rem Syslinux 1994-2006 H. Peter Anvin http://syslinux.zytor.com
- cls
- echo.
- echo ==============================================================
- echo This file will prepare your Gentoo ISO for USB boot!
- echo ==============================================================
- echo.
- echo.
- echo Warning: Only run this file from the directory containing
- echo the Gentoo ISO and no other ISO files
- echo.
- echo This batch file is offered in hopes that it will be useful and
- echo comes with absolutely no warranty. USE AT YOUR OWN RISK!
- echo.
- echo.
- :start
- echo.
- echo Please enter your flash drive letter (D,E,F,G,H,I,J,K) and press Enter
- set /p drive=
- if %drive% == D goto proceed
- if %drive% == E goto proceed
- if %drive% == F goto proceed
- if %drive% == G goto proceed
- if %drive% == H goto proceed
- if %drive% == I goto proceed
- if %drive% == J goto proceed
- if %drive% == K goto proceed
- if %drive% == d goto proceed
- if %drive% == e goto proceed
- if %drive% == f goto proceed
- if %drive% == g goto proceed
- if %drive% == h goto proceed
- if %drive% == i goto proceed
- if %drive% == j goto proceed
- if %drive% == k goto proceed
- cls
- goto error
- :error
- echo.
- echo The drive letter you entered was not recognized
- echo.
- pause
- cls
- goto start
- :proceed
- cls
- echo.
- echo Would you like to format flash drive %drive%:?
- echo.
- echo Type y or n and press Enter
- set /p ok=
- if %ok% == y goto yes
- if %ok% == Y goto yes
- if %ok% == n goto no
- if %ok% == N goto no
- cls
- :yes
- cls
- echo Pre-Stage Format:
- echo First, let's ensure that the flash drive is inserted
- echo.
- format %drive%: /FS:fat32 /V:Gentoo /Q
- cls
- goto no
- :no
- cls
- echo Stage 1:
- 7-Zip\7z x *.iso -x![BOOT] -o%drive%:
- cls
- echo Stage 2:
- echo Please wait while we prepare the files and copy them to your flash drive...
- echo.
- mkdir %drive%:\syslinux\win32
- copy syslinux\win32\*.* %drive%:\syslinux\win32
- copy makeboot.bat %drive%:
- %drive%:
- copy isolinux *.*
- rmdir isolinux /s/q
- ren isolinux.cfg syslinux.cfg
- del isolinux.bin
- call %drive%:\makeboot.bat
复制代码 |
|