Vasant Kanchan | 15 May 2003 04:56
Picon
Favicon

Root file system on Flash mounted R/O

Hi,

I have a minimal file system  currently on a ZIP disk which I can boot 
 from.
I would like to move this to a CF card which I would prefer to mount 
read only.
Unfortunately there are writes to /tmp /var and /root done by the apps.
One possiblity to mout ramdisks at /tmp, /var /root.
Another possibilty is to union mount the ramdisk on top of  root .
I couldn't  get this to work.
Any suggestions to handle this.
Thanks for your answers.

Kanchan

Ignatios Souvatzis | 15 May 2003 10:26
Picon
Favicon

Re: Root file system on Flash mounted R/O

Hi,

On Wed, May 14, 2003 at 07:56:01PM -0700, Vasant Kanchan wrote:

> I have a minimal file system  currently on a ZIP disk which I can boot 
> from. I would like to move this to a CF card which I would prefer to mount 
> read only.

Look at this:

http://eurobsdcon.org/papers/souvatzis.pdf

which is what I did for a not completely different task.
> Unfortunately there are writes to /tmp /var and /root done by the apps.
> One possiblity to mout ramdisks at /tmp, /var /root.
> Another possibilty is to union mount the ramdisk on top of  root .

Ahem - I guess your device nodes(in /dev) are inaccessible. Remove them,
and run MAKEDEV after the mfs / is mounted over /root.

Regards,
	-is
David Bonnafous | 21 May 2003 00:47

cross-debugging with gdb

hi,

I'd like to know how to build gdb (from pkgsrc) for cross debugging ?

(target: sparc, host: i386)

thank you.

Allen Briggs | 21 May 2003 04:44

Re: cross-debugging with gdb

On Wed, May 21, 2003 at 12:47:43AM +0200, David Bonnafous wrote:
> I'd like to know how to build gdb (from pkgsrc) for cross debugging ?
> 
> (target: sparc, host: i386)

I'm not sure about pkgsrc, but when you're building the tools under
NetBSD, you can set "MKCROSSGDB=yes" and that should do it for you.

-allen

--

-- 
 Allen Briggs                     briggs <at> wasabisystems.com
 Wasabi Systems, Inc.             http://www.wasabisystems.com/

roberto | 21 May 2003 15:14
Picon

Help with memory disk

All I want do to is to install netbsd on flash memory and mount root and
other fs as read only; only fs like /var, /dev or /tmp should be writable
and I need to create ramdisk in memory for those devices (it is a bad
things to write on flash for tmp files or logs).

And I do not have any swap partition on disk to use the command mount_mfs.
So I need pure ramdisk.

I'm using netbsd 1.6 GENERIC.

As suggested in netbsd-help mailing list, I'm using md and mdconfig:

1) I've 2 device in /dev:
md0a b 17, 0
md0d b 17, 3

(a first question: what is the means of these device?)

2) to create a 8 MB of ramdisk I run: "mdconfig /dev/md0a 9192 & "

3) but before I can mount it I should create a file system with newfs; is
it correct?
Any attempt failed: "newfs md0" says "rmd0d no such file or dir.". So I
uncommented "rmd*" in MAKEDEV and ran "MAKEDEV md0" and it created rmd0a c
24,0 and rmd0d c 24,3; rerun the command "newfs md0" says "ioctl (GDINFO)
invalid argument md0d: can't read disk label; disk type must be
specified";
it is sound to me as I must create a disklabel or define a disk in
/etc/disktab.
Can anyone help me?
(Continue reading)

Brian Rose | 21 May 2003 18:41

Re: Help with memory disk

Is the makefs command useful?

I had a similiar issue when creating a ramdisk image to be embedded into a kernel. I tried making an image with
newfs and had similiar difficulties with the disklabel. Someone tipped me off about makefs and that
solved my problem.

If you want some more details, I have it on my website (sorry for the long URL).
http://www.brianrose.net/family/fetch.php?dir=/Brian/NetBSD/Embedded&filename=single.html

roberto <at> redix.it wrote:
> All I want do to is to install netbsd on flash memory and mount root and
> other fs as read only; only fs like /var, /dev or /tmp should be writable
> and I need to create ramdisk in memory for those devices (it is a bad
> things to write on flash for tmp files or logs).
> 
> And I do not have any swap partition on disk to use the command mount_mfs.
> So I need pure ramdisk.
> 
> I'm using netbsd 1.6 GENERIC.
> 
> As suggested in netbsd-help mailing list, I'm using md and mdconfig:
> 
> 1) I've 2 device in /dev:
> md0a b 17, 0
> md0d b 17, 3
> 
> (a first question: what is the means of these device?)
> 
> 2) to create a 8 MB of ramdisk I run: "mdconfig /dev/md0a 9192 & "
> 
(Continue reading)

John Gordon | 29 May 2003 10:51

Remote debugging patch for NetBSD/PowerPC

Hello all,

I have just finished adding support for PowerPC to the gdbserver code in 
  NetBSD. While I was changing the code I also added support for the new 
SA based threading (based on the code in the native debugger for 
supporting threads).

More information, including the patch and the one new file that is 
needed, can be found at: 
http://www.bluedonkey.org/cgi-bin/twiki/bin/view/Netbsd/RemoteDebugging

I have done only very limited testing of the change so far, but it has 
allowed me to set breakpoints in threads, and to obtain information 
about the states of the various threads. If anybody finds something that 
doesn't work, please either let me know directly, or post the 
information on the TWiki site (there is a page for feedback about this 
work). If you can include an example that would be helpful too ;-)

Rgds,
John...

roberto | 29 May 2003 14:24
Picon

Re: Help with memory disk


Hi Gan,
First,  I've submitted some mail on netbsd-help mailing list, and someone 
on it redirect me to tech-embedded.

Ok I've already red about mount_mfs() and it works as you described.

But I cannot use mount_mfs() simply becouse I do not have any swap (or 
other writable) partition on disk. So I 'm try to use md.

Actually I want to use flash memory as hard disk, and mount it as read only 
root disk; the memory disk, mounted read-write, will be used for /var, 
/dev/ and /tmp.

Thanks for your answer,
Roberto

--On Monday, May 26, 2003 00:27:32 -0400 Gan Uesli Starling 
<alias <at> starling.us> wrote:

> roberto <at> redix.it wrote:
>> I'd like to setup a ramdisk (on netbsd 1.6 GENERIC) for temporary files,
>> without any file image and real disk device (eg. swap partition, so I
>> prefer to not use mount_mfs).
>>
>> As suggested I'm using md and mdconfig:
>>
>> 1) I've 2 device in /dev:
>> md0a b 17, 0
>> md0d b 17, 3
(Continue reading)

Frederick Bruckman | 29 May 2003 15:25

Re: Help with memory disk

On Thu, 29 May 2003 roberto <at> redix.it wrote:

> But I cannot use mount_mfs() simply becouse I do not have any swap (or
> other writable) partition on disk. So I 'm try to use md.
>
> Actually I want to use flash memory as hard disk, and mount it as read only
> root disk; the memory disk, mounted read-write, will be used for /var,
> /dev/ and /tmp.

I think you'll need something in "/dev" before you mount anything at
all, but no doubt you can arrange for that, and still mount over it.

> --On Monday, May 26, 2003 00:27:32 -0400 Gan Uesli Starling
> <alias <at> starling.us> wrote:> >>

> > I did not see where anybody answered your question.

> >> 2) to create a 8 MB of ramdisk I run: "mdconfig /dev/md0a 9192 & "
> >>
> >> 3) before I can mount it I should create a file system with newfs; is it
> >> correct?

The answer given was to use "makefs" to build a skeletal file system
(as a file, which might then, say, be compressed with "gzip"), then to
use "dd" to get it into "md0". E.g:

	mkdir mdroot mdroot/var mdroot/tmp mdroot/dev
	makefs mdroot.fs mdroot
	gzip -9 mdroot.fs
	mdconfig /dev/md0d 8192 &
(Continue reading)

der Mouse | 30 May 2003 21:18
Picon

Re: Help with memory disk

> But I cannot use mount_mfs() simply becouse I do not have any swap
> (or other writable) partition on disk.  So I'm try to use md.

Not having any swap does not, in itself, prevent you from using mfs.
No swap means your total memory consumption - including mfs "disk" -
cannot exceed your real RAM, but that's all.  I've used mfs on swapless
systems often enough myself.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse <at> rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Gmane