Novena/Debian installer

From Studio Kousagi Wiki
Jump to: navigation, search

The installer resides on the internal MMC, and will activate if:

  1. A boot image cannot be found (e.g. fatload fails)
  2. If the recovery button is held down during boot

The installer consists of an initrd and a command line tailored to boot it. It will perform a network install, using either Ethernet port or the wifi card. A preconfiguration file is present to add the Kosagi Debian mirror to the selection process, which adds support for the Novena U-Boot and kernel packages, as well as (possibly) non-free binaries.

There are multiple install methods, and there will be separate boot images for each. Possible options include:

  • Serial port interface
  • LCD/LVDS interface
  • HDMI interface

The various interfaces will be identical, only command line arguments will change.

Installing Debian onto a SATA driver (over serial/SSH)

To install Debian onto an SSD, you will need the following:

  • MicroSD card with at least 128 MB
  • SATA drive
  • Serial access to Novena
  • Internet access (Ethernet or wifi)
  • A terminal that supports extended graphics (e.g. NOT GNU screen)

Many of the installation steps are self-explanatory. There are, however, a few notes:

  • After configuring the network, you will be prompted to connect via SSH. This can be useful for debugging, or if you'd like a colour install terminal. The password is: kosagi
  • If you're located in Singapore, when prompted to select a mirror, choose the top option to "enter information manually". The server hostname is bunniefoo.com, and the path is /debian/.
  • Since you're installing to a SATA disk, ensure the root partition "/" is on /dev/sda2.
  • You cannot install Debian to the internal MMC card.
  • Don't insert a card into the external MMC slot during installation

To install, perform these steps:

  1. Download the Debian boot image
  2. Write the image to the MicroSD card using dd (or Win32DiskImager)
  3. Attach the SATA drive to Novena, and insert the MicroSD card in the internal slot
  4. Boot Novena. You should be prompted to select a language.
  5. When you get to the step announcing SSH, you may either choose <Continue> and keep installing over serial, or use a separate computer to install over SSH.
  6. At the end, when it tells you to remove installation media, simply select <Continue>. Do not remove any media.

Installer internals

Our local fork of the Debian installer (with Novena additions) is available on Github.

The Debian installer resides in an initrd. To actually load the Debian installer rfs, kernel, and device tree file, use the following U-Boot script:

setenv mmcdev 1
mmc rescan
mmc dev ${mmcdev}
fatload mmc ${mmcdev} 0x11ff0000 /d/uimage.dtb
fatload mmc ${mmcdev} 0x12000000 /uimage-novena.bin
fatload mmc ${mmcdev} 0x12a00000 /d/uinitrd
setenv bootargs initrd=0x12a00000 console=ttymxc1,115200 consoleblank=0
bootm 0x12000000 0x12a00000 0x11ff0000

Preseeding the installer

The following preseed.conf is used to seed the install program:

# The kernel image (meta) package to be installed; "none" can be used if no
# kernel is to be installed.
d-i base-installer/kernel/image string linux-image-novena

# Individual additional packages to install
d-i pkgsel/include string openssh-server build-essential u-boot-novena linux-image-novena

# Additional repositories, local[0-9] available
d-i apt-setup/local0/repository string \
       http://bunniefoo.com/kosagi-deb wheezy main
d-i apt-setup/local0/comment string Kosagi repo

# Enable deb-src lines
d-i apt-setup/local0/source boolean true

# URL to the public key of the local repository; you must provide a key or
# apt will complain about the unauthenticated repository and so the
# sources.list line will be left commented out
d-i apt-setup/local0/key string http://bunniefoo.com/kosagi-deb/kosagi.gpg.key

# Add the debug serial port to inittab
d-i preseed/late_command string echo "T1:2345:respawn:/sbin/getty -L ttymxc1 115200 vt100" >> /target/etc/inittab

# We don't require additional kernel modules
d-i anna/no_kernel_modules boolean true

d-i anna/choose_modules string network-console
d-i network-console/password password kosagi
d-i network-console/password-again password kosagi

d-i base-installer/kernel/skip-install boolean true
nobootloader nobootloader/confirmation_common note

Custom packages

There need to be two custom packages for Novena: the kernel, and the bootloader. In order to get these installed, we've created our own repo on bunniefoo.com, at http://bunniefoo.com/kosagi-deb/ with the GPG key located at http://bunniefoo.com/kosagi-deb/kosagi.gpg.key.

Signing packages

Packages live on bunniefoo.com. To add a package to the repo, run this command:

reprepro -b /mnt/var/spool/kosagi-deb/ -A armhf -V includedeb wheezy [path-to-deb-to-add]

The command will ask for the GPG key to sign each package as it's added.

Mirroring Debian

There is a script on bunniefoo located at /usr/bin/kosagi-mirror.sh that uses debmirror to pull down copies of wheezy, jessie, and Ubuntu-Saucy. It should be run occasionally.

Other notes

If you're located on the 10.0.49.0/24 network, you'll need to add the following entry to /etc/hosts:

10.0.49.9   bunniefoo.com www.bunniefoo.com

Packaging files

Use "dpkg -b" to package a file.