[Arm-netbook] SATA - ATAS

luke.leighton luke.leighton at gmail.com
Mon Sep 9 20:23:35 BST 2013


On Mon, Sep 9, 2013 at 3:12 PM, joem <joem at martindale-electric.co.uk> wrote:
>> >> > From http://rhombus-tech.net/allwinner/a20/boot/
>> >> > When I run
>> >> >
>> >> > make -j3 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
>> >> > KDIR=~/src/a10/linux-sunxi/ -C arch/arm/mach-sun7i/pm/standby all
>> >>
>> >>  the KDIR environment variable is a standard linux kernel environment
>> >> variable, which says "my (K)ernal (DIR)ectory is ~/src/....".  so,
>> >> obviously, you have to adjust that for your setup.
>> >
>> >
>> > That is what got me confused - is the kernel sources sub directory not
>> > in the linux directory already?
>>
>>  there *is* no quotes subdirectory - it *is* the kernel sources.
>>
>> > If its not in there, what am I
>> > downloading when I do git clone http://git.hands.com/linux.git ?
>>
>>  linux kernel sources.  there is only linux kernel sources.
>
>
> Hmmmm.... going in circles - the instructions read:
>
> git clone http://git.hands.com/linux.git
> cd linux   <----- so you are in the linux kernel sources directory

 the correct name is "the git repository which is being maintained on
git.hands.com that has a number of variants (branches) of the linux
kernel within it, one of which is the one we are getting you to
build...".

> git checkout -b lkcl-3.3-a20

 ... "and this is the variant (branch) that we are getting you to build"...

> make -j3 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
> KDIR=~/src/a10/linux-sunxi/ -C arch/arm/mach-sun7i/pm/standby all

 yes.  how did you get on?  obviously, you modify "KDIR=" to
"KDIR=the/path/to/where/the/sources/that/you/checked/out/are/including/the/linux/subdirectory/as/the/last/bit/of/the/path"

 to get that path, after you did the "cd linux" you can run "pwd".
the output from that command - IN FULL - is what you should substitute
into the KDIR.

> At no stage in instruction at
> http://rhombus-tech.net/allwinner/a20/boot/
> does it say where to download and set up
> linux-sunxi.

 that's correct, because the linux-sunxi variants have absolutely
nothing to do with this.

> Where is linux-sunxi directory?

 there isn't one.  i didn't say clone the linux-sunxi variant of the
linux kernel, i said to clone the variant of the linux kernel that's
in git.hands.com/linux.git (and check out the lkcl-3.3-a20 branch).

 i did say "substitute the subdirectory that you checked out into the
KDIR variable" - i believe you missed this.


> Why set KDIR again to
> something somewhere else like linux-sunxi
> if you are in the linux kernel directory already?

because if you don't the build will fail, that's why.

ok, the way that the linux kernel Makefiles work is that they can be
"told" where the linux kernel sources are.  the reason for this is
because it's quite a complex set of includes, so each and every
Makefile (of which there are hundreds in the linux kernel sources)
*has* to know where the top-level subdirectory is.

 they do this through the convention of defining an environment
variable - "KDIR".

 in the top-level Makefile (somewhere....) if this variable happens
not to have ever been set, it's set to `pwd` i.e. the
current-working-directory (at the top level).

 then, whenever a sub-Makefile or a sub-sub-sub-Makefile is called,
that KDIR variable is propagated, and everything builds correctly.
#includes know where to get the includes from etc. etc.

 *HOWEVER*, because allwinner were lazy and didn't properly put the
standby sources together in the proper way, you have to BYPASS that
and set KDIR manually.



> That be why I am confused and going in circles.

 entirely forget linux-sunxi and it will become clear.

l.



More information about the arm-netbook mailing list