Go to file
Sangbum Kim 69c5eacda7 로깅 메시지 정리 2024-03-10 02:21:43 +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 로깅 메시지 정리 2024-03-10 02:21:43 +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 added initial commit 2024-03-06 05:03:44 +09:00
Dockerfile 코드정리, kmsg 기반으로 로그 전송하도록 처리, allocator 메모리 재활용하도록 처리, init 찾을 수 있도록 처리 2024-03-10 01:53:57 +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