public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH 0/4] Fixing isar-apt usage inside SDK
@ 2023-12-06 12:12 Anton Mikanovich
  2023-12-06 12:12 ` [PATCH 1/4] rootfs: Split isar-apt and base-apt cleanup Anton Mikanovich
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Anton Mikanovich @ 2023-12-06 12:12 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.

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 ++-----
 3 files changed, 38 insertions(+), 8 deletions(-)

-- 
2.34.1


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

* [PATCH 1/4] rootfs: Split isar-apt and base-apt cleanup
  2023-12-06 12:12 [PATCH 0/4] Fixing isar-apt usage inside SDK Anton Mikanovich
@ 2023-12-06 12:12 ` Anton Mikanovich
  2023-12-06 12:12 ` [PATCH 2/4] sdk: Remove duplicated isar-apt cleanup Anton Mikanovich
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Anton Mikanovich @ 2023-12-06 12:12 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 ++++++++
 1 file changed, 8 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
-- 
2.34.1


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

* [PATCH 2/4] sdk: Remove duplicated isar-apt cleanup
  2023-12-06 12:12 [PATCH 0/4] Fixing isar-apt usage inside SDK Anton Mikanovich
  2023-12-06 12:12 ` [PATCH 1/4] rootfs: Split isar-apt and base-apt cleanup Anton Mikanovich
@ 2023-12-06 12:12 ` Anton Mikanovich
  2023-12-06 12:12 ` [PATCH 3/4] sdk: Control isar-apt list removing Anton Mikanovich
  2023-12-06 12:12 ` [PATCH 4/4] doc/user_manual.md: Improve SDK usage howto Anton Mikanovich
  3 siblings, 0 replies; 7+ messages in thread
From: Anton Mikanovich @ 2023-12-06 12:12 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] 7+ messages in thread

* [PATCH 3/4] sdk: Control isar-apt list removing
  2023-12-06 12:12 [PATCH 0/4] Fixing isar-apt usage inside SDK Anton Mikanovich
  2023-12-06 12:12 ` [PATCH 1/4] rootfs: Split isar-apt and base-apt cleanup Anton Mikanovich
  2023-12-06 12:12 ` [PATCH 2/4] sdk: Remove duplicated isar-apt cleanup Anton Mikanovich
@ 2023-12-06 12:12 ` Anton Mikanovich
  2023-12-07  0:55   ` Jan Kiszka
  2023-12-06 12:12 ` [PATCH 4/4] doc/user_manual.md: Improve SDK usage howto Anton Mikanovich
  3 siblings, 1 reply; 7+ messages in thread
From: Anton Mikanovich @ 2023-12-06 12:12 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] 7+ messages in thread

* [PATCH 4/4] doc/user_manual.md: Improve SDK usage howto
  2023-12-06 12:12 [PATCH 0/4] Fixing isar-apt usage inside SDK Anton Mikanovich
                   ` (2 preceding siblings ...)
  2023-12-06 12:12 ` [PATCH 3/4] sdk: Control isar-apt list removing Anton Mikanovich
@ 2023-12-06 12:12 ` Anton Mikanovich
  3 siblings, 0 replies; 7+ messages in thread
From: Anton Mikanovich @ 2023-12-06 12:12 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] 7+ messages in thread

* Re: [PATCH 3/4] sdk: Control isar-apt list removing
  2023-12-06 12:12 ` [PATCH 3/4] sdk: Control isar-apt list removing Anton Mikanovich
@ 2023-12-07  0:55   ` Jan Kiszka
  2023-12-07 15:46     ` Baurzhan Ismagulov
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Kiszka @ 2023-12-07  0:55 UTC (permalink / raw)
  To: Anton Mikanovich, isar-users

On 06.12.23 20:12, Anton Mikanovich wrote:
> Do not remove isar-apt.list in case SDK_INCLUDE_ISAR_APT enabled.
> 

This says what it does, not why.

Does that isar-apt list really make any sense outside of the build
environment?

Jan

> 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() {

-- 
Siemens AG, Technology
Linux Expert Center


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

* Re: [PATCH 3/4] sdk: Control isar-apt list removing
  2023-12-07  0:55   ` Jan Kiszka
@ 2023-12-07 15:46     ` Baurzhan Ismagulov
  0 siblings, 0 replies; 7+ messages in thread
From: Baurzhan Ismagulov @ 2023-12-07 15:46 UTC (permalink / raw)
  To: isar-users; +Cc: Jan Kiszka

On 2023-12-07 09:55, 'Jan Kiszka' via isar-users wrote:
> > Do not remove isar-apt.list in case SDK_INCLUDE_ISAR_APT enabled.
> 
> This says what it does, not why.
> 
> Does that isar-apt list really make any sense outside of the build
> environment?

isar-apt is essential for sdk users who have big or complex application
dependencies. It enables hello developer to do apt-get build-dep hello and get
all dependencies installed in the sdk.

This series fixes a regression of an existing feature. The motivation is
described in
https://github.com/ilbers/isar/blob/next/doc/user_manual.md#create-an-isar-sdk-root-filesystem
but the use case could be defined in more specific terms; we'll send a separate
patch for that.

With kind regards,
Baurzhan

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

end of thread, other threads:[~2023-12-07 15:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-06 12:12 [PATCH 0/4] Fixing isar-apt usage inside SDK Anton Mikanovich
2023-12-06 12:12 ` [PATCH 1/4] rootfs: Split isar-apt and base-apt cleanup Anton Mikanovich
2023-12-06 12:12 ` [PATCH 2/4] sdk: Remove duplicated isar-apt cleanup Anton Mikanovich
2023-12-06 12:12 ` [PATCH 3/4] sdk: Control isar-apt list removing Anton Mikanovich
2023-12-07  0:55   ` Jan Kiszka
2023-12-07 15:46     ` Baurzhan Ismagulov
2023-12-06 12:12 ` [PATCH 4/4] doc/user_manual.md: Improve SDK usage howto Anton Mikanovich

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