[Gta04-owner] initrd proposal for low battery boot

Dr. H. Nikolaus Schaller hns at goldelico.com
Sun Dec 8 21:30:51 CET 2013


Am 08.12.2013 um 21:08 schrieb Josua Mayer:

> Hi
> Am 02.12.2013 07:41, schrieb Andreas Kemnade:
>> Hi,
>> here is my proposal for an initrd script for low battery boot.
>> It waits with boot until battery voltage is over 3.45 V,
>> switches the charging to linear charging while doing that.
> I personally like this idea very much. But I would probably also want to use this for charging without booting e.g. when there is no working OS installed.

Well, you always need a kernel and some root file system to control the charger.
The only alternative were to enable charging very early in MLO or U-Boot [1] but that would lack a lot of options that can be done by the kernel and by scripts.

>> In automatic charging the charger limits the usb current
>> (not the charging current!) to 100mA if the battery voltage is below
>> some certain level (if it is even lower, the device turns off automatically)
>> The result is that I never had any boot failures after the kernel starts due to
>> low battery while the charger is attached.
>> I put it into an initrd so there are no delays because of log-replaying on
>> the rootfs.
>> It works with the klibc environment and excepts fb0 and the rootdevice available in /dev.
>> URLs:
>> script:
>> http://misc.andi.de1.cc/linuxrc-gta04
>> fb background set quickhack:
>> http://misc.andi.de1.cc/fillfb.c
>> it can be compiled using klcc -o fillfb killfb.c
>> so that it uses the klibc (which is used in initramfs environments)
> But I am missing the ability to use this now. It would be nice if you could publish a built initrd that can be directly used or the instructions how to produce one.
> The biggest issue for me though is to find out how to have the initrd loaded by u-boot(bootargs.scr additions?).

I think you just have to modify your /etc/init.d files. I.e. nothing to compile. AFAIK, the init process will just run his script very early during the boot process.
When I find some time we can test and add it to the Debian-Wheezy config [2].


[1]: http://projects.goldelico.com/p/gta04-xloader/issues/279/
[2]: http://git.goldelico.com/?p=gta04-rootfs.git;a=tree;f=debian/config/etc;hb=HEAD

More information about the Gta04-owner mailing list