add grub 2.00 files

This commit is contained in:
Ronald van Haren 2012-06-28 17:51:38 +00:00
parent ce00477b29
commit a53b449156
7 changed files with 753 additions and 0 deletions

29
20_memtest86+ Normal file
View File

@ -0,0 +1,29 @@
#! /bin/sh -e
########################################################
# This script generates a memtest86+ entry on grub.cfg #
# if memtest is installed on the system. #
########################################################
prefix="/usr"
exec_prefix="${prefix}"
datarootdir="/usr/share"
datadir="${datarootdir}"
. "${datadir}/grub/grub-mkconfig_lib"
MEMTEST86_IMAGE="/boot/memtest86+/memtest.bin"
CLASS="--class memtest86 --class gnu --class tool"
if [ -e $MEMTEST86_IMAGE ] && is_path_readable_by_grub $MEMTEST86_IMAGE; then
# image exists, create menu entry
echo "Found memtest86+ image: $MEMTEST86_IMAGE" >&2
cat << EOF
menuentry "Memory test (memtest86+)" $CLASS {
EOF
prepare_grub_to_access_device `${grub_probe} --target=device $MEMTEST86_IMAGE` | sed -e "s/^/ /"
cat << EOF
linux16 (\$root)`make_system_path_relative_to_its_root $MEMTEST86_IMAGE`
}
EOF
fi

249
PKGBUILD Normal file
View File

@ -0,0 +1,249 @@
# Maintainer: Ronald van Haren <ronald.archlinux.org>
# Contributor: Keshav P R <(the.ridikulus.rat) (aatt) (gemmaeiil) (ddoott) (ccoomm)>
_grub_lua_ver=24
_grub_ntldr_ver=21
_grub_915_ver=9
pkgname=('grub-common' 'grub-bios' 'grub-efi-i386')
pkgbase=grub
pkgver=2.00
pkgrel=1
url="https://www.gnu.org/software/grub/"
arch=('i686' 'x86_64')
license=('GPL3')
makedepends=('xz' 'bdf-unifont' 'ttf-dejavu' 'python' 'autogen'
'texinfo' 'help2man' 'gettext' 'device-mapper' 'fuse')
source=("http://ftp.gnu.org/gnu/grub/grub-${pkgver}.tar.xz"
"ftp://ftp.archlinux.org/other/grub2/grub2_extras_lua_r${_grub_lua_ver}.tar.xz"
"ftp://ftp.archlinux.org/other/grub2/grub2_extras_ntldr-img_r${_grub_ntldr_ver}.tar.xz"
"ftp://ftp.archlinux.org/other/grub2/grub2_extras_915resolution_r${_grub_915_ver}.tar.xz"
'archlinux_grub_mkconfig_fixes.patch'
'grub.default'
'grub.cfg'
'20_memtest86+'
'grub_bzr_export.sh')
noextract=("grub2_extras_lua_r${_grub_lua_ver}.tar.xz"
"grub2_extras_ntldr-img_r${_grub_ntldr_ver}.tar.xz"
"grub2_extras_915resolution_r${_grub_915_ver}.tar.xz")
sha1sums=('274d91e96b56a5b9dd0a07accff69dbb6dfb596b'
'89290031b974780c6df76893836d2477d4add895'
'eb4b35b4c36b64f9405cbcbc538cb205171c1c0a'
'd5ae2efec25616028a9d89e98b6e454f1c4c415f'
'26e4e946190bea1f03632658cf08ba90e11dec57'
'dbf493dec4722feb11f0b5c71ad453a18daf0fc5'
'76ae862a945a8848e6999adf8ad1847f0f7008b9'
'ce35d7ae75cd1b5b677e894e528f96add40e77b9'
'0cfd4e51cdb14a92f06cfd3c607f2aa21f3e55fc')
_build_grub-common_and_bios() {
## copy the source for building the common/bios package
cp -r "${srcdir}/grub-${pkgver}" "${srcdir}/grub_bios-${pkgver}"
cd "${srcdir}/grub_bios-${pkgver}"
## Apply Archlinux specific fixes to enable grub-mkconfig detect Arch kernels and initramfs
patch -Np1 -i "${srcdir}/archlinux_grub_mkconfig_fixes.patch"
echo
## fix unifont.bdf location so that grub-mkfont can create *.pf2 files
sed 's|/usr/share/fonts/unifont|/usr/share/fonts/unifont /usr/share/fonts/misc|g' -i "${srcdir}/grub_bios-${pkgver}/configure.ac"
## fix DejaVuSans.ttf location so that grub-mkfont can create *.pf2 files for starfield theme
sed 's|/usr/share/fonts/dejavu|/usr/share/fonts/dejavu /usr/share/fonts/TTF|g' -i "${srcdir}/grub_bios-${pkgver}/configure.ac"
## add the grub-extra sources
export GRUB_CONTRIB="${srcdir}/grub_bios-${pkgver}/grub-extras/"
install -d "${srcdir}/grub_bios-${pkgver}/grub-extras"
bsdtar xf "${srcdir}/grub2_extras_lua_r${_grub_lua_ver}.tar.xz" \
-C "${srcdir}/grub_bios-${pkgver}/grub-extras"
bsdtar xf "${srcdir}/grub2_extras_ntldr-img_r${_grub_ntldr_ver}.tar.xz" \
-C "${srcdir}/grub_bios-${pkgver}/grub-extras"
bsdtar xf "${srcdir}/grub2_extras_915resolution_r${_grub_915_ver}.tar.xz" \
-C "${srcdir}/grub_bios-${pkgver}/grub-extras"
## Requires python2
# sed 's|python |python2 |g' -i "${srcdir}/grub_bios-${pkgver}/autogen.sh"
## start the actual build process
cd "${srcdir}/grub_bios-${pkgver}"
./autogen.sh
echo
CFLAGS="" ./configure \
--with-platform="pc" \
--target="i386" \
--host="${CARCH}-unknown-linux-gnu" \
"${_EFIEMU}" \
--enable-mm-debug \
--enable-nls \
--enable-device-mapper \
--enable-cache-stats \
--enable-grub-mkfont \
--enable-grub-mount \
--prefix="/usr" \
--bindir="/usr/bin" \
--sbindir="/usr/sbin" \
--mandir="/usr/share/man" \
--infodir="/usr/share/info" \
--datarootdir="/usr/share" \
--sysconfdir="/etc" \
--program-prefix="" \
--with-bootdir="/boot" \
--with-grubdir="grub" \
--disable-werror
echo
CFLAGS="" make
echo
}
_build_grub-efi-i386() {
## copy the source for building the efi package
cp -r "${srcdir}/grub-${pkgver}" "${srcdir}/grub_efi-${pkgver}"
cd "${srcdir}/grub_efi-${pkgver}"
export GRUB_CONTRIB="${srcdir}/grub_efi-${pkgver}/grub-extras/"
install -d "${srcdir}/grub_efi-${pkgver}/grub-extras"
bsdtar xf "${srcdir}/grub2_extras_lua_r${_grub_lua_ver}.tar.xz" \
-C "${srcdir}/grub_efi-${pkgver}/grub-extras"
cd "${srcdir}/grub_efi-${pkgver}"
./autogen.sh
echo
CFLAGS="" ./configure \
--with-platform="efi" \
--target="i386" \
--host="${CARCH}-unknown-linux-gnu" \
--disable-efiemu \
--enable-mm-debug \
--enable-nls \
--enable-device-mapper \
--enable-cache-stats \
--enable-grub-mkfont \
--enable-grub-mount \
--prefix="/usr" \
--bindir="/usr/bin" \
--sbindir="/usr/sbin" \
--mandir="/usr/share/man" \
--infodir="/usr/share/info" \
--datarootdir="/usr/share" \
--sysconfdir="/etc" \
--program-prefix="" \
--with-bootdir="/boot" \
--with-grubdir="grub" \
--disable-werror
echo
CFLAGS="" make
echo
}
build() {
## set architecture dependent variables
if [[ "${CARCH}" == 'x86_64' ]]; then
_EFIEMU="--enable-efiemu"
else
_EFIEMU="--disable-efiemu"
fi
_HOST="${CARCH}"
cd "${srcdir}/grub-${pkgver}"
# _get_locale_files
_build_grub-common_and_bios
echo
_build_grub-efi-i386
echo
}
package_grub-common() {
pkgdesc="GNU GRand Unified Bootloader - Utilities and Common Files"
depends=('sh' 'xz' 'freetype2' 'gettext' 'device-mapper' 'fuse')
conflicts=('grub-legacy' 'grub')
replaces=('grub2-common')
provides=('grub2-common')
backup=('boot/grub/grub.cfg' 'etc/default/grub' 'etc/grub.d/40_custom')
optdepends=('libisoburn: provides xorriso for generating grub rescue iso using grub-mkrescue'
'os-prober: to detect other OSes when generating grub.cfg in BIOS systems'
'mtools: for grub-mkrescue FAT FS support')
install="grub.install"
options=('strip' 'purge' 'docs' 'zipman' '!emptydirs')
cd "${srcdir}/grub_bios-${pkgver}"
make DESTDIR="${pkgdir}/" bashcompletiondir="/usr/share/bash-completion/completions" install
echo
## install extra /etc/grub.d/ files
install -D -m0755 "${srcdir}/20_memtest86+" "${pkgdir}/etc/grub.d/20_memtest86+"
## install /etc/default/grub (used by grub-mkconfig)
install -D -m0644 "${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 -D -m0644 "${srcdir}/grub.cfg" "${pkgdir}/boot/grub/grub.cfg"
# remove platform specific files
rm -rf "${pkgdir}/usr/lib/grub/i386-pc/"
}
package_grub-bios() {
pkgdesc="GNU GRand Unified Bootloader - i386 PC BIOS Modules"
depends=("grub-common=${pkgver}")
options=('!strip' '!emptydirs')
replaces=('grub2-bios')
provides=('grub2-bios')
cd "${srcdir}/grub_bios-${pkgver}"
make DESTDIR="${pkgdir}/" install
echo
## remove non platform-specific files
rm -rf "${pkgdir}"/{boot,etc,usr/{share,bin,sbin}}
## remove gdb debugging related files
rm -f "${pkgdir}/usr/lib/grub/i386-pc"/*.module || true
rm -f "${pkgdir}/usr/lib/grub/i386-pc"/*.image || true
rm -f "${pkgdir}/usr/lib/grub/i386-pc"/{kernel.exec,gdb_grub,gmodule.pl} || true
}
package_grub-efi-i386() {
pkgdesc="GNU GRand Unified Bootloader - i386 UEFI Modules"
depends=("grub-common=${pkgver}" 'dosfstools' 'efibootmgr')
options=('!strip' '!emptydirs')
replaces=('grub2-efi-i386')
provides=('grub2-efi-i386')
cd "${srcdir}/grub_efi-${pkgver}"
make DESTDIR="${pkgdir}/" install
echo
## remove non platform-specific files
rm -rf "${pkgdir}"/{boot,etc,usr/{share,bin,sbin}}
## remove gdb debugging related files
rm -f "${pkgdir}/usr/lib/grub/i386-efi"/*.module || true
rm -f "${pkgdir}/usr/lib/grub/i386-efi"/*.image || true
rm -f "${pkgdir}/usr/lib/grub/i386-efi"/{kernel.exec,gdb_grub,gmodule.pl} || true
}

View File

@ -0,0 +1,143 @@
diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
index 516be86..5f37db2 100644
--- a/util/grub-mkconfig.in
+++ b/util/grub-mkconfig.in
@@ -213,6 +213,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_ENABLE_CRYPTODISK \
diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in
index 765bfdc..b148558 100644
--- a/util/grub.d/00_header.in
+++ b/util/grub.d/00_header.in
@@ -115,6 +115,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 14402e8..64c9bb5 100644
--- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in
@@ -87,6 +87,8 @@ linux_entry ()
case $type in
recovery)
title="$(gettext_printf "%s, with Linux %s (recovery mode)" "${os}" "${version}")" ;;
+ fallback)
+ title="$(gettext_printf "%s, with Linux %s (Fallback initramfs)" "${os}" "${version}")" ;;
*)
title="$(gettext_printf "%s, with Linux %s" "${os}" "${version}")" ;;
esac
@@ -100,7 +102,7 @@ linux_entry ()
else
echo "menuentry '$(echo "$os" | grub_quote)' ${CLASS} \$menuentry_id_option 'gnulinux-simple-$boot_device_id' {" | sed "s/^/$submenu_indentation/"
fi
- if [ x$type != xrecovery ] ; then
+ if [ x$type != xrecovery ] && [ x$type != xfallback ] ; then
save_default_entry | sed -e "s/^/\t/"
fi
@@ -132,7 +134,8 @@ linux_entry ()
fi
printf '%s\n' "${prepare_boot_cache}" | sed "s/^/$submenu_indentation/"
fi
- message="$(gettext_printf "Loading Linux %s ..." ${version})"
+
+ message="$(gettext_printf "Loading Linux %s ..." "${version}")"
sed "s/^/$submenu_indentation/" << EOF
echo '$message'
linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
@@ -190,7 +193,22 @@ while [ "x$list" != "x" ] ; do
alt_version=`echo $version | sed -e "s,\.old$,,g"`
linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
+ if test -e "/etc/arch-release" ; then
+ if echo "${basename}" | grep -q 'vmlinuz-linux' ; then
+ version="`echo "${basename}" | sed -e 's,vmlinuz-linux,,g'`"
+
+ if [ "x${version}" = "x" ] ; then
+ version="core repo kernel"
+ else
+ version="`echo "${version}" | sed -e 's,-,,g'`"
+ version="${version} kernel"
+ fi
+ fi
+ fi
+
initrd=
+ initrd_arch="`echo "${basename}" | sed -e 's,vmlinuz,initramfs,g'`"
+
for i in "initrd.img-${version}" "initrd-${version}.img" "initrd-${version}.gz" \
"initrd-${version}" "initramfs-${version}.img" \
"initrd.img-${alt_version}" "initrd-${alt_version}.img" \
@@ -198,7 +216,8 @@ while [ "x$list" != "x" ] ; do
"initramfs-genkernel-${version}" \
"initramfs-genkernel-${alt_version}" \
"initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \
- "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}"; do
+ "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}" \
+ "${initrd_arch}.img" ; do
if test -e "${dirname}/${i}" ; then
initrd="$i"
break
@@ -226,6 +245,22 @@ while [ "x$list" != "x" ] ; do
linux_root_device_thisversion=${GRUB_DEVICE}
fi
+ if test -e "/etc/arch-release" ; then
+ is_first_entry="false"
+
+ linux_entry "${OS}" "${version}" true \
+ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
+
+ for i in "${initrd_arch}-fallback.img" "initramfs-${version}-fallback.img" ; do
+ if test -e "${dirname}/${i}" ; then
+ initrd="${i}"
+ linux_entry "${OS}" "${version}" fallback \
+ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
+ break
+ fi
+ done
+ fi
+
if [ "x$is_first_entry" = xtrue ]; then
linux_entry "${OS}" "${version}" simple \
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
@@ -239,8 +274,11 @@ while [ "x$list" != "x" ] ; do
echo "submenu '$(gettext_printf "Advanced options for %s" "${OS}" | grub_quote)' \$menuentry_id_option 'gnulinux-advanced-$boot_device_id' {"
fi
+ if ! test -e "/etc/arch-release" ; then
linux_entry "${OS}" "${version}" advanced \
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
+ fi
+
if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
linux_entry "${OS}" "${version}" recovery \
"single ${GRUB_CMDLINE_LINUX}"
@@ -252,8 +290,10 @@ done
# If at least one kernel was found, then we need to
# add a closing '}' for the submenu command.
+if ! test -e "/etc/arch-release" ; then
if [ x"$is_first_entry" != xtrue ]; then
echo '}'
fi
+fi
echo "$title_correction_code"

139
grub.cfg Normal file
View File

@ -0,0 +1,139 @@
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
load_env
fi
set default="0"
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi
export menuentry_id_option
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
if [ x$feature_default_font_path = xy ] ; then
font=unicode
else
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 ad4103fa-d940-47ca-8506-301d8071d467
else
search --no-floppy --fs-uuid --set=root ad4103fa-d940-47ca-8506-301d8071d467
fi
font="/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
set gfxmode=auto
load_video
insmod gfxterm
set locale_dir=$prefix/locale
set lang=en_US
insmod gettext
fi
terminal_input console
terminal_output gfxterm
set timeout=5
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch GNU/Linux, with Linux core repo kernel' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-core repo kernel-true-ad4103fa-d940-47ca-8506-301d8071d467' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 ad4103fa-d940-47ca-8506-301d8071d467
else
search --no-floppy --fs-uuid --set=root ad4103fa-d940-47ca-8506-301d8071d467
fi
echo 'Loading Linux core repo kernel ...'
linux /boot/vmlinuz-linux root=UUID=ad4103fa-d940-47ca-8506-301d8071d467 ro quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initramfs-linux.img
}
menuentry 'Arch GNU/Linux, with Linux core repo kernel (Fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-core repo kernel-fallback-ad4103fa-d940-47ca-8506-301d8071d467' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5 ad4103fa-d940-47ca-8506-301d8071d467
else
search --no-floppy --fs-uuid --set=root ad4103fa-d940-47ca-8506-301d8071d467
fi
echo 'Loading Linux core repo kernel ...'
linux /boot/vmlinuz-linux root=UUID=ad4103fa-d940-47ca-8506-301d8071d467 ro quiet
echo 'Loading initial ramdisk ...'
initrd /boot/initramfs-linux-fallback.img
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/20_memtest86+ ###
### END /etc/grub.d/20_memtest86+ ###
### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

47
grub.default Normal file
View File

@ -0,0 +1,47 @@
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Arch"
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX=""
# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"
# Uncomment to enable Hidden Menu, and optionally hide the timeout count
#GRUB_HIDDEN_TIMEOUT=5
#GRUB_HIDDEN_TIMEOUT_QUIET=true
# Uncomment to use basic console
GRUB_TERMINAL_INPUT=console
# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT=console
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=auto
# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=keep
# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY=true
# Uncomment and set to the desired menu colors. Used by normal and wallpaper
# modes only. Entries specified as foreground/background.
#GRUB_COLOR_NORMAL="light-blue/black"
#GRUB_COLOR_HIGHLIGHT="light-cyan/blue"
# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/path/to/wallpaper"
#GRUB_THEME="/path/to/gfxtheme"
# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"
#GRUB_SAVEDEFAULT="true"

33
grub.install Normal file
View File

@ -0,0 +1,33 @@
infodir="usr/share/info"
filelist=('grub.info' 'grub-dev.info')
post_install() {
if [ -f /boot/grub/grub.cfg.pacsave ]; then
echo "Copying /boot/grub/grub.cfg.pacsave to /boot/grub/grub.cfg"
install -D -m0644 /boot/grub/grub.cfg.pacsave /boot/grub/grub.cfg
fi
cat << 'EOM'
Generating grub.cfg.example config file...
This may fail on some machines running a custom kernel.
EOM
grub-mkconfig -o /boot/grub/grub.cfg.example 2> /dev/null
echo "done."
for file in ${filelist[@]}; do
install-info ${infodir}/${file}.gz ${infodir}/dir 2> /dev/null
done
}
post_upgrade() {
for file in ${filelist[@]}; do
install-info ${infodir}/${file}.gz ${infodir}/dir 2> /dev/null
done
}
pre_remove() {
for file in ${filelist[@]}; do
install-info --delete ${infodir}/${file} ${infodir}/dir 2> /dev/null
done
}

113
grub_bzr_export.sh Normal file
View File

@ -0,0 +1,113 @@
#!/usr/bin/env bash
## For actual repos
# bzr branch bzr://bzr.savannah.gnu.org/grub-extras/lua lua
# bzr branch bzr://bzr.savannah.gnu.org/grub-extras/gpxe gpxe
# bzr branch bzr://bzr.savannah.gnu.org/grub-extras/ntldr-img ntldr-img
# bzr branch bzr://bzr.savannah.gnu.org/grub-extras/915resolution 915resolution
## For launchpad mirror
# bzr branch lp:~the-ridikulus-rat/grub/grub-extras-lua lua
# bzr branch lp:~the-ridikulus-rat/grub/grub-extras-gpxe gpxe
# bzr branch lp:~the-ridikulus-rat/grub/grub-extras-ntldr-img ntldr-img
# bzr branch lp:~the-ridikulus-rat/grub/grub-extras-915resolution 915resolution
## grub-extras zfs is integrated into grub bzr main repo and is no longer needed separately.
_WD="${PWD}/"
_OUTPUT_DIR="${_WD}/"
_ACTUAL_PKGVER="2.00"
_GRUB_BZR_REPO_DIR="${_WD}/grub_mainline_BZR/"
_GRUB_BZR_EXP_REPO_DIR="${_WD}/grub_experimental_BZR/"
_GRUB_EXTRAS_REPOS_DIR="${_WD}/grub_extras_BZR/"
_MAIN_SNAPSHOT() {
cd "${_GRUB_BZR_REPO_DIR}/"
echo
_REVNUM="$(bzr revno ${_GRUB_BZR_REPO_DIR})"
bzr export --root="grub-${_ACTUAL_PKGVER}" --format="tar" "${_OUTPUT_DIR}/grub_r${_REVNUM}.tar"
echo
cd "${_OUTPUT_DIR}/"
xz -9 "${_OUTPUT_DIR}/grub_r${_REVNUM}.tar"
echo
}
_EXP_SNAPSHOT() {
cd "${_GRUB_BZR_EXP_REPO_DIR}/"
echo
_REVNUM="$(bzr revno ${_GRUB_BZR_EXP_REPO_DIR})"
bzr export --root="grub-${_ACTUAL_PKGVER}" --format="tar" "${_OUTPUT_DIR}/grub_exp_r${_REVNUM}.tar"
echo
cd "${_OUTPUT_DIR}/"
xz -9 "${_OUTPUT_DIR}/grub_exp_r${_REVNUM}.tar"
echo
}
_EXTRAS_SNAPSHOT() {
cd "${_GRUB_EXTRAS_REPOS_DIR}/${_GRUB_EXTRAS_NAME}/"
echo
_REVNUM="$(bzr revno ${_GRUB_EXTRAS_REPOS_DIR}/${_GRUB_EXTRAS_NAME})"
bzr export --root="${_GRUB_EXTRAS_NAME}" --format="tar" "${_OUTPUT_DIR}/grub_extras_${_GRUB_EXTRAS_NAME}_r${_REVNUM}.tar"
echo
cd "${_OUTPUT_DIR}/"
echo
xz -9 "${_OUTPUT_DIR}/grub_extras_${_GRUB_EXTRAS_NAME}_r${_REVNUM}.tar"
echo
}
echo
set -x -e
echo
_MAIN_SNAPSHOT
echo
# _EXP_SNAPSHOT
echo
_GRUB_EXTRAS_NAME="lua"
_EXTRAS_SNAPSHOT
# _GRUB_EXTRAS_NAME="gpxe"
# _EXTRAS_SNAPSHOT
_GRUB_EXTRAS_NAME="ntldr-img"
_EXTRAS_SNAPSHOT
_GRUB_EXTRAS_NAME="915resolution"
_EXTRAS_SNAPSHOT
echo
set +x +e
echo
unset _WD
unset _OUTPUT_DIR
unset _GRUB_BZR_REPO_DIR
unset _GRUB_EXTRAS_REPOS_DIR
unset _GRUB_EXTRAS_NAME