Created
July 24, 2025 11:30
-
-
Save luckycyang/18939017209f480bc8e72c36a3a4a87f to your computer and use it in GitHub Desktop.
A ramdiskfs init script for debug in alpine rootfs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| echo "Loading, please wait..." | |
| [ -d /dev ] || mkdir -m 0755 /dev | |
| [ -d /root ] || mkdir --mode=0700 /root | |
| [ -d /sys ] || mkdir /sys | |
| [ -d /proc ] || mkdir /proc | |
| [ -d /tmp ] || mkdir /tmp | |
| [ -d /mnt ] || mkdir /mnt | |
| # Mount /proc and /sys: | |
| mount -n proc /proc -t proc | |
| mount -n sysfs /sys -t sysfs | |
| # Note that this only becomes /dev on the real filesystem if udev's scripts | |
| # are used; which they will be, but it's worth pointing out | |
| #mount -t tmpfs -o mode=0755 udev /dev | |
| [ -e /dev/console ] || mknod /dev/console c 5 1 | |
| [ -e /dev/null ] || mknod /dev/null c 1 3 | |
| # this will scan device update /dev list | |
| mdev -s | |
| /bin/sh -i |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment