Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (2) </ [1] 2 >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: Toshiba 310 CDS revival, How DSL awakened him, and made it cool!< Next Oldest | Next Newest >
blackeyedboy Offline





Group: Members
Posts: 3
Joined: Mar. 2007
Posted: Mar. 25 2007,19:30 QUOTE

1- History
Yesterday I found an old piece of hardware somewhere with other things I keep (those things you think senseless until they make sense :;):). It's a Toshiba 310 CDS laptop which stands in very good state (it's as if I bought it last month!) when we imagine its age! It runs a 200Mhz MMX Pentium with as low as 32MB of RAM, and a 2GB harddisk. It also include one USB port, FIR, 2 Cardbus ports, a floppy and a CD-Rom.
Nearly two years ago, a friend of mine gave it to me as Windows 98 original installation was broken and wasn't booting at all (hanging after boot). I said we could put back a fresh OS but obviously he laughed watching his brand new Pentium4HT running WinXP and answered his dustbin was ready to eat that laptop if I don't take it.

2- The context
Don't ask me why I forgot Win98 and tried 2K on it. Everything was going ok, but it took that much time to load, and even more if I were just asking it to open the explorer... So I forgot that laptop with that other things I keep... A day I took it back and tried to install linux, but debian installer said "no no" to my 32MB of RAM. So I burned a Linux From Scratch LiveCD and began an automated install with jhalfs. Two days later, it was just at the begining of the second stage out of a hundred before the end... As the CD-Rom was searching hard, I stopped that install to save the hardware!
Yesterday morning was a rainy day so I forgot the "Boat Show" and said : today's challenge is to make the 310CDS run! As I'm very demanding, I've set some goals : an X-Server running (as fast as possible) and every hardware working (USB, FIR, Cardbus, Soundcard). The result would then be a good Linux workstation to try/learn/build bash commands (awk, sed...) and scripts (normal, initscripts...), to play with fluxbox as I would like to install it on all of my computers with the same theme/torsmoconfig (I know that's madness! but I love this idea). Besides, it would be a good way to laugh on power failures (not frequent, but I hate them!), as its battery could go on sending music to my earphones, and let me go on working satisfied (instead of walking and waiting...).
Searching a little for small Linux distros, I felt on DSL and adopted it.

3- The build
That oldy CD-ROM can't read any of my CD-RW, but it accepts my burned CD-R. So I complicated things a little (challenges rocks!) saying I won't burn any DSL iso to a CD-R. So I booted up on my (burned CD-R) Linux From Scratch LiveCD to get a good console and made partitions on the harddisk, as easy as :
Code Sample
# cfdisk
I made a 160M swap on hda1, and grab that 1.83G remaining on hda2. I formated the partitions :
Code Sample
# mke2fs -jv /dev/hda2
# mkswap /dev/hda1
Before mounting them :
Code Sample
# mkdir /mnt/theSystem
# mount /dev/hda2 /mnt/theSystem
# swapon /dev/hda1

Now I use my less and less prefered OS to download the standard dsl-3.2.iso and put the file on my USB pendrive. Going back to the old laptop, I plug the pendrive. Dmesg says it's sda1 so I mount it :
Code Sample
# mkdir /mnt/usbdisk
# mount /dev/sda1 /mnt/usbdisk -o ro

Okay, so now let's install grub on the hard disk :
Code Sample
# cd /mnt/theSystem
# grub-install --no-floppy --root-directory=. /dev/hda2

One more point for Linux, I directly mount the iso image as if it was a CD in my CD-ROM drive :
Code Sample
# mkdir /mnt/falseCD
# mount /mnt/usbdisk/dsl-3.2.iso /mnt/falseCD -o loop
That rocks!
Now I follow the DSL wiki info to install manually on hard drive (frugal way). So I copy the files :
Code Sample
# cp -vr /mnt/falseCD/* /mnt/theSystem
The I move and rename syslinux files as said in the wiki :
Code Sample
# mv /mnt/theSystem/boot/isolinux/* /mnt/theSystem
# mv /mnt/theSystem/isolinux.cfg /mnt/theSystem/syslinux.cfg

To finish it, I create my own /mnt/theSystem/boot/grub/menu.lst file :
Code Sample
color yellow/black yellow/brown
default 0
timeout 5
title  Awakening that Toshiba 310CDS with DSL
root   (hd0,1)
kernel /linux24 root=/dev/hda2 ro host=pc-tsba-310cds lang=fr noeject frugal
initrd /minirt24.gz

Now let's umount the different filesystems used :
Code Sample
# umount /mnt/falseCD
# umount /mnt/usbdisk
# umount /mnt/theSystem
Then just reboot and...
Quote
Welcome to the Fold (Filter)
:cool:

4- The First Run
Everything loads correctly, and xsetup script comes! That laptop screen is limited to 800x600, I use the small stick as a mouse so it's not USB but PS/2, I want 16bit color depth as 24 is too much and 8 not enough, I can't remember what dpi is, and I'm a french guy!

Wow! That's running!
Primary goal achieved : an XServer is running, and damn it's fast! I thought it would take minutes to load but it only takes seconds.
Now, let's get this hardware working. USB, FIR and Cardbus are recognized and working (damn too easy...). What about the soundcard? Nothing!
Thanks to the DSL forums I found a way to make that Yamaha vintage soundcard working :
Code Sample
# modprobe opl3sa2 io=0x370 mss_io=0x530 mpu_io=0x330 irq=5 dma=1 dma2=0
Launching XMMS, mounting another USB pendrive with some mp3 and... damn, this soundcard is not that vintage! It's just playing loud and clear, that's cool.

Okay, now let's mount a CD. During the boot, the kernel said the CD-ROM drive is hdc so I try to mount it but with no result! Looking around on the net teaches me that it's not hdc, but scd0. This is not debian, so maybe knoppix? Or is it DSL? I don't know, and don't really need to know more... So here it is to mount my CD :
Code Sample
# mount /dev/scd0 /mnt/cdrom
Forgetting the last parameter is possible due to... a magical thing in DSL? Lol, haven't searched it, but it's not in fstab :;):
Secondary goal achieved : every hardware is working. But as it was too easy (thanks to the hard work made by knoppix, debian, and dsl), I am going to play around a little bit more, beggining by changing that look and feel I can't bear (sorry for the creator, as we say in France "we can't discuss tastes and colors") because it remind me of the first XServer I ran in 199X...

5- Customizing
First, I want to get rid of that colors so I'm gonna make my own style. Installed fluxbox styles are in /usr/share/fluxbox/styles/ and user made/saved should stand in ~/.fluxbox/styles/
It's easier to start from an existing style so :
Code Sample
# cp /usr/share/fluxbox/styles/envane /home/dsl/.fluxbox/styles/myStyle
And Beaver will help modifying it.
Fluxbox maintainers have made some good docs, and every aspect of the styles can be found in the fluxstyle man page. Just make your own! Playing with styles teaches us that 3D button effects are not that easy to make!

The style can't change the toolbar time format. And this format is not the usual one for me. This can be changed by the file /home/dsl/.fluxbox/init which line I changed :
Code Sample
session.screen0.strftimeFormat: %d/%m/%y %H:%M
This makes the date and time in a better format for French people.

Now I want to get rid of that little "dockapp" on the bottom-right of the screen showing "mounted-or-not" filesystems and more. It's called wmswallow, appears to be unmaintained, and I don't like it. It's automatically loaded when fluxbox starts by the file ".xinitrc". So i just commented ("#") the line. Yeah, dillo with the welcome page is also loaded by this file, so I comment the dillo line too. How to see the changes? CTRL+ALT+DEL will kill the XServer. Then just type startx at the prompt to load it again!

The mouse cursor is too quick. It's difficult with the USB optical one, and nearly impossible with the stick! The command to set mouse speed is "xset m acceleration treshold", but this can be done automatically by the same .xinitrc file when the XServer loads, just add the line :
Code Sample
xset m 3/4 1
on the top of the file (3/4 and 1 are my prefered speeds, try some others that could better suit your needs!).

Let's go on. I would prefer the workspace pager to sit on the bottom-right of the screen and to be smaller. It's name is fluxter, and it's config file is /home/dsl/.fluxbox/fluxter.bb so i changed some of that lines :
Code Sample
fluxter.position: -1-1
fluxter.desktop.width: 20
fluxter.desktop.height: 20
Restarting X makes fluxter sit where I want him, that's good!

What about the presentation of the info on the top-right of the screen? Yeah, you are right, I don't like it, and the battery indicator is not working, which irritates me a lot. This textual info on the desktop is written by a software called Torsmo. The main configuration file is /home/dsl/.torsmorc which you have to modify to make it print the way you want. The Torsmo Readme will help a lot.

Playing a bit with that file, I realized that I can't make the battery indicator print anything. Walking around in torsmo source code make me realize that it searches for BATX directory in /proc/acpi/battery where X is the number of the battery (should be 0). Navigating to /proc/acpi/battery I see the cause of the problem : the directory is named MBAT! I'm not sure, but I imagine it's because the bios/computer is old. So Torsmo default variables won't be able to see it unless I change the source code, recompile it, remaster the distro... LOL! As I can't use existing torsmo text variables, I will make a script! First, I add the following line after the TEXT switch in the .torsmorc file :
Code Sample
battery : ${execi 10 ~/.torsmo_battery}
Now I have to create the script. I found that the "acpi -V" command gives me the info in a good textual way, so I will use it. Here are my lines for the .torsmo_battery script :
Code Sample
#!/bin/sh
/usr/bin/acpi -V | awk '/Battery/ {split($0, x, "1: "); split(x[2], y, ", "); printf "%s, ", y[2]; if (y[1] ~ /unknown/) { printf "fully ready to rock\n"} else printf "%s\n", y[1]; if (y[3]) printf "%s - ", y[3]; exit;}'
/usr/bin/acpi -V | awk '/AC Adapter/ {split($0, x, "1: "); printf "A/C : %s\n", x[2]; exit;}'
/usr/bin/acpi -V | awk '/Thermal/ {split($0, x, "1: "); split(x[2], y, ", "); printf "motherboard : %s, %s", y[2], y[1]; exit;}'
I'm neither an awk guru nor a bash chief engineering scripter, so if you are, please forgive! As you can see, I replace "unknown" state by a more pretty text, because "acpi -V" says "unknown" when my battery is full, and as a perfectionist I don't like it at all!

One more thing is getting my eyes blink. All desktop icons are grouped on the top of the screen. Should I modify it? Of course! I would like them to cover more height of the screen, and less width (yes, say it, as on the Windows desktop...). Moreover, I could change icon sizes and text color. Here in fluxbox, icons are brought by xtdesktop. The config file is /home/dsl/.xtdesktop/xtdeskrc in which you will be able to change everything, even the font. Run xfontsel to know the syntax of the font you want.

6- Persistence
This could stand for the newbie problem with DSL if maintainers had'nt made the Backup/Restore function (moreover with restore boot parameter, and the filetool.lst/xfiletool.lst config files). But tarring/untarring on each shutdown/boot does not please me a lot (moreover on that old slow pentium 200MHz! it's too long so don't ask, I definitely use the norestore option). Besides, I have some kind of a harddrive install (but frugal way) so I should save my files on the hard disk and use the persistent home and opt directories tip from the wiki. But I don't like it too (lol Damn this guy is difficult!).
Actually, I love the idea of the whole system to be readonly (RO). From the "windows user" point of view, it's as if the system was completely reinstalled each time you boot it. And definitely, it is! So it's wonderfull because the boot time is not longer than it is normally, and it avoids the Sword of Damocles saying a day or another, you will have to reinstall. The "linux user" point of view is much more different, as the WinRot does not apply. I won't give my head to cut to the wonderful Linux community by talking of a LinRot problem as it does not exist. Have I talked about my fileserver? It's a Debian-based SMB/FTP/SSH with LVM sitting somewhere in my garage for monthes and it doesn't even know that the word reboot exist! Linux servers are rock solid and efficient. But when you use Linux as a workstation, every software you open saves his configuration : the last placed you searched to open files, the position of the window... and much more. Working for one hour means a lot of configuration potentially written/changed (mostly in the /home directory) and they will all be back the next time you reboot. And that's really cool! But I don't like it. Because sometimes you just can't remember what adjusting you made as we can make a lot! Then you waste your time searching in your head, or even worse, making all possible adjustments until you find the good one. I personally practiced it when I was using Mandrake (the old name for Mandriva), Ubuntu or others. I was angry because I was slowly losing control over the computer, and the fastest way to get back was... to reinstall!

That's why I searched and found some kind of a "better" (apostrophes because it is MY point of view, and I do claim nothing) way to only save the config files I want, to put back the only adjustments I want back, and obviously, all of my personal files, without changing the readonly state of the system, without waiting for tar/untar to finish its work each time I start/stop the computer, and whithout using persistent /home and /opt directories.

So, during the customization process, I've modified/created only 7 files! I could copy all of them to my harddisk partition (/dev/hda2 which is automaticaly mounted in /cdrom by DSL). Then, I reboot, automaticaly get the "default" look&feel, open a console, copy back my files at their right place, and restart the X server. But that's long : file copying is long (okay I've just 7 files but what when I will have 100 or more?), X start and restart is long. Besides, I do type commands instead of using the computer under my orders. Moreover I don't want to take the risk to forget saving files I modified before rebooting whereas my hda2 IS mounted rw in /cdrom!!
Here is the solution : let's put the files physically on hda2, automaticaly mounted in /cdrom on boot by DSL, and make a script to symlink them in their right place!
The need of a script during the boot process should be a problem, as adding an initscript to the system means remastering which I don't admit. That's where the knoppix.sh file come! This script is launched by the first iniscript himself : S00knoppix-autoconfig. But it raises another problem, as at the beginning of the init process, everything is readonly or even not mounted! The knoppix.sh script won't be able to read the /cdrom directory as hda2 is not mounted on it yet. We could mount it but the boot would then fail while trying to mount it again. What about mounting and umounting it? Okay, this will avoid boot to fail when mounting again, but if you use knoppix.sh to create files in /home/dsl directory, the boot will fail too. Damn...

Have I said that the /etc directory is not readonly but rw when knoppix.sh is executed? Here is the fun guys! We will use the knoppix.sh script to create an S98dynamicallyCreated init script in /etc/rc5.d which will be himself executed during runlevel 5 (the one where XServer is started) just before the last one, S99bootlocal (the well-known bootlocal...). Is it magic? Definitely not!
Here you could ask, why don't adding the lines directly to the bootlocal.sh from the knoppix.sh? Because the bootlocal.sh script is in /opt which is readonly, and we like all the system to be readonly, don't we? I do.

Here is my knoppix.sh file :
Code Sample
echo -n "${BLUE}Dynamicaly creating S98 initscript in rc5.d directory... ${GREEN}"
echo "#!/bin/sh" >> /etc/rc5.d/S98dynamicallyCreated.sh
echo "# myOwn - Dynamicaly Generated Script" >> /etc/rc5.d/S98dynamicallyCreated.sh
echo "# Created from knoppix.sh script himself invoked by S00knoppix-autoconfig" >> /etc/rc5.d/S98dynamicallyCreated.sh
echo "#" >> /etc/rc5.d/S98dynamicallyCreated.sh
echo "# Script utility is to symlink ramdisk system files to my harddisk saved files" >> /etc/rc5.d/S98dynamicallyCreated.sh
echo "" >> /etc/rc5.d/S98dynamicallyCreated.sh

echo "# Here are my 7 files" >> /etc/rc5.d/S98dynamicallyCreated.sh

echo "# .torsmorc : Torsmo Config" >> /etc/rc5.d/S98dynamicallyCreated.sh
echo "ln -sf /cdrom/mySavedFiles/.torsmorc /home/dsl/.torsmorc" >> /etc/rc5.d/S98dynamicallyCreated.sh
echo "# .torsmo_battery : Torsmo Battery Checker script" >> /etc/rc5.d/S98dynamicallyCreated.sh
echo "ln -sf /cdrom/mySavedFiles/.torsmo_battery /home/dsl/.torsmo_battery" >> /etc/rc5.d/S98dynamicallyCreated.sh
echo "# .xinitrc : launched when xserver starts" >> /etc/rc5.d/S98dynamicallyCreated.sh
echo "ln -sf /cdrom/mySavedFiles/.xinitrc /home/dsl/.xinitrc" >> /etc/rc5.d/S98dynamicallyCreated.sh
echo "# .fluxbox/init : fluxbox init config" >> /etc/rc5.d/S98dynamicallyCreated.sh
echo "ln -sf /cdrom/mySavedFiles/.fluxbox/init /home/dsl/.fluxbox/init" >> /etc/rc5.d/S98dynamicallyCreated.sh
echo "# .fluxbox/fluxter.bb : fluxter config (fluxter is the workspaces pager)" >> /etc/rc5.d/S98dynamicallyCreated.sh
echo "ln -sf /cdrom/mySavedFiles/.fluxbox/fluxter.bb /home/dsl/.fluxbox/fluxter.bb" >> /etc/rc5.d/S98dynamicallyCreated.sh
echo "# my style!" >> /etc/rc5.d/S98dynamicallyCreated.sh
echo "ln -sf /cdrom/mySavedFiles/.fluxbox/styles/myStyle /home/dsl/.fluxbox/styles/myStyle" >> /etc/rc5.d/S98dynamicallyCreated.sh
/etc/rc5.d/S98dynamicallyCreated.sh
echo "# .xtdesktop/xtdeskrc : xtdesktop main configuration file (xtdesktop brings icons on the desktop)" >> /etc/rc5.d/S98dynamicallyCreated.sh
echo "ln -sf /cdrom/mySavedFiles/.xtdesktop/xtdeskrc /home/dsl/.xtdesktop/xtdeskrc" >> /etc/rc5.d/S98dynamicallyCreated.sh

echo "# Set my style as the default fluxbox style" >> /etc/rc5.d/S98dynamicallyCreated.sh
echo "ln -sf /home/dsl/.fluxbox/styles/myStyle /usr/share/fluxbox/styles/default" >>

echo "# Here it loads the module for sound support" >> /etc/rc5.d/S98dynamicallyCreated.sh
echo "modprobe opl3sa2 io=0x370 mss_io=0x530 mpu_io=0x330 irq=5 dma=1 dma2=0 &> /dev/null" >> /etc/rc5.d/S98dynamicallyCreated.sh

echo "Done."

That way, instead of maintaining 2 files (filetool.lst and xfiletool.lst) we can maintain only one which is more powerful : knoppix.sh script.
We could also consider a different approach for newbies by fetching the name of the files to save in another user configfile, so that they can't make mistakes which can be disastrous with knoppix.sh script. Or even better, by automatically symlinking files in the "mySavedFiles" (as called here) to their right place (which is easy if the filestructure is respected as in here!). Mmh, I'll work on it!

7- Conclusions
This post is a (very long) testimony, and a (happy) dsl user feedback. I hope it will help somebody as it's full of tips and tricks (even if most were probably already known).
It helps demonstrate that low-end old hardware can become a wonderful experience in learning/using linux with dsl.
Besides, it introduces what I think to be a new way of persistence with dsl/knoppix OSes.
My last hope is that my friend never sees his brand new laptop, because if he does, he will want it back! :;):
Back to top
Profile PM 
lucky13 Offline





