diff options
author | Denton Liu | 2019-06-27 13:42:42 -0400 |
---|---|---|
committer | Denton Liu | 2019-06-27 13:42:42 -0400 |
commit | 9439d7232741900dad0c604b62e2f2b0be507297 (patch) | |
tree | 04a3885c5dc994493fdaf62dfa7e058ce78d6353 | |
download | aur-9439d7232741900dad0c604b62e2f2b0be507297.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 15 | ||||
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | PKGBUILD | 20 | ||||
-rw-r--r-- | grub-linux-default-hook.hook | 10 | ||||
-rw-r--r-- | grub-linux-default-hook.install | 17 | ||||
-rw-r--r-- | grub-linux-default-hook.patch | 23 |
6 files changed, 88 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..079281365e8c --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,15 @@ +pkgbase = grub-linux-default-hook + pkgdesc = Patch grub to make vmlinuz-linux the first entry + pkgver = 1.0 + pkgrel = 1 + install = grub-linux-default-hook.install + arch = any + license = MIT + depends = grub + source = grub-linux-default-hook.hook + source = grub-linux-default-hook.patch + sha256sums = bd7e0363d770c3898224a8d101f63979fa607042dc3621ecf98f638e0241858f + sha256sums = 95a8c61846665b029d3d11cdb77b9208103fb55375e34032debac6cef2ecce39 + +pkgname = grub-linux-default-hook + diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..d5fbbf8c5751 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +pkg/ +src/ +*.tar.xz diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..26df5ffb0374 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,20 @@ +# Maintainer: Denton Liu <liu.denton@gmail.com> + +pkgname=grub-linux-default-hook +pkgver=1.0 +pkgrel=1 +pkgdesc="Patch grub to make vmlinuz-linux the first entry" +arch=('any') +license=('MIT') +depends=('grub') +install="$pkgname.install" +source=("$pkgname.hook" + "$pkgname.patch") +sha256sums=('bd7e0363d770c3898224a8d101f63979fa607042dc3621ecf98f638e0241858f' + '95a8c61846665b029d3d11cdb77b9208103fb55375e34032debac6cef2ecce39') + +package() { + cd "$srcdir" + install -Dm 644 "$pkgname.hook" "$pkgdir/usr/share/libalpm/hooks/$pkgname.hook" + install -Dm 644 "$pkgname.patch" "$pkgdir/usr/share/$pkgname/$pkgname.patch" +} diff --git a/grub-linux-default-hook.hook b/grub-linux-default-hook.hook new file mode 100644 index 000000000000..80011d848290 --- /dev/null +++ b/grub-linux-default-hook.hook @@ -0,0 +1,10 @@ +[Trigger] +Type = Package +Operation = Install +Operation = Upgrade +Target = grub + +[Action] +Description = Patching grub to make vmlinuz-linux the first entry +When = PostTransaction +Exec = /usr/bin/patch -p0 -i /usr/share/grub-linux-default-hook/grub-linux-default-hook.patch diff --git a/grub-linux-default-hook.install b/grub-linux-default-hook.install new file mode 100644 index 000000000000..0a9dce571b4c --- /dev/null +++ b/grub-linux-default-hook.install @@ -0,0 +1,17 @@ +patch_file=/usr/share/grub-linux-default-hook/grub-linux-default-hook.patch + +post_install() { + patch -p0 <"$patch_file" +} + +post_upgrade() { + post_install +} + +pre_remove() { + patch -R -p0 <"$patch_file" +} + +pre_upgrade() { + pre_remove +} diff --git a/grub-linux-default-hook.patch b/grub-linux-default-hook.patch new file mode 100644 index 000000000000..7f4d1aa09614 --- /dev/null +++ b/grub-linux-default-hook.patch @@ -0,0 +1,23 @@ +--- /etc/grub.d/10_linux ++++ /etc/grub.d/10_linux +@@ -184,8 +184,20 @@ + submenu_indentation="" + + is_top_level=true ++default_kernel_grabbed=false ++default_kernel_name="/boot/vmlinuz-linux" + while [ "x$list" != "x" ] ; do + linux=`version_find_latest $list` ++ if ! $default_kernel_grabbed; then ++ for i in $list; do ++ if [ $i == $default_kernel_name ] ++ then ++ linux=$default_kernel_name ++ break ++ fi ++ done ++ default_kernel_grabbed=true ++ fi + gettext_printf "Found linux image: %s\n" "$linux" >&2 + basename=`basename $linux` + dirname=`dirname $linux` |