Go to file
Sangbum Kim 2e653268c8 fix error in type conversion 2024-09-23 04:21:12 +09:00
.vscode added initial commit 2024-03-06 05:03:44 +09:00
cargo added initial commit 2024-03-06 05:03:44 +09:00
src fix error in type conversion 2024-09-23 04:21:12 +09:00
.dockerignore added initial commit 2024-03-06 05:03:44 +09:00
.gitignore added initial commit 2024-03-06 05:03:44 +09:00
Cargo.toml 바이너리 크기 조정. 2024-07-22 02:27:12 +09:00
Dockerfile 오타 정리. 2024-07-22 02:28:27 +09:00
Dockerfile.debian added initial commit 2024-03-06 05:03:44 +09:00
README.md 코드정리, kmsg 기반으로 로그 전송하도록 처리, allocator 메모리 재활용하도록 처리, init 찾을 수 있도록 처리 2024-03-10 01:53:57 +09:00

README.md

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/dev /dev || true
mount  --move /oldroot/run /run
umount -l /oldroot
rmdir /oldroot
rmdir /run/overlay/merged
exec /sbin/init

USAGE

When booting the kernel, add the following line to the append parameter:

init=/sbin/init-wrapper