From: "Sun, Yi" <yi.sun@intel.com>
To: Uladzimir Bely <ubely@ilbers.de>
Cc: "isar-users@googlegroups.com" <isar-users@googlegroups.com>
Subject: Re: Build Failed for RISC-V Image Using isar/kas-container
Date: Wed, 16 Apr 2025 23:42:42 +0800 [thread overview]
Message-ID: <Z__P8gfJZr0RO6kt@ysun46-mobl.ccr.corp.intel.com> (raw)
In-Reply-To: <Z_z18wc2MGBkOaGe@ysun46-mobl.ccr.corp.intel.com>
On 14.04.2025 19:48, Sun, Yi wrote:
>On 13.04.2025 17:41, Uladzimir Bely wrote:
>>On Sun, 2025-04-13 at 17:58 +0800, Sun, Yi wrote:
>>>On 13.04.2025 11:18, Uladzimir Bely wrote:
>>>> On Sun, 2025-04-13 at 16:02 +0800, Sun, Yi wrote:
>>>> > On 13.04.2025 10:41, Uladzimir Bely wrote:
>>>> > > On Sun, 2025-04-13 at 06:38 +0000, Sun, Yi wrote:
>>>> > > >
>>>> > > >
>>>> > > >
>>>> > > > Hi All,
>>>> > > >
>>>> > > > I'm new to ISAR and was told it's an efficient project for
>>>> > > > building
>>>> > > > embedded OS images.
>>>> > > > I'm currently trying to create an Ubuntu Noble (24.04) image
>>>> > > > for
>>>> > > > the
>>>> > > > RISC-V architecture.
>>>> > > >
>>>> > > > I gave it a quick try, but ran into some issues:
>>>> > > > Step 1: KAS_ALLOW_ROOT=yes ./kas/kas-container menu
>>>> > > > Step 2: KAS_ALLOW_ROOT=yes ./kas/kas-container build (or use
>>>> > > > the
>>>> > > > "Build" option from the menu)
>>>> > > >
>>>> > > > I've attached my configuration files (generated by kas-
>>>> > > > container)
>>>> > > > along with the error log dumped by ISAR during the build
>>>> > > > process.
>>>> > > >
>>>> > > > Another question I have is about the concepts of "target" and
>>>> > > > "host".
>>>> > > > After reading as much documentation on ISAR as I could find,
>>>> > > > I'm
>>>> > > > still a bit confused:
>>>> > > >
>>>> > > > Why do we need a "host" rootfs/distro, given that ISAR runs
>>>> > > > inside
>>>> > > > the kas-isar Docker container, which I assume already acts as
>>>> > > > the
>>>> > > > host environment?
>>>> > > > What I’m aiming for with this project is to generate an image
>>>> > > > that
>>>> > > > can be run in QEMU or flashed to a disk — that would be the
>>>> > > > target
>>>> > > > distro, right?
>>>> > > >
>>>> > > > Any guidance or suggestions would be greatly appreciated!
>>>> > > >
>>>> > > > Thanks
>>>> > > > --Sun, Yi
>>>> > > >
>>>> > >
>>>> > > Hello.
>>>> > >
>>>> > > Currently we support (and test) only amd64/i386 and arm64/armhf
>>>> > > architectures for Ubuntu despite of the fact ubuntu has ports
>>>> > > for
>>>> > > riscv64 ( http://ports.ubuntu.com/ubuntu-ports/dists/noble/ ).
>>>> > >
>>>> > > For now, you could try attached patch for Isar to run ubuntu-
>>>> > > noble
>>>> > > build for riscv64.
>>>> > >
>>>> > > Also, you need to apply patches for u-boot and kernel from
>>>> > > https://patchwork.isar-build.org/project/isar/list/?series=1551
>>>> > > -
>>>> > > or
>>>> > > wait 2..3 days until they are merged to 'next' branch.
>>>> > >
>>>> > > ---
>>>> > >
>>>> > > In general, we might need to add other architectures supported
>>>> > > in
>>>> > > ubuntu-ports into our configs. Stay tuned.
>>>> > >
>>>> >
>>>> > Thanks to Uladzimir for sharing your progress!
>>>> > I gave the patch a quick try, but unfortunately it didn’t work as
>>>> > expected.
>>>> > I tried master+patch and next+patch, both are failed.
>>>> > I'm still seeing the following error message.
>>>> >
>>>> > BTW, could you please expain more about the "host distro"? Do I
>>>> > really
>>>> > need a host distro if my running ISAR in KAS container?
>>>> >
>>>>
>>>> Briefly, host distro - is a distro that is repsoncible for
>>>> compiling
>>>> custom packages. Target distro - is what will be installed on
>>>> target.
>>>>
>>>> E.g., in your case (riscv64), we have:
>>>> 1. Cross-compiling case:
>>>> - host-distro: Ubuntu Noble / amd64
>>>> - target-distro: Ubuntu Noble / riscv64
>>>> 2. Non-cross-compiling case:
>>>> - host-distro = target-distro = riscv64
>>>>
>>>> Of course, case 2 is much slower because everything is built
>>>> natively
>>>> using qemu-static.
>>>>
>>>I see — that matches my previous understanding exactly.
>>>My question is: since we're already using kas-container (a Debian-
>>>based OS)
>>>why don’t we just compile all packages directly within it, instead of
>>>chrooting into a separate host rootfs? It seems like things could be
>>>simplified if there were a toggle option to do that.
>>>
>>>I'm asking because, while trying to figure out why the Ubuntu Noble
>>>target
>>>couldn't be built, I noticed that ubuntu-common.inc might be mixing
>>>up
>>>DISTRO_ARCH and HOST_ARCH somewhere (if I’m understanding it
>>>correctly).
>>>
>>>> ---
>>>>
>>>> I've updated a bit the patch I sent and managed to completely build
>>>> ubuntu-noble for starfive-visionfive2 machine.
>>>>
>>>> I pushed my changes to the branch "ubely/devel" so you can give it
>>>> a
>>>> try without any additional patches.
>>>>
>>>> ./kas/kas-container menu:
>>>> - Machine selection
>>>> - starfive-visionfive2
>>>> - Distro
>>>> - Allow any machine-distro combinations
>>>> - Ubuntu 24.04 (Noble)
>>>>
>>>
>>>The devel branch doesn't make things better:
>>>
>>
>>Big sorry for misleading you... I wanted to write "ubely/riscv64"
>>branch I've created for you...
>>
>>Please, try it instead.
>
>Hi Uladzimir,
>
>I gave it a try, but no luck.
>What I want to point out is that the error I encountered is likely not
>RISC-V specific. Due to limited time, I did a quick debug and found
>that the error is coming from bitbake:
>
>```
>(root)# bitbake -c build isar-image-base
>
>ERROR: isar-apt-1.0-r0 do_unpack: Unpack failure for URL: 'file://distributions.in'. Unpack command PATH="/repo/scripts:/repo/bitbake/bin:/usr/sbin:/usr/bin:/sbin:/bin" cp -fpPRH "/build/../repo/meta/recipes-devtools/isar-apt/files/distributions.in" "." failed with return value 1
>```
>
>LOG FILE:
>```
>DEBUG: Using /build/../repo/meta/recipes-devtools/isar-apt/files/distributions.in for distributions.in
>NOTE: Unpacking /build/../repo/meta/recipes-devtools/isar-apt/files/distributions.in to /build/tmp/work/ubuntu-noble-riscv64/isar-apt/1.0-r0/
>cp: failed to preserve ownership for './distributions.in': Invalid argument
>ERROR: Unpack failure for URL: 'file://distributions.in'. Unpack command PATH="/repo/scripts:/repo/bitbake/bin:/usr/sbin:/usr/bin:/sbin:/bin" cp -fpPRH "/build/../repo/meta/recipes-devtools/isar-apt/files/distributions.in" "." failed with return value 1
>DEBUG: Python function do_unpack finished
>```
>
>Log file shows that all failures are the same that caused by 'copy':
>cp: failed to preserve ownership for './distributions.in': Invalid argument
>
>@Uladzimir, if you have a moment, could you help me understand what might
>be going wrong here?
>
>I'm using the Docker image kas-isar:4.7, and I can consistently
>reproduce the issue by running ./kas/kas-container build.
>
>Here is my docker parameters:
>```
>docker run -v /home/riscv/isar:/repo:rw -v /home/riscv/isar:/work:rw -e KAS_WORK_DIR=/work -v /home/riscv/isar/build/rv64_sw-machine:/build:rw --workdir=/repo -e KAS_BUILD_DIR=/build -e USER_ID=0 -e GROUP_ID=0 --rm --init -t -i -e TERM=tmux-256color -e SHELL=/bin/bash -e http_proxy=http://xxx:port -e https_proxy=http://xxx:port -e NO_PROXY=localhost,127.0.0.0/8 --privileged --log-driver=none --user=root ghcr.io/siemens/kas/kas-isar:4.7 build
>```
>
>I'm pretty sure that my configue matches your demo setup:
>StarFive VisionFive2 + Ubuntu 24.04 (Noble).
>
>Thanks
> --Sun, Yi
I made some progress — the issue was caused by the -p parameter in the cp command.
The following patch allows the unpack process to proceed.
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 5bf2c4b8..73c34301 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -1606,7 +1606,7 @@ class FetchMethod(object):
if urlpath.find("/") != -1:
destdir = urlpath.rsplit("/", 1)[0] + '/'
bb.utils.mkdirhier("%s/%s" % (unpackdir, destdir))
- cmd = 'cp -fpPRH "%s" "%s"' % (file, destdir)
+ cmd = 'cp -fPRH "%s" "%s"' % (file, destdir)
else:
urldata.unpack_tracer.unpack("archive-extract", unpackdir)
diff --git a/bitbake/lib/bb/fetch2/npmsw.py b/bitbake/lib/bb/fetch2/npmsw.py
index ff5f8dc7..a250a2d2 100644
--- a/bitbake/lib/bb/fetch2/npmsw.py
+++ b/bitbake/lib/bb/fetch2/npmsw.py
@@ -294,7 +294,7 @@ class NpmShrinkWrap(FetchMethod):
npm_unpack(depsrcdir, depdestdir, d)
else:
bb.utils.mkdirhier(depdestdir)
- cmd = 'cp -fpPRH "%s/." .' % (depsrcdir)
+ cmd = 'cp -fPRH "%s/." .' % (depsrcdir)
runfetchcmd(cmd, d, workdir=depdestdir)
def clean(self, ud, d):
Then I got following issuem, which I believe are related to riscv
platform. The log is dumpped by do_rootfs_install.
```
(......)
Broken libstdc++-13-dev:amd64 Breaks on libstdc++-13-dev:riscv64 < none -> 13.3.0-6ubuntu2~24.04 @un puN Ib > (!= 13.2.0-1
6ubuntu1)
Considering libstdc++-13-dev:riscv64 9998 as a solution to libstdc++-13-dev:amd64 0
Conflicts//Breaks against version 13.2.0-23ubuntu4 for libstdc++-13-dev but that is not InstVer, ignoring
Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
build-essential : Depends: libc6-dev but it is not installable or
libc-dev
devscripts : Depends: gnupg but it is not installable or
gnupg2 but it is not installable
libc-dev-bin:riscv64 : Depends: libc6:riscv64 (> 2.39) but it is not installable
Depends: libc6:riscv64 (< 2.40) but it is not installable
libc6-dev:riscv64 : Depends: libc6:riscv64 (= 2.39-0ubuntu8.4) but it is not installable
libcrypt-dev:riscv64 : Depends: libcrypt1:riscv64 (= 1:4.4.36-4build1) but it is not installable
libgcc-13-dev : Breaks: libgcc-13-dev:riscv64 (!= 13.2.0-16ubuntu1) but 13.3.0-6ubuntu2~24.04 is to be installed
libgcc-13-dev:riscv64 : Depends: gcc-13-base:riscv64 (= 13.3.0-6ubuntu2~24.04) but it is not installable
Depends: libgcc-s1:riscv64 (>= 13.3.0-6ubuntu2~24.04) but it is not installable
Depends: libgomp1:riscv64 (>= 13.3.0-6ubuntu2~24.04) but it is not installable
Depends: libitm1:riscv64 (>= 13.3.0-6ubuntu2~24.04) but it is not installable
Depends: libatomic1:riscv64 (>= 13.3.0-6ubuntu2~24.04) but it is not installable
Depends: libasan8:riscv64 (>= 13.3.0-6ubuntu2~24.04) but it is not installable
Depends: libubsan1:riscv64 (>= 13.3.0-6ubuntu2~24.04) but it is not installable
Breaks: libgcc-13-dev (!= 13.3.0-6ubuntu2~24.04) but 13.2.0-16ubuntu1 is to be installed
libstdc++-13-dev : Depends: libc6-dev (>= 2.13-0ubuntu6) but it is not installable
Breaks: libstdc++-13-dev:riscv64 (!= 13.2.0-16ubuntu1) but 13.3.0-6ubuntu2~24.04 is to be installed
libstdc++-13-dev:riscv64 : Depends: gcc-13-base:riscv64 (= 13.3.0-6ubuntu2~24.04) but it is not installable
Depends: libstdc++6:riscv64 (>= 13.3.0-6ubuntu2~24.04) but it is not installable
Breaks: libstdc++-13-dev (!= 13.3.0-6ubuntu2~24.04) but 13.2.0-16ubuntu1 is to be installed
libtool : Depends: libc6-dev but it is not installable or
libc-dev
E: Unable to correct problems, you have held broken packages.
```
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/Z__P8gfJZr0RO6kt%40ysun46-mobl.ccr.corp.intel.com.
next prev parent reply other threads:[~2025-04-16 15:43 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-13 6:38 Sun, Yi
2025-04-13 7:41 ` Uladzimir Bely
2025-04-13 8:02 ` Sun, Yi
2025-04-13 8:18 ` Uladzimir Bely
2025-04-13 9:58 ` Sun, Yi
2025-04-13 14:41 ` Uladzimir Bely
2025-04-14 11:48 ` Sun, Yi
2025-04-14 15:53 ` Baurzhan Ismagulov
2025-04-15 0:10 ` Sun, Yi
2025-04-15 0:33 ` Sun, Yi
2025-04-16 19:53 ` Uladzimir Bely
2025-04-17 0:19 ` Sun, Yi
2025-04-16 15:42 ` Sun, Yi [this message]
2025-04-17 5:58 ` Uladzimir Bely
2025-04-17 12:08 ` Sun, Yi
2025-04-17 15:04 ` Uladzimir Bely
2025-04-22 13:14 ` Sun, Yi
2025-04-22 13:56 ` Uladzimir Bely
2025-04-22 15:34 ` Sun, Yi
2025-04-27 9:13 ` Sun, Yi
2025-04-27 11:32 ` Sun, Yi
2025-04-28 7:24 ` Baurzhan Ismagulov
2025-04-30 5:10 ` Sun, Yi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z__P8gfJZr0RO6kt@ysun46-mobl.ccr.corp.intel.com \
--to=yi.sun@intel.com \
--cc=isar-users@googlegroups.com \
--cc=ubely@ilbers.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox