All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gleb Mazovetskiy <glex.spb@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] relocate-sdk: Allow relocating to any location
Date: Sat, 17 Jul 2021 11:08:03 +0100	[thread overview]
Message-ID: <CADjhFRDi9hOA7u9xinmPSuoWvNhyZDBErbfpSwpOO4o+Gh3v4g@mail.gmail.com> (raw)
In-Reply-To: <20210717093954.GJ12203@scaer>

 This fixes a minor frustrating issue. It addresses the following scenario:

1. I'm the SDK maintainer. I tell users to unpack to a specific directory.
E.g. /opt/mysdk.
2. I build the SDK in such a way that the users do not need to run
relocate-sdk.sh if they unpack to /opt/mysdk.

The problem is with step 2: currently it requires the build process to move
the SDK to /opt/mysdk, then run relocate-sdk.sh, before producing the final
tarball.
This is often problematic because on the SDK maintainer's machine,
`/opt/mysdk` usually already exists and contains the latest stable release.

With this new argument, the build process can be simplified for the SDK
maintainer.



On Sat, Jul 17, 2021 at 10:39 AM Yann E. MORIN <yann.morin.1998@free.fr>
wrote:

> Gleb, All,
>
> On 2020-03-28 23:49 +0000, Gleb Mazovetskiy spake thusly:
> > Previously, the script could only relocate to the current location.
>
> I am not sure to understand what you mean...
>
> The SDK can already be relocated to any location:
>
>     $ cd /path/to/anywhere
>     $ tar xf /path/to/sdk.tar
>     $ ./relocate-sdk
>
> > This caused issues for SDK maintainers, as the default target location
> > (e.g. /opt/my-sdk) would need to be created and the content copied
> > to it during the build process, which is error-prone.
> >
> > With this change you can now pass a target location argument to
> > ./relocate-sdk.sh (this does not move the directory).
>
> I fail to see the purpose for that... If the SDK is not there, what is
> the point of relocating to a location where the SDK is not?
>
> Eventually, the user will have to either extract the SDK in the proper
> location, or move it there, so whether they are able to run the script
> prior to the move does not seem very interesting...
>
> So, I am far from convinced by this change... :-(
>
> Additionally, last time I had to touch on the SDK topic, I got seriously
> burnt, so I'd like that people that have a better grasp, the history, and
> some beliefs, in the SDK, look at that patch, please...
>
> Regards,
> Yann E. MORIN.
>
> > ---
> >  support/misc/relocate-sdk.sh | 19 ++++++++++++-------
> >  1 file changed, 12 insertions(+), 7 deletions(-)
> >
> > diff --git a/support/misc/relocate-sdk.sh b/support/misc/relocate-sdk.sh
> > index caabeaa6f6..981d272425 100755
> > --- a/support/misc/relocate-sdk.sh
> > +++ b/support/misc/relocate-sdk.sh
> > @@ -1,15 +1,20 @@
> >  #!/bin/sh
> > -#
> > -if [ "$#" -ne 0 ]; then
> > -    echo "Run this script to relocate the buildroot SDK at that
> location"
> > +
> > +if [ "$#" -gt 1 ]; then
> > +    echo "Usage: $0 [path]"
> > +    echo "Run this script to relocate the buildroot SDK to the current
> location"
> > +    echo "If [path] is given, sets the location to [path] (without
> moving it)"
> >      exit 1
> >  fi
> >
> > -LOCFILE="share/buildroot/sdk-location"
> > -FILEPATH="$(readlink -f "$0")"
> > -NEWPATH="$(dirname "${FILEPATH}")"
> > +cd "$(dirname "$(readlink -f "$0")")"
> > +if [ "$#" -eq 1 ]; then
> > +    NEWPATH="$1"
> > +else
> > +    NEWPATH="${PWD}"
> > +fi
> >
> > -cd "${NEWPATH}"
> > +LOCFILE="share/buildroot/sdk-location"
> >  if [ ! -r "${LOCFILE}" ]; then
> >      echo "Previous location of the buildroot SDK not found!"
> >      exit 1
> > --
> > 2.20.1
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot at busybox.net
> > http://lists.busybox.net/mailman/listinfo/buildroot
>
> --
>
> .-----------------.--------------------.------------------.--------------------.
> |  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics'
> conspiracy: |
> | +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___
>      |
> | +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is
> no  |
> | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v
>  conspiracy.  |
>
> '------------------------------^-------^------------------^--------------------'
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20210717/ecb3eb19/attachment-0001.html>

WARNING: multiple messages have this Message-ID (diff)
From: Gleb Mazovetskiy <glex.spb@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] relocate-sdk: Allow relocating to any location
Date: Sat, 17 Jul 2021 11:08:03 +0100	[thread overview]
Message-ID: <CADjhFRDi9hOA7u9xinmPSuoWvNhyZDBErbfpSwpOO4o+Gh3v4g@mail.gmail.com> (raw)
Message-ID: <20210717100803.rgLE2OAIz50YsfN--Ms_rixsfBnCKFcI6gyz6KphjJE@z> (raw)
In-Reply-To: <20210717093954.GJ12203@scaer>

 This fixes a minor frustrating issue. It addresses the following scenario:

