mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-01-23 18:14:54 +08:00
grub2: fix quirks
This commit is contained in:
parent
4cf6f4b885
commit
8d04c0493b
@ -1,6 +0,0 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
cat << EOF
|
||||
set menu_color_normal=light-blue/black
|
||||
set menu_color_highlight=light-cyan/blue
|
||||
EOF
|
@ -1,6 +0,0 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
cat << EOF
|
||||
set menu_color_normal=light-blue/black
|
||||
set menu_color_highlight=light-cyan/blue
|
||||
EOF
|
282
grub2/PKGBUILD
282
grub2/PKGBUILD
@ -1,5 +1,8 @@
|
||||
# Maintainer: Ronald van Haren <ronald.chakra.org>
|
||||
# Contributor: Keshav P R <skodabenz at rocketmail dot com>
|
||||
#
|
||||
# Core Packages for Chakra, part of chakra-project.org
|
||||
#
|
||||
# maintainer (i686): Phil Miller <philm[at]chakra-project[dot]org
|
||||
# maintainer (x86_64): Daniele Cocca <jmc[at]chakra-project[dot]org>
|
||||
|
||||
# The src pkg includes grub2_bzr_export.sh to create newer grub-extras snapshots. Modify the paths in it accordingly.
|
||||
|
||||
@ -10,10 +13,10 @@ _grub2_gpxe_ver=12
|
||||
_grub2_ntldr_ver=17
|
||||
_grub2_915_ver=7
|
||||
|
||||
pkgname=('grub2-common' 'grub2-bios' 'grub2-efi-i386')
|
||||
pkgname=('grub2-common' 'grub2-bios' 'grub2-efi-x32')
|
||||
pkgbase="grub2"
|
||||
pkgver='1.99'
|
||||
pkgrel=3
|
||||
pkgrel=7
|
||||
url="http://www.gnu.org/software/grub/"
|
||||
arch=('i686' 'x86_64')
|
||||
license=('GPL3')
|
||||
@ -21,187 +24,196 @@ epoch=1
|
||||
makedepends=('bdf-unifont' 'python2' 'xz' 'autogen' 'texinfo' 'help2man' 'gettext' 'device-mapper')
|
||||
options=(strip purge docs zipman !emptydirs)
|
||||
|
||||
# "http://alpha.gnu.org/gnu/grub/grub-${pkgver}.tar.xz"
|
||||
# "http://alpha.gnu.org/gnu/grub/grub-${pkgver}.tar.xz"
|
||||
source=("ftp://ftp.gnu.org/gnu/grub/grub-1.99.tar.xz"
|
||||
"ftp://http://chakra-project.org/sources/grub2/grub2_extras_lua_r${_grub2_lua_ver}.tar.xz"
|
||||
"ftp://http://chakra-project.org/sources/grub2/grub2_extras_gpxe_r${_grub2_gpxe_ver}.tar.xz"
|
||||
"ftp://http://chakra-project.org/sources/grub2/grub2_extras_ntldr-img_r${_grub2_ntldr_ver}.tar.xz"
|
||||
"ftp://http://chakra-project.org/sources/grub2/grub2_extras_915resolution_r${_grub2_915_ver}.tar.xz"
|
||||
'chakra_grub2_mkconfig_fixes.patch'
|
||||
'grub.default'
|
||||
'grub.cfg'
|
||||
'20_memtest86+'
|
||||
'grub2_bzr_export.sh'
|
||||
"http://chakra-linux.org/sources/grub2/grub2_extras_lua_r${_grub2_lua_ver}.tar.xz"
|
||||
"http://chakra-linux.org/sources/grub2/grub2_extras_gpxe_r${_grub2_gpxe_ver}.tar.xz"
|
||||
"http://chakra-linux.org/sources/grub2/grub2_extras_ntldr-img_r${_grub2_ntldr_ver}.tar.xz"
|
||||
"http://chakra-linux.org/sources/grub2/grub2_extras_915resolution_r${_grub2_915_ver}.tar.xz"
|
||||
'chakra_grub2_mkconfig_fixes.patch'
|
||||
'resume-hook.patch'
|
||||
'grub.default'
|
||||
'20_memtest86+'
|
||||
'grub2_bzr_export.sh'
|
||||
'update-grub')
|
||||
|
||||
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")
|
||||
"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")
|
||||
|
||||
sha1sums=('a5ae9558f30ce7757a76aa130088b053a87e2fb6'
|
||||
'd21ca5033f7069cbb36934cdb71f57a1c7829234'
|
||||
'6c58eee654fa4eb7f057275b330710ffd4a9e989'
|
||||
'0e50955141a45918fcf56f3a5e15fb477f0448a7'
|
||||
'f2a5f1d5b75bd3286b63aefaf5e6553aa03e772b'
|
||||
'b7e5510c7b171e9c4dbddb42bbf54ce5ee86e2de'
|
||||
'e1477db3700b27b5e5ad3d8fa43028555204759b'
|
||||
'8948d89537c12a4202df7c001e65a77030bbe5a3'
|
||||
'd44bb9c9b95a6999560d3b7300e05e14e85fcfc6'
|
||||
'16424e596f4f1e976b626e0d43e9772fb80f8acb'
|
||||
'c6192dbda83d11871eb81024fef7679685310005'
|
||||
'82a27eca5277218cf57c6c5767e0b17a72f62229'
|
||||
'beb31419045db70fee7401aa6448c220a491e2a3'
|
||||
'5770fbb559b1f463e1a735a1463d24af489bcc3e')
|
||||
|
||||
build() {
|
||||
# set architecture dependent variables
|
||||
if [ "${CARCH}" = "x86_64" ] ; then
|
||||
_EFIEMU="--enable-efiemu"
|
||||
else
|
||||
_EFIEMU="--disable-efiemu"
|
||||
fi
|
||||
_HOST="${CARCH}"
|
||||
# set architecture dependent variables
|
||||
_HOST="${CARCH}"
|
||||
[ "${CARCH}" = 'i686' ] && _EFIEMU="--disable-efiemu"
|
||||
[ "${CARCH}" = 'x86_64' ] && _EFIEMU="--enable-efiemu"
|
||||
|
||||
build_grub2-common_and_bios
|
||||
build_grub2-efi
|
||||
build_grub2-common_and_bios
|
||||
build_grub2-efi
|
||||
}
|
||||
|
||||
build_grub2-common_and_bios() {
|
||||
# copy the source for building the common/bios package
|
||||
cp -r ${srcdir}/grub-${pkgver} ${srcdir}/grub2_bios-${pkgver}
|
||||
# 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}/chakra_grub2_mkconfig_fixes.patch
|
||||
## Apply Chakra specific fixes to enable grub2-mkconfig detect Chakra kernels and initramfs
|
||||
cd "${srcdir}/grub2_bios-${pkgver}"
|
||||
patch -Np1 -i "${srcdir}/chakra_grub2_mkconfig_fixes.patch"
|
||||
|
||||
# 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
|
||||
# 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
|
||||
cd "${srcdir}/grub2_bios-${pkgver}"
|
||||
|
||||
# start the actual build process
|
||||
cd ${srcdir}/grub2_bios-${pkgver}
|
||||
./autogen.sh
|
||||
## Need to use python2
|
||||
sed -i 's|python|python2|' autogen.sh
|
||||
|
||||
# start the actual build process
|
||||
./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
|
||||
## fix unifont.bdf location so grub-mkfont can create *.pf2 files
|
||||
sed -i 's|/usr/share/fonts/unifont|/usr/share/fonts/misc|' configure
|
||||
|
||||
# mkdir ${srcdir}/grub2_bios-${pkgver}/BUILD_BIOS
|
||||
# cd ${srcdir}/grub2_bios-${pkgver}/BUILD_BIOS
|
||||
# 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 --enable-nls \
|
||||
--program-transform-name=s,grub,grub,
|
||||
CFLAGS="" make
|
||||
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 --enable-nls \
|
||||
--program-transform-name=s,grub,grub,
|
||||
|
||||
CFLAGS="" make
|
||||
}
|
||||
|
||||
build_grub2-efi() {
|
||||
# copy the source for building the efi package
|
||||
cp -r ${srcdir}/grub-${pkgver} ${srcdir}/grub2_efi-${pkgver}
|
||||
# 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
|
||||
# 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
|
||||
cd "${srcdir}/grub2_efi-${pkgver}"
|
||||
|
||||
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 \
|
||||
--enable-nls --program-transform-name=s,grub,grub,
|
||||
CFLAGS="" make
|
||||
## Need to use python2
|
||||
sed -i 's|python|python2|' autogen.sh
|
||||
|
||||
# start the actual build process
|
||||
./autogen.sh
|
||||
|
||||
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 \
|
||||
--enable-nls --program-transform-name=s,grub,grub,
|
||||
|
||||
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' 'gettext' 'texinfo')
|
||||
conflicts=('grub')
|
||||
backup=('boot/grub/grub.cfg' 'etc/default/grub' 'etc/grub.d/40_custom')
|
||||
cd ${srcdir}/grub2_bios-${pkgver}
|
||||
make DESTDIR=${pkgdir} install
|
||||
pkgdesc="The GNU GRand Unified Bootloader version 2 - Files common for all platforms"
|
||||
install="grub2.install"
|
||||
depends=('xz' 'freetype2' 'device-mapper' 'gettext' 'texinfo')
|
||||
conflicts=('grub')
|
||||
backup=('boot/grub/grub.cfg' 'etc/default/grub' 'etc/grub.d/40_custom')
|
||||
|
||||
cd "${srcdir}/grub2_bios-${pkgver}"
|
||||
make DESTDIR="${pkgdir}" install
|
||||
|
||||
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
|
||||
# install update-burg script
|
||||
install -Dm755 ${srcdir}/update-grub ${pkgdir}/sbin/update-grub
|
||||
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"
|
||||
|
||||
# install update-burg script
|
||||
install -Dm755 "${srcdir}/update-grub" "${pkgdir}/sbin/update-grub"
|
||||
|
||||
sed -i "s|^\(target_cpu\)=.*|\1=i386|; \
|
||||
s|^\(platform\)=.*|\1=pc|" \
|
||||
${pkgdir}/sbin/grub_bios-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=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
|
||||
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}/20_memtest86+ ${pkgdir}/etc/grub.d/20_memtest86+
|
||||
## install extra /etc/grub.d/ files
|
||||
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 /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 -Dm644 ${srcdir}/grub.cfg ${pkgdir}/boot/grub/grub.cfg
|
||||
## create blank grub.cfg so it won't get removed on upgrade
|
||||
mkdir -p "${pkgdir}/boot/grub"
|
||||
touch "${pkgdir}/boot/grub/grub.cfg"
|
||||
|
||||
# remove platform specific files
|
||||
rm -rf ${pkgdir}/usr/lib/grub/i386-pc/
|
||||
# remove platform specific files
|
||||
rm -rf "${pkgdir}/usr/lib/grub/i386-pc"
|
||||
|
||||
# add resume-hook support
|
||||
cd ${pkgdir}/sbin
|
||||
patch -Np0 -i ${srcdir}/resume-hook.patch
|
||||
}
|
||||
|
||||
package_grub2-bios() {
|
||||
pkgdesc="The GNU GRand Unified Bootloader version 2 - Built for PC BIOS"
|
||||
depends=(grub2-common=${epoch}:${pkgver})
|
||||
replaces=('grub2')
|
||||
provides=('grub2')
|
||||
pkgdesc="The GNU GRand Unified Bootloader version 2 - Built for PC BIOS"
|
||||
depends=("grub2-common=${pkgver}")
|
||||
replaces=('grub2')
|
||||
provides=('grub2')
|
||||
|
||||
cd ${srcdir}/grub2_bios-${pkgver}
|
||||
make DESTDIR=${pkgdir} install
|
||||
cd "${srcdir}/grub2_bios-${pkgver}"
|
||||
make DESTDIR="${pkgdir}" install
|
||||
|
||||
## 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}
|
||||
## 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}
|
||||
}
|
||||
|
||||
package_grub2-efi-i386() {
|
||||
|
||||
pkgdesc="The GNU GRand Unified Bootloader version 2 - i386 UEFI version"
|
||||
depends=("grub2-common=${epoch}:${pkgver}" 'dosfstools' 'efibootmgr')
|
||||
optdepends=('mtools')
|
||||
package_grub2-efi-x32() {
|
||||
pkgdesc="The GNU GRand Unified Bootloader version 2 - i386 UEFI version"
|
||||
depends=("grub2-common=${pkgver}" 'dosfstools' 'efibootmgr')
|
||||
optdepends=('mtools')
|
||||
|
||||
cd ${srcdir}/grub2_efi-${pkgver}
|
||||
make DESTDIR=${pkgdir} install
|
||||
cd "${srcdir}/grub2_efi-${pkgver}"
|
||||
make DESTDIR="${pkgdir}" install
|
||||
|
||||
## 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}
|
||||
## 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}
|
||||
}
|
||||
|
||||
# vim:set ts=2 sw=2 et:
|
||||
|
@ -1,35 +0,0 @@
|
||||
diff -urN grub-1.98.orig/util/grub.d/00_header.in grub-1.98/util/grub.d/00_header.in
|
||||
--- grub-1.98.orig/util/grub.d/00_header.in 2010-03-10 20:30:56.319608325 -0400
|
||||
+++ grub-1.98/util/grub.d/00_header.in 2010-03-10 23:01:20.856612701 -0400
|
||||
@@ -104,6 +104,20 @@
|
||||
terminal gfxterm
|
||||
fi
|
||||
EOF
|
||||
+if [ x$GRUB_BACKGROUND != x ] && [ -f $GRUB_BACKGROUND ] \
|
||||
+ && is_path_readable_by_grub $GRUB_BACKGROUND; then
|
||||
+ echo "Found background: $GRUB_BACKGROUND" >&2
|
||||
+ case $GRUB_BACKGROUND in
|
||||
+ *.png) reader=png ;;
|
||||
+ *.tga) reader=tga ;;
|
||||
+ *.jpg|*.jpeg) reader=jpeg ;;
|
||||
+ esac
|
||||
+ prepare_grub_to_access_device `${grub_probe} --target=device $GRUB_BACKGROUND` | sed -e "s/^/ /"
|
||||
+ cat << EOF
|
||||
+ insmod $reader
|
||||
+ background_image (\$root)`make_system_path_relative_to_its_root $GRUB_BACKGROUND`
|
||||
+EOF
|
||||
+fi
|
||||
if [ x$GRUB_THEME != x ] && [ -f $GRUB_THEME ] \
|
||||
&& is_path_readable_by_grub $GRUB_THEME; then
|
||||
echo "Found theme: $GRUB_THEME" >&2
|
||||
diff -urN grub-1.98.orig/util/grub-mkconfig.in grub-1.98/util/grub-mkconfig.in
|
||||
--- grub-1.98.orig/util/grub-mkconfig.in 2010-03-10 20:30:56.319608325 -0400
|
||||
+++ grub-1.98/util/grub-mkconfig.in 2010-03-10 20:34:00.689582261 -0400
|
||||
@@ -220,6 +220,7 @@
|
||||
GRUB_DISABLE_LINUX_UUID \
|
||||
GRUB_DISABLE_LINUX_RECOVERY \
|
||||
GRUB_GFXMODE \
|
||||
+ GRUB_BACKGROUND \
|
||||
GRUB_THEME \
|
||||
GRUB_GFXPAYLOAD_LINUX \
|
||||
GRUB_DISABLE_OS_PROBER \
|
43
grub2/chakra_grub2_mkconfig_fixes.patch
Executable file → Normal file
43
grub2/chakra_grub2_mkconfig_fixes.patch
Executable file → Normal file
@ -1,6 +1,18 @@
|
||||
diff -Nur a/util/grub.d/00_header.in b/util/grub.d/00_header.in
|
||||
--- a/util/grub.d/00_header.in 2011-04-06 13:14:27.000000000 +0200
|
||||
+++ b/util/grub.d/00_header.in 2011-08-01 15:19:57.919100452 +0200
|
||||
diff -Naur a/util/grub-mkconfig.in b/util/grub-mkconfig.in
|
||||
--- a/util/grub-mkconfig.in 2011-12-03 21:37:37.148786544 +0000
|
||||
+++ b/util/grub-mkconfig.in 2011-12-03 21:37:48.445392013 +0000
|
||||
@@ -252,6 +252,8 @@
|
||||
GRUB_THEME \
|
||||
GRUB_GFXPAYLOAD_LINUX \
|
||||
GRUB_DISABLE_OS_PROBER \
|
||||
+ GRUB_COLOR_NORMAL \
|
||||
+ GRUB_COLOR_HIGHLIGHT \
|
||||
GRUB_INIT_TUNE \
|
||||
GRUB_SAVEDEFAULT \
|
||||
GRUB_BADRAM
|
||||
diff -Naur a/util/grub.d/00_header.in b/util/grub.d/00_header.in
|
||||
--- a/util/grub.d/00_header.in 2011-12-03 21:37:37.148786544 +0000
|
||||
+++ b/util/grub.d/00_header.in 2011-12-03 21:37:48.445392013 +0000
|
||||
@@ -100,6 +100,14 @@
|
||||
|
||||
EOF
|
||||
@ -16,9 +28,9 @@ diff -Nur a/util/grub.d/00_header.in b/util/grub.d/00_header.in
|
||||
serial=0;
|
||||
gfxterm=0;
|
||||
for x in ${GRUB_TERMINAL_INPUT} ${GRUB_TERMINAL_OUTPUT}; do
|
||||
diff -Nur a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
|
||||
--- a/util/grub.d/10_linux.in 2011-05-14 22:36:49.000000000 +0200
|
||||
+++ b/util/grub.d/10_linux.in 2011-08-01 15:56:53.324779083 +0200
|
||||
diff -Naur a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
|
||||
--- a/util/grub.d/10_linux.in 2011-12-03 21:37:37.148786544 +0000
|
||||
+++ b/util/grub.d/10_linux.in 2011-12-03 21:40:36.621147593 +0000
|
||||
@@ -31,8 +31,8 @@
|
||||
if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
|
||||
OS=GNU/Linux
|
||||
@ -50,9 +62,12 @@ diff -Nur a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
|
||||
if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
|
||||
done` ;;
|
||||
*)
|
||||
@@ -160,7 +162,8 @@
|
||||
@@ -159,8 +161,11 @@
|
||||
"initrd-${version}" "initramfs-${version}.img" \
|
||||
"initrd.img-${alt_version}" "initrd-${alt_version}.img" \
|
||||
"initrd-${alt_version}" "initramfs-${alt_version}.img" \
|
||||
+ "initramfs-linux-${version}" "initramfs-linux-${version}.img" \
|
||||
+ "initramfs-linux-${alt_version}" "initramfs-linux-${alt_version}.img" \
|
||||
"initramfs-genkernel-${version}" \
|
||||
- "initramfs-genkernel-${alt_version}"; do
|
||||
+ "initramfs-genkernel-${alt_version}" \
|
||||
@ -60,7 +75,7 @@ diff -Nur a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
|
||||
if test -e "${dirname}/${i}" ; then
|
||||
initrd="$i"
|
||||
break
|
||||
@@ -190,6 +193,15 @@
|
||||
@@ -190,6 +195,15 @@
|
||||
|
||||
linux_entry "${OS}" "${version}" false \
|
||||
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
|
||||
@ -76,15 +91,3 @@ diff -Nur a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
|
||||
if [ "x${GRUB_DISABLE_RECOVERY}" != "xtrue" ]; then
|
||||
linux_entry "${OS}" "${version}" true \
|
||||
"single ${GRUB_CMDLINE_LINUX}"
|
||||
diff -Nur a/util/grub-mkconfig.in b/util/grub-mkconfig.in
|
||||
--- a/util/grub-mkconfig.in 2011-04-06 17:45:53.000000000 +0200
|
||||
+++ b/util/grub-mkconfig.in 2011-08-01 15:20:49.256867648 +0200
|
||||
@@ -252,6 +252,8 @@
|
||||
GRUB_THEME \
|
||||
GRUB_GFXPAYLOAD_LINUX \
|
||||
GRUB_DISABLE_OS_PROBER \
|
||||
+ GRUB_COLOR_NORMAL \
|
||||
+ GRUB_COLOR_HIGHLIGHT \
|
||||
GRUB_INIT_TUNE \
|
||||
GRUB_SAVEDEFAULT \
|
||||
GRUB_BADRAM
|
||||
|
@ -1,59 +0,0 @@
|
||||
diff -ur grub-1.98.orig/util/grub.d/10_linux.in grub-1.98/util/grub.d/10_linux.in
|
||||
--- grub-1.98.orig/util/grub.d/10_linux.in 2010-03-13 22:10:15.953099258 -0400
|
||||
+++ grub-1.98/util/grub.d/10_linux.in 2010-03-13 22:10:44.217896122 -0400
|
||||
@@ -30,8 +30,8 @@
|
||||
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]') ${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
|
||||
@@ -46,7 +46,7 @@
|
||||
|| ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" ; 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 ()
|
||||
@@ -97,7 +97,7 @@
|
||||
EOF
|
||||
}
|
||||
|
||||
-list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* ; do
|
||||
+list=`for i in /boot/vmlinu[xz]* /vmlinu[xz]* ; do
|
||||
if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
|
||||
done`
|
||||
prepare_boot_cache=
|
||||
@@ -109,13 +109,12 @@
|
||||
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}" "initrd.img-${alt_version}" \
|
||||
- "initrd-${alt_version}.img" "initrd-${alt_version}"; do
|
||||
+ for i in "${base_init}.img"; do
|
||||
if test -e "${dirname}/${i}" ; then
|
||||
initrd="$i"
|
||||
break
|
||||
@@ -130,6 +129,9 @@
|
||||
|
||||
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_LINUX_RECOVERY}" != "xtrue" ]; then
|
||||
linux_entry "${OS}" "${version}" true \
|
||||
"single ${GRUB_CMDLINE_LINUX}"
|
@ -1,32 +0,0 @@
|
||||
diff -ur grub-1.98.orig/util/grub.d/00_header.in grub-1.98/util/grub.d/00_header.in
|
||||
--- grub-1.98.orig/util/grub.d/00_header.in 2010-03-12 12:54:12.686589681 -0400
|
||||
+++ grub-1.98/util/grub.d/00_header.in 2010-03-13 01:55:04.425437673 -0400
|
||||
@@ -108,6 +108,28 @@
|
||||
&& is_path_readable_by_grub $GRUB_THEME; then
|
||||
echo "Found theme: $GRUB_THEME" >&2
|
||||
prepare_grub_to_access_device `${grub_probe} --target=device $GRUB_THEME` | sed -e "s/^/ /"
|
||||
+ theme_dir=`dirname $GRUB_THEME`
|
||||
+ old_reader="null"
|
||||
+ # add any font dependency
|
||||
+ for f in ${theme_dir}/*.pf2 ; do
|
||||
+ if [ -e $f ] ; then
|
||||
+ echo " loadfont (\$root)`make_system_path_relative_to_its_root $f`"
|
||||
+ fi
|
||||
+ done
|
||||
+ # adding insmod dependencies for images
|
||||
+ for f in ${theme_dir}/*.{jpg,jpeg,png,tga} ; do
|
||||
+ if [ -e $f ] ; then
|
||||
+ case $f in
|
||||
+ *.png) reader=png ;;
|
||||
+ *.tga) reader=tga ;;
|
||||
+ *.jpg|*.jpeg) reader=jpeg ;;
|
||||
+ esac
|
||||
+ if [ $old_reader != $reader ] ; then
|
||||
+ echo " insmod ${reader}"
|
||||
+ old_reader=$reader
|
||||
+ fi
|
||||
+ fi
|
||||
+ done
|
||||
cat << EOF
|
||||
insmod gfxmenu
|
||||
set theme=(\$root)`make_system_path_relative_to_its_root $GRUB_THEME`
|
@ -1,23 +0,0 @@
|
||||
diff -Nru grub-1.96.orig/kern/i386/pc/startup.S grub-1.96/kern/i386/pc/startup.S
|
||||
--- grub-1.96.orig/kern/i386/pc/startup.S 2008-02-03 14:11:32.000000000 +0100
|
||||
+++ grub-1.96_20081229/kern/i386/pc/startup.S 2008-02-17 06:22:54.000000000 +0100
|
||||
@@ -594,15 +594,15 @@
|
||||
|
||||
call EXT_C(grub_dl_unload_all)
|
||||
|
||||
+ /* Turn off Gate A20 */
|
||||
+ xorl %eax, %eax
|
||||
+ call EXT_C(grub_gate_a20)
|
||||
+
|
||||
/* set up to pass boot drive */
|
||||
popl %edx
|
||||
|
||||
/* ESI must point to a partition table entry */
|
||||
popl %esi
|
||||
-
|
||||
- /* Turn off Gate A20 */
|
||||
- xorl %eax, %eax
|
||||
- call EXT_C(grub_gate_a20)
|
||||
|
||||
call prot_to_real
|
||||
.code16
|
135
grub2/grub.cfg
135
grub2/grub.cfg
@ -1,135 +0,0 @@
|
||||
#
|
||||
# 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 [ "${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 {
|
||||
insmod vbe
|
||||
insmod vga
|
||||
insmod video_bochs
|
||||
insmod video_cirrus
|
||||
}
|
||||
|
||||
insmod part_msdos
|
||||
insmod ext2
|
||||
set root='(hd0,msdos3)'
|
||||
search --no-floppy --fs-uuid --set=root fb70f55b-e58a-4ac6-af45-19d19cc24d60
|
||||
if loadfont /usr/share/grub/unicode.pf2 ; then
|
||||
set gfxmode=auto
|
||||
load_video
|
||||
insmod gfxterm
|
||||
insmod part_msdos
|
||||
insmod ext2
|
||||
set root='(hd0,msdos3)'
|
||||
search --no-floppy --fs-uuid --set=root fb70f55b-e58a-4ac6-af45-19d19cc24d60
|
||||
set locale_dir=($root)/boot/grub/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 Linux, with Linux vmlinuz26-lts' --class archlinux --class gnu-linux --class gnu --class os {
|
||||
load_video
|
||||
set gfxpayload=keep
|
||||
insmod part_msdos
|
||||
insmod ext2
|
||||
set root='(hd0,msdos3)'
|
||||
search --no-floppy --fs-uuid --set=root fb70f55b-e58a-4ac6-af45-19d19cc24d60
|
||||
echo 'Loading Linux vmlinuz26-lts ...'
|
||||
linux /boot/vmlinuz26-lts root=/dev/disk/by-uuid/fb70f55b-e58a-4ac6-af45-19d19cc24d60 ro quiet
|
||||
echo 'Loading initial ramdisk ...'
|
||||
initrd /boot/kernel26-lts.img
|
||||
}
|
||||
menuentry 'Arch Linux, with Linux vmlinuz26-lts Fallback' --class archlinux --class gnu-linux --class gnu --class os {
|
||||
load_video
|
||||
set gfxpayload=keep
|
||||
insmod part_msdos
|
||||
insmod ext2
|
||||
set root='(hd0,msdos3)'
|
||||
search --no-floppy --fs-uuid --set=root fb70f55b-e58a-4ac6-af45-19d19cc24d60
|
||||
echo 'Loading Linux vmlinuz26-lts ...Loading Linux Fallback ...'
|
||||
linux /boot/vmlinuz26-lts root=/dev/disk/by-uuid/fb70f55b-e58a-4ac6-af45-19d19cc24d60 ro quiet
|
||||
echo 'Loading initial ramdisk ...'
|
||||
initrd /boot/kernel26-lts-fallback.img
|
||||
}
|
||||
menuentry 'Arch Linux, with Linux vmlinuz26' --class archlinux --class gnu-linux --class gnu --class os {
|
||||
load_video
|
||||
set gfxpayload=keep
|
||||
insmod part_msdos
|
||||
insmod ext2
|
||||
set root='(hd0,msdos3)'
|
||||
search --no-floppy --fs-uuid --set=root fb70f55b-e58a-4ac6-af45-19d19cc24d60
|
||||
echo 'Loading Linux vmlinuz26 ...'
|
||||
linux /boot/vmlinuz26 root=/dev/disk/by-uuid/fb70f55b-e58a-4ac6-af45-19d19cc24d60 ro quiet
|
||||
echo 'Loading initial ramdisk ...'
|
||||
initrd /boot/kernel26.img
|
||||
}
|
||||
menuentry 'Arch Linux, with Linux vmlinuz26 Fallback' --class archlinux --class gnu-linux --class gnu --class os {
|
||||
load_video
|
||||
set gfxpayload=keep
|
||||
insmod part_msdos
|
||||
insmod ext2
|
||||
set root='(hd0,msdos3)'
|
||||
search --no-floppy --fs-uuid --set=root fb70f55b-e58a-4ac6-af45-19d19cc24d60
|
||||
echo 'Loading Linux vmlinuz26 ...Loading Linux Fallback ...'
|
||||
linux /boot/vmlinuz26 root=/dev/disk/by-uuid/fb70f55b-e58a-4ac6-af45-19d19cc24d60 ro quiet
|
||||
echo 'Loading initial ramdisk ...'
|
||||
initrd /boot/kernel26-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+ ###
|
||||
menuentry "Memory test (memtest86+)" --class memtest86 --class gnu --class tool {
|
||||
insmod part_msdos
|
||||
insmod ext2
|
||||
set root='(hd0,msdos3)'
|
||||
search --no-floppy --fs-uuid --set=root fb70f55b-e58a-4ac6-af45-19d19cc24d60
|
||||
linux16 ($root)/boot/memtest86+/memtest.bin
|
||||
}
|
||||
### 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 $prefix/custom.cfg ]; then
|
||||
source $prefix/custom.cfg;
|
||||
fi
|
||||
### END /etc/grub.d/41_custom ###
|
@ -1,6 +1,6 @@
|
||||
GRUB_DEFAULT=0
|
||||
GRUB_TIMEOUT=5
|
||||
GRUB_DISTRIBUTOR="Arch Linux"
|
||||
GRUB_DISTRIBUTOR="lsb_release -i -s 2> /dev/null || echo Chakra"
|
||||
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
|
||||
GRUB_CMDLINE_LINUX=""
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
infodir=usr/share/info
|
||||
filelist=(grub.info grub-dev.info)
|
||||
|
||||
wisperer() {
|
||||
show_important_message() {
|
||||
echo -e "\033[0;31m IMPORTANT"
|
||||
echo -e "\033[0;0m Run \033[0;32m 'grub-install /dev/sda --no-floppy' \033[0;0m as root for installing in MBR"
|
||||
echo -e "\033[0;0m Run \033[0;32m 'grub-mkconfig -o /boot/grub/grub.cfg' \033[0;0m as root for generating grub.cfg"
|
||||
@ -45,7 +45,7 @@ post_install() {
|
||||
install-info $infodir/$file.gz $infodir/dir 2> /dev/null
|
||||
done
|
||||
delete_symlinks
|
||||
wisperer
|
||||
show_important_message
|
||||
}
|
||||
|
||||
post_upgrade() {
|
||||
@ -53,7 +53,7 @@ post_upgrade() {
|
||||
install-info $infodir/$file.gz $infodir/dir 2> /dev/null
|
||||
done
|
||||
delete_symlinks
|
||||
wisperer
|
||||
show_important_message
|
||||
if [ -f /boot/grub/grub.cfg ]
|
||||
then
|
||||
update-grub
|
||||
|
@ -1,51 +0,0 @@
|
||||
diff -Naur /etc/grub.d.orig/10_linux /etc/grub.d/10_linux
|
||||
--- /etc/grub.d.orig/10_linux.in 2010-03-16 12:05:22.998499105 +0100
|
||||
+++ /etc/grub.d/10_linux.in 2010-03-16 13:26:36.669907054 +0100
|
||||
@@ -28,10 +28,10 @@
|
||||
CLASS="--class gnu-linux --class gnu --class os"
|
||||
|
||||
if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
|
||||
- OS=GNU/Linux
|
||||
+ OS="Chakra Linux"
|
||||
else
|
||||
- OS="${GRUB_DISTRIBUTOR} GNU/Linux"
|
||||
- CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr '[A-Z]' '[a-z]') ${CLASS}"
|
||||
+ OS="${GRUB_DISTRIBUTOR} Chakra Linux"
|
||||
+ CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr '[A-Z]' '[a-z]' ) ${CLASS}"
|
||||
fi
|
||||
|
||||
# loop-AES arranges things so that /dev/loop/X can be our root device, but
|
||||
@@ -46,7 +46,7 @@
|
||||
|| ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" ; 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 ()
|
||||
@@ -97,11 +97,12 @@
|
||||
EOF
|
||||
}
|
||||
|
||||
-list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* ; do
|
||||
+list=`for i in /boot/vmlinu[xz]* /vmlinu[xz]* ; do
|
||||
if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
|
||||
done`
|
||||
prepare_boot_cache=
|
||||
|
||||
+
|
||||
while [ "x$list" != "x" ] ; do
|
||||
linux=`version_find_latest $list`
|
||||
echo "Found linux image: $linux" >&2
|
||||
@@ -113,9 +114,7 @@
|
||||
linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
|
||||
|
||||
initrd=
|
||||
- for i in "initrd.img-${version}" "initrd-${version}.img" \
|
||||
- "initrd-${version}" "initrd.img-${alt_version}" \
|
||||
- "initrd-${alt_version}.img" "initrd-${alt_version}"; do
|
||||
+ for i in "$(echo $basename|sed 's|vmlinuz|kernel|'|sed 's|$|.img|')"; do
|
||||
if test -e "${dirname}/${i}" ; then
|
||||
initrd="$i"
|
||||
break
|
@ -1,12 +0,0 @@
|
||||
diff -ur grub-1.98.orig/util/grub.d/00_header.in grub-1.98/util/grub.d/00_header.in
|
||||
--- grub-1.98.orig/util/grub.d/00_header.in 2010-03-11 00:36:05.766730374 -0400
|
||||
+++ grub-1.98/util/grub.d/00_header.in 2010-03-11 00:40:49.046203888 -0400
|
||||
@@ -150,7 +150,7 @@
|
||||
fi
|
||||
cat << EOF
|
||||
if sleep$verbose --interruptible ${GRUB_HIDDEN_TIMEOUT} ; then
|
||||
- set timeout=${GRUB_TIMEOUT}
|
||||
+ set timeout=0
|
||||
fi
|
||||
EOF
|
||||
else
|
@ -1,25 +0,0 @@
|
||||
--- util/getroot.c~ 2010-07-12 20:34:58.498317508 +0200
|
||||
+++ util/getroot.c 2010-07-12 20:34:58.556288678 +0200
|
||||
@@ -222,9 +222,20 @@
|
||||
/* Ignore any error. */
|
||||
continue;
|
||||
|
||||
- if (S_ISLNK (st.st_mode))
|
||||
- /* Don't follow symbolic links. */
|
||||
+ if (S_ISLNK (st.st_mode)) {
|
||||
+#ifdef __linux__
|
||||
+ if (strcmp (dir, "mapper") == 0) {
|
||||
+ /* Follow symbolic links under /dev/mapper/; the canonical name
|
||||
+ may be something like /dev/dm-0, but the names under
|
||||
+ /dev/mapper/ are more human-readable and so we prefer them if
|
||||
+ we can get them. */
|
||||
+ if (stat (ent->d_name, &st) < 0)
|
||||
+ continue;
|
||||
+ } else
|
||||
+#endif /* __linux__ */
|
||||
+ /* Don't follow other symbolic links. */
|
||||
continue;
|
||||
+ }
|
||||
|
||||
if (S_ISDIR (st.st_mode))
|
||||
{
|
@ -1,29 +0,0 @@
|
||||
diff -ur grub-1.98.orig/util/grub.d/00_header.in grub-1.98/util/grub.d/00_header.in
|
||||
--- grub-1.98.orig/util/grub.d/00_header.in 2010-03-11 00:36:05.766730374 -0400
|
||||
+++ grub-1.98/util/grub.d/00_header.in 2010-03-11 00:36:27.252903963 -0400
|
||||
@@ -59,6 +59,13 @@
|
||||
}
|
||||
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
|
||||
case ${GRUB_TERMINAL_INPUT}:${GRUB_TERMINAL_OUTPUT} in
|
||||
serial:* | *:serial)
|
||||
if ! test -e ${grub_prefix}/serial.mod ; then
|
||||
diff -ur grub-1.98.orig/util/grub-mkconfig.in grub-1.98/util/grub-mkconfig.in
|
||||
--- grub-1.98.orig/util/grub-mkconfig.in 2010-03-11 00:36:05.781282507 -0400
|
||||
+++ grub-1.98/util/grub-mkconfig.in 2010-03-11 00:36:21.511483268 -0400
|
||||
@@ -223,6 +223,8 @@
|
||||
GRUB_THEME \
|
||||
GRUB_GFXPAYLOAD_LINUX \
|
||||
GRUB_DISABLE_OS_PROBER \
|
||||
+ GRUB_COLOR_NORMAL \
|
||||
+ GRUB_COLOR_HIGHLIGHT \
|
||||
GRUB_INIT_TUNE \
|
||||
GRUB_SAVEDEFAULT
|
||||
|
47
grub2/resume-hook.patch
Normal file
47
grub2/resume-hook.patch
Normal file
@ -0,0 +1,47 @@
|
||||
--- grub-mkconfig.orig 2012-01-21 23:08:55.000000000 +0100
|
||||
+++ grub-mkconfig 2012-01-21 23:10:00.000000000 +0100
|
||||
@@ -32,6 +32,7 @@ datarootdir=${prefix}/share
|
||||
datadir=${datarootdir}
|
||||
pkgdatadir=${datadir}/`echo grub | sed "${transform}"`
|
||||
grub_cfg=""
|
||||
+resume_hook=1
|
||||
grub_mkconfig_dir=${sysconfdir}/grub.d
|
||||
|
||||
self=`basename $0`
|
||||
@@ -52,6 +53,7 @@ Generate a grub config file
|
||||
-o, --output=FILE output generated config to FILE [default=stdout]
|
||||
-h, --help print this message and exit
|
||||
-v, --version print the version information and exit
|
||||
+ -s, --skip-resume disable resume hook setup
|
||||
|
||||
Report bugs to <bug-grub@gnu.org>.
|
||||
EOF
|
||||
@@ -86,6 +88,9 @@ do
|
||||
--output=*)
|
||||
grub_cfg=`echo "$option" | sed 's/--output=//'`
|
||||
;;
|
||||
+ -s | --skip-resume)
|
||||
+ resume_hook=0
|
||||
+ ;;
|
||||
-*)
|
||||
echo "Unrecognized option \`$option'" 1>&2
|
||||
usage
|
||||
@@ -295,6 +300,18 @@ for i in ${grub_mkconfig_dir}/* ; do
|
||||
esac
|
||||
done
|
||||
|
||||
+if [ "${resume_hook}" == 1 ]; then
|
||||
+ echo "Setup resume hook" >&2
|
||||
+ SWAP=`swapon -a | cat /proc/swaps | grep /dev | cut -d" " -f1`
|
||||
+ if [ -z "${SWAP}" ]; then
|
||||
+ echo "No swap partition found. Create one to enable hibernation..." >&2
|
||||
+ else
|
||||
+ echo "Adding swap partition $SWAP" >&2
|
||||
+ SWAPUUID=`blkid $SWAP -s UUID -o value`
|
||||
+ sed -i -e "s~root=/dev~resume=/dev/disk/by-uuid/${SWAPUUID} root=/dev~g" ${grub_cfg}.new
|
||||
+ fi
|
||||
+fi
|
||||
+
|
||||
if test "x${grub_cfg}" != "x" ; then
|
||||
if ! ${grub_script_check} ${grub_cfg}.new; then
|
||||
echo "Syntax errors are detected in generated GRUB config file." >&2
|
Loading…
Reference in New Issue
Block a user