[arch-commits] Commit in grub2/trunk (PKGBUILD archlinux_grub2_mkconfig_fixes.patch)

Ronald van Haren ronald at archlinux.org
Fri Jan 28 13:14:06 EST 2011


    Date: Friday, January 28, 2011 @ 13:14:06
  Author: ronald
Revision: 107989

mostly ready for grub2 1.99 release

Added:
  grub2/trunk/archlinux_grub2_mkconfig_fixes.patch
Modified:
  grub2/trunk/PKGBUILD

--------------------------------------+
 PKGBUILD                             |  243 +++++++++++++++++++++++++--------
 archlinux_grub2_mkconfig_fixes.patch |   93 ++++++++++++
 2 files changed, 280 insertions(+), 56 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2011-01-28 18:09:41 UTC (rev 107988)
+++ PKGBUILD	2011-01-28 18:14:06 UTC (rev 107989)
@@ -1,75 +1,206 @@
-# $Id$
 # Maintainer: Ronald van Haren <ronald.archlinux.org>
-# Contributor: dongiovanni <dongiovanni.archlinux.de>
+# Contributor: Keshav P R <skodabenz at rocketmail dot com>
 
-pkgname=grub2
-pkgver=1.98
-pkgrel=5
-pkgdesc="The GNU GRand Unified Bootloader"
+# _grub2_rev=3072
+
+_grub2_lua_ver=19
+_grub2_gpxe_ver=12
+_grub2_ntldr_ver=13
+_grub2_915_ver=6
+
+pkgname=('grub2-common' 'grub2-bios' 'grub2-efi-i386')
+pkgbase="grub2"
+pkgver='1.99~rc1'
+pkgrel=1
 url="http://www.gnu.org/software/grub/"
 arch=('i686' 'x86_64')
 license=('GPL3')
-depends=('sh' 'lzo2' 'freetype2')
-optdepends=('ruby:usr/share/grub/genmk.rb script' 'libusb: /sbin/grub-emu' 'gettext: /sbin/grub-mkconfig')
-makedepends=('bdf-unifont' 'ruby')
-backup=('boot/grub/grub.cfg' 'etc/default/grub' 'etc/grub.d/40_custom')
-conflicts=('grub')
-provides=('grub')
-source=(ftp://alpha.gnu.org/gnu/grub/grub-${pkgver}.tar.gz  
-	'archlinux-script-fixes.patch' 
-        'gfxmenu-dependencies.patch'
-   	'menucolors-in-mkconfig.patch' 
-        'background-image-in-mkconfig.patch'
-	'hidden-timeout-fix.patch' 
-        'grub.default' 
-        'grub.cfg' 
-        '20_memtest86+'
-        'lvm-detection.patch')
+optdepends=()
+makedepends=('bdf-unifont' 'python2' 'xz' 'autogen' 'texinfo' 'help2man' 'gettext' 'device-mapper')
+options=(strip purge docs zipman !emptydirs)
+groups=('grub2')
+conflicts=()
+provides=()
 
+source=("ftp://alpha.gnu.org/gnu/grub/grub-${pkgver}.tar.gz"
+	"ftp://ftp.archlinux.org/other/grub2/grub2_extras_lua_r${_grub2_lua_ver}.tar.xz"
+	"ftp://ftp.archlinux.org/other/grub2/grub2_extras_gpxe_r${_grub2_gpxe_ver}.tar.xz"
+	"ftp://ftp.archlinux.org/other/grub2/grub2_extras_ntldr-img_r${_grub2_ntldr_ver}.tar.xz"
+	"ftp://ftp.archlinux.org/other/grub2/grub2_extras_915resolution_r${_grub2_915_ver}.tar.xz"
+	'archlinux_grub2_mkconfig_fixes.patch'
+	'grub.default'
+	'grub.cfg'
+	'20_memtest86+'
+	'05_archtheme')
+
+noextract=("grub2_extras_lua_r${_grub2_lua_ver}.tar.xz"
+	"grub2_extras_gpxe_r${_grub2_gpxe_ver}.tar.xz"
+	"grub2_extras_ntldr-img_r${_grub2_ntldr_ver}.tar.xz"
+	"grub2_extras_915resolution_r${_grub2_915_ver}.tar.xz")
+
+
 build() {
-  cd $srcdir/grub-${pkgver}
+	# set architecture dependent variables
+	if [ "${CARCH}" = "x86_64" ] ; then
+		_EFIEMU="--enable-efiemu"
+	else
+		_EFIEMU="--disable-efiemu"
+	fi
+	_HOST="${CARCH}"
 
-  # some random patches to facilitate automatic creation of grub.cfg
-  patch -Np1 -i ${srcdir}/archlinux-script-fixes.patch
-  patch -Np1 -i ${srcdir}/gfxmenu-dependencies.patch
-  patch -Np1 -i ${srcdir}/menucolors-in-mkconfig.patch
-  patch -Np1 -i ${srcdir}/background-image-in-mkconfig.patch
-  patch -Np1 -i ${srcdir}/hidden-timeout-fix.patch
-  # fix lvm symlink detection
-  patch -Np0 -i ${srcdir}/lvm-detection.patch
-  # run autogen.sh to create configure files
-  ./autogen.sh
+	build_grub2-common_and_bios
+	build_grub2-efi
+}
 
-  # fix unifont.bdf location
-  sed -i 's|/usr/src/unifont.bdf|/usr/share/fonts/misc/unifont.bdf|' configure
+build_grub2-common_and_bios() {
+	# copy the source for building the common/bios package
+	cp -r ${srcdir}/grub-${pkgver} ${srcdir}/grub2_bios-${pkgver}
+  
+	## Apply Archlinux specific fixes to enable grub2-mkconfig detect Arch kernels and initramfs
+	cd ${srcdir}/grub2_bios-${pkgver}
+	patch -Np1 -i ${srcdir}/archlinux_grub2_mkconfig_fixes.patch
 
-  CFLAGS= ./configure --prefix=/usr --enable-grub-mkfont --bindir=/bin \
+	# add the grub-extra sources
+	export GRUB_CONTRIB=${srcdir}/grub2_bios-${pkgver}/grub2-extras/  
+	install -d ${srcdir}/grub2_bios-${pkgver}/grub2-extras 
+	bsdtar xf ${srcdir}/grub2_extras_lua_r${_grub2_lua_ver}.tar.xz \
+		-C ${srcdir}/grub2_bios-${pkgver}/grub2-extras
+	bsdtar xf ${srcdir}/grub2_extras_gpxe_r${_grub2_gpxe_ver}.tar.xz \
+		-C ${srcdir}/grub2_bios-${pkgver}/grub2-extras
+	bsdtar xf ${srcdir}/grub2_extras_ntldr-img_r${_grub2_ntldr_ver}.tar.xz \
+		-C ${srcdir}/grub2_bios-${pkgver}/grub2-extras
+	bsdtar xf ${srcdir}/grub2_extras_915resolution_r${_grub2_915_ver}.tar.xz \
+		-C ${srcdir}/grub2_bios-${pkgver}/grub2-extras
+  
+	## Need to use python2
+	sed -i 's|python|python2|' ${srcdir}/grub2_bios-${pkgver}/autogen.sh
+
+	# start the actual build process
+	cd ${srcdir}/grub2_bios-${pkgver}
+	./autogen.sh
+  
+	## fix unifont.bdf location so grub-mkfont can create *.pf2 files
+	sed -i 's|/usr/share/fonts/unifont|/usr/share/fonts/misc|' ${srcdir}/grub2_bios-${pkgver}/configure
+  
+#	mkdir ${srcdir}/grub2_bios-${pkgver}/BUILD_BIOS
+#	cd ${srcdir}/grub2_bios-${pkgver}/BUILD_BIOS
+  
+	CFLAGS="" ./configure \
+		--with-platform=pc --enable-mm-debug \
+		${_EFIEMU} --host=${CARCH}-unknown-linux-gnu \
+		--enable-grub-mkfont --prefix=/usr \
+		--bindir=/bin --sbindir=/sbin \
+		--mandir=/usr/share/man --infodir=/usr/share/info \
+		--sysconfdir=/etc
+	CFLAGS="" make 
+}
+
+build_grub2-efi() {
+	# copy the source for building the efi package
+	cp -r ${srcdir}/grub-${pkgver} ${srcdir}/grub2_efi-${pkgver}
+
+	# add the grub-extra sources
+	export GRUB_CONTRIB=${srcdir}/grub2_efi-${pkgver}/grub2-extras/  
+	install -d ${srcdir}/grub2_efi-${pkgver}/grub2-extras  
+	bsdtar xf ${srcdir}/grub2_extras_lua_r${_grub2_lua_ver}.tar.xz \
+		-C ${srcdir}/grub2_efi-${pkgver}/grub2-extras
+	bsdtar xf ${srcdir}/grub2_extras_gpxe_r${_grub2_gpxe_ver}.tar.xz \
+		-C ${srcdir}/grub2_efi-${pkgver}/grub2-extras
+  
+	## Need to use python2
+	sed -i 's|python|python2|' ${srcdir}/grub2_efi-${pkgver}/autogen.sh
+	
+	# start the actual build process
+	cd ${srcdir}/grub2_efi-${pkgver}
+	./autogen.sh
+	#install -d ${srcdir}/grub2_efi-${pkgver}/BUILD_EFI_i386
+	#cd ${srcdir}/grub2_efi-${pkgver}/BUILD_EFI_i386
+
+	CFLAGS="" ./configure \
+		--with-platform=efi --target=i386 \
+		--enable-mm-debug --disable-efiemu \
+		--host=${CARCH}-unknown-linux-gnu \
+		--prefix=/usr --bindir=/bin \
 		--sbindir=/sbin --mandir=/usr/share/man \
 		--infodir=/usr/share/info --sysconfdir=/etc
+	CFLAGS="" make 
+}
 
