I'm trying to implement a console in a recovery kernel. I'm stuck at this: After selecting the option to launch the console, recovery does exit, but to a blank screen with "A N D R O I D" flashing in the middle of the screen with a cursor, and then restarting the recovery UI. I've added the proper options to init.rc, plus the required binaries for sbin. Does anyone have any idea about what I'm doing wrong? Here's what I've done so far:
Added the option to exit to the console (do_reboot = 0, gr_exit);
Added openvt, vtspawn, consolemap, loadkeys and start_fbcon to sbin
Added the required calls to init.rc (class_start con when recovery exits, bunch of openvts with class con, start_fbcon disabled until started).
Bump, forgive the double post, etcetera.
I fixed it. If anyone is interested in the method, since this will probably work on any recovery to implement a console, I'd surely help. If not, let this topic die once more.
Related
Just installed Elelinux-7.1.0-Hero-v2.1, poked around in Dev Tools, and apparently turned on some debugging feature I should not have. Now my phone goes into a reboot loop. It isn't a full reboot... only the Android boot animation is shown, not the initial HTC splash screen. It makes it up to the lockscreen and the phone is responsive for about 10 seconds before it freezes up and reboots.
This isn't enough time for me to unlock the screen, open the app drawer, run Dev Tools, and change back the setting before the phone reboots. Is there another way of manually clearing the Dev Tools settings without having to do a factory wipe?
Since I can't get into Dev Tools now, I cannot say which options were enabled. I turned on one that shows the touch coordinates, and I think another that shows the running processes (trying to track down battery drain issues). There may have been a couple of others, but due to the delay in the reboot, it's hard to tell exactly which one is the culprit.
So I'm hoping there is some way to bring up the phone in single-user mode, edit or delete a settings file, and then rebooting the phone. I'm using the AmonRA recovery console, if that helps.
I'd just reflash...
Yeah, there isn't much on the phone yet, so I could do a wipe and not lose anything, but I'd rather see if there is a way to recover in case something like this happens again in the future.
I did find an issue tracker page on Google that describes the problem, and a couple of proposed fixes. I'm not allowed to post links yet, so demangle this to bring up the page. I'm going to try editing the settings.db file and hopefully that will fix things:
ht tp://code.google.com/p/cyanogenmod/issues/detail?id=1026
Hooray, editing the settings.db file worked! I followed the suggest posted by cryptographrix in post #14 of the code.google.com thread:
Code:
$ [B]./adb shell[/B]
/ # [B]mount /data[/B]
/ # [B]mount /system[/B]
/ # [B]/system/xbin/sqlite3 ./data/data/com.android.providers.settings/databases/settings.db[/B]
SQLite version 3.7.2
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> [B].header ON[/B]
sqlite> [B]select * from system where name="show_processes";[/B]
_id|name|value
109|show_processes|1
sqlite> [B]update system set value=0 where name="show_processes";[/B]
sqlite> [B]select * from system where name="show_processes";[/B]
_id|name|value
109|show_processes|0
sqlite> [B].quit[/B]
/ # [B]reboot[/B]
Hello!
I'm trying to enable boot console output instead of boot animation. I did not found a lot of articles and ones I got did not help me.
So why do I need it? Because my phone stuck in boot animation loop and I have no option to see what is happening. I have no adb or adb logcat and my phone does not have UART or JTAG interface to see what is wrong.
The last option is to enable linux kernel console and turn off boot animation.
To disable boot animation on cyanogenmod builds you have to add "debug.sf.nobootanimation=1" to the build.prop. For example for my S4 you need to change:
/device/samsung/i9500/system.prop
...
debug.sf.nobootanimation=1
or add BoardConfig.mk or i9500.mk
PRODUCT_PROPERTY_OVERRIDES += \
debug.sf.nobootanimation=1
And it is actually work. I have black screen instead of boot animation.
Next what you need is to enable kernel console. To do so I ran menuconfig on samsung kernel:
CONFIG_FRAMEBUFFER_CONSOLE=y
and several other flags like (fonts, framebuffer enabled) But I still see no console output. Instead of that after I turn CONFIG_FRAMEBUFFER_CONSOLE=y my device start to fail even before bootanimation (so it stuck on first welcome device name text) which means kernel crashed at boot.
Any suggestions how to enable kernel output on android devices?
Hi everybody,
I work on a light Launcher (to replace Launcher2.apk).
One of my objectives is obviously to have a quick boot.
But when my app is ready to show something, the bootanimation is still visible until the Boot timeout (40s after the first log):
WindowManager: ***** BOOT TIMEOUT: forcing display enabled
If I reboot with my command line :
adb reboot && adb wait-for-device && adb shell setprop service.bootanim.exit 1
My boot time is around 15s but with a bad rotation display until I receive the first ConfigurationChanged event. Without this point, the app is ready so...
Question 1: Do you know a way to properly close the boot animation?
Question 2: If the Q1 don't solve the ConfigurationChanged event, do you know a method to receive the ConfigurationChanged event in my Launcher?
Best Regards,
Kikiwa
PS : I hope this topic is in the right section, sorry if it's not the case.
Same problem
kikiwa said:
Hi everybody,
I work on a light Launcher (to replace Launcher2.apk).
One of my objectives is obviously to have a quick boot.
But when my app is ready to show something, the bootanimation is still visible until the Boot timeout (40s after the first log):
WindowManager: ***** BOOT TIMEOUT: forcing display enabled
If I reboot with my command line :
adb reboot && adb wait-for-device && adb shell setprop service.bootanim.exit 1
My boot time is around 15s but with a bad rotation display until I receive the first ConfigurationChanged event. Without this point, the app is ready so...
Question 1: Do you know a way to properly close the boot animation?
Question 2: If the Q1 don't solve the ConfigurationChanged event, do you know a method to receive the ConfigurationChanged event in my Launcher?
Best Regards,
Kikiwa
PS : I hope this topic is in the right section, sorry if it's not the case.
Click to expand...
Click to collapse
I am having the same problem , have you found any solution?
Hello !
Sorry but no. I'm still interested by the solution BTW.
Good luck
Kikiwa
kikiwa said:
Hello !
Sorry but no. I'm still interested by the solution BTW.
Good luck
Kikiwa
Click to expand...
Click to collapse
In my case I pushed my custom launcher apk to system/app and deleted launcher2.apk
Could it be that the system is waiting for some special response from default launcher? That should be made in custom luancher?
Possible Solution
Hey guys,
I was having this same issue for a while now, and I finally found a solution that works for me, at least as of Android 4.4.4 on a Nexus 7 2013 (LTE)
What I did to find this was selectively disable system apps one by one, and then test a reboot.
In my case, disabling Launcher2 didn't affect the boot sequence, but SystemUI (com.android.systemui) did cause these delayed boot times.
I dug through the ASOP source code, and found that the WindowManagerService performs a few checks in performEnableScreen() before stopping boot animation / displaying normally:
- System services must all be ready (mSystemBooted)
- A keyguard or application must be attached to Window Manager (haveApp || haveKeyguard)
- The Wallpaper Service must be disabled or ready (!wallpaperEnabled || haveWallpaper)
Since monitoring logcat showed my replacement launcher was open, and the system services had no errors, I suspected #3 was the problem
In the source for SystemUI, I found a single reference for "wallpaper" - com.android.systemui.ImageWallpaper is an included class that extends WallpaperService but itself is never referenced from that package.
Checking logcat again, I found these lines:
Code:
Attempted wallpaper ComponentInfo{com.android.systemui/com.android.systemui.ImageWallpaper} is unavailable
Default wallpaper component not found!
It turns out that the system-level WallpaperManagerService has hard-coded that particular class.
As a test fix, I created a new project with package name "com.android.systemui" and a single class "ImageWallpaper" that extends WallpaperService, declared this as a service in my manifest, and installed this apk on a device.
I rebooted, and the boot times were back to normal (~20sec) instead of the previous ~50sec.
So in summary: SystemUI was the culprit in my case; creating a fake replacement package with that hardcoded class back in fixed the long boot times.
Thank you
dtyler7 said:
Hey guys,
I was having this same issue for a while now, and I finally found a solution that works for me, at least as of Android 4.4.4 on a Nexus 7 2013 (LTE)
What I did to find this was selectively disable system apps one by one, and then test a reboot.
In my case, disabling Launcher2 didn't affect the boot sequence, but SystemUI (com.android.systemui) did cause these delayed boot times.
I dug through the ASOP source code, and found that the WindowManagerService performs a few checks in performEnableScreen() before stopping boot animation / displaying normally:
- System services must all be ready (mSystemBooted)
- A keyguard or application must be attached to Window Manager (haveApp || haveKeyguard)
- The Wallpaper Service must be disabled or ready (!wallpaperEnabled || haveWallpaper)
Since monitoring logcat showed my replacement launcher was open, and the system services had no errors, I suspected #3 was the problem
In the source for SystemUI, I found a single reference for "wallpaper" - com.android.systemui.ImageWallpaper is an included class that extends WallpaperService but itself is never referenced from that package.
Checking logcat again, I found these lines:
Code:
Attempted wallpaper ComponentInfo{com.android.systemui/com.android.systemui.ImageWallpaper} is unavailable
Default wallpaper component not found!
It turns out that the system-level WallpaperManagerService has hard-coded that particular class.
As a test fix, I created a new project with package name "com.android.systemui" and a single class "ImageWallpaper" that extends WallpaperService, declared this as a service in my manifest, and installed this apk on a device.
I rebooted, and the boot times were back to normal (~20sec) instead of the previous ~50sec.
So in summary: SystemUI was the culprit in my case; creating a fake replacement package with that hardcoded class back in fixed the long boot times.
Click to expand...
Click to collapse
It is exactly my problem and your solution seems perfect
Thank you for your efforts
command "setprop ctl.start bootanim" to perform boot animation;
command "setprop ctl.stop bootanim" stop the boot animation.
Hey,
I'm having a rooted Nook Simple Touch (FW 1.2.1) and want to add a shortcut (to launcher 8) for powering off the device. Unfortunately every tried command (adb reboot -p, several java shutdown methods) results in an immediate shutdown of the device and it looks like the device is frozen. After pressing the power button, you can see the usual "device is powering on" screen.
Does anybody know how I can power off my device, with showing the "Your NOOK has turned off completely" screen? Already tried some sendevent commands for simulating touch events, but with no success.
Thanks in advanced.
I always just hold the power button.
Do you want it to shutdown without even the confirm menu?
It's trivial, it's just an Intent, android.intent.action.ACTION_REQUEST_SHUTDOWN
Oh, but you just can't just:
Code:
# am start -a android.intent.action.ACTION_REQUEST_SHUTDOWN
Starting: Intent { act=android.intent.action.ACTION_REQUEST_SHUTDOWN }
[i]blah, blah, blah[/i] requires android.permission.SHUTDOWN
Unfortunately (or fortunately for security) android.permission.SHUTDOWN can only be obtained by a system app.
The solution? Write an app, put the permission in AndroidManifest.xml and sign it with the system signature.
This is only possible if you have re-signed your entire system.
It works fine on my Nook.
Yes, I want it without the confirm menu.
I tried your suggestion with the intent, transferred the app to with su to system app, but with no results. Do I have to generate a key by myself and sign the app to get the shutdown permission from android?
After a deeper system scan, I found the images which are shown if the device is shutdown or restarting under /system/assets. So I wrote an App set the image cold_boot_screen.png as background and shutting down the device with reboot -p. So this is working for me.
black-lord said:
I tried your suggestion with the intent, transferred the app to with su to system app, but with no results.
Click to expand...
Click to collapse
You should have seen "Not granting permission android.permission.SHUTDOWN" in logcat when installing.
You should have seen java.lang.SecurityException in logcat when attempting to run.
black-lord said:
So this is working for me.
Click to expand...
Click to collapse
True.
Still, that's really a Linux shutdown and not the kinder, gentler Android shutdown.
Or maybe not?
Maybe zygote gets a signal to shutdown and shuts down everything gracefully?
I don't know.
Re-signing your system does not have to be a big deal.
Moreover, if you want to go modifying some of the Nook's framework or Reader you'll have to do that anyway.
DON'T FORGET TO HIT THE THANKS BUTTON
!!!DISCLAIMER!!!!
You are solely responsible for whatever shtuff happens to your device by installing either of the two files to your device.
!!!DISCLAIMER END!!!
So this still needs a lot of work but I am providing a working boot.img and root filesystem archive for all Nexus 9 variants? (not sure needs others to test and confirm).
Will be edited as things start working
What's working:
WiFi. (Must use 'nmcli dev wifi con "SSID" password "passwd" ')
GPU @ anywhere from 900-2000 FPS
Sound works just needs reconfiguring
Screen rotation works best with minimal issues as desktop taskbar widgets command to turn clockwise into landscape:
Code:
sudo xrandr -o right; sudo xinput set-prop 7 "Evdev Axis Inversion" 0, 1; sudo xinput set-prop 7 "Evdev Axes Swap" 1
&
Code:
sudo xrandr -o right; sudo xinput set-prop 7 "Evdev Axis Inversion" 0, 0; sudo xinput set-prop 7 "Evdev Axes Swap" 0
For normal portrait orientation
However DO NOT USE THE DISPLAY SETTINGS TO ROTATE IT MESSES UP THE LOGIN ROTATION AND SCREEN GOES BLACK AND SOMETIMES SHOW BACK UP IN LANDSCAPE AND WILL NOT DEFAULT BACK INTO PORTRAIT ORIENTATION. SO YOU MUST DO IT MANUALLY!!!!! See screenshot below
Swipe gestures (Chromium-browser only).
Bluetooth: WORKING!!! Install package bluetooth-touch and set this command into a shell script or enter manually the ENTIRE string:
Code:
brcm_patchram_plus --enable_hci --use_baudrate_for_download --scopcm=0,2,0,0,0,0,0,0,0,0 --baudrate 3000000 --patchram /lib/firmware/bcm4354.hcd --no2bytes --enable_lpm --tosleep=50000 /dev/ttyTHS2
Also using a Bluetooth audio sink works by itself without keyboard connected. I've found it still needs work but, connecting to a keyboard still flawless in its function file transfer locks it up when sending not receiving. Pairing and connecting are all good but functionality of Bluetooth is down to one device at a time for best results
What's not working:
Cameras (Neither front nor rear camera works at all. Needs work).
NFC? (I have no idea how to check for this. Needs work).
Probably other things I missed.
What you will need:
Any Nexus 9 with an unlocked bootloader & latest TWRP recovery installed
USB keyboard
OTG cable
Instructions:
MAKE A BACKUP! Just in case.
1.) Enter into recovery go to wipe and format Data partition as Ext4
2.) Reboot into recovery and with the boot.img and rootfs on a flash drive or, push them to device via ADB.
3.) Go to terminal command in recovery issue the commands: cd /data; mkdir linux; cd linux
4.) tar xvjf /sdcard/rootfs.tar.bz2 -C /data/linux
5.) Flash N9boot.img with install image in TWRP Install submenu.
6.) Reboot into the new Linux system.
7.) If the Kernel panics and boot loops, go back into recovery and format the data partition again it will ask are you sure type yes & repeat steps 2-4
You will need to use a USB keyboard & OTG cable to install the necessary packages and connect to WiFi/Bluetooth.
It's much easier to install on device than in a chroot environment as I have had problems in the past. And some people have different favorite Desktop Environment's. However Gnome and KDE both do not work correctly and crash.
Fluxbox, Mate, XFCE, LXDE, all work as they should with Lightdm.
If there's anything I missed you can add it below, PM me and ask, whatever and I'll try to answer as soon as I am able.
If you are interested in building the entire thing from start to finish here are the original sources
https://forum.xda-developers.com/nexus-9/general/guide-linux-nexus-9-t2985958
https://forum.xda-developers.com/nexus-9/general/guide-linux-nexus-9-t2985958/page14
And thanks to @sonicadvance1 for his original guide & @Vartom for his work on porting some of the necessary Kernel drivers. And @Vartom again for his contributions to the Bluetooth and everything else to get us this far :good::good::good::good::good::good::good::good:
Xubuntu-Desktop Preinstalled 21.5 Drivers 1GB username=ubuntu password=ubuntu
https://drive.google.com/open?id=0B8NgGANYGMhOZS1OenNzZl94bEE
rootfs base only necessary packages root password=toor
https://drive.google.com/file/d/0B8NgGANYGMhOMjVObElVVnBWamM/view?usp=drivesdk
boot.img
https://drive.google.com/open?id=0B8NgGANYGMhOZXAwZHVrUUotZ0k
In order to get the preinstalled to fix login if having issues use the command as root in virtual terminal Ctrl+Alt+F1/F2, etc
Code:
chown ubuntu:ubuntu /home/ubuntu
.
This should fix the login issues, if you want you can create a different user and remove the premade user using these commands as root in virtual terminal.
Code:
deluser username
adduser username
addgroup username adm
addgroup username sudo
Additionally if you have an error when running glxgears there is a fix
Code:
xauth list
It should output something similar to this
Code:
localhost.localdomain/unix:0 MIT-MAGIC-COOKIE-1 a4f6256398303725763c5595f404afbb
You will need to export the display and add that MIT-MAGIC-COOKIE you got from xauth list
Code:
export DISPLAY=":0"; xauth add $DISPLAY . a4f6256398303725763c5595f404afbb
This should fix the display error.
And finally,
Enjoy Ubuntu on your Nexus 9
Video of it booting
https://youtu.be/PIGm47pwzj0
Booted fine.... However a username and password would help...lol
---------- Post added at 10:30 PM ---------- Previous post was at 09:45 PM ----------
andyroidking said:
Booted fine.... However a username and password would help...lol
Click to expand...
Click to collapse
Found the root password in the other thread. toor
Now on to getting wifi up so i can get a de installed....
Reserved
andyroidking said:
Booted fine.... However a username and password would help...lol
---------- Post added at 10:30 PM ---------- Previous post was at 09:45 PM ----------
Found the root password in the other thread. toor
Now on to getting wifi up so i can get a de installed....
Click to expand...
Click to collapse
sk1tch said:
Ha! Sorry I updated the guide above to include that little tidbit of info. Sweet I'm excited to read it worked so far. Hope the guide is simple enough for everybody who wants to try it out
Click to expand...
Click to collapse
Yeah now that I got wifi working I'm off to study how to get xfce4 installed. Everyone says Arch is hard but I'll tell you their repo's are extensive. Now I have to learn about ppa's...
Also, I'm over 50 and because we have a 2048 x 1536 display everything is very tiny making all of this more of a challenge... I tried a couple things to bump the font size but they don't work....
andyroidking said:
Yeah now that I got wifi working I'm off to study how to get xfce4 installed. Everyone says Arch is hard but I'll tell you their repo's are extensive. Now I have to learn about ppa's...
Also, I'm over 50 and because we have a 2048 x 1536 display everything is very tiny making all of this more of a challenge... I tried a couple things to bump the font size but they don't work....
Click to expand...
Click to collapse
I knew you were old school. I did get Arch Linux running on the original guide but it was choppy at best and only ran in the framebuffer but this was the aarch64 version. I do think it could be done because it's my preferred distro these days as well. I think we'd have to change a few things in the CPIO init scripts.. You know point to what it needs but, that's a little too advanced for me.
Also try setting a custom dpi in the settings menu if you're using XFCE I know there's the option there
and to install it you need to uncomment all the extra repos in /etc/apt/sources.list then do apt update && apt install xubuntu-desktop
it should look like in the picture
Well, I'm stuck. X won't start... I'll have to pull the log and see what up. Unfortunately I'm back to work tonight so it will be a while before I get to play again. Don't fret, I'll be back. :silly:
Edit: Pulled logs:
As root user:
https://pastebin.com/3bJE7HkJ
As reg user:
https://pastebin.com/ZVBrCAuM
They look the same to me...
andyroidking said:
Well, I'm stuck. X won't start... I'll have to pull the log and see what up. Unfortunately I'm back to work tonight so it will be a while before I get to play again. Don't fret, I'll be back. :silly:
Edit: Pulled logs:
As root user:
https://pastebin.com/3bJE7HkJ
As reg user:
https://pastebin.com/ZVBrCAuM
They look the same to me...
Click to expand...
Click to collapse
They look identical to me as well. Um try apt install xorg xubuntu-desktop lightdm-gtk-greeter.
then reboot it should automatically enable it with systemd while installing
Error 404
The links to the downloads are no longer working.
sk1tch said:
They look identical to me as well. Um try apt install xorg xubuntu-desktop lightdm-gtk-greeter.
then reboot it should automatically enable it with systemd while installing
Click to expand...
Click to collapse
I'll give that a shot. Sounds like solid advice. Probably not until Thursday or Saturday. Busy week kids back to school
a such...
humannequin777 said:
The links to the downloads are no longer working.
Click to expand...
Click to collapse
I fixed the links but the rootfs.tar.bz2 is down as I am uploading a preinstalled image archive with the XFCE4 DE w/ onscreen keyboard, still ironing out Bluetooth made good progress so hopefully I will have that finished soon
Cameras are not included in the kernel. I did not check their performance in this kernel.
Linux Inside... Nice. Well I found a few minutes and got this far.... https://imgur.com/a/VuDEN Xauthority issue? I'll check into it later. I assume suspend doesn't work? I tried once but didn't want to crash it right now. also changed scroll bar width... easier to tap. Border width is next.
Scroll bar width:
Open the .gtkrc-2.0 file, add the following to a new line starting at the bottom of the file:
Code:
style "myscrollbar"
{
GtkScrollbar::slider-width=XX
}
class "GtkScrollbar" style "myscrollbar"
How's the performance ?
Can I use it as a desktop?
Yes indeed it does work as a desktop I got screen rotation down to two three command scripts with desktop widgets. Most things work as of now Bluetooth sucks no matter what I do but, touchscreen works fine WiFi works fine no Cameras yet Sound only through headset. Hardware acceleration works at anywhere from 800 FPS - 2000 FPS. Videos like on YouTube stutter a little if you are doing other things while watching. Swipe gestures work in Chromium browser only. (Still working on installing multifunction swipe gestures) Your best bet would be to buy one of those $11 Micro-B USB wired tablet keyboards or just use the Onboard keyboard if its already in a rugged case or whatever. Those two green arrows at the top of the desktop are my rotate widgets
andyroidking said:
Linux Inside... Nice. Well I found a few minutes and got this far.... https://imgur.com/a/VuDEN Xauthority issue? I'll check into it later. I assume suspend doesn't work? I tried once but didn't want to crash it right now. also changed scroll bar width... easier to tap. Border width is next.
Scroll bar width:
Open the .gtkrc-2.0 file, add the following to a new line starting at the bottom of the file:
Click to expand...
Click to collapse
Yes there is an .Xauthority error when I flashed it as well that was why I said it's difficult to make a working install and that it was easier to install on device but either try chown ubuntu:ubuntu /home/ubuntu as root and it may fix your issue or you have to create a new user
Vartom said:
Cameras are not included in the kernel. I did not check their performance in this kernel.
Click to expand...
Click to collapse
I added the configs for the camera to my custom config to no avail... I dont have a headset jack debug cable so I can't see what going on during boot
sk1tch said:
I added the configs for the camera to my custom config to no avail... I dont have a headset jack debug cable so I can't see what going on during boot
Click to expand...
Click to collapse
Porting the cameras was not 100% complete. Therefore, simply adding lines to the config is not enough.
---------- Post added at 02:14 PM ---------- Previous post was at 02:08 PM ----------
Porting the cameras was not 100% complete. Therefore, simply adding lines to the config is not enough.
For bluetooth work, you need to download the corresponding firmware.
with some similar string
exec /usr/sbin/brcm_patchram_plus --enable_hci --use_baudrate_for_download --scopcm=0,2,0,0,0,0,0,0,0,0 --baudrate 3000000 --patchram /lib/firmware/bcm4324.hcd --no2bytes --enable_lpm --tosleep=50000 /dev/ttyTHS2
this can be added to the nvwifibt.conf config file.
Vartom said:
Porting the cameras was not 100% complete. Therefore, simply adding lines to the config is not enough.
---------- Post added at 02:14 PM ---------- Previous post was at 02:08 PM ----------
Porting the cameras was not 100% complete. Therefore, simply adding lines to the config is not enough.
For bluetooth work, you need to download the corresponding firmware.
with some similar string
exec /usr/sbin/brcm_patchram_plus --enable_hci --use_baudrate_for_download --scopcm=0,2,0,0,0,0,0,0,0,0 --baudrate 3000000 --patchram /lib/firmware/bcm4324.hcd --no2bytes --enable_lpm --tosleep=50000 /dev/ttyTHS2
this can be added to the nvwifibt.conf config file.
Click to expand...
Click to collapse
So just add this too the sbin config file??
sk1tch said:
So just add this too the sbin config file??
Click to expand...
Click to collapse
brcm_patchram_plus this package was not found. Add it to the fast failed.