Quantcast
Channel: MobileRead Forums - Kindle Developer's Corner
Viewing all articles
Browse latest Browse all 4441

PaperWhite 1 Kernel Build Walkthrough

$
0
0
Long time listener, first time caller:

Since I couldn't find much specific info concerning the PaperWhite here (yes I know its a K5... kinda), I decided to share my current progress on building the kernel and modules. The end goal is to have OTG host mode, bluetooth, audio, and thumb drive support. That should keep me happy. Once I make some headway with this I will be posting an end to end walkthrough for the PW1. It will be from demo/brick/serial to jailbreak to kindlets to kual to root to optware to OTG to bt/sound/thumb. What I need from you people now is some guidance.

Here we go:

Note: your toolchain/build directory may be different. I hope its obvious what you have to change in that case. The steps should remain the same.

Base operating system: Slackware64 14.1 (right?)
  1. Download the required files
    Quote:

    #go to your home directory
    cd ~
    #download the Kindle source files (5.4.4.2)
    wget https://kindle.s3.amazonaws.com/Kind...3310003.tar.gz
    #download a simple arm toolchain
    wget https://sourcery.mentor.com/GNUToolc...ux-gnu.tar.bz2
  2. Extract the files and move into the build root
    Quote:

    #extract your toolchain
    tar xf arm-2014.05-29-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
    #extract the kindle sources
    tar xf Kindle_src_5.4.4.2_2323310003.tar.gz
    #move into the build root
    cd gplrelease
  3. Build uBoot's mkimage
    Quote:

    #make and move into our uBoot build root
    mkdir uboot; cd uboot
    #extract uBoot sources to our location
    tar xf ../uboot_2009.08.tar.gz
    #set up our uBoot for our board
    make imx50_yoshi_config
    #make the tools (we only need mkimage)
    make CROSS_COMPILE=~/arm-2014.05/bin/arm-none-linux-gnueabi- tools
    #exit the uBoot build root
    cd ..
  4. Set up the Linux build
    Quote:

    #make and move into our Linux build root
    mkdir linux; cd linux
    #extract the linux sources to our location
    tar xf ../linux-2.6.31.tar.gz
    #set up the kernel for our board (it could also be yoshi or yoshime, comments appreciated)
    make ARCH=arm imx50_yoshime3_defconfig
    #configure the kernel options (I like menuconfig, but config, etc, also work)
    make ARCH=arm menuconfig
  5. Kernel Configuration Notes (full .config attached 'Attachment 128585')
    Quote:

    #Here are my working changes:
    CONFIG_NET_IPIP=m
    CONFIG_NET_IPGRE=m
    CONFIG_NET_IPGRE_BROADCAST=y
    CONFIG_IPV6=m

    CONFIG_BT=m
    CONFIG_BT_L2CAP=m
    CONFIG_BT_RFCOMM=m
    CONFIG_BT_RFCOMM_TTY=y
    CONFIG_BT_HIDP=m
    CONFIG_BT_HCIBTUSB=m

    CONFIG_TUN=m

    CONFIG_SOUND=m
    CONFIG_SND=m
    CONFIG_SND_SEQUENCER=m
    CONFIG_SND_MIXER_OSS=m
    CONFIG_SND_PCM_OSS=m
    CONFIG_SND_DUMMY=m
    CONFIG_SND_USB_AUDIO=m

    CONFIG_HID_SUPPORT=y

    CONFIG_USB_DEBUG=y
    CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
    CONFIG_USB_GADGET_DEBUG_FILES=y
    CONFIG_USB_GADGET_DEBUG_FS=y
    CONFIG_USB_OTG=y
    CONFIG_USB_AUDIO=m
    CONFIG_USB_GADGETFS=m
    CONFIG_USB_G_SERIAL=m
    CONFIG_USB_MIDI_GADGET=m
    CONFIG_USB_GPIO_VBUS=m
    CONFIG_NOP_USB_XCEIV=m

    CONFIG_EXT4_FS=m
    CONFIG_EXT4DEV_COMPAT=y
    CONFIG_NTFS_FS=m
    CONFIG_NTFS_DEBUG=y
    CONFIG_NTFS_RW=y
  6. Fix the broken config includes (comments appreciated)
    Quote:

    #disable yoshime hall sensor (CONFIG_YOSHIME_HALL=n),
    #as the required header is missing (lab126_hall.h)

    perl -pi -e 's/CONFIG_YOSHIME_HALL=y/CONFIG_YOSHIME_HALL=n/g' .config
    #disable yoshime front light (CONFIG_YOSHIME_FL=n),
    #as the required header is missing (yoshime_fl_int.h)

    perl -pi -e 's/CONFIG_YOSHIME_FL=y/CONFIG_YOSHIME_FL=n/g' .config

    #patch mx50_yoshime.c to respect CONFIG_YOSHIME_HALL=n
    perl -pi -e 's/#include <linux\/lab126_hall.h>/#ifdef CONFIG_YOSHIME_HALL\n #include <linux\/lab126_hall.h>\n#endif/g' arch/arm/mach-mx5/mx50_yoshime.c
    #patch mx50_yoshime.c to respect CONFIG_YOSHIME_FL=n
    perl -pi -e 's/#include <mach\/yoshime_fl_int.h>/#ifdef CONFIG_YOSHIME_FL\n #include <mach\/yoshime_fl_int.h>\n#endif/g' arch/arm/mach-mx5/mx50_yoshime.c

    #[B]TEMPORARY FIX[\B] - disable the E-Ink panel because of a broken include in the source/toolchain
    #I am currently looking into this issue
    #this will result in a kernel without display modules, and possibly a brick if you aren't careful
    #ASSISTANCE REQUESTED

    perl -pi -e 's/FB_MXC_EINK_PANEL=m/FB_MXC_EINK_PANEL=n/g' .config
  7. BACK UP YOUR .config
    Quote:

    #just copy your kernel config to outside the build root
    cp .config ../pw1.config
  8. Compile the kernel and modules
    Quote:

    #make the uImage kernel
    make ARCH=arm CROSS_COMPILE=~/arm-2014.05/bin/arm-none-linux-gnueabi- PATH=${PATH}:~/gplrelease/uboot/tools uImage
    #make the modules
    make ARCH=arm CROSS_COMPILE=~/arm-2014.05/bin/arm-none-linux-gnueabi- targz-pkg
  9. TODO- Update broken modules.dep (not really important)
  10. You now have a file named linux-2.6.31-rt11-lab126.tar.gz containing the kernel and modules (mine is attached 'Attachment 128586', don't blame me if you use it). I will edit to add how to load this onto your kernel shortly, but if you are doing this process you really should know how already.
  11. ???
  12. Brick or Profit

My questions now are:
  • Should I be configuring yoshi, yoshime, yoshime3, or something else?
  • Anyone have 'linux/lab126_hall.h'?
  • Anyone have 'mach/yoshime_fl_int.h'?
  • Any ideas on the FB_MXC_EINK_PANEL problem?
  • Does the PaperWhite 1 (i.MX508?) support OTG host mode?
  • How do I sense/manually trigger OTG host mode?
  • Is there a preferred way to load the kernel+modules on my Kindle so as to not brick it repeatedly?

Special thanks to MadMouse on HackThisSite IRC for the moral support, and shared coffees/cigarettes!

Attached Files
File Type: tar pw1.config.tar (50.0 KB)
File Type: gz linux-2.6.31-rt11-lab126.tar.gz (3.36 MB)

Viewing all articles
Browse latest Browse all 4441

Trending Articles