From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7216630053834063872 X-Received: by 2002:a92:610:0:b0:326:3001:1f7e with SMTP id x16-20020a920610000000b0032630011f7emr15757ilg.5.1681913401654; Wed, 19 Apr 2023 07:10:01 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6e02:2184:b0:32a:ad14:88b with SMTP id j4-20020a056e02218400b0032aad14088bls4771469ila.0.-pod-prod-gmail; Wed, 19 Apr 2023 07:10:00 -0700 (PDT) X-Google-Smtp-Source: AKy350ayIzjiMDY3xXYkax33zeJZbDIkjELmrex4XSKzjootVZZW9M0H/a+Ylrhhj/UIqRPMvSua X-Received: by 2002:a92:d784:0:b0:32b:6d5:5146 with SMTP id d4-20020a92d784000000b0032b06d55146mr47477iln.11.1681913400721; Wed, 19 Apr 2023 07:10:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681913400; cv=none; d=google.com; s=arc-20160816; b=i1VkmWpdaiaYddzRM2sU40IxsWOo6Wo3zQJE2AYKjEfjGak7ItVODpyZKncRlUHvxk PmBDZHUh2qqlmgq1peCUe0l3ezJtYXowLDf8NbjLGhQZpfuzwMKW2hvLmHR8qBYDL49a 1Bs4+LQjQsJVMT/KaQ9xdlLvwJZxy6h8D9kah8A0NHOmGUJn22AFkl+Q/gccdJNAuDG7 UTA+2BOan52ykaw849c3khVdJj8+XYWj0UncEG/7IHK2f04nnntQUZgJnoD9x6d/ihZO bXJojlpNhcDAQbNpqbXL6NYRo2GkUZafWIUpEISnMyWYvDySaoZfzXJgnGfrrYm9C0Nq F0QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:ironport-sdr; bh=4PzhNCoSl6uE2UvtMvanrOZiAB5tpe7+XTLWxTD3KEo=; b=zNFuXNjlre10AxWojmVAR36K0PZIHZ9Oqrc7mLM+totMsj8P7LKPUYdvKzjRZayKHo g7cUCLKs4XuHsPo6fqt3U/TVehzLc9OtZn2APQH2gjw1ANsTgH5Gl/Ng6FpFFa7ON9hm 2HbWdicNjLqUHAO3UJnmM0SudXS7jeCVUe89xh49kJeD/pcyq4zwp4t8e1+UFWh5iJ9n Bj6yaKx7KHkGIM2GQBJhGWwWD6RQhlsP26ILXIHhF7GC7x1w2cPN4UWKaBNIEGtZErFV cTf8MKbut48sv38IvMOyli7GXCMwWj9Ka4dgZQRq+3uS3QWLFPQX0IKDjkB62KE13h2O iU9w== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of srinuvasan_a@mentor.com designates 68.232.141.98 as permitted sender) smtp.mailfrom=Srinuvasan_A@mentor.com Return-Path: Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com. [68.232.141.98]) by gmr-mx.google.com with ESMTPS id l14-20020a056e020e4e00b0032b4d49f708si273423ilk.1.2023.04.19.07.10.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Apr 2023 07:10:00 -0700 (PDT) Received-SPF: pass (google.com: domain of srinuvasan_a@mentor.com designates 68.232.141.98 as permitted sender) client-ip=68.232.141.98; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of srinuvasan_a@mentor.com designates 68.232.141.98 as permitted sender) smtp.mailfrom=Srinuvasan_A@mentor.com X-IronPort-AV: E=Sophos;i="5.99,208,1677571200"; d="scan'208";a="3254442" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 19 Apr 2023 06:09:59 -0800 IronPort-SDR: 8dWSOy/LrxY2AVXf46u/Fz1vPq/1VF0sXNkNIopRqDhrZzFrGTgFt5oEYcbpjpvzEw6g6saBrn K2n819ZVSxvk1Z5R8r7VSLK+HITXzp6t8ahzBlpiFMYmFQN0waWRagDfznPhVmOx8wKS98p30P 4YQF5cm7PxwvOiUhDxof9M1lPMgKBwr5/CggNSbDtsXW0EzvvcRhhUe3ci6N+MnOGxV/T0FuaC IURUS8wHSY2e/wRSq48GQUrcB+//bZgLGhExWG2cAXiUfZ+Pbn62oi5Odiocew5S3gBy8kmps+ eqw= From: Srinuvasan Arjunan To: CC: , , , Srinuvasan A Subject: [PATCH v2] meta/classes/sdk.bbclass: add --transform in TAR_OPTIONS Date: Wed, 19 Apr 2023 19:39:40 +0530 Message-ID: <20230419140940.1268690-1-srinuvasan_a@mentor.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Return-Path: srinuvasan_a@mentor.com X-ClientProxiedBy: svr-orw-mbx-11.mgc.mentorg.com (147.34.90.211) To svr-orw-mbx-13.mgc.mentorg.com (147.34.90.213) X-TUID: xPPv5YDevOfe From: Srinuvasan A When we untar the SDK rootfs archive file, all the contents are extracted into the current directory, not a folder, this looks ugly hence fixed it with the file name transformations option. But the below transform pattern not works, specifically with the symlink TAR_OPTIONS:append:class-sdk = " --transform="s|.|${IMAGE_FULLNAME}|"" instead of changedir -C with {PP_ROOTFS} and choose all files (.), use {PP} and choose rootfs dir, now by default extracted into a rootfs sub folder, in this case --transform works fine with the filename. Updated the document as well. Signed-off-by: Srinuvasan A --- doc/user_manual.md | 20 ++++++++++---------- meta/classes/imagetypes.bbclass | 2 +- meta/classes/sdk.bbclass | 1 + 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/doc/user_manual.md b/doc/user_manual.md index 92075a8..60b7ca9 100644 --- a/doc/user_manual.md +++ b/doc/user_manual.md @@ -1063,8 +1063,8 @@ User manually triggers creation of SDK root filesystem for his target platform b `bitbake -c do_populate_sdk mc:${MACHINE}-${DISTRO}:isar-image-base`. Packages that should be additionally installed into the SDK can be appended to `SDK_PREINSTALL` (external repositories) and `SDK_INSTALL` (self-built). -The resulting SDK rootfs is archived into `tmp/deploy/images/${MACHINE}/sdk-${DISTRO}-${DISTRO_ARCH}.tar.xz`. -It is additionally available for direct use under `tmp/deploy/images/${MACHINE}/sdk-${DISTRO}-${DISTRO_ARCH}/`. +The resulting SDK rootfs is archived into `tmp/deploy/images/${MACHINE}/${IMAGE_FULLNAME}.tar.xz`. +Once you untar the compressed file, the content will be extracted into the ${IMAGE_FULLNAME} sub folder. The SDK rootfs directory `/isar-apt` contains a copy of isar-apt repo with locally prebuilt target debian packages (for ). One may chroot into the SDK and install required target packages with the help of `apt-get install :` command. @@ -1073,7 +1073,7 @@ One may chroot into the SDK and install required target packages with the help o - Trigger creation of SDK root filesystem ``` -bitbake -c do_populate_sdk mc:qemuarm-buster:isar-image-base +bitbake -c do_populate_sdk mc:qemuarm-bullseye:isar-image-base ``` - Mount the following directories in chroot by passing resulting rootfs as an argument to the script `mount_chroot.sh`: @@ -1091,14 +1091,14 @@ mount devtmpfs $1/dev -t devtmpfs -o mode=0755,nosuid mount devpts $1/dev/pts -t devpts -o gid=5,mode=620 mount tmpfs $1/dev/shm -t tmpfs -o rw,seclabel,nosuid,nodev -$ sudo scripts/mount_chroot.sh ../build/tmp/deploy/images/qemuarm/sdk-debian-buster-armhf +$ sudo scripts/mount_chroot.sh ../build/tmp/deploy/images/qemuarm/isar-image-base-sdk-debian-bullseye-qemuarm ``` - chroot to isar SDK rootfs: ``` -$ sudo chroot build/tmp/deploy/images/qemuarm/sdk-debian-buster-armhf +$ sudo chroot build/tmp/deploy/images/qemuarm/isar-image-base-sdk-debian-bullseye-qemuarm ``` - Check that cross toolchains are installed @@ -1190,7 +1190,7 @@ Daemon socket) accessible in the container. What can endanger the stability and security of the host. The resulting SDK formats are archived into -`tmp/deploy/images/${MACHINE}/sdk-${DISTRO}-${DISTRO_ARCH}-${sdk_format}.tar.xz` +`tmp/deploy/images/${MACHINE}/isar-image-base-sdk-${DISTRO}-${DISTRO_ARCH}-${sdk_format}.tar.xz` (being `sdk_format` each one of the formats specified in `SDK_FORMATS`). The SDK container directory `/isar-apt` contains a copy of isar-apt repo with locally prebuilt target debian packages (for ). @@ -1207,27 +1207,27 @@ to edit files in the host with an IDE and build in the container. For one-shot builds (use `local.conf` otherwise): ``` -export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE SDK_FORMATS" +export BB_ENV_PASSTHROUGH_ADDITIONS="$BB_ENV_EXTRAWHITE SDK_FORMATS" export SDK_FORMATS="docker-archive" ``` - Trigger creation of SDK root filesystem ``` -bitbake -c do_populate_sdk mc:qemuarm-buster:isar-image-base +bitbake -c do_populate_sdk mc:qemuarm-bullseye:isar-image-base ``` - Load the SDK container image into the Docker Daemon ``` -docker load -i build/tmp/deploy/images/qemuarm/sdk-isar-image-base-debian-buster-armhf-1.0-r0-docker-archive.tar.xz +docker load -i build/tmp/deploy/images/qemuarm/isar-image-base-sdk-debian-bullseye-armhf-1.0-r0-docker-archive.tar.xz ``` - Run a container using the SDK container image (following commands starting with `#~:` are to be run in the container) ``` -docker run --rm -ti --volume "$(pwd):/build" sdk-isar-image-base-debian-buster-armhf:1.0-r0 +docker run --rm -ti --volume "$(pwd):/build" isar-image-base-sdk-debian-bullseye-armhf:1.0-r0 ``` - Check that cross toolchains are installed diff --git a/meta/classes/imagetypes.bbclass b/meta/classes/imagetypes.bbclass index 2ee3240..e476778 100644 --- a/meta/classes/imagetypes.bbclass +++ b/meta/classes/imagetypes.bbclass @@ -9,7 +9,7 @@ TAR_OPTIONS ?= "" IMAGE_CMD:tar() { ${SUDO_CHROOT} tar ${TAR_OPTIONS} -cvSf \ - ${IMAGE_FILE_CHROOT} --one-file-system -C ${PP_ROOTFS} . + ${IMAGE_FILE_CHROOT} --one-file-system -C ${PP} rootfs } # image type: ext4 diff --git a/meta/classes/sdk.bbclass b/meta/classes/sdk.bbclass index 06cae02..c6dc689 100644 --- a/meta/classes/sdk.bbclass +++ b/meta/classes/sdk.bbclass @@ -53,6 +53,7 @@ ROOTFS_MANIFEST_DEPLOY_DIR:class-sdk = "${DEPLOY_DIR_SDKCHROOT}" ROOTFS_DPKGSTATUS_DEPLOY_DIR:class-sdk = "${DEPLOY_DIR_SDKCHROOT}" IMAGE_FSTYPES:class-sdk = "${SDK_FORMATS}" +TAR_OPTIONS:append:class-sdk = " --transform="s|rootfs|${IMAGE_FULLNAME}|"" # bitbake dependencies SDKDEPENDS += "sdk-files ${SDK_INSTALL}" -- 2.34.1