Build an Alpha System Using debootstrap

This follows the procedure documented at http://www.debian.org/releases/stable/i386/apds03.html and from the gentoo description of building an alpha system at http://www.gentoo.org/doc/en/handbook/handbook-alpha.xml. The gentoo documentation is particularly helpful in how to setup the boot loader.

  • It is best to start with a running alpha system of just about any version. Cross architecture debootstrap is tricky and the times I have tried it I have been unsuccessful.

  • To start completely fresh blow away the partition table on the target disk with dd.

      dd if=/dev/zero of=/dev/sdb count=1
    
  • Use fdisk to create partitions on the new disk. The most important part is to leave space at the beginning of the disk for the boot block. The default action for fdisk is to create a DOS label, but alpha srm requires a BSD label. In fdisk pick option 'b', edit bsd disklabel, and enter 'Y' to create the disk label. At this point there will be a single c partition that is the whole disk. Leave this partition intact and add a swap an a root partition leaving the first part of the disk for the boot block. Here is an example.

      # fdisk /dev/sdb
      Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
      Building a new DOS disklabel with disk identifier 0x9457ad6c.
      Changes will remain in memory only, until you decide to write them.
      After that, of course, the previous content won't be recoverable.
    
      Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
    
      Command (m for help): b
      /dev/sdb contains no disklabel.
      Do you want to create a disklabel? (y/n) y
      # /dev/sdb:
      type: SCSI
      disk: 
      label: 
      flags:
      bytes/sector: 512
      sectors/track: 63
      tracks/cylinder: 255
      sectors/cylinder: 16065
      cylinders: 1106
      rpm: 3600
      interleave: 1
      trackskew: 0
      cylinderskew: 0
      headswitch: 0           # milliseconds
      track-to-track seek: 0  # milliseconds
      drivedata: 0 
      3 partitions:
      #       start       end      size     fstype   [fsize bsize   cpg]
        c:        0  17767889  17767890     unused        0     0       
    
      BSD disklabel command (m for help): n
      Partition (a-p): a
      First sector (0-17767889, default 0): 512
      Last sector or +size or +sizeM or +sizeK (512-17767889, default 17767889): +1024M
    
      BSD disklabel command (m for help): p
    
      3 partitions:
      #       start       end      size     fstype   [fsize bsize   cpg]
        a:      512   2097664   2097153     unused        0     0       
        c:        0  17767889  17767890     unused        0     0       
      BSD disklabel command (m for help): n
      Partition (a-p): b
      First sector (0-17767889, default 0): 2097665
      Last sector or +size or +sizeM or +sizeK (2097665-17767889, default 17767889): 17767888
    
      BSD disklabel command (m for help): p
    
      3 partitions:
      #       start       end      size     fstype   [fsize bsize   cpg]
        a:      512   2097664   2097153     unused        0     0       
        b:  2097665  17767888  15670224     unused        0     0       
        c:        0  17767889  17767890     unused        0     0       
    
      BSD disklabel command (m for help): t
      Partition (a-c): a
      Hex code (type L to list codes): 1
    
      BSD disklabel command (m for help): t
      Partition (a-c): b
      Hex code (type L to list codes): 8
    
      BSD disklabel command (m for help): p
    
      3 partitions:
      #       start       end      size     fstype   [fsize bsize   cpg]
        a:      512   2097664   2097153       swap                      
        b:  2097665  17767888  15670224       ext2                      
        c:        0  17767889  17767890     unused        0     0       
    
      BSD disklabel command (m for help): w
      Writing disklabel to /dev/sdd.
    
      Syncing disks.
      Calling ioctl() to re-read partition table.
    
      BSD disklabel command (m for help): q
    
  • Create file systems.

      mkswap /dev/sdb1
      mkfs -t ext3 /dev/sdb2
    
  • Set apt-sources. The ca-zephyr repo holds the qlogic firmware.

      deb http://ftp.debian-ports.org/debian/ sid main
      deb-src http://ftp.us.debian.org/debian/ sid main
      deb http://ftp.ca-zephyr.org/debian sid main
    
  • Assume that the new system disk is mounted at /mnt/newroot.

      aptitude install debian-ports-archive-keyring
      aptitude install debootstrap
      debootstrap --arch alpha --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg unstable /mnt/newroot  http://ftp.debian-ports.org/debian
    
  • chroot into the new system root and make some devices. The installation and MAKEDEV generate "/sbin/MAKEDEV: warning: can't read /proc/devices" errors that can be ignored.

      LANG=C.UTF-8 chroot /mnt/newroot/
      apt-get install makedev
      cd /dev
      MAKEDEV generic
    
  • Make an fstab file in the newroot. Best to use UUID to mount the disks. The following example assumed a disk with two partitions, the root partition and a swap partition. (To see the UUIDs from host system use 'ls -l /dev/disk/by-uuid'.) It is also assumed that the /media/cdrom directory has been created.

      UUID=9b14bd0f-8341-4985-846f-f486ac424d5b / ext3 defaults 0 1
      UUID=f2a81c71-c1ab-46f7-8f40-2d76f2f90bbc none swap sw 0 0
      proc /proc proc defaults 0 0
      /dev/cdrom /media/cdrom iso9660 noauto,ro,user,exec 0 0
    
  • Set the time configuration by creating the file /etc/adjtime.

      0.0 0 0.0
      0
      UTC
    
  • Set the time zone

      dpkg-reconfigure tzdata
    
  • Configure networking by setting /etc/hostname, /etc/hosts, /etc/network/interfaces, and /etc/resolv.conf. Don't be tempted to assign 127.0.0.1 to the fqdn of the host. Here are examples of the 4 files.

      # /etc/hosts
      #
      127.0.0.1       localhost
      10.0.0.8        theo.ca-zephyr.org
      ::1             localhost ip6-localhost ip6-loopback
      ff02::1         ip6-allnodes
      ff02::2         ip6-allrouters
    
      # /etc/hostname
      theo.ca-zephyr.org
    
      # /etc/resolv.conf
      nameserver 8.8.8.8
      nameserver 8.8.4.4
    
      # /etc/network/interfaces
      auto lo
      iface lo inet loopback
      #
      auto eth0
      iface eth0 inet static
          address 10.0.0.8
          netmask 255.255.255.0
          broadcast 10.0.0.255
          gateway 10.0.0.1
    
  • Configure apt sources.

      deb http://ftp.debian-ports.org/debian/ sid main
      deb http://ftp.ca-zephyr.org/debian/ sid main
      deb-src http://ftp.us.debian.org/debian/ sid main
    
  • Install the debian ports keyring.

      apt-get install debian-ports-archive-keyring
    
  • Install some kernels and the firmware required to access disks.

      apt-get install firmware-qlogic
      apt-get install linux-image-3.10-2-alpha-smp
      apt-get install linux-image-3.10-2-alpha-generic
    
  • Packages recommended by the kernel installs

      apt-get install linux-doc-3.10 debian-kernel-handbook aboot fdutils
    
  • Install the boot loader

      swriteboot -f1 /dev/sdb /boot/bootlx
      abootconf /dev/sdb 2
    
  • Configure /etc/aboot.conf

      0:2/vmlinuz ro initrd=/initrd.img root=/dev/sdb2
      1:2/vmlinux.smp ro initrd=/initrd.img.smp root=/dev/sdb2