initrd 制作
bash
#!/bin/sh
mount -t devtmpfs dev /dev
mount -t proc proc /proc
mount -t sysfs sysfs /sys
mount -t tmpfs none /tmp
mount -t debugfs none /sys/kernel/debug
UPTIME=$(cut -d' ' -f1 /proc/uptime)
printf \\x1bc
dmesg
echo "Boot took $UPTIME seconds"
/sbin/getty -n -l /bin/sh 115200 /dev/console
poweroff -f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18