* Re: [9fans] pxeload nvram [not found] <<F199679A-1998-4100-BA44-AE7DBA583730@lsub.org> @ 2009-11-02 21:45 ` erik quanstrom 0 siblings, 0 replies; 6+ messages in thread From: erik quanstrom @ 2009-11-02 21:45 UTC (permalink / raw) To: 9fans On Mon Nov 2 15:34:25 EST 2009, nemo@lsub.org wrote: > iirc you could put nvram=/dev/sdU... > in plan9.ini. this patch, mentioned at iwp9, will also solve the problem without mangling plan9.ini: /n/sources/plan9//sys/src/libauthsrv/readnvram.c:25,46 - readnvram.c:25,32 int len; } nvtab[] = { "sparc", "#r/nvram", 1024+850, sizeof(Nvrsafe), - "pc", "#S/sdC0/nvram", 0, sizeof(Nvrsafe), - "pc", "#S/sdC0/9fat", -1, sizeof(Nvrsafe), - "pc", "#S/sdC1/nvram", 0, sizeof(Nvrsafe), - "pc", "#S/sdC1/9fat", -1, sizeof(Nvrsafe), - "pc", "#S/sdD0/nvram", 0, sizeof(Nvrsafe), - "pc", "#S/sdD0/9fat", -1, sizeof(Nvrsafe), - "pc", "#S/sdE0/nvram", 0, sizeof(Nvrsafe), - "pc", "#S/sdE0/9fat", -1, sizeof(Nvrsafe), - "pc", "#S/sdF0/nvram", 0, sizeof(Nvrsafe), - "pc", "#S/sdF0/9fat", -1, sizeof(Nvrsafe), - "pc", "#S/sd00/nvram", 0, sizeof(Nvrsafe), - "pc", "#S/sd00/9fat", -1, sizeof(Nvrsafe), - "pc", "#S/sd01/nvram", 0, sizeof(Nvrsafe), - "pc", "#S/sd01/9fat", -1, sizeof(Nvrsafe), - "pc", "#S/sd10/nvram", 0, sizeof(Nvrsafe), - "pc", "#S/sd10/9fat", -1, sizeof(Nvrsafe), + "pc", "#S/%s%x/9fat", -1, 512, + "pc", "#S/%s%x/nvram", 0, 512, "pc", "#f/fd0disk", -1, 512, /* 512: #f requires whole sector reads */ "pc", "#f/fd1disk", -1, 512, "mips", "#r/nvram", 1024+900, sizeof(Nvrsafe), /n/sources/plan9//sys/src/libauthsrv/readnvram.c:123,128 - readnvram.c:109,152 } } + static int + sdnvram0(char *s, int l, int tabi) + { + char *p, *f[3], buf[16]; + int fd, i; + + s[l] = 0; + for(; p = strchr(s, '\n'); s = p + 1){ + if(tokenize(s, f, nelem(f)) < 1) + continue; + for(i = 0; i < 0x10; i++){ + snprint(buf, sizeof buf, nvtab[tabi].file, f[0], i); + if((fd = open(buf, ORDWR)) >= 0) + return fd; + } + } + return -1; + } + + static int + sdnvram(int tabi) + { + char *s; + int fd, l, r; + + fd = open("#S/sdctl", OREAD); + if(fd == -1) + return -1; + r = -1; + l = 1024; /* #S/sdctl has 0 size; guess */ + if(s = malloc(l + 1)) + if((l = read(fd, s, l)) > 0) + r = sdnvram0(s, l, tabi); + free(s); + close(fd); + return r; + } + typedef struct { int fd; int safeoff; /n/sources/plan9//sys/src/libauthsrv/readnvram.c:185,191 - readnvram.c:209,219 for(i=0; i<nelem(nvtab); i++){ if(strcmp(cputype, nvtab[i].cputype) != 0) continue; - if((fd = open(nvtab[i].file, ORDWR)) < 0) + if(nvtab[i].file[0] == '#' && nvtab[i].file[1] == 'S') + fd = sdnvram(i); + else + fd = open(nvtab[i].file, ORDWR); + if(fd < 0) continue; safeoff = nvtab[i].off; safelen = nvtab[i].len; ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [9fans] pxeload nvram
@ 2009-11-02 20:32 Francisco J Ballesteros
0 siblings, 0 replies; 6+ messages in thread
From: Francisco J Ballesteros @ 2009-11-02 20:32 UTC (permalink / raw)
To: 9fans
iirc you could put nvram=/dev/sdU...
in plan9.ini.
On 02/11/2009, at 20:52, 9nut@9netics.com wrote:
>> iirc it's ok to put the nvram in a
>> USB disk dongle.
>
> how is it specified? i can't find any references.
>
>
> [/mail/box/nemo/msgs/200911/113]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [9fans] pxeload nvram
@ 2009-11-02 18:29 Francisco J Ballesteros
2009-11-02 19:51 ` Skip Tavakkolian
0 siblings, 1 reply; 6+ messages in thread
From: Francisco J Ballesteros @ 2009-11-02 18:29 UTC (permalink / raw)
To: 9fans
iirc it's ok to put the nvram in a
USB disk dongle.
On 02/11/2009, at 18:59, 9nut@9netics.com wrote:
> i need to pxeboot several cpus -- remote sensors -- with only usb
> storage. here's an old thread for the same thing. is there a
> solution?
>
> http://groups.google.com/group/comp.os.plan9/browse_thread/thread/db9236f5f8f740bd/66707c18718f8e7c?lnk=gst&q=pxe+boot+nvram+usb#66707c18718f8e7c
>
>
> [/mail/box/nemo/msgs/200911/100]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [9fans] pxeload nvram 2009-11-02 18:29 Francisco J Ballesteros @ 2009-11-02 19:51 ` Skip Tavakkolian 0 siblings, 0 replies; 6+ messages in thread From: Skip Tavakkolian @ 2009-11-02 19:51 UTC (permalink / raw) To: 9fans > iirc it's ok to put the nvram in a > USB disk dongle. how is it specified? i can't find any references. ^ permalink raw reply [flat|nested] 6+ messages in thread
* [9fans] pxeload nvram @ 2009-11-02 17:58 Skip Tavakkolian 2009-11-02 18:18 ` erik quanstrom 0 siblings, 1 reply; 6+ messages in thread From: Skip Tavakkolian @ 2009-11-02 17:58 UTC (permalink / raw) To: 9fans i need to pxeboot several cpus -- remote sensors -- with only usb storage. here's an old thread for the same thing. is there a solution? http://groups.google.com/group/comp.os.plan9/browse_thread/thread/db9236f5f8f740bd/66707c18718f8e7c?lnk=gst&q=pxe+boot+nvram+usb#66707c18718f8e7c ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [9fans] pxeload nvram 2009-11-02 17:58 Skip Tavakkolian @ 2009-11-02 18:18 ` erik quanstrom 0 siblings, 0 replies; 6+ messages in thread From: erik quanstrom @ 2009-11-02 18:18 UTC (permalink / raw) To: 9fans On Mon Nov 2 13:08:47 EST 2009, 9nut@9netics.com wrote: > i need to pxeboot several cpus -- remote sensors -- with only usb > storage. here's an old thread for the same thing. is there a > solution? > aoe storage? - erik ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-11-02 21:45 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <<F199679A-1998-4100-BA44-AE7DBA583730@lsub.org> 2009-11-02 21:45 ` [9fans] pxeload nvram erik quanstrom 2009-11-02 20:32 Francisco J Ballesteros -- strict thread matches above, loose matches on Subject: below -- 2009-11-02 18:29 Francisco J Ballesteros 2009-11-02 19:51 ` Skip Tavakkolian 2009-11-02 17:58 Skip Tavakkolian 2009-11-02 18:18 ` erik quanstrom
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).