public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH v2 0/4] Fixing isar-apt usage inside SDK
@ 2023-12-21 10:31 Anton Mikanovich
  2023-12-21 10:31 ` [PATCH v2 1/4] rootfs: Split isar-apt and base-apt cleanup Anton Mikanovich
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Anton Mikanovich @ 2023-12-21 10:31 UTC (permalink / raw)
  To: isar-users; +Cc: Anton Mikanovich

This patchset fixes SDK prepare code to provide isar-apt based on
SDK_INCLUDE_ISAR_APT value. It also improves Isar documentation for SDK
usage.

Changes since v1:
- Fix base-apt usage in repro test cases.

Anton Mikanovich (4):
  rootfs: Split isar-apt and base-apt cleanup
  sdk: Remove duplicated isar-apt cleanup
  sdk: Control isar-apt list removing
  doc/user_manual.md: Improve SDK usage howto

 doc/user_manual.md                            | 31 +++++++++++++++++--
 meta/classes/rootfs.bbclass                   |  8 +++++
 meta/classes/sdk.bbclass                      |  7 ++---
 .../sbuild-chroot/sbuild-chroot.inc           |  3 ++
 4 files changed, 41 insertions(+), 8 deletions(-)

-- 
2.34.1


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

* [PATCH v2 1/4] rootfs: Split isar-apt and base-apt cleanup
  2023-12-21 10:31 [PATCH v2 0/4] Fixing isar-apt usage inside SDK Anton Mikanovich
@ 2023-12-21 10:31 ` Anton Mikanovich
  2023-12-21 10:31 ` [PATCH v2 2/4] sdk: Remove duplicated isar-apt cleanup Anton Mikanovich
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Anton Mikanovich @ 2023-12-21 10:31 UTC (permalink / raw)
  To: isar-users; +Cc: Anton Mikanovich

To allow separate isar-apt and base-apt source lists cleanup control
remove this files in different functions.

Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
 meta/classes/rootfs.bbclass                           | 8 ++++++++
 meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc | 3 +++
 2 files changed, 11 insertions(+)

diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass
index 1b95115a..498fbfd6 100644
--- a/meta/classes/rootfs.bbclass
+++ b/meta/classes/rootfs.bbclass
@@ -305,6 +305,14 @@ rootfs_cleanup_isar_apt() {
         set -e
         rm -f "${ROOTFSDIR}/etc/apt/sources.list.d/isar-apt.list"
         rm -f "${ROOTFSDIR}/etc/apt/preferences.d/isar-apt"
+EOSUDO
+}
+
+ROOTFS_POSTPROCESS_COMMAND += "rootfs_cleanup_base_apt"
+rootfs_cleanup_base_apt[weight] = "2"
+rootfs_cleanup_base_apt() {
+    sudo -s <<'EOSUDO'
+        set -e
         rm -f "${ROOTFSDIR}/etc/apt/sources.list.d/base-apt.list"
         rm -f "${ROOTFSDIR}/etc/apt/apt.conf.d/50isar"
 EOSUDO
diff --git a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
index 938b8334..39ced80b 100644
--- a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
+++ b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
@@ -60,6 +60,9 @@ ROOTFS_PACKAGES = "${SBUILD_CHROOT_PREINSTALL}"
 ROOTFS_CONFIGURE_COMMAND:remove = "rootfs_configure_isar_apt"
 ROOTFS_POSTPROCESS_COMMAND:remove = "rootfs_cleanup_isar_apt"
 
+# Do not cleanup base-apt
+ROOTFS_POSTPROCESS_COMMAND:remove = "rootfs_cleanup_base_apt"
+
 DEPLOY_SCHROOT = "${@d.getVar('SCHROOT_' + d.getVar('SBUILD_VARIANT').upper() + '_DIR')}${SBUILD_SCHROOT_SUFFIX}"
 
 do_sbuildchroot_deploy[dirs] = "${DEPLOY_DIR}/schroot-${SBUILD_VARIANT}"
-- 
2.34.1


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

* [PATCH v2 2/4] sdk: Remove duplicated isar-apt cleanup
  2023-12-21 10:31 [PATCH v2 0/4] Fixing isar-apt usage inside SDK Anton Mikanovich
  2023-12-21 10:31 ` [PATCH v2 1/4] rootfs: Split isar-apt and base-apt cleanup Anton Mikanovich
@ 2023-12-21 10:31 ` Anton Mikanovich
  2023-12-21 10:31 ` [PATCH v2 3/4] sdk: Control isar-apt list removing Anton Mikanovich
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Anton Mikanovich @ 2023-12-21 10:31 UTC (permalink / raw)
  To: isar-users; +Cc: Anton Mikanovich

This cleanup is already implemented in rootfs_cleanup_isar_apt.

Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
 meta/classes/sdk.bbclass | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/meta/classes/sdk.bbclass b/meta/classes/sdk.bbclass
index 216213ac..e76f7930 100644
--- a/meta/classes/sdk.bbclass
+++ b/meta/classes/sdk.bbclass
@@ -82,11 +82,6 @@ sdkchroot_configscript () {
 
 ROOTFS_POSTPROCESS_COMMAND:append:class-sdk = " sdkchroot_finalize"
 sdkchroot_finalize() {
-    if [ "${SDK_INCLUDE_ISAR_APT}" = "0" ]; then
-        # Remove isar-apt repo entry
-        sudo rm -f ${ROOTFSDIR}/etc/apt/sources.list.d/isar-apt.list
-    fi
-
     sudo umount -R ${ROOTFSDIR}/dev || true
     sudo umount ${ROOTFSDIR}/proc || true
     sudo umount -R ${ROOTFSDIR}/sys || true
-- 
2.34.1


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

* [PATCH v2 3/4] sdk: Control isar-apt list removing
  2023-12-21 10:31 [PATCH v2 0/4] Fixing isar-apt usage inside SDK Anton Mikanovich
  2023-12-21 10:31 ` [PATCH v2 1/4] rootfs: Split isar-apt and base-apt cleanup Anton Mikanovich
  2023-12-21 10:31 ` [PATCH v2 2/4] sdk: Remove duplicated isar-apt cleanup Anton Mikanovich
@ 2023-12-21 10:31 ` Anton Mikanovich
  2023-12-21 10:31 ` [PATCH v2 4/4] doc/user_manual.md: Improve SDK usage howto Anton Mikanovich
  2023-12-29  7:17 ` [PATCH v2 0/4] Fixing isar-apt usage inside SDK Anton Mikanovich
  4 siblings, 0 replies; 6+ messages in thread
From: Anton Mikanovich @ 2023-12-21 10:31 UTC (permalink / raw)
  To: isar-users; +Cc: Anton Mikanovich

Do not remove isar-apt.list in case SDK_INCLUDE_ISAR_APT enabled.

Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
 meta/classes/sdk.bbclass | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/classes/sdk.bbclass b/meta/classes/sdk.bbclass
index e76f7930..52c3bec5 100644
--- a/meta/classes/sdk.bbclass
+++ b/meta/classes/sdk.bbclass
@@ -68,6 +68,8 @@ SDKROOTFSVARDEPS = ""
 SDKROOTFSVARDEPS:class-sdk = "SDK_INCLUDE_ISAR_APT"
 do_rootfs_install[vardeps] += "${SDKROOTFSVARDEPS}"
 
+ROOTFS_POSTPROCESS_COMMAND:remove = "${@'rootfs_cleanup_isar_apt' if d.getVar('SDK_INCLUDE_ISAR_APT') == '1' else ''}"
+
 # additional SDK steps
 ROOTFS_CONFIGURE_COMMAND:append:class-sdk = " ${@'rootfs_configure_isar_apt_dir' if d.getVar('SDK_INCLUDE_ISAR_APT') == '1' else ''}"
 rootfs_configure_isar_apt_dir() {
-- 
2.34.1


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

* [PATCH v2 4/4] doc/user_manual.md: Improve SDK usage howto
  2023-12-21 10:31 [PATCH v2 0/4] Fixing isar-apt usage inside SDK Anton Mikanovich
                   ` (2 preceding siblings ...)
  2023-12-21 10:31 ` [PATCH v2 3/4] sdk: Control isar-apt list removing Anton Mikanovich
@ 2023-12-21 10:31 ` Anton Mikanovich
  2023-12-29  7:17 ` [PATCH v2 0/4] Fixing isar-apt usage inside SDK Anton Mikanovich
  4 siblings, 0 replies; 6+ messages in thread
From: Anton Mikanovich @ 2023-12-21 10:31 UTC (permalink / raw)
  To: isar-users; +Cc: Anton Mikanovich

Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
 doc/user_manual.md | 31 ++++++++++++++++++++++++++++---
 1 file changed, 28 insertions(+), 3 deletions(-)

diff --git a/doc/user_manual.md b/doc/user_manual.md
index 3744c753..2eb97647 100644
--- a/doc/user_manual.md
+++ b/doc/user_manual.md
@@ -1138,16 +1138,28 @@ One may chroot into the SDK and install required target packages with the help o
 
 ### Example
 
+ - Enable isar-apt include in `conf/local.conf`:
+
+```
+SDK_INCLUDE_ISAR_APT = "1"
+```
+
  - Trigger creation of SDK root filesystem
 
 ```
 bitbake -c do_populate_sdk mc:qemuarm-bullseye:isar-image-base
+```
+
+ - Unpack generated SDK:
+
+```
+sudo tar xf tmp/deploy/images/qemuarm/isar-image-base-sdk-debian-bullseye-qemuarm.tar.xz -C tmp/deploy/images/qemuarm
 ```
 
  - Mount the following directories in chroot by passing resulting rootfs as an argument to the script `mount_chroot.sh`:
 
 ```
-cat scripts/mount_chroot.sh
+cat ../scripts/mount_chroot.sh
 #!/bin/sh
 
 set -e
@@ -1159,14 +1171,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/isar-image-base-sdk-debian-bullseye-qemuarm
+sudo ../scripts/mount_chroot.sh tmp/deploy/images/qemuarm/isar-image-base-sdk-debian-bullseye-qemuarm
 
 ```
 
  - chroot to isar SDK rootfs:
 
 ```
-$ sudo chroot build/tmp/deploy/images/qemuarm/isar-image-base-sdk-debian-bullseye-qemuarm
+sudo chroot tmp/deploy/images/qemuarm/isar-image-base-sdk-debian-bullseye-qemuarm
 ```
  - Check that cross toolchains are installed
 
@@ -1180,6 +1192,13 @@ ii  crossbuild-essential-armhf           12.3                   all          Inf
 ```
 :~# apt-get update
 :~# apt-get install libhello-dev:armhf
+```
+
+Note that you may need to copy `/etc/resolv.conf` from the host or use any
+public nameserver like:
+
+```
+:~# echo "nameserver 8.8.8.8" > /etc/resolv.conf
 ```
 
  - Check the contents of the installed target package
@@ -1200,6 +1219,12 @@ ii  crossbuild-essential-armhf           12.3                   all          Inf
 /usr/share/doc/libhello-dev/changelog.gz
 /usr/share/doc/libhello-dev/copyright
 ~#
+```
+
+ - Unmount rootfs paths:
+
+```
+sudo ../scripts/umount_chroot.sh tmp/deploy/images/qemuarm/isar-image-base-sdk-debian-bullseye-qemuarm
 ```
 
 ## Create a containerized Isar SDK root filesystem
-- 
2.34.1


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

* Re: [PATCH v2 0/4] Fixing isar-apt usage inside SDK
  2023-12-21 10:31 [PATCH v2 0/4] Fixing isar-apt usage inside SDK Anton Mikanovich
                   ` (3 preceding siblings ...)
  2023-12-21 10:31 ` [PATCH v2 4/4] doc/user_manual.md: Improve SDK usage howto Anton Mikanovich
@ 2023-12-29  7:17 ` Anton Mikanovich
  4 siblings, 0 replies; 6+ messages in thread
From: Anton Mikanovich @ 2023-12-29  7:17 UTC (permalink / raw)
  To: isar-users

21/12/2023 12:31, Anton Mikanovich wrote:
> This patchset fixes SDK prepare code to provide isar-apt based on
> SDK_INCLUDE_ISAR_APT value. It also improves Isar documentation for SDK
> usage.
>
> Changes since v1:
> - Fix base-apt usage in repro test cases.
>
> Anton Mikanovich (4):
>    rootfs: Split isar-apt and base-apt cleanup
>    sdk: Remove duplicated isar-apt cleanup
>    sdk: Control isar-apt list removing
>    doc/user_manual.md: Improve SDK usage howto
>
>   doc/user_manual.md                            | 31 +++++++++++++++++--
>   meta/classes/rootfs.bbclass                   |  8 +++++
>   meta/classes/sdk.bbclass                      |  7 ++---
>   .../sbuild-chroot/sbuild-chroot.inc           |  3 ++
>   4 files changed, 41 insertions(+), 8 deletions(-)
>
Applied to next.


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

end of thread, other threads:[~2023-12-29  7:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-21 10:31 [PATCH v2 0/4] Fixing isar-apt usage inside SDK Anton Mikanovich
2023-12-21 10:31 ` [PATCH v2 1/4] rootfs: Split isar-apt and base-apt cleanup Anton Mikanovich
2023-12-21 10:31 ` [PATCH v2 2/4] sdk: Remove duplicated isar-apt cleanup Anton Mikanovich
2023-12-21 10:31 ` [PATCH v2 3/4] sdk: Control isar-apt list removing Anton Mikanovich
2023-12-21 10:31 ` [PATCH v2 4/4] doc/user_manual.md: Improve SDK usage howto Anton Mikanovich
2023-12-29  7:17 ` [PATCH v2 0/4] Fixing isar-apt usage inside SDK Anton Mikanovich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox