From 5d5cd90ddf9247ed179a71293777d2fcd430bd14 Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Thu, 17 Oct 2019 11:18:10 +0200 Subject: [PATCH] Document systemd-nspawn as a nice trick for patching a ramdisk Change-Id: I1f6d60a1db272293b701b44d705efc92933682a7 --- doc/source/admin/troubleshooting.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/doc/source/admin/troubleshooting.rst b/doc/source/admin/troubleshooting.rst index 644849677e..ccb0750498 100644 --- a/doc/source/admin/troubleshooting.rst +++ b/doc/source/admin/troubleshooting.rst @@ -173,6 +173,21 @@ The last command will result in the whole Linux file system tree unpacked in the current directory. Now you can modify any files you want. The actual location of the files will depend on the way you've built the ramdisk. +.. note:: + On a systemd-based system you can use the ``systemd-nspawn`` tool (from + the ``systemd-container`` package) to create a lightweight container from + the unpacked filesystem tree:: + + sudo systemd-nspawn --directory /path/to/unpacked/ramdisk/ /bin/bash + + This will allow you to run commands within the filesystem, e.g. use package + manager. If the ramdisk is also systemd-based, and you have login + credentials set up, you can even boot a real ramdisk enviroment with + + :: + + sudo systemd-nspawn --directory /path/to/unpacked/ramdisk/ --boot + After you've done the modifications, pack the whole content of the current directory back::