wok-tiny rev 67

Add fbvnc-ssh
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Sep 11 17:42:22 2011 +0200 (2011-09-11)
parents b529d4eabec0
children 5b93527a19eb
files dropbear/receipt fbvnc-ssh/receipt fbvnc/receipt
line diff
     1.1 --- a/dropbear/receipt	Sun Sep 11 09:35:34 2011 +0200
     1.2 +++ b/dropbear/receipt	Sun Sep 11 17:42:22 2011 +0200
     1.3 @@ -6,16 +6,15 @@
     1.4  SHORT_DESC="Light SSH client and server."
     1.5  MAINTAINER="pascal.bellard@slitaz.org"
     1.6  TARBALL="$PACKAGE-$VERSION.tar.gz"
     1.7 -DEPENDS="libutil libcrypt"
     1.8 +DEPENDS="libutil"
     1.9  [ -n "$TARGET" ] || TARGET="i486"
    1.10  BUILD_DEPENDS="dropbear uclibc-cross-compiler-$TARGET"
    1.11  SUGGESTED="sftp-server"
    1.12  WEB_SITE="http://matt.ucc.asn.au/dropbear/dropbear.html"
    1.13  WGET_URL="http://matt.ucc.asn.au/dropbear/releases/$TARBALL"
    1.14 -CONFIG_FILES="/etc/dropbear"
    1.15 +CONFIG_FILES="/etc/dropbear /etc/daemons.conf /etc/rcS.conf"
    1.16  PROVIDE="ssh"
    1.17  TAGS="ssh"
    1.18 -BUGS="should enable zlib"
    1.19  
    1.20  # Rules to configure and make the package.
    1.21  compile_rules()
    1.22 @@ -59,13 +58,20 @@
    1.23  # Post message when installing.
    1.24  post_install()
    1.25  {
    1.26 -	echo "$DSSKEY" | uudecode - > $1/etc/dropbear/dropbear_dss_host_key
    1.27 -	echo "$RSAKEY" | uudecode - > $1/etc/dropbear/dropbear_rsa_host_key
    1.28 +	cat >> $1/etc/daemons.conf <<EOT
    1.29 +
    1.30 +# Dropbear SSH server options.
    1.31 +DROPBEAR_OPTIONS="$DROPBEAR_OPTS"
    1.32 +EOT
    1.33 +	grep -qs 'dropbear ' $1/etc/rcS.conf ||
    1.34 +	sed -i 's/^RUN_DAEMONS="/&dropbear /' $1/etc/rcS.conf
    1.35 +	dos2unix <<EOT | uudecode - > $1/etc/dropbear/dropbear_dss_host_key
    1.36 +$DSSKEY
    1.37 +EOT
    1.38 +	dos2unix <<EOT | uudecode - > $1/etc/dropbear/dropbear_rsa_host_key
    1.39 +$RSAKEY
    1.40 +EOT
    1.41  	chmod 600 $1/etc/dropbear/dropbear_*_host_key
    1.42 -	grep -q dropbear $1/etc/rcS.conf ||
    1.43 -	sed -i 's/^RUN_DAEMONS="/&dropbear /' $1/etc/rcS.conf
    1.44 -	sed -i "s/^DROPBEAR_OPTIONS=.*/DROPBEAR_OPTIONS=\"$DROPBEAR_OPTS\"/" \
    1.45 -		$1/etc/daemons.conf
    1.46  }
    1.47  
    1.48  config_form()
    1.49 @@ -76,11 +82,21 @@
    1.50  		DSSKEY="$(uuencode -m - < /tmp/mkssh$$)"
    1.51  		rm -f /tmp/mkssh$$
    1.52  	fi
    1.53 +	uudecode - > /tmp/mkssh$$ <<EOT
    1.54 +$DSSKEY
    1.55 +EOT
    1.56 +	DSSPUB="$(dropbearkey  -y -f /tmp/mkssh$$ | grep ^ssh)"
    1.57 +	rm -f /tmp/mkssh$$
    1.58  	if [ -z "$RSAKEY" ]; then
    1.59  		dropbearkey -t rsa -f /tmp/mkssh$$ > /dev/null 2>&1
    1.60  		RSAKEY="$(uuencode -m - < /tmp/mkssh$$)"
    1.61  		rm -f /tmp/mkssh$$
    1.62  	fi
    1.63 +	uudecode - > /tmp/mkssh$$ <<EOT
    1.64 +$RSAKEY
    1.65 +EOT
    1.66 +	RSAPUB="$(dropbearkey  -y -f /tmp/mkssh$$ | grep ^ssh)"
    1.67 +	rm -f /tmp/mkssh$$
    1.68  	cat <<EOT
    1.69  <table>
    1.70  <tr>
    1.71 @@ -108,5 +124,13 @@
    1.72  <pre>
    1.73  # dropbearconvert openssh dropbear /etc/ssh/id_dsa /dev/stdout | uuencode -m -
    1.74  </pre>
    1.75 +Default DSS public key is
    1.76 +<pre>
    1.77 +$DSSPUB
    1.78 +</pre>
    1.79 +Default RSA public key is
    1.80 +<pre>
    1.81 +$RSAPUB
    1.82 +</pre>
    1.83  EOT
    1.84  }
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/fbvnc-ssh/receipt	Sun Sep 11 17:42:22 2011 +0200
     2.3 @@ -0,0 +1,66 @@
     2.4 +# SliTaz package receipt.
     2.5 +
     2.6 +PACKAGE="fbvnc-ssh"
     2.7 +VERSION="1.0"
     2.8 +CATEGORY="network"
     2.9 +SHORT_DESC="VNC client in frame buffer within a SSH tunnel."
    2.10 +MAINTAINER="pascal.bellard@slitaz.org"
    2.11 +WEB_SITE="http://tiny.slitaz.org/"
    2.12 +DEPENDS="base-tiny fbvnc dropbear"
    2.13 +
    2.14 +# Rules to gen a SliTaz package suitable for Tazpkg.
    2.15 +genpkg_rules()
    2.16 +{
    2.17 +	mkdir -p $fs/usr/bin
    2.18 +}
    2.19 +
    2.20 +config_form()
    2.21 +{
    2.22 +	[ "$VNCONLY" == "no" ] || VNCONLY=yes
    2.23 +	[ -n "$VNCUSER" ] || VNCUSER=tux
    2.24 +	cat <<EOT
    2.25 +<table>
    2.26 +<tr>
    2.27 +<td>SSH user for the VNC server</td>
    2.28 +<td><input type="text" name="VNCUSER" value="$VNCUSER"></td>
    2.29 +</tr>
    2.30 +<tr>
    2.31 +<td>Remove virtual consoles ?</td>
    2.32 +<td>
    2.33 +<input type="radio" name="VNCONLY" $([ "$VNCONLY" == "no" ] && echo "checked=checked ")value="no"> keep virtual consoles 3 to 6
    2.34 +<input type="radio" name="VNCONLY" $([ "$VNCONLY" == "yes" ] && echo "checked=checked ")value="yes"> keep VNC console only
    2.35 +</td>
    2.36 +</tr>
    2.37 +</table>
    2.38 +<p>
    2.39 +You should add the public key in <b>\$HOME/.ssh/authorized_keys</b> of the VNS/SSH server.
    2.40 +</p>
    2.41 +<p>
    2.42 +You can get it on the client (from configuration files) with:
    2.43 +</p>
    2.44 +<pre>
    2.45 +# dropbearkey -y -f /etc/dropbear/dropbear_dss_host_key | grep ^ssh
    2.46 +</pre>
    2.47 +or
    2.48 +<pre>
    2.49 +# dropbearkey -y -f /etc/dropbear/dropbear_rsa_host_key | grep ^ssh
    2.50 +</pre>
    2.51 +EOT
    2.52 +}
    2.53 +
    2.54 +post_install()
    2.55 +{
    2.56 +	sed -i 's/\(fbvnc -bpp [0-9]*\) \([^|]*\)/\1 127.0.0.1 5900/;/kill -1 1/d' $1/etc/init.d/local.sh
    2.57 +	cat >> $1/etc/init.d/local.sh <<EOT
    2.58 +
    2.59 +# From fbvnc-ssh
    2.60 +EOT
    2.61 +	[ "$VNCONLY" == "yes" ] &&  cat >> $1/etc/init.d/local.sh <<EOT
    2.62 +sed -i '/^tty[3-9]:.*/d' /etc/inittab
    2.63 +EOT
    2.64 +	cat >> $1/etc/init.d/local.sh <<EOT
    2.65 +grep -qs fbvnc /etc/inittab &&
    2.66 +sed -i "s|tty2:.*|tty2::respawn:/usr/bin/ssh -i /etc/dropbear/dropbear_dss_host_key -i /etc/dropbear/dropbear_rsa_host_key -y -N -L 5900:127.0.0.1:\$VNCPORT $VNCUSER@\$VNCSERVER|" /etc/inittab
    2.67 +kill -1 1
    2.68 +EOT
    2.69 +}
     3.1 --- a/fbvnc/receipt	Sun Sep 11 09:35:34 2011 +0200
     3.2 +++ b/fbvnc/receipt	Sun Sep 11 17:42:22 2011 +0200
     3.3 @@ -56,8 +56,8 @@
     3.4  </td>
     3.5  </tr>
     3.6  <tr>
     3.7 +<td>Bits per pixel</td>
     3.8  <td>
     3.9 -<td>Bits per pixel</td>
    3.10  <input type="radio" name="BPP" $([ "$BPP" == "8" ] && echo "checked=checked ")value="8"> 8
    3.11  <input type="radio" name="BPP" $([ "$BPP" == "16" ] && echo "checked=checked ")value="16"> 16
    3.12  <input type="radio" name="BPP" $([ "$BPP" == "32" ] && echo "checked=checked ")value="32"> 32
    3.13 @@ -79,24 +79,38 @@
    3.14  {
    3.15  	case "$START" in
    3.16  	on)	cat >> $1/etc/init.d/local.sh <<EOT
    3.17 +
    3.18 +# From fbvnc
    3.19 +VNCSERVER="$SERVER"
    3.20 +VNCPORT="$PORT"
    3.21  sed -i "s|tty1:.*|tty1::respawn:/usr/bin/fbvnc -bpp $BPP $SERVER $PORT|" /etc/inittab
    3.22  kill -1 1
    3.23  EOT
    3.24  		;;
    3.25  	ask)	cat >> $1/etc/init.d/local.sh <<EOT
    3.26 +
    3.27 +# From fbvnc
    3.28  echo -n "VNC server to connect (example: 192.168.0.123 5900): "
    3.29  read -t 30 SERVER
    3.30  [ -n "\$SERVER" ] &&
    3.31  sed -i "s|tty1:.*|tty1::respawn:/usr/bin/fbvnc -bpp $BPP \$SERVER|" /etc/inittab
    3.32 +set -- \$SERVER 5900
    3.33 +VNCSERVER="\$1"
    3.34 +VNCPORT="\$2"
    3.35  kill -1 1
    3.36  EOT
    3.37  		;;
    3.38  	cmdline) cat >> $1/etc/init.d/local.sh <<EOT
    3.39 +
    3.40 +# From fbvnc
    3.41  for i in \$(cat /proc/cmdline); do
    3.42      case "\$i" in
    3.43      fbvnc=*)
    3.44  	i=\${i#fbvnc=}
    3.45  	sed -i "s|tty1:.*|tty1::respawn:/usr/bin/fbvnc -bpp $BPP \${i/:/ }|" /etc/inittab
    3.46 +	set -- \${i/:/ } 5900
    3.47 +	VNCSERVER="\$1"
    3.48 +	VNCPORT="\$2"
    3.49  	kill -1 1
    3.50      esac
    3.51  done