Port-arm archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: building an RPI image that can be used via SSH
Hallo Hubert,
With my RPI B+, I had the very same problem as you describe: a serial
console that gives all the messages out from the Pi, but which doesn't
transmit information in the opposite way. I solved that problem by
disabling the hardware flow control on the other side of the serial
link. Using minicom on a PC, the connection was setup at 115200 speed,
8-N-1, and until I disabled the hardware flow control, nothing would
be transmitted from the PC to the Pi. Yes, you are right, that's very
annoying. Maybe it's worth it to add a word about that on the wiki
page (http://wiki.netbsd.org/ports/evbarm/raspberry_pi/)...
For your information, here is the content of my /boot/cmdline.txt:
console=ttyAMA0,115200 root=ld0a
Regards,
JB
On Wed, Jul 15, 2015 at 9:19 PM, Hubert Feyrer <hubert%feyrer.de@localhost> wrote:
>
> Hi,
>
> my RPI doesn't like the serial console - I get output, but I cannot type
> anything. It's hard to use the existing images that way: SSH login as root
> fails because root cannot login via SSH, and if so, the root account has an
> empty password and SSH doesn't allow that.
>
> How about adding a separate (non-root) user with a known password,
> that has su(8) permissions (is in the wheel group)?
>
> The patch below does that and works for me...
>
> What do you think?
> Other ideas how to make use of our images without a serial console?
>
>
> - Hubert
>
>
> Index: distrib/utils/embedded/conf/rpi.conf
> ===================================================================
> RCS file: /cvsroot/src/distrib/utils/embedded/conf/rpi.conf,v
> retrieving revision 1.29
> diff -u -r1.29 rpi.conf
> --- distrib/utils/embedded/conf/rpi.conf 19 Apr 2015 18:28:31 -0000
> 1.29
> +++ distrib/utils/embedded/conf/rpi.conf 15 Jul 2015 19:06:46 -0000
> @@ -42,13 +42,80 @@
> EOF
> echo "./etc/rc.local type=file uname=root gname=wheel mode=0644" \
> >> "$tmp/selected_sets"
> +
> +# echo "${bar} enabling root login and empty passwords via SSH"
> +# f=etc/ssh/sshd_config
> +# mkdir -p `dirname ${mnt}/$f`
> +# sed \
> +# -e '/PermitRootLogin/s,#,,' \
> +# -e '/PermitRootLogin/s,no,yes,' \
> +# -e '/PermitEmptyPasswords/s,#,,' \
> +# -e '/PermitEmptyPasswords/s,no,yes,' \
> +# <${release}/$f >${mnt}/$f
> +# echo "./$f type=file uname=root gname=wheel mode=0444" \
> +# >> "$tmp/selected_sets"
> +
> + echo "${bar} Enabling FFS journalling for /"
> + f=etc/fstab
> + mv ${mnt}/${f} ${mnt}/${f}.orig
> + sed \
> + -e '/ffs/s.rw.&,log.' \
> + <${mnt}/$f.orig >${mnt}/$f
> + rm ${mnt}/${f}.orig
> +
> + rpi_user=pi
> + rpi_password=raspberry
> +
> rpi_password_c='$2a$07$mOdoKebSILQqApYAPyPxLORulN8kpwxgpmire8MOLBu.hPQ6LWIGW'
> # create: pwhash -b 7
> + rpi_uid=1000
> + rpi_gid=100
> + :
> + echo "${bar} Adding '$rpi_user' user, with password '$rpi_password'"
> + f=etc/master.passwd
> + mkdir -p `dirname ${mnt}/$f`
> + cp ${release}/$f ${mnt}/$f
> + echo
> "${rpi_user}:${rpi_password_c}:${rpi_uid}:${rpi_gid}::0:0::/home/${rpi_user}:/bin/ksh"
>>>${mnt}/$f
> + ${TOOLDIR}/bin/nbpwd_mkdb -p -d ${mnt} ${mnt}/$f
> + :
> + # Update in set lists - remove checksums & size
> + s=${tmp}/selected_sets
> + mv $s $s.orig
> + sed \
> + -e '/etc\/master.passwd/s, size=[0-9]*,,' \
> + -e '/etc\/master.passwd/s, sha256=[0-9a-f]*,,' \
> + -e '/etc\/passwd/s, size=[0-9]*,,' \
> + -e '/etc\/passwd/s, sha256=[0-9a-f]*,,' \
> + -e '/etc\/pwd.db/s, size=[0-9]*,,' \
> + -e '/etc\/pwd.db/s, sha256=[0-9a-f]*,,' \
> + -e '/etc\/spwd.db/s, size=[0-9]*,,' \
> + -e '/etc\/spwd.db/s, sha256=[0-9a-f]*,,' \
> + <${s}.orig >$s
> + rm ${s}.orig
> +
> + echo "${bar} Adding home directory for user '$rpi_user'"
> + mkdir -p $mnt/home/pi
> + echo "./home type=dir mode=755 uid=0 gid=0" >>$s
> + echo "./home/$rpi_user type=dir mode=700 uid=${rpi_uid}
> gid=${rpi_gid}" >>$s
> +
> + echo "${bar} Adding user '$rpi_user' to wheel group"
> + f=etc/group
> + sed \
> + -e "/wheel/s.$.,${rpi_user}." \
> + <${release}/$f >${mnt}/$f
> + mv $s $s.orig
> + sed \
> + -e '/etc\/group/s, size=[0-9]*,,' \
> + -e '/etc\/group/s, sha256=[0-9a-f]*,,' \
> + <$s.orig >$s
> + rm $s.orig
> +
> }
>
> populate() {
> rpi2_kernel="$(echo $kernel | sed 's/RPI/RPI2/g')"
>
> cat > ${mnt}/boot/cmdline.txt << EOF
> -root=ld0a console=fb
> +root=ld0a
> +#HF#root=ld0a console=fb
> #fb=1280x1024 # to select a mode, otherwise try EDID
> #fb=disable # to disable fb completely
> EOF
Home |
Main Index |
Thread Index |
Old Index