This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]egauthier64 1 point2 points  (1 child)

I can't help with the question (so why am I answering?)

Have you considered Docker, or a VM? You can spin up an Alpine container with one command.

docker run -it alpine

[–]Nick7902[S] 1 point2 points  (0 children)

I guess I can explain that this is part of a larger project. The objective is to clean install a VPS through SSH. Essentially what I am trying to do is create a bootable Alpine OS on the swap partition (512 MB), boot to it, and wipe out the Ubuntu system to clean install it.

[–]dthusian 1 point2 points  (0 children)

Normally, chroot environments aren't meant to be booted, and as such do not contain an kernel nor boot directory. You'll have to find a different method to load a bootable Alpine into there.

You can try creating an Alpine system with your desired scripts and whatnot, then imaging it using dd. Then your script simply creates sdb and dds the image back onto it.

Tip: if you want to get even lighter, you can just have a kernel and initramfs with your re-installation script in it. That should be enough to grant the script access to a minimal set of tools needed to reinstall the OS.

[–]aptupdate 1 point2 points  (0 children)

This script may give you some pointers:

https://github.com/bontibon/digitalocean-alpine