Commit 3bdfb601 authored by philm's avatar philm

burg-bzr: add resume-hook patch, restore floppy-support

parent be3ac377
......@@ -6,7 +6,7 @@
pkgname=burg-bzr
pkgver=1844
pkgrel=2
pkgrel=3
pkgdesc="A brand-new boot loader based on GRUB."
url="https://launchpad.net/burg"
license="GPL3"
......@@ -19,12 +19,14 @@ changelog=burg.Changelog
provides=('burg')
md5sums=('f473ed24228a36d08e861279b26584e7'
'fa7e08137c8736c0b90375f09beaa101'
'49e7f85be82eb8044f6acda2e2a1910a'
'e8735e895ebe33638b3ad3e586fee018'
'1dff92d9973ed8eae1a9cb4e7dab842f'
'990eba4f3cb1808c97c2972de6957a3c'
'06dbd97a27ce89edd49a5f974679b012')
'c91b561ab7d1cf88c216d23bf4a11d76')
source=('burg.default'
'arch-burg-detection-folding.patch'
'resume-hook.patch'
'00_header'
'10_linux'
'20_memtest86+'
......@@ -51,8 +53,9 @@ build() {
# some random patches to facilitate automatic creation of grub.cfg
patch -Np1 -i ${srcdir}/arch-burg-detection-folding.patch
cd "${srcdir}/${_bzrmod}"
# Restore to old config: use for example: burg-install /dev/sda --no-floppy
# disable floppy probing in grub-mkdevicemap
sed -i 's|int floppy_disks = 1;|int floppy_disks = 0;|' ${srcdir}/${_bzrmod}/util/grub-mkdevicemap.c
#sed -i 's|int floppy_disks = 1;|int floppy_disks = 0;|' ${srcdir}/${_bzrmod}/util/grub-mkdevicemap.c
## Archlinux changed default /usr/bin/python to 3.1.2, need to use /usr/bin/python2 instead
sed -i 's|python|python2|' ${srcdir}/${_bzrmod}/autogen.sh
./autogen.sh || return 1
......@@ -70,6 +73,10 @@ build() {
--infodir=/usr/share/info --sysconfdir=/etc || return 1
make || return 1
}
package() {
cd $srcdir/$_bzrmod-build
make install DESTDIR=$pkgdir || return 1
# install /etc/default/burg(needed config file)
......@@ -78,5 +85,7 @@ build() {
install -Dm755 ${srcdir}/update-burg ${pkgdir}/sbin/update-burg
# install memtest config detection
install -Dm755 ${srcdir}/20_memtest86+ ${pkgdir}/etc/burg.d/20_memtest86+
cd ${pkgdir}/sbin
patch -Np0 -i ${srcdir}/resume-hook.patch
}
post_install() {
echo -e "\033[0;31m IMPORTANT"
echo -e "\033[0;0m Run \033[0;32m 'burg-install /dev/sda' \033[0;0m as root for installing in MBR"
echo -e "\033[0;0m Run \033[0;32m 'burg-install /dev/sda --no-floppy' \033[0;0m as root for installing in MBR"
echo -e "\033[0;0m Run \033[0;32m 'burg-mkconfig -o /boot/burg/burg.cfg' \033[0;0m as root for generating burg.cfg"
echo -e "\033[0;0m Also you can run \033[0;32m 'update-burg' \033[0;0m as root for generating burg.cfg"
}
......
--- burg-mkconfig.orig 2011-05-23 10:42:25.000000000 +0200
+++ burg-mkconfig 2011-05-23 10:42:25.000000000 +0200
@@ -305,6 +305,16 @@ for i in ${grub_mkconfig_dir}/* ; do
esac
done
+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
+
if test "x${grub_cfg}" != "x" ; then
# none of the children aborted with error, install the new grub.cfg
mv -f ${grub_cfg}.new ${grub_cfg}
#!/bin/sh -e
echo "Updating /boot/burg/burg.cfg"
exec burg-mkconfig -o /boot/burg/burg.cfg "$@"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment