public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* Re: Anyone embedding RH 6.1 / 2.2.12 ?
       [not found] <9182AA6C8DACD311A8D70006294EF76808D3C1@exchange-yvr.squirrelsystems.com>
@ 1999-12-08 22:08 ` ralph stickley
  1999-12-13 15:01   ` Adi Linden
  0 siblings, 1 reply; 8+ messages in thread
From: ralph stickley @ 1999-12-08 22:08 UTC (permalink / raw)
  To: Tkatchouk, Pavel; +Cc: 'linux-embedded@waste.org', MTD, Oron Ogdan

Yeah! M-Systems updated their linux drivers - seems like they
only changed their patch file for V2.2.0...

Boo ! - they still don't have a file listing for V2.2.0 :-(

>I was wondering if anyone has sucessfully "embedded" the 2.2.12 kernel
>from the RedHat 6.1 distro...
>2.0.36 worked fine but I am required to do an upgrade and there seems to
>be quite a few differences.

>I am looking for a list of files that will allow the system to boot
>(from M-Systems DOC) and run Fvwm2 (or similiar).   Also, a minimum
>kernel .config file would be useful :-)

>Currently, I can boot to the M-Systems chip as single user .  With a
>normal boot, the login prompt shows but does not allow anyone, even
>root, to login (I've copied the passwd, shadow, tons of library files
>and pam.d stuff, but still no luck).

>Our system is as follows:
>Media GX 233
>Touchscreen
>32MB ram
>AMI BIOS
>LCD panel
>M-Systems DOC 2000 - 16MB

>Any pointers or suggestions would be appreciated !
>Thanks,
>Ralph Stickley
>Datalux, Corp.

"Tkatchouk, Pavel" wrote:

> Unlikely your case, but here it goes...
> When I moved my diskless from libc to glibc login all of a sudden
> stopped to let anyone in. The problem appeared to be missing
> /lib/libnss_files.so.1,libnss_files.so.2,libnss_dns.so.2,
> libnss_nis.so.2,libresolv.so.2,libnsl.so.1 (not reported by ldd)
> and /etc/nsswitch.conf.
>

Seems like these libraries are required for passwd, maybe some of
the pam stuff...I copied these too..still no luck

I'd like to turn the pam stuff off anyhow...not sure how yet...

Is nsswitch.conf used during the login ?? Hmmmmm....


>
> Also, perhaps the following extract from my "Diskless-from-NT-mini-howto"
> (can be found in www.slug.org.au/etherboot distribution
> under name NT-Diskless-Terminal.txt) may be helpful in determining files
> required:
>
> "Pruning standard distribution (RedHat, Debian, etc.) to your needs might be
> very time
> consuming. To ease that painful process I have used remotely booted diskless
> client with
> NFS-Root (see Etherboot's Readme, NFS-Root and NFS-Root-Client mini-HOWTO's,
> Diskless-
> HOWTO):
>

If you have done this, do you have a directory listing available ? :-)
I have not used NFS stuff yet...not sure if I'll be able to figure this one
out.

> <snip>

> Regards,
>
> Pavel Tkatchouk
>

Thanks,
Ralph



To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Anyone embedding RH 6.1 / 2.2.12 ?
  1999-12-08 22:08 ` Anyone embedding RH 6.1 / 2.2.12 ? ralph stickley
@ 1999-12-13 15:01   ` Adi Linden
  1999-12-14 20:14     ` ralph stickley
  0 siblings, 1 reply; 8+ messages in thread
From: Adi Linden @ 1999-12-13 15:01 UTC (permalink / raw)
  To: ralph stickley
  Cc: Tkatchouk, Pavel, 'linux-embedded@waste.org', MTD,
	Oron Ogdan

> >I was wondering if anyone has sucessfully "embedded" the 2.2.12 kernel
> >from the RedHat 6.1 distro...
> >2.0.36 worked fine but I am required to do an upgrade and there seems to
> >be quite a few differences.

Doing just. Took Redhat 6.1 and created minimal tar balls of packages.
Stribed binaries and libs and no docs, man pages, etc. It's up and running
including networking in an 8MB partition. df tells me it's consuming about
5MB.

> >Currently, I can boot to the M-Systems chip as single user .  With a
> >normal boot, the login prompt shows but does not allow anyone, even
> >root, to login (I've copied the passwd, shadow, tons of library files
> >and pam.d stuff, but still no luck).

Compile util-linux, sysutils, shutils, ppp without PAM and shadow
password. Get's rid of a lot of libs. You can grab my work so far at:
http://projects.adis.on.ca/Embedded/embedded-0.13.tar.gz
No docs, though,except for some noted in 'FileList'...

Regards,
Adi



To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Anyone embedding RH 6.1 / 2.2.12 ?
  1999-12-13 15:01   ` Adi Linden
