October 18, 2016

How to Build the Perfect System on a USB Key

I was travelling earlier today and had a third of the day as downtime. But instead of the usual, twiddling of thumbs, chatting my neighbour up, etc. I focused inward. I've been wanting to upgrade my USB key to a newer version, and in doing so, automate the process. So I got started, I found the NetBSD sources I needed (I know I wanted to use OpenBSD, but that's for a future piece). The advantage of NetBSD is that its build system supports cross-compilation -- important for build speed -- and the base system takes less than 1 gig -- important for a flash drive. I set up a speedy ec2 instance for the build, using the Ubuntu trusty image and put the below script into /etc/rc.local, which checks out the latest NetBSD 7-STABLE source code, builds the amd64 port's live image, which needs to be put onto a USB key. Future enhancements are going to be to autoinstall the packages that we want on the system, but for now... if you should want a key of your own and aren't comfortable with this sort of hackery, you can send me $25 to cover the acquisition cost and shipping. E-mail your address and the packages you want installed to me and, a few weeks later, the stork will deliver you a live, USB-based NetBSD installation. Stick it in your machine, tell the BIOS to boot from it and you'll be set for life. I'll add the script to automatically set up the ec2 instance for true one click builds, if I get enough inquiries.

Finally, if you should have any suggestions, feel free to leave them in the comments.

No comments:

Post a Comment