Layerscape Software Development Kit - v19.09 - How to build OFFLINE using WSL2?

cancel
Showing results for 
Search instead for 
Did you mean: 

Layerscape Software Development Kit - v19.09 - How to build OFFLINE using WSL2?

Jump to solution
636 Views
christophe_schm
Contributor IV

Hello,

I successfully was able to build complete LS1012ARDB image on my corporate computer that is indeed connected to the WAN. This is an easy one since scripts simply can get on the Internet and get missing modules. Same goes for my WSL2 on my WIN10 HOST machine. WSL2 is the new Windows Subsystem for Linux based on Hyper-V.

Now my mission here is to create same setup but OFFLINE. So far the only idea I had was to first do the whole build process on a machine that is ONLINE, then try to copy out the complete tree into my OFFLINE machine and hope it works. It doesn't as you imagine hence my question here: did somebody had same problem and need as I do here?

To help you in answering me I need to know

  • WSL(2): how to I copy out delta packages my WSL2 installed and create same for OFFLINE installation on the other side? I don't have a local repo setup (yet) on my OFFLINE infrastructure
  • LSDK: is e.g. flex-builder capable to just download FULL package tree and assist me in exporting this from ONLINE toward the OFFLINE machine easily?

Thx Christophe

Labels (1)
0 Kudos
1 Solution
400 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Thx Christophe,

1. After executing "flex-builder -m ls1012ardb -a arm64", please copy build/rfs folder from the ONLINE machine to the OFFLINE machine.

2. You could download full package tree with command ''flex-builder -i repo-fetch" to fetch all git repositories, then copy  packages folder from the ONLINE machine to the offline machine.

Thanks,

Yiping

View solution in original post

0 Kudos
12 Replies
400 Views
christophe_schm
Contributor IV

Coming back on the WSL2 and Dockerfile approach.

First for WSL2 this is not officially available except if you're part of the Windows insider program.

Some links:

https://www.thomasmaurer.ch/2019/06/install-wsl-2-on-windows-10/ 

Install WSL 2 | Microsoft Docs 

That said in our infrastructure we deploy only LTSB/C images for obvious reasons - so WSL2 is a nogo yet.

WSL however is ok and works on a Windows 10 Enterprise LTSC 2019 but you've to install it the ZIP and not APPX way.

Install the Linux Subsystem on Windows Server | Microsoft Docs 

Brings me back to the Docker options NXP LSDK also is providing and I find nice.

On my Windows 10 WSL root file system I am here: flexbuild_lsdk1909_update_221019\docker\ubuntu\18.04.