@ 1999-12-14 20:14     ` ralph stickley
  1999-12-15  0:07       ` Adi Linden
  0 siblings, 1 reply; 8+ messages in thread
From: ralph stickley @ 1999-12-14 20:14 UTC (permalink / raw)
  To: Adi Linden; +Cc: 'linux-embedded@waste.org', MTD

Adi Linden:

Got it!   Looks great ... Now what do I do ?:-)

I have a shell script that erases/formats and loads files onto the DOC for
booting (setup for plilo boot since we can't afford DOS for each of our
units).  I'm converting this over to your directory structure - if you want a
copy let me know - however, I'm a relative newbie to this stuff so it may not
help..

Also, if you need any help with the documentation I'd be able to provide some
time..our system needs to be documented also...

Thanks again
Ralph Stickley
Datalux, Corp.
http://www.datalux.com/ipix

BTW...any way to host this on a site thats available at >56K ?? (or parse out
the standard files ?)

Adi Linden wrote:

> <snip>

> Compile util-linux, sysutils, shutils, ppp without PAM and shadow
> password. Get's rid of a lot of libs. You can grab my work so far at:
> http://projects.adis.on.ca/Embedded/embedded-0.13.tar.gz
> No docs, though,except for some noted in 'FileList'...
>
> Regards,
> Adi
>
> To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org





To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Anyone embedding RH 6.1 / 2.2.12 ?
  1999-12-14 20:14     ` ralph stickley
@ 1999-12-15  0:07       ` Adi Linden
  1999-12-15 14:54         ` ralph stickley
  0 siblings, 1 reply; 8+ messages in thread
From: Adi Linden @ 1999-12-15  0:07 UTC (permalink / raw)
  To: ralph stickley; +Cc: 'linux-embedded@waste.org', MTD

Hi,

> Got it!   Looks great ... Now what do I do ?:-)

Well, that depends :-) At this time I am working solely with ramdisks.
That is I format the flash with a DOS filesystem and use syslinux to boot
the kernel and an initrd. If you pass root=/dev/ram to the kernel it will
keep the initrd as the root filesystem.

An alternative to syslinux is to use plilo or lilo to boot the system from
a Linux partition/filesystem. I haven't been able to patch lilo for the
M-Systems driver. And lilo is harder to use than syslinux. Once syslinux
is installed it doesn't have to be run again. If I configured it to boot
the bzImage kernel and the ramdisk.img initrd it will do just that. The
kernel and ramdisk can be changed as long as the name stays the same.

Another version is to have an uncompressed filesystem on flash. Boot the
kernel and an initrd. The initrd copies the filesystem from flash to a
ramdisk and sets the root device to the newly created ramdisk. The nice
thing about this setup is you can mount the flash and make changes to it.
Those changes take effect upon reboot.

I also created a bootable CD version which loads a big ramdisk. This was
before I considered flash.

I've thought about mounting the flash read only and creating ramdisks for
/etc /dev and /var. However, since my filesystems are rather small I opted
for small flash devices and more physical ram. 

There is a directory that contains files ending in .tar and .list. These
are the compiled packages. I use mc to extract them. The mnt directory is
just a temporary mount point for building the filesystem. So untar
everything you need into the mnt directory. Start with
_base_filesystem.tar and _base_libs.tar. The remainder can be any order.
All the libs in _base_libs are required. If any other libs are required
they are part of the respective tar files (libproc is part of procps.tar,
etc). 

kernel-basic-net-doc.tar contains the kernel and modules. Since this
particular kernel is meant for a single floppy wireless router it contains
masquerading modules and drivers for the ne2000, pcnet32 and tulip cards.

Edit the folowing files:
etc/rc.sysinit  -->  executed by init and the section to mount
                     filesystems needs to be edited/added.
etc/config      -->  configuration for ethernet, etc. Very close
                     to the Redhat 6.1 stuff in /etc/sysconfig/
/etc/rcS.d	-->  script files executed in alphabethical order
                     by init upon entering runlevel 3
/etc/rcS.d/05modules  -->  insmod [module]

A couple of bugs to mention, /etc/rcS.d/05modules needs to be chmod 755.
And I trimmed /etc/termcap to aggressively. elvis doesn't work perfectly
and top only fills 1/2 screen. Works fine with a termcap copied over from
the Redhat 6.1 system but it's 111k.

I guess the philosophy behind this particular setup is a system that boots
into a ramdisk but doesn't have to gracefully shutdown. So there's only
one runlevel, runlevel 3. The scripts I create to start services only care
about starting the service. To be able to drop Redhat files from
/etc/rc.d/init.d into my etc/rcS.d all the scripts are called with start
as argument. There is nothing (yet) to stop services upon shutdown.

Now, ctrl-alt-delete, shutdown -h now and shutdown -r now work just fine.
I need to be able to telnet into a system an remotely reboot. Processes
are killed bu the rc.shutdown script with killall5 just as Redhat 6.1
does.

Hope this helps! 

> I have a shell script that erases/formats and loads files onto the DOC for
> booting (setup for plilo boot since we can't afford DOS for each of our
> units).  I'm converting this over to your directory structure - if you want a
> copy let me know - however, I'm a relative newbie to this stuff so it may not
> help..

Sure, I'd be interested. Is a DOS license required for a DOS formated
filesystem??? Never thought of that. Syslinux works from a FAT12 and FAT16
filesystem but it does not require and DOS files at all.

> Also, if you need any help with the documentation I'd be able to provide some
> time..our system needs to be documented also...

Right now this is what I am doing for fun in my spare time. I developed a
satellite router using a minimal Redhat 5.2 system. I just thought of
ideas to improve upon it and choose Redhat 6.1 as a development platform.

> BTW...any way to host this on a site thats available at >56K ?? (or parse out
> the standard files ?)

Well, the site is connected at 256k. Yup, I looked at the file size last
night. It's 16MB, I will split the source packages and compiled packages
into their own archive and update those only when compiled packages are
added. That should leave the actual collection of binaries, perhaps 1/3 of
the total size if not less...

Regards,
Adi



To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Anyone embedding RH 6.1 / 2.2.12 ?
  1999-12-15  0:07       ` Adi Linden
@ 1999-12-15 14:54         ` ralph stickley
  1999-12-15 16:27           ` Adi Linden
  1999-12-20 15:14           ` Adi Linden
  0 siblings, 2 replies; 8+ messages in thread
From: ralph stickley @ 1999-12-15 14:54 UTC (permalink / raw)
  To: Adi Linden, Embedded; +Cc: MTD


Adi Linden wrote:
<snip>

> I also created a bootable CD version which loads a big ramdisk. This was
> before I considered flash.
>
> I've thought about mounting the flash read only and creating ramdisks for
> /etc /dev and /var. However, since my filesystems are rather small I opted
> for small flash devices and more physical ram.
>

Yes, we will need to use the flash read-only.  I can make another partition (or
two) to use for storing user data.  If the software only writes to one partition,
then only that partition can be damaged during power down.   By alternating
partitions, only the last changes are lost. Have the application save it twice and
then you have it (That's my solution for the power down problem ).

>
> There is a directory that contains files ending in .tar and .list. These
> are the compiled packages. I use mc to extract them. The mnt directory is
> just a temporary mount point for building the filesystem. So untar
> everything you need into the mnt directory. Start with
> _base_filesystem.tar and _base_libs.tar. The remainder can be any order.
> All the libs in _base_libs are required. If any other libs are required
> they are part of the respective tar files (libproc is part of procps.tar,
> etc).

I'd like to make a configuration utility like "make menuconfig", but since I only
need one configuration, that may be considered a waste of Co. time :-)  I should
finish my V0.0 shell script today...

>
> I guess the philosophy behind this particular setup is a system that boots
> into a ramdisk but doesn't have to gracefully shutdown. So there's only
> one runlevel, runlevel 3. The scripts I create to start services only care
> about starting the service. To be able to drop Redhat files from
> /etc/rc.d/init.d into my etc/rcS.d all the scripts are called with start
> as argument. There is nothing (yet) to stop services upon shutdown.
>

Hmmm...I'll need to get run level 5 in also, since we need to run X (but thats
another task, after I see this thing boot ).

AFAIK shutdown is not needed if your running from ram disk.  Any software running
on the system
should force the writes to be completed when the user is saving something.  (Isn't
there a kernel flag or configuration file somewhere to force writes to happen
right away ?? I think QNX had that ...Hmmm...)

I like the idea of sharing files from a desktop to the embedded system...Thats got
to be the easiest way to debug the setup (especially when you don't have a floppy
disk on the embedded system (it is fun to use hard disks like floppies - 9 hard
drives sitting on my desk as I write <:-;).

>
> Sure, I'd be interested. Is a DOS license required for a DOS formated
> filesystem??? Never thought of that. Syslinux works from a FAT12 and FAT16
> filesystem but it does not require and DOS files at all.
>

Well, Duh....My mistake...I never knew...I was under the impression that there
were DOS files involved: command.com calling config.sys or something.  Hey, that
means I can leave the lilo (and especially plilo) in the trash - Whoopee Yeah Ra
Ra !!


>
> > Also, if you need any help with the documentation I'd be able to provide some
> > time..our system needs to be documented also...
>
> Right now this is what I am doing for fun in my spare time. I developed a
> satellite router using a minimal Redhat 5.2 system. I just thought of
> ideas to improve upon it and choose Redhat 6.1 as a development platform.
>

Spare time ?? whats that, please explain :-)

>
> > BTW...any way to host this on a site thats available at >56K ?? (or parse out
> > the standard files ?)
>
> Well, the site is connected at 256k. Yup, I looked at the file size last
> night. It's 16MB, I will split the source packages and compiled packages
> into their own archive and update those only when compiled packages are
> added. That should leave the actual collection of binaries, perhaps 1/3 of
> the total size if not less...
>

I'm thinking your connection is getting limited - best I could get on 3 different
downloads was about 2.8Kbps...maybe 56K is your upload speed ? Hmmmmm.... Well, if
you split it up, this won't be a problem...

Thanks again for your work on this project!

Ralph

Oops - Sorry about the double mailing ... my address book "First Name" and "email
address" were the same.




To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Anyone embedding RH 6.1 / 2.2.12 ?
  1999-12-15 14:54         ` ralph stickley
