From: Harald Hoyer <harald-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Pawel Krzesniak
<pawel.krzesniak-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: ls to stat patch
Date: Thu, 26 Nov 2009 19:15:01 +0100 [thread overview]
Message-ID: <4B0EC5A5.8050305@redhat.com> (raw)
In-Reply-To: <loom.20091123T144413-833-eS7Uydv5nfjZ+VzJOa5vwg@public.gmane.org>
On 11/23/2009 03:44 PM, Pawel Krzesniak wrote:
> Victor Lowther<victor.lowther@...> writes:
>
>> On Sep 3, 2009, at 1:33 AM, Joe Pelkey<pelkeyj@...> wrote:
>>
>>> Hi,
>>> I was randomly looking through the git repository and came across
>>> modules.d/95resume/resume.sh and its comment about not liking the
>>> use of
>>> ls. I modified it to use stat instead, and since stat has been in
>>> coreutils since at least late 2005, I assume it's safe to use.
>>
>> <snip patch>
>>
>> We had a patch that did that initally, but dropped it because it adds
>> another binary to the initramfs.
>
> What else depends on 'ls'?
> I can see 'ls' is used only in modules.d/95nfs/install which is invoked during
> creating initramfs image only. Am I wrong?
>
> btw: Joe's patch has bug, because stat returns major and minor in hex and we
> need decimal values. We can use printf (which is part of dash) to convert values.
>
> my version:
>
> Subject: [PATCH] use stat binary instead of ls
>
> Signed-off-by: Pawel Krzesniak<pawel.krzesniak-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
> modules.d/95resume/install | 1 +
> modules.d/95resume/resume.sh | 7 +++----
> modules.d/99base/install | 2 +-
> 3 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/modules.d/95resume/install b/modules.d/95resume/install
Hmm, having "ls" in the rescue shell is better than "stat"
prev parent reply other threads:[~2009-11-26 18:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-03 6:33 ls to stat patch Joe Pelkey
[not found] ` <4A9F6345.4050003-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-09-03 15:14 ` Victor Lowther
2009-11-23 14:44 ` Pawel Krzesniak
[not found] ` <loom.20091123T144413-833-eS7Uydv5nfjZ+VzJOa5vwg@public.gmane.org>
2009-11-26 18:15 ` Harald Hoyer [this message]
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=4B0EC5A5.8050305@redhat.com \
--to=harald-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=pawel.krzesniak-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox