#!/bin/sh diskfs=$1 # 用户组文件 cat<${diskfs}/etc/group root:x:0:root EOF # 用户密码文件 cat<${diskfs}/etc/passwd root:x:0:0:root:/:/bin/sh EOF # 用户 shadow 文件 cat<${diskfs}/etc/shadow root:\$1\$abcdefgh\$KJHEbEnUJaxWv269o9nH60:1:0:99999:7::: EOF # 用户 hostname 文件 cat<${diskfs}/etc/hostname localhost EOF # 用户 profile 文件 cat<${diskfs}/etc/profile HOSTNAME=$(/bin/hostname -F /etc/hostname) PS1="[\u@\h \w]\# " export PS1 HOSTNAME EOF cat<${diskfs}/etc/inittab ::sysinit:/bin/hostname -F /etc/hostname ::sysinit:/etc/init.d/rcS tty0::respawn:-/bin/login ::restart:/sbin/init ::ctrlaltdel:/sbin/reboot ::shutdown:/bin/umount -a -r ::shutdown:/sbin/swapoff -a EOF