Group: Members
Posts: 1478
Joined: Feb. 2007
Posted: Mar. 25 2007,20:42 QUOTE

Quote
Navigating to /proc/acpi/battery I see the cause of the problem : the directory is named MBAT! I'm not sure, but I imagine it's because the bios/computer is old. So Torsmo default variables won't be able to see it unless I change the source code, recompile it, remaster the distro...

Recompile or remaster or make a symlink from MBAT to /proc/acpi/battery?
Quote
All desktop icons are grouped on the top of the screen. Should I modify it? Of course! I would like them to cover more height of the screen, and less width (yes, say it, as on the Windows desktop...). Moreover, I could change icon sizes and text color. Here in fluxbox, icons are brought by xtdesktop. The config file is /home/dsl/.xtdesktop/xtdeskrc in which you will be able to change everything, even the font.

Or you can ditch xtdesk for rox.dsl (using the MyDSL browser, look in system). It will use the same font you set for GTK. The rox pinboard allows you to move icons around without setting coordinates manually like xtdesk, allows drag and drop, rox works as a file manager, etc. It uses more RAM than xtdesk, but its addition of function makes up for that to a large degree.
http://lucky13.blogsavy.com/rox-rocks/
Quote
Because the bootlocal.sh script is in /opt which is readonly, and we like all the system to be readonly, don't we? I do.

/opt isn't RO if it's added/mounted to your persistent partition. You really should consider adding that if you intend to add MyDSL extensions -- the base install of DSL is fine, but at some point you'll probably want to use apps that aren't included. It would also be the stone to kill that other bird of feeling that things have to be remastered or recompiled (or other Rube Goldberg variations to doing simpler things with greater complexity). Use the right tool and it makes things a lot easier.


--------------
"It felt kind of like having a pitbull terrier on my rear end."
-- meo (copyright(c)2008, all rights reserved)
Back to top
Profile PM WEB 
roberts Offline





Group: Members
Posts: 4983
Joined: Oct. 2003
Posted: Mar. 25 2007,22:08 QUOTE

Once you learn the mydsl system, if your seven configuration files do not change, you could put them in your own personal mydsl extension. Then you have write once, ready many. The DSL/MyDSL is very flexible without requiring writing/editing init scripts.
Back to top
Profile PM WEB 
andrewb Offline





Group: Members
Posts: 316
Joined: July 2005
Posted: Mar. 25 2007,23:32 QUOTE

THe latest version of Torsmo (0.18) deals with the MBAT problem. It compliles OK with GCC from the repositry. It is slightly larger than v0.17 (about 7kb) after compilation & stripping. I have a version ready to go if you PM me I can send it. I'll try & get it as a DSL or UNC package & send it for posting in the repositry.
Back to top
Profile PM 
lucky13 Offline





Group: Members
Posts: 1478
Joined: Feb. 2007
Posted: Mar. 26 2007,07:27 QUOTE

I read your post again and there's something I missed earlier...
Quote
Okay, now let's mount a CD. During the boot, the kernel said the CD-ROM drive is hdc so I try to mount it but with no result! Looking around on the net teaches me that it's not hdc, but scd0. This is not debian, so maybe knoppix? Or is it DSL? I don't know, and don't really need to know more... So here it is to mount my CD :
# mount /dev/scd0 /mnt/cdrom
Forgetting the last parameter is possible due to... a magical thing in DSL?

No. That mount point should've been auto pre-set for you. Look at your / directory and there should be directories for your cdrom and floppy (if you have a floppy drive). There should also be symlinks to each in /mnt. Here are the points from my fstab:
Code Sample
/dev/fd0  /floppy  vfat  defaults,user,noauto,showexec,umask=022  0  0
/dev/cdrom  /cdrom  iso9660  defaults,ro,user,noexec,noauto  0  0

...where /dev/cdrom is a symlink to /dev/scd0. I've never had to set mount points for any device -- hard drive, floppy, cd-rom, dvd, USB stick, mp3player, cam, card reader, etc. -- with any distro that uses Knoppix scripts and hotplug. That includes DSL. Before you go off and start setting mounts in DSL, look in /mnt and /etc/fstab and see if you have to do anything. You probably don't.

You should only have to put in a data CD and mount cdrom (not the /dev path but the auto pre-set point).

Earlier I linked to a rox page at my blog; that page has a pic of some of the icons on my desktop. The cdrom one is straight from / and the other two were dragged out of /mnt using rox. The only changes I made were to the "text to be displayed..." part when right-clicking on the icons and clicking "edit this item" for each. All the mount points were pre-set. The mp3player and USB pendrive were detected by hotplug, and Knoppix set the mount points for them and for cdrom (and my cam and cardreader since then).


--------------
"It felt kind of like having a pitbull terrier on my rear end."
-- meo (copyright(c)2008, all rights reserved)
Back to top
Profile PM WEB 
5 replies since Mar. 25 2007,19:30 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (2) </ [1] 2 >/
reply to topic new topic new poll
Quick Reply: Toshiba 310 CDS revival

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code