diff mbox series

[RFC,2/5] gen_initramfs.sh: use absolute path for gen_init_cpio

Message ID 20210818154646.925351-3-efremov@linux.com (mailing list archive)
State New
Headers show
Series selftests: floppy: basic tests | expand

Commit Message

Denis Efremov (Oracle) Aug. 18, 2021, 3:46 p.m. UTC
Use absolute path to call gen_init_cpio. This allows one
to use gen_initramfs.sh from any directory.

Cc: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Denis Efremov <efremov@linux.com>
---
 usr/gen_initramfs.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Masahiro Yamada Aug. 19, 2021, 12:24 a.m. UTC | #1
On Thu, Aug 19, 2021 at 12:47 AM Denis Efremov <efremov@linux.com> wrote:
>
> Use absolute path to call gen_init_cpio. This allows one
> to use gen_initramfs.sh from any directory.

I do not mind this, but $(dirname "$0")
is not necessarily an absolute path, is it?


I added test code:

   echo dirname is $(dirname $0)

in this script, and I saw

   dirname is usr




>
> Cc: Masahiro Yamada <masahiroy@kernel.org>
> Signed-off-by: Denis Efremov <efremov@linux.com>
> ---
>  usr/gen_initramfs.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/usr/gen_initramfs.sh b/usr/gen_initramfs.sh
> index 63476bb70b41..2e4a86181c79 100755
> --- a/usr/gen_initramfs.sh
> +++ b/usr/gen_initramfs.sh
> @@ -244,4 +244,4 @@ if test -n "$KBUILD_BUILD_TIMESTAMP"; then
>                 timestamp="-t $timestamp"
>         fi
>  fi
> -usr/gen_init_cpio $timestamp $cpio_list > $output
> +"$(dirname "$0")"/gen_init_cpio $timestamp $cpio_list > $output
> --
> 2.31.1
>


--
Best Regards
Masahiro Yamada
Denis Efremov (Oracle) Aug. 19, 2021, 8:51 p.m. UTC | #2
On 8/19/21 3:24 AM, Masahiro Yamada wrote:
> On Thu, Aug 19, 2021 at 12:47 AM Denis Efremov <efremov@linux.com> wrote:
>>
>> Use absolute path to call gen_init_cpio. This allows one
>> to use gen_initramfs.sh from any directory.
> 
> I do not mind this, but $(dirname "$0")
> is not necessarily an absolute path, is it?
> 
> 
> I added test code:
> 
>    echo dirname is $(dirname $0)
> 
> in this script, and I saw
> 
>    dirname is usr

Oh, sorry, commit message is wrong. Would that be ok for you if I will change
it in v2 to something like:

Prepend gen_init_cpio call with the same path as gen_initramfs.sh called. This
allows one to use gen_initramfs.sh from any directory, not only from the
kernel's topdir.

> 
> 
> 
> 
>>
>> Cc: Masahiro Yamada <masahiroy@kernel.org>
>> Signed-off-by: Denis Efremov <efremov@linux.com>
>> ---
>>  usr/gen_initramfs.sh | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/usr/gen_initramfs.sh b/usr/gen_initramfs.sh
>> index 63476bb70b41..2e4a86181c79 100755
>> --- a/usr/gen_initramfs.sh
>> +++ b/usr/gen_initramfs.sh
>> @@ -244,4 +244,4 @@ if test -n "$KBUILD_BUILD_TIMESTAMP"; then
>>                 timestamp="-t $timestamp"
>>         fi
>>  fi
>> -usr/gen_init_cpio $timestamp $cpio_list > $output
>> +"$(dirname "$0")"/gen_init_cpio $timestamp $cpio_list > $output
>> --
>> 2.31.1
>>
> 
> 
> --
> Best Regards
> Masahiro Yamada
>
Masahiro Yamada Aug. 20, 2021, 2:19 a.m. UTC | #3
On Fri, Aug 20, 2021 at 5:51 AM Denis Efremov <efremov@linux.com> wrote:
>
>
>
> On 8/19/21 3:24 AM, Masahiro Yamada wrote:
> > On Thu, Aug 19, 2021 at 12:47 AM Denis Efremov <efremov@linux.com> wrote:
> >>
> >> Use absolute path to call gen_init_cpio. This allows one
> >> to use gen_initramfs.sh from any directory.
> >
> > I do not mind this, but $(dirname "$0")
> > is not necessarily an absolute path, is it?
> >
> >
> > I added test code:
> >
> >    echo dirname is $(dirname $0)
> >
> > in this script, and I saw
> >
> >    dirname is usr
>
> Oh, sorry, commit message is wrong. Would that be ok for you if I will change
> it in v2 to something like:
>
> Prepend gen_init_cpio call with the same path as gen_initramfs.sh called. This
> allows one to use gen_initramfs.sh from any directory, not only from the
> kernel's topdir.


I am fine with it.

This patch is prefixed with 2/5, so I assume
you expect another person to pick up
the entire series.

With the commit message updated,

Reviewed-by: Masahiro Yamada <masahiroy@kernel.org>





> >
> >
> >
> >
> >>
> >> Cc: Masahiro Yamada <masahiroy@kernel.org>
> >> Signed-off-by: Denis Efremov <efremov@linux.com>
> >> ---
> >>  usr/gen_initramfs.sh | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/usr/gen_initramfs.sh b/usr/gen_initramfs.sh
> >> index 63476bb70b41..2e4a86181c79 100755
> >> --- a/usr/gen_initramfs.sh
> >> +++ b/usr/gen_initramfs.sh
> >> @@ -244,4 +244,4 @@ if test -n "$KBUILD_BUILD_TIMESTAMP"; then
> >>                 timestamp="-t $timestamp"
> >>         fi
> >>  fi
> >> -usr/gen_init_cpio $timestamp $cpio_list > $output
> >> +"$(dirname "$0")"/gen_init_cpio $timestamp $cpio_list > $output
> >> --
> >> 2.31.1
> >>
> >
> >
> > --
> > Best Regards
> > Masahiro Yamada
> >
diff mbox series

Patch

diff --git a/usr/gen_initramfs.sh b/usr/gen_initramfs.sh
index 63476bb70b41..2e4a86181c79 100755
--- a/usr/gen_initramfs.sh
+++ b/usr/gen_initramfs.sh
@@ -244,4 +244,4 @@  if test -n "$KBUILD_BUILD_TIMESTAMP"; then
 		timestamp="-t $timestamp"
 	fi
 fi
-usr/gen_init_cpio $timestamp $cpio_list > $output
+"$(dirname "$0")"/gen_init_cpio $timestamp $cpio_list > $output