yashsingh1/xdaforums huggingface dataset:
[Xiaomi Mi Pad 5] TheMagicMojoMan:
Thanks for all your help! @D6072 @LesGaR @ClearStaff

I tried flashing the fastboot ROM in many different combinations:

with MiFlash tool or by running flash_all.bat directly

running flash_all.bat with/without prior manual flashing of vbmeta_ab/vbmeta_system_ab and with/without prior reboot

flashing vbmeta with/without options --disable-verity and/or --disable-verification

Unfortunately, all of these tests were unsuccessful. After reboot the tablet still shows FASTBOOT and I can neither get out of this state nor boot TWRP or orangefox via fastboot.

Also flashing xbl manually did not change anything. (@D6072 @LesGaR no more need to send dumped images of your tablets to me because it is part of the fastboot ROM).

I am running out of ideas ... Maybe I will try to contact that payed service which offers device recovery.

P.S.: I did the flashing using an old laptop running Win 10 since somebody reported having problems with Win 11. I might also try to do the flashing using Linux but I don't think this will change anything.
[Xiaomi Mi Pad 5] LesGaR:
I send PM, sorry for delay
[Xiaomi Mi Pad 5] TheMagicMojoMan:
I have used the paid service of @mvikrant97 this morning and fortunately he was able to bring my tablet back to life :)

I can highly recommend his service and if you ever run into similar severe problems that need an authorized reflash of your device he will be the one who can do it. See this thread here

Xiaomi Auth Flash

Authorised from the site administration. Thanks to @V0latyle @Oswald Boelcke @willverduzco and all other admins. MESSAGE ME on XDA Forums Telegram Support Official MIUI & HyperOS Bootloader Unlock Guide Xiaomi Auth Flash Payments: PLEASE...

xdaforums.com

He really tries to help the people the best he can and also brought free tools here to the forum for fixing a couple of older devices. See

Xiaomi No Auth Firehose Files for Qualcomm based phones.

What is this file? As we all know that Xiaomi has blocked offline flashing with authentication to flash their device. This files will ultimately help you to fix the Mi Account Authorization issue and hence unbrick your Xiaomi device via EDL mode...

xdaforums.com

What a nice person!

---

So, I hope to be able to continue our journey of running and improving Linux on this mighty tablet in a couple of days. Still need to unlock boot loader once again, then rooting, formating and reinstalling Linux which might take some time.

In the meantime I wish you all a Merry Christmas (to whom it may belong)!
[Xiaomi Mi Pad 5] TheMagicMojoMan:
And thanks again to all of you who offered tips and help with my problem and invested their time for me. You girls and guys rock!
[Xiaomi Mi Pad 5] amazingfate:
Anyone know how does the stylus pen work on linux? The stylus driver of touchscreen is already in kernel, I guess there should be some configuration with evdev/libinput to make it work with apps like Xournal++.
[Xiaomi Mi Pad 5] ClearStaff:
I got my device back just yet too. Little later cause xmas, and i had to unlock it again too. Can someone bring me up to speed on recent development? @TheMagicMojoMan / @maverick_jia is the pen working on main branch? I had similar changes on mine but i could not get it to work, also anyone had luck with v6.6 yet?
[Xiaomi Mi Pad 5] maverick_jia:
Hi, welcome back and hope you had a happy Christmas! The stylus seems to be unusable. I don't have a stylus so I can't test it. I'm still struggling with fast charging, so have no plans to use 6.6 yet.
[Xiaomi Mi Pad 5] TheMagicMojoMan:
I think @LesGaR was able to boot 6.6 but USB is not working. Don't know about stability of the kernel.
[Xiaomi Mi Pad 5] ClearStaff:
@TheMagicMojoMan for wifi not working correctly, post systemctl status for services, one distro used iwd by default instead of wpa_supplicant in my case and i had similar problems
[Xiaomi Mi Pad 5] TheMagicMojoMan:
First of all: I wish you all a happy new year!

