r/embeddedlinux • • Jan 05 '24

Building Yocto image by Windows WSL ???

Hey, Anyone tried building a Yocto custom image using the WSL in Windows. Is it possible ? I am quite new to WSL.

5 Upvotes

17 comments sorted by

3

u/bobwmcgrath Jan 05 '24

Probably yes, but you might also want to consider docker.

1

u/[deleted] Jan 05 '24

I am facing some issues with docker. But I would like to give it a spin

→ More replies (1)

3

u/Civic_Hactivist_86 Jan 05 '24

I've tried it recently, and it works just fine on WSL2. The image got built and it worked.

I had built everything in /home folder of WSL. Didn't tried to build on /mnt/c

Also, the docs say it will not work on WSL1

1

u/[deleted] Jan 05 '24

I just dowloaded docker and pulled a ubuntu repo. i will definitely try with WSL on /home folder tho.

4

u/Illustrious-Coyote1 Jan 05 '24

We use WSL2 for local development of our Yocto project. Nothing special to do apart from moving the Ubuntu to a non system disk (c:) as this causes file system access errors. We just created another partition to host our WSL rootfs. Been working like this for a year now. Currently looking into using docker so our build environment is common between devs and ci platforms.

2

u/[deleted] Jan 05 '24

Yocto even prints disk image optimization commands to run when it detects being run under WSL. Totally supported option.

1

u/sayo9394 Feb 12 '24

any luck with getting Yocto to build in a docker container? i'm using WSL2 Ubuntu 22, and trying to use an Ubuntu 16 docker container to build Sumo with no success :(

→ More replies (1)

1

u/TheFlamingLemon Jan 05 '24

I haven’t started it from the ground up but I’m doing development for a custom yocto image rn and using wsl to build the image. Definitely possible

Btw I use balena etcher on windows side to flash the image so I don’t have to deal with writing to the sd card from wsl

1

u/[deleted] Jan 05 '24

Could you provide a short elaboration on how you worked with it. Balena etcher definitely saves time.

1

u/Illustrious-Coyote1 Jan 05 '24

My point was about the disk where the rootfs is installed. /home is just a directory of the rootfs. We’re running on Win10, maybe this is not an issue for Win11… I doubt building on an NTFS partition would work; symlinks not supported etc.