Commit 5c9684bc authored by Xuetian Weng's avatar Xuetian Weng

add nvme support to grub

parent 2b3e4331
...@@ -16,7 +16,7 @@ _EFI_ARCH="x86_64" ...@@ -16,7 +16,7 @@ _EFI_ARCH="x86_64"
pkgname="grub" pkgname="grub"
pkgdesc="GNU GRand Unified Bootloader (2)" pkgdesc="GNU GRand Unified Bootloader (2)"
pkgver=2.02.beta2 pkgver=2.02.beta2
pkgrel=4 pkgrel=5
url="https://www.gnu.org/software/grub/" url="https://www.gnu.org/software/grub/"
arch=('x86_64') arch=('x86_64')
license=('GPL3') license=('GPL3')
...@@ -44,10 +44,10 @@ source=("grub-${_pkgver}::git+git://git.sv.gnu.org/grub.git#tag=${_GRUB_GIT_TAG} ...@@ -44,10 +44,10 @@ source=("grub-${_pkgver}::git+git://git.sv.gnu.org/grub.git#tag=${_GRUB_GIT_TAG}
"http://ftp.gnu.org/gnu/unifont/unifont-${_UNIFONT_VER}/unifont-${_UNIFONT_VER}.bdf.gz" "http://ftp.gnu.org/gnu/unifont/unifont-${_UNIFONT_VER}/unifont-${_UNIFONT_VER}.bdf.gz"
"http://ftp.gnu.org/gnu/unifont/unifont-${_UNIFONT_VER}/unifont-${_UNIFONT_VER}.bdf.gz.sig" "http://ftp.gnu.org/gnu/unifont/unifont-${_UNIFONT_VER}/unifont-${_UNIFONT_VER}.bdf.gz.sig"
'grub-10_linux-detect-archlinux-initramfs.patch' 'grub-10_linux-detect-archlinux-initramfs.patch'
'grub-intel-ucode.patch'
'grub-add-GRUB_COLOR_variables.patch' 'grub-add-GRUB_COLOR_variables.patch'
'0001-Fix-security-issue-when-reading-username-and-password.patch' '0001-Fix-security-issue-when-reading-username-and-password.patch'
'grub.default' 'probe_nvme.patch'
'grub.default'
'update-grub') 'update-grub')
md5sums=('SKIP' md5sums=('SKIP'
...@@ -55,9 +55,9 @@ md5sums=('SKIP' ...@@ -55,9 +55,9 @@ md5sums=('SKIP'
'728b7439ac733a7c0d56049adec364c7' '728b7439ac733a7c0d56049adec364c7'
'SKIP' 'SKIP'
'945527e0de8d384166a4cf23439ae9ee' '945527e0de8d384166a4cf23439ae9ee'
'a678629bc82c4e70c48d28242036d1d7'
'e506ae4a9f9f7d1b765febfa84e10d48' 'e506ae4a9f9f7d1b765febfa84e10d48'
'9589ec46a04f9bb4d5da987340a4a324' '9589ec46a04f9bb4d5da987340a4a324'
'01d6dda5ffe2b6de35254f3bb2344c38'
'31e4c7414cef3db3fb26c40ac8da97f2' '31e4c7414cef3db3fb26c40ac8da97f2'
'9910bdfd42fa7d3e21e6961bfcc977f9') '9910bdfd42fa7d3e21e6961bfcc977f9')
...@@ -75,10 +75,6 @@ prepare() { ...@@ -75,10 +75,6 @@ prepare() {
msg "Security fix CVE-2015-8370" msg "Security fix CVE-2015-8370"
patch -Np1 -i ../0001-Fix-security-issue-when-reading-username-and-password.patch patch -Np1 -i ../0001-Fix-security-issue-when-reading-username-and-password.patch
msg "Patch to load Intel microcode"
patch -Np1 -i "${srcdir}/grub-intel-ucode.patch"
echo
msg "Patch to detect of Chakra Linux initramfs images by grub-mkconfig (same as Arch)" msg "Patch to detect of Chakra Linux initramfs images by grub-mkconfig (same as Arch)"
patch -Np1 -i "${srcdir}/grub-10_linux-detect-archlinux-initramfs.patch" patch -Np1 -i "${srcdir}/grub-10_linux-detect-archlinux-initramfs.patch"
echo echo
...@@ -87,6 +83,10 @@ prepare() { ...@@ -87,6 +83,10 @@ prepare() {
## Based on http://lists.gnu.org/archive/html/grub-devel/2012-02/msg00021.html ## Based on http://lists.gnu.org/archive/html/grub-devel/2012-02/msg00021.html
patch -Np1 -i "${srcdir}/grub-add-GRUB_COLOR_variables.patch" patch -Np1 -i "${srcdir}/grub-add-GRUB_COLOR_variables.patch"
echo echo
msg "Add support for nvme disk"
patch -Np1 -i "${srcdir}/probe_nvme.patch"
echo
msg "Fix DejaVuSans.ttf location so that grub-mkfont can create *.pf2 files for starfield theme" msg "Fix DejaVuSans.ttf location so that grub-mkfont can create *.pf2 files for starfield theme"
sed 's|/usr/share/fonts/dejavu|/usr/share/fonts/dejavu /usr/share/fonts/TTF|g' -i "${srcdir}/grub-${_pkgver}/configure.ac" sed 's|/usr/share/fonts/dejavu|/usr/share/fonts/dejavu /usr/share/fonts/TTF|g' -i "${srcdir}/grub-${_pkgver}/configure.ac"
......
diff --git a/grub-core/osdep/linux/getroot.c b/grub-core/osdep/linux/getroot.c
index 19581d3..7007193 100644
--- a/grub-core/osdep/linux/getroot.c
+++ b/grub-core/osdep/linux/getroot.c
@@ -896,6 +896,23 @@ grub_util_part_to_disk (const char *os_dev, struct stat *st,
*pp = '\0';
return path;
}
+
+ /* If this is a NVMe device */
+ if ((strncmp ("nvme", p, 4) == 0) && p[4] >= '0' && p[4] <= '9')
+ {
+ char *pp = p + 4;
+ while (*pp >= '0' && *pp <= '9')
+ pp++;
+ if (*pp == 'n')
+ pp++;
+ while (*pp >= '0' && *pp <= '9')
+ pp++;
+ if (*pp == 'p')
+ *is_part = 1;
+ /* /dev/nvme[0-9]+n[0-9]+p[0-9]* */
+ *pp = '\0';
+ return path;
+ }
}
return path;
--
cgit v0.9.0.2
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