UPDATE 2017-07-07
Here are my new instructions I actually follow
- Download the Paperwhite 5.8.1 source from amazon
- grab the tar.gz build_linaro-gcc_4.8.3.tar.gz
- grab the tar.gz linux-3.0.35.tar.gz
- Extract those to your computer
- Build the linaro compiler using the 'BUILD_HOW-TO.txt' in the package
- The howto will explain a lot of dependencies you need to install
- I change the PREFIX in the makefile to '$(HOME)/kindle/opt/cross-gcc-linaro'
- In the howto, the last step you need to follow for this part is 'Install the Kernel Headers'
- apt install < the list of dependencies>
- make
- mkdir -p $HOME/kindle/opt
- tar -C $HOME/kindle/opt -xjf cross-arm-linux-gnueabi-gcc-linaro-4.8-2014.04.tar.gz
- tar -C $HOME/kindle/opt/cross-gcc-linaro/arm-linux-gnueabi -xzf khdrs.tar.gz
- Build the linux kernel using the 'BUILD_HOW-TO.txt'
- make ARCH=arm CROSS_COMPILE=$HOME/kindle/opt/cross-gcc-linaro/bin/arm-linux-gnueabi- imx60_wario_defconfig
- make ARCH=arm CROSS_COMPILE=$HOME/kindle/opt/cross-gcc-linaro/bin/arm-linux-gnueabi-
Amazon source download page:
https://www.amazon.com/gp/help/custo...deId=200203720
I used the 5.8.1 source, just because I was trying to get an older one that would work on any version of my kindle. I had originally tried the 5.7.4 source, but the instructions didn't seem to work right, or there were some missing files, so I moved up 1 step.
Making the linux kernel is only necessary for the kernel modules, the programs can be built just by installing that linaro cross compiler.
This is my makefile for Kernel modules
Code:
export ARCH:=arm
export CROSS_COMPILE:=/home/osboxes/kindle/opt/cross-gcc-linaro/bin/arm-linux-gnueabi-
#obj-m := hello-2.o
#obj-m := evdev_mouse.o
#obj-m := ev_mdc.o
obj-m := tkbd.o
KDIR := /home/osboxes/kindle/gplrelease/linux-3.0.35
PWD := $(shell pwd)
EXTRA_CFLAGS := -I$(src)/drivers/
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
clean:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) clean
This is my makefile for programs
Code:
# i used amazon's own toolchain, from kindle fw sources
CROSS_COMPILE = /home/osboxes/kindle/opt/cross-gcc-linaro/bin/arm-linux-gnueabi-
CFLAGS =
LDFLAGS =
SRC = tpoint.c
OUT = tpoint.lix
# -print-search-dirs
kindle: $(SRC)
$(CROSS_COMPILE)gcc -DBUILD_KINDLE $(SRC) -o $(OUT) $(CFLAGS) $(LDFLAGS)
host: $(SRC)
gcc -DBUILD_KINDLE $(SRC) -o $(OUT) $(CFLAGS) $(LDFLAGS)
clean:
rm $(OUT)
Old copy of method 2 ( twobobs pre-set qemu image ) is included below, but that file is no longer on the internet.
Spoiler:
Method #2 - twobobs pre-set qemu image
Starting with this image twobob linked:
https://www.mobileread.com/forums/sh...46&postcount=6
- mkdir /chroots/armel-twobob
- wget https://dl.dropboxusercontent.com/u/...b.5gb.ext3.zip
- unzip deb.5gb.ext3.zip
- FILENAME=/mnt/base-us/deb.5gb.ext3
- dd if=/dev/zero of=$FILENAME bs=1M count=1500 oflag=append conv=notrunc
- e2fsck -f $FILENAME
- resize2fs $FILENAME
This sets up that build, but it doesn't have apt-get installed when I ran it with qemu
I haven't finished doing it yet, but the instruction here indicate that this was used in chroot, and to compile you set them up from inside the chroot, using apt-get from outside it, but its at this point I stopped.
These instructions are also from a thread for getting an updated debian onto the kindle itself, so I'm not 100% sure I'm on the right path with this.
https://www.mobileread.com/forums/sh...34#post2633334
- mount -o loop deb.5gb.ext3 /chroots/armel-twobob/
- chroot /chroots/armel-twobob/
Quote:
Originally Posted by twobob
deb.5gb.ext3 is a general purpose image that WILL need the additional steps outlined above doing to make it a "build system", when you are bored of it or you screw it up just replace it again. (EDIT: I did this just last night)
Enjoy
The script to mount this partition is available on the DEBIAN ON A PAPERWHITE thread (and ill post it again below)
|
Quote:
Originally Posted by twobob
root@kindle:/# apt-get install libtool build-essential ccache automake
I would guess that this would, with the debian grip guts, weigh in around 320 MB)
(then inside debian)
root@kindle:/# mkdir -p /mnt/us/extensions
(on my system that becomes /mnt/us/debian/mnt/us/extensions)
build stuff like:
root@kindle:/# ./configure --prefix=/mnt/us/extensions/{thing}/usr <other options>
root@kindle:/# make clean; PATH=/usr/lib/ccache:$PATH make ; make install
then MOVE(/COPY) the /mnt/us/debian/mnt/us/extensions stuff to /mnt/us/extensions from outside the chroot.
|