All of lore.kernel.org
 help / color / mirror / Atom feed
* yocto under WSL
@ 2020-07-11  9:02 R Srinivasan
  2020-07-11  9:36 ` [poky] " Roelof
  2020-07-13 10:31 ` Ross Burton
  0 siblings, 2 replies; 7+ messages in thread
From: R Srinivasan @ 2020-07-11  9:02 UTC (permalink / raw)
  To: poky

[-- Attachment #1: Type: text/plain, Size: 132 bytes --]

I got myself a new laptop. Trying to decide whether to setup a VM for yocto
development.

Will the above work?

thanks, srini

[-- Attachment #2: Type: text/html, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [poky] yocto under WSL
  2020-07-11  9:02 yocto under WSL R Srinivasan
@ 2020-07-11  9:36 ` Roelof
  2020-07-11  9:37   ` R Srinivasan
  2020-07-13 10:31 ` Ross Burton
  1 sibling, 1 reply; 7+ messages in thread
From: Roelof @ 2020-07-11  9:36 UTC (permalink / raw)
  To: R Srinivasan; +Cc: poky

Hi Srini,

you can use docker on: Linux, Windows, Mac OS for Yocto development. It's better than a full VM. It starts in seconds, can easily exchange files and is probably also faster in build times.

Now it depends on what system you’re running on the laptop:

On Linux: Just install docker, add an image based on ubuntu, mount your working directory into docker with -v

On Windows: Upgrade Win 10 to Build 2004 (at least), install WSL2, install docker for windows, configure WSL2 in docker for windows, then call „bash“ in a console. From there proceed as on linux (call "docker build" etc.)

On Mac: Install docker for mac, create a volume (this is not needed on Windows WSL2 and Linux), use docker on the command line as in Linux/Windows (docker build etc.), mount the volume with -v. Also mount an output directory, not as a volume, with a second -v, that can be used for outputting/inputting files to the docker image. For speed purposes two -v are needed on Mac.

Best regards,
R.


> 
> I got myself a new laptop. Trying to decide whether to setup a VM for yocto development.
> 
> Will the above work?
> 
> thanks, srini


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [poky] yocto under WSL
  2020-07-11  9:36 ` [poky] " Roelof
@ 2020-07-11  9:37   ` R Srinivasan
  2020-07-11 10:09     ` Roelof
  0 siblings, 1 reply; 7+ messages in thread
From: R Srinivasan @ 2020-07-11  9:37 UTC (permalink / raw)
  To: Roelof Berg; +Cc: poky

[-- Attachment #1: Type: text/plain, Size: 1330 bytes --]

Awesome, thanks!

On Sat, Jul 11, 2020 at 5:36 AM Roelof Berg <rberg@berg-solutions.de> wrote:

> Hi Srini,
>
> you can use docker on: Linux, Windows, Mac OS for Yocto development. It's
> better than a full VM. It starts in seconds, can easily exchange files and
> is probably also faster in build times.
>
> Now it depends on what system you’re running on the laptop:
>
> On Linux: Just install docker, add an image based on ubuntu, mount your
> working directory into docker with -v
>
> On Windows: Upgrade Win 10 to Build 2004 (at least), install WSL2, install
> docker for windows, configure WSL2 in docker for windows, then call „bash“
> in a console. From there proceed as on linux (call "docker build" etc.)
>
> On Mac: Install docker for mac, create a volume (this is not needed on
> Windows WSL2 and Linux), use docker on the command line as in Linux/Windows
> (docker build etc.), mount the volume with -v. Also mount an output
> directory, not as a volume, with a second -v, that can be used for
> outputting/inputting files to the docker image. For speed purposes two -v
> are needed on Mac.
>
> Best regards,
> R.
>
>
> >
> > I got myself a new laptop. Trying to decide whether to setup a VM for
> yocto development.
> >
> > Will the above work?
> >
> > thanks, srini
>
>

[-- Attachment #2: Type: text/html, Size: 1711 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [poky] yocto under WSL
  2020-07-11  9:37   ` R Srinivasan
@ 2020-07-11 10:09     ` Roelof
  0 siblings, 0 replies; 7+ messages in thread
From: Roelof @ 2020-07-11 10:09 UTC (permalink / raw)
  To: R Srinivasan; +Cc: poky

[-- Attachment #1: Type: text/plain, Size: 4076 bytes --]

Quickstart example on Windows WSL2 Ubuntu bash (Ensure with winver.exe that Win10 build 2004 at least is installed, install and start WSL2, Docker for Windows:

Run Powershell as Admin, then:
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
wsl --set-default-version 2
If asked for, update wsl2 kernel component and repeat the wsl command
Install Ubuntu V18.04 from https://aka.ms/wslstore 
After installation, double check that it is WSL Version 2.
wsl -l -v
(If version 2, proceed. If it is still Version 1 update with: wsl --set-version ubuntu 2)
wsl --setdefault ubuntu

Activate WSL2 in Docker for Windows options (tray icon).

Place the file all below to the C: drive into a file called „Dockerfile“. Then start „bash“ in a Windows console and about this should get you there:

sudo mkdir /srinux
cd /srinux
mkdir docker
cd docker
cp /mnt/c/Dockerfile .
docker build --tag srinux:1.0 .
cd ..
docker run --name srinux -it --rm -v /srinux:/srinux srinux:1.0 bash
cd /srinux

Now you are in a Ubuntu bash and can proceed. like wget … oe-init-build-env … vim /conf/local.conf ... bitbake … etc.

I did not try to build yocto directly in WSL2 and I saw that it might be incompatible, compared to a docker solution (e.g. https://github.com/microsoft/WSL/issues/5108 <https://github.com/microsoft/WSL/issues/5108>).

Best regards,
R

Dockerfile example: ———————————————————————————

FROM ubuntu:18.04

USER root

ENV USER_NAME "srinux"

RUN \
    apt-get update \
    apt-get install -y -q --no-install-recommends \
        -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \
        build-essential \
        chrpath \
        cpio \
        diffstat \
        file \
        g++-multilib \
        gawk \
        gcc-multilib \
        git-core \
        locales \
        openssh-client \
        python \
        python3 \
        socat \
        sudo \
        texinfo \
        tmux \
        unzip \
        wget \
        vim \
    && rm -rf /var/lib/apt/lists/* && \
    locale-gen en_US.UTF-8

    ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'

RUN \
    apt-get update && \
    apt-get install -y -q --no-install-recommends \
        -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \
        ca-certificates \
    && rm -rf /var/lib/apt/lists/* && \
    wget -O /usr/local/bin/repo https://storage.googleapis.com/git-repo-downloads/repo && \
    chmod a+x /usr/local/bin/repo

# Clean up APT when done and set shell and user options.
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*          \
        && rm /bin/sh && ln -s /bin/bash /bin/sh                            \
        && groupadd -g 1000 ${USER_NAME}                                    \
        && useradd -u 1000 -g 1000 -ms /bin/bash ${USER_NAME}               \
        && usermod -a -G sudo ${USER_NAME}                                  \
        && usermod -a -G users ${USER_NAME}                                 \
        && usermod --password ${USER_NAME} ${USER_NAME}                     \
        && usermod --password toor root                                     \
        && passwd -d root                                                   \
        && passwd -d ${USER_NAME}


# Run as yocto  user from the installation path
RUN install -o 1000 -g 1000 -m 2777  -d ${EXCH_PATH}                        \
        && install -o 1000 -g 1000 -m 2777 -d ${EXCH_PATH_INPUT}            \
        && install -o 1000 -g 1000 -m 2777 -d ${EXCH_PATH_OUTPUT}


USER ${USER_NAME}


> 
> On Sat, Jul 11, 2020 at 5:36 AM Roelof Berg <rberg@berg-solutions.de <mailto:rberg@berg-solutions.de>> wrote:
> Hi Srini,
> 
> you can use docker […]
> 
> > 
> > I got myself a new laptop. Trying to decide whether to setup a VM for yocto development.
> > 
> > Will the above work?
> > 
> > thanks, srini
> 


[-- Attachment #2: Type: text/html, Size: 8091 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [poky] yocto under WSL
  2020-07-11  9:02 yocto under WSL R Srinivasan
  2020-07-11  9:36 ` [poky] " Roelof
@ 2020-07-13 10:31 ` Ross Burton
  2020-07-13 12:38   ` R Srinivasan
  1 sibling, 1 reply; 7+ messages in thread
From: Ross Burton @ 2020-07-13 10:31 UTC (permalink / raw)
  To: R Srinivasan; +Cc: poky

WSL2 should work out of the box, no need for Docker.

Ross

On Sat, 11 Jul 2020 at 10:02, R Srinivasan <s@srin.me> wrote:
>
> I got myself a new laptop. Trying to decide whether to setup a VM for yocto development.
>
> Will the above work?
>
> thanks, srini
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [poky] yocto under WSL
  2020-07-13 10:31 ` Ross Burton
@ 2020-07-13 12:38   ` R Srinivasan
  2020-07-13 14:58     ` Roelof
  0 siblings, 1 reply; 7+ messages in thread
From: R Srinivasan @ 2020-07-13 12:38 UTC (permalink / raw)
  To: Ross Burton; +Cc: poky

[-- Attachment #1: Type: text/plain, Size: 660 bytes --]

I have been looking at WSL2. It seems the brand new DELL I received has a
version of Windows 10 that does not support WSL2. I assume others have
upgraded to the version of Windows. Was it a smooth upgrade? Anything I
should be worried about about this upgrade?

thanks, srini

On Mon, Jul 13, 2020 at 6:31 AM Ross Burton <ross@burtonini.com> wrote:

> WSL2 should work out of the box, no need for Docker.
>
> Ross
>
> On Sat, 11 Jul 2020 at 10:02, R Srinivasan <s@srin.me> wrote:
> >
> > I got myself a new laptop. Trying to decide whether to setup a VM for
> yocto development.
> >
> > Will the above work?
> >
> > thanks, srini
> > 
>

[-- Attachment #2: Type: text/html, Size: 1062 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [poky] yocto under WSL
  2020-07-13 12:38   ` R Srinivasan
@ 2020-07-13 14:58     ` Roelof
  0 siblings, 0 replies; 7+ messages in thread
From: Roelof @ 2020-07-13 14:58 UTC (permalink / raw)
  To: R Srinivasan; +Cc: Ross Burton, poky

[-- Attachment #1: Type: text/plain, Size: 1433 bytes --]

The rollout happens anyway. so it should be safe. The reason why you don’t have it allready installed by auto updatt is, that It is done in groups, maybe for not overloading the servers. Everyone can request the update. It was somewhere in the system settings (programs or features, there’s a button for an upgrade request. To your question: For me it was a smooth upgrade. Like all hidden upgrades.

It can be a challenge to port old WSL1 infrastructure to WSL2 regarding changes in the architecture of the internet protocol connection. But I assume you don’t have your own WSL 1 scripts and stuff, sho it should be safe.

Best regards
R


> Am 13.07.2020 um 14:38 schrieb R Srinivasan <s@srin.me>:
> 
> I have been looking at WSL2. It seems the brand new DELL I received has a version of Windows 10 that does not support WSL2. I assume others have upgraded to the version of Windows. Was it a smooth upgrade? Anything I should be worried about about this upgrade?
> 
> thanks, srini
> 
> On Mon, Jul 13, 2020 at 6:31 AM Ross Burton <ross@burtonini.com <mailto:ross@burtonini.com>> wrote:
> WSL2 should work out of the box, no need for Docker.
> 
> Ross
> 
> On Sat, 11 Jul 2020 at 10:02, R Srinivasan <s@srin.me <mailto:s@srin.me>> wrote:
> >
> > I got myself a new laptop. Trying to decide whether to setup a VM for yocto development.
> >
> > Will the above work?
> >
> > thanks, srini
> > 
> 


[-- Attachment #2: Type: text/html, Size: 2610 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-07-13 14:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-11  9:02 yocto under WSL R Srinivasan
2020-07-11  9:36 ` [poky] " Roelof
2020-07-11  9:37   ` R Srinivasan
2020-07-11 10:09     ` Roelof
2020-07-13 10:31 ` Ross Burton
2020-07-13 12:38   ` R Srinivasan
2020-07-13 14:58     ` Roelof

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.