From: "Martin Schlemmer [c]" <azarah@nosferatu.za.org>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: Andrew Morton <akpm@osdl.org>,
torvalds@osdl.org,
Linux Kernel Mailing Lists <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2.6.9-bk7] Select cpio_list or source directory for initramfs image updates [u]
Date: Sun, 31 Oct 2004 12:36:40 +0200 [thread overview]
Message-ID: <1099219000.11924.9.camel@nosferatu.lan> (raw)
In-Reply-To: <20041030234318.GI9592@mars.ravnborg.org>
[-- Attachment #1.1: Type: text/plain, Size: 1196 bytes --]
On Sun, 2004-10-31 at 01:43 +0200, Sam Ravnborg wrote:
> On Wed, Oct 27, 2004 at 08:44:05PM +0200, Martin Schlemmer [c] wrote:
> > >
> >
> > How about below? Works as expected. I am open to suggestions short of
> > coding a util to print numeric mtimes besides find, but for the life of
> > me could not think of another way ...
>
> Looks good.
> Please send me a version that is not whitespace damaged and with a
> proper changelog.
> The changelog shall be descriptive in itself without relying on context
> from privious patch or comments in a mail.
>
Unfortunately evolution 2.0 seems to have some issues, and the
whitespace damage is one of them. Anyhow, here is the patch attached,
with a changelog. Hope that is OK.
----
Add a comment to gen_initramfs_list.sh output that contains the
numeric mtime of the last modified file in the source directory,
or the mtime of the source list. This should cause the initramfs
image to be rebuild if a file in the source directory changed, or
the source list (if that was used rather than a directory as source).
Signed-off-by: Martin Schlemmer <azarah@nosferatu.za.org>
--
Martin Schlemmer
[-- Attachment #1.2: initramfs_list-regen-on-mtime-v1.patch --]
[-- Type: text/x-patch, Size: 1210 bytes --]
diff -uprN -X dontdiff linux-2.6.9.orig/scripts/gen_initramfs_list.sh linux-2.6.9/scripts/gen_initramfs_list.sh
--- linux-2.6.9.orig/scripts/gen_initramfs_list.sh 2004-10-27 20:06:47.043999448 +0200
+++ linux-2.6.9/scripts/gen_initramfs_list.sh 2004-10-27 20:34:39.121804984 +0200
@@ -37,6 +37,18 @@ filetype() {
return 0
}
+print_mtime() {
+ local argv1="$1"
+ local my_mtime="0"
+
+ if [ -e "${argv1}" ]; then
+ my_mtime=$(find "${argv1}" -printf "%T@\n" | sort -r | head -n 1)
+ fi
+
+ echo "# Last modified: ${my_mtime}"
+ echo
+}
+
parse() {
local location="$1"
local name="${location/${srcdir}//}"
@@ -77,16 +89,19 @@ parse() {
return 0
}
-if [ -z $1 ]; then
+if [ -z "$1" ]; then
simple_initramfs
-elif [ -f $1 ]; then
- cat $1
-elif [ -d $1 ]; then
+elif [ -f "$1" ]; then
+ print_mtime "$1"
+ cat "$1"
+elif [ -d "$1" ]; then
srcdir=$(echo "$1" | sed -e 's://*:/:g')
dirlist=$(find "${srcdir}" -printf "%p %m %U %G\n" 2>/dev/null)
# If $dirlist is only one line, then the directory is empty
if [ "$(echo "${dirlist}" | wc -l)" -gt 1 ]; then
+ print_mtime "$1"
+
echo "${dirlist}" | \
while read x; do
parse ${x}
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
prev parent reply other threads:[~2004-10-31 11:35 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200410200849.i9K8n5921516@mail.osdl.org>
2004-10-23 12:06 ` Martin Schlemmer [c]
2004-10-24 10:08 ` Andrew Morton
2004-10-24 13:59 ` Martin Schlemmer [c]
2004-10-24 22:26 ` Sam Ravnborg
2004-10-26 22:12 ` Sam Ravnborg
2004-10-26 21:07 ` Martin Schlemmer [c]
2004-10-26 23:15 ` Sam Ravnborg
2004-10-26 21:36 ` Martin Schlemmer [c]
2004-10-27 4:09 ` Dave Airlie
2004-10-27 6:21 ` Sam Ravnborg
2004-10-27 4:55 ` timestamps in kernel was " Dave Airlie
2004-10-27 18:44 ` Martin Schlemmer [c]
2004-10-30 23:43 ` Sam Ravnborg
2004-10-31 10:36 ` Martin Schlemmer [c] [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=1099219000.11924.9.camel@nosferatu.lan \
--to=azarah@nosferatu.za.org \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sam@ravnborg.org \
--cc=torvalds@osdl.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
Powered by JetHome