This may not be the final solution, but it could serve as a reference for others.
Start by following this build guide:
If you use only the commands from the page, here’s the process:
repo init -u https://github.com/STMicroelectronics/oe-manifest.git -b refs/tags/openstlinux-6.1-yocto-mickledore-mp1-v23.06.21
repo sync
DISTRO=openstlinux-weston MACHINE=stm32mp15-disco source layers/meta-st/scripts/envsetup.sh
bitbake st-image-weston
After completing these steps, you can replace the root filesystem (rootfs).
I downloaded "debian-12.1-minimal-armhf-2023-08-22.tar.xz" from
#extract debian rootfs.
mkdir rootfs_extracted
sudo tar -xvf debian-12.1-minimal-armhf-2023-08-22.tar.xz -C rootfs_extracted/
#cd ....
mkdir extracted_rootfs
sudo tar -xvf armhf-rootfs-debian-bookworm.tar -C extracted_rootfs/
before proceeding, FYI,
The "FlashLayout_sdcard_stm32mp157f-dk2-optee.tsv" file references st-image-weston-openstlinux-weston-stm32mp15-disco.ext4.
(ex)
lrwxrwxrwx 1 abraxas4 abraxas4 77 May 2 16:53 st-image-weston-openstlinux-weston-stm32mp15-disco.ext4 -> st-image-weston-openstlinux-weston-stm32mp15-disco-20240511074134.rootfs.ext4
This ext4 file is a symbolic link pointing to another file.
You should rename your ext4 file to match the name of the target file indicated by this link.
extract st linux's rootfs.
ex)
cd ..../build-openstlinuxweston-stm32mp15-disco/tmp-glibc/deploy/images
sudo mount -o loop ./st-image-weston-openstlinux-weston-stm32mp15-disco-20240511074134.rootfs.ext4 ./st_linux_rootfs/
copy st linux's (sudo cp -r)
..../st_linux_rootfs/lib/modules
and
..../st_linux_rootfs/lib/firmware
to extracted debian's folders accordingly.
..../extracted_rootfs/lib/modules
and
..../extracted_rootfs/lib/firmware
Convert your debian rootfs to an ext4 format.
dd if=/dev/zero of=debian-rootfs.img bs=1M count=4096
mkfs.ext4 -F debian-rootfs.img
mkdir mnt
sudo mount -o loop debian-rootfs.img mnt/
sudo cp -a extracted_rootfs/. mnt/
sudo umount mnt
and rename "debian-rootfs.img " to match the name of the file specified in the script.
(this is simpler than modifying the script).
in my case, I deleted st-image-weston-openstlinux-weston-stm32mp15-disco-20240511074134.rootfs.ext4 and replaced it with the newly created image.
Set the partition sizes as needed:
..../build-openstlinuxweston-stm32mp15-disco/tmp-glibc/deploy/images/stm32mp15-disco/scripts/create_sdcard_from_flashlayout.sh
...
# Size of 8GB
DEFAULT_RAW_SIZE=${SDCARD_SIZE:-8192}
# size of 4GB
DEFAULT_ROOTFS_PARTITION_SIZE=4194304
...
(you can adjust the size)
Modify this file too if needed:
.../build-openstlinuxweston-stm32mp15-disco/tmp-glibc/deploy/images/stm32mp15-disco/flashlayout_st-image-weston/optee/FlashLayout_sdcard_stm32mp157f-dk2-optee.tsv
Increase the offset value of `0x13` if your rootfs is large.
Run the following to create the final image (*.raw) and use tools like Rufus or Pi Imager to burn the image to your SD card:
.../build-openstlinuxweston-stm32mp15-disco/tmp-glibc/deploy/images/stm32mp15-disco/scripts/
create_sdcard_from_flashlayout.sh ../flashlayout_st-image-weston/optee/FlashLayout_sdcard_stm32mp157f-dk2-optee.tsv
Ethernet, WiFi, and RPMSG are all working in my case.
you can stretch rootfs '/' to the end
sudo parted /dev/mmcblk0
(parted) rm 11
(parted) resizepart 10 95%
(parted) mkpart primary ext4 95% 100%
(parted) quit
sudo resize2fs /dev/mmcblk0p10
sudo mkfs.ext4 /dev/mmcblk0p11
I installed wayland for the GUI.
sudo apt-get update
sudo apt-get install weston
hit weston in the prompt then GUI will show up.
I also succeeded in launching xfce + lightdm combination for GUI.
There was a hiccup that there was no /dev/fb0.
So I had to follow the below.
sudo nano /etc/X11/xorg.conf.d/10-drm.conf
#insert the below and save and exit.
Section "Device"
Identifier "DRM Device"
Driver "modesetting"
Option "kmsdev" "/dev/dri/card0"
Option "SWCursor" "true"
EndSection
Section "Screen"
Identifier "Screen0"
Device "DRM Device"
Monitor "Monitor0"
EndSection
Section "Monitor"
Identifier "Monitor0"
EndSection
Section "ServerLayout"
Identifier "DefaultLayout"
Screen "Screen0"
EndSection
//execute the rest.
sudo apt-get update
sudo apt-get install dbus-x11
which dbus-launch # for checking
startx
If you have any information or suggestions, please let me know.
moonjune.kim@gmail.com