Firefly Open Source Community

   Login   |   Register   |
New_Topic
12
New Topic
Print Previous Topic Next Topic

[Linux] How can I make a minimal os build in for PX30 board

67

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
67

【Linux】 How can I make a minimal os build in for PX30 board

Posted at 5/4/2022 17:23:17      View:2322 | Replies:10        Print      Only Author   [Copy Link] 1#
Hi guys,

So I need to create a minimal image which is like the minimal-core-image in Yocto build to test the operation of my custom board based on the Firefly px30 board since the pre-built image is not bootable with my custom board. Because I am new to this field so I do not know how to do it.  From the answer of the previous problem link I was advice to check the speed of eMMC so I did and it turns out there is not much of a difference between the two eMMC. I also tried to boot with the sd card and nothing changed.  So far nothing work so I just want to create an image to boot at minimal initialization to add one device by another to identify which part of the peripherals cause the problem.  

I have tried to disable some devices in device tree but it is just not working and hanged at boot.  So now I think that I should build an minimal image but even though there are a yocto folder inside the SDK, I have been long deleted so I do not know how to build one with default the kernel, uboot, loader and buildroot file system. So my question is that is there any way I can make a minimal image with the sdk and how to do it.

Please help and thank you in advance
Reply

Use props Report

486

Credits

20

Prestige

15

Contribution

intermediate

Rank: 3Rank: 3

Credits
486
Posted at 5/5/2022 14:36:18        Only Author  2#
Reply

Use props Report

67

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
67
Posted at 5/6/2022 10:26:50        Only Author  3#
时间的蝴蝶 Posted at 5/5/2022 14:36
Maybe you want to know about this.
https://wiki.t-firefly.com/en/Core-PX30-JD4/buildroot_compile.ht ...

Thank you for your answer @时间的蝴蝶
Well I have read the manual very carefully  but there is a problem that I need you to verify. That is from what I know the buildroot given in the SDK is actually not building any kernel, uboot, etc but only the rootfs. And the rootfs when boot for the first time it will reset to format partition. I assume that this behavior is a part of the modification of Firefly company to buildroot rootfs. So I just want to know is my assumption correct or the reset is a part of some other element than rootfs. And can you give me a hint where I can find and modify that part in the SDK. I know my question is very vague but I do not know to correctly express it.
Reply

Use props Report

486

Credits

20

Prestige

15

Contribution

intermediate

Rank: 3Rank: 3

Credits
486
Posted at 5/7/2022 14:40:27        Only Author  4#
tuhn1995 Posted at 5/6/2022 10:26
Thank you for your answer @时间的蝴蝶
Well I have read the manual very carefully  but there is a  ...

Yes, Buildroot just compiles rootfs.
Regarding reset, it boots from the recovery partition and then formats the userdata partition.
The build output of recovery is at `buildroot/output/rockchip_px30_recovery`, which conforms to the WIKI instructions at `https://wiki.t-firefly.com/en/Co ... root_develop.html`.
Reply

Use props Report

67

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
67
Posted at 5/9/2022 10:58:31        Only Author  5#

Sorry I think I miss that part of the Wiki, thank you for pointing that out.
The build output of recovery is at `buildroot/output/rockchip_px30_recovery`, which conforms to the WIKI instructions at `https://wiki.t-firefly.com/en/Co ... root_develop.html`.

.
So I guess if I delete the recovery part from the final upgrade img ( by changing the parameter file), the system will not reset and then boot from the recovery partition to format the user data partition, is it correct?  And can you explain why it need to do a seccond reset to finally bring the board up?
Reply

Use props Report

486

Credits

20

Prestige

15

Contribution

intermediate

Rank: 3Rank: 3

Credits
486
Posted at 5/9/2022 14:36:40        Only Author  6#
tuhn1995 Posted at 5/9/2022 10:58
Sorry I think I miss that part of the Wiki, thank you for pointing that out.

.

Yes, removing the recovery and misc partitions from the parameter file can achieve your desired effect.

We need to use the userdata partition, so formatting is necessary. When the system is running, the data will be saved to the userdata partition, which actually provides a function of clearing data to restore the default state of the system.
Reply

Use props Report

67

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
67
Posted at 5/10/2022 17:35:28        Only Author  7#
时间的蝴蝶 Posted at 5/9/2022 14:36
Yes, removing the recovery and misc partitions from the parameter file can achieve your desired ef ...

So It means that removing the recover part, I will not use userdata partition anymore and all of the remaining storage will not be partition and can not be used. Is it right? Well I think I will give it a try. Thank you very much for your support. It good to know that Firefly has such a good team. Just one more thing, Is it possible to modify the recovery and misc of the SDK? And if yes, which directory can I do such a thing?
Reply

Use props Report

486

Credits

20

Prestige

15

Contribution

intermediate

Rank: 3Rank: 3

Credits
486
Posted at 5/12/2022 10:06:12        Only Author  8#
Last edited by 时间的蝴蝶 In 5/12/2022 10:08 Editor
tuhn1995 Posted at 5/10/2022 17:35
So It means that removing the recover part, I will not use userdata partition anymore and all of t ...

In fact, it is difficult to describe in a few words. You can try it.

The build output of recovery is at `buildroot/output/rockchip_px30_recovery`, which conforms to the WIKI instructions at https://wiki.t-firefly.com/en/Co ... ldroot_develop.html .
recovery.img -> ../buildroot/output/rockchip_px30_recovery/images/recovery.img

For misc, misc.img -> ../device/rockchip/rockimg/wipe_all-misc.img
cat device/rockchip/rockimg/wipe_all-misc.img
Reply

Use props Report

67

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
67
Posted at 5/12/2022 16:49:15        Only Author  9#
Last edited by tuhn1995 In 5/12/2022 16:51 Editor
时间的蝴蝶 Posted at 5/12/2022 10:06
In fact, it is difficult to describe in a few words. You can try it.

The build output of recove ...

Thank you for your answer, I will try it .

But there is one more thing that I want to ask is that when the kernel  finish loading and the udev started to populate the /dev directory. It takes a lot of time like 40 secs, showing a promt that udevadm fail and then run a thing call ramdom number generator as can be shown below.

  1. [    5.210832] ALSA device list:
  2. [    5.214659]   #0: rockchip,rk809-codec
  3. [    5.376868] Freeing unused kernel memory: 1024K
  4. NAME=Buildroot
  5. VERSION=2018.02-rc3-ga31246734b
  6. ID=buildroot
  7. VERSION_ID=2018.02-rc3
  8. PRETTY_NAME="Buildroot 2018.02-rc3"
  9. Starting logging: OK
  10. Populating /dev using udev: [   33.487770] udevd[160]: starting version 3.2.7
  11. [   36.790111] udevd[160]: specified group 'kvm' unknown
  12. [   41.485961] udevd[161]: starting eudev-3.2.7
  13. udevadm settle failed</b>
  14. done
  15. Initializing random number generator... done.
  16. Starting network: cmdline=storagemedia=emmc androidboot.storagemedia=emmc androidboot.mode=normal  androidboot.slot_suffix= androidboot.serialno=17c5e6b3cec0121  ro rootwait earlycon=uart8250,mmio32,0xff160000 swiotlb=1 console=ttyFIQ0 root=PARTLABEL=rootfs rootfstype=ext4 overlayroot=device:dev=PARTLABEL=userdata,fstype=ext4,mkfs=1 coherent_pool=1m systemd.gpt_auto=0 cgroup_enable=memory swapaccount=1

  17. read console from cmdline is /dev/ttyFIQ0
  18. Starting recovery on Sat Aug  5 08:47:18 2017

  19. Recovery System have UI defined.
  20. failed to read font: res=-1, fall back to the compiled-in font
  21. [  350.000655] Freeing drm_logo memory: 1236K
  22. rotate degree: 0 - none, 1 - right, 2 - down, 3 - left.
  23. current rotate degree is : 0
  24. OK
  25. Debug: configfs_init
  26. mkdir: can't create directory '/sys/kernel/config/usb_gadget/rockchip/functions/uac1.gs0': No such file or directory
  27. mkdir: can't create directory '/sys/kernel/config/usb_gadget/rockchip/functions/uac2.gs0': No such file or directory
  28. [  611.974801] file system registered
  29. mkdir: can't create directory '/sys/kernel/config/usb_gadget/rockchip/functions/mtp.gs0': No such file or directory
  30. mkdir: can't create directory '/sys/kernel/config/usb_gadget/rockchip/functions/rndis.gs0': No such file or directory
  31. [  622.726941] Mass Storage Function, version: 2009/09/11
  32. [  622.741869] LUN: removable file: (no medium)
  33. mkdir: can't create directory '/sys/kernel/config/usb_gadget/rockchip/functions/hid.usb0': No such file or directory
  34. [  649.801816] read descriptors
  35. [  649.841781] read strings
  36. [  655.313572] dwc2 ff300000.usb: bound driver configfs-gadget
  37. [  655.626849] dwc2 ff300000.usb: new device is high-speed
  38. [  655.734602] dwc2 ff300000.usb: new device is high-speed
  39. [  655.802028] dwc2 ff300000.usb: new address 29
  40. [  655.841771] configfs-gadget gadget: high-speed config #1: b
  41. [  655.904757] android_work: sent uevent USB_STATE=CONNECTED
  42. [  655.937750] android_work: sent uevent USB_STATE=CONFIGURED
  43. Starting input-event-daemon: input-event-daemon: Start parsing /etc/input-event-daemon.conf...
  44. input-event-daemon: Adding device: /dev/input/event0...
  45. input-event-daemon: Adding device: /dev/input/event1...
  46. input-event-daemon: Start listening on 2 devices...
  47. done
Copy the code


So when the fs is ready, I tried to use ls /dev to see if any device is listed and there are a lot of device there. So why does udevadm fail but there are still device directories in  /dev.

I have tried to used another device management method in buildroot menuconfig (dynamic devtmpfs + mdev) but the result is still the same so can you make a guess why populate udev take up such a long time like this.
Reply

Use props Report

486

Credits

20

Prestige

15

Contribution

intermediate

Rank: 3Rank: 3

Credits
486
Posted at 5/13/2022 10:01:06        Only Author  10#
tuhn1995 Posted at 5/12/2022 16:49
Thank you for your answer, I will try it .

But there is one more thing that I want to ask is th ...

$ cat buildroot/output/rockchip_px30_recovery/target/etc/init.d/S10udev
udevadm settle --timeout=30 || echo "udevadm settle failed"

Check which peripheral and udev rule caused the processing timeout.
Reply

Use props Report

Return to List
12
You need to log in before you can reply Login | Register

This forum Credits Rules

Quick Reply Back to top Back to list