Search This thread
Nov 23, 2021
44
25
OnePlus 5T
Xiaomi Mi Pad 5
Then you may need to use my OrangeFOX recovery, or any other recovery that may offer root on your nabu, you need then a few binaries for arm, parted and sgdisk for sure, parted to print partitions and remove userdata then add back userdata as a smaller partition, then use sgdisk to increase partition table size, nabu is limited to only 32 entries by default and 31 are used, userdata being the last one, so if you need more than two OSes you need to create as many as you need at this point, i have created 2 extra.

Below is my partition table, as you can see i shrunk a lot userdata, and have plenty free space to add another partitions, note the name of partitions, system is used for PMOS, you can use that name with fastboot
Code:
sh-5.0# ./parted /dev/block/sda           
GNU Parted 3.3
Using /dev/block/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print free
print free
Model: SAMSUNG KLUDG4UHDC-B0E1 (scsi)
Disk /dev/block/sda: 126GB
Sector size (logical/physical): 4096B/4096B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name             Flags
        16.4kB  24.6kB  8192B   Free Space
 1      24.6kB  32.8kB  8192B                switch
 2      32.8kB  65.5kB  32.8kB               ssd
 3      65.5kB  98.3kB  32.8kB               dbg
 4      98.3kB  131kB   32.8kB               bk01
 5      131kB   262kB   131kB                bk02
 6      262kB   524kB   262kB                bk03
 7      524kB   1049kB  524kB                bk04
 8      1049kB  1573kB  524kB                keystore
 9      1573kB  2097kB  524kB                frp
10      2097kB  4194kB  2097kB               countrycode
11      4194kB  8389kB  4194kB               misc
12      8389kB  12.6MB  4194kB               vm-data
13      12.6MB  16.8MB  4194kB               bk06
14      16.8MB  25.2MB  8389kB               logfs
15      25.2MB  33.6MB  8389kB               ffu
16      33.6MB  50.3MB  16.8MB               oops
17      50.3MB  67.1MB  16.8MB               devinfo
18      67.1MB  83.9MB  16.8MB               oem_misc1
19      83.9MB  101MB   16.8MB  ext4         metadata
20      101MB   134MB   32.9MB               bk08
21      134MB   168MB   34.2MB               splash
22      168MB   201MB   33.6MB               bk09
23      201MB   9328MB  9127MB               super
24      9328MB  9328MB  131kB                vbmeta_system_a
25      9328MB  9328MB  131kB                vbmeta_system_b
26      9328MB  9396MB  67.1MB               logdump
27      9396MB  9530MB  134MB                minidump
28      9530MB  9664MB  134MB                rawdump
29      9664MB  10.7GB  1074MB  ext4         cust
30      10.7GB  10.9GB  134MB   ext2         rescue
        10.9GB  10.9GB  786kB   Free Space
31      10.9GB  50.0GB  39.1GB               userdata
32      50.0GB  50.5GB  500MB                EFI              msftdata
33      50.5GB  70.0GB  19.5GB               WIN              msftdata
34      70.0GB  80.0GB  10.0GB               system
        80.0GB  126GB   45.6GB  Free Space
cool. Ive already rooted my Pad 5 on MIUI. Do I need to still 'fastboot boot yourrecovery.img'? Im very used to using adb and fastboot. Ive never actually manually partitioned an Android-device before though.
Is your recovery-image needed to fastboot into its RAM to not actually have its root partition mounted to actually be able to partition the device?

I dont have All of the base UNIX-programs on the tablet tho.


Man what is it with android and it using a billion partitions?

I find Androids type of partitioning and use of a/b-slots utterly confusing compared to normal Linux-distros. But Its fun to learn, I like a challenge. I know Android is built on the Linux-kernel but Android kinda is its own thing.

Maybe I could practice first in a VM or an Android-emulator like the one that's in Android Development Studio? Anyhow, I dont have anything to flash except ArrowOS, which is still Android, and not full linux.

I appreciate the tutorial though :). U rock bro.
 
Nov 23, 2021
44
25
OnePlus 5T
Xiaomi Mi Pad 5
Why to use wine or proton when WIndows for ARM in running well on this tab? As far as i know GPU is working well under windows. Sound doesn't work yet in linux and i think in windows either, not sure.
there is Windows to run in this tablet ? wuuut? I didnt know that, I think. Also I kinda hate using Windows, never used their ARM-version. Why would anyone want to run Windows on this tablet? x86-games wont work natively without like proton, box86/64,wine or something like that.
 
cool. Ive already rooted my Pad 5 on MIUI. Do I need to still 'fastboot boot yourrecovery.img'? Im very used to using adb and fastboot. Ive never actually manually partitioned an Android-device before though.
Is your recovery-image needed to fastboot into its RAM to not actually have its root partition mounted to actually be able to partition the device?

I dont have All of the base UNIX-programs on the tablet tho.


Man what is it with android and it using a billion partitions?

I find Androids type of partitioning and use of a/b-slots utterly confusing compared to normal Linux-distros. But Its fun to learn, I like a challenge. I know Android is built on the Linux-kernel but Android kinda is its own thing.

Maybe I could practice first in a VM or an Android-emulator like the one that's in Android Development Studio? Anyhow, I dont have anything to flash except ArrowOS, which is still Android, and not full linux.

I appreciate the tutorial though :). U rock bro.
You may need to boot my OrangeFOX to be able to resize your userdata, under Android is mounted and even root is not allowed to unmount that partition.

Yeah, a bit strange to have such amount of partitions, yet this is Android, there are are a lot of oem partitions that keep firmware code.

A/B slots is a good thing, your Android uses one of them as active one, when you update the OS the other one is written if something goes wrong you can always boot back the old OS, we use the inactive slot to boot PMOS or any other OS, depending on what you have on boot_INACTIVE partition.
 
there is Windows to run in this tablet ? wuuut? I didnt know that, I think. Also I kinda hate using Windows, never used their ARM-version. Why would anyone want to run Windows on this tablet? x86-games wont work natively without like proton, box86/64,wine or something like that.
Yes it is, and why not, if possible is a challenge too, you can review my post on how to port EDK2 on nabu to boot Windows
 
Nov 23, 2021
44
25
OnePlus 5T
Xiaomi Mi Pad 5
You may need to boot my OrangeFOX to be able to resize your userdata, under Android is mounted and even root is not allowed to unmount that partition.

Yeah, a bit strange to have such amount of partitions, yet this is Android, there are are a lot of oem partitions that keep firmware code.

A/B slots is a good thing, your Android uses one of them as active one, when you update the OS the other one is written if something goes wrong you can always boot back the old OS, we use the inactive slot to boot PMOS or any other OS, depending on what you have on boot_INACTIVE partition.
yeah, Ive read that it is a good thing, its still kinda crazy with so many partitions. I will need to read up the Android-developer site on how it all works.
Is that how GSI-images are booted by loading it into he other slot? I've tried that, pretty cool .
Yes it is, and why not, if possible is a challenge too, you can review my post on how to port EDK2 on nabu to boot Windows
I was just wondering what the benefits of running Windows on ARM is instead of Android? Pretty cool, I will look into this too.

I dont wanna hijack this thread more hehe :). I went kinda offtopic there.
 
yeah, Ive read that it is a good thing, its still kinda crazy with so many partitions. I will need to read up the Android-developer site on how it all works.
Is that how GSI-images are booted by loading it into he other slot? I've tried that, pretty cool .

I was just wondering what the benefits of running Windows on ARM is instead of Android? Pretty cool, I will look into this too.

I dont wanna hijack this thread more hehe :). I went kinda offtopic there.
Yeah, too many partitions, but the only one that counts is userdata partition, after you backup what you have there you need to delete the partition and then create a new userdata but smaller use the same name for that partition, leave the rest empty for now, then reboot to your android to fix the data partition. Then reboot to OrangeFOX use the sgdisk from the attached archive to increase the number of partitions allowed, then reboot to OrangeFOX
Code:
/sdcard/sgdisk -S 54 /dev/block/sda
sgdisk --help may explain what -S means
Then you can create new partitions in the free space
 

Attachments

  • tools.tar.gz
    987.7 KB · Views: 8
Yeah, too many partitions, but the only one that counts is userdata partition, after you backup what you have there you need to delete the partition and then create a new userdata but smaller use the same name for that partition, leave the rest empty for now, then reboot to your android to fix the data partition. Then reboot to OrangeFOX use the sgdisk from the attached archive to increase the number of partitions allowed, then reboot to OrangeFOX
Code:
/sdcard/sgdisk -S 54 /dev/block/sda
sgdisk --help may explain what -S means
Then you can create new partitions in the free space
In theory it is possible to make a script for automatic splitting like in Oneplus 6. I can try...
 

Tryanks

Member
Sep 15, 2022
10
12
You may need to boot my OrangeFOX to be able to resize your userdata, under Android is mounted and even root is not allowed to unmount that partition.

Yeah, a bit strange to have such amount of partitions, yet this is Android, there are are a lot of oem partitions that keep firmware code.

A/B slots is a good thing, your Android uses one of them as active one, when you update the OS the other one is written if something goes wrong you can always boot back the old OS, we use the inactive slot to boot PMOS or any other OS, depending on what you have on boot_INACTIVE partition.
Yesterday i change my userdata size to flash WOA by parted, It started smoothly. Unfortunately, my original system Android is broken by my noob operation :(
So I cleared all the WOA partition space and reflash MIUI. Now I have an Android system with 53G of storage and 64G of free space.
 
  • Like
Reactions: serdeliuk
In theory it is possible to make a script for automatic splitting like in Oneplus 6. I can try...
Should be possible, but i don't think this is something that should be automated. Removing userdata partition in an automatic process, or even in an interactive process is a very bad idea, even experimented users makes mistakes, imagine what a newbie can do, not reading the docs... for sure will lose at least all images that are not in backup
 
Should be possible, but i don't think this is something that should be automated. Removing userdata partition in an automatic process, or even in an interactive process is a very bad idea, even experimented users makes mistakes, imagine what a newbie can do, not reading the docs... for sure will lose at least all images that are not in backup
Is there any way to restore partitions in case of problems, for example, to flash a tablet from EDL as implemented in Oneplus?
 
Is there any way to restore partitions in case of problems, for example, to flash a tablet from EDL as implemented in Oneplus?
For sure should be possible, if anyone know how to put the nabu in EDL mode, my poco F1 have two test points on the motherboard that should be connected each other prior booting from shutdown (battery removed)
Then, even in EDL mode, it is required to have some software tools that are not easy to find and usually are expensive and require xiaomi encryption keys, however, any xiaomi authorized service can do the job easily and probably cheap
 

Tryanks

Member
Sep 15, 2022
10
12
Hi, how do you switch between the three systems fluently? From my previous experience trying WOA, to switch between WOA/Android requires reflash the UEFI partition, which seems very troublesome :(
 
Hi, how do you switch between the three systems fluently? From my previous experience trying WOA, to switch between WOA/Android requires reflash the UEFI partition, which seems very troublesome :(
If you have only two OSes you can switch between A and B slots, if you have 3, and pretending that Android is on A slot and you want to boot one of the other OSes yes, you need to replace the boot on slot B for the desired OS, at this moment.
I will build a proper bootloader in a near future, i am planning to port Clover bootloader to ARM, there exists Simpleinit but i never used nor tested. Clover can boot efi bootloaders as well as legacy bootloaders and is very appropriate
 

Ankitpandey2

Member
Aug 12, 2021
25
5
[UPDATE 22 Oct 2022]
- finally working battery status
View attachment 5740895
View attachment 5740899

[UPDATE 11 Sep 2022]
- mainlined to 6.0-RC4
- GPU is finally working
- panel and brightness is working
- bluetooths is working

[UPDATE 2 Jul 2022]
- mainlined to the latest available kernel, 5.19.0-RC4
- WiFi finally works
View attachment 5650675

Hello,

I have successfully ported PostmarketOS to my Xiaomi Pad 5 tablet.
View attachment 5630875

I have fixed SPI touchscreen and currently boot from B slot, on A slot is still Android (dual boot)
WiFI do not work yet and the network is provided via USB, as the ssh access on the tablet too.

# here you can find the official page for this device
PostmarketOS Xiaomi-nabu page

I will keep you posted about the progress.

Best regards

M
Btw man, really loved your idea and this project, just best regards from my side..

I have redmi pad with meditek g99 so no hopes for this tab...😔😔
 
Last edited:
  • Like
Reactions: serdeliuk
Btw man, really loved your idea and this project, just best regards from my side..

I have redmi pad and no hopes for this tab...😔😔
You can try to find a similar device that has same CPU on which work the PostmarketOS, then try to port your downstream kernel drivers. You can even try to start PMOS on your downstream kernel, and if all goes well mainline
 

Ankitpandey2

Member
Aug 12, 2021
25
5
You can try to find a similar device that has same CPU on which work the PostmarketOS, then try to port your downstream kernel drivers. You can even try to start PMOS on your downstream kernel, and if all goes well mainline
This redmi pad is launched with new cpu meditek g99 which launched this year only. So have no hope that any port of pmos will exist for this cpu... If you have any other idea then u can tell me...
I can give try to port Linux as I really need Linux a lot in my day to day life...

And worst part is pc mode is also completely removed by Xiaomi after miui 13 Android 12 update...

But for now am runing kalinethunter magisk version on my device through chroot... Bec I usually need linux to do my some crazy work...
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 8
    Happy New Year!!!
    6
    I have upgraded the kernel to latest mainline 6.2-rc4 and ported all mods, still testing a bit, but i started to write the guide on how to install the preview images and soon i will publish the guide and images.
    5
    Would be awesome! So you also release the kernel changes?
    I will release the source code for my project as patches (patch files) added to PostmarketOS source code available on GitLab creating a new device, this will follow to the release of the images of the preview as it is required a lot of extra work. I am publishing the source code as patches to let others quickly port them to newer kernels later.
    4
    FYI i have updated the post #1
  • 35
    [UPDATE 23 Jan 2023]
    - XDA staff is pushing me to provide kernel source waving the linux kernel's GPL OpenSource license.
    I am using the latest stable linux kernel which can be found here linux-6.1.7.tar.xz
    - I am using as well some mods made by others which are put together by map220v and this kernel may be found here sm8150-mainline
    - As anyone may know kernel modules/drivers can be closed source and my kernel modules will remain as such until i decide that i am ready to make them OpenSource.

    JUST TO BE NOTED, I DIDN'T PROVIDED YET ANY ROM OR BINARY KERNEL, SO I AM NOT BOUND TO ANY GPL

    _______________________________
    Donate a coffee to support development:
    Donate via PayPal to serdeliuk


    [UPDATE 20 Jan 2023]
    - Mainlined to the latest kernel 6.2-rc4
    - Created the HowTo Resize internal storage on Xiaomi Pad 5 (nabu) and install PostmarketOS Preview
    - Preparing the preview images, please check https://github.com/serdeliuk/xiaomi-nabu-postmarketos

    [UPDATE 17 Dec 2022]
    - Fixed battery charging, now battery is charging as well, on slow speed.
    Yet the battery indicator still do not work properly

    [UPDATE 22 Oct 2022]
    - finally working battery status
    1666434328506.png

    1666436173168.jpeg


    [UPDATE 11 Sep 2022]
    - mainlined to 6.0-RC4
    - GPU is finally working
    - panel and brightness is working
    - bluetooths is working

    [UPDATE 2 Jul 2022]
    - mainlined to the latest available kernel, 5.19.0-RC4
    - WiFi finally works
    nabu.wifi.ok.jpg

    Hello,

    I have successfully ported PostmarketOS to my Xiaomi Pad 5 tablet.
    pmos.working.touch.jpg

    I have fixed SPI touchscreen and currently boot from B slot, on A slot is still Android (dual boot)
    WiFI do not work yet and the network is provided via USB, as the ssh access on the tablet too.

    # here you can find the official page for this device
    PostmarketOS Xiaomi-nabu page

    I will keep you posted about the progress.

    Best regards

    M
    10
    I have a bit of success, finally working battery status as you can see on images updated on #1 post
    9
    I have created the official device page, is not ready yet, but a start
    PostmarketOS Xiaomi-nabu page
    9
    It's bluetooth, as well as the Smart Pen, but they don't work in non-stock... GSIs, for exemple
    Thanks for the info, if are bluetooth and if i will make the BT work then for sure I will find a way to make them work, will be a bit difficult to test as i do not have the keyboard or the pen and are a bit expensive....
    There is just a matter of time to make the already ported touchscreen driver from downstream to mainline to have the pen working, in regards to the keyboard that should work directly (without charging) the pogo pins probably have a hall sensor to activate the power output to charge the keyboard when connected, the same should exists on the other side for pen, but those are far away on my development scale, as right now i am trying to bring up the multi touch gestures and prepare a release, as the wifi works, even without GPU the tablet is usable as a Linux device already.
    8
    You've achieved an awesome thing. Will you post image with instructions on here as you progress? Thanks anyway.
    Thank you, i will post here any progress i will have, right now i am working to publish a new device through PostmarketOS site and sources will be available through their repos, images as well.
    All required instructions about how to install will be available through PostmarketOS wiki pages