I'd like to get the Docker but it's not very clear how to get this one (there are proxies and such stuff I don't think I need).

I use your reference manual (well written):  Layerscape Software Development Kit User Guide, Rev. 19.09_311219, 12/2019 , especially  §4.1.1 Host system requirements to understand if I can run a Windows Docker setup as well. Or os this intendendet to run only out of a Linux host being smth else than an Ubunut distro?

Some clarifications very welcome. Thx Christophe

0 Kudos
401 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Thx Christophe,

1. After executing "flex-builder -m ls1012ardb -a arm64", please copy build/rfs folder from the ONLINE machine to the OFFLINE machine.

2. You could download full package tree with command ''flex-builder -i repo-fetch" to fetch all git repositories, then copy  packages folder from the ONLINE machine to the offline machine.

Thanks,

Yiping

View solution in original post

0 Kudos
400 Views
christophe_schm
Contributor IV

Could it be there is a difference whereas I run this in a WSL or WSL2?

Wiki: Windows Subsystem for Linux - Wikipedia 

I must admit WSL2 work perfectly with above said. It's also fact that WSL2 runs on my ONLINE machine that itself runs a recent WIN10 v1909 (OS build 18363.476).

On my OFFLINE machine it's a Windows Enterprise LTSC 2019 and there we don't get WSL2 but only WSL. There I've a v1809 (OS build 17763.864) build. LTSC is for Long Time Service and OFFLINE can only run LTS images, cannot change this.

Brings me to LSDKUG_Rev19.09.pdf, § 4.1.1 Host system requirements where it says this (citation)

[...]

Install Ubuntu 18.04 LTS via WSL (Windows Subsystem for Linux) on Windows 10 (optional)
If you have an Windows 10 machine and have no any available Linux machine, it is feasible to install Ubuntu 18.04 LTS via WSL on Windows 10, please refer to the steps from the link https://docs.microsoft.com/en-us/windows/wsl/install-win10
Note: Building LSDK with default settings works to generate all images under WSL 1, but generating distro userland from source doesn't work under WSL 1 environment due to the imcomplete system call compatibility of WSL 1, so it's recommended to upgrade to WSL 2 if your Win10 version is Windows 10 Build 18990 or above. You can connect to WSL Ubuntu 18.04 via ssh to work in multiple terminal sessions if needed. Generally, the location of Ubuntu under WSL in Win10 is C:\Users\<account-name>\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs, you can creat a shortcut of it on destktop for accessing in convenience.

[...]

Can you please confirm problem I observe here is due to the fact I've a WSL(1) on my OFFLINE machine?

If so, would Docker approach maybe help me out here?

Thx Christophe

0 Kudos
400 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Thx Christophe,

Using WSL 1 has feature limitation, building LSDK with default settings works to generate all images under WSL 1, but generating distro userland from source doesn't work under WSL 1 environment.

You can connect to WSL Ubuntu 18.04 via ssh to work in multiple terminal sessions if needed. So you could ssh to the WSL online machine to perform multiple flex-builder building rather than copying flex-builder build environment to the offline machine.

In addition, a Linux distribution is recommended to install on the host machine, if the Linux distribution is not Ubuntu 18.04, the user need to create an Ubuntu 18.04 Docker container to emulate the environment.

Thanks,

Yiping

0 Kudos
400 Views
christophe_schm
Contributor IV

Coming back on a statement made above

"In addition, a Linux distribution is recommended to install on the host machine, if the Linux distribution is not Ubuntu 18.04, the user need to create an Ubuntu 18.04 Docker container to emulate the environment."

I understand such a Docker container as provided by LSDK only properly works on a a host already running a Linux but that could be of a different distro family, correct? Asking this since I did the full Docker setup on my host but that runs a WIN10 OS. All works e.g. out of poratainer.io web interface and going inside the Docker container but think this is not the intend here. I say that since from WSL I can use such a container but it does not integrate into (host) flex-builder when using e.g. "flex-builder docker" command, is that understanding correct? Is it what I understand when studying flex-builder exe that is a big bash script. Thanks for confirming this here or correct what I say.

0 Kudos
400 Views
christophe_schm
Contributor IV

HI Yiping,

Thanks for the suggestions. I think if having only WSL1 your proposal to have a real (OFFLINE) Ubuntu-based build machine or VM could work and access it over SSH. But it must be OFFLINE.

To that regard I observe that the command "flex-builder -i repo-fetch" seems not tu suffice to have the FULL repo tree OFFLINE. I say that since when doing e.g. "flex-builder -i mkrfs -r ubuntu:lite" scripts still attempt to pull some stuff from the Internet e.g. from http://www.nxp.com/lgfiles/sdk/lsdk1909/rootfs_lsdk1909_LS_arm64_lite.tgz 

I had a look at the configuration file .../configs/build_lsdk.cfg and namely this:

[...]

# default configs for LSDK (component repositories on external codeaurora or github)

# default git repository URL
GIT_REPOSITORY_URL="http://source.codeaurora.org/external/qoriq/qoriq-components"
DISTRO_SVR_URL=http://www.nxp.com/lgfiles/sdk

[...]

# set default build options for auto build
CONFIG_EDGESCALE_SECURE_MODE=n
CONFIG_FUSE_PROVISIONING=n
BUILD_GUESTRFS=n
BUILD_DUAL_KERNEL=n
BUILD_UBUNTU_LITE=n
BUILD_UBUNTU_MATE=n
BUILD_UBUNTU_DEVEL=n
BUILD_YOCTO_RFS=n
BUILD_BUILDROOT_RFS=n UPDATE_REPO_PER_COMMIT=n
UPDATE_REPO_PER_TAG=y
INSTALL_FLASH_IMAGES=n
FETCH_PREBUILT_LSDK_RFS=y

[...]

What I try to avoid here is that my OFFLINE machine attempts to get additional packages from URLs like GIT_REPOSITORY_URL and DISTRO_SVR_URL.

Is there a way to force this and also download packages from those URL directly when issuing the command "flex-builder -i repo-fetch"?

I will take actions on my side to get a build environment capable to 100% run OFFLINE.

But I also need a way from you to get FULL repo where I can get rid of any attempt of the building process to pull yet another package or ZIP or whatever from the Internet - my setup must be fully capable to build in an isolated environment.

In short this command shall pass with no error on my OFFLINE setup (whatever it may look like): "flex-builder -m ls1012ardb -a arm64". Possible? Thanks to provide necessary parameters I may did not discovered yet that helps me achieve that goal to completely build OFFLINE.

Thx Christophe

0 Kudos
400 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Thx Christophe,

What's your current problem when executing "flex-builder -m ls1012ardb -a arm64" in your OFFLINE machine?

Thanks,

Yiping

0 Kudos
400 Views
christophe_schm
Contributor IV

Hello Yiping,

Thanks for answering so quickly.

I think I've several issues here, the main one for the moment, I agree, is the fact I only run WSL1 on my OFFLINE setup. This is so since our IT only deploys LTS images on isolated network. I understood that maybe (another) real Ubuntu machines could fill the gap via SSH of the limitations of WSL1. That's not the point here now.

So I took again your first answer in this tread and did exactly that on my ONLINE machine inside a WIN10 WSL2 session:

1. flex-builder -i repo-fetch

2. flex-builder -i repo-update

3. flex-builder -m ls1012ardb -a arm64

All this goes well. But there is something I still don't understand yet.

Now you said I shall copy out /build/rfs, ok fine. But I thought I also need e.g. /packages folder where all the sources reside, correct? And why not taking the whole (populated) flexbuild_lsdk1909_update_221019 root folder? By root folder I understand this including all subsequent files I got after build steps above:

chris@MOB13263:~/flexbuild_lsdk1909_update_221019$ ll
total 12
drwxrwxr-x 1 chris chris 512 Nov 18 14:59 ./
drwxr-xr-x 1 chris chris 512 Dec 12 08:52 ../
-rw-rw-r-- 1 chris chris 1483 Oct 22 08:30 LICENSE
-rw-rw-r-- 1 chris chris 616 Oct 22 08:30 Makefile
-rw-rw-r-- 1 chris chris 718 Oct 22 08:30 README.md
drwxrwxrwx 1 chris chris 512 Dec 16 11:32 build/
drwxrwxr-x 1 chris chris 512 Oct 22 08:41 configs/
drwxrwxr-x 1 chris chris 512 Oct 22 08:30 docker/
drwxrwxr-x 1 chris chris 512 Oct 22 08:30 docs/
drwxrwxr-x 1 chris chris 512 Oct 22 08:30 include/
drwxrwxrwx 1 chris chris 512 Dec 16 11:35 logs/
drwxrwxr-x 1 chris chris 512 Oct 22 08:30 packages/
-rwxrwxr-x 1 chris chris 173 Oct 22 08:30 setup.env*
drwxrwxr-x 1 chris chris 512 Oct 22 08:30 tools/

Do you say what I may miss is simply my /build/rfs or that is maybe not complete on my OFFLINE machine or I did not properly copied out into my OFFLINE machine?

Brings me then back to my tarball creation of my full ONLINE flexbuild_lsdk1909_update_221019 root folder for copying out to my OFFLINE machine. I had some trouble with the "tar" program here since there are soft links being used and not being taken by the archiver, tried and thought I shall also use option -h of tar program, correct? Can you please provide correct tarball creation "tar" parameters to ensure my ONLINE to OFFLINE copy out works correctly?

I tried this: tar -zcvf LSDK1909_OFFLINE.tar.gz flexbuild_lsdk1909_update_221019

Thx Christophe

0 Kudos
400 Views
yipingwang
NXP TechSupport
NXP TechSupport

Hello Christophe SCHMID,

When used with standard arguments tar cvf the soft link are saved in the tar archive as soft-links.

If your symlink is a full symlink, it might be broken when untarred.

If your symlink is a relative sysmlink, under the folder you are tarring it will work fine when extracted.

If you wan to tar the file and no the symlink, you can use the -h argument.

In flex-builder build environment, there are full symlinks used, so you need to use the same path name (as the online machine) on the offline machine.

Thanks,

Yiping

400 Views
christophe_schm
Contributor IV

Hi Yiping,

I finally managed to make it work. The hint of keeping the same path helped, thanks! That also answers the tar issues I had. I now can do a full build (after a flex-builder -i clean command) using command flex-builder -m ls1012ardb -b qspi -a arm64 and all passes. Also had to install quite a bunch of APT packages needed to build all this. Last but not least I did this on VMWare VRA hosted VMs being WIN10 Enterprise LTSC 2019 images within I use WSL2 from where the build happened.

We can now close this discussion, next steps will be flashing the whole stuff onto my RDB. I certainly will open yet another tread here for new questions.

 

Thank your for your help and commitment.

Christophe

0 Kudos
400 Views
christophe_schm
Contributor IV

Hello Yiping,

Ok I tired this and it seems to work. Just when I exflate on OFFLINE machine I get this at the end (sse below).

Did this

  • ONLINE machine: tar -zcvf LSDK1909_OFFLINE.tar.gz flexbuild_lsdk1909_update_221019
  • OFFLINE machine: tar xvfz LSDK1909_OFFLINE.tar.gz

Can you please help?

Thx Christophe 

tar: flexbuild_lsdk1909_update_221019/packages/linux/linux/tools/testing/selftests/powerpc/vphn/vphn.h: Cannot unlink: No such file or directory
tar: flexbuild_lsdk1909_update_221019/packages/linux/linux/tools/testing/selftests/powerpc/vphn/vphn.c: Cannot unlink: No such file or directory
tar: flexbuild_lsdk1909_update_221019/packages/linux/linux/tools/testing/selftests/powerpc/stringloops/strlen_32.S: Cannot unlink: No such file or directory
tar: flexbuild_lsdk1909_update_221019/packages/linux/linux/tools/testing/selftests/powerpc/stringloops/memcmp_64.S: Cannot unlink: No such file or directory
tar: flexbuild_lsdk1909_update_221019/packages/linux/linux/tools/testing/selftests/powerpc/stringloops/memcmp_32.S: Cannot unlink: No such file or directory
tar: flexbuild_lsdk1909_update_221019/packages/linux/linux/tools/testing/selftests/powerpc/primitives/word-at-a-time.h: Cannot unlink: No such file or directory
tar: flexbuild_lsdk1909_update_221019/packages/linux/linux/tools/testing/selftests/powerpc/primitives/asm/ppc_asm.h: Cannot unlink: No such file or directory
tar: flexbuild_lsdk1909_update_221019/packages/linux/linux/tools/testing/selftests/powerpc/primitives/asm/feature-fixups.h: Cannot unlink: No such file or directory
tar: flexbuild_lsdk1909_update_221019/packages/linux/linux/tools/testing/selftests/powerpc/primitives/asm/asm-const.h: Cannot unlink: No such file or directory
tar: flexbuild_lsdk1909_update_221019/packages/linux/linux/tools/testing/selftests/powerpc/primitives/asm/asm-compat.h: Cannot unlink: No such file or directory
tar: flexbuild_lsdk1909_update_221019/packages/linux/linux/tools/testing/selftests/powerpc/copyloops/memcpy_power7.S: Cannot unlink: No such file or directory
tar: flexbuild_lsdk1909_update_221019/packages/linux/linux/tools/testing/selftests/powerpc/copyloops/memcpy_64.S: Cannot unlink: No such file or directory
tar: flexbuild_lsdk1909_update_221019/packages/linux/linux/tools/testing/selftests/powerpc/copyloops/copyuser_power7.S: Cannot unlink: No such file or directory
tar: flexbuild_lsdk1909_update_221019/packages/linux/linux/tools/testing/selftests/powerpc/copyloops/copyuser_64.S: Cannot unlink: No such file or directory
tar: flexbuild_lsdk1909_update_221019/packages/linux/linux/scripts/dtc/include-prefixes/xtensa: Cannot unlink: No such file or directory
tar: flexbuild_lsdk1909_update_221019/packages/linux/linux/scripts/dtc/include-prefixes/sh: Cannot unlink: No such file or directory
tar: flexbuild_lsdk1909_update_221019/packages/linux/linux/scripts/dtc/include-prefixes/powerpc: Cannot unlink: No such file or directory
tar: flexbuild_lsdk1909_update_221019/packages/linux/linux/scripts/dtc/include-prefixes/openrisc: Cannot unlink: No such file or directory
tar: flexbuild_lsdk1909_update_221019/packages/linux/linux/scripts/dtc/include-prefixes/nios2: Cannot unlink: No such file or directory
tar: flexbuild_lsdk1909_update_221019/packages/linux/linux/scripts/dtc/include-prefixes/mips: Cannot unlink: No such file or directory
tar: flexbuild_lsdk1909_update_221019/packages/linux/linux/scripts/dtc/include-prefixes/microblaze: Cannot unlink: No such file or directory
tar: flexbuild_lsdk1909_update_221019/packages/linux/linux/scripts/dtc/include-prefixes/h8300: Cannot unlink: No such file or directory
tar: flexbuild_lsdk1909_update_221019/packages/linux/linux/scripts/dtc/include-prefixes/dt-bindings: Cannot unlink: No such file or directory
tar: flexbuild_lsdk1909_update_221019/packages/linux/linux/scripts/dtc/include-prefixes/c6x: Cannot unlink: No such file or directory
tar: flexbuild_lsdk1909_update_221019/packages/linux/linux/scripts/dtc/include-prefixes/arm64: Cannot unlink: No such file or directory

0 Kudos
400 Views
christophe_schm
Contributor IV

Hello,

I continued today on this but still am having issues.

My goal at the end is to simply issue this command on my OFFLINE machine and it all builds:

flex-builder -m ls1012ardb -a arm64

I managed doing this on my ONLINE machine and it went through (~20 hours of build) with no error.

For my OFFLINE machine I've now a local Ubuntu 18.04 Bionic full repo in place and my WSL on my WIN10 machine can see it as well - I don't miss any tool to run flex-builder conveniently.

What I observe is it seems looking for files such as <openssl/bio.h> or <openssl/sha.h>. Checking in my OFFLINE LSDK tree I imported everything seems be there.

So I still have a difference between ONLINE and OFFLINE setups.

Are you sure the command ''flex-builder -i repo-fetch" really catches it ALL? Are there other sub-dir I may miss yet?

Thx for helping, best regards,
Christophe

0 Kudos