burg,grub2: update, remove symlinks

This commit is contained in:
Phil 2011-08-08 11:29:08 +00:00
parent beb7241c4f
commit 357c2e0362
11 changed files with 188 additions and 102 deletions

View File

@ -6,7 +6,7 @@
pkgname=burg-bzr
pkgver=1844
pkgrel=6
pkgrel=7
pkgdesc="A brand-new boot loader based on GRUB."
url="https://launchpad.net/burg"
license="GPL3"
@ -20,7 +20,7 @@ provides=('burg')
md5sums=('39a0e3f1035342d75a9eda7a65f9793f'
'e52920e72ae3702a416a4b1a39bf370c'
'60bdcc9a3f86deb4f1a361f3bea4ae98'
'990eba4f3cb1808c97c2972de6957a3c'
'460a91c0998117285decdb176ad98ee1'
'c91b561ab7d1cf88c216d23bf4a11d76')
source=('burg.default'
'chakra-burg-detection-folding.patch'

View File

@ -1,14 +1,39 @@
delete_symlinks() {
if [ `readlink /boot/kernel26.img` ] ;
then
echo "removing backward-symlink"
rm -v /boot/kernel26.img
fi
if [ `readlink /boot/kernel26-lts.img` ] ;
then
echo "removing backward-symlink"
rm -v /boot/kernel26-lts.img
fi
if [ `readlink /boot/vmlinuz26` ] ;
then
echo "removing backward-symlink"
rm -v /boot/vmlinuz26
fi
if [ `readlink /boot/vmlinuz26-lts` ] ;
then
echo "removing backward-symlink"
rm -v /boot/vmlinuz26-lts
fi
}
post_install() {
echo -e "\033[0;31m IMPORTANT"
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"
delete_symlinks
}
post_upgrade() {
post_install
update-grub
}

View File

@ -1,3 +1,31 @@
#!/bin/sh -e
# do UID checking here so someone can at least get usage instructions
if [ "$EUID" != "0" ]; then
echo "error: This script must be run as root."
exit 1
fi
if [ `readlink /boot/kernel26.img` ] ;
then
echo "removing backward-symlink"
rm -v /boot/kernel26.img
fi
if [ `readlink /boot/kernel26-lts.img` ] ;
then
echo "removing backward-symlink"
rm -v /boot/kernel26-lts.img
fi
if [ `readlink /boot/vmlinuz26` ] ;
then
echo "removing backward-symlink"
rm -v /boot/vmlinuz26
fi
if [ `readlink /boot/vmlinuz26-lts` ] ;
then
echo "removing backward-symlink"
rm -v /boot/vmlinuz26-lts
fi
echo "Updating /boot/burg/burg.cfg"
exec burg-mkconfig -o /boot/burg/burg.cfg "$@"

6
grub2/05_archtheme Normal file
View File

@ -0,0 +1,6 @@
#!/bin/bash -e
cat << EOF
set menu_color_normal=light-blue/black
set menu_color_highlight=light-cyan/blue
EOF

View File

@ -1,7 +1,7 @@
#
# Core Packages for Chakra, part of chakra-project.org
#
# maintainer: Phil Miller <philm[at]chakra-project[dot]org
# Maintainer: Ronald van Haren <ronald.chakra.org>
# Contributor: Keshav P R <skodabenz at rocketmail dot com>
# The src pkg includes grub2_bzr_export.sh to create newer grub-extras snapshots. Modify the paths in it accordingly.
# _grub2_rev=3238
@ -10,26 +10,29 @@ _grub2_gpxe_ver=12
_grub2_ntldr_ver=17
_grub2_915_ver=7
pkgname=('grub2-common' 'grub2-bios' 'grub2-efi-x32')
pkgname=('grub2-common' 'grub2-bios' 'grub2-efi-i386')
pkgbase="grub2"
pkgver='1.99'
pkgrel=2
pkgrel=3
url="http://www.gnu.org/software/grub/"
arch=('i686' 'x86_64')
license=('GPL3')
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"
source=("ftp://ftp.gnu.org/gnu/grub/grub-1.99.tar.xz"
"http://chakra-project.org/sources/${pkgbase}/grub2_extras_lua_r${_grub2_lua_ver}.tar.xz"
"http://chakra-project.org/sources/${pkgbase}/grub2_extras_gpxe_r${_grub2_gpxe_ver}.tar.xz"
"http://chakra-project.org/sources/${pkgbase}/grub2_extras_ntldr-img_r${_grub2_ntldr_ver}.tar.xz"
"http://chakra-project.org/sources/${pkgbase}/grub2_extras_915resolution_r${_grub2_915_ver}.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+')
'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"
@ -41,10 +44,12 @@ sha1sums=('a5ae9558f30ce7757a76aa130088b053a87e2fb6'
'6c58eee654fa4eb7f057275b330710ffd4a9e989'
'0e50955141a45918fcf56f3a5e15fb477f0448a7'
'f2a5f1d5b75bd3286b63aefaf5e6553aa03e772b'
'9334c23b9d5525e24c204ab45f9de253809d8fbc'
'717bba46ea5c9903ccbb9b1486ff594b66dbe359'
'6d4f4a3899a0a343771e258cfb3f86172791e7e9'
'82a27eca5277218cf57c6c5767e0b17a72f62229')
'b7e5510c7b171e9c4dbddb42bbf54ce5ee86e2de'
'e1477db3700b27b5e5ad3d8fa43028555204759b'
'8948d89537c12a4202df7c001e65a77030bbe5a3'
'82a27eca5277218cf57c6c5767e0b17a72f62229'
'beb31419045db70fee7401aa6448c220a491e2a3'
'5770fbb559b1f463e1a735a1463d24af489bcc3e')
build() {
# set architecture dependent variables
@ -145,6 +150,8 @@ package_grub2-common() {
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|" \
@ -173,7 +180,7 @@ package_grub2-common() {
package_grub2-bios() {
pkgdesc="The GNU GRand Unified Bootloader version 2 - Built for PC BIOS"
depends=(grub2-common=${pkgver})
depends=(grub2-common=${epoch}:${pkgver})
replaces=('grub2')
provides=('grub2')
@ -185,12 +192,11 @@ package_grub2-bios() {
rm ${pkgdir}/usr/lib/grub/{grub-mkconfig_lib,update-grub_lib}
}
package_grub2-efi-x32() {
package_grub2-efi-i386() {
pkgdesc="The GNU GRand Unified Bootloader version 2 - 32bit UEFI version"
depends=("grub2-common=${pkgver}" 'dosfstools' 'efibootmgr')
pkgdesc="The GNU GRand Unified Bootloader version 2 - i386 UEFI version"
depends=("grub2-common=${epoch}:${pkgver}" 'dosfstools' 'efibootmgr')
optdepends=('mtools')
replaces=('grub2-efi-i386')
cd ${srcdir}/grub2_efi-${pkgver}
make DESTDIR=${pkgdir} install

94
grub2/chakra_grub2_mkconfig_fixes.patch Normal file → Executable file
View File

@ -1,6 +1,6 @@
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-04-26 09:23:02.371574484 +0200
+++ b/util/grub.d/00_header.in 2011-08-01 15:19:57.919100452 +0200
@@ -100,6 +100,14 @@
EOF
@ -17,17 +17,19 @@ diff -Nur a/util/grub.d/00_header.in b/util/grub.d/00_header.in
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-04-18 23:18:49.000000000 +0200
+++ b/util/grub.d/10_linux.in 2011-04-26 10:16:54.397538449 +0200
@@ -48,7 +48,7 @@
|| uses_abstraction "${GRUB_DEVICE}" lvm; then
LINUX_ROOT_DEVICE=${GRUB_DEVICE}
--- 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
@@ -31,8 +31,8 @@
if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
OS=GNU/Linux
else
- LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
+ LINUX_ROOT_DEVICE="/dev/disk/by-uuid/${GRUB_DEVICE_UUID}"
- 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
if [ "x`${grub_probe} --device ${GRUB_DEVICE} --target=fs 2>/dev/null || true`" = xbtrfs ]; then
# loop-AES arranges things so that /dev/loop/X can be our root device, but
@@ -65,7 +65,9 @@
version="$2"
recovery="$3"
@ -39,21 +41,16 @@ diff -Nur a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
title="$(gettext_quoted "%s, with Linux %s (recovery mode)")"
else
title="$(gettext_quoted "%s, with Linux %s")"
@@ -121,11 +123,11 @@
@@ -132,7 +134,7 @@
case x`uname -m` in
xi?86 | xx86_64)
- list=`for i in /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do
+ list=`for i in /boot/vmlinuz* /vmlinuz* /boot/kernel-* ; do
+ list=`for i in /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* /boot/vmlinuz26-* ; do
if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
done` ;;
*)
- list=`for i in /boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-* ; do
+ list=`for i in /boot/vmlinuz* /boot/vmlinux* /vmlinuz* /vmlinux* /boot/kernel-* ; do
if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
done` ;;
esac
@@ -148,7 +150,8 @@
@@ -160,7 +162,8 @@
"initrd.img-${alt_version}" "initrd-${alt_version}.img" \
"initrd-${alt_version}" "initramfs-${alt_version}.img" \
"initramfs-genkernel-${version}" \
@ -63,47 +60,25 @@ 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
@@ -178,6 +181,11 @@
@@ -190,6 +193,15 @@
linux_entry "${OS}" "${version}" false \
"${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}"
+ if test -e "${dirname}/${basename/vmlinuz/kernel}-fallback.img"; then
+ initrd="${basename/vmlinuz/kernel}-fallback.img"
+ linux_entry "${OS}" "${version}" true \
+ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" Fallback
+ fi
+ for i in "initramfs-${version}-fallback.img" \
+ "${basename/vmlinuz/kernel}-fallback.img"; do
+ if test -e "${dirname}/${i}"; then
+ initrd="$i"
+ linux_entry "${OS}" "${version}" true \
+ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" Fallback
+ break
+ fi
+ done
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-04-26 09:23:02.371574484 +0200
@@ -33,6 +33,7 @@ datadir=@datadir@
pkgdatadir=${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"`
grub_cfg=""
grub_mkconfig_dir=${sysconfdir}/grub.d
+resume_hook=1
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
+++ b/util/grub-mkconfig.in 2011-08-01 15:20:49.256867648 +0200
@@ -252,6 +252,8 @@
GRUB_THEME \
GRUB_GFXPAYLOAD_LINUX \
@ -113,22 +88,3 @@ diff -Nur a/util/grub-mkconfig.in b/util/grub-mkconfig.in
GRUB_INIT_TUNE \
GRUB_SAVEDEFAULT \
GRUB_BADRAM
@@ -293,6 +298,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

View File

@ -56,7 +56,7 @@ set timeout=5
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Chakra GNU/Linux, with Linux vmlinuz26-lts' --class chakra --class gnu-linux --class gnu --class os {
menuentry 'Arch Linux, with Linux vmlinuz26-lts' --class archlinux --class gnu-linux --class gnu --class os {
load_video
set gfxpayload=keep
insmod part_msdos
@ -68,7 +68,7 @@ menuentry 'Chakra GNU/Linux, with Linux vmlinuz26-lts' --class chakra --class gn
echo 'Loading initial ramdisk ...'
initrd /boot/kernel26-lts.img
}
menuentry 'Chakra GNU/Linux, with Linux vmlinuz26-lts Fallback' --class chakra --class gnu-linux --class gnu --class os {
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
@ -80,7 +80,7 @@ menuentry 'Chakra GNU/Linux, with Linux vmlinuz26-lts Fallback' --class chakra -
echo 'Loading initial ramdisk ...'
initrd /boot/kernel26-lts-fallback.img
}
menuentry 'Chakra GNU/Linux, with Linux vmlinuz26' --class chakra --class gnu-linux --class gnu --class os {
menuentry 'Arch Linux, with Linux vmlinuz26' --class archlinux --class gnu-linux --class gnu --class os {
load_video
set gfxpayload=keep
insmod part_msdos
@ -92,7 +92,7 @@ menuentry 'Chakra GNU/Linux, with Linux vmlinuz26' --class chakra --class gnu-li
echo 'Loading initial ramdisk ...'
initrd /boot/kernel26.img
}
menuentry 'Chakra GNU/Linux, with Linux vmlinuz26 Fallback' --class chakra --class gnu-linux --class gnu --class os {
menuentry 'Arch Linux, with Linux vmlinuz26 Fallback' --class archlinux --class gnu-linux --class gnu --class os {
load_video
set gfxpayload=keep
insmod part_msdos

View File

@ -1,6 +1,6 @@
GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Chakra`
GRUB_DISTRIBUTOR="Arch Linux"
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX=""

View File

@ -1,6 +1,36 @@
infodir=usr/share/info
filelist=(grub.info grub-dev.info)
wisperer() {
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"
echo -e "\033[0;0m Also you can run \033[0;32m 'update-grub' \033[0;0m as root for generating grub.cfg"
}
delete_symlinks() {
if [ `readlink /boot/kernel26.img` ] ;
then
echo "removing backward-symlink"
rm -v /boot/kernel26.img
fi
if [ `readlink /boot/kernel26-lts.img` ] ;
then
echo "removing backward-symlink"
rm -v /boot/kernel26-lts.img
fi
if [ `readlink /boot/vmlinuz26` ] ;
then
echo "removing backward-symlink"
rm -v /boot/vmlinuz26
fi
if [ `readlink /boot/vmlinuz26-lts` ] ;
then
echo "removing backward-symlink"
rm -v /boot/vmlinuz26-lts
fi
}
post_install() {
if [ -f /boot/grub/grub.cfg.pacsave ]; then
echo "Copying /boot/grub/grub.cfg.pacsave to /boot/grub/grub.cfg"
@ -14,12 +44,17 @@ post_install() {
for file in ${filelist[@]}; do
install-info $infodir/$file.gz $infodir/dir 2> /dev/null
done
delete_symlinks
wisperer
}
post_upgrade() {
for file in ${filelist[@]}; do
install-info $infodir/$file.gz $infodir/dir 2> /dev/null
done
delete_symlinks
wisperer
update-grub
}
pre_remove() {

View File

@ -2,10 +2,10 @@
## 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
# 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
@ -21,8 +21,7 @@ output_dir=${wd}/
grub2_bzr_dir=${wd}/grub2_BZR/
grub2_bzr_exp_dir=${wd}/grub2_experimental_BZR/
#grub2_extras_dir=${wd}/grub2_extras_BZR/
grub2_extras_dir=${wd}/./
grub2_extras_dir=${wd}/grub2_extras_BZR/
main_snapshot() {

31
grub2/update-grub Executable file
View File

@ -0,0 +1,31 @@
#!/bin/sh -e
# do UID checking here so someone can at least get usage instructions
if [ "$EUID" != "0" ]; then
echo "error: This script must be run as root."
exit 1
fi
if [ `readlink /boot/kernel26.img` ] ;
then
echo "removing backward-symlink"
rm -v /boot/kernel26.img
fi
if [ `readlink /boot/kernel26-lts.img` ] ;
then
echo "removing backward-symlink"
rm -v /boot/kernel26-lts.img
fi
if [ `readlink /boot/vmlinuz26` ] ;
then
echo "removing backward-symlink"
rm -v /boot/vmlinuz26
fi
if [ `readlink /boot/vmlinuz26-lts` ] ;
then
echo "removing backward-symlink"
rm -v /boot/vmlinuz26-lts
fi
echo "Updating /boot/grub/grub.cfg"
exec grub-mkconfig -o /boot/grub/grub.cfg "$@"