summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Luna2015-08-16 18:11:55 -0500
committerChristopher Luna2015-08-16 18:11:55 -0500
commitc2321a79d396432447e06614fc80dad7ccc18329 (patch)
tree02cf649e368f3c425d546b50e27f29858229513e
downloadaur-c2321a79d396432447e06614fc80dad7ccc18329.tar.gz
First commit
-rw-r--r--.SRCINFO25
-rw-r--r--PKGBUILD84
-rw-r--r--README_arch.txt58
-rw-r--r--grub4dos.install21
-rw-r--r--menu.lst176
5 files changed, 364 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..e141806444fb
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,25 @@
+pkgbase = grub4dos
+ pkgdesc = A GRUB boot loader support menu on windows(fat,ntfs)/linux(ext2,3,4)
+ pkgver = 0.4.5c_20140822
+ pkgrel = 1
+ url = http://grub4dos.chenall.net/
+ install = grub4dos.install
+ arch = i686
+ arch = x86_64
+ license = GPL2
+ makedepends = upx
+ makedepends = nasm
+ conflicts = grub4dos
+ options = !strip
+ options = !buildflags
+ options = !makeflags
+ backup = grub/menu.lst
+ source = https://github.com/chenall/grub4dos/archive/81aad9a50e380814107af0baaf5e05949f12b0cc.zip
+ source = README_arch.txt
+ source = menu.lst
+ md5sums = 4e97c87e13fbe0ec08585edcd84814b0
+ md5sums = d84dde7476cb6ef37df3b159a1c3f1e8
+ md5sums = 32cc5705f5328dc30077e9d0a96ded3b
+
+pkgname = grub4dos
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..9fe2660b4e81
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,84 @@
+# Maintainer : chrisl echo archlinux@c2h0r1i2s4t5o6p7h8e9r-l3u4n1a.com|sed 's/[0-9]//g'
+# Contributor: Leandro Britez <britinx (at) hotmail.com>
+# Contributor: Daniel YC Lin <dlin.tw (at) gmail.com>
+#81aad9a50e380814107af0baaf5e05949f12b0cc
+pkgname=grub4dos
+pkgver="0.4.5c_20140822"
+pkgrel=1
+_rel=81aad9a50e380814107af0baaf5e05949f12b0cc
+pkgdesc="A GRUB boot loader support menu on windows(fat,ntfs)/linux(ext2,3,4)"
+arch=(i686 x86_64)
+url="http://grub4dos.chenall.net/"
+license=('GPL2')
+backup=(grub/menu.lst)
+makedepends=('upx' 'nasm')
+install=grub4dos.install
+conflicts=(grub4dos)
+options=('!strip' '!buildflags' '!makeflags')
+
+md5sums=('4e97c87e13fbe0ec08585edcd84814b0'
+ 'd84dde7476cb6ef37df3b159a1c3f1e8'
+ '32cc5705f5328dc30077e9d0a96ded3b')
+
+source=(
+ "https://github.com/chenall/grub4dos/archive/$_rel.zip"
+ README_arch.txt
+ menu.lst
+)
+
+prepare() {
+ cd "$pkgname-$_rel"
+ # Patch: Only allow a single thread
+ sed -i -e 's:make |:make -j1 |:' build
+}
+
+build() {
+ cd "$pkgname-$_rel"
+ #GRUB4DOS_TEMP=$PWD/tmp ./build
+ unset CFLAGS
+ unset CFLAGS
+ unset CXXFLAGS
+ unset LDFLGAS
+ unset CPPFLAGS
+ temp_flags=(`grep -E '^CFLAGS=.+' /etc/makepkg.conf | cut -d '"' -f 2`)
+ for i in ${temp_flags[@]};do [ "$i" != "-fstack-protector" ] && CFLAGS+="$i ";done
+ CXXFLAGS=("`grep -E '^CXXFLAGS=.+' /etc/makepkg.conf | cut -d '"' -f 2`")
+ LDFLAGS=("`grep -E '^LDFLAGS=.+' /etc/makepkg.conf | cut -d '"' -f 2`")
+ CPPFLAGS=("`grep -E '^CPPFLAGS=.+' /etc/makepkg.conf | cut -d '"' -f 2`")
+ ./configure --enable-preset-menu=preset_menu.lst
+ make -j1
+ cd stage2
+ # Generate bootlace64.com:
+ size=`ls -l bootlace.com|awk '{print $5}'`
+ dd if=bootlace.com of=bootlace.head bs=1 count=64
+ dd if=bootlace.com of=bootlace.body bs=1 count=`expr $size - 128` skip=64
+ dd if=bootlace.com of=bootlace.tail bs=1 count=64 skip=`expr $size - 64`
+ cat bootlace.tail bootlace.body bootlace.head > bootlace64.com
+ chmod a+x bootlace64.com
+ rm -f bootlace.tail bootlace.body bootlace.head
+}
+
+package() {
+ cd $srcdir
+ for _f in menu.lst ; do
+ install -Dm 644 "$_f" "$pkgdir/grub/$_f"
+ done
+
+ _f=README_arch.txt ; install -Dm 644 "$_f" "$pkgdir/usr/share/doc/grub4dos/$_f"
+
+ cd $srcdir/$pkgname-$_rel
+ _f=default ; install -Dm 644 "$_f" "$pkgdir/grub/$_f"
+ for _f in grub.exe grldr ; do
+ install -Dm 644 "stage2/$_f" "$pkgdir/grub/$_f"
+ done
+ _f=bootlace.com ; install -Dm 755 "stage2/$_f" "$pkgdir/usr/bin/$_f"
+ if [ `uname -m` = x86_64 ] ; then
+ _f=bootlace64.com ; install -Dm 755 stage2/$_f "$pkgdir/usr/bin/$_f"
+ fi
+
+ for _f in README_GRUB4DOS.txt ChangeLog_GRUB4DOS.txt README_GRUB4DOS_CN.txt \
+ ChangeLog_chenall.txt ; do
+
+ install -Dm 644 $_f "$pkgdir/usr/share/doc/grub4dos/$_f"
+ done
+}
diff --git a/README_arch.txt b/README_arch.txt
new file mode 100644
index 000000000000..f082274312cb
--- /dev/null
+++ b/README_arch.txt
@@ -0,0 +1,58 @@
+=======
+INSTALL
+=======
+
+grub4dos supported filesystems: ext2, ext3, ext4, ntfs, fat, fat32
+
+Assume /dev/sdd is your bootable usb device.
+Assume /mnt/sdd1 is your boot partition mount point
+
+------
+STEP 1
+------
+
+Install first stage boot loader to MBR of /dev/sdd:
+# bootlace.com --no-backup-mbr --mbr-disable-floppy --time-out=0 /dev/sdd
+
+grub4dos supports automatic backups of the original MBR by default:
+# bootlace.com --mbr-disable-floppy /dev/sda
+
+Then, if you need to restore the original MBR, press SPACE during grub
+loading prompt.
+
+NOTE: Use bootlace64.com instead of bootlace.com in x86_64 systems.
+
+------
+STEP 2
+------
+
+Copy the grldr file to the mounted device:
+$ cp /grub/grldr /mnt/sdd1/
+
+NOTE: Target directory (/mnt/sdd1) only supports FAT/NTFS/ext2 (not ext4)
+
+------
+STEP 3
+------
+
+Create a grub directory on the mounted device:
+$ mkdir -p /mnt/sdd1/grub
+$ cp /grub/menu.lst /mnt/sdd1/grub
+
+There is additional documentation about menu.lst configs in /usr/share/doc/grub4dos
+
+grub4dos manual: http://diddy.boot-land.net/grub4dos/Grub4dos.htm
+
+-----------------
+STEP 4 (optional)
+-----------------
+
+If you want to use 'default' option in menu.lst:
+$ cp /grub/default /mnt/sdd1/grub
+
+-----------------
+STEP 5 (optional)
+-----------------
+
+If you want to use Windows boot.ini/bootmgr.ini to chain grub4dos bootloader:
+$ cp /grub/grub.exe /mnt/sda1/grub
diff --git a/grub4dos.install b/grub4dos.install
new file mode 100644
index 000000000000..bcfae941e376
--- /dev/null
+++ b/grub4dos.install
@@ -0,0 +1,21 @@
+msg()
+{
+ echo "Read the installation tips on /usr/share/doc/grub4dos/README_arch.txt"
+}
+
+
+## arg 1: the new package version
+post_install()
+{
+ msg
+ /bin/true
+}
+
+## arg 1: the old package version
+post_remove()
+{
+ echo "To remove an installed grub4dos from a device:"
+ echo "1) Restore original MBR"
+ echo "2) Delete /grldr or /boot/grldr"
+ /bin/true
+}
diff --git a/menu.lst b/menu.lst
new file mode 100644
index 000000000000..1511118d3cdb
--- /dev/null
+++ b/menu.lst
@@ -0,0 +1,176 @@
+# This is a sample menu.lst file. You should make some changes to it.
+# The old install method of booting via the stage-files has been removed.
+# Please install GRLDR boot strap code to MBR with the bootlace.com
+# utility under DOS/Win9x or Linux.
+#
+# It must be UTF-8 encoding for multi-lingual support. Font lines can be
+# appended to the file. The font lines should be in the unifont.hex format.
+
+color blue/green yellow/red white/magenta white/magenta
+timeout 30
+## menu border color
+color border=0xEEFFEE
+## set vbe mode
+graphicsmode -1 640:800 480:600 24:32 || graphicsmode -1 -1 -1 24:32
+font /grub/unifont.hex.gz
+## loading splashimage
+splashimage /grub/splashimage.xpm || splashimage /grub/splashimage.bmp
+default /grub/default
+## Menu AutoNumber
+write 0x8274 0x2001
+
+# ========================
+# Examples for Arch Linux
+# ========================
+# ref: https://wiki.archlinux.org/index.php/kernel_parameters
+# maybe root=UUID=...
+# root=/dev/disk/by-label/...
+
+title Arch Linux
+find --set-root --ignore-floppies --ignore-cd /vmlinuz-linux
+kernel /vmlinuz-linux root=/dev/sda1 rw quiet splash
+initrd /initramfs-linux.img
+savedefault --wait=0
+
+title Arch Linux Fallback
+find --set-root --ignore-floppies --ignore-cd /vmlinuz-linux
+kernel /vmlinuz-linux root=/dev/sda1 rw quiet splash
+initrd /initramfs-linux-fallback.img
+
+title Windows 7
+find --set-root --ignore-floppies --ignore-cd /bootmgr
+#root (hd0,1)
+chainloader /bootmgr
+savedefault --wait=0
+
+# ========================
+# Examples from grub4dos chenall's source
+# ========================
+title find and load NTLDR of Windows NT/2K/XP\n find and load NTLDR of Windows NT/2K/XP
+fallback +1
+find --set-root --ignore-floppies --ignore-cd /ntldr
+map () (hd0)
+map (hd0) ()
+map --rehook
+find --set-root --ignore-floppies --ignore-cd /ntldr
+chainloader /ntldr
+savedefault --wait=2
+
+#iftitle only show when command in [] returns true
+# set a variable named bootmgr where /bootmgr is found.
+iftitle [find --set-root --devices=h /bootmgr && call set bootmgr=%@root^%] load BOOTMGR of Windows VISTA/WIN7/WIN2008 on %bootmgr%
+fallback +1
+chainloader %bootmgr%/bootmgr
+savedefault --wait=2
+
+title find and load CMLDR, the Recovery Console of Windows NT/2K/XP
+fallback +1
+find --set-root --ignore-floppies --ignore-cd /cmldr
+map () (hd0)
+map (hd0) ()
+map --rehook
+find --set-root --ignore-floppies --ignore-cd /cmldr
+chainloader /cmldr
+#####################################################################
+# write string "cmdcons" to memory 0000:7C03 in 2 steps:
+#####################################################################
+# step 1. Write 4 chars "cmdc" at 0000:7C03
+#write 0x7C03 0x63646D63
+# step 2. Write 3 chars "ons" and an ending null at 0000:7C07
+#write 0x7C07 0x00736E6F
+
+# or.
+#write --offset=3 (md)0x3e+1 cmdcons\0
+# or
+calc *0x7c03=0x00736E6F63646D63
+
+savedefault --wait=2
+
+title Chainload IO.SYS for booting MS-DOS/Windows 9x/Me
+fallback +1
+find --set-root --ignore-floppies --ignore-cd /io.sys
+chainloader /io.sys
+savedefault --wait=2
+#
+# Or in this way:
+#
+# find --set-root --ignore-floppies --ignore-cd chainloader /io.sys
+# boot
+#
+# The above boot command is needed in this case.
+# See "Delimitors or comments between titles" in grub4dos_readme.txt.
+
+title find /boot/grub/menu.lst for booting Linux (Mageia, Mandriva, etc)
+fallback +1
+find --set-root --ignore-floppies --ignore-cd /boot/grub/menu.lst
+configfile /boot/grub/menu.lst
+
+title Switch to GRUB2 core.img for booting Linux (Ubuntu, etc)
+fallback +1
+find --set-root --ignore-floppies --ignore-cd /boot/grub/i386-pc/core.img
+kernel /boot/grub/i386-pc/core.img
+
+title commandline
+commandline
+
+title 0PE LiveISO
+find --set-root --ignore-floppies --ignore-cd /0PE/0PE.ISO
+map /0PE/0PE.ISO (0xff)
+map --hook
+chainloader (0xff)
+savedefault --wait=2
+
+title MicroPE LiveISO
+find --set-root --ignore-floppies --ignore-cd /boot/MicroPE.ISO
+map /boot/MicroPE.ISO (0xff)
+map --hook
+chainloader (0xff)
+savedefault --wait=2
+
+title Parted Magic LiveISO
+find --set-root --ignore-floppies --ignore-cd /pmagic.iso
+map /pmagic.iso (0xff)
+map --hook
+chainloader (0xff)
+savedefault --wait=2
+
+title Ultimate Boot CD LiveISO
+find --set-root --ignore-floppies --ignore-cd /ubcd.iso
+map /ubcd.iso (0xff)
+map --hook
+chainloader (0xff)
+savedefault --wait=2
+
+title SliTaz LiveISO
+find --set-root --ignore-floppies --ignore-cd /slitaz.iso
+map /slitaz.iso (0xff)
+map --hook
+chainloader (0xff)
+
+title Mageia Installation ISO
+find --set-root --ignore-floppies --ignore-cd /Mageia-2-x86_64-DVD.iso
+map /Mageia-2-x86_64-DVD.iso (0xff)
+map --hook
+chainloader (0xff)
+
+title reboot (重启)
+reboot
+
+title halt (关机)
+halt
+
+title MAXDOS.IMG
+find --set-root --ignore-floppies --ignore-cd /boot/MAXDOS.IMG
+map --mem /boot/MAXDOS.IMG (fd0)
+map --hook
+chainloader (fd0)+1
+rootnoverify (fd0)
+
+# In the end, font lines for unicode chars in unifont.hex format.
+# It should include all unicode chars used in the above menu code.
+# Surely normal ASCII chars are not necessary to be included here.
+
+#5173:10100810082000003FF8010001000100FFFE010002800280044008203018C006
+#542F:010000801FFC1004100410041FFC10001000100017FC24042404440487FC0404
+#673A:100011F011101110FD10111031103910551055109110111211121212120E1400
+#91CD:001000F83F000100FFFE01001FF011101FF011101FF001003FF80100FFFE0000