From: Daniel Smolik <marvin@mydatex.cz>
To: sparclinux@vger.kernel.org
Subject: Re: TILO and others
Date: Wed, 06 Sep 2006 14:11:44 +0000 [thread overview]
Message-ID: <44FED720.6090005@mydatex.cz> (raw)
In-Reply-To: <44FC960D.3040508@mydatex.cz>
[-- Attachment #1: Type: text/plain, Size: 546 bytes --]
Hamish Greig napsal(a):
> On Tuesday 05 September 2006 17:45, Rene Rebe wrote:
>
>>I used elftoaout + the piggyback helper in arch/sparc64.
>
>
> I too have successfully used these two for netbooting.
> hgg
Thanks, you kick me to rigt way. I use piggyback from sparc directory. I test
before piggiback64 but that says nothing and I think that doesn't work.
But now I read source make simple patch to display status of working piggyback
and woala all works piggyback64 doesn't write new file but modify kenel directly.
Thanks
Dan
[-- Attachment #2: piggyback.patch --]
[-- Type: text/x-patch, Size: 1289 bytes --]
--- linux-2.6.18-rc3/arch/sparc64/boot/piggyback.c 2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.17.2/arch/sparc64/boot/piggyback.c 2006-09-05 19:59:37.000000000 +0200
@@ -45,6 +45,7 @@
FILE *map;
struct stat s;
int image, tail;
+
if (stat (argv[3], &s) < 0) die (argv[3]);
map = fopen (argv[2], "r");
@@ -55,6 +56,7 @@
else if (!strcmp (buffer + 19, "_end\n"))
end = strtoul (buffer + 8, NULL, 16);
}
+ printf("start: 0x%x end: 0x%x \n",start,end);
fclose (map);
if ((image = open(argv[1],O_RDWR)) < 0) die(argv[1]);
if (read(image,buffer,512) != 512) die(argv[1]);
@@ -88,6 +90,7 @@
}
offset = i + (q - buffer) + 10;
}
+
if (lseek(image, offset, 0) < 0) die ("lseek");
*(unsigned *)buffer = 0;
*(unsigned *)(buffer + 4) = 0x01000000;
@@ -101,8 +104,15 @@
if (write(image,buffer,12) != 12) die (argv[1]);
if (lseek(image, k - start + ((end + 32 + 8191) & ~8191), 0) < 0) die ("lseek");
if ((tail = open(argv[3],O_RDONLY)) < 0) die(argv[3]);
+ printf("Writing ...");
while ((i = read (tail,buffer,1024)) > 0)
+ {
if (write(image,buffer,i) != i) die (argv[1]);
+ printf(".");
+
+ }
+ printf(".done\n");
+ printf("%s updated \n",argv[1]);
if (close(image) < 0) die("close");
if (close(tail) < 0) die("close");
return 0;
next prev parent reply other threads:[~2006-09-06 14:11 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-04 21:09 TILO and others Daniel Smolik
2006-09-05 7:45 ` Rene Rebe
2006-09-05 11:22 ` Hamish Greig
2006-09-05 14:26 ` Daniel Smolik
2006-09-06 14:11 ` Daniel Smolik [this message]
2006-09-07 1:39 ` Hamish Greig
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=44FED720.6090005@mydatex.cz \
--to=marvin@mydatex.cz \
--cc=sparclinux@vger.kernel.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 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.