{"id":65,"date":"2014-08-01T09:28:48","date_gmt":"2014-08-01T09:28:48","guid":{"rendered":"http:\/\/cazenave.co.uk\/?p=65"},"modified":"2014-12-17T15:21:23","modified_gmt":"2014-12-17T15:21:23","slug":"utilite-pro-as-a-server","status":"publish","type":"post","link":"https:\/\/cazenave.co.uk\/utilite-pro-as-a-server\/","title":{"rendered":"Utilite Pro as a server"},"content":{"rendered":"
I got a\u00a0 Utilite Pro<\/a> to replace my aging Fit-PC2. It’s significantly more powerful than the Fit-PC2 and contains an ARM processor. The standard package contains a slightly customised version of Ubuntu (mainly the kernel includes a few extra drivers for the onboard hardware). It turns out, however, that a number of useful features in the kernel have been disabled. These include lots of useful filesystems, including btrfs and xfs. It also has the kernel cryptographic routines disabled, which means you’re out of luck if you want to use some encryption software to protect your data. In the end, recompiling the kernel was pretty straightforward and Utilite provide pretty comprehensive instructions on how to do so.<\/p>\n In case it’s useful (and as a reminder to myself), here’s<\/a> the link to the instructions, but here’s my little script to automate the process:<\/p>\n set -eu<\/p>\n # Build a new kernel for the Utilite Pro. See: OLD=\"yes\" # run 'make oldconfig' instead of 'make menuconfig'?<\/p>\n CWD=$(pwd) mkdir -p $ROOTFS\/boot<\/p>\n export ARCH=arm<\/p>\n make utilite_defconfig<\/p>\n # Are we using the existing .config? cp -v $CWD\/arch\/arm\/boot\/uImage $ROOTFS\/boot\/$IMAGE # Display the commands to actually install the new kernel. To use the script, place it in the cloned git repository<\/a> and execute (probably best as root). It creates a tarball and prints the instructions for installing the new kernel after the compilation has completed. It refuses to overwrite an existing tarball (if you've run this script multiple times in the same day, you'll need to remove the old tarball before running the script again.<\/p>\n#!\/usr\/bin\/env bash<\/p>\n
\n# http:\/\/www.utilite-computer.com\/wiki\/index.php\/Utilite_Linux_Kernel<\/p>\n
\nTODAY=$(date +%Y-%m-%d)
\nROOTFS=$CWD\/..\/rootfs-$TODAY
\nTARBALL=$CWD\/..\/linux-image-utilite-$TODAY.tar.gz
\nIMAGE=uImage-cm-fx6<\/p>\n
\nif [ $OLD == \"yes\" ]; then
\n make oldconfig
\nelse
\n make menuconfig # this is interactive but you need to save a .config manually
\nfi
\nmake -j4 # parallelise the build
\nmake uImage
\nINSTALL_MOD_PATH=$ROOTFS make modules_install<\/p>\n
\ntar -C $ROOTFS -czvf $TARBALL .<\/p>\n
\nboot_partition=$(awk '{for (i=1; i<=NF; i++) {if($i~\/root=\/) {print substr($i,6,length($i)-6)\"1\"}}}' \/proc\/cmdline)\necho '# mount the \/boot partition:'\necho \"mount $boot_partition \/boot\"\nif [ ! -f \/boot\/$IMAGE-$TODAY ]; then\n echo '# back up the existing image:'\n echo mv \/boot\/$IMAGE \/boot\/$IMAGE-$TODAY\nelse\n echo \"WARNING: EXISTING KERNEL IMAGE BACKUP IN \/boot: $IMAGE-$TODAY\"\nfi\necho '# extract the new kernel to the installation:'\necho tar -C \/ -xvf $TARBALL<\/code><\/p>\n