Intel Compute Stick (STCK1A8LFC) + Xubuntu 18.04.4

# Intel Compute Stick (STCK1A8LFC) + Xubuntu 18.04.4

To avoid agonistic wifi settings, better install Xubuntu Desktop first.
Thanks to wifi drivers delivered with bionic, wifi works on installation.

## Hardware

- [Intel® Compute Stick STCK1A8LFC](https://ark.intel.com/content/www/us/en/ark/products/86613/intel-compute-stick-stck1a8lfc.html)

## Prerequisites

### prepare installation media

- at least 2GB USB memory stick as installation media
- Xubuntu Desktop installation is preferred for better wifi device detection
- download xubuntu-18.04.4-desktop-amd64.iso (1534459904 bytes) and burn it to USB memory stick

### equipments

- USB power supply (Type-A) and power cable (micro-B, packaged with STCK1A8LFC)
- HDMI extension cable (packaged with STCK1A8LFC)
- HDMI display
- wifi station/home router connected to internet
- USB HUB (Type-A) with at least 3 Type-A receptacles
  - Keyboard
  - Mouse
  - Installation media (as described above)
- at least 16GB microSD card as DUMMY system storage
  - Ubiquity (Ubuntu installer) refuses to proceed if only internal MMC exists
  - internal MMC is 8GB small, insufficient but still actually installable
  - better use this external microSD than internal MMC anyway

### update BIOS (could be done later)

- visit Intel Site and search STCK1A8LFC
  - https://downloadcenter.intel.com/ja/product/86613/-Compute-Stick-STCK1A8LFC

### BIOS settings

- press F2 during boot to enter BIOS setup
- check SecureBoot and Performance settings
- see [Install Ubuntu Server 18.04.2 on Intel Compute Stick Guide](https://jamesachambers.com/install-ubuntu-server-18-04-on-intel-compute-stick-guide/)

### LAN

- see wifi MACs (marked on Compute Stick surface)
- permit wifi MACs on wifi station/home router per-SSID settings
- write down available SSID and WPA2 PSK

## installation

- use English, do not change timezone nor keyboard mapping (set later)
  - avoiding unnecessary heuristic locale settings depending timezone
- do not connect to Internet during installation (connect later)
  - some gigs of free space remained for /var/cache/apt

## Post-install

### Cstate-related problems

bay trail SoC has broken sleep state. it hangs randomly. fundamentally, cooling failure.

`sudo vi /etc/default/grub` modify `GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"` to `GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_idle.max_cstate=1"
`

even after above, transition to sleep state seems still fatal. so,

`sudo apt remove thermald`

### CUI/GUI

`sudo systemctl set-default {multi-user,graphical}.target`

### inactivate unattended-upgrade

see and modify `/etc/apt/apt.conf.d/20auto-upgrades` as you like

### wifi 

edit `/etc/netplan/01-network-manager-all.yaml` and perform `netplan generate` `netplan apply`

```
# Let NetworkManager manage all devices on this system
network:
  version: 2
  wifis:
      wlan0:
          access-points:
              <ssid>:
                  password: <WPA2 PSK>
  renderer: NetworkManager
```

### Japan-only settings (no Japanese packages required) as you like

```
timedatectl set-timezone Asia/Tokyo
localectl set-keymap jp
```

### (optional) add your bread-and-butter packages

`sudo apt install tree curl jq git apt-transport-https socat build-essential ssh xorgxrdp-hwe-18.04 xrdp`

## References

- [Install Ubuntu Server 18.04.2 on Intel Compute Stick Guide](https://jamesachambers.com/install-ubuntu-server-18-04-on-intel-compute-stick-guide/)
  - this author uses Ubuntu Server
- [NetplanでWiFi設定](https://eng-memo.info/blog/netplan/)
- [Ubuntu 18.0.4 LTSでの無線LAN設定でつまづいた話](https://blog.kujira-station.com/201910232379)
- [Intel Compute Stick をサーバ化](https://qiita.com/11kenterada/items/7b087c8d0919ad3b9bc8)