[yocto] How to have Poky automatically login at boot?
Andre McCurdy
armccurdy at gmail.com
Fri Jul 28 17:32:16 PDT 2017
On Fri, Jul 28, 2017 at 11:29 AM, Aaron Schwartz
<aaron.schwartz at logicsupply.com> wrote:
> Hello,
>
> I'm trying to have the busybox getty in Poky login as root automatically but
> I can't seem to get it working.
This may be a possible solution:
https://git.linaro.org/openembedded/meta-linaro.git/tree/meta-linaro/recipes-linaro/auto-serial-console/auto-serial-console_0.1.bb
> So far I have a sysvinit-inittab_2.%.bbappend:
>>
>> PR := "${PR}.1"
>> SYSVINIT_ENABLED_GETTYS="1 2 3 4"
>> do_install() {
>> install -d ${D}${sysconfdir}
>> install -m 0644 ${WORKDIR}/inittab ${D}${sysconfdir}/inittab
>> install -d ${D}${base_bindir}
>> install -m 0755 ${WORKDIR}/start_getty ${D}${base_bindir}/start_getty
>> set -x
>> tmp="${SERIAL_CONSOLES}"
>> for i in $tmp
>> do
>> j=`echo ${i} | sed s/\;/\ /g`
>> l=`echo ${i} | sed -e 's/tty//' -e 's/^.*;//' -e 's/;.*//'`
>> label=`echo $l | sed 's/.*\(....\)/\1/'`
>> echo "$label:12345:respawn:${base_bindir}/start_getty ${j} vt102" >>
>> ${D}${sysconfdir}/inittab
>> done
>> if [ "${USE_VT}" = "1" ]; then
>> cat <<EOF >>${D}${sysconfdir}/inittab
>> # ${base_sbindir}/getty invocations for the runlevels.
>> #
>> # The "id" field MUST be the same as the last
>> # characters of the device (after "tty").
>> #
>> # Format:
>> # <id>:<runlevels>:<action>:<process>
>> #
>> EOF
>> for n in ${SYSVINIT_ENABLED_GETTYS}
>> do
>> echo "$n:12345:respawn:${base_sbindir}/mingetty --autologin
>> root 38400 tty$n" >> ${D}${sysconfdir}/inittab
>> done
>> echo "" >> ${D}${sysconfdir}/inittab
>> fi
>> }
>
>
> I have tried a number of flags with the default getty, including using a
> shell as login. I tried adding mingetty to my image to see if that would
> work with it's "--autologin" flag, but I still got the busybox getty yelling
> at me about unrecognized flags.
>
> Is the best approach to adjust the ALTERNATIVE_PRIORITY for either the
> busybox getty or mingetty to have update-alternatives select mingetty, or is
> there an easier modification to my sysvinit-innittab bbappend above that
> will enable autologin?
>
> Thanks for the help!
> Aaron
>
> --
> _______________________________________________
> yocto mailing list
> yocto at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>
More information about the yocto
mailing list