Skip to content

Instantly share code, notes, and snippets.

@johnko
Last active February 16, 2018 12:04
Show Gist options
  • Save johnko/5dcda2a24c51ae4729b1 to your computer and use it in GitHub Desktop.
Save johnko/5dcda2a24c51ae4729b1 to your computer and use it in GitHub Desktop.
Experiments with FreeBSD on Intel Compute Stick

Experiments with FreeBSD on Intel Compute Stick

Ingredients

Acquire an Intel Compute Stick with Atom CPU and 2GB of RAM, 32GB of storage.

The product code I got is BOXSTCK1A32WFC.

You'll also need:

  • a USB hub
  • a USB thumbdrive with FreeBSD 11.0-CURRENT (10.2-RELEASE UEFI memstick crashes)
  • a USB keyboard & mouse
  • a USB nic/wifi adapter

We won't be installing FreeBSD because the internal disk can't be detected but we can run the LiveCD image from the thumbdrive.

Also the internal wifi adapater is not detected which is why I suggest a USB nic/wifi adapter.

Test Device

Boot into default OS and make sure everything works. In my case it was "Windows 8.1 with Bing".

I sped through the default OS OOBE and just made sure everything worked fine to rule out faulty hardware.

Create Medusa (Connect USB Peripherals)

Since the Intel Compute Stick only has 1 USB port, connect the USB hub, and everything else to the hub.

Boot into the BIOS (pressing F2)

image of Mr Bean tapping piano key

Change BIOS setting

In the BIOS, under Configuration, change Select Operating System from Windows 32bit to Ubuntu 64bit.

Save Changes and Exit.

Boot from USB thumbdrive (pressing F10).

image of Mr Bean tapping piano key

Select your USB thumbdrive

Select LiveCD

Login with root and no password.

Check what network adapters you have with ifconfig.

You'll notice there is only lo0.

Check what disk you have with gpart show.

You'll notice there is only da0 which is your USB thumbdrive.

Let's increase the size of /tmp and /var so we can play with pkg

Remount the / as read-write:

mount -o rw /

Set the tmpsize variable in rc.conf with:

sysrc tmpsize=300m

Set the varsize varialbe in rc.conf with:

sysrc varsize=300m

My USB wifi adapter used the realtek drivers which I had to read and accept by setting a variabl in /boot/loader.conf

Now reboot

Enable wifi from a USB adapter

Where rsu0 is your real wifi adapter name detected by FreeBSD:

ifconfig wlan0 create wlandev rsu0

Scan available wifi ssid networks with:

ifconfig wlan0 up scan

Create a file /etc/wpa.conf to save your wifi settings:

network={
ssid="$SSID"
psk="$PASSWORD"
}

Tell your wlan0 which ssid to connect to:

ifconfig wlan0 ssid $SSID

Use wpa_supplicant to negotiate the password:

wpa_supplicant -iwlan0 -c/etc/wpa.conf &

Get an IP address from your router:

dhclient wlan0

We're going to temporarily link /usr/local to /var/usrlocal since we're only playing around

% DO NOT DO THIS ON A PRODUCTION SYSTEM %

mount -o rw /
mkdir /var/usrlocal 
rmdir /usr/local
ln -s /var/usrlocal /usr/local

Now let's use pkg to download and install some programs

Bootstrap pkg:

env ASSUME_ALWAYS_YES=yes pkg bootstrap

Install screenfetch:

pkg install -y screenfetch

Mount the fdescfs needed by screenfetch:

mount -t fdescfs fdesc /dev/fd

Run it:

screenfetch

@UnitedMarsupials-zz
Copy link

Thanks for the report! Two notes:

  • if the RAM size is only 2GB, why not use The 32bit version of the OS?
  • the Amazon seller of a these states, the internal storage is Samsung’s EMCC — should be usable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment