From: Ulf Samuelsson <ulf.samuelsson@atmel.com>
To: buildroot@busybox.net
Subject: [Buildroot] What's up with the kernel names? (Again)
Date: Wed, 11 Feb 2009 21:03:31 +0100 [thread overview]
Message-ID: <1234382611.22044.8.camel@elrond.atmel.com> (raw)
In-Reply-To: <d6cda7730902101048w1706b7e9j41d8702d50766756@mail.gmail.com>
tis 2009-02-10 klockan 16:48 -0200 skrev Thiago A. Corr?a:
> Hi,
>
> On Tue, Feb 10, 2009 at 3:42 PM, Ulf Samuelsson
> <ulf.samuelsson@atmel.com> wrote:
> > No you have totally misunderstood.
> > U-Boot will, with my patch use an initial default, but you can
> > update the linux kernel version and then automatically generate the kernel
> > name for tftp download without recompiling u-boot.
> >
> > That is why you have the os command.
> >
> > A better implementation would automatically
> > recompute the linux kernel name when any
> > part of it is changed.
> >
>
> But you never update kernel-date env variable. That way it can't guess
> what to concatenate in there, or it will always generate the same
> name.
The user can do thinks like:
setenv kernel-date 20090123 ; os
setenv kernel-version 2.6.28.1; os
to tell u-boot that a new version is to be used.
--------------------------
Just for fun, I checked my OpenSuSE /boot directory
Guess what I found:
"vmlinuz" which happens to be a LINK to
??vmlinuz-$(KERNEL_VERSION)-$(REV)-$PROJECT)
?
There was also a:
vmlinux-$(KERNEL_VERSION)-$(REV)-$PROJECT).gz file
Looks like the guys doing OpenSuSE are as "odd" as I am.
Would be interesting to know how the /boot directory
in Fedora, Ubuntu etc look like.
BR
Ulf Samuelsson
>
> One possible way could be:
> +int do_os (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
> +{
> + char kname[512];
> + char *curname;
> + char *kdate;
> + int datepos;
> + curname = getenv("linux");
> + kdate = getenv("kernel-date");
> + datepos = strstr(curname, kdate);
> + if (datepos) {
> + //Replace the hardcoded date
> + curname[datepos] = 0;
> + sprintf(kname, "%s%s%s", curname, date??, curname +
> datepos + strlen(kdate));
> + } else {
> + strcpy(kname, "uImage");
> + }
> + setenv("linux", kname);
> + return 0;
> +}
>
> This searches the kernel-date inside the name, therefore it can be
> anywhere, and updates it. But as you can see from date??? I have no
> idea where the new value comes from.
> If it comes from some script or program, it could be modified so that
> it stores the older date in kernel-olddate variable, then you searcho
> for it and replace with the new date:
>
> +int do_os (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
> +{
> + char kname[512];
> + char *curname;
> + char *kdate;
> + int datepos;
> + curname = getenv("linux");
> + kdate = getenv("kernel-olddate");
> + datepos = strstr(curname, kdate);
> + if (datepos) {
> + //Replace the hardcoded date
> + curname[datepos] = 0;
> + sprintf(kname, "%s%s%s", curname,
> getenv("kernel-date"), curname + datepos + strlen(kdate));
> + } else {
> + strcpy(kname, "uImage");
> + }
> + setenv("linux", kname);
> + return 0;
> +}
>
>
> Regards,
> Thiago A. Correa
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
next prev parent reply other threads:[~2009-02-11 20:03 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-04 1:49 [Buildroot] What's up with the kernel names? (Again) Thiago A. Corrêa
2009-02-04 7:39 ` Peter Korsgaard
2009-02-04 12:29 ` Peter Korsgaard
2009-02-05 2:33 ` Thiago A. Corrêa
2009-02-05 13:23 ` Peter Korsgaard
2009-02-05 20:37 ` Ulf Samuelsson
2009-02-06 2:28 ` Thiago A. Corrêa
2009-02-06 6:16 ` Ulf Samuelsson
2009-02-06 8:49 ` Peter Korsgaard
2009-02-06 9:06 ` Ulf Samuelsson
2009-02-06 12:30 ` Peter Korsgaard
2009-02-06 8:45 ` Peter Korsgaard
2009-02-06 8:58 ` Ulf Samuelsson
2009-02-06 8:44 ` Peter Korsgaard
2009-02-05 20:23 ` Ulf Samuelsson
2009-02-06 8:41 ` Peter Korsgaard
2009-02-06 8:56 ` Ulf Samuelsson
2009-02-06 12:27 ` Peter Korsgaard
2009-02-06 14:31 ` Thiago A. Corrêa
2009-02-06 15:18 ` Thiago A. Corrêa
2009-02-09 17:24 ` Ulf Samuelsson
2009-02-09 19:34 ` Peter Korsgaard
2009-02-09 22:52 ` Ulf Samuelsson
2009-02-10 1:25 ` Thiago A. Corrêa
2009-02-10 8:02 ` Ulf Samuelsson
2009-02-10 9:28 ` Peter Korsgaard
2009-02-10 10:32 ` Ulf Samuelsson
2009-02-10 9:17 ` Peter Korsgaard
2009-02-10 10:16 ` Ulf Samuelsson
2009-02-10 12:51 ` Peter Korsgaard
2009-02-10 13:50 ` Ulf Samuelsson
2009-02-10 16:34 ` Thiago A. Corrêa
2009-02-10 17:17 ` Thiago A. Corrêa
2009-02-10 17:42 ` Ulf Samuelsson
2009-02-10 18:48 ` Thiago A. Corrêa
2009-02-11 20:03 ` Ulf Samuelsson [this message]
2009-02-11 20:15 ` Peter Korsgaard
2009-02-12 18:16 ` Ulf Samuelsson
2009-02-16 22:21 ` Thiago A. Corrêa
2009-02-17 11:26 ` Peter Korsgaard
2009-02-10 18:26 ` Ulf Samuelsson
2009-02-10 18:50 ` Ulf Samuelsson
2009-02-10 20:06 ` Thiago A. Corrêa
2009-02-10 18:59 ` Ulf Samuelsson
2009-02-10 19:49 ` Ulf Samuelsson
2009-02-10 20:06 ` Peter Korsgaard
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=1234382611.22044.8.camel@elrond.atmel.com \
--to=ulf.samuelsson@atmel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox