List of tweaks for Red Hat 7.0 on Picocheep (Sharp Actius A150)

Initial Install

With the basic Red Hat 7.0 PCMCIA install disk, I would get a kernel panic for every PCMCIA device except my webgear aviator wireless lan card. Unfortunately for you, I just took the cowardly way out and simply used that card to do an HTTP install. The panics happened with my el-cheapo PCMCIA CD-Rom, and my el-cheapo NDC 10/T ethernet PCMCIA card.

The problem is no doubt the interrupt problem solved by the PCIC_OPTS fix listed next. I assume there is a way to get the boot disk to use this type of setup, but it is probably just as easy to do a hard drive install (use windows to move the files onto the hard drive first) or find a PCMCIA card that happens to work (like I did).

Another attack might be to go into the bios setup and disable everything you can find just long enough to get the install working, then customize things later. I don't know which interrupt crashes the machine, but you might work around it this way.

On the other hand, these webgear cards are only about $150 per pair, including PCMCIA to ISA Host adapters, so maybe this is just the excuse you were looking for to pick up a pair. Having this small a laptop with wireless ethernet is extremely nice.

Modified /etc/sysconfig/pcmcia

I also modified the /etc/sysconfig/pcmcia file and changed the "PCIC_OPTS" to include irq 10 and 3, which are the two interrupts that windows wants to use for my PCMCIA devices with plug and play. New file contents are as follows.

/etc/sysconfig/pcmcia

   PCMCIA=yes
   PCIC=i82365
   PCIC_OPTS="irq_list=10,3"
   CORE_OPTS=

Many sound fixes

Note that all these problems could likely be eliminated by using the non-open sound driver alternatives available for linux. Some people are opposed to these drivers because of their non-free nature. I have no such compunction, but I am however a terrible cheapskate, and don't think a driver is worth $30 and the hassle of purchase.

When recovering from sleep mode and upon initial startup, the barely compatible cs4232 sound configuration gets badly confused. Note that the initial configuration is done via the Red Hat sndconfig tool.

I can use sndconfig and just say there is a soundblaster installed, and the sound is adequate through the system speaker, but has poor fidelity for serious use (like MP3's). Basically, I think the default sound blaster driver does not do better then 22kHz. The cs4232 driver can do 44Khz, and you can definitely hear the difference.

The cs4232 setup sounds good when working, but has some sort of race condition, and must be uninstalled then reinstalled. This appears to change the order of the opl and cs4232 modules, and then things start working. I have no idea why this solves the problem. I got the dma, irq, and ioport settings for sndconfig from windows. First, here is /etc/modules.conf for the sound chip:

/etc/modules.conf

       alias parport_lowlevel parport_pc
       alias sound-slot-0 cs4232
       options sound dmabuf=1
       alias midi opl3
       options opl3 io=0x388
       options cs4232 io=0x530 irq=5 dma=1 dma2=3 mpuio=0x330 mpuirq=5
And here is /etc/sysconfig/soundcard . This was automatically created by the Redhat sndconfig program:

/etc/sysconfig/soundcard

  # THIS FILE IS WRITTEN BY SNDCONFIG
  # PLEASE USE SNDCONFIG TO MODIFY
  # TO CHANGE THIS FILE!
  # There should be no spaces at the start of a line
  # or around the '=' sign
  CARDTYPE=CS4232

Next, I coded up a little program in /usr/local/bin called fixsound. Make sure you set the permissions ( chmod 744 /usr/local/bin/fixsound ) to executable.

/usr/local/bin/fixsound

      #!/bin/sh
      #
      # Unfortunately there seems to be some sort of problem in the (buggy)
      # sound hardware.  Removing then restarting the driver somehow fixes
      # the problem.  The order of the opl and cs4232 drivers are changed,
      # and this seems to clear things up.  I could probably also fix this
      # in the modules dependency file, but I would rather fix it after the
      # fact with a simple script then go messing in there... call me a
      # whimp...
      
      /sbin/rmmod cs4232
      /sbin/modprobe sound

Then I added /etc/sysconfig/apm-scripts/apmcontinue to call this upon system start, and restart from suspend. I set the bios to suspend to disk. Given the stability of Linux, about the only time this thing gets rebooted is to switch operating systems (which on the laptop is pretty rare).

/etc/sysconfig/apm-scripts/apmcontinue

  #!/bin/sh
  # Invoke my kludge to get the sound modules back working on
  # sharp actius A150 (same fix is necessary on initial boot).

  PROG="$1"

  case "$PROG" in
      start)
  	/usr/local/bin/fixsound
      ;;
      resume)
  	/usr/local/bin/fixsound
      ;;
      *)
      ;;
  esac

Network convenience script

I often found myself bouncing the network card to get a new DHCP assigned address from my firewall, so I wrote a script to do this on command. /usr/local/bin/bouncenet

/usr/local/bin/bouncenet

  #!/bin/sh
  echo "Bouncing network interface"
  /sbin/ifdown eth0
  /sbin/ifup eth0

Fix apmd

In RH7, there appears to be a misconfiguration of the /etc/sysconfig/apmd configuration file. This caused the laptop to sleep fine when the lid was closed if in a non-graphical window, but to not sleep correctly until a mouse input was received if in an X window. The lines regarding the screensaver lock in /etc/sysconfig/apmd need the following fix:

(very end of) /etc/sysconfig/apmd

  # Set LOCK_X to 1 if you want to lock all your X displays at suspend
  # killbill: note this is a bug, to not set lock you have to set
  # explicitly to zero, not setting it will still enable it.
  # LOCK_X=1
  LOCK_X=0

(Updated 11/16/00) Sane looking font support

For better or worse, the fact is that windows platforms dominate the web, and web designers (myself included) tend to code to the most popular platform. This means they generally design around the standard fonts available with windows.

This means that (especially with the 800x600 display on the older Actius models) many common websites look pretty awfull with nearly illegible fonts.

Fortunately, XFree86 supports true type fonts very well, and the font definitions can be easily moved from an existing windows install (especially in a dual boot configuration where the dos partition is mounted on boot, as my system does).

Here is how to add the default set of windows true type fonts on the RedHat 7.0 installation. Other distributions should be very similiar, find the documentation on xfs or fs , as well as looking at your XF86Config file for hints on directory locations.

  1. Find a set of true type fonts to install. I just used the command find /mnt/dosc -name *.ttf for my system (where /mnt/dosc is the mount point for my dos partition containing a rather vanilla windows 98 installation). This command showed the fonts in the /mnt/dosc/windows/fonts directory.
  2. Create a true type directory in the /usr/X11R6/lib/X11/fonts directory ( mkdir /usr/X11R6/lib/X11/fonts/TrueType ). Change the permissions to match the other directories in that fonts directory ( chmod 755 /usr/X11R6/lib/X11/fonts/TrueType).
  3. Edit your XF86Config file and add this full directory path to the list of existing font directory paths. Use emacs /usr/lib/X11/XF86Config (or other editor) and add a "Font Path" line with that directory. Note that I don't believe this step is really necessary, I think it gets overridden later. But I did it, and this configuration worked, so I thought I ought to include it.
  4. Edit /etc/X11/fs/config to include your new true type directory. This is the important step.
  5. Copy all the windows fonts into the new TrueType directory.
  6. Restart X. Netscape (and other apps) should now be using quite nice looking fonts.

Summary

So far, that's it to created a darned functional little laptop running RH7.0... I am quite impressed with this latest Redhat release, especially for a point zero release. Glad to see this, I was getting pretty concerned with 6.x, and none of those systems supported my webgear aviator cards without a lot of pain and suffering.

For everyone, the sharp actius A150 is a fantastic little laptop for linux. Small, light, powerful enough, fantastic display. Very nice. Note that my laptop is actually a Mebius PC-PJ1-M2, which was an international version of the Actius A150. It was brought to the states before the Actius appeared.

Mebius Keyboard US Modification

The Mebius has an international keyboard layout. This may be great for others, but I hated it. As a consultant, I probably use 5 different keyboards everyday. I want them to be as similar as possible.

Note that with Linux and Windows, you can tell the operating system that it is not actually an international keyboard, but actually a US keyboard. This gets the keys in the right places (for the most part), but now the labels on them are wrong.

My solution? An elegant hack (in the old noble sense of the word). I scanned the keyboard into my scanner, fired up my ancient copy of photostyler (could have used gimp), and manually retouched the image to copy and paste the bitmaps for the appropriate keys to the appropriate places for the new keyboard. I have the jpeg if anyone wants to repeat this exercise.

Then, I printed this on a 8x11 piece of sticker from my inkjet printer. I found sheets of these at a local office supply store, just like name tags for the inkjet printer but without the cuts. With a little work, the nametag ones could be made to work as well.

Then, I took the resulting print out to the garage and gave it about 5 coats of automotive clear coat laquer (any auto parts store). Between each coat, I let things dry (not long) and buffed slightly with steel wool until the finish was dull. Eventually, the paper stopped absorbing clear coat, and the sticker had a nice glossy durable finish.

I found this finish to have too much glare for use in the dark (the screen reflected and I could not make out the keys). A final rub with some fine steel wool buffed the paper to a nice matte finish. Finally, I cut this sticker down to individual key sized pieces... make them smaller then the top of the key so they don't pop up... you want them completely flat and flush on the tops of the keys.

Put each one in the right place, and it looks as good as factory. People don't even notice unless I mention it and tell them to look closer. This technique could also be used to "skin" a keyboard (like the winamp skins) for a pretty cool custom look. The only real drawback is a few slightly smaller keys... the international keyboard has more (smaller) keys, notably around the space bar. If I ever get bored, I may map these keys to particular tasks (launch web browser, launch MP3 player, etc). You end up with 5 extra keys.

After nearly a years use, the stickers are holding up great, and still look as good as new (which is more then I could say for the original printing on some of the keys before sticker application).

Firewalling

Script kiddies are everywhere, and anytime your system has been compromised you really have to scrub everything and do a fresh install. I can't count how many hours I have wasted securing systems and recovering cracked systems that I would rather have been spending developing resources like this, or developing open source software. Listen cracker boy... the neighborhood you are trashing is your own...

Anyway, enough editorial. At home and at most client sites, you are behind a firewall. You can't trust any client system, however, so you really need to take a few steps to secure your box.

This is easier under Red Hat 7, as you can scare up the gnome-lokkit package and give it a run. The default configuration it created was pretty good for a basic security configuration, but it caused me some problems with DNS and shut down FTP. Since I am often at poorly or non configured client sites, I need FTP server open and running, as it is about the only thing I can count on those brain dead windows boxes being able to do right.

Shown here is my final /etc/sysconfig/ipchains script setup. It is not the most secure setup in the world, I am still vulnerable to weak password guessing, FTP, DNS, Apache, and telnet exploits.

If the IP address was static, I could lock it down better, but since I am moving from network to network I can't do this easily. Maybe a better approach would be to only allow these services when using non-routable IP addresses (i.e. 10.x.x.x or 192.168.x.x), but I can't even count on clients to get this much right, so this will eventually cause me some grief. Also, please don't confuse me for a firewall expert, the following changes are at best a kludge.

It should stop most script kiddies though, especially if I keep my packages up to date (via the RedHat up2date tool). Also note that any use of telnet or FTP is a danger, as any sniffer will easily catch my password, though this would not immediately get them root.

/etc/sysconfig/ipchains

:input ACCEPT
:forward ACCEPT
:output ACCEPT
-A input -s 0.0.0.0/0.0.0.0 -d 0.0.0.0/0.0.0.0 80:80 -p 6 -j ACCEPT -y
-A input -s 0.0.0.0/0.0.0.0 -d 0.0.0.0/0.0.0.0 22:22 -p 6 -j ACCEPT -y
-A input -s 0.0.0.0/0.0.0.0 -d 0.0.0.0/0.0.0.0 23:23 -p 6 -j ACCEPT -y
-A input -s 0.0.0.0/0.0.0.0 -d 0.0.0.0/0.0.0.0 20:20 -p 6 -j ACCEPT -y
-A input -s 0.0.0.0/0.0.0.0 -d 0.0.0.0/0.0.0.0 21:21 -p 6 -j ACCEPT -y
-A input -s 0.0.0.0/0.0.0.0 67:68 -d 0.0.0.0/0.0.0.0 67:68 -i eth0 -p 17 -j ACCEPT
-A input -s 0.0.0.0/0.0.0.0 -d 0.0.0.0/0.0.0.0 -i lo -j ACCEPT
-A input -s 0.0.0.0/0.0.0.0 53:53 -d 0.0.0.0/0.0.0.0 -p 17 -j ACCEPT
-A input -s 0.0.0.0/0.0.0.0 -d 0.0.0.0/0.0.0.0 -p 6 -j DENY -y
-A input -s 0.0.0.0/0.0.0.0 -d 0.0.0.0/0.0.0.0 -p 17 -j DENY

Still to try

Feel free to send me questions or suggestions for this page. Mail to Bill@KilgallonFamily.com, and I will do my best to respond in a timely manner.

Addendum


I have switched to an IBM thinkpad 570 (nice little box, cheap on ebay) and found a bug where if I let grub (RedHat 7.2) boot windows, the windows APM support is then broken. This wasted GOBS of my time. Sigh. Anyway, I just wanted to tack this note out here since I know this page is already ranked reasonably high on the search engines, and hopefully anyone else searching for windows win98 winme apm grub linux problem or anything like it will find this little note. Just ditch grub, go back to lilo (the anaconda installer left a correct configuration in my /etc directory, all I had to do was copy it to the right name), run lilo, and your apm support will reappear in Windows. Feel free to email me if you need help with this.

Addendum to Addendum


Jeepers! In the time it took me to compose these changes to this page (5 minutes), RedHat had gotten back to me indicating that the bugzilla bug I logged was a known issue (though why my search failed to find it is unknown) and that a fix is available. Get the fixed grub from http://people.redhat.com/~katzj/grub . Now THATS support! What do you think would have happend if I had called Microsoft with that same question :)