Instead of having make
build a Debian image, here are the instructions to manually modify a Ubuntu Base image to make it bootable on Intel Edison.
Also here is a pre-built ubuntu image for you now! check ubuntu-22.04-minimal
Download Gatesgarth64 image (https://github.com/edison-fw/meta-intel-edison/releases/download/Gatesgarth64/edison-image-91c85a58.7z).
Use flashall.sh
to flash it on the Edison.
Now when the Edison boots you need to login via serial port and connect to WiFi network
Connect a powered external hard drive via usb (or use SD card). The Edison hasn’t enough power on the USB port so an external powered Hard Drive is necessary
Format the disk (will erase all data):
mkfs.ext4 /dev/sda1
if using the hdd (check your device is /dev/sda1)mkfs.ext4 /dev/mmcblk1p1
if using the SD Card (the external sd will always be on that position)Mount the disk:
mount /dev/sda1 /mnt
if using the HDDmount /dev/mmcblk1p1 /mnt
if using the sd cardDownload Ubuntu Base using wget http://cdimage.ubuntu.com/ubuntu-base/releases/20.04/release/ubuntu-base-20.04.3-base-amd64.tar.gz
Extract it to the external disk: tar -C /mnt -zxf ubuntu-base-20.04.3-base-amd64.tar.gz
Copy kernel, modules and firmware:
cp -ra /lib/modules /mnt/lib/
cp -ra /lib/firmware /mnt/lib/
cp -ra /boot /mnt/
Correct system date: date -s '2022-02-21'
(put your date)
Chroot into Ubuntu:
mount -t proc /proc /mnt/proc
mount -t sysfs /sys /mnt/sys
mount -o bind /dev /mnt/dev
mount -o bind /dev/pts /mnt/dev/pts
and then chroot /mnt bash
You can change hostname:
echo 'edison' > /etc/hostname
Install some necessary packages:
export DEBIAN_FRONTEND="noninteractive"
apt update
apt install -y language-pack-en-base
apt install -y dialog apt-utils
unset DEBIAN_FRONTEND
apt install -y bash-completion curl dnsutils htop ifupdown iputils-ping kmod nano net-tools network-manager openssh-server rfkill sudo systemd systemd-sysv tree vim wget wireless-tools wpasupplicant
Create an user, and set password:
useradd -G sudo -d /home/ubuntu -m -s /bin/bash ubuntu
echo "ubuntu:ubuntu" | chpasswd
You will be able to login later when ubuntu boots with the user ubuntu
and password ubuntu
Enable login via serial port: systemctl enable getty@ttyS2.service
Exit and reboot:
exit
umount /mnt/dev/pts
umount /mnt/dev
umount /mnt/sys
umount /mnt/proc
umount /mnt
systemctl reboot
Interrupt U-Boot when requested and run in the U-Boot Console:
setenv bootargs_edsboot 'tty1 console=ttyS2,115200n8 root=/dev/sda1 rootfstype=ext4 systemd.unit=multi-user.target hardware_id=${hardware_id}'
run edsboot
setenv bootargs_edsboot 'tty1 console=ttyS2,115200n8 root=/dev/mmcblk1p1 rootfstype=ext4 systemd.unit=multi-user.target hardware_id=${hardware_id}'
run edsboot
Later we will make the boot permanent on Ubuntu (now when rebooted it will load the Gatesgarth Image)
Now you can login with user ubuntu
and password ubuntu
Now you’ll need to enable WiFi
sudo modprobe brcmfmac
echo 'brcmfmac' | sudo tee -a /etc/modules
With these commands we’re enabling the WiFi module
As an example, to connect to the access point ‘my_wifi’, you would use the following command:
$ nmcli d wifi connect my_wifi password <password>
see: https://ubuntu.com/core/docs/networkmanager/configure-wifi-connections
I followed this guide
As said above we have to set the SD Card (or HDD) as default boot disk, otherwise we’ll always load the Gatesgarth Image.
We can do that by going to the U-Boot console, interrupting the boot when asked (you’ll need to be connected through Serial to do that)
If you’re using an HDD just change /dev/mmcblk1p1
with /dev/sda1
in every command later
Then issue the following commands:
setenv mmc-bootargs 'setenv bootargs root=${myrootfs} rootdelay=3 rootfstype=ext4 ${bootargs_console} ${bootargs_debug} systemd.unit=${bootargs_target}.target hardware_id=${hardware_id} g_multi.iSerialNumber=${serial#} g_multi.dev_addr=${usb0addr}'
setenv myrootfs '/dev/mmcblk1p1'
setenv myrootfs_sdcard /dev/mmcblk1p1
setenv myrootfs_emmc /dev/mmcblk0p8
that’s the partition where out Gatesgarth image is loaded
setenv do_boot_emmc 'setenv myrootfs ${myrootfs_emmc}; run do_boot'
setenv do_boot_sdcard 'setenv myrootfs ${myrootfs_sdcard}; run do_boot'
setenv bootdelay 3
this is optional, we’re just delaying the boot allowing us more time to stop the boot process to enter the U-Boot Console
saveenv
run do_boot_sdcard
From now on every time we’ll reboot the board it will automatically load the system in the /dev/mmcblk1p1
partition aka. our SD Card.
If we want to load the Gatesgarth image (for debugging or whatever else) we’ll need to stop the boot process entering the U-Boot Console and issuing the following command:
run do_boot_emmc
© 2018 Ferry Toth