yashsingh1/xdaforums huggingface dataset:
[Xiaomi Mi Pad 5] dskw:
@maverick_jia are you keeping track of the changes done by map220v in his repo for the 6.7 Kernel?

Commits · map220v/sm8150-mainline

WIP Mainline kernel for Xiaomi Pad 5. Contribute to map220v/sm8150-mainline development by creating an account on GitHub.

github.com

Looks like he has added pen support and some more changes since you included his DSP fix in your 6.1.10 branch.

I don't know much about kernel dev, so not sure how I could help to find out what could be improved for suspend mode.

I have the impression we've 10 people working on individual fronts for supporting linux on nabu.

If would be so much more useful to work collaboratively on a single repo for the kernel.

This would be of benefit for Ubuntu, Arch linux and any other distro people want to use.

I've also found a lot of SM8150 specific linux kernel branches online that might have some useful changes in them. Most of the were 1-2 years old though.

Just looking at github, a free organization with all-public repos can set up github actions with docker to build debian packages, or even build images to be flashed on the devices. (including cross compile of course)

I also saw your messages in the Arch thread @TheMagicMojoMan about a usb-stick based live distro option for installation.

Would such a topic warrant a dedicated forum thread?
[Xiaomi Mi Pad 5] maverick_jia:
Thank you for giving me this test result. I was still focusing on functionality rather than performance. I'll test the power consumption in the suspend mode later.

I think Ubuntu used 3 levels of power mode:

1. Turn off display.

2. Suspend to RAM. All devices into suspend mode, except DDR. I guess the problem should be here, all peripherals should go into low-power mode properly.

3. Power off.
[Xiaomi Mi Pad 5] dskw:
Thanks for your and everyone's great work on the kernel and images!

I'm not sure if the distributions have different setups, but according to this thread it should be 4:

Quick Battery Drain in Suspend Mode

I am using Ubuntu 22.10 and my laptop is a Dell XPS 13 9365. When I check my suspend type by typing cat /sys/power/mem_sleep it returns s2idle [deep] which I believe should save the most power. Des...

askubuntu.com

S0 - s2idle (freeze) Suspend-to-idle; providing power to SSD and RAM

S1 - shallow (stand-by) Power-on suspend; providing power lowest possible to CPU and I/O

S3 - deep Suspend-to-RAM; providing power to RAM, CPU goes off-line

S4 - disk Suspend-to-disk; write RAM information into Disk and give firmware control. Not many machines do this perfectly.

The post also mentions a grub settings which is interesting. Needs verification if it is really dell specific, or if other manufacturer hardware is affected by this mem_sleep_default=deep setting

I'm not sure what the expected behavior for a tablet should be when going to suspend. Personally I would not mind S3 since I don't care for notifications and alarms for this device/os.

I also need to check if the magnetic case is triggering correctly in Linux. At the moment nothing happens when I close it, but I think I saw a commit by you that it should be supported.

I still need to install your latest kernel image, but did not have much time to test on the tablet these days.
[Xiaomi Mi Pad 5] maverick_jia:
Yes , I did. My work is based on map220v's work, I just added some drivers that he didn't have. I also considered using linux 6.7 directly, but @TheMagicMojoMan said that linux 6.7 had some performance issues.
[Xiaomi Mi Pad 5] maverick_jia:
I completely agree with you. But I still have some questions,

I am a newer to use github, I don't know how to work to together on a single repo.

I don't know whether others are interested in a single repo.

If there are different ways to implement a feature, how to unify them.

I think it's a super big project, We should putting everything together first. If anyone is willing to do this, it's going to be a great guy.

I know some open source projects that provide some implementations, such as buidroot and yocto.

I have tested this use renegada project, but it is not worked, so it's no easy way to install a live distro form usb-stick.

I think all the topics I mentioned above is warrant a dedicated forum thread.

All of those are beyond my capabilities:ROFLMAO:
[Xiaomi Mi Pad 5] maverick_jia:
Here's a more low-level document to refer to:

System Sleep States — The Linux Kernel documentation

