View Single Post
Old 03-12-2016, 10:55 AM   #2
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
kdb information

I **though** the kdb installed on the Kindle was a 'read only' build.
My memory was wrong, the kdb build provides a complete command set.

My memory was correct, the write operations, although listed, are not functional, since the database is stored in a cramfs filesystem.
Code:
[root@kindle root]# df /etc/kdb.src
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/loop/4               1412      1412         0 100% /etc/kdb.src

[root@kindle root]# losetup /dev/loop/4
/dev/loop/4: 0 /etc/kdb.src.cramfs.img
(Ah, but I can fix that, when/if required.)

Code:
[root@kindle root]# kdb -h
Usage: kdb [OPTION] <command> [<key> [value ...]]
Use kdb to manipulate the Key Database.

libelektra 0.7.0 is used

ARGUMENTS
Commands are explained with kdb -h command
<key> is the name of the key. It can be prefixed
 with environment KDB_ROOT. The slash between will
be inserted.
 export KDB_ROOT="user/test/dir"
 kdb get file/key ... will expand to user/test/dir/file/key
[value ...] hold the value which should be set

COMMANDS
 kdb get [-dlfs] key/name
 kdb set [-t type] [-c "A comment about this key"] [-m mode] [-u uid]
         [-g gid] key/name "the value"
 kdb set [-t type] [-m mode] [-c "A comment"] key/name -- "the value"
 kdb set [-t type] [-b file] key/name
 kdb ls [-lRfvs] [key/dir | key/name]
 kdb ls [-lRfvx] [key/dir | key/name] > keys.xml
 kdb edit [-R] [key/dir | key/name]
 kdb rm key/name
 kdb mv key/src key/dest
 kdb ln key/src key/dest
 kdb export system/some/tree.root > file.xml
 kdb import < file.xml
 kdb import file.xml
 kdb monitor some/key/name
 kdb info
Walking part of the db tree:
Code:
[root@kindle root]# kdb ls
system
user

[root@kindle root]# kdb ls system
system/daemon
system/driver

[root@kindle root]# kdb ls system/daemon
system/daemon/cmd
system/daemon/contentpackd
system/daemon/otaup
system/daemon/phd
system/daemon/pillowd
system/daemon/pmond
system/daemon/powerd
system/daemon/usbnetd
system/daemon/volumd
system/daemon/wand
system/daemon/wifid
Getting the ota update controls as an xml file:
Code:
[root@kindle root]# kdb export system/daemon/otaup >/tmp/root/otaup.xml
[root@kindle root]# cp /tmp/root/otaup.xml /mnt/us
Which gets us a bit more readable output that 'strings' does.
PHP Code:
<keyset>
<
key name="system/daemon/otaup/DOWNLOAD_PATH_FULLBIN"
        
uid="1004" gid="136" mode="0664">

     <
value><![CDATA[/mnt/us/update-full.bin]]></value>
</
key>

<
key name="system/daemon/otaup/DOWNLOAD_PATH_LANGUAGE_FORMAT"
        
uid="1004" gid="136" mode="0664">

     <
value><![CDATA[/mnt/us/Update_LANG_%lld.bin]]></value>
</
key>

<
key name="system/daemon/otaup/DOWNLOAD_PATH_OTA_FORMAT"
        
uid="1004" gid="136" mode="0664">

     <
value><![CDATA[/mnt/us/Update_%lld_%lld.bin]]></value>
</
key>

<
key name="system/daemon/otaup/DOWNLOAD_PATH_TEMP"
        
uid="1004" gid="136" mode="0664">

     <
value><![CDATA[/mnt/us/update.bin]]></value>
</
key>

<
key name="system/daemon/otaup/DOWNLOAD_PATH_VERSIONLESS_FORMAT"
        
uid="1004" gid="136" mode="0664">

     <
value><![CDATA[/mnt/us/Update_VLS_%lld.bin]]></value>
</
key>

<
key name="system/daemon/otaup/PLATFORM_CODE"
        
uid="1004" gid="136" mode="0664"
    
value="7"/>
<
key name="system/daemon/otaup/TRANSFER_TIMEOUT_SEC"
        
uid="1004" gid="136" mode="0664"
    
value="126000"/>
</
keyset
Which seems to lead to:
Edit as desired.
kdb import the changed *.xml file.

So what to do to it?
Set the download path temp to /dev/null ?

= = = = = =
OK readers, some of you with command line access to a 7th gen device use this kdb export feature to let me see what your firmware version contains for ota update controls.
Please, Please

Last edited by knc1; 03-12-2016 at 11:19 AM.
knc1 is offline   Reply With Quote