[oe] autologin recipe for gumstix Overo
Elvis Dowson
elvis.dowson at mac.com
Sat Jun 5 16:11:08 UTC 2010
Hi,
For the autologin.bb recipe that is shown below, the pkg_postinst and the pkg_prerm parts do not run correctly. the /etc/inittab file does not get modified. I've had to manually modify the inittab file by hand, and additionally create a text file /usr/autologin.profile with the text root in the autologin.profile file.
Could someone suggest how this recipe can be modified so that
a. the following text in the /etc/inittab file to be modified such that
S:2345:respawn:/sbin/getty 115200 ttyS2
is changed to
S:2345:respawn:/sbin/getty -n -l /usr/bin/autologin 115200 ttyS2
and
1:2345:respawn:/sbin/getty 38400 tty1
is changed to
1:2345:respawn:/sbin/getty -n -l /usr/bin/autologin 38400 tty1
b. Create a new text file called /usr/autologin.profile with the following text
root
Here are some links to the original instructions:
http://www.gumstix.net/wiki/index.php?title=AutoLogin
http://old.nabble.com/A-very-unique-auto-login-on-verdex-td28224459.html#a28517599
http://littlesvr.ca/linux-stuff/articles/autologinconsole/autologinconsole.php
Best regards,
Elvis Dowson
DESCRIPTION = "Automatically login to console as root user with no prompt"
SECTION = "bin"
LICENSE = "GPL"
RDEPENDS="tinylogin sed"
PACKAGES ="${PN}"
PR = "r0"
SRC_URI = " \
file://src/autologin.c \
"
S = "${WORKDIR}"
#inherit autotools_stage
#AUTOTOOLS_STAGE_PKGCONFIG = 1
#do_stage() {
# autotools_stage_all
#}
do_compile () {
${CC} ${CFLAGS} ${LDFLAGS} ${WORKDIR}/src/autologin.c -o autologin
}
do_install () {
install -d ${D}${bindir}/
install -m 0755 ${WORKDIR}/autologin ${D}${bindir}/
}
pkg_postinst_${PN} () {
sed 's_S:2345:respawn:/sbin/getty_S:2345:respawn:/sbin/getty -n -l /usr/bin/autologin_' /etc/inittab > inittab.tmp
mv inittab.tmp /etc/inittab
passwd -d root
echo 'NOTE: remove the password from the root account'
rm inittab.tmp
}
pkg_prerm_${PN} () {
sed 's_ -n -l /usr/bin/autologin__' /etc/inittab > inittab.tmp
mv inittab.tmp /etc/inittab
echo 'NOTE: there is still no password on the root account'
rm inittab.tmp
}
PACKAGES = "${PN}"
FILES_${PN} = "${bindir}/autologin"
More information about the Openembedded-devel
mailing list