About the magnetic case, I have an official case with keyboard. I tested with this case. Here's a low-level test you can try:

sudo apt install evtest -y
sudo evtest /dev/input/eventX

X is the event number
[Xiaomi Mi Pad 5] Tryanks:
I discovered a method to export the needed partition without requiring the installation and booting of two separate Ubuntu systems. Here's how it can be done:

First, Switch to the Android system's slot using fastboot and boot into Orangefox Recovery.

You need to upload an armv7l build of busybox to the system's /tmp directory:

adb push busybox-armv7l /tmp/busybox

Next, initiate a TCP listener on your local machine and direct the output to a file:

nc -l 1234 > dump.rootfs.img.lzo

Through adb, establish a reverse proxy from port 1234 to the same port:

adb reverse tcp:1234 tcp:1234

Copy the partition and expedite the transfer with:

adb shell "chmod +x /tmp/busybox && /tmp/busybox dd if=/dev/block/sda33 | /tmp/busybox lzop -6 | /tmp/busybox nc 127.0.0.1 1234 && rm /tmp/busybox"

Note: The choice not to use toybox is due to its lack of the lzop fast compression tool. This method allowed me to pull a complete 176GB partition (compressed to 7.2GB) from my device in approximately 1300 seconds.

To decompress dump.rootfs.img.lzo on your device, use busybox lzop -d:

busybox lzop -d dump.rootfs.img.lzo

(Interestingly, the generic lzop tool fails to decompress it). Ensure there's ample disk space available, as it will unpack the entire ext4 partition image, which in my case occupied 176GB.

Use e2fsck to check, and resize2fs to compress the ext4 filesystem:

e2fsck dump.rootfs.img
resize2fs -M dump.rootfs.img

I now have a 7.2GB Ubuntu.Backup.rootfs.img image file. When I flash it to the Ubuntu partition, it restores everything. Remember to enable the resize script to reacquire the size suited to your device's partition:

systemctl enable resize-root

Currently, I am experimenting with various software on this system, including docker, box86, box64, steam, etc. Whenever I disrupt my system environment, my only recourse is to execute fastboot flash Ubuntu rootfs.img, followed by reinitializing Ubuntu with the OEM phase. Now, with a backup of Ubuntu that has been minimally upgraded and equipped with a few utilities, I feel more confident in conducting diverse tests.

I hope this can help someone :)

P.S.: Hi @TheMagicMojoMan , are there any plans to update to the latest kernel?
[Xiaomi Mi Pad 5] TheMagicMojoMan:
Actually, I build my images now by creating an .img file, mounting it as a loop device and then copying all the stuff that is needed into it. I can then install packages by chroot'ing or using systemd-nspawn (although this does not work with snap packages). All done on my Xiaomi tablet.

I can finally compress the image file and upload it or back it up.

However, for in depth testing of the graphical system I still need a second partition that I can boot (technically I could also use a USB stick for that and boot from it - but my USB sticks are slooooow).

If you have your Android rooted you can also do backups using Termux. Just type sudo dd if=/dev/block/sda33 of=myBackup.img if sda33 is your Linux partition. You can also compress the image using Termux.

I did some tests with 6.7 kernel maybe 4 weeks ago (don't remember) and kernel was working but sleep mode did not and performance was lower compared to 6.1.10 kernel (tested with glmark2-wayland). I might continue testing in the following days. Have other stuff I am working on that is more important to me. I don't feel an urge to switch to newer kernel if it does not bring big benefits.
[Xiaomi Mi Pad 5] Catmengi:
So, today i bought brand new xiaomi pad 5 and interested in linux on it. I have some questions: How do i compile kernel and pack it to android boot.img and dont brick my pad(of course i want new features). And does feature like sound and wireless require any specific userspace support(i want to use other distros too(debian?))? Thanks for any related replies)
[Xiaomi Mi Pad 5] TheMagicMojoMan:
Hi and welcome!

I would suggest to follow post #1 and install a premade image first. You can already do a lot of customizations using these images and gain a lot of experience.

When you feel more familiar you might head over to github and clone https://github.com/map220v/ubuntu-xiaomi-nabu.git which has scripts to build newest kernel and ubuntu image. You can easily modify these scripts to tailor them to your own needs (please do not ask here how to do it if you don't understand batch files. Inform yourself about batch scripting and building a Linux kernel.).

How to make bootable loader images is described in sections 2.4 & 2.5 here (as well as how to build @maverick_jia 's kernel):

https://www-cnblogs-com.translate.g...uto&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp

Last but not least: Everything you do with your tablet is at your own risk!
[Xiaomi Mi Pad 5] Catmengi:
But i dont know which kernel is better @map220v or @maverick_jia or they supported featuees are full same? Can you list supported and unsupported features?(Mostly need unsuported and broken features(supported by one kernel and not supported in other or broken in all of them))
[Xiaomi Mi Pad 5] TheMagicMojoMan:
Then I would suggest that you test both and tell us about your experience. I did just a few posts ago ... :)
[Xiaomi Mi Pad 5] Catmengi:
Now im waiting to unlock Xiaomi bootloader i think @maverick_jia 's kernel is more ready to work with nabu and it have more custom patches, i think i can try porting some features to @map220v kernel but i think if i patch charging driver i can burn my tablet (i will touch kernel code for first time in my life)-__-. About the ln8000, is this a PD or QC driver? And does microphone and audio(speakers) working in @map220v linux 6.7? I saw some commits that touches them. And also question about wifi and Bluetooth, does it work with @map220v kernel?(Im a just not sure). And wakeup and sleep are working in both of thoose kernels?
[Xiaomi Mi Pad 5] Catmengi:
Now im patching @maverick_jia kernel, i added some dts features from map220v kernel,like flash light and newer panel driver
[Xiaomi Mi Pad 5] Catmengi:
So today i ported some features from map220v kernel. this features are flash light and microphone. I compiled a kernel but can test it because of unlock wait time, so there compiled kernels and github link:

GitHub - catmengi/linux-6.1.10-patch

Contribute to catmengi/linux-6.1.10-patch development by creating an account on GitHub.

github.com

So can anyone test thoose kernels? Thanks

P.s. test this kernels just with fastboot boot, if they boot please say are there /sys/class/leds and microphone?
[Xiaomi Mi Pad 5] MateusL13:
To test it do I have to rename my partition to "linux"??
[Xiaomi Mi Pad 5] Catmengi:
If you have linux on /dev/sda32 you just have to run root=/dev/sda32.img
[Xiaomi Mi Pad 5] MateusL13:
My linux is on 34 😂
[Xiaomi Mi Pad 5] Catmengi:
I can repack kernel for /dev/sda34, just wait a few minutes
[Xiaomi Mi Pad 5] Catmengi:
this kernel is for /dev/sda34
[Xiaomi Mi Pad 5] MateusL13:
Thanks, I'll test it 😁
[Xiaomi Mi Pad 5] MateusL13:
It doesn't boot, end Kernel panic
[Xiaomi Mi Pad 5] Catmengi:
Can you try single user kernel, pls wait a minute
[Xiaomi Mi Pad 5] Catmengi:
this should use /bin/bash as init i think it cant find init
[Xiaomi Mi Pad 5] MateusL13:
Same problem 🤔
[Xiaomi Mi Pad 5] Catmengi:
Now i am compiling kernel with disabled microphone. It can be an error because it makes big changes in dts
[Xiaomi Mi Pad 5] Catmengi:
Maybe it fix but i am not sure. If this wont work i will patch @maverick_jia kernel from scratch to be sure i am not made any mistakes
[Xiaomi Mi Pad 5] MateusL13:
So, same thing again 👀
[Xiaomi Mi Pad 5] Catmengi:
Ok, i will try rollback my sources and patch dts-es again. Because i dont have any idea where the error can be
[Xiaomi Mi Pad 5] MateusL13:
Ok, don't forget that my linux installation is on sda34 😁 (named as Ubuntu)
[Xiaomi Mi Pad 5] Catmengi:
Now i am building kernel from rollbacked sources, now i added only flash node if it will work i will try adding microphone and updating panel drivers

Edit: here is a kernel from rollbacked sources with flash node added, if someone will test it(fastboot boot) it will boot from /dev/sda34. Please let me know if there are working /sys/class/leds/[dunno]
[Xiaomi Mi Pad 5] Catmengi:
Compiled a new kernel with updated panel driver and drm-panel subsystem, can be unstable but there arent any compilation errors was. This kernel boots from /dev/sda34. If some one can test it please test it via fastboot boot and say are there /sys/class/leds/[idk] working

EDIT: please test both of this kernels!
[Xiaomi Mi Pad 5] Catmengi:
When i looked for android DTS for this device i discovered this: https://github.com/ArrowOS-Devices/...1/drivers/media/platform/msm/camera_v2/camera

Can we use android camera driver for qualcomm on mainline kernel? Also there is a dtsi files for camera
[Xiaomi Mi Pad 5] Catmengi:
Third kernel a day now i tried add microphons node and cant test it out because off bootloader unlock wait time.

This kernel will boot from /dev/sda34 (for @MateusL13 ) Can anyone test it, please? Just with fastboot boot and say me boot it or not. If it boots and dont freeze please say are there /sys/class/leds[idk] and microphones working.(contact me if you need kernel modules).

Edit: i linked damn old dtb file all that time
[Xiaomi Mi Pad 5] MateusL13:
None of the kernel images booted so far, all end with the line end Kernel panic.

Could it because I have zram enabled on my installation?? 🤔
[Xiaomi Mi Pad 5] Catmengi:
Can you give me a screenshot of kernel panic?
[Xiaomi Mi Pad 5] Catmengi:
This may be because drivers or bad kernel modules. Can you give me screenshot of your error on latest of thoose kernels. And yes it can be because of zram, this kernel may not support you modules. Does it start init?
[Xiaomi Mi Pad 5] Catmengi:
Because i cant know where and what error causing kernel panic
[Xiaomi Mi Pad 5] MateusL13:
This one is from the latest boot.img
[Xiaomi Mi Pad 5] Catmengi:
Hmmmm this is the same error -____-. I dont know how to fix this only full removing my dts edits :)
[Xiaomi Mi Pad 5] Catmengi:
i revert all changes excluding flash led

