Build Atmel ARM9 board Board Support Packets
guowenxue
2024-06-07 d956c803890acd0c5023a5940e398775fb5d46ca
update image build shell script to modify profile and sshd service
1 files modified
2 files added
82 ■■■■■ changed files
images/build.sh 12 ●●●●● patch | view | raw | blame | history
images/patches/S50sshd 50 ●●●●● patch | view | raw | blame | history
images/patches/profile 20 ●●●●● patch | view | raw | blame | history
images/build.sh
@@ -174,6 +174,16 @@
}
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
@@ -231,6 +241,8 @@
do_fetch
do_modify
do_build
do_install
images/patches/S50sshd
New file
@@ -0,0 +1,50 @@
#!/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 $?
images/patches/profile
New file
@@ -0,0 +1,20 @@
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