koldfront

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.

Connecting

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.

Partitioning

I've already done this part while installing Ubuntu.

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

Filesystems

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
topper:~# 

(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 
topper:~# 

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:
  debootstrap 
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
Summary:
 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
topper:~# 

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
LANG=POSIX
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
topper:~# 

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
topper:/# 

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

fstab

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
topper:/# 

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

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

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

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

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?)

^C

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 *
topper:/# 

The final lilo.conf contains:

topper:/# grep -v ^# /etc/lilo.conf | grep -v ^$
lba32
boot=/dev/sdb
root=/dev/sdb1
install=menu
prompt
timeout=50
map=/boot/map
vga=normal
image=/boot/vmlinuz-2.6.8-2-686
        label="Lin 2.6.8img0"
        initrd=/boot/initrd.img-2.6.8-2-686
        read-only
topper:/# 
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?)

Boot

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.

Wireless

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
grub

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

X

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

Longrun

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

CompactFlash

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

Needs finishing up...

0.0017 s
webcustodian@koldfront.dk