Skip to content

Basic setup for rpi4 without needing another computer or monitor

License

Notifications You must be signed in to change notification settings

HackerHappyHour/bootcc

Repository files navigation

BootCC

This is an automation I wrote to help me load up fresh versions of Ubuntu-server on RPi 4, without requiring ethernet or a monitor, so I could atomically test builds of octoprint/octoprint docker image. I may expand this some day to a GUI tool, but for now, it's scripted enough to work every time and you just have to "fill in the blanks" so to speak, of your own network details and desired hostname.

Steps to follow are below.

Steps

  1. insert usb disk
  2. download ubuntu image
  3. get disk device map designation using lsblk -a -d -e7
  4. example device is /dev/sde
  5. uncompress and pipe ubuntu compressed disk image to dd to "restore" it to usb disk
  6. xzcat ubuntu.img.xz | sudo dd status=progress of=/dev/sde bs=4M conv=sync,noerror
  7. mount the disk sudo mount /dev/sde /media/${USER}
  8. Edit the network config in writable/etc/wpa_supplicant/wpa_supplicant.conf
  9. Edit desired details in cloud-config/user-data
  10. sudo ./write-boot-configs /media/$USER
  11. Turn on pi, wait ~5 minutes for boot
  12. login using ssh ubuntu@<static_ip_address (declared below in netplan example)> with password ubuntu
  13. Follow prompts to change password immediately, will disconnect after password is updated
  14. log back in using ssh ubuntu@<static_ip_address> with the new password, and voila!

Following example taken directly from netplan.io/examples#conecting-to-a-wpa-personal-wireless-network

Edit the system-boot/network-config file as follows:

... # existing config
  wifis:
    wlan0:
      optional: true
      dhcp4: no
      dhcp6: no
      addresses: [192.168.0.21/24]
      gateway4: 192.168.0.1
      nameservers:
        addresses: [192.168.0.1, 8.8.8.8]
      access-points:
        "network_ssid_name":
          password: "**********"

example etc/wpa_supplicant/wpa_supplicant.conf

network={
    ssid="ssidname"
    psk="password"
}

Links

https://wiki.ubuntu.com/ARM/RaspberryPi https://www.raspberrypi.org/documentation/configuration/config-txt/README.md https://netplan.io/examples#connecting-to-a-wpa-personal-wireless-network

About

Basic setup for rpi4 without needing another computer or monitor

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published