Maybe you’ve got one of these laptops and wonder what to do with it?
I’m proposing here to use it into a basic MP3 music player (a Linux system of course!)
Let’s see what we’ve got here :
IBM ThinkPad 365X, model from 1997
Pentium 133MHz, no MMX!
2.1Gb 2.5″ HDD (initially running Win95)
No cdrom drive!
No network interface!
Why Slitaz 1.0?
- Because it features a modern (2.6.2x) kernel that is able to boot with only 16Mb of RAM!
- It has the sound driver we need (the ES1688 sound module)
Why Slitaz 1.0 and not 2.0 or 3.0?
- my tests showed that 1.0 was easier to get working, and for our use on this hardware it will be sufficient!
- a more powerful “installer computer” (256Mb or more RAM recommended), to boot Slitaz and install it onto the laptop’s HDD or CF card.
- if you intend to use the laptop’s HDD, you’ll need an IDE 40 to 44 pins adapter
- if you want to use an IDE Compact Flash card instead, you’ll need two adapters : an IDE 40pin to CF (for the “installer computer”) and an IDE 44pin to CF for the laptop. Those adapters are cheap and can be found anywhere.
1. Get and burn the Slitaz 1.0 iso
2. Plug your ThinkPad’s harddrive or Compact Flash card into your “installer computer”
(128Mb minimum capacity, Slitaz needs ~90-100Mb!)
Be sure to disconnect all other HDDs if any, to avoid accidental data loss!
Connect it as your primary master, so that the drive is recognized as /dev/hda in Slitaz, using an IDE 40 to 44 pin adapter or IDE 44pin to CF adapter
Warning : ensure you plug it the correct way, not inverting pin numbers!
3. Boot with the Slitaz cd
Select your keyboard, bypass the sound card detection and select your X display mode.
4. Prepare your destination drive within Slitaz
Use Gparted to create 2 partitions :
- an active EXT2 partition for the Linux system (90-100Mb should be enough) – will be /dev/hda1
- a FAT partition for the music files (all the rest of the drive space) – will be /dev/hda2
5. Launch the SliTaz installer (in the System Tools menu), do a full install on the /dev/hda1 partition.
6. Reboot the system on the newly slitaz-installed HD/CF
7. In a terminal, login as root (password is “root”)
Use tazpkg to install the following packages :
Tip : the list of packages can be seen here
# tazpkg get-install mpg123
# tazpkg get-install libtool
(this one is needed by mpg123, but at the time there was a dependency break)
BUGFIX: mpg123 package in slitaz 1.0 was broken, we need to create the missing .la files in /usr/lib/mpg123 in order to output sound
# nano /usr/lib/mpg123/output_alsa.la
dlname='output_alsa.so' library_names='output_alsa.so output_alsa.so output_alsa.so' old_library='output_alsa.a' inherited_linker_flags='' dependency_libs=' /usr/lib/libasound.la -lpthread -lrt /usr/lib/libltdl.la -ldl -lm' weak_library_names='' current=0 age=0 revision=0 installed=yes shouldnotlink=yes dlopen='' dlpreopen='' libdir='/usr/lib/mpg123'
# nano /usr/lib/mpg123/output_oss.la
dlname='output_oss.so' library_names='output_oss.so output_oss.so output_oss.so' old_library='output_oss.a' inherited_linker_flags='' dependency_libs=' /usr/lib/libltdl.la -ldl -lm' weak_library_names='' current=0 age=0 revision=0 installed=yes shouldnotlink=yes dlopen='' dlpreopen='' libdir='/usr/lib/mpg123'
# nano /usr/lib/mpg123/output_dummy.la
dlname='output_dummy.so' library_names='output_dummy.so output_dummy.so output_dummy.so' old_library='output_dummy.a' inherited_linker_flags='' dependency_libs=' /usr/lib/libltdl.la -ldl -lm' weak_library_names='' current=0 age=0 revision=0 installed=yes shouldnotlink=yes dlopen='' dlpreopen='' libdir='/usr/lib/mpg123'
(Optional part. If your CF is low capacity, this will free about 25megs)
Reclaiming some space :
# tazpkg list |more
to see installed packages
then remove unused packages (X11, etc)
# tazpkg remove xorg
(will ask yout remove dependant packages as well)
# tazpkg remove sqlite
# tazpkg remove glib
I found that removing a certain package (which one I can’t remember) destroyed the /dev/null entry and prevented the system to boot, so we recreate it right now :
# mknod /dev/null c 1 3
# chmod 666 /dev/null
To gain further space we could remove the unused kernel modules in :
But you may want to keep them, so that you can have sound/network access when booting your HD/CF on another machine.
8. Customize the configuration and boot scripts
# nano /etc/rcS.conf
modify as follow :
CHECK_FS line (we are going to set our filesystem read-only later)
enable the sound module ES1688 :
LOAD_MODULES="vfat nls_utf8 ohci_hcd snd-es1688"
modify the RUN_SCRIPTS line :
RUN_SCRIPTS="bootopts.sh network.sh i18n.sh local.sh"
disable other daemons :
Next, modify the /etc/inittab file :
# nano /etc/inittab
remove some ttys as they consume precious memory :
comment the tty3 to tty6 lines. (2 ttys left should be enough!)
Then the main startup script :
# nano /etc/init.d/rcS
modify as follow :
# Remount rootfs rw.
echo "Remounting rootfs read/write"
/bin/mount -o remount,rw /
# Remount rootfs READ ONLY!
echo "Remounting rootfs read-only"
/bin/mount -o remount,ro /
then add after the “/bin/mount -a” line :
/bin/mkdir -p /var/log
/bin/mkdir -p /var/tmp
since we don’t use X, we can delete the 6 lines after
# Set up tmp X11 and ICE dir.
Include our mp3 player startup routine :
# nano /etc/init.d/local.sh
add the following lines :
echo "FREDO's MP3 PLAYER STARTING UP"
find /mnt/mp3 -name "*.mp3" | sort >/tmp/playlist.txt
mpg123 -v -C -@ /tmp/playlist.txt
echo "END OF PLAYLIST!"
Finally, we are going to modify /etc/fstab so that our system is mounted read-only at boot-time
(will disable writes onto the CF for better lifetime) and our music data partition is mounted (read only) too.
# nano /etc/fstab
add the following lines :
tmpfs /tmp tmpfs defaults 0 0
tmpfs /var tmpfs defaults 0 0
/dev/hda2 /mnt/mp3 auto defaults,ro 0 0
Create the /mnt/mp3 folder
# mkdir /mnt/mp3
9. Shutdown, copy some mp3 files onto the data partition
It’s convenient to use a (usb) card reader.
10. Put back your HDD/CF in your IBM ThinkPad and boot it!
You may need to run alsamixer once, in order to get the desired sound levels :
(to quit mpg123 hit the “q” key, then login as root)
# mount -o remount,rw /
# alsactl store
to see cpu/mem/process usage
Below, my setup with a compact flash + adapter in place of the original HDD, no battery.