Menu
Logo

Neoware CA5: DSL 


 


 

 



Introduction

I needed to set up another small web server for a friend. I've always wondered how well the 200MHz SiS based systems perform so it seemed to be a good idea to pick on the Neoware CA5 for this task. At the same time I decided to build a disk-based system rather than one of my more usual Compact Flash Card systems. This "How To" covers the addition of a hard disk to the CA5 and the installation of Linux on that disk. My particular CA5 is fitted with 256MB of RAM.

This time I decided to pick on DSL (Damn Small Linux) as the distribution of choice. This was because the SiS processor is not the most modern or powerful of CPUs and DSL prides itself on....

And it certainly runs well on the CA5.


Hardware

Elsewhere I describe how to select/prepare a cast-off disk for re-use in a Thin Client. My original intention was to use a 1.8" drive for this project but, through laziness, ended up using a 2.5" drive - a 10GB Fujitsu MHM2100AT - as this was very easy to fit into the CA5. This particular drive is 9.5mm high - a larger (thicker) drive will not fit.

Ready To Fit

I used some double-sided tape to fit a sliver of expanded polystyrene to one side of the drive and another bit on the other side of the drive to fit a piece of strongish polythene cut from a document sleeve. If I'd had any to hand I would have used a bit of foam draft excluder (the sort you use on window frames) in place of the polystyrene. A piece of card would do equally well in place of the polythene to provide the insulation between the drive and the cover.

Where it goes

The drive just fits in the space between the processor heatsink and the rear panel. I did have to move the foam earthing(?) block that sits on top of the ethernet connector - just peel it off and replace it on the keyboard socket. By doing that the drive can be positioned a little further up the case which makes the routing of the IDE cable easy - it's just a right-angle fold.

Fitted Drive

The polystyrene strip provides a bit of resilience and makes the drive an interference fit between the back panel and the processor heat sink. The bit of polythene is folded over the drive and prevents an inadvertent electrical short between its circuit board and the case.

Unfortunately the fitted drive nicely covers the ventilation holes on the case sleeve. However very little heat is generated in the case and I've (so far!) had no overheating problems.

  Once you've fitted the drive, switch on the CA5 and hit the DEL key to get into the BIOS. Pick the "Standard CMOS Features" screen and check that the CA5 has found the drive. It should be listed as the IDE Primary Master. At this point, if you haven't done it already, go into the "Advanced BIOS Features" screen and set the order of the boot devices. In my case the first boot device is USB-HDD (see below) and the second is HDD-0.


Booting & installation

A distinct advantage here is that the CA5 will boot from a pen drive. On my Windows machine I went to pendrivelinux.com and downloaded the Universal installer and used this to put DSL 4.4.9 onto a 256MB pendrive. (I don't know if it is just me, but I always get an error from the installer if I try and use a pendrive that is 1GB or larger).

Next power-up/reset the CA5 to boot your media. Once you get the DSL logo and boot prompt type:

dsl vga=788

As DSL boots select your keyboard type, mouse type and either the Xfbdev xserver or the Xvesa xserver. In the latter case select 800 x 600 resolution. (You get no option if you've selected the Xfbdev xserver).

The next step is to partition the hard disk. It should have appeared as /dev/hda. A check of dmesg will confirm that DSL has found it and also show you what device name it has been assigned. We need two partitions on the disk:

Note: You may have to be creative here if you're using a drive which you've already partitioned to lock out areas of bad sectors as described here.

Open a root shell and then run either fdisk or cfdisk depending on your preference. Delete any existing partitions and create the two new partitions. The cfdisk command sequence for this is:

New/primary/512/beginning/type/82
New/primary/(default)/Bootable/type/83

..then write the partition table to disk and quit.

I'm not too sure whether it is necessary, but the recommendation is to reboot at this point to ensure that the system is running with the correct partition table.

The next step is to set up the swap partition. Open a root shell and type:

swapoff -a
mkswap /dev/hda1
swapon /dev/hda1

Now we're ready to install DSL on the hard disk. Follow through the menu sequence DSL/Apps/Tools/Install to Hard Drive which then opens a window and runs the install script.

We're installing to hda2
I use multi-user logins: y
ext3 filesystem? - not for us on the CA5: n
Continue?: y (if you're happy!)

The installation script then proceeds to create the file system and then copies over the system files.

Proceed to install a boot loader?: y
Use Grub or Lilo?: g
Do you have windows installed : n
Reboot now? : y

You need to remove the USB pen drive (or your original boot media) so that the reboot will use the newly installed system from the hard disk. On the restart you'll be prompted for passwords for the two users root and dsl.

So we now have a bootable version of DSL installed on the hard disk. The next step is to look at system configuration.


System Configuration

There are various tasks here. My selection is:

  1. Change default boot up to one that works!
  2. Set the correct keyboard, Timezone and system time.
  3. Change the host name from the default of box.
  4. Add new user(s) whose websites are to be mirrored on the server.
  5. Get rid of the "Getting Started" screen on login.
  6. Sort out the video mode.

Startup

Edit /boot/grub/menu.lst and set the default to 1 to select the fb800x600 menu item. You can also set the timeout to anything you fancy or just stick with 15 seconds.

The local timezone can be set as a boot parameter as can the keyboard. You'll find the data on a substantial number of timezones sitting in /usr/share/zoneinfo/. I'm in the UK so I need to append tz=Europe/London to the boot parameters in order to set it correctly, and lang=uk for the keyboard.

The CA5 has no battery-backed Real Time Clock. When the system boots it thinks the time is midnight on the 1st January 1970. DSL does have a script (/usr/local/bin/gettime.lua) to set the time from an NTP server. Whilst this works for the default NIST time server I couldn't get to work with any of the local UK servers - even after changing the UDP port from 13 to 123. I ended up trawling the net and amending Tim Hogard's perl script which I saved as /usr/local/bin/ntp.pl. We then need to add the command ntp.pl to the /opt/bootlocal.sh file. I put it in as the first item in the file and had no problem with that - the underlying networking was up and running by the time the script was run.

Hostname

This is covered in the DSL Wiki - which is slightly inaccurate as some items are absent - but it does cover all bases.

I edited the following files: /etc/hostname, /etc/hosts, /etc/mailname to change "box" to the new host name.

There was no entry in /etc/init.d/knoppix-autoconfig and /opt/ethn.sh didn't exist.

However the startup script /etc/init.d/knoppix-autoconfig calls the sethostname() function in the file /etc/init.d/dsl-functions. This, using the name that was specified on the command line or the default name of "box", attempts to (re)create the /etc/hosts and /etc/hostname files. Luckily this fails as our root file system is read-only at that time. It also sets the hostname within the system. I modified the sethostname() function to use the existing name in /etc/hostname (line 173), and commented out the lines that attempted to rewrite the system files. (All our files are persistent and don't need to be (re)created). The function now looks like:

    169 sethostname(){
    170 # Set hostname
    171 # This function contributed by henk.1955 from the DSL user forums
    172   HOSTNAME="$(getbootparam host 2>/dev/null)"
    173   [ -n "$HOSTNAME" ] || HOSTNAME="$(cat /etc/hostname)"
    174   echo -n "${BLUE}Setting hostname to ${YELLOW}$HOSTNAME${NORMAL} "
    175 #  rm -f /etc/hostname
    176 #  echo $HOSTNAME >/etc/hostname
    177   /bin/hostname --file /etc/hostname
    178 #  rm -f /etc/hosts
    179 #  cat >/etc/hosts <<EOT
    180 #127.0.0.1 $HOSTNAME localhost
    181 #
    182 # The following lines are desirable for IPv6 capable hosts
    183 # (added automatically by netbase upgrade)
    184 #
    185 #::1     ip6-localhost ip6-loopback
    186 #fe00::0 ip6-localnet
    187 #ff00::0 ip6-mcastprefix
    188 #ff02::1 ip6-allnodes
    189 #ff02::2 ip6-allrouters
    190 #ff02::3 ip6-allhosts
    191 #
    192 #EOT
    193
    194   echo "${BLUE}Done.${NORMAL}"
    195   return 0
    196 }

Add users

Simply done through the menus system: DSL/Setup/AddUsers

Remove startup message

Edit .xinitrc and comment out (or delete) the line dillo...getting_started.html... (Line 28 in my file). Note that this file will be in every user's home directory.

Video Mode

Currently I have an old qdi LM-510 monitor connected. It's basic specs are:

The default DSL 1024x768 Xvesa setting doesn't work for me. All I get is a flashing "Out-of-Range" message on the screen. Interestingly it is exactly the same if I plug in my modern widescreen Benq monitor. Whilst this server will be running headless and I won't be using be using the desktop things like this bug me and it would be nice to find a solution. However, as the modern Benq monitor also fails to display anything, it makes me wonder if there is a more to this than a simple display configuration issue.

A quick Google on the subject threw up the following snippets:

I've parked this for now but intend to revisit it.


Applications

I want the following packages running on the server:

ftp    Standard 'website builder' style packages upload their images via FTP.
ssh    I run systems such as these 'headless' (no keyboard or screen) and use an ssh client to connect to the server should I need to logon on to it.
samba    Personally I create/edit html files directly rather than using an authoring package. I normally do this using Editplus on my Windows box with the website files appearing on a mapped drive. The server has to run Samba in order to be able to share its files with the Windows client.
apache    The web server. Apache is what my hosting company runs so it would seem to be a good idea to use it here as well. Also my web sites use SSI and I use apache's 'Virtual Web sites' feature both of which I don't think are supported by the already installed Monkey Server.

ftp & ssh

ftp and ssh are already installed. We just to ensure that they startup automatically every time the server starts up. We do this by adding the startup commands to the file: /opt/bootlocal.sh. Edit the file and add the lines:

/usr/sbin/betaftpd >/dev/null
/etc/init.d/ssh start

samba & apache

The Samba server and Apache are not installed by default and have to be installed. This very easy to do using the MyDSL tool. This is run via the menu sequence DSL/MyDSL/MyDSL Browser. MyDSL will start, and as this is the first time it has been run, will want to download the database of applications. Once that is loaded it is just a matter of clicking on net and then selecting samba.dsl. Finally click on Install Selected.

Repeat this for apache-2.0.54.tar.gz.

Next we need to edit the configuration files so that they do what we want. The final step is to ensure that they start automatically when the CA5 powers up.

The Samba configuration file is: /etc/samba/smb.conf. I'm no expert here and my simple and totally insecure configuration file is:

[global]
workgroup = PTOWERS
netbios name = moray
server string = Samba Server

hosts allow = 192.168.10. 127.0.0.1

log file = /var/log/log.%m
max log size = 50
security = share

[user1]
comment = Data
path = /home/user1
force user = user1
force group = staff
read only = no
guest ok = yes

[user2]
comment = Data
path = /home/user2
force user = user2
force group = staff
read only = no
guest ok = yes

Note: This is sitting on my home LAN in a trusted environment so I'm happy about the total lack of security. I also like the ease with which I can map drives to the server (no unnecessary passwords). YMMV.

Having created your version of the configuration file you can try it out from the command line by typing smbd -i -d 5. This let's you easily(?) trackdown any errors as you need to stop and then restart samba every time you make any changes to the configuration file.

With Apache I found the httpd.conf configuration file in /opt/wwwroot/conf/. Setting this up is not a trivial exercise and this page is not an Apache configuration "How To". Have fun. Apache is started/stopped/restarted with the command: /opt/wwwroot/bin/apachectl (start|stop|restart)

When you've got both of them sorted out it's back to /opt/bootlocal.sh to add the two lines:

/usr/sbin/smbd
/opt/wwwroot/bin/apachectl start

That's all folks!

 


Any comments? email me.    Last update August 2010