- Initial considerations: We're using the UBNT kernel to bootstrap.
Unfortantely, this is a 2.6.32 which does not work with Debian Jessie
du to missing features - however, it does work with Wheezy. So we
bootstrap to Wheezy and then dist-upgrade to Jessie.
- Create the initial root file system via debootstrap whose
--foreign and --arch options allow this do be done
on a non-native machine (amd64 in my case):
mkdir rootfs ; debootstrap --arch=mips --verbose --foreign wheezy rootfs http://ftp.us.debian.org/debian/
Note that --foreign skips the post-install, which then needs
to be done later on the target machine via --second-stage.
- copy the rootfs directory to the root of the second partition
(the ext2 one) of the UBNT USB stick
- insert UBNT USB stick into Erlite-3 and boot EdgeOS normally
- via the serial console, login as user ubnt, password
ubnt (the default), then acquire uid 0 via sudo su -
- mkdir /mnt/work
- mount /dev/sda2 /mnt/work
- chroot rootfs
- Run the post-install that --foreign skipped:
distro=wheezy ; export LANG=C ; /debootstrap/debootstrap --second-stage
- set the root password to something reasonable
- edit /etc/inittab to enable the T0 serial console, set it to
speed 115200 and disable the regular gettys (nothing for them to listen
on)
- edit /etc/hostname and set the hostname to something useful
- shutdown EdgeOS, remove USB stick from Erlite-3, put into computer
- copy the kernel image from the first partition (vmlinux.64)
for later user
- copy the rootfs directory
- from the second partition of the UBNT stick mount the
squashfs.img and extract the
lib/modules/2.6.32.13-UBNT/ tree for later use
- prepare a new USB stick
- Due to not properly initializing the hardware USB stack in uboot,
the Erlite-3 only recognizes a limited set of USB sticks for booting,
aside from the include ones. The Sandisk Cruzer Fit 16 GB is known to
work (which is what I use) and the Gentoo MIPS Wiki has a little
list in the
Erlite-3
page.
- create two partitions:
- partition 1: 256 MB, vfat (type c), format as VFAT
- partition 2: remainder of stick, Linux, format as ext2 since
we're booting 2.6.32
- copy the vmlinux.64 kernel image to the first partition of
our new stick
- copy the contents of the rootfs directory to the root of the
second partition of our new stick
- copy the saved lib/modules/2.6.32.13-UBNT/ into the same
location on the second partition of our new stick
- insert stick into Erlite-3 and after the stick has been recognized,
interrupt uboot with the ESC key
- manually boot the system:
fatload usb 0 $loadaddr vmlinux.64
bootoctlinux $loadaddr root=/dev/sda2 rootdelay=15 rw
- wait for the system to come up, then login as root
- get the network up (assumes active DHCP server):
modprobe octeon-ethernet
dhclient -v eth0
- automatically setup eth0 on boot by adding to
/etc/network/interfaces:
auto eth0
eth0 inet dhcp
- install ssh: apt-get install ssh
- fix ssh config by disabling passworded root logins in
/etc/ssh/sshd_config:
PermitRootLogin without-password
- At this point, if you want to be able to login via the network and
not just the console, you need to either add a ssh public key to
/root/.ssh/authorized_keys or add a non-root user account and
add him to the sudo group so he can run sudo su - .
- install screen: apt-get install screen
- fix up /etc/fstab to look like this:
/dev/sda2 / ext4 defaults,data=ordered,barrier=1,noatime,errors=remount-ro 0 1
/dev/sda1 /boot vfat defaults,errors=remount-ro 0 0
proc /proc proc defaults 0 0
- mount everything: mount -a
- build and install a recent kernel image:
- update from Wheezy to Jessie:
- And we're done, the Erlite-3 is now running Debian jessie with a
current kernel.