cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
AntonRG
Participant
Participant
363 Views
Registered: ‎02-13-2019

Merging Ubuntu rootfs and Petalinux rootfs in Petalinux 2021.01

Jump to solution

Hi,

 

Vivado version: 2021.01
Petalinux Version: 2021.01

HW: ZCU102

 

I have successfully run both the petalinux rootfs and the raspberry pi ubuntu rootfs on the ZCU102. But one issue is that when I use the Ubuntu rootfs I am missing any modules or drivers from the petalinux side for things like the onboard DisplayPort etc.

I can extract the rootfs.tar.gz and copy over the lib/modules but how should I merge the file structures as they have different folder names?
Is it simply a matter of "depmod" then modloading the new files once they are moved over or do I need to perform other steps?

My worry is that the uname will be different from the petalinux to ubuntu versions so which one will the ubuntu system be looking for?

Sorry for lots of questions, I have some experience with Linux but this is the first time ive merged two systems together like this.

 

0 Kudos
1 Solution

Accepted Solutions
aravindb
Moderator
Moderator
274 Views
Registered: ‎02-07-2018

HI @AntonRG 

That will not work if you simply replace the modules folder in raspberry pi ubuntu file system as this is built with different toolchain. 

It is mandatory that modules & rootfs should built with same toolchain inorder to install the modules.

Not sure this will help, but you can just try to copy all the /lib/modules directory to raspberry pi ubuntu file system & remove existing kernel modules and  run "depmod -a" , then insert the modules.

 

Thanks & regards

Aravind

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
------------------------------------------------------------------------------------------

 

View solution in original post

0 Kudos
5 Replies
watari
Professor
Professor
336 Views
Registered: ‎06-16-2013

Hi @AntonRG 

 

What kind of dtb are you using ?

Also, do you install kernel driver into rootfs or initramfs or something ?

 

Best regards,

0 Kudos
AntonRG
Participant
Participant
318 Views
Registered: ‎02-13-2019

Hi @watari 

 

Thanks for the responce.

I am using the dtb, almost without edits, from the petalinux tool chain which is based on the XSA I generated in Vivado.

I have switched to using SD card rather than initramfs and I partition the card with 1G boot Fat32 and the rest as EXT4 for the rootfs.

 

When I run the petalinux rootfs I simply extract the generated tar onto the EXT4 partition and the Boot.bin, ub file etc go on the boot parition.

When I run the ubuntu system I still use the boot.bin etc as before except I extract the predeployed raspberry pi ubuntu rootfs onto the EXT partition, I have also used the "core" ubuntu aarch64 tar before in a similar way.

So if I want to "merge" the two keeping the drivers and modules from the petalinux rootfs while keeping the core ubuntu rootfs also I was wondering what the best way to do that is?

Thanks again for your time.

0 Kudos
watari
Professor
Professor
314 Views
Registered: ‎06-16-2013

Hi @AntonRG 

 

>So if I want to "merge" the two keeping the drivers and modules from the petalinux rootfs while keeping the core ubuntu rootfs also I was wondering what the best way to do that is?

I suggest you to use generated kernel (included some kernel drivers) and dtb by petalinux.

 

BTW, can you share whole boot log message to make sure it ?

 

Best regards,

0 Kudos
aravindb
Moderator
Moderator
275 Views
Registered: ‎02-07-2018

HI @AntonRG 

That will not work if you simply replace the modules folder in raspberry pi ubuntu file system as this is built with different toolchain. 

It is mandatory that modules & rootfs should built with same toolchain inorder to install the modules.

Not sure this will help, but you can just try to copy all the /lib/modules directory to raspberry pi ubuntu file system & remove existing kernel modules and  run "depmod -a" , then insert the modules.

 

Thanks & regards

Aravind

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
------------------------------------------------------------------------------------------

 

View solution in original post

0 Kudos
AntonRG
Participant
Participant
173 Views
Registered: ‎02-13-2019

Thanks for the reply.

That works as i was hoping. I copy over the modules folder, run depmod to find all the dependencies, and then I can modprobe any drivers I need.

0 Kudos