1、下載ubuntu:
因為grub4dos需要在gcc4.8下面編譯,ubuntu14.04里面apt在線安裝默認就是gcc4.8,所以在清華大學開源軟件站https://mirrors.tuna.tsinghua.edu.cn/
輸入ubuntu,進入ubuntu-releases,選擇14.04:https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/14.04/
ubuntu-14.04.6-desktop-amd64.iso
2、這里從零開始,以liveCD為例,livecd一鍵安裝:https://liuzhaoyzz.lanzoui.com/b00nlwy1c
如果關機不斷電,grub4dos/grub2啟動菜單,kernel那一句最后加上acpi=force pci=nomsi參數。
3、修改root密碼為root,切換到root:
點左上角第一個圓環形圖標,輸入terminal(可以拖動到左側收藏欄),進入bash:
ubuntu@ubuntu:~$ sudo passwd root
Enter new UNIX password: root
Retype new UNIX password: root
passwd: password updated successfully
ubuntu@ubuntu:~$ su
Password: root
4、ubuntu調整到中文界面,修正ibus中文全拼輸入法,方便輸入中文,方便網上搜索知識:
右上角system settings,language support,
把漢語拖動到第一個,然后點Apply System-Wide,鍵盤輸入方式選擇ibus。
Regional Formats,選擇漢語,然后Apply System-Wide。
如果彈出錯誤thunderbird-locale-en: Depends: thunderbird (>= 1:24.4.0+build1-0ubuntu1),就更新下源: sudo apt-get update
點右上角齒輪,Log Out,輸入前面設置的root密碼,注銷之后就可以顯示中文了。
ibus中文輸入法全拼有點小問題,如果在拼音----首選項里面,設置全拼之后,必須在bash里面運行下sudo ibus restart重啟下輸入法才能確保ibus全拼生效。
要想ibus輸入法生效,設置--系統設置--語言支持--鍵盤輸入方式應該選擇ibus。
5、gcc及其依賴包,根據chenall的提示:
根據caocaofff的辦法https://pecmd.net/thread-133.htm,更換軟件源為國內的,否則可能無法安裝upx-ucl和p7zip-full,這兩個軟件包grub4dos打包需要用:
#!/bin/bash
cp /etc/apt/sources.list /etc/apt/sources.list.bak
echo "deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse" > /etc/apt/sources.list
echo "deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse" >> /etc/apt/sources.list
echo "deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse" >> /etc/apt/sources.list
apt-get update
sudo apt-get install -y gcc-4.8 gcc-4.8-multilib nasm upx upx-ucl p7zip-full texinfo autoconf automake make patch binutils-dev liblzma-dev gawk
如果不知道軟件包名字,用sudo apt-cache search gcc這樣子的命令進行模糊查詢。
6、下載grub4dos BIOS和UEFI版本:
根據wintoflash的提示,建議用git下載:
grub4dos-BIOS版本:git clone --depth=1 https://github.com/chenall/grub4dos.git
grub4dos-UEFI版本:git clone https://github.com/chenall/grub4dos -b efi
不推薦在widnows下面下載解壓縮,可能會有權限問題:
http://grub4dos.chenall.net/categories/0-4-6a/
http://grub4dos.chenall.net/categories/for-UEFI/,
下載源代碼,解壓縮,放在NTFS分區好像有權限問題,建議放到ext4分區。
7、切換到grub4dos源代碼所在的目錄,開始編譯:
root@ubuntu:~# cd /media/root/SSD1/grub4dos-20210602source
看下ubuntu版本號:sudo lsb_release -a
root@ubuntu:/media/root/SSD1/grub4dos-20210602source# sudo lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.6 LTS
Release: 14.04
Codename: trusty
看下gcc版本:gcc -v,4.8.4的。
root@ubuntu:/media/root/SSD1/grub4dos-20210602source# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.8/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.8.4-2ubuntu1~14.04.4' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libmudflap --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.4)
開始編譯了:
root@ubuntu:/media/root/SSD1/grub4dos-20210602source# ./configure
bash: ./configure: 權限不夠
權限不夠,試了chmod +x ./configure無效,chmod -R 777 ./無效,直接用bash ./configure吧:
root@ubuntu:/media/root/SSD1/grub4dos-20210602source# bash ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/media/root/SSD1/grub4dos-20210602source':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
出錯了。
執行uname -m看了下名字是:x86_64
root@ubuntu:/media/root/SSD1/grub4dos-20210602source# uname -m
x86_64
加上--host=x86-64編譯試試看:
root@ubuntu:/media/root/SSD1/grub4dos-20210602source# bash ./configure --host=x86-64
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for x86-64-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for style of include used by make... GNU
checking for x86-64-gcc... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking dependency style of gcc... gcc3
checking build system type... x86_64-unknown-linux-gnu
checking host system type... Invalid configuration `x86-64': system `64' not recognized
configure: error: /bin/sh ./config.sub x86-64 failed
這個錯誤信息該怎么解決?
看了下config.log,有幾個錯誤:
configure:3212: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3223: $? = 4
configure:3212: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.
上面的錯誤好像不影響什么。
configure:4016: checking build system type
configure:4030: result: x86_64-unknown-linux-gnu
configure:4050: checking host system type
configure:4059: error: /bin/sh ./config.sub x86-64 failed
上面的錯誤可能有點問題。./config.sub有讀寫權限問題?
wintoflash指點說:源碼不能放在ntfs/fat等不支持POSIX權限的分區上。
(1)我格式化了一個分區格式為ext4,把源代碼放在里面開始編譯grub4dos_BIOS:
root@ubuntu:/media/root/yule/grub4dos-for_UEFI-2021-06-02source# cd /media/root/yule/grub4dos-20210602source
root@ubuntu:/media/root/yule/grub4dos-20210602source#
root@ubuntu:/media/root/yule/grub4dos-20210602source# bash ./build
./build: 行 77: ./configure: 權限不夠
root@ubuntu:/media/root/yule/grub4dos-20210602source# chmod -R 777 ./
root@ubuntu:/media/root/yule/grub4dos-20210602source# bash ./build
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking dependency style of gcc... gcc3
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking whether to enable maintainer-specific portions of Makefiles... no
checking for gcc... (cached) gcc
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking dependency style of gcc... (cached) gcc3
checking for ranlib... ranlib
checking whether optimization for size works... yes
checking whether gcc has -fno-stack-protector... yes
checking whether gcc has -fno-reorder-functions... yes
checking whether -Wundef works... yes
checking whether -falign-loops works... yes
checking whether linker accepts `--build-id=none'... yes
checking for objcopy... objcopy
checking if C symbols get an underscore after compilation... no
checking whether objcopy works for absolute addresses... yes
checking whether addr32 must be in the same line as the instruction... yes
checking for .code16 addr32 assembler support... yes
checking whether an absolute indirect call/jump must not be prefixed with an asterisk... no
checking if start is defined by the compiler... no
checking if _start is defined by the compiler... yes
checking if __bss_start is defined by the compiler... yes
checking if _edata is defined by the compiler... yes
checking if edata is defined by the compiler... yes
checking if end is defined by the compiler... yes
checking if _end is defined by the compiler... yes
checking for opendisk in -lutil... no
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating stage2/Makefile
config.status: creating config.h
config.status: executing depfiles commands
Making clean in stage2
make[1]: 正在進入目錄 `/tmp/grub4dos-temp/stage2'
test -z "grub.exe badgrub.exe grldr grldr.mbr bootlace.com hmload.com eltorito.sys pre_stage2 dosstart badgrubstart grldrstart mbrstart bootlacestart hmloadstart pre_stage2_fullsize pre_stage2_head pre_stage2_tail " || rm -f grub.exe badgrub.exe grldr grldr.mbr bootlace.com hmload.com eltorito.sys pre_stage2 dosstart badgrubstart grldrstart mbrstart bootlacestart hmloadstart pre_stage2_fullsize pre_stage2_head pre_stage2_tail
test -z "pre_stage2.exec dosstart.exec badgrubstart.exec grldrstart.exec mbrstart.exec bootlacestart.exec hmloadstart.exec" || rm -f pre_stage2.exec dosstart.exec badgrubstart.exec grldrstart.exec mbrstart.exec bootlacestart.exec hmloadstart.exec
rm -f *.o
test -z "pre_stage2.exec dosstart.exec badgrubstart.exec grldrstart.exec mbrstart.exec bootlacestart.exec hmloadstart.exec" || rm -f pre_stage2.exec dosstart.exec badgrubstart.exec grldrstart.exec mbrstart.exec bootlacestart.exec hmloadstart.exec
test -z "" || rm -f
test -z "" || rm -f
test -z "test-suite.log" || rm -f test-suite.log
make[1]:正在離開目錄 `/tmp/grub4dos-temp/stage2'
make[1]: 正在進入目錄 `/tmp/grub4dos-temp'
make[1]: 沒有什么可以做的為 `clean-am'。
make[1]:正在離開目錄 `/tmp/grub4dos-temp'
make all-recursive
make[1]: 正在進入目錄 `/tmp/grub4dos-temp'
Making all in stage2
make[2]: 正在進入目錄 `/tmp/grub4dos-temp/stage2'
CPPAS pre_stage2_exec-asm.o
CC pre_stage2_exec-bios.o
CC pre_stage2_exec-boot.o
CC pre_stage2_exec-builtins.o
CC pre_stage2_exec-char_io.o
CC pre_stage2_exec-cmdline.o
CC pre_stage2_exec-common.o
CC pre_stage2_exec-console.o
CC pre_stage2_exec-dec_lz4.o
CC pre_stage2_exec-dec_lzma.o
CC pre_stage2_exec-dec_vhd.o
CC pre_stage2_exec-disk_io.o
CC pre_stage2_exec-fsys_ext2fs.o
CC pre_stage2_exec-fsys_fat.o
CC pre_stage2_exec-fsys_ntfs.o
CC pre_stage2_exec-fsys_ffs.o
CC pre_stage2_exec-fsys_iso9660.o
CC pre_stage2_exec-fsys_jfs.o
CC pre_stage2_exec-fsys_minix.o
CC pre_stage2_exec-fsys_reiserfs.o
CC pre_stage2_exec-fsys_ufs2.o
CC pre_stage2_exec-fsys_vstafs.o
CC pre_stage2_exec-fsys_xfs.o
CC pre_stage2_exec-fsys_pxe.o
CC pre_stage2_exec-fsys_initrd.o
CC pre_stage2_exec-fsys_ipxe.o
CC pre_stage2_exec-fsys_fb.o
CC pre_stage2_exec-gunzip.o
CC pre_stage2_exec-hercules.o
CC pre_stage2_exec-md5.o
CC pre_stage2_exec-serial.o
CC pre_stage2_exec-stage2.o
CC pre_stage2_exec-terminfo.o
CC pre_stage2_exec-tparm.o
CC pre_stage2_exec-graphics.o
CCLD pre_stage2.exec
/usr/bin/ld: Warning: alignment 2 of symbol `grub_putchar' in pre_stage2_exec-asm.o is smaller than 4 in pre_stage2_exec-bios.o
/usr/bin/ld: Warning: alignment 2 of symbol `grub_putchar' in pre_stage2_exec-asm.o is smaller than 4 in pre_stage2_exec-boot.o
/usr/bin/ld: Warning: alignment 2 of symbol `grub_putchar' in pre_stage2_exec-asm.o is smaller than 4 in pre_stage2_exec-builtins.o
/usr/bin/ld: Warning: alignment 2 of symbol `grub_putchar' in pre_stage2_exec-asm.o is smaller than 4 in pre_stage2_exec-char_io.o
/usr/bin/ld: Warning: alignment 2 of symbol `grub_putchar' in pre_stage2_exec-asm.o is smaller than 4 in pre_stage2_exec-cmdline.o
/usr/bin/ld: Warning: alignment 2 of symbol `grub_putchar' in pre_stage2_exec-asm.o is smaller than 4 in pre_stage2_exec-common.o
/usr/bin/ld: Warning: alignment 2 of symbol `grub_putchar' in pre_stage2_exec-asm.o is smaller than 4 in pre_stage2_exec-console.o
/usr/bin/ld: Warning: alignment 2 of symbol `grub_putchar' in pre_stage2_exec-asm.o is smaller than 4 in pre_stage2_exec-dec_lz4.o
/usr/bin/ld: Warning: alignment 2 of symbol `grub_putchar' in pre_stage2_exec-asm.o is smaller than 4 in pre_stage2_exec-dec_lzma.o
/usr/bin/ld: Warning: alignment 2 of symbol `grub_putchar' in pre_stage2_exec-asm.o is smaller than 4 in pre_stage2_exec-dec_vhd.o
/usr/bin/ld: Warning: alignment 2 of symbol `grub_putchar' in pre_stage2_exec-asm.o is smaller than 4 in pre_stage2_exec-disk_io.o
/usr/bin/ld: Warning: alignment 2 of symbol `grub_putchar' in pre_stage2_exec-asm.o is smaller than 4 in pre_stage2_exec-fsys_ext2fs.o
/usr/bin/ld: Warning: alignment 2 of symbol `grub_putchar' in pre_stage2_exec-asm.o is smaller than 4 in pre_stage2_exec-fsys_fat.o
/usr/bin/ld: Warning: alignment 2 of symbol `grub_putchar' in pre_stage2_exec-asm.o is smaller than 4 in pre_stage2_exec-fsys_ntfs.o
/usr/bin/ld: Warning: alignment 2 of symbol `grub_putchar' in pre_stage2_exec-asm.o is smaller than 4 in pre_stage2_exec-fsys_ffs.o
/usr/bin/ld: Warning: alignment 2 of symbol `grub_putchar' in pre_stage2_exec-asm.o is smaller than 4 in pre_stage2_exec-fsys_iso9660.o
/usr/bin/ld: Warning: alignment 2 of symbol `grub_putchar' in pre_stage2_exec-asm.o is smaller than 4 in pre_stage2_exec-fsys_jfs.o
/usr/bin/ld: Warning: alignment 2 of symbol `grub_putchar' in pre_stage2_exec-asm.o is smaller than 4 in pre_stage2_exec-fsys_minix.o
/usr/bin/ld: Warning: alignment 2 of symbol `grub_putchar' in pre_stage2_exec-asm.o is smaller than 4 in pre_stage2_exec-fsys_reiserfs.o
/usr/bin/ld: Warning: alignment 2 of symbol `grub_putchar' in pre_stage2_exec-asm.o is smaller than 4 in pre_stage2_exec-fsys_ufs2.o
/usr/bin/ld: Warning: alignment 2 of symbol `grub_putchar' in pre_stage2_exec-asm.o is smaller than 4 in pre_stage2_exec-fsys_vstafs.o
/usr/bin/ld: Warning: alignment 2 of symbol `grub_putchar' in pre_stage2_exec-asm.o is smaller than 4 in pre_stage2_exec-fsys_xfs.o
/usr/bin/ld: Warning: alignment 2 of symbol `grub_putchar' in pre_stage2_exec-asm.o is smaller than 4 in pre_stage2_exec-fsys_pxe.o
/usr/bin/ld: Warning: alignment 2 of symbol `grub_putchar' in pre_stage2_exec-asm.o is smaller than 4 in pre_stage2_exec-fsys_initrd.o
/usr/bin/ld: Warning: alignment 2 of symbol `grub_putchar' in pre_stage2_exec-asm.o is smaller than 4 in pre_stage2_exec-fsys_ipxe.o
/usr/bin/ld: Warning: alignment 2 of symbol `grub_putchar' in pre_stage2_exec-asm.o is smaller than 4 in pre_stage2_exec-fsys_fb.o
/usr/bin/ld: Warning: alignment 2 of symbol `grub_putchar' in pre_stage2_exec-asm.o is smaller than 4 in pre_stage2_exec-gunzip.o
/usr/bin/ld: Warning: alignment 2 of symbol `grub_putchar' in pre_stage2_exec-asm.o is smaller than 4 in pre_stage2_exec-hercules.o
/usr/bin/ld: Warning: alignment 2 of symbol `grub_putchar' in pre_stage2_exec-asm.o is smaller than 4 in pre_stage2_exec-md5.o
/usr/bin/ld: Warning: alignment 2 of symbol `grub_putchar' in pre_stage2_exec-asm.o is smaller than 4 in pre_stage2_exec-serial.o
/usr/bin/ld: Warning: alignment 2 of symbol `grub_putchar' in pre_stage2_exec-asm.o is smaller than 4 in pre_stage2_exec-stage2.o
/usr/bin/ld: Warning: alignment 2 of symbol `grub_putchar' in pre_stage2_exec-asm.o is smaller than 4 in pre_stage2_exec-terminfo.o
/usr/bin/ld: Warning: alignment 2 of symbol `grub_putchar' in pre_stage2_exec-asm.o is smaller than 4 in pre_stage2_exec-tparm.o
/usr/bin/ld: Warning: alignment 2 of symbol `grub_putchar' in pre_stage2_exec-asm.o is smaller than 4 in pre_stage2_exec-graphics.o
OBJ pre_stage2
CPPAS dosstart_exec-dosstart.o
CCLD dosstart.exec
CPPAS badgrubstart_exec-badgrubstart.o
CCLD badgrubstart.exec
CPPAS grldrstart_exec-grldrstart.o
CCLD grldrstart.exec
CPPAS mbrstart_exec-mbrstart.o
CCLD mbrstart.exec
CPPAS bootlacestart_exec-bootlacestart.o
CCLD bootlacestart.exec
CPPAS hmloadstart_exec-hmloadstart.o
CCLD hmloadstart.exec
OBJ dosstart
GEN grub.exe
OBJ badgrubstart
GEN badgrub.exe
OBJ grldrstart
GEN grldr
OBJ mbrstart
GEN grldr.mbr
OBJ bootlacestart
GEN bootlace.com
記錄了10+0 的讀入
記錄了10+0 的寫出
5120字節(5.1 kB)已復制,0.000104693 秒,48.9 MB/秒
記錄了1+0 的讀入
記錄了1+0 的寫出
512字節(512 B)已復制,7.2937e-05 秒,7.0 MB/秒
記錄了1+0 的讀入
記錄了1+0 的寫出
512字節(512 B)已復制,7.509e-05 秒,6.8 MB/秒
OBJ hmloadstart
GEN hmload.com
Ultimate Packer for eXecutables
Copyright (C) 1996 - 2013
UPX 3.91 Markus Oberhumer, Laszlo Molnar & John Reiser Sep 30th 2013
File size Ratio Format Name
-------------------- ------ ----------- -----------
6140 -> 1724 28.08% dos/sys eltorito.sys
Packed 1 file.
make[2]:正在離開目錄 `/tmp/grub4dos-temp/stage2'
make[2]: 正在進入目錄 `/tmp/grub4dos-temp'
make[2]:正在離開目錄 `/tmp/grub4dos-temp'
make[1]:正在離開目錄 `/tmp/grub4dos-temp'
記錄了64+0 的讀入
記錄了64+0 的寫出
64字節(64 B)已復制,0.000137164 秒,467 kB/秒
記錄了43456+0 的讀入
記錄了43456+0 的寫出
43456字節(43 kB)已復制,0.0319802 秒,1.4 MB/秒
7-Zip [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
p7zip Version 9.20 (locale=zh_CN.UTF-8,Utf16=on,HugeFiles=on,8 CPUs)
Scanning
Creating archive grub4dos-0.4.6a-2021-06-06.7z
Compressing grub4dos-0.4.6a/COPYING
Compressing grub4dos-0.4.6a/sample/default
Compressing grub4dos-0.4.6a/grldr
Compressing grub4dos-0.4.6a/grldr_cd.bin
Compressing grub4dos-0.4.6a/docs/ChangeLog_chenall.txt
Compressing grub4dos-0.4.6a/docs/ChangeLog_GRUB4DOS.txt
Compressing grub4dos-0.4.6a/docs/README_GRUB4DOS.txt
Compressing grub4dos-0.4.6a/docs/README_GRUB4DOS_CN.txt
Compressing grub4dos-0.4.6a/badgrub.exe
Compressing grub4dos-0.4.6a/grub.exe
Compressing grub4dos-0.4.6a/sample/config.sys
Compressing grub4dos-0.4.6a/eltorito.sys
Compressing grub4dos-0.4.6a/bootlace.com
Compressing grub4dos-0.4.6a/bootlace64.com
Compressing grub4dos-0.4.6a/hmload.com
Compressing grub4dos-0.4.6a/sample/menu.lst
Compressing grub4dos-0.4.6a/grldr.mbr
Compressing grub4dos-0.4.6a/grldr.pbr
Compressing grub4dos-0.4.6a/grub.pif
Everything is Ok
root@ubuntu:/media/root/yule/grub4dos-20210602source#
grub4dos-BIOS成功編譯!
(2)選擇那個ext4分區,把源代碼放在里面開始編譯grub4dos_UEFI:
root@ubuntu:/media/root/yule/grub4dos-20210602source# cd /media/root/yule/grub4dos-for_UEFI-2021-06-02source
root@ubuntu:/media/root/yule/grub4dos-for_UEFI-2021-06-02source#
root@ubuntu:/media/root/yule/grub4dos-for_UEFI-2021-06-02source# chmod -R 777 ./
root@ubuntu:/media/root/yule/grub4dos-for_UEFI-2021-06-02source# bash ./build
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
/tmp/grub4dos-temp/missing: Unknown `--is-lightweight' option
Try `/tmp/grub4dos-temp/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking dependency style of gcc... gcc3
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking whether to enable maintainer-specific portions of Makefiles... no
checking for gcc... (cached) gcc
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking dependency style of gcc... (cached) gcc3
checking for ranlib... ranlib
checking whether optimization for size works... yes
checking whether gcc has -fno-stack-protector... yes
checking whether gcc has -fno-reorder-functions... yes
checking whether -Wundef works... yes
checking whether -falign-loops works... yes
checking whether linker accepts `--build-id=none'... yes
checking for objcopy... objcopy
checking if C symbols get an underscore after compilation... no
checking whether objcopy works for absolute addresses... yes
checking whether addr32 must be in the same line as the instruction... yes
checking for .code16 addr32 assembler support... yes
checking whether an absolute indirect call/jump must not be prefixed with an asterisk... no
checking if start is defined by the compiler... no
checking if _start is defined by the compiler... yes
checking if __bss_start is defined by the compiler... yes
checking if _edata is defined by the compiler... yes
checking if edata is defined by the compiler... yes
checking if end is defined by the compiler... yes
checking if _end is defined by the compiler... yes
checking for opendisk in -lutil... no
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating stage2/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
Making clean in stage2
make[1]: 正在進入目錄 `/tmp/grub4dos-temp/stage2'
test -z " pre_stage2 " || rm -f pre_stage2
test -z "pre_stage2.exec" || rm -f pre_stage2.exec
rm -f *.o
test -z "pre_stage2.exec" || rm -f pre_stage2.exec
test -z "" || rm -f
test -z "" || rm -f
test -z "test-suite.log" || rm -f test-suite.log
make[1]:正在離開目錄 `/tmp/grub4dos-temp/stage2'
make[1]: 正在進入目錄 `/tmp/grub4dos-temp'
make[1]: 沒有什么可以做的為 `clean-am'。
make[1]:正在離開目錄 `/tmp/grub4dos-temp'
make all-recursive
make[1]: 正在進入目錄 `/tmp/grub4dos-temp'
Making all in stage2
make[2]: 正在進入目錄 `/tmp/grub4dos-temp/stage2'
CPPAS pre_stage2_exec-asm.o
CC pre_stage2_exec-boot.o
CC pre_stage2_exec-builtins.o
CC pre_stage2_exec-char_io.o
CC pre_stage2_exec-cmdline.o
CC pre_stage2_exec-common.o
CC pre_stage2_exec-console.o
CC pre_stage2_exec-dec_lz4.o
CC pre_stage2_exec-dec_lzma.o
CC pre_stage2_exec-dec_vhd.o
CC pre_stage2_exec-disk_io.o
CC pre_stage2_exec-fsys_ext2fs.o
CC pre_stage2_exec-fsys_fat.o
CC pre_stage2_exec-fsys_ntfs.o
CC pre_stage2_exec-fsys_iso9660.o
CC pre_stage2_exec-fsys_pxe.o
CC pre_stage2_exec-fsys_ipxe.o
CC pre_stage2_exec-fsys_fb.o
CC pre_stage2_exec-fsys_initrd.o
CC pre_stage2_exec-gunzip.o
CC pre_stage2_exec-md5.o
CC pre_stage2_exec-stage2.o
CC pre_stage2_exec-graphics.o
CCLD pre_stage2.exec
OBJ pre_stage2
make[2]:正在離開目錄 `/tmp/grub4dos-temp/stage2'
make[2]: 正在進入目錄 `/tmp/grub4dos-temp'
make[2]:正在離開目錄 `/tmp/grub4dos-temp'
make[1]:正在離開目錄 `/tmp/grub4dos-temp'
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
/tmp/grub4dos-temp/missing: Unknown `--is-lightweight' option
Try `/tmp/grub4dos-temp/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking dependency style of gcc... gcc3
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking whether to enable maintainer-specific portions of Makefiles... no
checking for gcc... (cached) gcc
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking dependency style of gcc... (cached) gcc3
checking for ranlib... ranlib
checking whether optimization for size works... yes
checking whether gcc has -fno-stack-protector... yes
checking whether gcc has -fno-reorder-functions... yes
checking whether -Wundef works... yes
checking whether -falign-loops works... yes
checking whether linker accepts `--build-id=none'... yes
checking for objcopy... objcopy
checking if C symbols get an underscore after compilation... no
checking whether objcopy works for absolute addresses... yes
checking whether addr32 must be in the same line as the instruction... yes
checking for .code16 addr32 assembler support... yes
checking whether an absolute indirect call/jump must not be prefixed with an asterisk... no
checking if start is defined by the compiler... no
checking if _start is defined by the compiler... yes
checking if __bss_start is defined by the compiler... yes
checking if _edata is defined by the compiler... yes
checking if edata is defined by the compiler... yes
checking if end is defined by the compiler... yes
checking if _end is defined by the compiler... yes
checking for opendisk in -lutil... no
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating stage2/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
Making clean in stage2
make[1]: 正在進入目錄 `/tmp/grub4dos-temp/stage2'
test -z " pre_stage2 " || rm -f pre_stage2
test -z "pre_stage2.exec" || rm -f pre_stage2.exec
rm -f *.o
test -z "pre_stage2.exec" || rm -f pre_stage2.exec
test -z "" || rm -f
test -z "" || rm -f
test -z "test-suite.log" || rm -f test-suite.log
make[1]:正在離開目錄 `/tmp/grub4dos-temp/stage2'
make[1]: 正在進入目錄 `/tmp/grub4dos-temp'
make[1]: 沒有什么可以做的為 `clean-am'。
make[1]:正在離開目錄 `/tmp/grub4dos-temp'
make all-recursive
make[1]: 正在進入目錄 `/tmp/grub4dos-temp'
Making all in stage2
make[2]: 正在進入目錄 `/tmp/grub4dos-temp/stage2'
CPPAS pre_stage2_exec-asm.o
CC pre_stage2_exec-boot.o
CC pre_stage2_exec-builtins.o
CC pre_stage2_exec-char_io.o
CC pre_stage2_exec-cmdline.o
CC pre_stage2_exec-common.o
CC pre_stage2_exec-console.o
CC pre_stage2_exec-dec_lz4.o
CC pre_stage2_exec-dec_lzma.o
CC pre_stage2_exec-dec_vhd.o
CC pre_stage2_exec-disk_io.o
CC pre_stage2_exec-fsys_ext2fs.o
CC pre_stage2_exec-fsys_fat.o
CC pre_stage2_exec-fsys_ntfs.o
CC pre_stage2_exec-fsys_iso9660.o
CC pre_stage2_exec-fsys_pxe.o
CC pre_stage2_exec-fsys_ipxe.o
CC pre_stage2_exec-fsys_fb.o
CC pre_stage2_exec-fsys_initrd.o
CC pre_stage2_exec-gunzip.o
CC pre_stage2_exec-md5.o
CC pre_stage2_exec-stage2.o
CC pre_stage2_exec-graphics.o
CCLD pre_stage2.exec
OBJ pre_stage2
make[2]:正在離開目錄 `/tmp/grub4dos-temp/stage2'
make[2]: 正在進入目錄 `/tmp/grub4dos-temp'
make[2]:正在離開目錄 `/tmp/grub4dos-temp'
make[1]:正在離開目錄 `/tmp/grub4dos-temp'
7-Zip [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
p7zip Version 9.20 (locale=zh_CN.UTF-8,Utf16=on,HugeFiles=on,8 CPUs)
Scanning
/tmp/grub4dos-temp/Get_Source_of_This_Build.txt: WARNING: No more files
/tmp/grub4dos-temp/grub4dos_.diff: WARNING: No more files
Creating archive grub4dos-for_UEFI-2021-06-06.7z
Compressing x86_64-efi/kernel.img
Compressing i386-efi/kernel.img
Compressing ChangeLog_UEFI.txt
Compressing BOOTIA32.EFI
Compressing BOOTX64.EFI
Compressing menu.lst
Compressing mkimage.exe
WARNINGS for files:
/tmp/grub4dos-temp/Get_Source_of_This_Build.txt : No more files
/tmp/grub4dos-temp/grub4dos_.diff : No more files
----------------
WARNING: Cannot find 2 files
7z failed. Continue with zip or tar...
grub4dos_UEFI成功編譯!
nice!!!