Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 21 Nov 2017, 06:07
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
Howto boot Puppy from internal Compact Flash card
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 3 [37 Posts]   Goto page: 1, 2, 3 Next
Author Message
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 8312
Location: Perth, Western Australia

PostPosted: Sat 23 Jul 2005, 11:39    Post subject:  Howto boot Puppy from internal Compact Flash card  

As discussed in a couple of other threads, there is a problem with booting
Puppy from an internal CF card, that is, plugged onto an IDE cable.
The card is then recognised as a normal ide hard drive, NOT as sda1,
sdb1, etc.

This thread is one in which we are discussing PCs with the VIA passive CPU:
http://www.murga.org/~puppy/viewtopic.php?t=1179&start=15

...it has a snapshot of the NTA-6010A that has a VIA Eden 433MHz CPU, with me holding a pci card, and you can see the CF card toward the back. It requires an adaptor to plug onto a standard IDE cable.

The guys at Devon IT preinstalled Puppy v1.0.3 on the CF card, but the installation can be further optimised.

Here is the content of syslinux.cfg as they supplied:
Code:
default vmlinuz root=/dev/ram0 initrd=image.gz
append ide=nodma ramdisk_size=120000 PSLEEP=25 PHOME=sda1 PFILE=pup100-none-262144 PKEYS=us


...they created image.gz with usr_cram.fs, hence needed the "ramdisk_size=" paramter. That works, but is not the most flexible arrangement.
It is preferable to have usr_cram.fs as a separate file.

Here is my modified syslinux.cfg:
Code:
default vmlinuz root=/dev/ram0 initrd=image.gz
append ide=nodma PSLEEP=25 PHOME=hda1 PFILE=pup100-none-262144 PKEYS=us


Notice, ramdisk_size parameter removed, and PHOME changed to hda1.
I don't know about the "ide=nodma", left that in.

Okay, one more thing to fix. I have changed one line in /etc/rc.d/rc.sysinit:
Code:
      #0.9.8 want to minimise writes to usb flash...
      #note, if swapon then have very big ramdisk capacity...
      #is PHOME a usb partition?...
      #v1.0.5 booting from internal CF flash card on IDE cable, will be hdx1, not sdx1,
      #so test PSLEEP instead...
      #if [ ! "`echo "$PHOME" | grep --extended-regexp  "sda|sdb|sdc|sdd"`" = "" ];then
      if [ $PSLEEP -gt 0 ];then #see line220, PSLEEP not defined, gets set =0.
       #what we will consider is mount pupxxx on /mnt/pupxxx by loopback, then copy contents to /root.
       #we need to know that the tmpfs ramdisk has enough space.
       #if not, just drop thru and pupxxx will get mounted directly on /root.
       #RAMDISKFREE will also include any allocated swap...
       RAMDISKFREE=`df | grep "rootfs" | tr -s " " | cut -f 4 -d " "`
       RAMDISKFREE=`expr $RAMDISKFREE - 7000` #leave 7M
       if [ $RAMDISKFREE -gt `du $HOMEDIR/$NAMEPFILE | cut -f 1` ];then
        PUPMNTPOINT="/mnt/pupxxx"
        echo "PUPMNTPOINT=$PUPMNTPOINT" > /tmp/pupxxxshutdown.txt
       fi
      fi     


You can see the commented-out "if" statement, replaced by the one below it.
As PHOME is now hda1, the "if" test doesn't work, so now testing for PSLEEP > 0, which it will be if booting from usb. (the cf card is on the ide cable so is not usb, but still using PSLEEP non-0 value)

So, the steps are, if building from Unleashed:
1. edit /etc/rc.d/rc.sysinit, as above.
2. build with separate usr_cram.fs (the default).
3. When install to usb card, edit syslinux.cfg as above.

You don't necessarily have to use Unleashed, an existing installation could probably be edited by uncompressing and mounting image.gz.

The first time it boots, a file "pup100" will be created on the CF card and it will be mounted on /root.
On subsequent boots, pup100 gets mounted on /mnt/pupxxx/ and contents copied to /root, so as to avoid writes to the Flash memory. As shutdown, /root/ is copied back to /mnt/pupxxx/ hence to pup100.

I have now got the NTA PC saving sessions to CF card, and minimizing writes. As the CF card is 128M, pup100 is only 55M, which is good from the point of view of the RAM, as the PC has 256M RAM, and 55M doesn't use up much of it.
One advantage of having usr_cram.fs separate from image.gz is "/" is now a tmpfs filesystem, which is much easier for the kernel memory manager to handle, and even though "/" is assigned 120M it will only use as much RAM as needed.

Last edited by BarryK on Mon 25 Jul 2005, 09:06; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 8312
Location: Perth, Western Australia

PostPosted: Sat 23 Jul 2005, 11:43    Post subject:  

Oh yeah, "PSLEEP=25" probably needs to be 25 seconds as the NTA PC has USB 1.1. But a PC with USB 2 could reduce this value, maybe down to PSLEEP=5 or thereabouts.

The NTA PC seems to handle a max resolution of 1024x768, and the Xvesa server only does that at 60Hz.
...that's next on my list, see if we can get a better X server.

Note also, the NTA guys stuck an extra "sleep=10" line just before they mounted usr_cram.fs on /usr, but it doesn't seem to be required.
Back to top
View user's profile Send private message Visit poster's website 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 8312
Location: Perth, Western Australia

PostPosted: Sun 24 Jul 2005, 21:10    Post subject:  

A short postscript on this:
I've been thinking "inside the square", thinking of the CF card as a usb device, when in fact plugged into an ide cable it isn't.
Which means that we don't need the PSLEEP parameter at all.

However, the way rc.sysinit has been modified in my above post, it is required to get the mechanism of eliminating writes to the CF card during a session.

If we do have PSLEEP, it has to have value of "25" for usb 1.1, as too-low value will cause kernel panic if a usb drive is plugged in.
This is because rc.modules loads "usb-storage" module.

Anyway, the solution given so far does work, but I will finetune rc.sysinit and rc.modules soon, so that we can eliminate that 25 second wait.
Stay tuned.
Back to top
View user's profile Send private message Visit poster's website 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 8312
Location: Perth, Western Australia

PostPosted: Tue 26 Jul 2005, 19:30    Post subject:  

A suggestion, to avoid the 25 second delay at bootup, is to modify /etc/rc.d/rc.modules like this:

Code:
  if [ $PSLEEP ];then
   #v1.0.5 treat PSLEEP=999 as special case. boot from internal CF card, use PSLEEP
   #test in rc.sysinit for saving writes to flash during session, but as CF isn't
   #an actual usb device when plugged on ide cable, avoid this wait...
   if [ ! $PSLEEP -eq 999 ];then
    echo "Loading kernel usb driver module usb-storage..."
    modprobe usb-storage
    echo "usb storage device replies async, need to sleep $PSLEEP secs..."
    sleep $PSLEEP
   fi
  fi


I have added the extra test for PSLEEP=999. Maybe not the most elegant way of doing it, but it avoids usb-storage from being loaded at boot-time, hence avoids the delay.
PSLEEP is still defined, so utilised later for the test to minimise writes to flash during a session.
Back to top
View user's profile Send private message Visit poster's website 
Marv


Joined: 04 May 2005
Posts: 911
Location: SW Wisconsin

PostPosted: Wed 27 Jul 2005, 13:25    Post subject: CF shutdown speed  

Thanks much for the thread above. I had moved from ms-cd to a CF based system (corsair 80x 256Mb CF, 384 Mb ram), and like the folks from Devon, had come close but not quite right. It is now booting very fast, running solidly (still pup 1.03, slow connection..) but is quite slow to shut down as it has to write the whole pupxxx every time.

Is it a total wild hair to use the sessiontimestamp /modified files/ deleted files capabilities from the ms-cd rc files and write to pupxxx only what has been modified or deleted since the last boot? then unmount and zeroize (I need to learn what that is) pupxxx.

If there are no obvious reasons not to try this, I will.

Thanks for Pup!

JM

_________________
Pups currently in kennel Very Happy X-slacko 4.4 and X-tahr 2.0 for my users; LxPupSc,LxPupXenial & XFCE_XenialPup64 for me. All good pups indeed, and all running browsers, office etc. solely from SFS.
Back to top
View user's profile Send private message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 8312
Location: Perth, Western Australia

PostPosted: Thu 28 Jul 2005, 06:12    Post subject:  

Yes, I can't see any reason why you can't modify the shutdown script, and only save new/changed/deleted files/directories, like the multi-session cd does.

Also, you don't have to zeroise the unused space in the pup100 file when shutting down.
-- reason for doing that, is if someone wants to gzip and backup the pup100 file, it will compress more.
Back to top
View user's profile Send private message Visit poster's website 
neg2led


Joined: 04 May 2005
Posts: 5
Location: Oz.

PostPosted: Fri 29 Jul 2005, 08:06    Post subject:  

perhaps you should build up an 'IDE-CF Edition' puppy that does what the Multisession CD does when you shut it down? that would work, no?

doesnt affect me much... would be useful, for later use, but right now i dont need it.


i just use a really really old super extra quiet HDD for pup, its 640mb Very Happy

neg

_________________
everyone has fotografic memory. some peoples just dont have films!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
Marv


Joined: 04 May 2005
Posts: 911
Location: SW Wisconsin

PostPosted: Sat 30 Jul 2005, 17:39    Post subject: Selective write to pupxxx  

Attached is a rough first go at a reboot script to write only files modified or added during the current session. It uses Barrys' reboot-cd work and seems fine on my CF system at this point.

As of now, it does not zeroize, does not yet deal with deleted files or do any real size checking of pupxxx. I'll work on some of that after next week when I'm a dwindles slave.

I put it in /.etc/rc.d with the rest of the reboot scripts and cp -af it to /tmp with a line in rc.local overwriting the original rc.reboot copied there by rc.local0.

Advice and work on it welcome as I'm a scriptbaby here.
rc.reboot-sel.gz
Description 
gz

 Download 
Filename  rc.reboot-sel.gz 
Filesize  2.54 KB 
Downloaded  822 Time(s) 

_________________
Pups currently in kennel Very Happy X-slacko 4.4 and X-tahr 2.0 for my users; LxPupSc,LxPupXenial & XFCE_XenialPup64 for me. All good pups indeed, and all running browsers, office etc. solely from SFS.
Back to top
View user's profile Send private message 
Marv


Joined: 04 May 2005
Posts: 911
Location: SW Wisconsin

PostPosted: Sun 31 Jul 2005, 21:05    Post subject: Sel write NOT useable yet.  

I have the delete files portion of the above rc.reboot-sel working now, but the final write to pupxxx is commented out as I havent been able to get the cat..sed..awk.. combo to give me the right parameter format to let cp do a copy with directories. For now I am using the Barrys' rc.reboot script with the zeroizing commented out and the shutdown is plenty fast.

Any help on that last step appreciated. This is for ideas only. Sorry it's halfway but I'm off for a week now.
rc.reboot-sel.gz
Description 
gz

 Download 
Filename  rc.reboot-sel.gz 
Filesize  2.83 KB 
Downloaded  845 Time(s) 

_________________
Pups currently in kennel Very Happy X-slacko 4.4 and X-tahr 2.0 for my users; LxPupSc,LxPupXenial & XFCE_XenialPup64 for me. All good pups indeed, and all running browsers, office etc. solely from SFS.
Back to top
View user's profile Send private message 
dvw86


Joined: 04 May 2005
Posts: 636
Location: Washington State

PostPosted: Tue 02 Aug 2005, 01:34    Post subject:  

I have hda1 formated as 3GB FAT16 and hda2 formated as 115GB ext2 with Puppy 1.0.3 installed on it. Grub manages the boot options. I thought that I would try the install to USB script on hda1 just to see how it would work. Everything looks like it installs fine. I modified syslinux.cfg as Barry instructed. Grub finds the vmlinuz file and starts to boot, but half way through booting up on hda1 I get a kernel panic. The error is:
"Warning: unable to open initial console.
Kernel panic: No init found. Try passing init= option to kernel."

Puppy on hda2 still works fine.
Back to top
View user's profile Send private message 
wscarl

Joined: 16 May 2005
Posts: 99
Location: NY

PostPosted: Thu 04 Aug 2005, 19:09    Post subject: How to send you hardware?  

Barry
Like to send you some hardware. Small - lite - so you can play with IDE Flash Modules - also made short cable so that you have both on one ide header Question Very Happy How to send you hardware? Question
Warren
Back to top
View user's profile Send private message 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 8312
Location: Perth, Western Australia

PostPosted: Thu 04 Aug 2005, 22:04    Post subject:  

wscarl,
I've already got the NTA06010A, which has a Compact Flash card plugged in internally via an adaptor to the IDE cable.
Back to top
View user's profile Send private message Visit poster's website 
wscarl

Joined: 16 May 2005
Posts: 99
Location: NY

PostPosted: Fri 05 Aug 2005, 14:41    Post subject: IDE flash module vs ide flash card  

Transend IDE flash module vs ide flash card - ide flash module has longer life for read/write can be set as Master/Save as well as read/write or read only and are avilable 32meg-2gig - 40/44pin. Also it has a low profile.
Back to top
View user's profile Send private message 
Agilos
Guest


PostPosted: Wed 17 Aug 2005, 12:25    Post subject:  

WSCARL: Are the speeds comparable between a flash module and a flash card? Just concerned about a performance difference. Let me know thanks!
Back to top
BlackAdder


Joined: 22 May 2005
Posts: 382

PostPosted: Fri 19 Aug 2005, 22:15    Post subject:  

Perhaps I can add my 2 cents worth.
Transcend quote the instaneous data rate of the IDE flash module at 16.6MB/sec. They also say that it should be good for 100,000 write cycles and they give a 2 year warranty.
There are a number of speeds of CF cards available. Makers have taken to quoting the speed in terms of base CD-ROM speed. So there are 30X, 45X and 80X cards advertised. A 30X is 30 x 150KB/sec or 4.5MB/sec, and I assume that is the instantaneous data rate.
On that basis, the IDE flash module is faster than most CF cards.
The Transcend CF cards are also said to be good for 100,000 write cycles, but some carry a 5 year warranty. Maybe Transcend is expecting the IDE Flash to hit the 100K limit sooner than the CF cards, but that is only my surmise.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 3 [37 Posts]   Goto page: 1, 2, 3 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0651s ][ Queries: 12 (0.0119s) ][ GZIP on ]