Skip to content

terensapp/eos_boot_loader

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eos_grub_loader

What

A Linux/Grub2 boot loader for EOS (alternative to aboot). This does NOT include EOS, you will need to download EOS from arista.com with your account.

Why

Aboot is not easy to install on x86/x86_64 and has limitations such as lack of ACPI support, EFI, etc. Aboot also decompresses the root file system to memory. Eos_grub_loader is based on Grub2 which is the most popular Linux boot loader and is very well supported. Eos_grub_loader decompresses the root file system to disk (on each boot) hence memory is preserved. A switch usually has a low write flash medium. The expectation is that eos_grub_loader is installed on a system with a disk (preferably SSD). Disk space is also less costly on cloud infrastructure them memory.

How

Eos_grub_loader installs a Linux kernel, a small initrd, and Grub2 to disk (it comes in a bootable installer). On eos_grub_loader boot, the file system /mnt/flash is mounted (it looks for a disk with the label persist). Assuming that autoinit is not disabled (settings file on /mnt/flash) then the system proceeds to the next stage. A new filesystem is created on the disk with the label bootimage and mounted to /bootimage. If a previous filesystem existed it will be destroyed. The file /mnt/flash/boot-config is consulted to determine the desired SWI. The SquashFS file (rootfs-i386.sqsh) is extracted from the SWI and decompressed to /bootimage. A static settings file and tool(s) are installed to /bootimage. A fstab entry is installed to /bootimage/etc/fstab for /mnt/flash. Finally, the EOS kernel is loaded and executed. At this point eos_grub_loader dies and its memory is reclaimed by the EOS kernel. If any failure occurs or if autoinit is disabled the user can manage eos_grub_loader with the bash shell (no credentials required).

Motivations

The motivation for this project was the difficulty of running vEOS on Ravello. As one would expect, Grub2 is well supported on the cloud and ABOOT not so much. I wanted the solution to closely match the behaviour of ABOOT, specifically that the root filesystem is created new on each boot. Initially I setup the boot_loader to decompress to memory but then decided it made more since to use cheaper disk.

Download

A binary bootable installer can be downloaded from https://github.com/aristanetworks/eos_boot_loader/releases/download/v.1/installer.iso

Tools

configure.sh

The configure.sh script is available from the installer only. This script requires one arg, the disk to install the boot_loader. The configure.sh script will generate the script install.sh in the same directory.

  1. configure.sh
  2. install.sh (generated by configure.sh)

Autoinit

The autoinit (/usr/bin/autoinit) script is available in the boot_loader and EOS (not the installer). It can be executed from the bash shell or from the EOS CLI. The script is used to enable/disable autoboot, show the status of autoboot and if ran inside the boot_loader it can be used to manually boot the next stage.

  1. No Arg - status
  2. 'enable' - enable autoinit
  3. 'disable' - disables autoinit
  4. 'boot' - boots the next stage (only available in the boot_loader)

Build Instructions

Setup Environment

  1. [ -f /usr/bin/mock ] || sudo dnf -y install mock
  2. cd ~/workspace; mkdir eos_grub_loader; cd eos_grub_loader
  3. cat /etc/mock/fedora-24-i386.cfg | sed 's/fedora-24-i386/eos_grub_loader/g' > mock.cfg
  4. mock -r mock.cfg --init
  5. mock -r mock.cfg --install dnf git vim
  6. echo "#\!/bin/bash\nmock -r mock.cfg --copyout /builddir/eos_boot_loader/boot_installer/dist/installer.iso ." > copyout
  7. echo "#\!/bin/bash\nmock -r mock.cfg --shell" > shell
  8. chmod +x shell copyout
  9. ./shell; cd; rm -rf build
  10. cp /usr/bin/vim /usr/bin/vi
  11. git clone https://github.com/aristanetworks/eos_boot_loader.git
  12. cd eos_grub_loader
  13. ./build.sh

USB bootable

A bootable USB flash disk can be created with the command

  1. sudo dd if=installer.iso of=/dev/[USB] status=progress

Memory Footprint

Because the rootfile system does not consume memory it will not require the same about of memory as normal. I have tested with 1536MB but did not stress it. I am currently recommending 2048M and will revise if necessary.

Quick Guide

  1. Download installer.iso
  2. Create new virutal machine with 2048M RAM, 2 core CPU and 10G disk
  3. Set installer.iso as boot device (cdrom)
  4. Boot. Select 'vga' install
  5. At bash prompt run configure.sh && install.sh (system will reboot)
  6. Cancel auto-init (control + c)
  7. Set ip address on interface with ifconfig (ifconfig ens33 192.168.55.125/224 up)
  8. Change directory to /mnt/flash (cd /mnt/flash)
  9. Copy swi file to local (scp [email protected]:veos.swi .)
  10. Write boot-config file (echo "SWI=file:/mnt/flash/veos.swi" > boot-config)
  11. Boot (autoinit boot)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 100.0%