Having learned a bit from the 'main' kernel - - -
Assume that the diags kernel came out of the same build process as the main kernel, see if we can get lucky finding the dot-config file.
The kernel uses gzip compression for the dot-config file, so search for those magic numbers:
Try the last one found:
Yup - that is the kernel dot-config file. Attach a copy of it here.
Code:
core2quad diags $ mv kd-4.0-99 dot-config-diags-4.0
core2quad diags $ gzip dot-config-diags-4.0
Now take a quick check of the configuration options for the initramFS file:
Code:
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE="initramfs.list"
CONFIG_INITRAMFS_ROOT_UID=0
CONFIG_INITRAMFS_ROOT_GID=0
CONFIG_RD_GZIP=y
# CONFIG_RD_BZIP2 is not set
# CONFIG_RD_LZMA is not set
CONFIG_INITRAMFS_COMPRESSION_NONE=y
# CONFIG_INITRAMFS_COMPRESSION_GZIP is not set
# CONFIG_INITRAMFS_COMPRESSION_BZIP2 is not set
# CONFIG_INITRAMFS_COMPRESSION_LZMA is not set
Yup, not compressed.
Trim the known, compressed, dot-config off of the kernel image:
Code:
core2quad diags $ dd if=kernel_diags_4.0.img bs=1 count=3853332 of=kd-trim.bin
3853332+0 records in
3853332+0 records out
3853332 bytes (3.9 MB) copied, 14.889 s, 259 kB/s
Search for the -H newc cpio magic number:
Maybe we can get lucky, and it is the first one:
Code:
core2quad diags $ od -A d -t x1 kd-trim.bin | grep '30 37 30 37 30 31'
0102560 30 37 30 37 30 31 30 30 30 30 30 32 44 31 30 30
core2quad diags $ dd if=kd-trim.bin bs=1 skip=102560 of=kd-trim-00.cpio
3750772+0 records in
3750772+0 records out
3750772 bytes (3.8 MB) copied, 14.8647 s, 252 kB/s
core2quad diags $ file kd-trim-00.cpio
kd-trim-00.cpio: ASCII cpio archive (SVR4 with no CRC)
core2quad diags $ mkdir cpio
core2quad diags $ cd cpio
core2quad cpio $ sudo su
core2quad cpio # cpio -i -d -m --no-absolute-filenames -I ../kd-trim-00.cpio
cpio: Removing leading `/' from member names
1920 blocks
core2quad cpio # ls -l
total 28
drwxr-xr-x 2 root root 4096 2013-02-20 12:24 bin
drwxr-xr-x 7 root root 4096 2013-02-20 12:24 dev
lrwxrwxrwx 1 root root 18 2013-02-20 12:24 init -> /bin/recovery-util
drwxr-xr-x 3 root root 4096 2013-02-20 12:24 lib
drwxr-xr-x 3 root root 4096 2013-02-20 12:24 mnt
drwxr-xr-x 2 root root 4096 2011-09-02 21:00 proc
drwx------ 2 root root 4096 2011-09-02 21:00 root
drwxr-xr-x 2 root root 4096 2011-09-02 21:00 sys
Got lucky, make an archive of that for reference purposes.