autologin recipe for gumstix Overo
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"
Hi Elvis,
Quoted 1 line · Elvis Dowson
For the autologin.bb recipe that is shown below, the
pkg_postinstand thepkg_prermparts do not run correctly.
Are these steps not being run at all when you install the package? I added in the 'echo' commands somewhat as a debugging tool to see if it was being run.
-Ash
Hi Ash,
I added autologin to the list of tool, in the omap3-console-image.bb recipe file. So I assumed that when you build the rootfs image, the script would somehow modify the /etc/inittab file. At the moment, I have to manually copy the inittab and autologin.profile files to the microSD card image.
It would be nice if the autologin recipe could insert it automatically, as part of the omap3-console-image rootfs build process.
Best regards,
Elvis
Quoted 15 lines · Ash Charles
Hi Elvis,
Quoted 1 line · Elvis Dowson
For the autologin.bb recipe that is shown below, the
pkg_postinstand thepkg_prermparts do not run correctly.Are these steps not being run at all when you install the package? I added in the 'echo' commands somewhat as a debugging tool to see if it was being run.
-Ash
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
Hi Elvis,
Does the image do the autologin the second time you boot it?
I wrote the autologin stuff to do some factory testing of new boards but discovered after some head scratching that the image only did the automatic login after the first reboot; I wondered if perhaps the postinst stuff was only getting run after the image was booted.
For the testing stuff, I ended up just booting once and then cloning this once-booted test image.
-Ash
Hi Ash,
Quoted 1 line · Ash Charles
Does the image do the autologin the second time you boot it?
Yes, it does, no problems there.
The post init stuff is supposed to modify the inittab file, but it didn't.
I manually edited the /etc/inittab file after I discovered that the bitbake rootfs process for omap3-console-image with the autologin recipe added, did not modify the inittab file.
Best regards,
Elvis Dowson
Quoted 12 lines · Elvis Dowson
Hi Ash,
Quoted 1 line · Ash Charles
Does the image do the autologin the second time you boot it?
Yes, it does, no problems there.
The post init stuff is supposed to modify the inittab file, but it didn't.
I manually edited the
/etc/inittabfile after I discovered that the bitbake rootfs process for omap3-console-image with the autologin recipe added, did not modify the inittab file.
Quoted 9 lines
Best regards,
Elvis Dowson
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
The preinst/postinst/prerm/postrm scripts belonging to a package will be skipped by opkg during image creation as this step uses an offline root (the -o flag to opkg). These scripts will be run if the package is installed/removed directly on the target system. Perhaps in this case, you also need to use ROOTFS_POSTPROCESS_COMMAND?
-Graham