1. I'm the SDK maintainer. I tell users to unpack to a specific directory.
E.g. /opt/mysdk.
2. I build the SDK in such a way that the users do not need to run
relocate-sdk.sh if they unpack to /opt/mysdk.

The problem is with step 2: currently it requires the build process to move
the SDK to /opt/mysdk, then run relocate-sdk.sh, before producing the final
tarball.
This is often problematic because on the SDK maintainer's machine,
`/opt/mysdk` usually already exists and contains the latest stable release.

With this new argument, the build process can be simplified for the SDK
maintainer.



On Sat, Jul 17, 2021 at 10:39 AM Yann E. MORIN <yann.morin.1998@free.fr>
wrote:

> Gleb, All,
>
> On 2020-03-28 23:49 +0000, Gleb Mazovetskiy spake thusly:
> > Previously, the script could only relocate to the current location.
>
> I am not sure to understand what you mean...
>
> The SDK can already be relocated to any location:
>
>     $ cd /path/to/anywhere
>     $ tar xf /path/to/sdk.tar
>     $ ./relocate-sdk
>
> > This caused issues for SDK maintainers, as the default target location
> > (e.g. /opt/my-sdk) would need to be created and the content copied
> > to it during the build process, which is error-prone.
> >
> > With this change you can now pass a target location argument to
> > ./relocate-sdk.sh (this does not move the directory).
>
> I fail to see the purpose for that... If the SDK is not there, what is
> the point of relocating to a location where the SDK is not?
>
> Eventually, the user will have to either extract the SDK in the proper
> location, or move it there, so whether they are able to run the script
> prior to the move does not seem very interesting...
>
> So, I am far from convinced by this change... :-(
>
> Additionally, last time I had to touch on the SDK topic, I got seriously
> burnt, so I'd like that people that have a better grasp, the history, and
> some beliefs, in the SDK, look at that patch, please...
>
> Regards,
> Yann E. MORIN.
>
> > ---
> >  support/misc/relocate-sdk.sh | 19 ++++++++++++-------
> >  1 file changed, 12 insertions(+), 7 deletions(-)
> >
> > diff --git a/support/misc/relocate-sdk.sh b/support/misc/relocate-sdk.sh
> > index caabeaa6f6..981d272425 100755
> > --- a/support/misc/relocate-sdk.sh
> > +++ b/support/misc/relocate-sdk.sh
> > @@ -1,15 +1,20 @@
> >  #!/bin/sh
> > -#
> > -if [ "$#" -ne 0 ]; then
> > -    echo "Run this script to relocate the buildroot SDK at that
> location"
> > +
> > +if [ "$#" -gt 1 ]; then
> > +    echo "Usage: $0 [path]"
> > +    echo "Run this script to relocate the buildroot SDK to the current
> location"
> > +    echo "If [path] is given, sets the location to [path] (without
> moving it)"
> >      exit 1
> >  fi
> >
> > -LOCFILE="share/buildroot/sdk-location"
> > -FILEPATH="$(readlink -f "$0")"
> > -NEWPATH="$(dirname "${FILEPATH}")"
> > +cd "$(dirname "$(readlink -f "$0")")"
> > +if [ "$#" -eq 1 ]; then
> > +    NEWPATH="$1"
> > +else
> > +    NEWPATH="${PWD}"
> > +fi
> >
> > -cd "${NEWPATH}"
> > +LOCFILE="share/buildroot/sdk-location"
> >  if [ ! -r "${LOCFILE}" ]; then
> >      echo "Previous location of the buildroot SDK not found!"
> >      exit 1
> > --
> > 2.20.1
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot at busybox.net
> > http://lists.busybox.net/mailman/listinfo/buildroot
>
> --
>
> .-----------------.--------------------.------------------.--------------------.
> |  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics'
> conspiracy: |
> | +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___
>      |
> | +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is
> no  |
> | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v
>  conspiracy.  |
>
> '------------------------------^-------^------------------^--------------------'
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20210717/ecb3eb19/attachment-0002.html>

  reply	other threads:[~2021-07-17 10:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-28 23:49 [Buildroot] [PATCH] relocate-sdk: Allow relocating to any location Gleb Mazovetskiy
2021-07-17  9:39 ` Yann E. MORIN
2021-07-17 10:08   ` Gleb Mazovetskiy [this message]
2021-07-17 10:08     ` Gleb Mazovetskiy
2021-07-17 10:26     ` Yann E. MORIN
2021-07-17 10:33       ` Gleb Mazovetskiy
2021-07-17 10:33         ` Gleb Mazovetskiy
2022-01-06 21:28 ` Arnout Vandecappelle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADjhFRDi9hOA7u9xinmPSuoWvNhyZDBErbfpSwpOO4o+Gh3v4g@mail.gmail.com \
    --to=glex.spb@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.