Skip to content

Quick 'n dirty OpenWrt buildroot setup using Alpine Linux

Daniel Engberg edited this page Aug 11, 2019 · 2 revisions
  • Download Extended x86_64
    https://alpinelinux.org/downloads/

  • Create a VM with ~2+ cores (it'll be very slow otherwise) and at least 1G of RAM, 2G preferably
    For what it's worth, here are my settings in Hyper-V:
    Machine type: "Generation 2" (UEFI support)
    No "Dynamic Memory"
    Secure Boot disabled
    Virtual CPUs 2 (same as the amount I allocated)
    Checkpoints Disabled

  • Start VM (boot from the ISO)

  • Login as root

  • Run setup-alpine

  • Set keyboard layout and variant

  • Set hostname (buildbox or whatever you prefer)

  • Enable eth0 and use dhcp, no manual configuration

  • Set password for root

  • Set timezone (i.e Europe/Oslo )

  • No proxy (unless you have one...)

  • NTP Client --> openntpd

  • Set mirror (preferably a close one)

  • Use openssh as SSH server

  • Use disk sda, use it as sys and confirm
    Power off (use the cmd poweroff) and remove the mounted iso

  • Boot up

  • Login as root

  • Run apk update

  • Run apk upgrade

  • Create a non root user
    adduser m00
    Always make it a habit to login as that user from now on

  • Run ifconfig to determine ipaddress, logout and login using a SSH client instead (as m00)

  • su root su root

  • Install packages
    apk add git build-base bash ncurses-dev perl tar findutils patch coreutils gawk grep unzip bzip2 wget python2-dev python3-dev linux-headers curl diffutils bsd-compat-headers less diffutils

  • Exit as root exit

  • Setup git (barebone)

git config --global core.editor "nano"
git config --global user.name "m00"
git config --global user.email [email protected]

git will ask about these settings eventually so just set these for now

  • Make a dir for your repo...
    mkdir openwrt

  • Clone OpenWrt (cd first to whatever dir you created)
    git clone https://github.com/openwrt/openwrt.git