From 91e1330bde8f170af0491f72edd586de7ea65b4a Mon Sep 17 00:00:00 2001 From: Sangbum Kim Date: Thu, 7 Mar 2024 11:39:42 +0900 Subject: [PATCH] =?UTF-8?q?readme=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..9e8f8cc --- /dev/null +++ b/README.md @@ -0,0 +1,24 @@ +# init-wrapper +It performs the same operation as the shell at the bottom. + +``` +#!/bin/sh +set -eu +mount --make-private / +mount -t tmpfs -o lazytime,relatime,nodev,nosuid parentfs /run +mkdir -p /run/overlay +mkdir -p /run/overlay/lower +mkdir -p /run/overlay/upper +mkdir -p /run/overlay/work +mkdir -p /run/overlay/merged +mount -o bind / /run/overlay/lower +mount -t overlay -o rw,relatime,lowerdir=/run/overlay/lower,upperdir=/run/overlay/upper,workdir=/run/overlay/work,redirect_dir=on,uuid=on,metacopy=on,volatile rootfs /run/overlay/merged +mkdir -p /run/overlay/merged/oldroot +pivot_root /run/overlay/merged /run/overlay/merged/oldroot +cd / +mount --move /oldroot/run /run +umount -l /oldroot +rmdir /oldroot +rmdir /run/overlay/merged +exec /sbin/init +``` \ No newline at end of file