update image build shell script to modify profile and sshd service
1 files modified
2 files added
| | |
| | | } |
| | | |
| | | |
| | | function do_modify() |
| | | { |
| | | cd $PRJ_PATH |
| | | |
| | | pr_info "start modify rootfs ..." |
| | | |
| | | cp patches/profile $ROOTFS_SRC/etc/profile |
| | | cp patches/S50sshd $ROOTFS_SRC/etc/init.d/S50sshd |
| | | } |
| | | |
| | | function do_build() |
| | | { |
| | | cd $PRJ_PATH |
| | |
| | | |
| | | do_fetch |
| | | |
| | | do_modify |
| | | |
| | | do_build |
| | | |
| | | do_install |
New file |
| | |
| | | #!/bin/sh |
| | | # |
| | | # sshd Starts sshd. |
| | | # |
| | | |
| | | # Make sure the ssh-keygen progam exists |
| | | [ -f /usr/bin/ssh-keygen ] || exit 0 |
| | | |
| | | umask 077 |
| | | |
| | | start() { |
| | | # Create any missing keys |
| | | /usr/bin/ssh-keygen -A |
| | | |
| | | # This folder must own by root |
| | | chown root.root /var/empty/ |
| | | |
| | | printf "Starting sshd: " |
| | | /usr/sbin/sshd |
| | | touch /var/lock/sshd |
| | | echo "OK" |
| | | } |
| | | stop() { |
| | | printf "Stopping sshd: " |
| | | killall sshd |
| | | rm -f /var/lock/sshd |
| | | echo "OK" |
| | | } |
| | | restart() { |
| | | stop |
| | | start |
| | | } |
| | | |
| | | case "$1" in |
| | | start) |
| | | start |
| | | ;; |
| | | stop) |
| | | stop |
| | | ;; |
| | | restart|reload) |
| | | restart |
| | | ;; |
| | | *) |
| | | echo "Usage: $0 {start|stop|restart}" |
| | | exit 1 |
| | | esac |
| | | |
| | | exit $? |
| | | |
New file |
| | |
| | | export PATH="/bin:/sbin:/usr/bin:/usr/sbin:/apps/bin:/apps/tools" |
| | | |
| | | if [ "$PS1" ]; then |
| | | if [ "`id -u`" -eq 0 ]; then |
| | | export PS1='[\u@\h \w]# ' |
| | | else |
| | | export PS1='[\u@\h \w]$ ' |
| | | fi |
| | | fi |
| | | |
| | | export PAGER='/bin/more' |
| | | export EDITOR='/bin/vi' |
| | | |
| | | # Source configuration files from /etc/profile.d |
| | | for i in /etc/profile.d/*.sh ; do |
| | | if [ -r "$i" ]; then |
| | | . $i |
| | | fi |
| | | done |
| | | unset i |