Walltop: Difference between revisions

From Wildsong
Jump to navigationJump to search
Brian Wilson (talk | contribs)
Brian Wilson (talk | contribs)
mNo edit summary
 
(56 intermediate revisions by the same user not shown)
Line 1: Line 1:
WallTop computers... recycle an old laptop by removing all the extraneous parts such as the cdrom drive, floppy drive, (dead) battery and then hanging it on the wall.
WallTop computers... the concept is to recycle an old laptop by removing all the extraneous parts such as the cdrom drive, floppy drive, (dead) battery and then hanging it on the wall.


I am building one from an old Dell Inspiron 3700.
= Available hardware =


== Operating system ==
My first attempt is based on a Dell Inspiron 3700 C466GT.


I looked at using Debian, Damn Small Linux, Puppy Linux (which immediately panics on boot), and Movix. I decided I might as well stick with Ubuntu so I am building a custom Live CD. I will then transfer it to a Compact Flash card, which will be plugged into an adapter and replace the incredibly noisy stock 4200 rpm hard drive.
* 466 MHz Celeron processor
* 256 MB PC100 SODIMM memory
* one PATA slot
* two broken PC card slots
* one USB port


See
Removed: case, 4200 RPM hard drive, dead battery
http://www.debuntu.org/how-to-customize-your-ubuntu-live-cd


===Set up - mount cd and copy files===
Added: a shadow box frame from Michaels, a power supply from OSUsed, a CF to 44pin PATA adapter, a 1GB CF card, and an ASUS 802.11g WiFi USB adapter


mkdir /tmp/livecd
I had to modify the frame to add cooling slots.
mount -o loop /export/bellman/home/bwilson/Dell/xubuntu-9.04-desktop-i386.iso /tmp/livecd
 
mkdir /home/bwilson/livecd
This laptop will only boot when you touch its power on button. To make the button accessible I mounted the motherboard upside down (what used to be the top is towards the wall when it's hanging up.
  mkdir cd
I drilled a hole in the back about 3/8" diameter. You can poke the button with a pencil eraser to boot it up. Yes.. its a pain.
  rsync --exclude=/casper/filesystem.squashfs -av /tmp/livecd/ cd
 
== More hardware available for future projects ==
 
Micron TransPort GX2: Pentium III 1.2Ghz
* 15-inch LCD at 1,280-by-1,024
 
http://www.pcmag.com/article2/0,2817,7733,00.asp
 
Micron TransPort XT Notebook Computers CPU: Intel Pentium III 750 ~ 850MHz
* Standard Memory: 64MB~256MB
* Maximum Memory: 512MB
14" screen
 
http://www.pcworld.com/article/54784/micronpc_launches_transport_xt_notebook.html
 
= The software =
 
== Which distribution to use? ==
 
After much research and experimentation I settled on
[http://live.debian.net/ Debian Live!]
 
This allows me to build an image on a big fancy Ubuntu desktop system ([[Raven]]) and test it in qemu.
 
Once the image is built I transfer it to a Compact Flash card, which will be plugged into an IDE adapter and replace the incredibly noisy stock 4200 rpm hard drive.
 
I am also now using Debian Live! to build [[Asterisk]] phone systems.
 
Some other options that I investigated:
*Debian
*Damn Small Linux
*Puppy Linux (which immediately panics on boot)
*Movix
*Ubuntu, building a [http://www.debuntu.org/how-to-customize-your-ubuntu-live-cd custom Live CD]
 
== Debian Live! installation ==
 
[http://wiki.debian.org/DebianLive Debian Live wiki]
 
[http://live.debian.net/manual/html/ch03s03.html Building an USB/HDD image]
 
[http://wiki.debian.org/FluxBox FluxBox]
 
Install the tools to build Debian Live! systems
 
apt-get install live-helper
 
Build an image.
 
lh_clean --binary
lh_config -b usb-hdd -k 686 --bootstrap-flavour minimal\
--packages-lists "stripped" --binary-indices disabled\
--memtest "disabled"\
--packages "x-window-system-core fluxbox\
  openssh-server vlc gnash portmap nfs-common\
autofs debconf-english"\
  --bootappend-live "nolocales" --syslinux-timeout 50
 
I build on a 64 bit machine so I have to say -k 686 to get the 32 bit kernel
 
Add scripts to config/chroot_local-hooks
 
'''02-fix_inittab.sh''' - changes runlevel to 5 and adds the tty7 login line
so I have only one login running instead of default 5
 
'''40-bash_profile.sh''' - append or create a .bash_profile script that will run a script from nfs and then do a 'startx'.
 
'''50-windowmanager.sh''' - configures fluxbox startup files
 
'''99-make-export.sh''' - make the directories needed for autofs
 
Add files to config/chroot_local-includes
I add the autofs.* files that I use to mount nfs servers.
   
   
  mkdir squashfs custom
Doing customizations, do this (as root)
  modprobe squashfs
lh_clean --binary
  mount -t squashfs -o loop /tmp/livecd/casper/filesystem.squashfs squashfs/
lh_config
cp -a squashfs/* custom
lh_bootstrap
# Prepare for a chroot system so you can do hacks
umount squashfs
lh_chroot
umount /tmp/livecd
lh_chroot_hosts install
rmdir /tmp/livecd
lh_chroot_resolv install
lh_chroot_proc install
chroot chroot
#do the hacks here, for example "apt-get install asterisk".
exit
# Now remove the changes make to do chroot
lh_chroot_hosts remove
lh_chroot_resolv remove
lh_chroot_proc remove
# I wonder what this does
lh_binary
# Build the image
lh_build
 
Copy image to CF: dd if=binary.img of=${USBSTICK}
 
To test image, start in qemu or convert img file to a vmdk and use vmware
 
To use in walltop, transfer CF to laptop and boot it
 
Customization that I might want to do
 
other codecs???
  emacs21-nox
  libcurl3
  realplayer?
firefox - use iceweasel, unless like me your laptop is puny, then forget it!
flash - use gnash??
 
I need something to do a slide show of pictures, driven from command line.
Image-magick supports this.
 
Starting X / fluxbox without a window manager
http://www.debianadmin.com/how-to-auto-login-and-startx-without-a-display-manager-in-debian.html
 
=== Building a working image ===
 
To make (large) changes, you build a new, complete image from scratch.
You copy the new image to CF, put it in the computer, and boot.
 
I add scripts to config/chroot_local-hooks. I keep backup copies of the scripts at the top level so that I can wipe the config/ directory and rebuild it from scratch.
I keep copies of the files that will be included in MyConfigIncludes/
 
Create scripts to customize the images
 
'''''nn-name''.sh''' where 'nn' is a number to control execution order, and 'name' is a meaningful name, for example '''01-password.sh''' would be used to install local user accounts and set user and root passwords.
 
== Networking ==
 
Depending on how I deploy things, wired or wifi might be easier.
From my notes below I have concluded wired is easier!
 
=== Wired network ===
 
I ended up pulling a USB-to-ethernet adapter out of my junkbox. It's a 3COM 3C19250 from a 3COM [[Audrey]]. I hooked it up to my VirtualBox simulated walltop and it started right up. Now I have to do the DHCP set up in Debian Live and see if it works on the Dell hardware.
 
=== WiFi Network ===
 
These are WiFi cards I ''was'' considering using. They are still in my junk box but when I actually went to plug one in, I found that this Dell's PC card slots are messed up, so instead I plugged in an ASUS USB adapter.
 
D-Link DW650M
http://sourceforge.net/apps/mediawiki/ndiswrapper/index.php?title=D-Link_DWL-G650M


===Access the image===
Microsoft MN-720


cp /etc/resolv.conf /etc/hosts custom/etc/
I have not completed testing of ndiswrapper since I switched to using the ASUS USB adapter. Here are my notes for the NEXT walltop. I have several more laptops...
chroot /home/bwilson/livecd/custom
mount -t proc none /proc/
mount -t sysfs none /sys/
export HOME=/root


===Customize the image===
To use these I need to use the manufacturer's drivers + ndiswrapper.
http://wiki.debian.org/NdisWrapper


Packages to remove from the stock image.
In chroot environment
m-a prepare
m-a a-i ndiswrapper
echo ndiswrapper >> /etc/modules


apt-get remove --purge gnome-games
==== WiFi Security settings ====
# non-english language packs
for i in `dpkg-query -W --showformat='${Package}\n' | grep language-pack | grep -v en`; do apt-get remove --purge $i; done


for i in `dpkg-query -W --showformat='${Package}\n' | grep gimp`; do apt-get remove --purge $i; done
With this device it's just a matter of plugging it in and then getting the correct security settings for the network. I was able to turn off security on my Linksys and get a connection. Since my ultimate goal is to take this to work and hang it on the wall there, turning security at the WAP off is not an option.


apt-get remove --purge abiword gnumeric aspell aspell-en
I first I spent a couple hours wrestling with getting it to work with wpa_supplicant on an Ubuntu desktop. I tried all sorts of combinations of security settings to no avail. Very frustrating.
apt-get remove --purge cdparanoia cdrdao dvd+rw-tools brasero genisoimage
apt-get remove --purge pidgin pidgin-data thunderbird


apt-get remove thunar xsane-common imagemagick imagemagick-doc
Then I found [http://wicd.sourceforge.net/ wicd]. I installed it (apt-get install wicd), started the daemon (sudo wicd) and the client (wicd-client -n) and had a link up in about 60 seconds. Conclusion: '''USE WICD'''!!


# EVERYTHING Gnome related - don't want a desktop
What I actually ended up doing was installing wicd, using it to set up wpa_supplicant, and then removing it from my installation. The wpa_supplicant configuration that worked that I created with wicd-curses looks like this
apt-get remove --purge `dpkg-query -W --showformat='${Package}\n' | grep gnome`


  # Windows friendly things
  ap_scan=1
  apt-get remove --purge ntfs-3g ntfsprogs
  ctrl_interface=/var/run/wpa_supplicant
# System utilities
  network={
  apt-get remove --purge logrotate cups cups-bsd cups-common reiserfsprogs
      ssid="wildsong"
      scan_ssid=0
      proto=WPA RSN
      key_mgmt=WPA-PSK
      pairwise=CCMP TKIP
      group=CCMP TKIP
      psk=67c4e0a7ff7736641fdf9bc8094c45a8b7c60a33f45321f6c3d08f42ec0397af
  }


# Documentation
Check the downloads page for more documentation
apt-get remove --purge docbook-xml manpages


Remove the desktop
'''In Debian Lenny''', wicd is a [http://www.backports.org/dokuwiki/doku.php?id=instructions backport], so installing it requires additional work. Add this to /etc/apt/sources.list; like this


echo 'deb http://www.backports.org/debian lenny-backports main contrib non-free ' > config/chroot_sources/backports-wicd.chroot
wget -O - http://backports.org/debian/archive.key -O config/chroot_sources/backports-wicd.binary.gpg


Update the /etc/apt/sources.list file to activate other repositories.
NOTE '''Backports is also required for the USB firmware'''
Then get updates


Then in the chroot environment I do this
  apt-get update
  apt-get update
apt-get install debian-backports-keyring
apt-get -t lenny-backports install wicd
...which installs about a zillion more dependent packages! All just to get my  wireless link going!
== SSH services ==
The lsh-server is a small SSH server.
By default it generates keys on the first run, which alas is every time on a Debian Live system. So I generate keys on the development host and copy them into the config tree.


Add the things I really want
This is how I generate the seed file and keys.


  apt-get install emacs21-nox libcurl3 openssh-server
  mkdir ~/.lsh && cd ~/.lsh
  realplayer
lsh-make-seed --sloppy -o yarrow-seed-file
flash
  lsh-keygen | lsh-writekey


adduser bwilson
== Testing ==
Give root a password
Copy in .ssh directories for root and bwilson


Do the update at the end, there will be less to do
To test the image in a virtual machine, you can either start it directly in qemu or convert the img file to a vdi and use [[VirtualBox]]


apt-get upgrade
I really don't like using Qemu so I deleted the instructions that I used to have here. I don't intend to use it again.


Good enough for now
Converting the IMG file to a VDI file


  apt-get clean
  VBoxManage convertfromraw -format VDI binary.img binary.vdi
umount /proc/
 
umount /sys/
Now you can create a virtual machien and mount the VDI as a virtual disk and boot from it. It boots about 10 times faster on the development system as on the real computer. Poor little obsolete laptop!
exit
rm custom/etc/resolv.conf custom/etc/hosts
rm -rf custom/tmp/*


===Creating a new ISO image===
You can also the virtual machine to boot from the USB stick but testing the img file first means you don't have to keep copying the image to the stick.)


The extra 'rm' commands are just in case we've been here before.
== Deployment ==


chmod +w cd/casper/filesystem.manifest
Copy the image to a CF card, completely overwriting it: '''dd if=binary.img of=''<devicename>'''''. You can get the device name with '''dmesg''', it will be buried in the last few messages after you insert the stick. Something like /dev/sda. Don't use the first partition (which would be /dev/sda1), use the whole drive, you have to overwrite everything there including the boot block and the partition table.
chroot custom dpkg-query -W --showformat='${Package} ${Version}\n' > cd/casper/filesystem.manifest
cp cd/casper/filesystem.manifest cd/casper/filesystem.manifest-desktop
rm -f cd/casper/filesystem.squashfs
mksquashfs custom cd/casper/filesystem.squashfs
rm cd/md5sum.txt
(cd cd && find . -type f -print0 | xargs -0 md5sum > md5sum.txt)


rm -f Ubuntu-Live-custom.iso
'''Note: If you select the wrong device name you can make the host system unbootable in about 250 mS. If you do this, don't come whining to me about it. Fix it.'''
cd cd
mkisofs -r -V "Ubuntu-Live-Custom" -b isolinux/isolinux.bin -c isolinux/boot.cat -cache-inodes -J -l -no-emul-boot -boot-load-size 4 -boot-info-table -o ../Ubuntu-Live-custom.iso .

Latest revision as of 05:32, 6 July 2010

WallTop computers... the concept is to recycle an old laptop by removing all the extraneous parts such as the cdrom drive, floppy drive, (dead) battery and then hanging it on the wall.

Available hardware

My first attempt is based on a Dell Inspiron 3700 C466GT.

  • 466 MHz Celeron processor
  • 256 MB PC100 SODIMM memory
  • one PATA slot
  • two broken PC card slots
  • one USB port

Removed: case, 4200 RPM hard drive, dead battery

Added: a shadow box frame from Michaels, a power supply from OSUsed, a CF to 44pin PATA adapter, a 1GB CF card, and an ASUS 802.11g WiFi USB adapter

I had to modify the frame to add cooling slots.

This laptop will only boot when you touch its power on button. To make the button accessible I mounted the motherboard upside down (what used to be the top is towards the wall when it's hanging up. I drilled a hole in the back about 3/8" diameter. You can poke the button with a pencil eraser to boot it up. Yes.. its a pain.

More hardware available for future projects

Micron TransPort GX2: Pentium III 1.2Ghz

  • 15-inch LCD at 1,280-by-1,024

http://www.pcmag.com/article2/0,2817,7733,00.asp

Micron TransPort XT Notebook Computers CPU: Intel Pentium III 750 ~ 850MHz

  • Standard Memory: 64MB~256MB
  • Maximum Memory: 512MB

14" screen

http://www.pcworld.com/article/54784/micronpc_launches_transport_xt_notebook.html

The software

Which distribution to use?

After much research and experimentation I settled on Debian Live!

This allows me to build an image on a big fancy Ubuntu desktop system (Raven) and test it in qemu.

Once the image is built I transfer it to a Compact Flash card, which will be plugged into an IDE adapter and replace the incredibly noisy stock 4200 rpm hard drive.

I am also now using Debian Live! to build Asterisk phone systems.

Some other options that I investigated:

  • Debian
  • Damn Small Linux
  • Puppy Linux (which immediately panics on boot)
  • Movix
  • Ubuntu, building a custom Live CD

Debian Live! installation

Debian Live wiki

Building an USB/HDD image

FluxBox

Install the tools to build Debian Live! systems

apt-get install live-helper

Build an image.

lh_clean --binary
lh_config -b usb-hdd -k 686 --bootstrap-flavour minimal\
--packages-lists "stripped" --binary-indices disabled\
--memtest "disabled"\
--packages "x-window-system-core fluxbox\
openssh-server vlc gnash portmap nfs-common\
autofs debconf-english"\
--bootappend-live "nolocales" --syslinux-timeout 50

I build on a 64 bit machine so I have to say -k 686 to get the 32 bit kernel

Add scripts to config/chroot_local-hooks

02-fix_inittab.sh - changes runlevel to 5 and adds the tty7 login line so I have only one login running instead of default 5

40-bash_profile.sh - append or create a .bash_profile script that will run a script from nfs and then do a 'startx'.

50-windowmanager.sh - configures fluxbox startup files

99-make-export.sh - make the directories needed for autofs

Add files to config/chroot_local-includes I add the autofs.* files that I use to mount nfs servers.

Doing customizations, do this (as root)

lh_clean --binary
lh_config
lh_bootstrap
# Prepare for a chroot system so you can do hacks
lh_chroot
lh_chroot_hosts install
lh_chroot_resolv install
lh_chroot_proc install
chroot chroot
#do the hacks here, for example "apt-get install asterisk".
exit
# Now remove the changes make to do chroot
lh_chroot_hosts remove
lh_chroot_resolv remove
lh_chroot_proc remove
# I wonder what this does
lh_binary
# Build the image
lh_build

Copy image to CF: dd if=binary.img of=${USBSTICK}

To test image, start in qemu or convert img file to a vmdk and use vmware

To use in walltop, transfer CF to laptop and boot it

Customization that I might want to do

other codecs???
emacs21-nox
libcurl3
realplayer?
firefox - use iceweasel, unless like me your laptop is puny, then forget it!
flash - use gnash??

I need something to do a slide show of pictures, driven from command line. Image-magick supports this.

Starting X / fluxbox without a window manager http://www.debianadmin.com/how-to-auto-login-and-startx-without-a-display-manager-in-debian.html

Building a working image

To make (large) changes, you build a new, complete image from scratch. You copy the new image to CF, put it in the computer, and boot.

I add scripts to config/chroot_local-hooks. I keep backup copies of the scripts at the top level so that I can wipe the config/ directory and rebuild it from scratch. I keep copies of the files that will be included in MyConfigIncludes/

Create scripts to customize the images

nn-name.sh where 'nn' is a number to control execution order, and 'name' is a meaningful name, for example 01-password.sh would be used to install local user accounts and set user and root passwords.

Networking

Depending on how I deploy things, wired or wifi might be easier. From my notes below I have concluded wired is easier!

Wired network

I ended up pulling a USB-to-ethernet adapter out of my junkbox. It's a 3COM 3C19250 from a 3COM Audrey. I hooked it up to my VirtualBox simulated walltop and it started right up. Now I have to do the DHCP set up in Debian Live and see if it works on the Dell hardware.

WiFi Network

These are WiFi cards I was considering using. They are still in my junk box but when I actually went to plug one in, I found that this Dell's PC card slots are messed up, so instead I plugged in an ASUS USB adapter.

D-Link DW650M http://sourceforge.net/apps/mediawiki/ndiswrapper/index.php?title=D-Link_DWL-G650M

Microsoft MN-720

I have not completed testing of ndiswrapper since I switched to using the ASUS USB adapter. Here are my notes for the NEXT walltop. I have several more laptops...

To use these I need to use the manufacturer's drivers + ndiswrapper. http://wiki.debian.org/NdisWrapper

In chroot environment

m-a prepare
m-a a-i ndiswrapper
echo ndiswrapper >> /etc/modules

WiFi Security settings

With this device it's just a matter of plugging it in and then getting the correct security settings for the network. I was able to turn off security on my Linksys and get a connection. Since my ultimate goal is to take this to work and hang it on the wall there, turning security at the WAP off is not an option.

I first I spent a couple hours wrestling with getting it to work with wpa_supplicant on an Ubuntu desktop. I tried all sorts of combinations of security settings to no avail. Very frustrating.

Then I found wicd. I installed it (apt-get install wicd), started the daemon (sudo wicd) and the client (wicd-client -n) and had a link up in about 60 seconds. Conclusion: USE WICD!!

What I actually ended up doing was installing wicd, using it to set up wpa_supplicant, and then removing it from my installation. The wpa_supplicant configuration that worked that I created with wicd-curses looks like this

ap_scan=1
ctrl_interface=/var/run/wpa_supplicant
network={
      ssid="wildsong"
      scan_ssid=0
      proto=WPA RSN
      key_mgmt=WPA-PSK
      pairwise=CCMP TKIP
      group=CCMP TKIP
      psk=67c4e0a7ff7736641fdf9bc8094c45a8b7c60a33f45321f6c3d08f42ec0397af
}

Check the downloads page for more documentation

In Debian Lenny, wicd is a backport, so installing it requires additional work. Add this to /etc/apt/sources.list; like this

echo 'deb http://www.backports.org/debian lenny-backports main contrib non-free ' > config/chroot_sources/backports-wicd.chroot
wget -O - http://backports.org/debian/archive.key -O config/chroot_sources/backports-wicd.binary.gpg

NOTE Backports is also required for the USB firmware

Then in the chroot environment I do this

apt-get update
apt-get install debian-backports-keyring
apt-get -t lenny-backports install wicd

...which installs about a zillion more dependent packages! All just to get my wireless link going!

SSH services

The lsh-server is a small SSH server.

By default it generates keys on the first run, which alas is every time on a Debian Live system. So I generate keys on the development host and copy them into the config tree.

This is how I generate the seed file and keys.

mkdir ~/.lsh && cd ~/.lsh
lsh-make-seed --sloppy -o yarrow-seed-file
lsh-keygen | lsh-writekey

Testing

To test the image in a virtual machine, you can either start it directly in qemu or convert the img file to a vdi and use VirtualBox

I really don't like using Qemu so I deleted the instructions that I used to have here. I don't intend to use it again.

Converting the IMG file to a VDI file

VBoxManage convertfromraw -format VDI binary.img binary.vdi

Now you can create a virtual machien and mount the VDI as a virtual disk and boot from it. It boots about 10 times faster on the development system as on the real computer. Poor little obsolete laptop!

You can also the virtual machine to boot from the USB stick but testing the img file first means you don't have to keep copying the image to the stick.)

Deployment

Copy the image to a CF card, completely overwriting it: dd if=binary.img of=<devicename>. You can get the device name with dmesg, it will be buried in the last few messages after you insert the stick. Something like /dev/sda. Don't use the first partition (which would be /dev/sda1), use the whole drive, you have to overwrite everything there including the boot block and the partition table.

Note: If you select the wrong device name you can make the host system unbootable in about 250 mS. If you do this, don't come whining to me about it. Fix it.