Can you test it?
[Xiaomi Mi Pad 5] MateusL13:
Another Kernel panic 😁
[Xiaomi Mi Pad 5] Catmengi:
Well, i dont know where are error is. Maybe when i unclock my tablet (12d) i get back to work with this :(
[Xiaomi Mi Pad 5] MateusL13:
Ok, I'm almost always available to test things if you need 😊
[Xiaomi Mi Pad 5] rabbit z:
Is there any possibility to get the camera to work?
[Xiaomi Mi Pad 5] dskw:
Make sure to check the unlock tool in between waiting.

For me it unlocked after just 4 days, even though it initially wanted to wait for 7
[Xiaomi Mi Pad 5] Catmengi:
I tried skip unlocking time via unofficial tool but it growed from 168h to 360h now i am supposted to wait ~11d and i checking unlock time everyday.

Edit: which tool did you use?
[Xiaomi Mi Pad 5] TheMagicMojoMan:
Some comments:

1. Microphone is already working in Map220v's kernel.

2. Linux image will only boot when you also copy modules of 6.7 kernel into /lib/modules/6.7.xxx and when using 6.7 firmware layout (can be downloaded from map220v's github page).
[Xiaomi Mi Pad 5] dskw:
I have used the official one.

Do not bother with the unofficial tools, worst case they cause issues.

I have started the process twice by mistake and also had 360h showing up for me, but still after 4 days of keeping the tablet running I checked again with the official tool and suddenly they unlocked it for me.
[Xiaomi Mi Pad 5] dskw:
Ah sorry no, I have used this tool: https://www.xiaomitool.com/V2/

But followed the official procedure.
[Xiaomi Mi Pad 5] Catmengi:
This tool caused 360h waiting for me but i tried to unlock it on 2nd of use,this may was a error.

Edit: this tool not even working for me now(
[Xiaomi Mi Pad 5] Catmengi:
Does he fixed the charger yet? Will standart charger work well? (I saw commit message where it Isn't working). So i have question for you as man who knows the kernel more than full newbie(me). How to debug kernel on this tablet?(Preferably through usb)
[Xiaomi Mi Pad 5] maverick_jia:
How can this be achieved? The kernel can refer to the official source code, but does Ubuntu have stylus support?
[Xiaomi Mi Pad 5] yiyipenguin:
Hi, firstly I am so grateful for your good job.

I have already followed your guide, and the system can boot from my device properly. But some of questions I have encounted.

I want to install the ubuntu-desktop package on it, but it seemed that the rndis network sharing method didn‘t work, I used my mobile phone to share the network with mipad 5, but nothing happened.

Do you have any solutions of that?

Sorry for my bad English.
[Xiaomi Mi Pad 5] D6072:
First, enter "ip a" command , you need to look a device begin with"enp", for example, enp0s20f0u1. It's your mi pad 5.

Next, we need to give it a proper ip address, enter this command in your terminal:

sudo ip address add dev enp0s20f0u1 172.16.42.2/24

Note: replace "enp0s20f0u1" with your tablet's actual hardware location.
[Xiaomi Mi Pad 5] maverick_jia:
I use win10, share my experience，you can also try this,

Plug in the USB cable, will be shown in Network Connections as an RNDIS Adapter.

Set the IP address of the rndis adapter to 192.168.137.1

Right click on the Adapter that is connected to the internet.

Select Properties.

Switch to the Sharing tab, select your RNDIS adapter in the drop-down box

Turn off the network firewall

If your tablet still can't get the IP，reboot your windows
[Xiaomi Mi Pad 5] TheMagicMojoMan:
@maverick_jia Thanks for your great work!

Is there any chance we can download the preview image without having a Baidu account (because I really do not want to give them all my personal data including my cell phone number)?
[Xiaomi Mi Pad 5] yiyipenguin:
Ok, thank you. I will have a try.
[Xiaomi Mi Pad 5] yiyipenguin:
Thank you.
[Xiaomi Mi Pad 5] maverick_jia:
sorry for inconvenience. I've changed it to Google Drive, you can try it
[Xiaomi Mi Pad 5] TheMagicMojoMan:
Thanks!

Unfortunately, 7Zip always stops with an error after unpacking 46% of the image. I have downloaded the image twice and had the same error twice.
[Xiaomi Mi Pad 5] maverick_jia:
I fixed it, please try again. I am not at home lately, so I can only download from Baidu drive and upload the image to Google disk. sorry.
[Xiaomi Mi Pad 5] TheMagicMojoMan:
I was now able to decompress and install the images to my tablet. Thank you very much!

EDIT:

But when I attach the tablet to my Win 11 PC device manager recognizes it as an unknown USB device. I have downloaded the rndis.inf template from Microsoft webpage put when I try to install it throws an error stating that it is missing digital signature information.

So, how do I get rndis working on Win 11. Unfortunately, I did not find a driver that could be readily installed.

I have switched to my old laptop now running Manjaro Linux and I was able to see the tablet when typing 'ip a' and give it an ip address as described by @D6072. But when I try to connect to it via ssh I get the same error as described by @D6072: 'Permission denied'.

But then I remembered that I started reading your (chinese) in-depth tutorial about how to set things up manually and I recognized that your boot loader tries to boot /dev/sda32.

But my partition layout is different: sda31: ESP, sda32: Windows, sda33: linux, sda34: userdata.

Therefore, could you please add a boot loader that loads /dev/sda33 instead of /dev/sda32?

Thank you very much for your hard work!
[Xiaomi Mi Pad 5] maverick_jia:
Sorry, I can't go home now because the previous typhoon destroyed my home way. So I can't do this myself, I can give you some suggestions.

The following method can modify the location of the root partition.

you can install abootimg by command on ubuntu:

sudo apt-get install abootimg
sudo apt-get install android-tools-mkbootimg

1 unpack boot.img​

mkdir extract_bootimg
cd extract_bootimg
cp dir_of_bootimage/boot.img .
abootimg -x ./boot.img

2 View package information​

abootimg -i boot.img

3 repack boot.img​

After the above steps, you may get the file zImage you need and cmdline.

Now you can repack the boot.img and put the root in your correct partition

eg. for /dev/sda33

mv Image.gz-dtb zImage
mkbootimg --kernel zImage --cmdline "console=tty0 root=/dev/sda33 rw rootwait" --base 0x00000000 --kernel_offset 0x00008000 --tags_offset 0x00000100 --pagesize 4096 --id -o boot_new.img

I dont kown if what I wrote is useful, hope you can solve this problem. Good luck!
[Xiaomi Mi Pad 5] TheMagicMojoMan:
I'm very sorry to hear that you can't return home because of the last typhoon. I really hope that you and your family are O.K. and that things will get reconstructed soon!

It's so kind that even in this situation you are trying to help people like me with their insignificant problems while in real you are the one who is suffering. I can't thank you enough for your kindness!

I will try to follow your instructions to alter the bootloader later.

Take care
[Xiaomi Mi Pad 5] maverick_jia:
You are so friendly, I can't express much in my limited English. Thank you again. Please let me know if there are results.
[Xiaomi Mi Pad 5] MartinDoug:
Hi! Thank you for all effort put into this, it's amazing to see ubuntu running in nabu!

Probably I doing something wrong, but I'm couldn't boot it in my device - I have userdata (sda31), ESP (sda32), windows (sda33) and trying to boot ubuntu in /dev/sda34. I already tried to unpack boot.img using hints above, but I'm stuck in this error:

boot_new.img: ramdisk size is null
boot_new.img: not a valid Android Boot Image.

I also tried to build my own kernel to point it to /dev/sda34, flash it into my device, but I only see a black screen, and after some seconds it turn off. Tried to point it using partition name (/dev/block/bootdevice/by-name/ubuntu) but also, no success...

For some random reason, I'm able to boot PMOS in /dev/sda34, and also able to unpack its boot.img.
[Xiaomi Mi Pad 5] xdatux:
Hi @maverick_jia, I hope things are fine at your end.

Tried your Kernel, works well, thanks :-)

By any chance does it have the touch working?
[Xiaomi Mi Pad 5] jason170:
if can use chromeOS
[Xiaomi Mi Pad 5] maverick_jia:
congratulations! I was busy with some other things before, but I thank I can continue this now:). The driver of the touch screen should not be too complicated, but I don't know how much needs to be done in ubuntu layer.
[Xiaomi Mi Pad 5] maverick_jia:
sorry, I know nothing about chromeOS:(
[Xiaomi Mi Pad 5] xdatux:
Good to see you back.

I hope audio/mic is also in your wishlist :-)
[Xiaomi Mi Pad 5] TheMagicMojoMan:
Sorry, I am not a kernel guy.

I only compile the kernel with some custom configuration to get stuff working that I need and that people asked for. I mainly work on providing Linux images for this community and try to increase the usability of this great tablet computer.
[Xiaomi Mi Pad 5] MateusL13:
I'm using the kernel from zram update, which doesn't support microphone yet 🤔
[Xiaomi Mi Pad 5] TheMagicMojoMan:
Kernel from zram update is 6.1.10 kernel from @maverick_jia which does not support microphone, yet. We were talking about map220v's 6.7 kernel which supports microphone.
[Xiaomi Mi Pad 5] Catmengi:
Does suspend and wakeup working in 6.7 kernel by map220v?

Edit: comparing two drivers says to me that drm suspend should working but iam not sure :)
[Xiaomi Mi Pad 5] bizarreuser:
Hey could you please share the guide, I'm pretty new to this modding devices the link to the guide will be helpful thank you😊