* [PATCH v2] classes/isar-image: Replace the apt sources file with the original
@ 2018-12-18 17:03 Maxim Yu. Osipov
2018-12-19 7:27 ` Jan Kiszka
2018-12-19 11:45 ` Maxim Yu. Osipov
0 siblings, 2 replies; 4+ messages in thread
From: Maxim Yu. Osipov @ 2018-12-18 17:03 UTC (permalink / raw)
To: isar-users
At the final stage of image generation replace the local apt sources
file used for bootstrapping with the original APT sources list
defined via DISTRO_APT_SOURCES variable.
Signed-off-by: Maxim Yu. Osipov <mosipov@ilbers.de>
---
meta/classes/isar-image.bbclass | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/meta/classes/isar-image.bbclass b/meta/classes/isar-image.bbclass
index 81738ff..4992800 100644
--- a/meta/classes/isar-image.bbclass
+++ b/meta/classes/isar-image.bbclass
@@ -66,7 +66,13 @@ isar_image_cleanup() {
if [ "${ISAR_USE_CACHED_BASE_REPO}" = "1" ]; then
sudo umount -l ${IMAGE_ROOTFS}/base-apt
sudo rmdir ${IMAGE_ROOTFS}/base-apt
+ # Replace the local apt we bootstrapped with the
+ # APT sources initially defined in DISTRO_APT_SOURCES
+ sudo rm -f "${IMAGE_ROOTFS}/etc/apt/sources.list.d/base-apt.list"
+ sudo mv "${IMAGE_ROOTFS}/etc/apt/sources-list" \
+ "${IMAGE_ROOTFS}/etc/apt/sources.list.d/bootstrap.list"
fi
+ sudo rm -f "${IMAGE_ROOTFS}/etc/apt/sources-list"
}
do_rootfs() {
--
2.11.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] classes/isar-image: Replace the apt sources file with the original
2018-12-18 17:03 [PATCH v2] classes/isar-image: Replace the apt sources file with the original Maxim Yu. Osipov
@ 2018-12-19 7:27 ` Jan Kiszka
2018-12-19 9:30 ` Henning Schild
2018-12-19 11:45 ` Maxim Yu. Osipov
1 sibling, 1 reply; 4+ messages in thread
From: Jan Kiszka @ 2018-12-19 7:27 UTC (permalink / raw)
To: Maxim Yu. Osipov, isar-users
On 18.12.18 18:03, Maxim Yu. Osipov wrote:
> At the final stage of image generation replace the local apt sources
> file used for bootstrapping with the original APT sources list
> defined via DISTRO_APT_SOURCES variable.
>
> Signed-off-by: Maxim Yu. Osipov <mosipov@ilbers.de>
> ---
> meta/classes/isar-image.bbclass | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/meta/classes/isar-image.bbclass b/meta/classes/isar-image.bbclass
> index 81738ff..4992800 100644
> --- a/meta/classes/isar-image.bbclass
> +++ b/meta/classes/isar-image.bbclass
> @@ -66,7 +66,13 @@ isar_image_cleanup() {
> if [ "${ISAR_USE_CACHED_BASE_REPO}" = "1" ]; then
> sudo umount -l ${IMAGE_ROOTFS}/base-apt
> sudo rmdir ${IMAGE_ROOTFS}/base-apt
> + # Replace the local apt we bootstrapped with the
> + # APT sources initially defined in DISTRO_APT_SOURCES
> + sudo rm -f "${IMAGE_ROOTFS}/etc/apt/sources.list.d/base-apt.list"
> + sudo mv "${IMAGE_ROOTFS}/etc/apt/sources-list" \
> + "${IMAGE_ROOTFS}/etc/apt/sources.list.d/bootstrap.list"
> fi
> + sudo rm -f "${IMAGE_ROOTFS}/etc/apt/sources-list"
As I'm counting 3 further sudos here, and actually every other command in
isar_image_cleanup has that prefix as well: Why not just do
sudo sh -c ' \
cmd1
cmd2
...
'
like elsewhere?
This case would actually need
sudo isar_image_cleanup() {
...
}
if bitbake had that.
Jan
> }
>
> do_rootfs() {
>
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] classes/isar-image: Replace the apt sources file with the original
2018-12-19 7:27 ` Jan Kiszka
@ 2018-12-19 9:30 ` Henning Schild
0 siblings, 0 replies; 4+ messages in thread
From: Henning Schild @ 2018-12-19 9:30 UTC (permalink / raw)
To: [ext] Jan Kiszka; +Cc: Maxim Yu. Osipov, isar-users
Am Wed, 19 Dec 2018 08:27:02 +0100
schrieb "[ext] Jan Kiszka" <jan.kiszka@siemens.com>:
> On 18.12.18 18:03, Maxim Yu. Osipov wrote:
> > At the final stage of image generation replace the local apt sources
> > file used for bootstrapping with the original APT sources list
> > defined via DISTRO_APT_SOURCES variable.
> >
> > Signed-off-by: Maxim Yu. Osipov <mosipov@ilbers.de>
> > ---
> > meta/classes/isar-image.bbclass | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > diff --git a/meta/classes/isar-image.bbclass
> > b/meta/classes/isar-image.bbclass index 81738ff..4992800 100644
> > --- a/meta/classes/isar-image.bbclass
> > +++ b/meta/classes/isar-image.bbclass
> > @@ -66,7 +66,13 @@ isar_image_cleanup() {
> > if [ "${ISAR_USE_CACHED_BASE_REPO}" = "1" ]; then
> > sudo umount -l ${IMAGE_ROOTFS}/base-apt
> > sudo rmdir ${IMAGE_ROOTFS}/base-apt
> > + # Replace the local apt we bootstrapped with the
> > + # APT sources initially defined in DISTRO_APT_SOURCES
> > + sudo rm -f
> > "${IMAGE_ROOTFS}/etc/apt/sources.list.d/base-apt.list"
> > + sudo mv "${IMAGE_ROOTFS}/etc/apt/sources-list" \
> > +
> > "${IMAGE_ROOTFS}/etc/apt/sources.list.d/bootstrap.list" fi
> > + sudo rm -f "${IMAGE_ROOTFS}/etc/apt/sources-list"
>
> As I'm counting 3 further sudos here, and actually every other
> command in isar_image_cleanup has that prefix as well: Why not just do
>
> sudo sh -c ' \
> cmd1
> cmd2
> ...
> '
>
> like elsewhere?
>
> This case would actually need
>
> sudo isar_image_cleanup() {
> ...
> }
>
> if bitbake had that.
prefuncs/postfuncs
As soon as sudo is involved cleandirs will not work anymore, which
should probably be the default way to go.
Henning
> Jan
>
> > }
> >
> > do_rootfs() {
> >
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] classes/isar-image: Replace the apt sources file with the original
2018-12-18 17:03 [PATCH v2] classes/isar-image: Replace the apt sources file with the original Maxim Yu. Osipov
2018-12-19 7:27 ` Jan Kiszka
@ 2018-12-19 11:45 ` Maxim Yu. Osipov
1 sibling, 0 replies; 4+ messages in thread
From: Maxim Yu. Osipov @ 2018-12-19 11:45 UTC (permalink / raw)
To: isar-users
On 12/18/18 8:03 PM, Maxim Yu. Osipov wrote:
> At the final stage of image generation replace the local apt sources
> file used for bootstrapping with the original APT sources list
> defined via DISTRO_APT_SOURCES variable.
Applied to the 'next'.
>
> Signed-off-by: Maxim Yu. Osipov <mosipov@ilbers.de>
> ---
> meta/classes/isar-image.bbclass | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/meta/classes/isar-image.bbclass b/meta/classes/isar-image.bbclass
> index 81738ff..4992800 100644
> --- a/meta/classes/isar-image.bbclass
> +++ b/meta/classes/isar-image.bbclass
> @@ -66,7 +66,13 @@ isar_image_cleanup() {
> if [ "${ISAR_USE_CACHED_BASE_REPO}" = "1" ]; then
> sudo umount -l ${IMAGE_ROOTFS}/base-apt
> sudo rmdir ${IMAGE_ROOTFS}/base-apt
> + # Replace the local apt we bootstrapped with the
> + # APT sources initially defined in DISTRO_APT_SOURCES
> + sudo rm -f "${IMAGE_ROOTFS}/etc/apt/sources.list.d/base-apt.list"
> + sudo mv "${IMAGE_ROOTFS}/etc/apt/sources-list" \
> + "${IMAGE_ROOTFS}/etc/apt/sources.list.d/bootstrap.list"
> fi
> + sudo rm -f "${IMAGE_ROOTFS}/etc/apt/sources-list"
> }
>
> do_rootfs() {
>
--
Maxim Osipov
ilbers GmbH
Maria-Merian-Str. 8
85521 Ottobrunn
Germany
+49 (151) 6517 6917
mosipov@ilbers.de
http://ilbers.de/
Commercial register Munich, HRB 214197
General Manager: Baurzhan Ismagulov
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-12-19 11:45 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-18 17:03 [PATCH v2] classes/isar-image: Replace the apt sources file with the original Maxim Yu. Osipov
2018-12-19 7:27 ` Jan Kiszka
2018-12-19 9:30 ` Henning Schild
2018-12-19 11:45 ` Maxim Yu. Osipov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox