crondog / arch-flo

Arch Linux for Nexus Flo
66 stars 10 forks source link

Details needed #6

Open DelusionalLogic opened 10 years ago

DelusionalLogic commented 10 years ago

I really don't get how makebootimg is ever supposed to run. Where am i supposed to find ~/android/system/out/host/linux-x86/bin/mkbootimg that it's trying to run. Is it supposed to be run on the tablet in android mode? chroot? how about on the host.

How about kernel_msm, am i supposed to get a specific version of that? from where?

I'm really stuck, and i am by no means a linux newcomer.

crondog commented 10 years ago

mkbootimg is a tool built from android source code on a host machine and is run from the host. You might be able to build it independently of android but I have never tried.

You should be using the mr1 branch of my kernel https://github.com/crondog/kernel_msm (I have been meaning to make that the default branch)

willcast commented 10 years ago

Never heard of mkbootimg.

Arch Linux (both arm and i686/x86_64) offer android-tools which has abootimg as well as adb. You need a bootimg.cfg file which can be extracted from your normal Android kernel image. It contains the cmdline parameters (which you can change).

On Mon, Sep 8, 2014 at 2:46 PM, crondog notifications@github.com wrote:

mkbootimg is a tool built from android source code on a host machine and is run from the host. You might be able to build it independently of android but I have never tried.

You should be using the mr1 branch of my kernel https://github.com/crondog/kernel_msm (I have been meaning to make that the default branch)

— Reply to this email directly or view it on GitHub https://github.com/crondog/arch-flo/issues/6#issuecomment-54892422.

DelusionalLogic commented 10 years ago

So can abootimg do what i need or should i install the whole SDK from the AUR? I'm real bad at android development, but reading the documentation it looks like i can, simply using the --create flag.

willcast commented 10 years ago

It can. By the way - extract the old boot.img from /dev/block/platform/(press tab, I forget the mmc slot addr)/by-name/boot

You can write your new kernel either there or to the recovery partiton, nowhere else.

On Mon, Sep 8, 2014 at 3:52 PM, Jesper Jensen notifications@github.com wrote:

So can abootimg do what i need or should i install the whole SDK from the AUR? I'm real bad at android development.

— Reply to this email directly or view it on GitHub https://github.com/crondog/arch-flo/issues/6#issuecomment-54899466.

DelusionalLogic commented 10 years ago

Now the kernel is failing to compile because python doesn't like commas in prints without parens (probably a python 2-3 thing) I think i'm just going to bed.

I think i'll pass until this whole ordeal becomes more stable (i pray that it does).

willcast commented 10 years ago

Just edit the Makefile - it's the stupid qualcomm GCC wrapper script.

Search for wrapper and replace the line that sets CC with CC = $(REAL_CC) On Sep 8, 2014 4:17 PM, "Jesper Jensen" notifications@github.com wrote:

Now the kernel is failing to compile because python doesn't like commas in prints without parens (probably a python 2-3 thing) I think i'm just going to bed.

I think i'll pass until this whole ordeal becomes more stable (i pray that it does).

— Reply to this email directly or view it on GitHub https://github.com/crondog/arch-flo/issues/6#issuecomment-54901799.

DelusionalLogic commented 10 years ago

Well, that solved that, but im having a very hard time actually getting it to cross compile from my x86_64 arch install (tried export ARCH=arm, and SUBARCH=arm, make flo_defconfig) but it's failing on make

┌─╼ [~/nexusCrap/kernel/kernel_msm]
└╼ make
  CHK     include/linux/version.h
  CHK     include/generated/utsrelease.h
make[1]: 'include/generated/mach-types.h' is up to date.
  CC      kernel/bounds.s
gcc: error: unrecognized argument in option ‘-mabi=aapcs-linux’
gcc: note: valid arguments to ‘-mabi=’ are: ms sysv
gcc: error: unrecognized command line option ‘-mlittle-endian’
gcc: error: unrecognized command line option ‘-mno-thumb-interwork’
/home/delusional/nexusCrap/kernel/kernel_msm/./Kbuild:35: recipe for target 'kernel/bounds.s' failed
make[1]: *** [kernel/bounds.s] Error 1
Makefile:989: recipe for target 'prepare0' failed
make: *** [prepare0] Error 2

i'm assuming this is because it's trying to compile from arm to arm instead of from linux_x86 to arm. I don't know how to make it.

crondog commented 10 years ago

You need to specify a cross compiler

DelusionalLogic commented 10 years ago

It worked! I've split (extracted) boot.img (i downloaded the original one from google for the razor) and compiled the new kernel.

I'm guessing minimal.initramfs is just created from the system-initramfs as described here https://wiki.ubuntu.com/Initramfs.

I made the boot image with abootimg after changing the cmdline to be what was in abootimg.cfg (from this repo), and ran fastboot boot archImg.img. The screen didn't change. Fastboot reported that it booted ok, and it was unresponsive. I guess i did something wrong?

EDIT: I tried it again (i forgot to configure the kernel and gzip the initramfs) but this time it's too big for the Boot Image, I removed that line from the bootimg.cfg, but have the same problem, no activity after fastboot boot archImg.img

EDIT2: Gave it another shot where instead of packing the ramdisk and kernel i tried fastboot boot <kernel> <ramdisk> This made it stick on booting.... The tablet should display the normal arch boot process even without x and the refresher right?

DelusionalLogic commented 10 years ago

Nope, can't get it to work. I've tried booting it in every possible way, even leaving it for 3 hours to see if it just took a while. Is there any way to get some sort of debug output from it during boot?

crondog commented 10 years ago

Ok so i keep forgetting that i set the kernel to build modules (this could be cuasing the issue because it might be missing a module) I updated the flo_defconfig so it builds everything in the zimage. This will hopefully fix things.

To get some sort of output of what is wrong you need to reboot back into android right away and then cat /proc/last_kmsg to see what went wrong in the failed boot.

DelusionalLogic commented 10 years ago

I end up getting this error now:

LD      arch/arm/mach-msm/built-in.o
arch/arm/mach-msm/wcnss-ssr-8960.o: In function `do_ramdump':
/home/delusional/nexusCrap/kernel/kernel_msm/arch/arm/mach-msm/ramdump.c:264: multiple definition of `do_ramdump'
arch/arm/mach-msm/ramdump.o:/home/delusional/nexusCrap/kernel/kernel_msm/arch/arm/mach-msm/ramdump.c:264: first defined here
arch/arm/mach-msm/wcnss-ssr-8960.o: In function `IS_ERR_OR_NULL':
/home/delusional/nexusCrap/kernel/kernel_msm/include/linux/err.h:39: multiple definition of `destroy_ramdump_device'
arch/arm/mach-msm/ramdump.o:/home/delusional/nexusCrap/kernel/kernel_msm/include/linux/err.h:39: first defined here
arch/arm/mach-msm/wcnss-ssr-8960.o: In function `create_ramdump_device':
/home/delusional/nexusCrap/kernel/kernel_msm/arch/arm/mach-msm/ramdump.c:193: multiple definition of `create_ramdump_device'
arch/arm/mach-msm/ramdump.o:/home/delusional/nexusCrap/kernel/kernel_msm/arch/arm/mach-msm/ramdump.c:193: first defined here
arch/arm/mach-msm/wcnss-ssr-8960.o:(.rodata+0x18): multiple definition of `ramdump_file_ops'
arch/arm/mach-msm/ramdump.o:(.rodata+0x18): first defined here
scripts/Makefile.build:375: recipe for target 'arch/arm/mach-msm/built-in.o' failed
make[1]: *** [arch/arm/mach-msm/built-in.o] Error 1
Makefile:949: recipe for target 'arch/arm/mach-msm' failed
make: *** [arch/arm/mach-msm] Error 2

I should probably say that i did git clean before trying to compile.

crondog commented 10 years ago

I just built it fine.

Did you "make mrproper" first?

DelusionalLogic commented 10 years ago

Tried that as well, didn't work. I'll walk you through my entire compile flow this time:

  1. Clone the kernel_msm git repo (I tried a completely new clone)
  2. run nano Makefile and remove the wrapper.py script
  3. make flo_defconfig
  4. make

This is where it errors out.

crondog commented 10 years ago

Why are you removing wrapper.py? I dont think you should.

Where are you setting your cross compiler?

All i do is this.

ARCH=arm make flo_defconfig ARCH=arm CROSS_COMPILE=~/android/system/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7/bin/arm-eabi- make LOCALVERSION= -j8 zImage

The cross compiler is just from android

DelusionalLogic commented 10 years ago

I'm removing the wrapper since it doesn't work on my system. It's probably made for python2, i run python3.

For the envars i do: export ARCH=arm, export SUBARCH=arm and export CROSS_COMPILE=arm-none-eabi-. My arm compiler is called arm-none-eabi-gcc

crondog commented 10 years ago

You need that script.

... REAL_CC = $(CROSS_COMPILE)gcc ... CC = $(srctree)/scripts/gcc-wrapper.py $(REAL_CC)

If you remove that then it is not receiving the correct compiler...

Just install python2

DelusionalLogic commented 10 years ago

I just changed CC=$(srctree)/scripts/gcc-wrapper.py $(REAL_CC) to CC=$(REAL_CC).

I tried prefixing it with python2 (to force it). It made my build way slower, so i know it worked. Same error.

crondog commented 10 years ago

I'm out of ideas. All i do to get it working is to use the android cross compiler and nothing else. Sorry

DelusionalLogic commented 10 years ago

I gave that a shot as well, just for completeness sake. Sadly it gave the exact same error. I can't find a single person talking about it on google.

Nope, still crashed. just later

DelusionalLogic commented 10 years ago

I might be misunderstanding how this is supposed to work, but is my .config supposed to say config_modules=n because it isn't.

crondog commented 10 years ago

Yes. Make sure that you have updated your branch so it should be included.

DelusionalLogic commented 10 years ago

When i run make flo_defconfig it print:

arch/arm/configs/flo_defconfig:43:warning: override: reassigning to symbol UTS_NS
arch/arm/configs/flo_defconfig:44:warning: override: reassigning to symbol IPC_NS
arch/arm/configs/flo_defconfig:45:warning: override: reassigning to symbol USER_NS
arch/arm/configs/flo_defconfig:46:warning: override: reassigning to symbol PID_NS
arch/arm/configs/flo_defconfig:47:warning: override: reassigning to symbol NET_NS
warning: (ARCH_MSM_KRAITMP && ARCH_MSM_CORTEX_A5) selects HAVE_HW_BRKPT_RESERVED_RW_ACCESS which has unmet direct dependencies (HAVE_HW_BREAKPOINT)
warning: (ARCH_MSM_KRAITMP && ARCH_MSM_CORTEX_A5) selects HAVE_HW_BRKPT_RESERVED_RW_ACCESS which has unmet direct dependencies (HAVE_HW_BREAKPOINT)
#
# configuration written to .config
#

But then i look in kernel_msm/.config and it says CONFIG_MODULES isn't set

crondog commented 10 years ago

That is all good then.

That output is fine and that also means modules will not be built (which is what you want)

DelusionalLogic commented 10 years ago

Then i'm right back to having no idea. Looking at the code i don't see the problem :/

DelusionalLogic commented 10 years ago

I used my brain, and disabled MSM_WCNSS_SSR_8960 since that was what was causing the issue . It once again compiled without problem.

Sadly the other problem is still there i tried looking at last_msg:

[    8.569091] WARNING: at arch/arm/mach-msm/clock-local.c:313 rcg_clk_enable+0x20/0x40()
[    8.569213] dsi1_byte_clk status stuck at 'off'[<c010b408>] (unwind_backtrace+0x0/0xe0) from [<c016b6b0>] (warn_slowpath_common+0x48/0x60)
[    8.569396] [<c016b6b0>] (warn_slowpath_common+0x48/0x60) from [<c016b720>] (warn_slowpath_fmt+0x2c/0x3c)
[    8.569519] [<c016b720>] (warn_slowpath_fmt+0x2c/0x3c) from [<c0151924>] (rcg_clk_enable+0x20/0x40)
[    8.569671] [<c0151924>] (rcg_clk_enable+0x20/0x40) from [<c01184d8>] (clk_enable+0x124/0x188)
[    8.569793] [<c01184d8>] (clk_enable+0x124/0x188) from [<c03ec140>] (mipi_dsi_clk_enable+0x1d8/0x258)
[    8.569885] [<c03ec140>] (mipi_dsi_clk_enable+0x1d8/0x258) from [<c03ed324>] (mipi_dsi_clk_cfg+0x3c/0x90)
[    8.570007] [<c03ed324>] (mipi_dsi_clk_cfg+0x3c/0x90) from [<c03eebb4>] (mipi_dsi_cmdlist_put+0xbc/0xf4)
[    8.570129] [<c03eebb4>] (mipi_dsi_cmdlist_put+0xbc/0xf4) from [<c03efb24>] (mipi_JDI_lcd_shutdown+0x54/0x144)
[    8.570251] [<c03efb24>] (mipi_JDI_lcd_shutdown+0x54/0x144) from [<c0497ff0>] (syscore_shutdown+0x48/0x6c)
[    8.570373] [<c0497ff0>] (syscore_shutdown+0x48/0x6c) from [<c017e4e8>] (kernel_restart+0xc/0x48)
[    8.570495] [<c017e4e8>] (kernel_restart+0xc/0x48) from [<c017e774>] (sys_reboot+0x188/0x210)
[    8.570587] [<c017e774>] (sys_reboot+0x188/0x210) from [<c0105bc0>] (ret_fast_syscall+0x0/0x30)
[    8.570709] ---[ end trace 6140110bb642d69d ]---

This was among all the other things from multirom and the msm kernel. Is the problem related to my trying to run with fastboot while having multirom installed? or is this unrelated to my problem (since most of the log mention cyanogenmod kernel and "internal" multirom)

It prints a lot of stuff though, so it might be working?

DelusionalLogic commented 10 years ago

I tried making the boot image, and now i see the pattern:

[ 1284.250121] msm_mpm_irqs_detectable: cannot monitor 000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000
[ 1284.250121] msm_pm_enter: return
[ 1284.250945] PM: noirq resume of devices complete after 0.792 msecs
[ 1284.251952] PM: early resume of devices complete after 0.426 msecs
[ 1284.253173] smb345_resume+
[ 1284.253173] smb345_resume-
[ 1284.253692] msm_fb_ext_resume: Turning on HPD circuitry
[ 1284.253966] wakeup wake lock: event0-603
[ 1284.254821] PM: resume of devices complete after 2.836 msecs
[ 1284.257781] Restarting tasks ... 
[ 1284.260955] bq27541_get_capacity = 91% ret= 90
[ 1284.262664] bq27541_get_psp voltage_now= 4152000 uV
[ 1284.264495] bq27541_get_psp current = -6 mA
[ 1284.265532] bq27541_get_psp temperature= 238 (0.1¢XC)
[ 1284.266478] done.
[ 1284.266692] PM: suspend exit 2014-09-18 20:48:57.121522907 UTC
[ 1284.266845] suspend: exit suspend, ret = 0 (2014-09-18 20:48:57.121644888 UTC)
[ 1284.266967] PM: Syncing filesystems...
[ 1284.275512] sync done.
[ 1284.275634] suspend: enter suspend
[ 1284.275695] PM: suspend entry 2014-09-18 20:48:57.130518466 UTC
[ 1284.275969] PM: Syncing filesystems...
[ 1284.276122] bq27541_get_psp status: Not charging ret= 0x0101
[ 1284.290801] sync done.
[ 1284.341765] Freezing user space processes ... (elapsed 0.002 seconds) done.
[ 1284.344024] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
[ 1284.346282] Suspending console(s) (use no_console_suspend to debug)
[ 1284.348693] bq27541_get_psp status: Not charging ret= 0x0101
[ 1284.349242] bq27541_get_psp status: Not charging ret= 0x0101
[ 1284.349822] bq27541_get_psp voltage_now= 4152000 uV
[ 1284.350371] bq27541_get_capacity = 91% ret= 90
[ 1284.350737] msm_fb_ext_suspend: Turning off HPD circuitry
[ 1284.350921] bq27541_get_psp temperature= 238 (0.1¢XC)
[ 1284.352050] bq27541_get_psp current = -6 mA
[ 1284.352508] smb345_suspend+
[ 1284.352508] smb345_suspend-
[ 1284.361266] PM: suspend of devices complete after 13.480 msecs
[ 1284.361724] PM: late suspend of devices complete after 0.457 msecs
[ 1284.362822] power_suspend_late return 0
[ 1284.362822] PM: noirq suspend of devices complete after 1.097 msecs
[ 1284.362822] Disabling non-boot CPUs ...
[ 1284.362975] msm_pm_enter
[ 1284.362975] msm_pm_enter: power collapse
[ 1284.362975] msm_mpm_irqs_detectable: cannot monitor 000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000

It just keep printing this until i force it to restart by holding down the power button.

I'm also a little unsure of what i should see on the screen when it works. Since i can't install X from the chroot env (no internet connection)

EDIT: turns out i have internet in chroot, I just didn't have a resolv.conf. I fixed it quite simply by adding the google dns to it.

  1. We remove the symlink rm /etc/resolv.conf
  2. We echo the google dns to the file echo "8.8.8.8" > /etc/resolv.conf
  3. We enjoy that we now have internet.
DelusionalLogic commented 10 years ago

I'm going to keep updating this, both for future record for myself, if anyone else has any problems, and to ask for help from anyone bothering to look...

So, my problem is still the same as before, but i figured out i actually didn't have the packages correctly installed on my chroot env. The original install failed to correctly set the resolv.conf, so it couldn't install all the fantastic packages. I fixed that and installed all the require packages (including and old version of xorg and evdev that is supported by freedreno). I then made myself a user, copied the systemd files, and compiled/moved the refresher.

I now have the CHROOT working with a vnc connection!

This leads me to wonder how Xorg is supposed be started without the framebuffer? Should i install lightdm or something? and what does the log above mean?

crondog commented 10 years ago

You can start Xorg just by using startx or however you want. ie startx etc with a .xinitrc

If you mean the framebuffer console, that is what fbterm is for. The kernel fbcon does not work but fbcon will do the job for you

willcast commented 10 years ago

Freedreno compiles with xorg-1.16. I'm not sure if an old X server is necessary here.

About that dmesg - are you pressing the power key? it looks like it's trying to sleep. On Sep 19, 2014 2:15 AM, "Jesper Jensen" notifications@github.com wrote:

I'm going to keep updating this, both for future record for myself, if anyone else has any problems, and to ask for help from anyone bothering to look...

So, my problem is still the same as before, but i figured out i actually didn't have the packages correctly installed on my chroot env. The original install failed to correctly set the resolv.conf, so it couldn't install all the fantastic packages. I fixed that and installed all the require packages (including and old version of xorg and evdev that is supported by freedreno). I then made myself a user, copied the systemd files, and compiled/moved the refresher.

This leads me to wonder how Xorg is supposed be started without the framebuffer? Should i install lightdm or something? and what does the log above mean?

— Reply to this email directly or view it on GitHub https://github.com/crondog/arch-flo/issues/6#issuecomment-56154663.

DelusionalLogic commented 10 years ago

I should probably have told that the first kmsg log is just the power off. that was just me being stupid. But the second one is still unknown.

The current git freedreno on the AUR requires X-ABI-VIDEODRV_VERSION == 15, the current xorg-server provides X-ABI-VIDEODRV_VERSION == 18. Those two conflict, so i just installed an old version from the ALARM. With that (and an old version of EVDEV since it requires the newest xorg-server) it compiled and i suppose it should still work, as long as i have the newest driver.

I just followed the getty guide, and now i guess the kmesg looks more interesting, so here it is: http://pastebin.com/ddVrRhFs

is that good? it looks pretty decent. The screen still isn't changing from the fastboot screen.

I have a very hard time figuring out how Xorg would start by itself (since noone is calling startx)/how i would run startx without a terminal to type it into. i guess fbterm will give me that, but what is getty and how will that start fbterm?

willcast commented 10 years ago

The ABI can be changed by compiling for the new headers. That's there as a hint to pacman, and you can and should try to update the number to 18.

OTOH, if there's an API change you'd have to fix the source code. You'll know - there should be errors during compilation if that's the case. On Sep 19, 2014 10:31 AM, "Jesper Jensen" notifications@github.com wrote:

I should probably have told that the first kmsg log is just the power off. that was just me being stupid. But the second one is still unknown.

The current git freedreno on the AUR requires X-ABI-VIDEODRV_VERSION == 15, the current xorg-server provides X-ABI-VIDEODRV_VERSION == 18. Those two conflict, so i just installed an old version from the ALARM. With that (and an old version of EVDEV since it requires the newest xorg-server) it compiled and i suppose it should still work, as long as i have the newest driver.

I just followed the getty guide, and now i guess the kmesg looks more interesting, so here it is:

— Reply to this email directly or view it on GitHub https://github.com/crondog/arch-flo/issues/6#issuecomment-56208505.

DelusionalLogic commented 10 years ago

But that shouldn't affect it when the driver is updated to the latest revision should it? I'd think it would boot with xorg-server-1.5. There's not a single mention of xorg or fbterm in the log.

It looks like it's suspending and resuming again and again from the log.

DelusionalLogic commented 10 years ago

Sadly, i can tell that nothing is booting. xorg never creates a log file...

same thing goes for systemd, no journal file!

DelusionalLogic commented 10 years ago

SUCCESS i don't know what i did, but i recompiled the kernel, made a new bootimg and it's displaying the framebuffer terminal!

The rendering is really sloppy, in that it seems to render in a band that moves down the screen, so it's completely unusable. It also seems to be printing something about "sleeping function called from invalid context (it looks to originate from a call from fbcon). At least it's something!

Here's the log until i stopped waiting: http://pastebin.com/jxxxzxRi

I want ahead and recorded the strange screen refresh problem: https://www.youtube.com/watch?v=7bSdv2Y5-LE

I tried to disable the getty@tty1.service. It's actually the linux kernel terminal, so i guess it is working. It just isn't very good...

crondog commented 10 years ago

Woops i forgot that frambufferconsole was supposed to be a module and not built in. I have updated the flo_defconfig to disable framebuffer console. So when booting it will now not use the kernel framebuffer console. Make sure that you set up fbterm

DelusionalLogic commented 10 years ago

Woo! It's alive. It's prompting me for a login, which I obviously can't give it since I don't have a keyboard hooked up, but the screen is on and serial is working!

Now I just need to hook it up with more space (since I'm already out)

binli commented 9 years ago

I also met the issue like below arch/arm/mach-msm/wcnss-ssr-8960.o: In function `do_ramdump':

After disable the MSM_WCNSS_SSR_8960 in .config, it build successfully, but after boot up, I met the same issue in kernel.

[ 8.569091] WARNING: at arch/arm/mach-msm/clock-local.c:313 rcg_clk_enable+0x20/0x40()