3

I've looked at a lot of topics that look like what I'm looking for but aren't quite what I want. To give you some context, my ultimate goal is to have a Vagrant box that can compile some C code and output a binary. These are my requirements :

  • The OS image needs to be very small (around 50 MB would be good enough, the smaller the better)
  • Ideally I don't want to compile every tool I'd like to use, so it would be nice if I had access to the Arch or Debian package repos through pacman or apt-get
  • All I need on the base image is a toolchain, basic networking, and a popular package manager

The idea is for this base image to be complimented with other specific tools using Packer and then packaged as a Vagrant box.

So far I've looked at these distros :

  • Tiny Core: Very interesting size-wise (10 MB) but the package repo makes it a no-no, and I haven't seen anything on getting pacman on it.
  • Arch Linux: The base image is very large for my needs (>600 MB). I might be able to create a custom image, but this is a last resort.
  • Puppy: Tahrpup is based on Ubuntu but still big for my taste (200 MB)
  • Alpine: 82 MB, good enough but again the package manager makes it a no-no
  • No idea how big this turns out to be - wiki.debian.org/ReduceDebian – EightBitTony Jan 19 '16 at 11:33
  • You may have a look at linuxbbq.org/about.html – Mathieu Jan 19 '16 at 12:02
  • Try debian live-build tools. You can customize you own image and build it. – user1700494 Jan 19 '16 at 12:23
  • You can just use Arch's archiso to have whatever packages you want installed on the live media. – HalosGhost Jan 20 '16 at 0:49
  • @HalosGhost, this is the path i'm currently investigating, thank you :) – Fahd Jan 21 '16 at 10:28
0

Reading between the lines, I think you like Arch. Well, it is easy to create a custom image using mkarchroot. See this example:

$ mkarchroot -C pacman.conf img packages

where

  • pacman.conf is your pacman config file
  • img is a directory to contain the files
  • packages is the list of packages you'd like (e.g. start with base grub)

You can then write the contents of that img directory onto a filesystem that you can boot from. You'll need to setup a bootloader (i.e. grub) which I won't go into here.

You may need to refine your package list to get a working system that is suitable for your needs but this should get you started. Also, you don't need all of base for a minimal working system so you can trim out packages that you don't need (list required packages explicitly and omit base).

If you need to, you can download a vanilla pacman.conf:

curl https://git.archlinux.org/svntogit/packages.git/plain/trunk/pacman.conf.x86_64?h=packages/pacman > pacman.conf

(my example above generates a filesystem that is 5.5G in size)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.