⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 build_tgrub.sh

📁 一个可以引导多个操作系统的启动程序
💻 SH
字号:
#!/bin/bashTRUSTEDGRUB_VERSION="TrustedGRUB-1.1.3"TRUSTEDGRUB_ARCHIVE="$TRUSTEDGRUB_VERSION".tgzVERBOSE=" /dev/null"BUILD=1export CCconfigure_tgrub(){echo "- Deflating TrustedGRUB"if test -d $TRUSTEDGRUB_VERSION; then    echo "TrustedGRUB directory already exists!"    echo "Please remove first (as root):"    echo "	rm -rf $TRUSTEDGRUB_VERSION"    exit -1fiif test -f ./$TRUSTEDGRUB_ARCHIVE; then    tar -xpzf $TRUSTEDGRUB_ARCHIVE    if [ $? != 0 ]; then exit 1; fielse    echo "TrustedGRUB sources not present"    exit -1fiecho "- Configuring TrustedGRUB"if [[ $(which aclocal) = "" ]] ; then    echo "Need automake and autoconf"    exit -1else    cd $TRUSTEDGRUB_VERSION    aclocal >& $VERBOSE    if [ $? != 0 ]; then exit 501; fi    autoconf >& $VERBOSE    if [ $? != 0 ]; then exit 502; fi    automake >& $VERBOSE    if [ $? != 0 ]; then exit 503; fi    if [[ $SHOWSHA1 ]] ; then    	./configure CFLAGS="-DSHOW_SHA1" >& $VERBOSE    else	./configure >& $VERBOSE    fi    if [ $? != 0 ]; then exit 504; fifi}built_tgrub(){echo "- Compiling TrustedGRUB"gcc util/create_sha1.c -o util/create_sha1if [ $? != 0 ]; then exit 601; figcc util/verify_pcr.c -o util/verify_pcrif [ $? != 0 ]; then exit 602; fimake >& $VERBOSE if [ $? != 0 ]; then exit 603; fichmod g+w * -Rif [ $? != 0 ]; then exit 604; fichmod a+x util/grub-installif [ $? != 0 ]; then exit 605; fiif [[ $SRC == "src" ]] ; then    echo "- done"else    echo "- done"    echo     echo "Please do"    echo "	'cp default /boot/grub'"    echo "	'cd $TRUSTEDGRUB_VERSION'"    echo "	'make install'"    echo    echo "To install TrustedGRUB to your local harddisc do:"    echo    echo "	'rm -rf /boot/grub/stage*'"    echo "	'rm -rf /boot/grub/*1_5'"    echo "	'cp default /boot/grub'"    echo "	'cd $TRUSTEDGRUB_VERSION'"    echo "	'cp stage1/stage1 /boot/grub'"    echo "	'cp stage2/stage2 /boot/grub'"    echo "	'./grub/grub --no-floppy'"    echo "Then enter:"    echo "	root (hdX,Y)"    echo "	setup (hdX)"    echo "	quit"    echo    echo "or alternatively"    echo "	'rm -rf /boot/grub/stage*'"    echo "	'rm -rf /boot/grub/*1_5'"    echo "	'./$TRUSTEDGRUB_VERSION/util/grub-install /dev/XXX --no-floppy'"    echo fi}until [ -z "$1" ]; do    case $1 in"-h" | "--help")    echo "Script to build TrustedGRUB."    echo "The following options are possible:"    echo ""    echo "-f | --force   : force deleting of existing GRUB-directory"    echo "-h | --help    : show this help"    echo "-v | --verbose : compile with verbose output"    echo "-n | --nobuild : extract and patch, but do not compile"    echo "-s | --showsha1: compile TrustedGRUB with \"-DSHOW_SHA1\""    exit 0;;"-f" | "--force")    shift;    DELETE=1;;"-s" | "--showsha1")    shift;    SHOWSHA1=1;;"-v" | "--verbose")    shift;    echo "Enabling verbose output"    VERBOSE=" /dev/stdout";;"-n" | "--nobuild")    shift;    BUILD=0;;*)    shift;;;    esac    doneif [[ $DELETE ]] ; then    echo "Deleting old TrustedGRUB directory"    rm -rf $TRUSTEDGRUB_VERSIONficonfigure_tgrubif [[ "$BUILD" == "1" ]] ; then    built_tgrubfi

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -