public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH 0/1] isar-bootstrap-helper: fix "Argument list too long" error
@ 2018-12-09 15:21 Cedric Hombourger
  2018-12-09 15:21 ` [PATCH 1/1] " Cedric Hombourger
  0 siblings, 1 reply; 3+ messages in thread
From: Cedric Hombourger @ 2018-12-09 15:21 UTC (permalink / raw)
  To: isar-users; +Cc: Cedric Hombourger

One of our customer projects has many packages includes in the root file-system.
This caused the setup_root_file_system function to fail when calling /bin/mv to
move downloaded .deb files to the apt cache with an "Argument list too long"
error. This can be fixed by using 'find -execdir {} +'. The number of /bin/mv
calls will remain minimal and command lines within system limits.

Cedric Hombourger (1):
  isar-bootstrap-helper: fix "Argument list too long" error

 meta/classes/isar-bootstrap-helper.bbclass | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

-- 
2.11.0


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

* [PATCH 1/1] isar-bootstrap-helper: fix "Argument list too long" error
  2018-12-09 15:21 [PATCH 0/1] isar-bootstrap-helper: fix "Argument list too long" error Cedric Hombourger
@ 2018-12-09 15:21 ` Cedric Hombourger
  2018-12-11  8:12   ` Maxim Yu. Osipov
  0 siblings, 1 reply; 3+ messages in thread
From: Cedric Hombourger @ 2018-12-09 15:21 UTC (permalink / raw)
  To: isar-users; +Cc: Cedric Hombourger

The mv command used to move downloaded .deb files to the apt cache will
fail with an "Argument list too long" error when the root file-system
includes many packages. Use 'find -execdir {} +' to call /bin/mv with
as many packages as possible but without exceeding system limits.

Signed-off-by: Cedric Hombourger <Cedric_Hombourger@mentor.com>
---
 meta/classes/isar-bootstrap-helper.bbclass | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/meta/classes/isar-bootstrap-helper.bbclass b/meta/classes/isar-bootstrap-helper.bbclass
index 641138a..d780b85 100644
--- a/meta/classes/isar-bootstrap-helper.bbclass
+++ b/meta/classes/isar-bootstrap-helper.bbclass
@@ -145,8 +145,9 @@ setup_root_file_system() {
     if [ ${CLEAN} ]; then
         if [ ${KEEP_APT_CACHE} -eq 1 ]; then
             mkdir -p ${WORKDIR}/apt_cache
-            sudo mv $(find $ROOTFSDIR/var/cache/apt -name '*.deb') ${WORKDIR}/apt_cache
-            sudo chown `whoami` ${WORKDIR}/apt_cache/*
+            sudo find ${ROOTFSDIR}/var/cache/apt/archives \
+                -maxdepth 1 -name '*.deb' -execdir /bin/mv -t ${WORKDIR}/apt_cache '{}' '+'
+            sudo chown -R $(whoami) ${WORKDIR}/apt_cache
         fi
         sudo -E chroot "$ROOTFSDIR" \
             /usr/bin/apt-get autoremove --purge --yes
-- 
2.11.0


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

* Re: [PATCH 1/1] isar-bootstrap-helper: fix "Argument list too long" error
  2018-12-09 15:21 ` [PATCH 1/1] " Cedric Hombourger
@ 2018-12-11  8:12   ` Maxim Yu. Osipov
  0 siblings, 0 replies; 3+ messages in thread
From: Maxim Yu. Osipov @ 2018-12-11  8:12 UTC (permalink / raw)
  To: Cedric Hombourger, isar-users

On 12/9/18 6:21 PM, Cedric Hombourger wrote:
> The mv command used to move downloaded .deb files to the apt cache will
> fail with an "Argument list too long" error when the root file-system
> includes many packages. Use 'find -execdir {} +' to call /bin/mv with
> as many packages as possible but without exceeding system limits.

Applied to the 'next',

Thanks,
Maxim.

> Signed-off-by: Cedric Hombourger <Cedric_Hombourger@mentor.com>
> ---
>   meta/classes/isar-bootstrap-helper.bbclass | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/classes/isar-bootstrap-helper.bbclass b/meta/classes/isar-bootstrap-helper.bbclass
> index 641138a..d780b85 100644
> --- a/meta/classes/isar-bootstrap-helper.bbclass
> +++ b/meta/classes/isar-bootstrap-helper.bbclass
> @@ -145,8 +145,9 @@ setup_root_file_system() {
>       if [ ${CLEAN} ]; then
>           if [ ${KEEP_APT_CACHE} -eq 1 ]; then
>               mkdir -p ${WORKDIR}/apt_cache
> -            sudo mv $(find $ROOTFSDIR/var/cache/apt -name '*.deb') ${WORKDIR}/apt_cache
> -            sudo chown `whoami` ${WORKDIR}/apt_cache/*
> +            sudo find ${ROOTFSDIR}/var/cache/apt/archives \
> +                -maxdepth 1 -name '*.deb' -execdir /bin/mv -t ${WORKDIR}/apt_cache '{}' '+'
> +            sudo chown -R $(whoami) ${WORKDIR}/apt_cache
>           fi
>           sudo -E chroot "$ROOTFSDIR" \
>               /usr/bin/apt-get autoremove --purge --yes
> 


-- 
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] 3+ messages in thread

end of thread, other threads:[~2018-12-11  8:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-09 15:21 [PATCH 0/1] isar-bootstrap-helper: fix "Argument list too long" error Cedric Hombourger
2018-12-09 15:21 ` [PATCH 1/1] " Cedric Hombourger
2018-12-11  8:12   ` 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