Due to problems with the prior one I have reuploaded my last Ubuntu 23.10 image which starts in OEM mode and does automatic resizing of the image to the size of the partition. In this context I have also changed version number back to 0.91 (naming the last one 1.0 was a dumb decision in hindsight).

This version comes with the most recent 6.1.10 kernel and I have also added a boot loader which automatically boots the image if the partition name is 'Ubuntu' so you don't have to choose the correct sdaXX partition name anymore (but you can still download the boot_sdaXX boot loaders if you need them).

I have also reverted back to @maverick_jia's firmware files structure for better compatibility.

If you just want to update then

download xiaomi-nabu-firmware.deb, xiaomi-nabu-modules.deb and boot loader of your choice

rename your /lib/firmware and /lib/modules/6.1.10-... folders

install the .deb packages

flash the boot loader and

reboot

If everything works well then you might delete the old firmware and module folders.

If you do a new install (at your own risk) then

download boot_xiaomi-nabu_Ubuntu.img

download rootfs.img.xz and DECOMPRESS it

download vbmeta_disabled.img

follow guide at https://xdaforums.com/t/resize-inte...ad-5-nabu-and-install-another-images.4642670/ thoroughly to partition your disk, delete dtbo and flash vbmeta with disabled verified boot BUT

do sgdisk --resize-table 64 /dev/block/sda in adb shell to extend the number of partitions from 32 to 64,

(to be prepared for future images: create a 512MB large fat32 partition for efi support)

create an ext4 partition named 'Ubuntu' (not 'pmos')

Flash the root image: fastboot flash Ubuntu rootfs.img

Flash the boot loader. If Android is installed in slot 'a' you do fastboot flash boot_b boot_xiaomi-nabu_Ubuntu.img otherwise fastboot flash boot_a boot_xiaomi-nabu_Ubuntu.img

Activate correct slot and reboot: fastboot set_active b or fastboot set_active a

Reboot: fastboot reboot

---

Next I will try to get Manjaro running again and upload an image of it for those interested. After that I think I'm gonna invest some time on kernel 6.6.

---

Please have a look out for @LesGaR 's coming efi image which includes signing, btrfs support and standby mode.
[Xiaomi Mi Pad 5] TheMagicMojoMan:
Thanks - I'm gonna try this next!
[Xiaomi Mi Pad 5] TheMagicMojoMan:
Small addition:

'Suspend' & waking up from "Suspend' does already work with the new 0.91 image/new kernel. Nice!
[Xiaomi Mi Pad 5] bigfoothart:
Nice job guys, thanks for your efforts! I was just able to accomplish this, I can run Ubuntu on this beast. I wish I could run Arch Linux too.
[Xiaomi Mi Pad 5] TheMagicMojoMan:
Hi and welcome - nice to have you on board!
[Xiaomi Mi Pad 5] D6072:
Did someone tried Vanilla GNOME on Ubuntu 23.10 on this tablet?

What is the best way to install Vanilla GNOME Session o…

I want to install it, but it will remove pulseaudio and install pipewire for me. Will it cause sound issues?
[Xiaomi Mi Pad 5] ClearStaff:
@D6072 there should be no issues with pipewire, but i recommend to use wireplumber instead of pipewire-media-session. Also you could always try to switch back to pulseaudio cause on other distros pipewire and pulseaudio are easy to switch between.
[Xiaomi Mi Pad 5] ClearStaff:
@TheMagicMojoMan @maverick_jia after getting the device back from service i started working right away on our biggest problem, boot/multiboot and i found solution, what if i told you as long as we have one boot.img and esp.img flashed onto a device we could load every Linux distro we have with automatic system Discovery? Worth a shot?
[Xiaomi Mi Pad 5] TheMagicMojoMan:
Oh yes, definitely worth a shot!!! Great work!

(And if we could also boot Android as well it would be perfect, but little by little ...)
[Xiaomi Mi Pad 5] ClearStaff:
From my early testing, we can boot Linuxes and Windows this way, Android needs some device-tree magic and im unsure how to proceed with it right now.
[Xiaomi Mi Pad 5] ClearStaff:
I can already see many advantages from my early tests.

1. We do not need to generate boot.img, we just need make install kernel to boot directory in rootfs (not a single mount point) (for Ubuntu you can just add /boot/some-kernel-image + if you want /boot/some-initrd-image to your modules deb package).

2. root= kernel parameter is discovered at boot time automatically as long as your kernel is on the same partition as system and you have correctly created /etc/fstab.
[Xiaomi Mi Pad 5] TheMagicMojoMan:
I have just created a new thread [ROM] Arch Linux on Xiaomi Pad 5 (nabu) and kindly asked the moderators to move the posts about Arch Linux to the new thread. Please head over there for everything regarding Arch Linux. Thanks!
[Xiaomi Mi Pad 5] LesGaR:
WoW!! great work!

You can boot secure_boot and signed drivers in windows and boot linux?

I was trying but not work for me, but I not use rfind, I was use grub.

I only boot with old uefi without secureboot enabled and need enable test signing in windows bcd.

I was used grub because I wasa change ubuntu nabu filesystem to btrfs, enable it in kernels 6.1 and 6.6 and use grub-btrfs.

When use Btrfs with compresion, ubuntu intallation use less than 2 GB and I don't see nabu work slowly, but not have performance tests to compare ext4 and btrfs.

Now I try to boot btrfs snapsots from grub. at the moment create snapshots in ubuntu work and can be choiced from grub, but not work perfect. Maybe need have changes in btrfs structures.

I think his aproach, when working, can be best environement to develop for nabu, because you not depend to external pc to make changes.

My computer was broken (trackpad, not work) and I wait to tecnical seervice fix it. I work only in nabu. But I have my old kernels 6.1 and 6.6 deb packages and firmware folder to boot in uefi mode if you like test, or if you prefer, if you share me your uefi folder, can I try to boot it with rfind.
[Xiaomi Mi Pad 5] LesGaR:
Hi! I can't test smartpen because I was lost it:-(.

Yesterday I was recived a new smart pen, now can try if working or not.

You have some progress about it?

Yesterday I upgrade firmware from xx6 to lastest firm xx7 to capture latest firmware because I can't found it.

I try to downgrade it again to factory firm but I can't, maybe need reflash old nabu firmware, I don't know....

If you like to have some test with smartpen in ubuntu or armbian, please tell me,

I only have kernels 6.1 and 6.6. I try to compile your 6.7 kernel, with commits to nabu dts but at the moment, not work. But can try in 6.1 or 6.6
[Xiaomi Mi Pad 5] ClearStaff:
@LesGaR you will need to enable test signing drivers in windows anyway, no workaround for that, as for Linux we need to either patch Kernel to support ARM_APPENDED_DTB for arm64 or use EFISTUB Kernel with dtb= parameter otherwise it will not boot, so before sharing ESP image i need to figure out the correct approach before letting others waste time on that.
[Xiaomi Mi Pad 5] amazingfate:
I have given up the xiaomi pen because I find that xiaomi pad5 pro need an extra pen firmware which is not openned by xiaomi. Maybe it will work on pad5. See discussion here: https://github.com/map220v/sm8150-mainline/issues/3
[Xiaomi Mi Pad 5] ClearStaff:
Im afraid Nabu needs the same firmware.
[Xiaomi Mi Pad 5] TheMagicMojoMan:
I don't think so because Xiaomi Pad 5 Pro uses Smart Pen 2 which needs extra firmware.

I did dmesg in termux and it does not show extra firmware load for Smart Pen 1.

Anyway, although pen is shown to be enabled constantly it does not work. I suppose that it is simply not connected via bluetooth which Android seems to establish in kernel driver.

Also, we would need the correct settings in /lib/udev/hwdb.d/60-evdev.hwdb which are currently unknown.
[Xiaomi Mi Pad 5] ClearStaff:
I assumed is seems like it cause Arrow os fixed pen support by changing firmware. I need to double check that
[Xiaomi Mi Pad 5] LesGaR:
I can connect smartpen 1 in nabu Bluetooth, only need keep preset first button, few seconds and put smartpen in paring mode. Now can search in ubuntu Bluetooth and pairing. But not work, can you try if this method work for you. I tested in ubuntu wit kernel 6.1 and kernel 6.6 both can pair. Latest kernel 6.7 not work because Bluetooth it's working.

Can I send video with pairing method if need

I don't know what rule need to mod, can you explain it or send link to mod it and I try it.

Thanks in advance
[Xiaomi Mi Pad 5] TheMagicMojoMan:
I can connect the pen as well and it shows up in the list of input devices as a keyboard:

Device: Xiaomi Smart Pen
Kernel: /dev/input/event8
Group: 6
Seat: seat0, default
Capabilities: keyboard
Tap-to-click: n/a
Tap-and-drag: n/a
Tap drag lock: n/a
Left-handed: n/a
Nat.scrolling: n/a
Middle emulation: n/a
Calibration: n/a
Scroll methods: none
Click methods: none
Disable-w-typing: n/a
Disable-w-trackpointing: n/a
Accel profiles: n/a
Rotation: 0.0

It also sends events when pushing the buttons.

Lower button:

themojoman@mipad5:~$ sudo cat /dev/input/event8
X��e!u
NX��e!u
mX��e!u
^[[6~X��e=NX��e=mX��e=

Upper button:

hemojoman@mipad5:~$ sudo cat /dev/input/event8
���eҷ
K���eҷ
h���eҷ
^[[5~���e�:K���e�:h���e�:

But it does not show anything when touching the screen or when hovering above the screen.

I think this only works when the kernel driver connects directly to the pen and we still don't know how to do it. I fear it is not implemented in serdeliuk's touchscreen driver. Or is it? @maverick_jia

You can also see error in libinput devices:

event1 - NVTCapacitivePen: libinput bug: missing tablet capabilities: resolution. Ignoring this device.

This is the one we need to get working I think. I tried adding stuff to /lib/udev/hwdb.d/60-evdev.hwdb and error disappears but pen is not working anyway.
[Xiaomi Mi Pad 5] bigfoothart:
Can we also get binderfs modules for running waydroid?
[Xiaomi Mi Pad 5] TheMagicMojoMan:
You can try it now. I have just uploaded bootloader with a new kernel containing binderfs. I hope that it'll work.
[Xiaomi Mi Pad 5] bigfoothart:
Amazing, it's working, now we have Android on Linux tablet!
[Xiaomi Mi Pad 5] TheMagicMojoMan:
How to get network working in waydroid? Settings shows an IP address but internet is not working.

I also tried this (as one can find on their website)

sudo ufw allow 53
sudo ufw allow 67
sudo ufw default allow FORWARD

but it does not work.
[Xiaomi Mi Pad 5] ClearStaff:
While @TheMagicMojoMan is working on quality of life enhancements and little testings i can share a little progress on my side with you. I pretty much finished proof of concept multiboot solution, now we just need to figure out how to package images correctly for it.
[Xiaomi Mi Pad 5] dskw:
Hi everyone!

I've got my hands on a refurbished Pad 5 128GB recently and bootloader unlock should be available next weekend for me.

Are those steps still up to date, or is there a more recent change to be taken into account?

What is the latest recommended image for the installation?

The main thread post mentions the desktop-less preview images and also those with desktop by @TheMagicMojoMan

Or are there newer packages?

Is the latest 6.1.10 kernel included in them, if not where can it be obtained from?

Is it still very unstable, or would you say it is in a state where it could be used?

I'm more inclined towards ubuntu with the amd64 built packages vs. windows 11, since most of the tools I'm planning to use are available for the OS and arch.

Fastcharge is a difficult topic, I've read about the issues on the windows telegram group, but what does it mean that "Powermanagement" is still missing for the Ubuntu/Linux support?

Does it consume more power than running windows right now due to missing power modes of the CPU or what?

I'm trying to get a good picture and understanding until the tablet is ready for the installation.
[Xiaomi Mi Pad 5] ClearStaff:
Current recommended image is latest Ubuntu from TheMagicMojoMan imho, partitioning should look the same, but i strongly recommend to create ESP partition alongside partition for Linux (just like you would do before installing Windows) because in future multiboot might require ESP partition. With images you have included most stable kernel right now. Newest kernel that we have booting on Mi Pad 5 is 6.7, but it currently does not have Bluetooth + panel suspend resume. Fastcharging is very WIP on kernel 6.7, but because its not yet ready to be used on a daily basis i don't recommend fiddling with 6.7 kernel unless you are advanced linux user. Energy consumption i think is better than Windows, but i suggest reboot to Android for charging for now. Also Smart Pen works on Windows, but on Linux is not there yet.
[Xiaomi Mi Pad 5] dskw:
Sounds good to me. Yes I will very likely just use the current 6.1.10 kernel, unless some major changes happen during next week.

For the ESP partition can I just follow the recommendations from TheMagicMojoMan's guide?

Having no pen support and booting to Android for charging is fine for me. I will use Linux mostly for running DnD sessions and for daily stuff switch to Android. Does running Ubuntu also require a stronger charger as the OEM one like with windows? I've read some 33W might work.

I'm wondering though, since it's the same issue for Windows:

Does the second OS (win, linux) use much more power than the original MIUI OS? Are we missing some drivers or firmware to have more refined control over power management of heavy components?

And, since I plan to buy the 2nd gen stylus in the next weeks: Anything I can help with to find a proper firmware?

I haven't looked into the core of Android in quite some years, but didn't it have some similarity to Linux in its core?

My thought is: Could we get a compatible firmware binary somewhere from ArrowOS or another OS where it's working? (probalby not and I'm looking at it from a too simple view point :p )
[Xiaomi Mi Pad 5] TheMagicMojoMan:
Small update regarding kernel 6.7.0:

I have just tested Android performance inside Ubuntu 23.10 using 'Waydroid' and the result for Geekbench 6 seems to be on par with native Android and a lot better than Windows :)

3DMark Sling Shot result seems to be lower than native Android:

I have also tested if Asphalt 9 is working and the result is that it does. Anything else I should test for the audience here?
[Xiaomi Mi Pad 5] TheMagicMojoMan:
Kernel is included in the boot loader that you have to download and flash to boot_b (or boot_a if Android is installed in slot b).
[Xiaomi Mi Pad 5] dskw:
Ha that worked well!

Yesterday evening my tablet got unexpectedly unlocked earlier, so I could spend his afternoon running through the installation steps.

I went with 50GB userdata and 60GB for Ubuntu, including a 512MB efi placeholder and 6GB trailing remaining space in case I decide to make use of a swap partition later on.

Ubuntu is working really well and I was able to connect my BT mouse and keyboard just fine.

I have a USB-C hub here with passthrough power and HDMI support here that I am testing right now.

Interestingly it works if I just hook up USB devices to it.

Once I also attach a power source the driver (sorry, forgot the name before reboot to MIUI) throws some errors in dmesg and the HUB is not working. Without power it works fine.

I'll check this out further later once I'm back in Android.

@TheMagicMojoMan the user mentioned on the first post (Username: user , Password: ubu147147) does not exist, is that correct? So nothing to clean up when using your 0.91 image?

Switching between Android and Ubuntu is currently only supported via fastboot adb commands, do I understand that correctly?

Is there a way to get this done on the device with a PC involved? I have not messed with magisk and twrp yet, so I'm not sure if that is something that would close this gap.

EDIT:

The mentioned errors when attaching the hub to a power source:

The device

HDMI seems to be non function as well with this hub, not even error logs show up, but that's not much of a problem for my use case. Performance of the tablet is not good enough for what I had on mind with an external screen, so I will refrain from using external displays on it.

Log:
[Xiaomi Mi Pad 5] ClearStaff:
Temporary user was used before i figured out Gnome OEM mode and we made use of it, does not exist on newest images. USB hub dying while connecting charger is related to using pm8150b_charger driver without ln8000_charger driver, might work on 6.7 later, generally speaking charging related things are yet very "alpha" stage. This device does not support HDMI even on Android if i recall correctly. Switching between OSes? From Android to Linux you can change slot with some Android app that requires root, other way not yet possibile and i dont want to pursue changing slots from Linux cause one of us bricked device experimenting with it. I am currently testing/developing multiboot so you wilk be able to select system at boot in the future.
[Xiaomi Mi Pad 5] dskw:
I've looked up qbootctl from postmarketos and tried it just now. Worked in my 2 tries so far. It simply sets the active boot slot and then you have to reboot the OS.

And yes, doing the route Android->Linux is the same thing used on the windows front:

root with magisk and then use switchtowin.apk.

I haven't done the rooting/android part yet because of what I saw in your post.

Is that what I think it it is? An efi bootloader that allows the selection of either android or linux/other os without the need to root Android?

If yes that would be awesome and I'll just wait for your results and not root my device :)
[Xiaomi Mi Pad 5] ClearStaff:
There is a video in my post from two days ago on this threads just scroll up a little :) basically UEFI launches aarch64 version of refind (created for Apple Silicon MacBooks, slightly configured to work on this tablet) and a different way of supplying Kernel using systemd-ukify.
[Xiaomi Mi Pad 5] Sticky92:
This build

kinda amazing. is it possible to run native vulkan or opengl apps? Does Blender or Gimp works as well?
[Xiaomi Mi Pad 5] TheMagicMojoMan:
Some more graphics testing - kernel 6.1.10:

I have just installed plasma-desktop and plasma-workspace-wayland, removed ubuntu-desktop and reran glmark2-wayland.

The result is stunning!

Gnome: glmark2 Score: 1152

KDE Plasma: glmark2 Score: 2154
[Xiaomi Mi Pad 5] dskw:
That's with the 6.7 kernel, right?

Is it faster in general than the previous kernel? I could use a bit of graphical performance boost and might try it too. Given you can provide a deb or instructions :D

Btw, any news on the boot loader @ClearStaff?
[Xiaomi Mi Pad 5] TheMagicMojoMan:
No, it is still the 6.1.10 kernel. (Info is now added to my last post)
[Xiaomi Mi Pad 5] ClearStaff:
Current Ubuntu does not build systemd with systemd-ukify support and i think how to package .deb UKI without using systemd-ukify. Other than this, its ready
[Xiaomi Mi Pad 5] TheMagicMojoMan:
Some more graphics testing - kernel 6.7.0:

Login with GDM to ...

Gnome: glmark2 Score: 623 (1st run), 599 (2nd run)

Logout and login with GDM to ...

KDE Plasma: glmark2 Score: 599 (1st run), 579 (2nd run)

Reboot and direct login with GDM to ...

KDE Plasma: glmark2 Score: 1023 (1st run), 1017 (2nd run)

Can we understand the results?

Maybe something initiated by Gnome was still running in the background when I logged out of Gnome and into KDE Plasma. After reboot and direct login to KDE Plasma we see better results for 6.7.0 which would be in line with what we saw from the tests using kernel 6.1.10.

Overall glmark2 performance is much lower for 6.7.0 compared to 6.1.10. One thing that might explain a degradation of performance is the fact that the tablet screen is driven with 120 Hz in kernel 6.7.0 vs. 104 Hz in kernel 6.1.10. But I did not expect such a huge impact on performance. Maybe it is possible to compile a 6.7.0 kernel with a refresh rate of 104 Hz and additionally even 60 Hz. Than we would see if this is the cause of performance loss.

Results of second run is always lower than of first run: heat, I guess.
[Xiaomi Mi Pad 5] MateusL13:
Does Ubuntu on nabu boots using UEFI? I'm asking because I'm planning to use it alongside with windows 😅