Skip to content

Instantly share code, notes, and snippets.

@pjobson
Last active October 28, 2019 06:24
Show Gist options
  • Save pjobson/e0b0c99f5d9affb28c1a2f33503c27c7 to your computer and use it in GitHub Desktop.
Save pjobson/e0b0c99f5d9affb28c1a2f33503c27c7 to your computer and use it in GitHub Desktop.
AP42 Debian/Mint/Ubuntu Linux Install Instructions

AP42 Linux Mint / Ubuntu Linux Variants Install Instructions

Instructions on installing Ubuntu or Ubuntu Flavour, Linux Mint, KDE neon, elementary OS, BackBox, or Peppermint on Beelink AP42 or Kodlix AP42 and possibly other Apollo Lake Intel CPU computers.

This is the specific machine I purchased from Amazon CoolFun N42 DIY SSD Mini PC Intel Apollo Lake Pentium N4200 Processor.

I couldn't find any step-by-step instructions detailing this, so here we go.

The AP42 uses UEFI to install Linux on it, it won't boot if you use a standard USB bootable drive. You'll need to respin the ISO to use the rEFInd Boot Manager instead of GRUB, which using isorespin is incredibly easy.

Download an ISO copy of your preference

Download: isorespin.sh

Required packages: bc, klibc-utils, iproute2, genisoimage, dosfstools, squashfs-tools, rsync, squashfs-tools, unzip, wget, findutils, xorriso. You'll probably have some if not most of these, but you can try installing them all. When you run ./isorespin.sh it'll tell you what it is missing.

sudo apt install bc klibc-utils iproute2 genisoimage dosfstools squashfs-tools rsync squashfs-tools unzip wget findutils xorriso

Here we're going to rebuild the ISO file for UEFI and upgrade the Linux kernel to the latest. The AP42 uses the Intel Apollo Lake CPU, using the --apollo switch sets up the rEFInd boot loader.

The name of your ISO file will probably vary from mine in the mv and isorespin.sh steps.

mkdir ~/respin
cd ~/respin
mv ~/Downloads/isorespin.sh ~/respin
chmod +x isorespin.sh
mv ~/Downloads/linuxmint-18.2-mate-64bit.iso ~/respin
./isorespin.sh  -i ~/respin/linuxmint-18.2-mate-64bit.iso --apollo -u

isorespin automates the entire process...

Extracting ISO ...
Parallel unsquashfs: Using 4 processors
216491 inodes (231715 blocks) to write
Extracting ISO ...
[===========================================================================================================]  231715/231715 100%

created 168180 files
created 21261 directories
created 48197 symlinks
created 81 devices
created 0 fifos
Extracting isorespin files ...
Updating bootloader/bootmanager ...
Fetching mainline kernel packages ...
Installing mainline kernel packages ...
Spinning ISO ...
Parallel mksquashfs: Using 4 processors
Creating 4.0 filesystem on iso-directory-structure/casper/filesystem.squashfs, block size 131072.
[===========================================================================================================]  204205/204205 100%

Exportable Squashfs 4.0 filesystem, gzip compressed, data block size 131072
	compressed data, compressed metadata, compressed fragments, compressed xattrs
	duplicates are removed
Filesystem size 1766327.01 Kbytes (1724.93 Mbytes)
	37.76% of uncompressed filesystem size (4677804.47 Kbytes)
Inode table size 2661745 bytes (2599.36 Kbytes)
	27.69% of uncompressed inode table size (9613921 bytes)
Directory table size 2712124 bytes (2648.56 Kbytes)
	41.17% of uncompressed directory table size (6586862 bytes)
Number of duplicate files found 38650
Number of inodes 272324
Number of files 195167
Number of fragments 12362
Number of symbolic links  48522
Number of device nodes 81
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 28554
Number of ids (unique uids + gids) 31
Number of uids 13
	root (0)
	man (6)
	colord (112)
	speech-dispatcher (113)
	kernoops (115)
	hplip (114)
	nm-openvpn (118)
	avahi (110)
	pjobson (1000)
	_apt (105)
	ntp (108)
	avahi-autoipd (109)
	syslog (104)
Number of gids 27
	root (0)
	video (44)
	audio (29)
	tty (5)
	kmem (15)
	disk (6)
	dip (30)
	shadow (42)
	ssl-cert (112)
	lpadmin (113)
	nogroup (65534)
	ntp (114)
	utmp (43)
	crontab (107)
	mail (8)
	avahi-autoipd (117)
	avahi (118)
	messagebus (110)
	pjobson (1000)
	staff (50)
	bluetooth (119)
	pulse-access (123)
	syslog (108)
	ssh (116)
	nm-openvpn (126)
	adm (4)
	lp (7)

Adding ISO boot partition ...
Adding ISO file system partition ...
./isorespin.sh: Respun ISO created as 'linuxium-apollo-v4.14-rc1-linuxmint-18.2-mate-64bit.iso' ... see logfile 'isorespin.log' for details.

Note the name of the new ISO file, mine is linuxium-apollo-v4.14-rc1-linuxmint-18.2-mate-64bit.iso.

Insert your USB and figure out where it is mounted to and what the device is.

mount 

Should display something like this, of course yours will have a different mount point as your login probably isn't pjobson. Be sure to take note of your device name, don't mess this up or you could severely mess up your install, mine is /dev/sdh.

/dev/sdh1 on /media/pjobson/x type ext4 (rw,nosuid,nodev,relatime,data=ordered,uhelper=udisks2)

May be slightly different, unmount your device.

umount /media/pjobson/x

I like to delete the partitions of the drive.

sudo parted /dev/sdh

You'll be dropped to the (parted) prompt.

(parted) print 

Model: Kingston DataTraveler 2.0 (scsi)
Disk /dev/sdh: 15.7GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  15.7GB  15.7GB  primary  ext4

Take note of the Model, if it is not your USB stick, you may be looking at the wrong disk. If everything is okay rm each of your partitions.

(parted) rm 1                                                             
(parted) print                                                            
Model: Kingston DataTraveler 2.0 (scsi)
Disk /dev/sdh: 15.7GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start  End  Size  Type  File system  Flags

(parted) quit
Information: You may need to update /etc/fstab.

Ignore the fstab message.

Now write the ISO to the USB with dd, this will take awhile.

sudo dd if=linuxium-apollo-v4.14-rc1-linuxmint-18.2-mate-64bit.iso of=/dev/sdh bs=8M
243+1 records in
243+1 records out
2041188352 bytes (2.0 GB, 1.9 GiB) copied, 330.982 s, 6.2 MB/s

Pop the drive out and pop it into your AP42.... Hey while you're messing with the AP42, consider installing a SSD. I got this ZTC 256GB Armor 42mm M.2 NGFF 6G SSD Solid State Drive. You'll have to take the device apart, but it really isn't a huge deal.

Boot up your AP42 and hit the delete key to get into the BIOS. Go over to BOOT and deselect all the boot options, except for your USB. Save and exit.

You should boot into rEFInd, then boot into the Live CD or installer.

I'm using MINT, so this stuff may or may not be applicable to you.

From the Menu open GParted, you'll have two or three devices depending on if you installed an SSD or not. Mine are:

  • /dev/mmcblk1 @ 47.62 GiB - The built in MMC flash drive, mine has Windows on it... well did.
  • /dev/sda @ 238.47 GiB - This is my SSD drive.
  • /dev/sdb @ 14.65 GiB - This is my USB stick.

I deleted all of the existing partitions from both the MMC and the SSD drive for a clean install.

Create an ext4 partition on /dev/mmcblk1, this will get deleted in the installer.

Save and quit out of GParted.

Connect to your WiFi or LAN if you want.

Start the Install Linux Mint program, next through it, install 3rd party if you want.

After the installer completes, reboot, remove the USB stick, hit delete again and select to boot from Hard Drive or whatever.

You rEFInd should appear again and you can boot into Linux.

@pjobson
Copy link
Author

pjobson commented Oct 10, 2018

Updated with correct operating systems and cleaned up links.

@pjobson
Copy link
Author

pjobson commented Jan 18, 2019

This is probably no longer needed as most linux distros support UEFI.

@tomillr
Copy link

tomillr commented Jan 27, 2019

I‘m still trying to get OpenMediaVault to work on my Apollo Lake-based pc. Does Debian also support UEFI now?

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