@ 1999-12-15 16:27           ` Adi Linden
  1999-12-15 21:16             ` ralph stickley
  1999-12-20 15:14           ` Adi Linden
  1 sibling, 1 reply; 8+ messages in thread
From: Adi Linden @ 1999-12-15 16:27 UTC (permalink / raw)
  To: ralph stickley; +Cc: Embedded, MTD

Hi,

> Yes, we will need to use the flash read-only.  I can make another partition (or
> two) to use for storing user data.  If the software only writes to one partition,
> then only that partition can be damaged during power down.   By alternating
> partitions, only the last changes are lost. Have the application save it twice and
> then you have it (That's my solution for the power down problem ).

That's a neat idea. How do you detect error in writing? Use fsck on boot?
So far I haven't had any user data to save. The emphasis has been on
building an appliance type deal where you ask the user if the lights are
on and if they're not on unplug the power to reset. However, even for
dhcp it would be nice to save the dhcp.leases file...

> I'd like to make a configuration utility like "make menuconfig", but since I only
> need one configuration, that may be considered a waste of Co. time :-)  I should
> finish my V0.0 shell script today...

I created the *.list files with the idea of eventually creating a script
that parses a file containing the *.tar files to use to build the system.
Then it might be possible to use the *.list files to tag files that should
be deleted from the system if they're not needed. A menu type system would
be nice... :-) but I am not fluent in C, doing a lot of shell and perl
programming. I opted to to this embedded project and learn about CISCO
router admin instead of learning C... 

> Hmmm...I'll need to get run level 5 in also, since we need to run X (but thats
> another task, after I see this thing boot ).

I haven't tackled X yet. I am still looking for an inexpensive embedded
platform with a LCD touch screen for an Internet kiosk. So far US$2300.00
was the bottom line I found...

> AFAIK shutdown is not needed if your running from ram disk.  Any software running

I need to be able to telnet into the box and force a reboot.

> on the system
> should force the writes to be completed when the user is saving something.  (Isn't
> there a kernel flag or configuration file somewhere to force writes to happen
> right away ?? I think QNX had that ...Hmmm...)

There are mount options that force immediate writes. Would it be sync?

> I like the idea of sharing files from a desktop to the embedded system...Thats got
> to be the easiest way to debug the setup (especially when you don't have a floppy
> disk on the embedded system (it is fun to use hard disks like floppies - 9 hard
> drives sitting on my desk as I write <:-;).

I almost had to build a remote boot system using bootroms for my employer.
The idea got scrapped. The embedded platform I use has a build in bootrom.
I'd love to use it to have a full system mounted nfs to do development,
install software on the doc, etc... I alread spend significant time
researching the remote boot thing, unfortunatley my research was centered
on Windows clients booting from a Linux server.

> Well, Duh....My mistake...I never knew...I was under the impression that there
> were DOS files involved: command.com calling config.sys or something.  Hey, that
> means I can leave the lilo (and especially plilo) in the trash - Whoopee Yeah Ra
> Ra !!

Just found a problem, though. Didn't compile MS-DOS filesystem support in
the kernel. I tried the driver using using an ext2 formated doc... Got to
fix that. 

> Spare time ?? whats that, please explain :-)

Hey, after working 30 hours a day and 10 days a week there's still time
left in the day ;-)

> I'm thinking your connection is getting limited - best I could get on 3 different
> downloads was about 2.8Kbps...maybe 56K is your upload speed ? Hmmmmm.... Well, if
> you split it up, this won't be a problem...

RAD modems on 2 pairs of wires, 256k in and 256k out... I wonder, I am far
up in the boonies. Perhaps I could mirror on xoom.com or something like
that. I am rearranging my site bit that should make mirroring possible.

TTYL,
Adi




To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Anyone embedding RH 6.1 / 2.2.12 ?
  1999-12-15 16:27           ` Adi Linden
@ 1999-12-15 21:16             ` ralph stickley
  0 siblings, 0 replies; 8+ messages in thread
From: ralph stickley @ 1999-12-15 21:16 UTC (permalink / raw)
  To: Adi Linden; +Cc: Embedded, MTD

Ok,
Heres a shell script that should help. (Pasted it at the end of this message).

try:
./doc

to get the usage message.

./doc -E

Erases the disk on chip, well, almost.  I was using ext2 but commented that line out..
need to update for msdos filesystem.  Just mounts it for now.  How do you do this now?

./doc -f   xxx

That will copy all the packages listed in the doc.conf file (default file is built with
all
xx.tar filenames found in the ./packages directory).  Edit doc.conf to select which
packages to install.

The actual files 'untarred' are taken from the xx.list file.  Edit xx.list file to
include or
exclude specific files.

./doc -s

makes a list of the entire contents of the disk on chip - seemed like a fun thing to
do.

Other things to do from this shell script:
-- look in "updates" directory to copy new files over the un-tarred files
-- use a specific .config file to build the kernel just for the disk on chip
-- More features to come - any suggestions welcome :-)

Hope this helps.
Later,
Ralph

<more below>

Adi Linden wrote:

> Hi,
>
> > Yes, we will need to use the flash read-only.  I can make another partition (or
> > two) to use for storing user data.  If the software only writes to one partition,
> > then only that partition can be damaged during power down.   By alternating
> > partitions, only the last changes are lost. Have the application save it twice and
> > then you have it (That's my solution for the power down problem ).
>
> That's a neat idea. How do you detect error in writing? Use fsck on boot?
> So far I haven't had any user data to save. The emphasis has been on
> building an appliance type deal where you ask the user if the lights are
> on and if they're not on unplug the power to reset. However, even for
> dhcp it would be nice to save the dhcp.leases file...
>

I suppose...I thought that was automatic at power up...but then I'm still not sure
what happens at power up  ?:-o


>
> > I'd like to make a configuration utility like "make menuconfig", but since I only
> > need one configuration, that may be considered a waste of Co. time :-)  I should
> > finish my V0.0 shell script today...
>
> I created the *.list files with the idea of eventually creating a script
> that parses a file containing the *.tar files to use to build the system.
> Then it might be possible to use the *.list files to tag files that should
> be deleted from the system if they're not needed. A menu type system would
> be nice... :-) but I am not fluent in C, doing a lot of shell and perl
> programming. I opted to to this embedded project and learn about CISCO
> router admin instead of learning C...
>

C and Shell scripts are easy...its "programming" this dang OS thats a pain !:-|
I guess it's what your used to...

>
> > Hmmm...I'll need to get run level 5 in also, since we need to run X (but thats
> > another task, after I see this thing boot ).
>
> I haven't tackled X yet. I am still looking for an inexpensive embedded
> platform with a LCD touch screen for an Internet kiosk. So far US$2300.00
> was the bottom line I found...
>

<sales pitch on>
Check out:

http://www.datalux.com/ipix

They even have a linux version! (well, almost :-)

</sales pitch off>

>
> > AFAIK shutdown is not needed if your running from ram disk.  Any software running
>
> I need to be able to telnet into the box and force a reboot.
>

Hey, neat feature...

>
> There are mount options that force immediate writes. Would it be sync?
>

I guess theres' a 50 page how to about that somewhere...I'll have to check...

>
> > I like the idea of sharing files from a desktop to the embedded system...Thats got
> > to be the easiest way to debug the setup (especially when you don't have a floppy
> > disk on the embedded system (it is fun to use hard disks like floppies - 9 hard
> > drives sitting on my desk as I write <:-;).
>
> I almost had to build a remote boot system using bootroms for my employer.
> The idea got scrapped. The embedded platform I use has a build in bootrom.
> I'd love to use it to have a full system mounted nfs to do development,
> install software on the doc, etc... I alread spend significant time
> researching the remote boot thing, unfortunatley my research was centered
> on Windows clients booting from a Linux server.
>
> > Well, Duh....My mistake...I never knew...I was under the impression that there
> > were DOS files involved: command.com calling config.sys or something.  Hey, that
> > means I can leave the lilo (and especially plilo) in the trash - Whoopee Yeah Ra
> > Ra !!
>
> Just found a problem, though. Didn't compile MS-DOS filesystem support in
> the kernel. I tried the driver using using an ext2 formated doc... Got to
> fix that.
>
> > Spare time ?? whats that, please explain :-)
>
> Hey, after working 30 hours a day and 10 days a week there's still time
> left in the day ;-)
>
> > I'm thinking your connection is getting limited - best I could get on 3 different
> > downloads was about 2.8Kbps...maybe 56K is your upload speed ? Hmmmmm.... Well, if
> > you split it up, this won't be a problem...
>
> RAD modems on 2 pairs of wires, 256k in and 256k out... I wonder, I am far
> up in the boonies. Perhaps I could mirror on xoom.com or something like
> that. I am rearranging my site bit that should make mirroring possible.
>
> TTYL,
> Adi
>
> To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org

#! /bin/sh
#
# DOConfig  - script to configure Disk on Chip
#
#    Copies files from <pakages>.tar as listed in doc.conf
#    Actual files are specified in <package>.list
#
#    Created by Ralph Stickley rstickley@datalux.com
#    Many Features copied from init.d scripts
#
#    Built for ?Pee Wee Linux? created by Adi Linden
#
#
# Make sure we're really running bash.
#
[ -z "$BASH" ] && { echo "DOConfig requires bash" 1>&2; exit 1; }
#
#  constants for this shell script
#
VER=0.1
CFG_FILE=doc.conf
LST_FILE=files.lst
DOC_LOG=doc.log
[ -z "$COLUMNS" ] && COLUMNS=80
RES_COL=40
MOVE_TO_COL="echo -en \\033[${RES_COL}G"
#
#  constants for system directory structure
#
PKG_DIR=packages
DOC=./mnt
DOC_DEV=/dev/fla1
#
#
#
# Function: Usage
#
DOCUsage() {

   echo ""
   echo -e "doc \t\t Disk On Chip shell utility - V"$VER""
   echo ""
   echo "Usage: doc  -[E f s] mnt"
   echo "   -E   Erase disk on chip at $DOC"
   echo "   -f   create files from file $CFG_FILE"
   echo "   -s   store snapshot of files in $LST_FILE"
   echo "   mnt  mount point for Disk On Chip filesystem"
   echo ""
}
#
# Function: DOCMounted  (ExitOnError)
#
DOCMounted() {
   #
   # check if device is mounted (maybe someplace else)
   #
   if ! grep -iq "$DOC_DEV" /proc/mounts ;  then
      echo Device $DOC_DEV not mounted
      if [ ! $# = "" ]; then
         exit 0
      else
         return 0
      fi
   fi
   #
   # verify $DOC is mounted at $DOC_DEV
   #
   mntpt=`basename $DOC`
   if ! grep -i $mntpt /proc/mounts | grep -iq "$DOC_DEV"  ; then
      echo Disk-On-Chip not mounted at $DOC
      if [ ! $# = "" ]; then
         exit 0
      else
         return 0
      fi
   fi
   # valid mount, return true
   return 1
}

#
# function: DOCList
#
DOCList() {
#
   loc=$PWD
   echo -n Creating file: $loc/$LST_FILE
   cd $DOC
   #
   # use du to list - there may be a better way
   #
   du . -a | cut -f2 | sort -u > $loc/$LST_FILE
   #
   cd $loc
   #
   echo ...done
}

#
# function: DOCBackup filename
#
DOCBackup() {
   #
   #  backup to new backup file
   #
   if [ -f $1 ]; then
      bakn=1
      while [ -f "$1".$bakn ]; do
         bakn=`expr $bakn + 1`
      done
      cp  $1  "$1".$bakn
      echo Backing up $1 to "$1".$bakn
   fi
}

#
# function DOCExtract
#
DOCExtract() {

   echo -n Extracting files from:
   $MOVE_TO_COL
   echo as specified in:
   #
   loc=$PWD
   ln=1
   #
   for nfile_lst in `cat $CFG_FILE`; do
       #
       # each list file needs it's tar ball untarred at mount point
       #
       tar_file=`basename $nfile_lst list`"tar"
       tar_dir=`dirname $nfile_lst`
       #
       if [ ! -f "$tar_dir"/"$tar_file" ] ; then
          echo $CFG_FILE Error: $tar_file not found \(line  "$ln"\)
       else
          #
          #        nice printout of whats happening
          cd $DOC
          echo -n $tar_file
          $MOVE_TO_COL
          echo $nfile_lst
          #
          #  -T option seems to generate errors for empty directories
          #
          tar -xT "$loc"/"$nfile_lst" -f "$loc"/"$tar_dir"/"$tar_file"  >/dev/null
2>/dev/null
          cd $loc
       fi
       #
       ln=`expr $ln + 1`    # increment line counter
   done
}
#
# DOC main()
#
   #
   # At least one parameter required
   #
   if [ "$1" = "" ]; then
      DOCUsage
      exit 0
   fi
   #
   # command line parameter #2 - change DOC mount point
   #
   if [ ! "$2" = "" ]; then
      DOC=$2
   fi
   #
   # Verify DOC mount point exists or create it
   #
   if [ ! -d $DOC ]; then
        echo Creating Disk-On-Chip mount point at: $DOC
        mkdir $DOC
   else
      echo Disk On Chip File System at: $DOC
   fi
   case "$1" in
      #
      # Command:  Erase DOC
      #
      -E)
         echo Creating Filesystem on Disk-On-Chip \("$DOC_DEV"\) at $DOC
         #
         umount  $DOC_DEV       >  $DOC_LOG  2> $DOC_LOG
         #mke2fs $DOC_DEV       >> $DOC_LOG
         mount   $DOC_DEV $DOC  >> $DOC_LOG  2> $DOC_LOG
         #
         # verify mount
         #
         DOCMounted  ExitOnError
         #
         echo Formatted and Mounted Disk On Chip at $DOC
         #
         rm -r $DOC_LOG        # comment out to see results
         #
         ;;                    # end -E
      #
      # Command: Snapshot of Current FileSystem
      #
      -s)
         #
         # make sure we have something to take a picture of
         #
         if [ ! DOCMounted ]; then
            mount $DOC_DEV $DOC
         fi
         DOCMounted ExitOnError
         #
         # backup previous list
         #
         DOCBackup $LST_FILE
         #
         #  list files on device
         #
         DOCList
         ;;              # end -s
      #
      # Copy Files
      #
      -f)
         if [ ! -f $CFG_FILE ]; then
            #
            # Build configuration default - use all files
            #
            ls "$PKG_DIR"/*.list > $CFG_FILE
            echo File \"$CFG_FILE\" not found, creating default $CFG_FILE
         fi
         #
         DOCExtract
         #
         sync
         echo Done.
         ;;
      *)
         echo Invalid Parameter: $1
         DOCUsage
   #
   #
   esac     # end commandline processing
#
# end.
#



To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Anyone embedding RH 6.1 / 2.2.12 ?
  1999-12-15 14:54         ` ralph stickley
  1999-12-15 16:27           ` Adi Linden
@ 1999-12-20 15:14           ` Adi Linden
  1 sibling, 0 replies; 8+ messages in thread
