It is assumed readers have enough knowledge of Linux and IP networking to know when to alter instructions to suit their own network and needs. Some of these instructions are destructive!
- Single-user Git server
- Infrequent push/pull
- Physically unobtrusive
- Networked from any room - i.e. WiFi
You can probably achieve the same results with a Pi but I bought a Compute Stick instead.
- STCK1A8LFC Compute Stick Specification
- Recovering the OS
- Headless Operation and the STCK1A8LFC BIOS
- Booting to Command Prompt
- Ubuntu Headless WiFi
- Remote Login
- Mount the MicroSD Card
- Git Server
STCK1A8LFC Compute Stick Specification
A STCK1A8LFC is terrible as a desktop PC.
- Model: STCK1A8LFC
- CPU: Intel Atom Z3735F; 1.33GHz 4-core; 2MB L2 cache; integrated graphics, memory controller, platform controller hub
- RAM: 1GB single-channel DDR3L/L-RS 1.35V 1333MHz
- Storage: 8GB Embedded MultiMediaCard (eMMC)
- Wireless: 802.11bgn; Bluetooth 4.0
- Ports: HDMI v1.4a (male); USB 2.0 Connector; MicroSD (8 to 128GB); 5V DC Connector (micro-USB)
- OS: Ubuntu 14.04 LTS (Trusty Tahr)
Intel has since released Compute Sticks with better specifications. To date, the STCK1A8LFC is the only one that comes with Linux pre-installed.
Factory partition scheme:
/dev/mmcblk0p1EFI System Partition (50MB FAT)
/dev/mmcblk0p2PQSERVICE Recovery Partition (1.3GB FAT)
/dev/mmcblk0p3Filesystem (5.3GB Ext4)
/dev/mmcblk0p4Swap (980MB Ext4)
I used the following peripherals to set up the device:
- 7-port powered USB 3.0 Hub
- USB keyboard
- USB mouse
- HDMI monitor
I also added a 32GB MicroSDHC card for storage as Ubuntu swallows most of the stock file system.
Instead of booting to Ubuntu the Stick gave me a GRUB prompt and trying to
cat the GRUB config locked up the device.
Holding down F10 during POST allows selection of the boot device and access to the recovery partition.
After recovery I ran
badblocks -sv /dev/mmcblk0 and it reported zero errors.
Intel doesn't provide a download image of the OS in case you ever need to reinstall from scratch. I took an image of the entire eMMC using:
- Linuxium live-boot USB stick (ubuntu-14.04.2-desktop-linuxium.iso ~1.2GB)
- >8GB ext4 formatted USB stick
Headless Operation and the STCK1A8LFC BIOS
Prior to version 31 of the FCBYT10H.86A BIOS there are issues with headless boot. You can check your BIOS version by holding down F2 during POST.
BIOS upgrade process:
- Place the .BIO file on a FAT32 USB or MicroSD device and connect it
- Hold down F7 during POST
- Select the storage device
- Select the file and press enter at the prompt
- Wait for the process to complete
Booting to Command Prompt
You can get a root shell in Ubuntu using
Backup the original GRUB config:
cp -n /etc/default/grub /etc/default/grub.orig
/etc/default/grub to enable booting to a command prompt:
GRUB_DEFAULT=0 GRUB_HIDDEN_TIMEOUT=0 GRUB_HIDDEN_TIMEOUT_QUIET=true GRUB_TIMEOUT=10 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` GRUB_CMDLINE_LINUX="text locale=en_GB.UTF-8
Change the locale code to your own.
Update Grub from the configuration:
Reboot to the console.
Ubuntu Headless WiFi
This section is dependent on local network configurations. NetworkManager is installed by default.
This command lists the available WiFi access points:
nmcli dev wifi list
The following key file
/etc/NetworkManager/system-connections/SOMESSID defines a connection to the SOMESSID network with the passphrase SOME_PASS_PHRASE.
The static IP 10.10.10.10 is allocated and the gateway is 10.10.10.1.
[connection] id=SOMESSID uuid=FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF type=802-11-wireless [802-11-wireless-security] key-mgmt=wpa-psk auth-alg=open psk=SOME_PASS_PHRASE [802-11-wireless] ssid=SOMESSID mode=infrastructure mac-address=FF:FF:FF:FF:FF:FF security=802-11-wireless-security [ipv4] method=manual dns=188.8.131.52,184.108.40.206 addresses=10.10.10.10/24,10.10.10.1 [ipv6] method=auto
The MAC address is specific to the device; the UUID is random.
The WiFi connection can be made by providing the SSID and will survive reboots:
nmcli c up id SOMESSID
Install the OpenSSH daemon:
sudo apt-get install openssh-server openssh-client sudo service ssh status
Mount the MicroSD Card
cp /etc/fstab /etc/fstab.orig
Use the blkid command to find the UUID of
add a line similar to this to
UUID=FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF /git ext4 errors=remount-ro 0 0
Create the mount point and mount the drive:
mkdir /git mount /git
apt-get install git
Create a user for owning the files:
adduser linus chown linus /git chgrp linus /git
sudo -i -u linus to switch to the new user and create a repository:
cd /git mkdir foo cd foo git init cd .. git clone --bare foo foo.git
Clone the empty repository from a development PC using a command of the form
git clone email@example.com:/git/foo.git.