[Pinebook Pro] 5.13 no longer boots from NVME

I’m trying to setup to build a kernel with the code restored. Guided by your posts here:

I used git and updpkgsums to obtain linux513 and the kernel source but I’m troubled that I can’t find the
“CONFIG_PCI_MSI_ARCH_FALLBACKS=y” line in any of the previous config files.

My plan is to restore that line in the linux513 config file and also restore the code in the 3 files documented here:

and then build a new kernel package.

Okay–I found it. It’s in zcat /proc/config.gz

so, per your instructions,

 zcat /proc/config.gz >> .config

brings it into my Linux513 kernel source from gitlab.

But I’m still running 5.12 so where can I find the 5.13 config file? Again, my plan is to take the Manjaro 5.13 source and edit it to restore the use of the msi_controller. If it then boots from NVMe, that would be conclusive and I’ll file the bug report.

I have Manjaro XFCE on an SD card. Maybe I can get the 5.13 config file from it, but looks like I’ll have to boot the SD card to generate the file in /proc/

make menuconfig doesn’t allow me to add the "CONFIG_PCI_MSI_ARCH_FALLBACKS=y” back into the 5.13 .config file so I added it back in manually. Now on to the source edits…

When I tried to edit linux-5.3/drivers/pci/msi.c to put the code back into 5.13, I see that it still contains the old code with the MSI support ( beginning with /* Arch hooks */`on line #65), but when I browse the code at msi.c « pci « drivers - kernel/git/stable/linux.git - Linux kernel stable tree, I see that the MSI code has been removed, as expected.

The code differences are not as I expect so pointless to build the kernel at this point.

When I

cd linux53
updpkgsums

(quote is from your “Download kernel source” post)

Does updpkgsums generate a tar.gz source archive for 5.12 instead of 5.13, because I’m still running the 5.12 kernel? I guess I could try all this from my 5.13 Manjaro XFCE SD card and see what happens.

This kernel building process is very different from my frequent experiences building kernels with Gentoo, Ubuntu, Red Hat, etc. many years ago, where I’d just install the linux-source package (or whatever it was named) and I’d know exactly what version of linux source I was getting!

You need this source instead:

The other one you have is pretty old and for x86_64.

Oops! I’ll git it and start over. :slight_smile:
Thanks!

I’m following this guide

and I’m at Step 9:

However, there is no /boot/vmlinuz file to copy and vmlinux-5.13.0-MANJARO-ARM already exists and it has a timestamp that indicates it was built when I performed step 7 (“sudo make install”).

# ls -tla
total 82408
-rwxr-xr-x  1 root root  6216201 Jul 23 19:03 System.map-5.13.0-MANJARO-ARM
-rwxr-xr-x  1 root root 31402496 Jul 23 19:03 vmlinux-5.13.0-MANJARO-ARM
-rwxr-xr-x  1 root root  7208095 Jul  7 09:40 initramfs-linux.img
-rwxr-xr-x  1 root root 30974464 Jun 16 03:41 Image
drwxr-xr-x  2 root root     4096 Jun  3 19:11 extlinux
drwxr-xr-x  7 root root     4096 Jun  3 19:10 dtbs
-rwxr-xr-x  1 root root   157980 May 23 10:04 idbloader.img
-rwxr-xr-x  1 root root  4194304 May 23 10:04 trust.img
-rwxr-xr-x  1 root root  4194304 May 23 10:04 uboot.img
drwxr-xr-x 17 root root     4096 May  5 15:01 ..
drwxr-xr-x  4 root root    16384 Dec 31  1969 .

Should I proceed with step 10 to generate initramfs now without doing step 9??

I’ll wait for confirmation from you, Strit, because of the risk that my system might not boot if I proceed incorrectly.

Looking at my Manjaro XFCE system on my SD card as well as my backup of Manjaro KDE Fusion 5.12 that I copied to eMMC, it appears that I might need to rename “vmlinux-5.13.0-MANJRO-ARM” to “Image”, because U-Boot does not support selecting multiple kernels like grub so the kernel is simply named “Image.”

Or maybe I can keep the old Image and initramfs.linux.img files and just edit extlinux.conf to point to the new files. That seems safer, because if it doesn’t boot, I can restore extlinux.conf and get the system to boot (I think).

This is the safest way to test out new kernels without uninstalling the old one.

mkinitcpio would not let me generate an initramfs with a new filename so I’m using the original name (initramfs-linux.img ) and, even though mkinitcpio seems to to permit a new kernel name, I’m using the original name “Image” too. (I saved the old files as .bak files.)

After generating the initramfs and rebooting, it’s not booting my new 5.13 kernel:

uname -ar
Linux pinebook 5.12.11-1-MANJARO-ARM #1 SMP Wed Jun 16 10:48:53 UTC 2021 aarch64 GNU/Linux
[calinb@pinebook ~]$ 

Maybe it’s because my mmcblk2 and nvme0n1 partitions have the same UUID (but different labels, which I changed):

lsblk -f
NAME         FSTYPE FSVER LABEL           UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
mmcblk2                                                                                       
├─mmcblk2p1  vfat   FAT16 MMCBT_MNJRO     DC5B-1D91                                           
└─mmcblk2p2  ext4   1.0   EMMC_ROOT_MNJRO a24b5d20-0aef-4e1d-a516-c5f272500ed3                
mmcblk2boot0                                                                                  
mmcblk2boot1                                                                                  
zram0                                                                                         [SWAP]
nvme0n1                                                                                       
├─nvme0n1p1  vfat   FAT16 BOOT_MNJRO      DC5B-1D91                                94M    56% /boot
└─nvme0n1p2  ext4   1.0   ROOT_MNJRO      a24b5d20-0aef-4e1d-a516-c5f272500ed3  850.3G     3% /

The labels in extlinux.conf match my nvme:

$ cat /boot/extlinux/extlinux.conf  
LABEL Manjaro ARM
KERNEL /Image
FDT /dtbs/rockchip/rk3399-pinebook-pro.dtb
APPEND initrd=/initramfs-linux.img console=tty1 console=ttyS2,1500000 root=LABEL=ROOT_MNJRO rw rootwait video=eDP-1:1920x1080@60 video=HDMI-A-1:1920x1080@60 bootsplash.bootfile=bootsplash-theme
s/manjaro/bootsplash

What should I do about the duplicate UUIDs? I could just change the UUIDs on my emmc but, if U-Boot uses UUIDs, where is the configuration for them?

I used gparted to reset the UUIDs on both mmcblk2 partitions, re-ran mkinitcpio (which generated a new initramfs-linux.img) but, upon reboot, uname -r still reports 5.12 is running.

Since making my UUIDs unique, I did a “make clean” and rebuilt the kernel to the end of the process

make -j$(nproc)
..
..
sudo mkinitcpio -p linux

but it still boots to the old 5.12 kernel:

$ uname -r
5.12.11-1-MANJARO-ARM

:unamused:

Maybe I should use makepkg -s, as you describe here:

Where does makepkg expect to find config (and is it “config” or “.config”)? Should config exist in the same folder as PKGBUILD? Where does it expect to find the .preset file (“linux.preset”)?

What steps must be completed after makepkg -s to install the kernel?

Well, I tried makepkg -s and got this:

...
...
patching file tools/testing/selftests/kvm/dirty_log_test.c
patching file tools/testing/selftests/kvm/lib/kvm_util.c
patching file tools/testing/selftests/kvm/lib/x86_64/processor.c
patching file tools/testing/selftests/kvm/set_memory_region_test.c
patching file tools/testing/selftests/kvm/steal_time.c
patching file tools/testing/selftests/kvm/x86_64/set_boot_cpu_id.c
patching file tools/testing/selftests/lkdtm/run.sh
patching file tools/testing/selftests/lkdtm/tests.txt
patching file tools/testing/selftests/net/forwarding/pedit_dsfield.sh
patching file tools/testing/selftests/net/forwarding/pedit_l4port.sh
patching file tools/testing/selftests/net/forwarding/skbedit_priority.sh
patching file tools/testing/selftests/net/tls.c
patching file tools/testing/selftests/powerpc/pmu/ebb/no_handler_test.c
patching file tools/testing/selftests/resctrl/README
patching file tools/testing/selftests/resctrl/resctrl_tests.c
patching file tools/testing/selftests/sgx/load.c
patching file tools/testing/selftests/splice/short_splice_read.sh
patching file tools/testing/selftests/tc-testing/plugin-lib/scapyPlugin.py
patching file tools/testing/selftests/timers/rtcpie.c
patching file tools/testing/selftests/vm/protection_keys.c
patching file virt/kvm/coalesced_mmio.c
==> ERROR: A failure occurred in prepare().
    Aborting...

Okay. That’s a lot of questions.

Makepkg it self does not use the config file. But it is listed in the source of the PKGBUILD. So the file is called what it’s called in the PKGBUILD (which in our case is config).

Yes. All the files mentioned in the source=() array should be in the same folder as the PKGBUILD, unless the source is a URL.

In the same folder as the PKGBUILD, just like config.

To install a package that was built with makepkg you run:

sudo pacman -U <path to package file>

According to the output: ==> ERROR: A failure occurred in prepare(). there was an error in the prepare step. So likely a patch failed to apply. But we can’t know for sure, without the entire output (you only pasted a couple of lines, which so not contain the actual error).

Yes–many questions but your answers helped me greatly! I’ll debug the prepare error later. It was from my Manjaro XFCE system on SD card. I went back to my Manjaro Fusion system on NVMe SSD and makepkg worked!

However, I don’t see any new Image or vmlinux or other new file in /boot. There is a ~/linux/linux-5.13/vmlinux file with a new timestamp. Do I need to copy it to /boot/Image ?

Did you do install the package or just build it?

I did

updpkgsums
makepkg -s

then I did

sudo pacman -U ~/linux/linux-5.13.4-2-aarch64.pkg.tar.zst
sudo pacman -U ~/linux/linux-headers-5.13.4-2-aarch64.pkg.tar.zst

Here’s the output from the linux-5.13.4-2 install:

$ sudo pacman -U ~/linux/linux-5.13.4-2-aarch64.pkg.tar.zst  
loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (1) linux-5.13.4-2

Total Installed Size:   79.84 MiB
Net Upgrade Size:      -35.09 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                                                                                      [######################################################################] 100%
(1/1) checking package integrity                                                                                    [######################################################################] 100%
(1/1) loading package files                                                                                         [######################################################################] 100%
(1/1) checking for file conflicts                                                                                   [######################################################################] 100%
(1/1) checking available disk space                                                                                 [######################################################################] 100%
:: Processing package changes...
(1/1) upgrading linux                                                                                               [######################################################################] 100%
warning: /etc/mkinitcpio.d/linux.preset installed as /etc/mkinitcpio.d/linux.preset.pacnew
:: Running post-transaction hooks...
(1/4) Arming ConditionNeedsUpdate...
(2/4) Updating module dependencies...
(3/4) Updating linux module dependencies...
(4/4) Updating linux initcpios...
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
  -> -k 5.13.0-MANJARO-ARM -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
==> Starting build: 5.13.0-MANJARO-ARM
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [autodetect]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
  -> Running build hook: [filesystems]
  -> Running build hook: [keyboard]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-linux.img
==> Image generation successful
[calinb@pinebook linux]$ sudo pacman -U /home/calinb/linux/linux-headers-5.13.4-2-aarch64.pkg.tar.zst 
loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (1) linux-headers-5.13.4-2

Total Installed Size:  83.99 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                                                                                      [######################################################################] 100%
(1/1) checking package integrity                                                                                    [######################################################################] 100%
(1/1) loading package files                                                                                         [######################################################################] 100%
(1/1) checking for file conflicts                                                                                   [######################################################################] 100%
(1/1) checking available disk space                                                                                 [######################################################################] 100%
:: Processing package changes...
(1/1) installing linux-headers                                                                                      [######################################################################] 100%
:: Running post-transaction hooks...
(1/3) Arming ConditionNeedsUpdate...
(2/3) Updating module dependencies...
(3/3) Updating linux module dependencies...

Okay. Did you change any file locations in the PKGBUILD before building it?

If you didn’t, the file you have in /boot/Image is the new one, since it will overwrite it.

The timestamp is wrong on /boot/Image. Can’t be the new one.

I think I maybe need to update the .preset file line in /etc/mkinitcpio.d/linux.preset

cat /etc/mkinitcpio.d/linux.preset
# mkinitcpio preset file for the '%PKGBASE%' package

ALL_config="/etc/mkinitcpio.conf"
ALL_kver="5.13.0-MANJARO-ARM"

PRESETS=('default')

#default_config="/etc/mkinitcpio.conf"
default_image="/boot/initramfs-linux.img"
#default_options=""

You have a .pacnew there, so move that over in it’s stead and rebuild the initramfs.

Okay. I did " sudo mv linux.preset.pacnew linux.preset"

and then:

 sudo mkinitcpio -p linux
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
  -> -k 5.13.4-2-MANJARO-ARM -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
==> Starting build: 5.13.4-2-MANJARO-ARM
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [autodetect]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
  -> Running build hook: [filesystems]
  -> Running build hook: [keyboard]
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-linux.img
==> Image generation successful
 

But no “Image” or “vmlinux” file in /boot still:

ls -tla
total 83444
-rwxr-xr-x  1 root root  7208560 Jul 26 15:27 initramfs-linux.img
drwxr-xr-x  9 root root     4096 Jul 26 14:52 dtbs
drwxr-xr-x  2 root root     4096 Jul 26 11:57 extlinux
-rwxr-xr-x  1 root root  7208095 Jul 26 11:56 initramfs-linux.img.bak
-rwxr-xr-x  1 root root 30974464 Jul 26 11:56 Image.bak
-rwxr-xr-x  1 root root 31468032 Jul 26 11:54 Image.old
drwxr-xr-x  4 root root     4096 Jul 26 11:15 .Trash-1000
-rwxr-xr-x  1 root root   157980 May 23 10:04 idbloader.img
-rwxr-xr-x  1 root root  4194304 May 23 10:04 trust.img
-rwxr-xr-x  1 root root  4194304 May 23 10:04 uboot.img
drwxr-xr-x 17 root root     4096 May  5 15:01 ..
drwxr-xr-x  5 root root    16384 Dec 31  1969 .