Debian GNU/Linux on a Sharp PC-CV50F

I've run Ubuntu on my Sharp PC-CV50F since I got it. I originally chose Ubuntu to check it out and because it quickly had gained a reputation for being desktop-oriented and laptop-friendly. I run Debian on my other machines, so I'm giving Debian a whirl on my little "Muramasa", hodja, now.


If you connect the turned off laptop to another computer via the small USB-port on the right side, it acts as a USB-harddrive ("DirectHD"). When doing that, the laptops harddisk turns up as /dev/sdb on my desktop box, topper.


I've already done this part while installing Ubuntu.

So, the harddisk has three partitions: sd1, bootable, 18GB; sd2, swap, 1GB; sd3, Dell Utility


I want XFS on sdb1 and prepare sdb2 to be swap:

topper:~# mkfs.xfs /dev/sdb1
mkfs.xfs: /dev/sdb1 appears to contain an existing filesystem (xfs).
mkfs.xfs: Use the -f option to force overwrite.
topper:~# mkfs.xfs -f /dev/sdb1
meta-data=/dev/sdb1              isize=256    agcount=16, agsize=288165 blks
         =                       sectsz=512  
data     =                       bsize=4096   blocks=4610640, imaxpct=25
         =                       sunit=0      swidth=0 blks, unwritten=1
naming   =version 2              bsize=4096  
log      =internal log           bsize=4096   blocks=2560, version=1
         =                       sectsz=512   sunit=0 blks
realtime =none                   extsz=65536  blocks=0, rtextents=0
topper:~# mkswap /dev/sdb2
Setting up swapspace version 1, size = 1069281 kB
no label, UUID=6772a280-e933-49d2-811f-04acbf0c2bc0

(Note that the -f for mkfs was only necessary because I already had a filesystem there.)

Install base system (debootstrap)

This part is basically following the instructions in the Debian GNU/Linux Installation Guide, specifically appendix C.4.

First I mount the laptop-harddisk on my desktop box:

topper:~# mount /dev/sdb1 /mnt/hodja 

Then I proceed by installing debootstrap on my desktop. Notice that because I'm running unstable on that and want to install stable, I need a stable-line in /etc/apt/sources.list and specifically specify that I want debootstrap from stable:

topper:~# aptitude install debootstrap/stable
Reading package lists... Done
Building dependency tree       
Reading extended state information       
Initializing package states... Done
The following NEW packages will be installed:
0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/72.2kB of archives. After unpacking 193kB will be used.
Writing extended state information... Done
Reading package fields... Done
Reading package status... Done
Retrieving bug reports... Done    
grave bugs of debootstrap ( -> 0.2.45-0.2) <open>
 #314157 - does not work in d-i anymore
 debootstrap(1 bug)
Are you sure you want to install/upgrade the above packages? [Y/n/?/...]  
Selecting previously deselected package debootstrap.
(Reading database ... 129222 files and directories currently installed.)
Unpacking debootstrap (from .../debootstrap_0.2.45-0.2_i386.deb) ...
Setting up debootstrap (0.2.45-0.2) ...
Reading package lists... Done             
Building dependency tree       
Reading extended state information      
Initializing package states... Done

Be sure that your locale is generic (POSIX) before starting debootstrap; I've had problems with my default locale (Danish/English, mixed). It should look a little like this:

topper:~# locale

Then run debootstrap (I'm using a mirror close to me):

topper:~# /usr/sbin/debootstrap --arch i386 sarge /mnt/hodja http://mirrors.telianet.dk/pub/mirrors/ftp.debian.org/debian
I: Retrieving debootstrap.invalid_dists_sarge_Release
I: Validating debootstrap.invalid_dists_sarge_Release
I: Retrieving debootstrap.invalid_dists_sarge_main_binary-i386_Packages
I: Checking adduser...
I: Checking apt...
I: Checking apt-utils...
I: Checking aptitude...
I: Checking wget...
I: Checking whiptail...
I: Checking zlib1g...
I: Retrieving adduser
I: Validating adduser
I: Retrieving apt
I: Validating apt
I: Retrieving apt-utils
I: Validating apt-utils
I: Retrieving aptitude
I: Validating aptitude
I: Installing core packages...
I: Base system installed successfully. 

Configure base system

Still following Debian GNU/Linux Installation Guide appendix C.4, first chroot'ing into the newly installed system:

topper:~# chroot /mnt/hodja /bin/bash

(Note that the sequence here is not random, you want /proc mounted fairly soon in the chroot, I think.)


topper:/# editor /etc/fstab 
topper:/# cat /etc/fstab 
# /etc/fstab: static file system information.
/dev/hda1       /               xfs     noatime         0       0
/dev/hda2       none            swap    sw              0       2
proc            /proc           proc    defaults        0       0
sys             /sys            sysfs   defaults        0       0
usbfs           /proc/bus/usb   usbfs   defaults        0       0
topper:/# mount -a
mount: mount point /proc/bus/usb does not exist

Well, it seems this is needed for /proc to work:

topper:/# mount -t proc proc /proc
topper:/# mount -a

/etc/resolv.conf from my desktop is fine:

topper:/# cat /etc/resolv.conf 
search koldfront.dk koldfront.local
topper:/# echo hodja > /etc/hostname
hodja:~# editor /etc/hosts
hodja:~# cat /etc/hosts       hodja.koldfront.dk hodja localhost

Timezone, users, apt

topper:/# /usr/sbin/base-config new

(Configured apt to use the closest mirror and security.debian.org.)

mdetect and read-edid was installed here - I don't know if I should have waited to install them until after booting the new machine? - and then a bunch of other files. But I need the compiler and stuff for the wireless, so I think it's correct to install this now, here.

Recommended but not installed: ca-certificates hotplug wbritish

I can't live without these: jove less

topper:/# aptitude install ca-certificates hotplug wbritish jove less

Install kernel

And also install the headers and stuff needed to compile the linux-wlan-ng modules:

topper:/# aptitude install kernel-image-2.6-686 kernel-source-2.6 kernel-headers-2.6-686 kernel-doc-2.6 kernel-package subversion

Wireless sources

topper:/# cd /usr/src/
topper:/usr/src# svn co svn://svn.shaftnet.org/linux-wlan-ng/trunk linux-wlan-ng-devel

Boot loader

Change the fstab temporarily to read sdb and so on.

topper:/# jove /etc/fstab 
topper:/# aptitude install grub

Had to do this outside the chroot, don't know if it works:

asjo@topper:~$ sudo grub-install --root-directory=/mnt/hodja /dev/sdb
Due to a bug in xfs_freeze, the following command might produce a segmentation
fault when /mnt/hodja/boot/grub is not in an XFS filesystem. This error is harmless and
can be ignored.

(This probably means that the grub installed is the one from the desktop box, running unstable?)


grub didn't work. Trying lilo:

topper:/# mount -t proc proc /proc
topper:/# mount -a
topper:/# aptitude install lilo
topper:/# liloconfig
Warning: /dev/sdb1 is not on the first disk
Fatal: Filesystem would be destroyed by LILO boot sector: /dev/sdb1

ERROR: correct /etc/lilo.conf manually and rerun /sbin/lilo

topper:/# jove /etc/lilo.conf 
topper:/# lilo
Warning: /dev/sdb is not on the first disk
Added Lin_2.6.8img0 *

The final lilo.conf contains:

topper:/# grep -v ^# /etc/lilo.conf | grep -v ^$
        label="Lin 2.6.8img0"
topper:/# umount /proc/
topper:/# exit
topper:~# umount /mnt/hodja/

append="pci=noacpi pci=usepirqmask i8042.nomux" (I'm not sure if the first two should be used?)


The moment of truth, if anything above has gone wrong, we will soon know. Fortunately it is quite easy to turn the laptop off and into a USB-harddisk again if something did indeed go wrong.

Remember to add root=/dev/hda1 to the command-line when booting, otherwise the laptop will try mounting its root-filesystem on a nonexistant /dev/sdb1...

Fix up lilo.conf.


To get the wireless network going, I installed linux-wlan-ng from svn.

Unpack kernel source. Make kernel. Install. Reboot. make config. make all. make install. Turn on wlan. Works!

Install grub:

grub-install --no-floppy /dev/hda

fuckit installed lilo instead - grub sucks (doesn't install, uses all CPU for 10+ minutes, probes for floppy disk even with --no-floppy).


Change /etc/X11/XF86Config-4 to read 1280x768.


Added cpuid and msr to /etc/modules, installed the acpid and longrun packages and modified the scripts in /etc/acpid/actions/


Install pcmcia-cs (probably removed automatically due to the "install on usb-harddisk"-method.

Needs finishing up...

0.0022 s