-  CFLAGS= make
+package_grub2-common() {
+	pkgdesc="The GNU GRand Unified Bootloader version 2 - Files common for all platforms"
+	install="grub2.install"
+	depends=('xz' 'freetype2' 'device-mapper')
+	conflicts=('grub2')
+	backup=('boot/grub/grub.cfg' 'etc/default/grub' 'etc/grub.d/40_custom')
+  
+	cd ${srcdir}/grub2_bios-${pkgver}
+	make DESTDIR=${pkgdir} install 
+
+	## install grub2-extras ntldr-img's grubinst as /sbin/grubinst
+	install -Dm755 ${srcdir}/grub2_bios-${pkgver}/grub-core/grubinst ${pkgdir}/sbin/grubinst
+  
+	install -Dm755 ${pkgdir}/sbin/grub-install ${pkgdir}/sbin/grub_bios-install
+	install -Dm755 ${pkgdir}/sbin/grub-install ${pkgdir}/sbin/grub_efi_x86_64-install
+	install -Dm755 ${pkgdir}/sbin/grub-install ${pkgdir}/sbin/grub_efi_i386-install
+    
+	sed -i "s|^\(target_cpu\)=.*|\1=i386|; \
+		s|^\(platform\)=.*|\1=pc|" \
+		${pkgdir}/sbin/grub_bios-install
+
+	sed -i "s|^\(target_cpu\)=.*|\1=x86_64|; \
+		s|^\(platform\)=.*|\1=efi|" \
+		${pkgdir}/sbin/grub_efi_x86_64-install
+
+	sed -i "s|^\(target_cpu\)=.*|\1=i386|; \
+		s|^\(platform\)=.*|\1=efi|" \
+		${pkgdir}/sbin/grub_efi_i386-install
+  
+	## install extra /etc/grub.d/ files
+	install -Dm755 ${srcdir}/05_archtheme ${pkgdir}/etc/grub.d/05_archtheme
+	install -Dm755 ${srcdir}/20_memtest86+ ${pkgdir}/etc/grub.d/20_memtest86+
+    
+	## install /etc/default/grub (used by grub-mkconfig)
+	install -Dm644 ${srcdir}/grub.default ${pkgdir}/etc/default/grub
+
+	## install grub.cfg (needed so it doesn't get removed on upgrading because it was previously here)
+	install -Dm755 ${srcdir}/grub.cfg ${pkgdir}/boot/grub/grub.cfg
+
+	# remove platform specific files
+	rm -rf ${pkgdir}/usr/lib/grub/i386-pc/
 }
 
-package() {
-  cd $srcdir/grub-${pkgver}
-  make DESTDIR=${pkgdir} install
+package_grub2-bios() {
+	pkgdesc="The GNU GRand Unified Bootloader version 2 - Built for PC BIOS"
+	depends=(grub2-common=${pkgver})
+	replaces=('grub2')
+  
+	cd ${srcdir}/grub2_bios-${pkgver}
+	make DESTDIR=${pkgdir} install 
 
-  # install /etc/default/grub
-  install -Dm644 ${srcdir}/grub.default ${pkgdir}/etc/default/grub
+	## remove non platform-specific files
+	rm -rf ${pkgdir}/{boot,bin,sbin,etc,usr/share}
+	rm ${pkgdir}/usr/lib/grub/{grub-mkconfig_lib,update-grub_lib}
+}
 
-  # install grub.cfg (needed so it doesn't get removed on upgrading because it was previously here)
-  install -Dm644 ${srcdir}/grub.cfg ${pkgdir}/boot/grub/grub.cfg
+package_grub2-efi-i386() {
 
-  # install memtest config detection
-  install -Dm755 ${srcdir}/20_memtest86+ ${pkgdir}/etc/grub.d/20_memtest86+
+	pkgdesc="The GNU GRand Unified Bootloader version 2 - i386 UEFI version"
+	depends=("grub2-common=${pkgver}" 'dosfstools')
+	optdepends=('efibootmgr')
+  
+	cd ${srcdir}/grub2_efi-${pkgver}
+	make DESTDIR=${pkgdir} install 
+
+	## remove non platform-specific files
+	rm -rf ${pkgdir}/{bin,sbin,etc,usr/share/info,usr/share/man,usr/lib/grub}
 }
-md5sums=('c0bcf60e524739bb64e3a2d4e3732a59'
-         '0910da120700a6928cd0290211acc79f'
-         '897f8af2fc83fcdaf7329da39f06d3dc'
-         '00ae9ff8991b8f00ab90739859af2921'
-         'fa14d3feabe17ac11dd3163501a66155'
-         '81bcdf26aa01b08b9925d72cbc4c3dab'
-         'ff99d316b0c59e514e5bb641a392d330'
-         '743215998a581a54ac77630f0db222ce'
-         '5a07e04c4ecb8ed145d54fec3043e0d5'
-         '60b0157ed87041541ad0f62e3c7c0577')
+sha1sums=('866b6979974ad7209d236cb4e1819039f0bd1c6d'
+          'f116fed72eb70da1d503cf3c225dce68d658dabd'
+          'b04994c005910b4bf123f034b30109d5c8d6fd86'
+          '963517b6f178d3cec3ff65f64cf6128cbde2f515'
+          '644fe2bd6edaff03bc2e7a27bf1c0845a4568d6f'
+          '2c22c7e900e4da9a555d26d455ed3fbf974d553d'
+          '23cb743d0b864d415b033f71c79ebf182e909264'
+          '88c15058f5079c470d8a5061e0de0f1e8fe1effd'
+          '82a27eca5277218cf57c6c5767e0b17a72f62229'
+          '22bd1a4c18d8b93130ca46348c2a9ea2f8b90c6b')

Added: archlinux_grub2_mkconfig_fixes.patch
===================================================================
--- archlinux_grub2_mkconfig_fixes.patch	                        (rev 0)
+++ archlinux_grub2_mkconfig_fixes.patch	2011-01-28 18:14:06 UTC (rev 107989)
@@ -0,0 +1,93 @@
+diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
+index b041a38..6f31dce 100644
+--- a/util/grub-mkconfig.in
++++ b/util/grub-mkconfig.in
+@@ -252,6 +252,8 @@ export GRUB_DEFAULT \
+   GRUB_THEME \
+   GRUB_GFXPAYLOAD_LINUX \
+   GRUB_DISABLE_OS_PROBER \
++  GRUB_COLOR_NORMAL \
++  GRUB_COLOR_HIGHLIGHT \
+   GRUB_INIT_TUNE \
+   GRUB_SAVEDEFAULT \
+   GRUB_BADRAM
+diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in
+index 420b3f3..79fd4fb 100644
+--- a/util/grub.d/00_header.in
++++ b/util/grub.d/00_header.in
+@@ -100,6 +100,14 @@ cat <<EOF
+ 
+ EOF
+ 
++if [ x$GRUB_COLOR_NORMAL != x ] && [ x$GRUB_COLOR_HIGHLIGHT != x ] ; then
++    cat << EOF
++set menu_color_normal=$GRUB_COLOR_NORMAL
++set menu_color_highlight=$GRUB_COLOR_HIGHLIGHT
++
++EOF
++fi
++
+ serial=0;
+ gfxterm=0;
+ for x in ${GRUB_TERMINAL_INPUT} ${GRUB_TERMINAL_OUTPUT}; do
+diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
+index a09c3e6..cf12ea9 100644
+--- a/util/grub.d/10_linux.in
++++ b/util/grub.d/10_linux.in
+@@ -31,8 +31,8 @@ CLASS="--class gnu-linux --class gnu --class os"
+ if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
+   OS=GNU/Linux
+ else
+-  OS="${GRUB_DISTRIBUTOR} GNU/Linux"
+-  CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr '[A-Z]' '[a-z]' | cut -d' ' -f1) ${CLASS}"
++  OS="${GRUB_DISTRIBUTOR}"
++  CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr '[A-Z]' '[a-z]' | tr -d ' ') ${CLASS}"
+ fi
+ 
+ # loop-AES arranges things so that /dev/loop/X can be our root device, but
+@@ -48,7 +48,7 @@ if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue"
+     || uses_abstraction "${GRUB_DEVICE}" lvm; then
+   LINUX_ROOT_DEVICE=${GRUB_DEVICE}
+ else
+-  LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
++  LINUX_ROOT_DEVICE="/dev/disk/by-uuid/${GRUB_DEVICE_UUID}"
+ fi
+ 
+ linux_entry ()
+@@ -111,7 +111,7 @@ EOF
+ EOF
+ }
+ 
+-list=`for i in /boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* ; do
++list=`for i in /boot/vmlinuz* /boot/vmlinux* /vmlinuz* /vmlinux* ; do
+         if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
+       done`
+ prepare_boot_cache=
+@@ -123,14 +123,12 @@ while [ "x$list" != "x" ] ; do
+   dirname=`dirname $linux`
+   rel_dirname=`make_system_path_relative_to_its_root $dirname`
+   version=`echo $basename | sed -e "s,^[^0-9]*-,,g"`
+-  alt_version=`echo $version | sed -e "s,\.old$,,g"`
++  base_init=`echo $basename | sed -e "s,vmlinuz,kernel,g"`
++  alt_version="${base_init}-fallback"
+   linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
+ 
+   initrd=
+-  for i in "initrd.img-${version}" "initrd-${version}.img" \
+-	   "initrd-${version}" "initramfs-${version}.img" \
+-	   "initrd.img-${alt_version}" "initrd-${alt_version}.img" \
+-	   "initrd-${alt_version}" "initramfs-${alt_version}.img"; do
++  for i in "${base_init}.img"; do
+     if test -e "${dirname}/${i}" ; then
+       initrd="$i"
+       break
+@@ -155,6 +153,9 @@ while [ "x$list" != "x" ] ; do
+ 
+   linux_entry "${OS}" "${version}" false \
+       "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
++  initrd="${alt_version}.img"
++  linux_entry "${OS}" "${version} Fallback" false \
++      "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
+   if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
+     linux_entry "${OS}" "${version}" true \
+ 	"single ${GRUB_CMDLINE_LINUX}"


Property changes on: grub2/trunk/archlinux_grub2_mkconfig_fixes.patch
___________________________________________________________________
Added: svn:executable
   + *



More information about the arch-commits mailing list