| b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # Copyright (C) 2006 OpenWrt.org | ||||
| 3 | export INITRAMFS=1 | ||||
| 4 | |||||
| 5 | # switch to tmpfs to allow run daemons in jail on initramfs boot | ||||
| 6 | DIRS=$(echo *) | ||||
| 7 | NEW_ROOT=/new_root | ||||
| 8 | |||||
| 9 | mkdir -p $NEW_ROOT | ||||
| 10 | mount -t tmpfs tmpfs $NEW_ROOT | ||||
| 11 | |||||
| 12 | cp -pr $DIRS $NEW_ROOT | ||||
| 13 | |||||
| 14 | exec switch_root $NEW_ROOT /sbin/init | ||||