Skip to content

A tiny init binary intended to boot Ubuntu Base from an ext2 .img file on a FAT32 usb flash drive

Notifications You must be signed in to change notification settings

AXKuhta/micro_init

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

micro_init

A tiny init binary intended to boot Ubuntu Base from an ext2 .img file on a FAT32 usb flash drive

Booting into bash and executing some commands

What is Ubuntu Base?

Ubuntu Base is a small (27.1 MB) distribution of Ubuntu that is intended to run in chroot containers. It lacks its own init system, which is arguably its main advantage (Ubuntu uses systemd).

It comes with a fully functioning APT, so you can extend it to a full Ubuntu system, granted you have networking connectivity.

Annoyingly, Ubuntu Base lacks the packages required to set up a working network connection. Well, no wonder; it was meant to be run in a container in an environment that already has a connection set up, but that's not what we're doing. We're booting it raw!

List of gotchas

  • You must have an empty folder named dev
  • You must have an empty folder named newroot
  • You must mount root rw
  • Your kernel must have CONFIG_DEVTMPFS and CONFIG_DEVTMPFS_MOUNT enabled in order to automount /dev
    You know it automounts if you see a line "devtmpfs: mounted" shortly after mounting root
    Theoretically micro_init could do this by itself... Let implementing this be your homework?

Example kernel command line:

root=/dev/sda1 rw rootwait init=/micro_init

About

A tiny init binary intended to boot Ubuntu Base from an ext2 .img file on a FAT32 usb flash drive

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages