Update RISC-V patch

Ensure grubby uses U-Boot wrapped kernel and initramfs for extlinux
configuration on RISC-V.

Signed-off-by: David Abdurachmanov <david.abdurachmanov@gmail.com>
This commit is contained in:
David Abdurachmanov 2019-04-03 21:01:44 +02:00
parent 57ece75e86
commit 063fbf5c5d
Signed by: davidlt
GPG Key ID: 7108702C938B13C1
2 changed files with 90 additions and 13 deletions

View File

@ -1,15 +1,15 @@
From 3242d46a8e4badb1b7a804ce656db3a029808ef7 Mon Sep 17 00:00:00 2001
From 1172e7b953f3682cf7b75beeab805d7538c66827 Mon Sep 17 00:00:00 2001
From: Your Name <you@example.com>
Date: Sat, 30 Mar 2019 06:11:45 -0400
Date: Wed, 3 Apr 2019 19:00:57 +0000
Subject: [PATCH] riscv uboot
---
new-kernel-pkg | 63 ++++++++++++++++++--------------------------------
uboot | 39 ++++++++++++-------------------
2 files changed, 37 insertions(+), 65 deletions(-)
new-kernel-pkg | 76 +++++++++++++++++++++++---------------------------
uboot | 39 ++++++++++----------------
2 files changed, 50 insertions(+), 65 deletions(-)
diff --git a/new-kernel-pkg b/new-kernel-pkg
index b634388..64a36ce 100755
index b634388..245b5e3 100755
--- a/new-kernel-pkg
+++ b/new-kernel-pkg
@@ -50,7 +50,6 @@ grubConfig=""
@ -52,7 +52,18 @@ index b634388..64a36ce 100755
liloFlag=""
isx86=""
else
@@ -417,7 +429,6 @@ remove() {
@@ -299,6 +311,10 @@ install() {
fi
if [ -n "$cfgExtlinux" ]; then
+ if [ -n "$cfguBoot" ]; then
+ kernelImage=$ubootDir/uImage-$version
+ INITRD=$(echo $INITRD | sed "s|$initrdfile|$ubootDir/uInitrd-$version|")
+ fi
[ -n "$verbose" ] && echo "adding $version to $extlinuxConfig"
ARGS="--extlinux -c $extlinuxConfig --add-kernel=$kernelImage \
@@ -417,7 +433,6 @@ remove() {
fi
mv $tmpKList $ubootDir/$ubootKList
@ -60,7 +71,7 @@ index b634388..64a36ce 100755
else
[ -n "$verbose" ] && echo "uImage $newversion does not exist!"
[ -f $tmpKList ] && rm -f $tmpKList
@@ -426,7 +437,7 @@ remove() {
@@ -426,10 +441,13 @@ remove() {
[ -n "$verbose" ] && echo "No previous kernel version. U-Boot images not removed!"
fi
else
@ -69,7 +80,13 @@ index b634388..64a36ce 100755
fi
if [ -n "$cfgExtlinux" ]; then
@@ -534,12 +545,12 @@ update() {
+ if [ -n "$cfguBoot" ]; then
+ kernelImage=$ubootDir/uImage-$version
+ fi
[ -n "$verbose" ] && echo "removing $version from $extlinuxConfig"
$grubby --extlinux -c $extlinuxConfig \
--remove-kernel=$kernelImage
@@ -534,12 +552,12 @@ update() {
[ -n "$verbose" ] && echo "adding $version to $ubootDir..."
[ -n "$verbose" ] && echo "creating uImage-$version"
@ -84,7 +101,7 @@ index b634388..64a36ce 100755
-n initramfs -d $initrdfile $ubootDir/uInitrd-$version
if [ -f $ubootDir/uImage-$version ] && [ -f $ubootDir/uInitrd-$version ]; then
@@ -552,12 +563,11 @@ update() {
@@ -552,15 +570,18 @@ update() {
[ -n "$verbose" ] && echo "copy uInitrd-$version error, kernel not installed!" && exit
fi
echo $version >> $ubootDir/$ubootKList
@ -98,7 +115,23 @@ index b634388..64a36ce 100755
fi
if [ -n "$cfgExtlinux" ]; then
@@ -876,33 +886,7 @@ fi
+ if [ -n "$cfguBoot" ]; then
+ kernelImage=$ubootDir/uImage-$version
+ INITRD=$(echo $INITRD | sed "s|$initrdfile|$ubootDir/uInitrd-$version|")
+ fi
[ -n "$verbose" ] && echo "updating $version from $extlinuxConfig"
ARGS="--extlinux -c $extlinuxConfig --update-kernel=$kernelImage \
$DEVTREE $DEVTREEDIR $INITRD ${kernargs:+--args=\"$kernargs\"} \
@@ -592,6 +613,8 @@ doMkinitrd() {
rminitrd() {
[ -n "$verbose" ] && echo "removing initrd $initrdfile"
[ -f $initrdfile ] && rm -f $initrdfile
+ [ -n "$verbose" -a -n "$cfguBoot" ] && "removing U-Boot wrapped initrd $ubootDir/uInitrd-$version"
+ [ -n "$cfguBoot" -a -f $ubootDir/uInitrd-$version ] && rm -f $ubootDir/uInitrd-$version
}
doDepmod() {
@@ -876,33 +899,7 @@ fi
[ -n "$grub2EfiConfig" ] && [ -f "$grub2EfiConfig" ] && cfgGrub2Efi=1;
[ -n "$liloConfig" ] && [ -f "$liloConfig" ] && cfgLilo=1;
[ -n "$extlinuxConfig" ] && [ -f "$extlinuxConfig" ] && cfgExtlinux=1;
@ -133,7 +166,7 @@ index b634388..64a36ce 100755
# if we have a lilo config on an x86 box, see if the default boot loader
# is lilo to determine if it should be run
@@ -920,7 +904,4 @@ elif [ "$mode" == "--rpmposttrans" ]; then
@@ -920,7 +917,4 @@ elif [ "$mode" == "--rpmposttrans" ]; then
rpmposttrans
fi
@ -205,5 +238,5 @@ index 07d8671..3db046a 100644
+# Default uInitrd compression
+#UBOOT_UINITRD_COMPRESSION=gzip
--
2.20.1
2.21.0

44
a.patch Normal file
View File

@ -0,0 +1,44 @@
--- /usr/sbin/new-kernel-pkg 2019-04-03 12:19:29.969231795 -0400
+++ /usr/sbin/new-kernel-pkg 2019-04-03 13:02:36.022107582 -0400
@@ -313,6 +313,10 @@
fi
if [ -n "$cfgExtlinux" ]; then
+ if [ -n "$cfguBoot" ]; then
+ kernelImage=$ubootDir/uImage-$version
+ INITRD=$(echo $INITRD | sed "s|$initrdfile|$ubootDir/uInitrd-$version|")
+ fi
[ -n "$verbose" ] && echo "adding $version to $extlinuxConfig"
ARGS="--extlinux -c $extlinuxConfig --add-kernel=$kernelImage \
@@ -443,6 +447,9 @@
fi
if [ -n "$cfgExtlinux" ]; then
+ if [ -n "$cfguBoot" ]; then
+ kernelImage=$ubootDir/uImage-$version
+ fi
[ -n "$verbose" ] && echo "removing $version from $extlinuxConfig"
$grubby --extlinux -c $extlinuxConfig \
--remove-kernel=$kernelImage
@@ -573,6 +580,10 @@
fi
if [ -n "$cfgExtlinux" ]; then
+ if [ -n "$cfguBoot" ]; then
+ kernelImage=$ubootDir/uImage-$version
+ INITRD=$(echo $INITRD | sed "s|$initrdfile|$ubootDir/uInitrd-$version|")
+ fi
[ -n "$verbose" ] && echo "updating $version from $extlinuxConfig"
ARGS="--extlinux -c $extlinuxConfig --update-kernel=$kernelImage \
$DEVTREE $DEVTREEDIR $INITRD ${kernargs:+--args=\"$kernargs\"} \
@@ -604,6 +615,8 @@
rminitrd() {
[ -n "$verbose" ] && echo "removing initrd $initrdfile"
[ -f $initrdfile ] && rm -f $initrdfile
+ [ -n "$verbose" -a -n "$cfguBoot" ] && "removing U-Boot wrapped initrd $ubootDir/uInitrd-$version"
+ [ -n "$cfguBoot" -a -f $ubootDir/uInitrd-$version ] && rm -f $ubootDir/uInitrd-$version
}
doDepmod() {