From: Adi Linden @ 1999-12-20 15:14 UTC (permalink / raw)
  To: ralph stickley; +Cc: Embedded, MTD

Hi,

Just thought I'd mention I am mirroring all the embedded stuff I am
working on at http://embedded.sourceforge.net

I found my connection to the westcoast is really slow. I can hit Chicago
at 22k/s but uploading to sourceforge is going at 3.2k/s at best. Hope
this helps.

Latest version is 0.16. The next few days I will be working on the
products the embeded thing was started for. After Christmas I am hoping to
get some documantation done and perhaps some scripts to buid different
type systems (i.e. boot from HD, flash, CD, etc).

> I'm thinking your connection is getting limited - best I could get on 3 different
> downloads was about 2.8Kbps...maybe 56K is your upload speed ? Hmmmmm.... Well, if
> you split it up, this won't be a problem...

Regards,
Adi



To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~1999-12-20 15:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <9182AA6C8DACD311A8D70006294EF76808D3C1@exchange-yvr.squirrelsystems.com>
1999-12-08 22:08 ` Anyone embedding RH 6.1 / 2.2.12 ? ralph stickley
1999-12-13 15:01   ` Adi Linden
1999-12-14 20:14     ` ralph stickley
1999-12-15  0:07       ` Adi Linden
1999-12-15 14:54         ` ralph stickley
1999-12-15 16:27           ` Adi Linden
1999-12-15 21:16             ` ralph stickley
1999-12-20 15:14           ` Adi Linden

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox