Galaxy Grand Quattro Tutorial : Way To Become A Developer - Samsung Galaxy Grand Quattro

The intention of this thread is to help newbies step by step to become an entry level developer so each one can contribute their ideas and opinions inspired by hands on experiment so as to share and increase the vast knowledge of Android

How To Setup Android Development Environment on Ubuntu 13.10
Hardware Needed : Atleat Dual Core 2.8 GHz. Processor, 4GB RAM (8GB recommended).
Software Needed For Virtualisation : VMware Workstation 10.0.1 Build 1379776
OS Needed : Ubuntu 13.10/13.04 x64 (64 bit recommended)
Virtual Machine Requirement : Atleast 3 GB RAM and 40 GB Hard Disk Space
Other Requirement : Atleast 1 Mbps (4 Mbps recommended) Shared Internet Connection.
http://forum.xda-developers.com/show....php?t=2302780 [Follow This Tutorial By Matt95. All Links Are Given There.]
JDK
$ sudo mkdir /usr/lib/jvm
$ cd ~/Downloads/
$ chmod +x jdk-6u45-linux-x64.bin
$ ./jdk-6u45-linux-x64.bin
$ sudo mv jdk1.6.0_45 /usr/lib/jvm/
$ sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_45/bin/javac 1
$ sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_45/bin/java 1
$ sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk1.6.0_45/bin/jar 1
$ sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_45/bin/javaws 1
$ java -version
Now a restart is recommended before installing git.
GIT
$ sudo apt-get install git
$ y
PYTHON
$ cd ~/Downloads/
$ tar -xzvf Python-2.7.5.tgz
$ cd Python-2.7.5/
$ ./configure
$ make
$ sudo make altinstall
GNU
$ cd ~/Downloads/
$ tar -zxvf make-3.82.tar.gz
$ cd make-3.82
$ ./configure
$ make
$ sudo make install
[Do not use make 4.0]
OTHER PACKAGES
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6
ANDROID SDK
$ mkdir ~/development
$ cd ~/Downloads
$ tar -zxvf android-sdk_r22.2.1-linux.tgz
$ mv ~/Downloads/android-sdk-linux ~/development/
SETUP ADB/FASTBOOT
$ cd ~/development/android-sdk-linux/tools
$ ./android
SDK Path: Tools (Tick All)
Extras (Tick All)
[This process will take time depending upon the internet bandwidth]
$ sudo gedit .bashrc (ignore the error)
Now paste this at the end of the file:
#Android PATHS
export PATH=$PATH:~/development/android-sdk-linux/tools
export PATH=$PATH:~/development/android-sdk-linux/platform-tools
Save the file.
Now in a terminal window type
$ adb
$ fastboot
Both commands shows list of attributes.
Connected Samsung Galaxy Grand Quattro (I8552) to Workstation through USB Cable.
$ adb devices
Successfully Shows Device Number (Device is attached).
You are done!

How To Install, Initialize and Sync Repo on Ubuntu 13.10
How To Install, Initialize and Sync Repo on Ubuntu 13.10
Hardware Needed : Atleat Dual Core 2.8 GHz. Processor, 4GB RAM (8GB recommended).
Software Needed For Virtualisation : VMware Workstation 10.0.1 Build 1379776
OS Needed : Ubuntu 13.10/13.04 x64 (64 bit recommended)
Virtual Machine Requirement : Atleast 3 GB RAM and 40 GB Hard Disk Space
Other Requirement : Atleast 1 Mbps Shared Internet Connection.
A. INSTALL REPO PART
Install needed libs (Ubuntu 13.10) [Nearly 161 MB]
sudo apt-get install git-core flex bison gperf build-essential curl zlib1g-dev zlib1g-dev:i386 lib32ncurses5-dev x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc libreadline6-dev lib32readline-gplv2-dev lib32readline6 libreadline-dev libbz2-dev libghc-bzlib-dev lib32bz2-dev libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool libwxgtk2.8-dev
Create Directories
$ mkdir -p ~/bin && mkdir -p ~/android/system
Install Repo
$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
Make Repo Executable
$ chmod a+x ~/bin/repo
Add "~/bin" to PATH of Execution
Start By Typing
gedit ~/.bashrc
Add The Below Line
export PATH=${PATH}:~/bin
B. CREATING AN ACCOUNT AT https://github.com
Go to github.com and register yourself. [If you are already a registered user then you do not have to register again]
In terminal type:
git config --global user.name "Your Name Here"
git config --global user.email "[email protected]"
[NOTE: Use the e-mail used in the website account creation]
Create your unique SSH public key
ssh-keygen -t rsa -C "[email protected]"
You can create a passphrase or omit.
Now press enter to save the ssh public keys.
Now two keys will be saved in/home/.ssh folder. (Hidden folder)
Now go to ~/.ssh folder and copy your id_rsa.pub content into account administration on github.com (double click id_rsa.pub, copy the key, login to github, go to account setting, click the SSH link and peste there).
Note: If this is the second time you are generating the ssh pubic key then after the generation copy it and visit Github. After clicking the ssh key link you will find a button "Add SSH Key". Click this and paste your new ssh key below the previous one.
Now check whether everything is ok by typing
ssh -T [email protected]
In the prompt type "yes" and you are done!
C. INITIALIZE REPO PART
$ cd ~/android/system/
repo init -u git://github.com/CyanogenMod/android.git -b jellybean
(instead of jellybean, depending on your built you may use gingerbread or ics)
D. SYNCING REPO PART
$ repo sync -j16
[This process will really take time depending on your bandwidth as this will download +16GB]
You can download all at a time or part by part. For downloading part by part just close the download at any time and safely logoff/shutdown your Ubuntu. Next time just cd to ~/android/system and type repo sync -j16. Just like any Window based download manager your download will begin from the point you closed in the last session.
You are done!

Can I also use Windows 7 for development. I have a video tutorial from YouTube indicating setting up android environment in windows. I am just asking because I never tested that I haven't a fast internet connection but if u approved for Windows 7 than I will download required sdk and exe from cafe and install them in my pc.
And also if u can please share tutorials for Windows.
Sent from my GT-I8552 using xda app-developers app

Vikas,
You are welcome to show developments in Windows. In-fact personally I feel that we can approach mass if Window is used as the development platform as newbies are much more accustomed with Window OS.
Also let me share my plan for this tutorial.
I started with ADB, the first step to connect Android based Smartphones to any OS based Workstation where Android environment is created. Then I discussed about Repo, the prime base for Android development.
Now the future plans are as following:
1. How to built a Device Tree for any new devices.
2. How to built CWM.
3. How to built Cyanogen Mod.
4. Tutorial about Eclipse.
5. Android Kitchen Setup.
6. Building Custom ROM.
The only condition is that all these steps must be shown in details for newbies in a step by step approach and it must be a generalized approach so that any devices developement can be done through these set of tutorials.

Thanks for cooperation sir give me 7-10 days and I will start development work because I truly want to learn something in android and if a support from expert side than definitely it will be more helpful.
I will start my dev from windows and very soon I will install all recommended files from tutorial and report u by pm.:thumbup::thumbup::thumbup::thumbup:
Sent from my GT-I8552 using xda app-developers app

Very useful guide...thanks for the initiative..appreciate the efforts..

You are welcome to post here.
Regards

nice info..
i just want to ask a question,
how do we compile android kernel by cygwin?
since dsixda kitchen are working flawlesly,but i wonder
why kernel seems not even compiling a kernel.
it say total errors...
i hope someone can make a clear instructions "how to"
cause ive came across all TUT in xda and i think something is missing in their TUT

Dear Jefry,
Though the kernel compilation shows error why don't you share the steps, code you have used etc. so we can all learn through it? Let it be wrong, we all will go through the coded lines, if needed search net, consult between us and then again try.
Hope you understand.
Regards

Few Basic Terminology
WHAT IS AN ANDROID EMULATOR
While there are hundreds of millions of Android devices representing hundreds of
models, you probably do not have one of each model. You may only have a single
piece of Android hardware. And if you do not even have that, you most certainly will
want to acquire one before trying to publish an Android app.
To help fill in the gaps between the devices you have and the devices that are
possible, the Android developer tools ship an emulator. The emulator behaves like a
piece of Android hardware, but it is a program you run on your development
machine. You can use this emulator to emulate many different devices, with
different screen sizes and Android OS versions, by creating one or more Android
virtual devices, or AVDs.
ANDROID OS VERSIONS AND API LEVEL
Android has come a long way since the early beta releases from late 2007. Each new
Android OS version adds more capabilities to the platform and more things that
developers can do to exploit those capabilities.
Moreover, the core Android development team tries very hard to ensure forwards
and backwards compatibility. An app you write today should work unchanged on
future versions of Android (forwards compatibility), albeit perhaps missing some
features or working in some sort of “compatibility mode”. And there are well-trodpaths for how to
create apps that will work both on the latest and on previous
versions of Android (backwards compatibility).
To help us keep track of all the different OS versions that matter to us as developers,
Android has API levels. A new API level is defined when an Android version ships
that contains changes that affect developers. When you create an emulator AVD to
test your app, you will indicate what API level that emulator should emulate. When
you distribute your app, you will indicate the oldest API level your app supports, so
the app is not installed on older devices.
At the time of this writing, the API levels of significance to most Android developers
are:
Android 1.0 (API level 1)
Android 1.1 (API level 2)
Android 1.5 Cupcake (API level 3)
Android 1.6 Donut (API level 4)
Android 2.0 Eclair (API level 5)
Android 2.0.1 Eclair (API level 6)
Android 2.1 Eclair (API level 7)
Android 2.2–2.2.3 Froyo (API level 8)
Android 2.3–2.3.2 Gingerbread (API level 9)
Android 2.3.3–2.3.7 Gingerbread (API level 10)
Android 3.0 Honeycomb (API level 11)
Android 3.1 Honeycomb (API level 12)
Android 3.2 Honeycomb (API level 13)
Android 4.0–4.0.2 Ice Cream Sandwich (API level 14)
Android 4.0.3–4.0.4 Ice Cream Sandwich (API level 15)
Android 4.1 Jelly Bean (API level 16)
Android 4.2 Jelly Bean (API level 17)
Android 4.3 Jelly Bean (API level 18)
Android 4.4 KitKat (API level 19)
WHAT IS DALVIK
In terms of Android, Dalvik is a virtual machine (VM). Virtual machines are used by
many programming languages, such as Java, Perl, and Smalltalk. The Dalvik VM is
designed to work much like a Java VM, but optimized for embedded Linux
environments.
So, what really goes on when somebody writes an Android application is:
1. Developers write Java-syntax source code, leveraging class libraries published
by the Android project and third parties.
2. Developers compile the source code into Java VM bytecode, using the javac
compiler that comes with the Java SDK.
3. Developers translate the Java VM bytecode into Dalvik VM bytecode, which
is packaged with other files into a ZIP archive with the .apk extension (the
APK file).
4. An Android device or emulator runs the APK file, causing the bytecode to be
executed by an instance of a Dalvik VM.

How To Connect Your Android Phone/Tablet With Your PC For Developement
Follow Post #2 i.e. 'How To Setup Android Development Environment on Ubuntu 13.10'
Now in a terminal window type the command
$ adb devices
The output will be something similar to:
List of devices attached
f9eru809279 device
If by any case this command fails to work, you may need to add some udev rules.
For example, here is a
51-android.rules file that will handle the devices from a handful of manufacturers:
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="22b8", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="18d1", MODE="0666"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="0c01",
MODE="0666", OWNER="[me]"
SUBSYSTEM=="usb", SYSFS{idVendor}=="19d2", SYSFS{idProduct}=="1354", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="04e8", SYSFS{idProduct}=="681c", MODE="0666"
Open gedit and copy the above codes, then put the file in /etc/udev/rules.d directory and reboot the system.
Note that the CyanogenMod project uses these udev rules.

Before We Begin
WHO MANAGED ANDROID?
Android is very different from other mobile platforms currently available. It is not
managed by a single organization, but by a group of companies named the “Open
Handset Alliance,” which is committed to providing a mobile OS that is free, complete,
and open source.
WHY THIS CREATES COMPLEXITY?
1.Multiple screen sizes
Android devices come in a multitude of different screen sizes. Success of your app
can hinge upon how your app looks across devices.
2.Fragmentation
It is up to the carrier and manufacturer to update their devices when a new version
of the OS and runtime are released, which doesn’t always happen in a timely manner.
It is therefore necessary to support older versions of the OS and runtime.
3.Different hardware capabilities
Android phones come in all shapes, sizes, and capabilities. It is necessary to ensure
that you degrade unsupported features gracefully when the hardware is limited.
Another important consideration is the particular hardware components on which
you can or cannot rely (for instance, some devices don’t have cameras, GPS sensors,
or keyboards).
4.Resource limitations
Developing applications targeted to the mobile environment is different from developing
for the desktop. CPU speed and memory are limited compared to desktops
or servers. Mobile device users don’t put up with apps that tie up their devices
(blocking the UI), consume too many resources, or crash their devices.
DEVELOPEMENT PROCESS FOR ANDRIOD DEVELOPER TOOLS
Google manages ADT (Android Developer Tools) development, as well as the standard Android platform.
However,the two products are managed very differently, particularly in regards to the opensource
nature of the products. The ADT project is developed by a different group from
the one that manages the main platform. The tools are released separately from the
standard SDK and follow their own release cycle, which is frequently (but not always)
tied to the platform release.
The standard OS is developed behind closed doors—contributions are not accepted to
the current code base. The source code is released to the public at some point after the
group releases it to manufacturers and other insiders.
ANDROID SOFTWARE DEVELOPEMENT KIT
This bundle consists of:
• The Eclipse IDE, including the ADT plug-ins, and all the required extensions
• The SDK Tools
• The Platform Tools
• The latest Android Platform
• A CPU image compatible with the latest platform
CONFIGURING A DEVICE FOR DEVELOPEMENT
The simplest way to test your applications is often by using an Android device. You can
use almost any Android device for development, as long as you make a few changes in
order to enable communication with the development tools.
1. Configuring a Physical Device for Development.
2. Change phone settings.
Launch the Settings app on your phone, then select Applications → Development
→ USB-Debugging. Check the box next to “USB debugging” to enable this functionality.
3. Download the ADB driver.
In order to connect an Android-powered device for testing on Windows machines,
it is necessary to install the appropriate USB driver. This is not necessary on Mac
OS X or Linux.
You can find drivers at the website of the manufacturer of your phone. You may be
able to find a driver through the Android Document website, which contains a list
of links to software for many original equipment manufacturers (OEMs).
4. Validate debugging on the phone.
Connect your device to your computer. If everything went well, you will see a notification
from your operating system, indicating that the device is installed and ready to use.
WHAT IS ADB?
Andriod Debug Bridge (ADB) is the main tool that allows you to interact with your emulator or a
connected device. The ADB process is actually a client/server program. The server component
communicates with a variety of clients (such as the command line or DDMS). The
daemon process on the device facilitates communication of activities such as:
• Push/pull of data or apps
• Issuing shell commands
• Restarting the device
• Reading system logs

Let Us Start Communicating
Before you begin follow post no #2 and follow accordingly.
Now issue the command:
$ adb devices
The response will include:
Serial number
The unique ID of each connected device. You will need the serial number to connect
directly. The format of the serial number includes information about the device
itself (namely, the type of device and the port on which it is listening).
State
The connection state of the device. This will be offline if the device is connected but
not responding. It will be device if is available and connected. Otherwise, the response
will be no devices, which indicates there are no active devices that ADB can
communicate with currently.
Now issue the command:
$ adb -s serialNumber version [serialNumber = The serial number you get from $adb devices command]
The output will be like this:
[email protected]:~$ adb -s 1fd***** version
Android Debug Bridge version 1.0.31
Now that ADB knows which device to target, we can interact with it. It is possible to do
a variety of useful things with this interface.
TRANSFERRING FILES: THE FAMOUS PUSH & PULL COMMANDS
It is very easy to transfer files between your computer and your device using the push
and pull commands.
PUSH = File transferrs from your computer to the attached device.
PULL = File transfers from your attached device to computer.
You can include additional path parameters if you would like to specify a
particular location for the files. If a path is not specified, the commands will use the
current directory of your computer for the local location and the data folder on the
device for the remote location. push and pull can also copy complete directories
(recursively), which can be very useful.
The syntax of push is:
$ adb push local-directory
remote
An example of using this command is shown here. We are using ADB to push a file
named test.txt from the current directory to the SD card. The syntax for this is:
$ adb push test.txt /sdcard/test.txt [Here sdcard means the internal sdcard]
To move the file off the SD card and back onto your machine, in a new directory and
with a new name, type:
$ adb pull /sdcard/test.txt home/arinio/andro/test.txt
INTERACTIVE MODE
Interactive mode allows you to execute more than one command successively on the
device. To start interactive shell mode, type:
$ adb shell
You will see a # symbol, which indicates that you are in shell mode. When you are ready
to exit the remote shell, you can use Ctrl+D or type exit to end the shell session.
REal-Time Example:
[email protected]:~$ adb shell
[email protected]:/ $
/
[email protected]:/ $ cd /sys
sys/ system/
[email protected]:/ $ cd /system/etc/
[email protected]:/system/etc $ pwd
/system/etc
[email protected]:/system/etc $exit
ONE-OFF MODE
It is also possible to execute commands noninteractively. To do this, type the command
you want to execute after the shell keyword.
adb shell command
[email protected]:~$ adb shell cat /system/etc/hosts
127.0.0.1 localhost
RETRIEVING SYSTEM DATA
There are many cases in which you need detailed information about the various systems
on your device. Some useful commands can dump huge amounts of information about
the system, including service status, system statistics, and error logs. You may want to
collect these statistics if you are trying to analyze trends or specific details about your application.
$ adb shell dumpsys > /home/arinio/Downloads/dump.txt [Here I redirected the output to dump.txt file. Tolal output line is 31000+]
Outputs data about specific system services to the screen. For example, adb shell
dumpsys alarm will output details about all the alarms currently registered on the
system.
The first few lines are:
Currently running services:
AtCmdFwd
CustomFrequencyManagerService
DirEncryptService
FMPlayer
SurfaceFlinger
accessibility
account
activity
alarm
apn_settings_policy
application_policy
apppermission_control_policy
appwidget
audio
auditlog
backup
battery
batteryinfo
bluetooth
bluetooth_a2dp
bluetooth_avrcp
bluetooth_policy
browser_policy
certificate_policy
clipboard
clipboardEx
commontime_management
connectivity
content
country_detector
cpuinfo
date_time_policy
dbinfo
device_account_policy
device_info
device_policy
devicestoragemonitor
diskstats
display.hwcservice
drm.drmManager
dropbox
eas_account_policy
edm_proxy
edmnativehelper
email_account_policy
email_policy
enterprise_license_policy
enterprise_policy
enterprise_vpn_policy
entropy
firewall_policy
geofencing
gfxinfo
hardware
input
input_method
iphonesubinfo
iphonesubinfo_msim
isms
isms_msim
kioskmode
ldap_account_policy
license_log_service
location
location_policy
lock_settings
lockscreen_overlay
log_manager_service
mdm.remotedesktop
media.audio_flinger
media.audio_policy
media.camera
media.gestures
media.player
meminfo
mini_mode_app_manager
misc_policy
motion_recognition
mount
netpolicy
netstats
network_management
notification
package
password_policy
permission
phone
phone_msim
phone_restriction_policy
phoneextadb shell dumpsys > /home/arinio/Downloads/dump.txt
power
remoteinjection
restriction_policy
roaming_policy
samplingprofiler
samsung.facedetection_service
scheduling_policy
seandroid_policy
search
security_policy
sensorservice
serial
servicediscovery
simphonebook
simphonebook_msim
sip
smartcard_browser_policy
smartcard_email_policy
smartcard_vpn_policy
statusbar
telephony.msim.registry
telephony.registry
textservices
throttle
uimode
updatelock
usagestats
usb
vibrator
voip
vpn_policy
wallpaper
wifi
wifi_policy
wifip2p
window
Another Command:
$ adb shell dumpstate > /home/arinio/Downloads/dump1.txt
Detailed system data representing a device at a particular state in time (includes
dumpsys information as well).
The output contains 90772 lines.
THe first few lines are:
mkdir(/data/anr): Permission denied
========================================================
== dumpstate: 2013-11-30 22:37:19
========================================================
Build: JZO54K.I8552XXAMJ7
Build fingerprint: 'samsung/delos3gxx/delos3geur:4.1.2/JZO54K/I8552XXAMJ7:user/release-keys'
Bootloader: I8552XXAMDB
Radio: msm
Network: AirTel
Kernel: Linux version 3.4.0-1441994 ([email protected]) (gcc version 4.6.x-google 20120106 (prerelease) (GCC) ) #1 SMP PREEMPT Tue Oct 29 13:28:51 KST 2013
Command line: (unknown)
------ UPTIME (uptime) ------
up time: 4 days, 03:13:23, idle time: 1 days, 23:21:38, sleep time: 3 days, 14:12:20
[uptime: 0.1s elapsed]
------ MEMORY INFO (/proc/meminfo) ------
MemTotal: 865328 kB
MemFree: 63208 kB
Buffers: 18316 kB
Cached: 201748 kB
SwapCached: 0 kB
Active: 540780 kB
Inactive: 121620 kB
Active(anon): 443292 kB
Inactive(anon): 1020 kB
Active(file): 97488 kB
Inactive(file): 120600 kB
Unevictable: 848 kB
Mlocked: 0 kB
HighTotal: 117760 kB
HighFree: 1624 kB
LowTotal: 747568 kB
LowFree: 61584 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Dirty: 0 kB
Writeback: 0 kB
AnonPages: 443196 kB
Mapped: 105740 kB
Shmem: 1116 kB
Slab: 46192 kB
SReclaimable: 9332 kB
SUnreclaim: 36860 kB
KernelStack: 8112 kB
PageTables: 16444 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 432664 kB
Committed_AS: 8003824 kB
VmallocTotal: 245760 kB
VmallocUsed: 82488 kB
VmallocChunk: 59248 kB
------ CPU INFO (top -n 1 -d 1 -m 30 -t) ------
User 2%, System 8%, IOW 0%, IRQ 0%
User 21 + Nice 0 + Sys 61 + Idle 645 + IOW 0 + IRQ 0 + SIRQ 0 = 727
PID TID PR CPU% S VSS RSS PCY UID Thread Proc
26459 26459 0 10% R 1432K 808K shell top top
96 96 0 0% S 0K 0K root irq/89-msm-cpr-
1013 1025 0 0% S 6012K 448K root mpdecision /system/bin/mpdecision
6 6 0 0% S 0K 0K root migration/0
16 16 1 0% S 0K 0K root khelper
17 17 1 0% S 0K 0K root suspend_sys_syn
18 18 1 0% S 0K 0K root suspend
19 19 0 0% S 0K 0K root irq/53-msmdatam
20 20 0 0% S 0K 0K root sync_supers
21 21 0 0% S 0K 0K root bdi-default
22 22 1 0% S 0K 0K root kblockd
23 23 0 0% S 0K 0K root khubd
24 24 1 0% S 0K 0K root modem_notifier
25 25 1 0% S 0K 0K root smd_channel_clo
26 26 1 0% S 0K 0K root smsm_cb_wq
30 30 1 0% S 0K 0K root qmi
31 31 1 0% S 0K 0K root rpcrouter
32 32 1 0% S 0K 0K root rpcrotuer_smd_x
33 33 0 0% S 0K 0K root krpcserversd
35 35 0 0% S 0K 0K root rmt_storage
36 36 1 0% S 0K 0K root kadspd
37 37 1 0% D 0K 0K root voicememo_rpc
39 39 0 0% D 0K 0K root krmt_storagecln
40 40 0 0% D 0K 0K root krmt_storagecln
41 41 0 0% S 0K 0K root kswapd0
42 42 0 0% S 0K 0K root fsnotify_mark
43 43 0 0% S 0K 0K root ecryptfs-kthrea
44 44 1 0% S 0K 0K root crypto
57 57 1 0% S 0K 0K root mdp_dma_wq
58 58 1 0% S 0K 0K root mdp_vsync_wq
[top: 2.7s elapsed]
------ PROCRANK (procrank) ------
*** exec(procrank): Permission denied
*** procrank: Exit code 255
[procrank: 0.1s elapsed]
------ VIRTUAL MEMORY STATS (/proc/vmstat) ------
nr_free_pages 10236
nr_inactive_anon 255
nr_active_anon 110826
nr_inactive_file 30149
nr_active_file 24375
nr_unevictable 212
nr_mlock 0
nr_anon_pages 110801
nr_mapped 26437
nr_file_pages 55015
nr_dirty 0
nr_writeback 0
nr_slab_reclaimable 2746
nr_slab_unreclaimable 14345
nr_page_table_pages 4117
nr_kernel_stack 1015
nr_unstable 0
nr_bounce 0
nr_vmscan_write 0
nr_vmscan_immediate_reclaim 0
nr_writeback_temp 0
nr_isolated_anon 0
nr_isolated_file 0
nr_shmem 279
nr_dirtied 439303
nr_written 438957
nr_anon_transparent_hugepages 0
nr_dirty_threshold 11861
nr_dirty_background_threshold 2965
pgpgin 1208499
pgpgout 1874766
pswpin 0
pswpout 0
pgalloc_normal 7397855
pgalloc_high 1334847
pgalloc_movable 0
pgfree 8862011
pgactivate 127582
pgdeactivate 53470
pgfault 10679448
pgmajfault 8080
pgrefill_normal 15854
pgrefill_high 79498
pgrefill_movable 0
pgsteal_kswapd_normal 337890
pgsteal_kswapd_high 103263
pgsteal_kswapd_movable 0
pgsteal_direct_normal 17327
pgsteal_direct_high 1880
pgsteal_direct_movable 0
pgscan_kswapd_normal 352987
pgscan_kswapd_high 127978
pgscan_kswapd_movable 0
pgscan_direct_normal 22790
pgscan_direct_high 2645
pgscan_direct_movable 0
pginodesteal 0
slabs_scanned 28130432
kswapd_inodesteal 0
kswapd_low_wmark_hit_quickly 289
kswapd_high_wmark_hit_quickly 748
kswapd_skip_congestion_wait 0
pageoutrun 2014157
allocstall 452
pgrotated 8
compact_blocks_moved 17749
compact_pages_moved 78038
compact_pagemigrate_failed 10421
compact_stall 640
compact_fail 248
compact_success 392
unevictable_pgs_culled 212
unevictable_pgs_scanned 0
unevictable_pgs_rescued 2
unevictable_pgs_mlocked 2
unevictable_pgs_munlocked 2
unevictable_pgs_cleared 0
unevictable_pgs_stranded 0
unevictable_pgs_mlockfreed 0
Another Useful Command:
$ adb shell logcat -b radio
This command provides access to the cellular radio log. This information is useful
when interacting with the networking stack. Some of the information available in
this log includes time of events, a listing of commands used by the system to com‐
municate, SMS information, IP information, and cellular network data.
ADB DOES A LOT MORE:
The ADB tool has a variety of additional functionality. Some functionality worth highlighting includes:
• Modify network configuration options like port forwarding (example: adb forward
tcp:7101 tcp:8101)
• Access your device as the root user (example: adb shell su)
• Restart the device in alternate modes, such as recovery mode (example: adb reboot
recovery)
• View system logs, such as the radio or event buffers (example: adb logcat -b events)
• Examine system utilization (example: adb shell tail | top)
There is a lot of other functionality we aren’t able to cover. For a complete list of all
available commands and their parameters, type adb -help without any additional arguments to get a listing of all options.

How To Find The Complete File System Of Galaxy Grand Quattro
Before you begin follow post no #2 and follow accordingly.
Now issue the command:
[email protected]:~$ adb devices
[email protected]:~$ adb shell
[email protected]:/ $ su -
[email protected]:/ # ls -R /
Move this find.txt from internal to external sdcard with the command:
[email protected]:/ # ls -R / > /sdcard/filesystem.doc
You can now transfer this file to your computer.
The file system of Galaxy Grand Quattro (GT-I8552) is as below: (Total 4253 pages of a MSWord doc)
[FONT=&quot]/:
acct
cache
charger
config
d
data
default.prop
dev
efs
etc
factory
fstab.delos3g
fstab.msm7627a
fstab.qcom
init
init.goldfish.rc
init.qcom.class_core.sh
init.qcom.class_main.sh
init.qcom.rc
init.qcom.ril.path.sh
init.qcom.sh
init.qcom.unicorn-dpi.sh
init.qcom.usb.rc
init.qcom.usb.sh
init.rc
init.target.rc
init.trace.rc
init.usb.rc
initlogo.rle
initlogo_swa.rle
lpm.rc
mnt
persist
preload
proc
res
root
sbin
sdcard
storage
sys
system
ueventd.goldfish.rc
ueventd.qcom.rc
ueventd.rc
vendor[/FONT]
.
.
.
..........(4253 pages)

The /proc/partitions Table Of Galaxy Grand Quattro
[email protected]:/sdcard # cat /proc/partitions
[FONT=&quot]
[/FONT]
[FONT=&quot]major minor #blocks name[/FONT]
[FONT=&quot] [/FONT]
[FONT=&quot] 179 0 7634944 mmcblk0[/FONT]
[FONT=&quot] 179 1 20 mmcblk0p1[/FONT]
[FONT=&quot] 179 2 175 mmcblk0p2[/FONT]
[FONT=&quot] 179 3 20480 mmcblk0p3[/FONT]
[FONT=&quot] 179 4 1 mmcblk0p4[/FONT]
[FONT=&quot] 179 5 1000 mmcblk0p5[/FONT]
[FONT=&quot] 179 6 1000 mmcblk0p6[/FONT]
[FONT=&quot] 179 7 2000 mmcblk0p7[/FONT]
[FONT=&quot] 179 8 12288 mmcblk0p8[/FONT]
[FONT=&quot] 179 9 3072 mmcblk0p9[/FONT]
[FONT=&quot] 179 10 3072 mmcblk0p10[/FONT]
[FONT=&quot] 179 11 4096 mmcblk0p11[/FONT]
[FONT=&quot] 179 12 8192 mmcblk0p12[/FONT]
[FONT=&quot] 179 13 12288 mmcblk0p13[/FONT]
[FONT=&quot] 179 14 4096 mmcblk0p14[/FONT]
[FONT=&quot] 179 15 4096 mmcblk0p15[/FONT]
[FONT=&quot] 179 16 12288 mmcblk0p16[/FONT]
[FONT=&quot] 179 17 24576 mmcblk0p17[/FONT]
[FONT=&quot] 179 18 4096 mmcblk0p18[/FONT]
[FONT=&quot] 179 19 512 mmcblk0p19[/FONT]
[FONT=&quot] 179 20 2048 mmcblk0p20[/FONT]
[FONT=&quot] 179 21 1228800 mmcblk0p21[/FONT]
[FONT=&quot] 179 22 737280 mmcblk0p22[/FONT]
[FONT=&quot] 179 23 102400 mmcblk0p23[/FONT]
[FONT=&quot] 179 24 5443168 mmcblk0p24[/FONT]
[FONT=&quot] 179 32 31166976 mmcblk1[/FONT]
[FONT=&quot] 179 33 31165952 mmcblk1p1[/FONT][FONT=&quot]
[/FONT]

The /proc/partitions Table Of Galaxy Grand Quattro In Structured Format
Please view attachment.

The /proc/partitions Table Of Galaxy Grand Quattro After Decimal To Hex Convertion
Here we have the /proc/partitions table after converting the values to hexadecimal.
Samsung no more provides the file /proc/mtd for make the developers work easy.
I want all to emphasis on this table structure as for building recovery and CWM this table structure is invaluable.
However still the name of the partitions are not known to us in desired format like boot, recovery etc.
We will do further research in the upcoming tutorial.

How To Unpack Recovery Image
For now let us shift our attention fro the /proc folder and focus over the recovery image file. Later on we will again review our previous discussion in more detailed manner.
Let us jump into this current topic.
Now the first question is where to find the recovery image?
In old days it was possible to locate that file by simply typing the command:
$ adb devices
$ adb shell
$ su -
and then in the root typing # cat /proc/mtd (for Samsung) or # cat /proc/emmc (for HTC)
Alas! Now there is no such files.
So, let us apply the hard way to find that image file.
Start...............
In google simply type sammobile or directly type in the address bar www.sammobile.com
Register yourself first and foremost.
Now click the Firmware link or you can directly click the Firmwares link after typing sammobile in google search box. It's up to you.
Here you will find a box 'search your device here'
There simply type I8552
The search result will consist of seven columns.
Importantis column no. two where you will find your country, column three where you will find the Firmware release month (go for the latest month), column six where the name of the version you will get and finally the last column where the download link is there.
Now click the latest download link (for India it is I8552XXAMJ7) and in the latest windows you will get a Captcha challenge. Unfortunately though filling the right letters/numbers the Captcha will fail and fortunately you will get another link for download. [There are two links for India, one will show INU file and another INS file. In your Galaxy Grand Quattro box you will find whether your device is based on INU or INS].
The download links are always Hotfile links and they are resumable. Better to use Internet Download Manager (IDM) to download this file.
The files are nearly 750 MB sizes and they are compressed in rar format.
With the help of WInRAR unRAR it and you will get a tar.md5 formatted file and the latest Firmwares size will become 1.3 GB.
We call them as tarball (actually a .tar file is a tarball file and here in this case this is a tarball file with md5 checksum) files and inside this Firmware the recovery image file is hidden.
For Indian user the file will look like I8552XXAMJ7_I8552ODDAMI4_I8552DDAMI1_HOME.tar.md5
If you are not very much accustomed with VMWare how to create a link between your Original OS (we call it host) and virtually running Ubuntu (we call it guest) simply go to your Windows OS, copy the file in a USB drive and then again plug it while in Ubuntu and paste it in your home folder.
Now the main part...............
Right click this file and delete the .md5 words (mind the dot)
In Ubuntu open a terminal window and fire up these commands:
[email protected]:~$ mkdir quattro
[email protected]:~$ mv I8552XXAMJ7_I8552ODDAMI4_I8552DDAMI1_HOME.tar /home/arinio/quattro/
[email protected]:~$ cd quattro/
[email protected]:~/quattro$ tar xvf I8552XXAMJ7_I8552ODDAMI4_I8552DDAMI1_HOME.tar
boot.img
recovery.img
system.img.ext4
fat.bin
cache.img.ext4
hidden.img.ext4
So finally inside the quattro folder we got six files and one of them is recovery.img. Note that another important file is boot.img
Now you can delete the I8552XXAMJ7_I8552ODDAMI4_I8552DDAMI1_HOME.tar file. This will be no more needed. Infact you can delete all other files except recovery.img and boot.img
So if now you issue this command you will observe
[email protected]:~$ ls /home/arinio/quattro/
boot.img recovery.img
Let us target recovery.img
First visit this page http://forum.xda-developers.com/showthread.php?t=1877807 and download unmkbootimg.gz file.
Inside your /home partition you will find one folder named Download. After the download is complete (1-5 second) you will find the unmkbootimg.gz file there only.
Now issue this commands:
[email protected]:~$ cd /home/arinio/Downloads/
[email protected]:~/Downloads$ ls
ADB.txt dump1.txt Python-2.7.5
ADB.txt~ dump2.txt REPO PART.txt
Android Developer Tools Essentials.pdf dump.txt REPO PART.txt~
CWM BUILD PATH.txt~ make-4.0 unmkbootimg.gz
[email protected]:~/Downloads$ gunzip unmkbootimg.gz
[email protected]:~/Downloads$ ls
ADB.txt dump1.txt Python-2.7.5
ADB.txt~ dump2.txt REPO PART.txt
Android Developer Tools Essentials.pdf dump.txt REPO PART.txt~
CWM BUILD PATH.txt~ make-4.0 unmkbootimg
So unmkbootimg.gz becomes unmkbootimg
Now cut the unmkbootimg file from Downloads folder and paste it inside quattro folder.
So now the quattro folder will look like:
[email protected]:~/Downloads$ ls /home/arinio/quattro/
boot.img recovery.img unmkbootimg
Now right click the unmkbootimg and click 'Properties'.
In the new window click the tab 'Pemissions' and check-mark 'Allow executing file as program'.
Close the 'Permissions' window.
Now while inside the quattro folder issue this command:
[email protected]:~/quattro$ ./unmkbootimg recovery.img > recoveryoutput.txt
Now issue
[email protected]:~/quattro$ ls
boot.img recovery.img unmkbootimg
initramfs.cpio.gz recoveryoutput.txt zImage
Here The kernel is zImage and the ramdisk is initramfs.cpio.gz.
So, ultimately we have successfully unpacked the recovery image and recovery.img consists two files namely zImage and initramfs.cpio.gz
If we issue this command:
[email protected]:~/quattro$ cat recoveryoutput.txt
The output will show:
unmkbootimg version 1.2 - Mikael Q Kuisma <[email protected]>
Kernel size 4694160
Kernel address 0x208000
Ramdisk size 1082913
Ramdisk address 0x1500000
Secondary size 0
Secondary address 0x1100000
Kernel tags address 0x200100
Flash page size 4096
Board name is ""
Command line "androidboot.hardware=qcom loglevel=1 vmalloc=200M"
*** WARNING ****
This image is built using NON-standard mkbootimg!
OFF_RAMDISK_ADDR is 0x01300000
Please modify mkbootimg.c using the above values to build your image.
****************
Extracting kernel to file zImage ...
Extracting root filesystem to file initramfs.cpio.gz ...
All done.
---------------
To recompile this image, use:
mkbootimg --kernel zImage --ramdisk initramfs.cpio.gz --base 0x200000 --cmdline 'androidboot.hardware=qcom loglevel=1 vmalloc=200M' --pagesize 4096 -o new_boot.img
---------------
Done!

You have been simple superb so far...no other dev would care to go into all these details...thanks a lot for your efforts..
im learning android a bit

Related

[HOWTO] Install GNU/Linux on the Huawei S7 && Development thread (Kernel & GB)

[HOWTO] Install GNU/Linux on the Huawei S7 && Development thread (Kernel & GB)
Installing GNU/Linux on the Huawei IDEOS S7
( Using Debian or Ubuntu )
THIS GUIDE IS A WORK IN PROGRESS!
USE AT OWN RISK!​
Requirements:
Gnu/Linux experience! THIS IS NOT INTENDED FOR THE FAINTHEARTED!
Debian or Ubuntu.
The Google Android SDK Or at least adb and Fastboot
Busybox and a terminal emulator for Android.
A rooted device. See http://forum.xda-developers.com/showthread.php?p=14321729#post14321729 For how to root the Huawei S7 Android (2.2.2)
UPDATE:
New Image available.
Compatible and tested on :
-Huawei S7
-Huawei X5 / U8800(not quite done yet),
-RK2818 based devices,
-Samsung Galaxy s2.
Add "setprop ctl.stop bootanim" to the chroot command in "startnix-s7/other/rk.sh" on targets newer then gingerbread.
The image is using the MSM/QSD X11 driver for video,
ext3-4 modules for chroot on Android 2.2.2 stock image
xinput calibrator for screen calibration
Recompiled udev making that compatible.
And also a new sane kernel. which can be fastbooted with this image where ext3-4 are included and compiled-in. This kernel is necessary for enabling acceleration on the MSM/QSD X11 driver, using DRM. Swap and alsa(hopefully) are also enabled, ++, currently for _testing_only_!
Read post #11 for information - Merry Christmas and a Happy new year to you all!!
Setting up an image.
dd if=/dev/zero of=arm-linux.img bs=1024 count=2097152 to create a 2gb image.
mkfs.ext2,3 or 4 arm-linux.img , see post 10 for ext3 and 4 modules. as well as jbd and jbd2 which need to be insmodded.
Setting up a partition.
Plug it into your pc running Debian or Ubuntu, have usb storage selected on the device.
Back up everything on the 8GB Fat32 partition. I did this with a simple tar -cf android-back.tar /media/8gigandroidmountpoint. Verify that .android_secure is properly packed, but i also strongly suggest using titanium backup to backup application data and settings first then backup with a .tar. That cant fail.
Create a mountpoint and locate the special device of the S7.
Once you are absolutely sure you backed your partition, proceed with partitioning. Also be warned that ext2 is very prone to dataloss if not properly unmounted before rebooting, And by default, the s7 only supports ext2. So be sure and remember to have unmount any ext2 partition properly when done in Gnu/Linux, run sync as root before exiting, And have e2fsck handy. i have had to edit /etc/mtab back in due to corruption a dozen times when i was using ext2!
Code:
cfdisk -z /dev/sdx
I recommend at least 2Gb's. You can always increase the size of the partition later using tools such as gparted , but be aware, gparted might wreak havoc on your fat32 partition!
Now, create the first partition. It is very important that you make the first partition a Fat32 partition or the pad might go mad and operating systems with Multiple $clerosis wont see the partition! Choose "Type" and enter "0B" (FAT32). Create the second partition using the remaining space.
Select "Write" then Exit.
Now, do mkfs.vfat /dev/sdx1 and mkfs.ext2,3 or 4 /dev/sdx2.
Installing.
Once this is done we make ourselves a temporary directory, lets say mkdir /media/deb and loop mount the image or the partition there.
Instruct debootstrap to get the base packages for squeeze (Debian 6.0),
Squeeze is based on kernel 2.6.32 and is therefore safest to base our installation on, as Android 2.2 is designed with 2.6.32 in mind. The s7 is a armv7 so we could also use armhf, the drawbacks are its not quite done yet, and there is currently no video driver for our device available from me or the debian repo tested for armhf.
Code:
apt-get install debootstrap
# Adjust .nl. for your closest Debian mirror. Saves time and energy.
debootstrap --verbose --arch armel --foreign squeeze /media/deb [URL]ftp://ftp.nl.debian.org/debian[/URL]
Now using adb from the Google Android SDK and a usb cable, enter a shell and do the following.
(NOTE: I'm using /sdcard2 , which is the mountpoint to any external sdcard as the mountpoint, the reason for this is lazyness, creating a new folder on the s7's filesystem requires you run psneuter, remount the fs, then create your directory, see my rooting thread for that, you must change this if you are using an sdcard)
Code:
adb kill-server
adb start-server
adb shell
su
# For loopback image
mknod /dev/block/loop255 b 7 255
busybox losetup arm-linux.img /dev/block/loop255
mount -o rw -t ext2,3 or 4 /dev/block/loop255 /sdcard2
# For partition
mount -o rw -t ext2,3 or 4 /dev/block/vold/179:2 /sdcard2
export bin=/sdcard2/bin
export PATH=$bin:/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:$PATH
export TERM=linux
export HOME=/root
cp -r /etc/firwmare/* /sdcard2/lib/firmware/
cp -r /etc/wifi/* /sdcard2/lib/firmware/
cp /sbin/adbd /sdcard2/sbin
cp -r /dev /sdcard2/
chroot /sdcard2 /debootstrap/debootstrap --second-stage
# Adjust .nl. for your closest Debian mirror.
echo 'deb [URL]ftp://ftp.nl.debian.org/debian[/URL] squeeze main' > /sdcard2/etc/apt/sources.list
Tell it what nameserver to use, probably your routers IP address.
In this case we'll just use Googles DNS that should work in any case.
Code:
echo 'nameserver 8.8.8.8' > /sdcard2/etc/resolv.conf
echo 'nameserver 8.8.4.4' >> /sdcard2/etc/resolv.conf
Lets drop by our new home and make it nice and comfy.
Code:
chroot /sdcard2 /bin/bash
Once in, we need to do a quick few mounts, a fast few mknodes and a little bit of linking to make things fully functional.
Code:
mount -t devpts devpts /dev/pts
mount -t proc proc /proc
mount -t sysfs sysfs /sys
ln -s /proc/self/fd/0 /dev/stdin
ln -s /proc/self/fd/2 /dev/stderr
ln -s /proc/self/fd/1 /dev/stdout
mknod /dev/block/loop255 b 7 255 # Shouldn't really be needed as we just copied /dev
ln -s /dev/ptmx /dev/pts/ptmx
#mknod /dev/pts/ptmx c 5 2
# ln -s /dev/input/event0 /dev/event0
ln -s /dev/graphics/fb1 /dev/fb1
ln -s /dev/graphics/fb0 /dev/fb0
Creating the /etc/mtab file
The /etc/mtab file should look something like this.
Code:
/dev/block/vold/179:2 / ext2 rw,noatime 0 0
# or - You should have figured to adjust for ext 2 3 or 4 now?
/dev/block/loop255 / ext2 rw,noatime 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
devpts /dev/pts devpts rw 0 0
The FS should always be mounted with the noatime option! This reduces load considerably and conserves sdcard!
mount -o rw,noatime -t ext2 /dev/block/vold/179:2 /sdcard2 for instance
/etc/fstab should look like this: (remember to adjust / )
Code:
/dev/block/loop255 / ext3 defaults,noatime 1 1
tmpfs /lib/init/rw tmpfs rw,nosuid,mode=0755 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts rw,gid=5,mode=620 0 0
Setup a password for the root account.
For some reason i had to run dhclient to get online at first, even though ifconfig shows me as connected. Also be aware that when Android falls asleep it puts the wlan0 device to sleep, dropping the connection. Pinging something with -i 90 is a temporary workaround for this.
Setting up OpenSSH
Code:
apt-get update
apt-get install openssh
(OPTIONAL) To configure your locale settings to use a language other than English, install the locales support package and configure it.
Currently the use of UTF-8 locales are recommended.
Code:
apt-get install locales
dpkg-reconfigure locales
(OPTIONAL! ) The "tasksel install standard" command installs all packages marked as "standard" packages for the selected distribution. Running just tasksel will promote you with several choices. tasksel --initial will promote you with installing the base system.
For things like the touchscreen to work properly we need to populate /dev.
Code:
# NOT NEEDED ANYMORE , USING DIFFERENT APPROACH! - leaving for reference
#mknod /dev/kgsl-3d0 c 244 0
#mkdir /dev/input
#mknod /dev/input/input0 c 13 64
#mknod /dev/input/input1 c 13 65
#mknod /dev/input/input3 c 13 67
#mknod /dev/input/input4 c 13 68
#mknod /dev/i2c-0 c 89 0
#mknod /dev/i2c-1 c 89 1
Poking around i figured out the touchscreen and stuff.
input0 = Hid Ofn
input1 = Touchscreen
input2 = Sensor
input3 = Keypad
input4 = Handset
After the installation there will be a lot of downloaded packages in /var/cache/apt/archives/. You can free up some diskspace by running:
apt-get clean
I then created a small script to drop into GNU/Linux a bit easier, note the path of the modules.
Code:
su &
if test -e /mnt/sdcard/arm-linux/linux/bin/bash # or /sdcard2/bin/ if your using a partition
then
echo "Already mounted."
else
busybox insmod /mnt/sdcard/arm-linux/s7/jbd.ko
busybox insmod /mnt/sdcard/arm-linux/s7/ext3.ko
busybox insmod /mnt/sdcard/arm-linux/s7/jbd2.ko
busybox insmod /mnt/sdcard/arm-linux/s7/ext4.ko
# For loopback image
mknod /dev/block/loop255 b 7 255
busybox losetup arm-linux.img /dev/block/loop255
mount -o rw,noatime -t ext2,3 or 4 /dev/block/loop255 /sdcard2
# For partition
mount -o rw,noatime -t ext2,3 or 4 /dev/block/vold/179:2 /sdcard2
fi
export bin=/sdcard2/bin/ # or /mnt/sdcard/arm-linux/linux if your using an image
export PATH=$bin:/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:$PATH
export TERM=linux
export HOME=/root
export SHELL=/bin/bash
# You can also do
#'setprop ctl.stop zygote & setprop ctl.stop media && chroot /sdcard2/ /bin/bash && setprop ctl.start zygote & setprop ctl.start media'
# This will kill the Android wm, start chroot, and once you quit return you to
# android, but that doens work in an android terminal, only via adb.
chroot /sdcard2 /bin/bash
This needs to be expanded with another script since you still need some mounts (sysfs devpts and proc), i just dropped them in the .bashrc file in /root for now.
Code:
if test -e /sys/class/graphics/fb0/uevent
then
echo "All sys mounts already mounted."
else
mount -a
#service hal start
hald --daemon=yes
service ssh start
fi
cd
For Xorg
I've compiled the MSM/QSD X11 drivers, which should provide "limited 3d acceleration, provided they works, here is the status of that so far:
http://threader.zapto.org/s7/dev/msm-drv/xf86-video-msm-6fd8528-gcc46-2-rgb-fix-accel-6.tar , Colour working, needs NoAccel on production kernel. With accel enabled on the production kernel, there are no errors shown when starting X as there were. But Lxde first appears, tjen the menu, taskbar, background, and the rest vanish in a puff of smoke, leaving only the pointer and which can be moved about corruption regions of the screen. This is because certain features were left out of the production kernel. Using the kernel provided in post #11, acceleration works!
You can always check http://threader.zapto.org/s7/dev/msm-drv/ and try out some of the others I've compiled and see if there are any speed issues, sources are also available.
Now to enter the X server, the first thing you really want to do is have your ssh server running and connect to it. You can start your xserver and have all resources devoted to it by having passed "setprop ctl.stop media & setprop ctl.stop zygote" to android in the ADB. Starting zygote again is merely a 'setprop ctl.start zygote & setprop ctl.start zygote'.
The HTC Dream is fairly similar to our device, similar as in its a QSD8x50 device, we should be able to borrow some of their work, this is probably optimized and should be fast, http://build.shr-project.org/shr-unstable/images/htcdream/ its good for reference anyway.
Some problems i ran into. # Outdated but leaving for reference.
When trying to ssh in, after a reboot, i got a rather nasty error.
PTY allocation request failed on channel 0
if present remove /dev/ptmx and do mknod /dev/ptmx c 5 2 then redo these mounts or make sure they are properly mounted.
mount -t devpts devpts /dev/pts
mount -t proc proc /proc
mount -t sysfs sysfs /sys
TIPS:
Install localepurge! This will save a lot of space!
Install a vncserver and try setting up an X session your happy with, i would recommend the use of lxde and openbox to minimize the memory footprint and to conserve space and ram as the s7's kernel is compiled without swap enabled (o,0).
Configure xorg.conf in /etc/X11/xorg.conf with the config i posted in #3 http://forum.xda-developers.com/showpost.php?p=14594464&postcount=3
Be sure to properly unmount the ext partition before you reboot your device! Especially ext2 partitions are prone to dataloss!!!!! Use "sync" as root atleast before exiting!
install matchbox-keyboard ( an onscreen keyboard )
Starting X11 was an oddball first few attempts! As the fbdev driver isn't really compatible with the qsd8250 gpu, it blanks out the screen and doesnt know how to revert it. With android still running, I experimented with startx -- :1 and stuff the xorg.conf but ended up using just startx and found that repeatedly pressing the power button (quite frantically) (once the screen blanked out), low and behold, the x session miraculously appeared! This was before i had even "thunk" about compiling the qsd msm driver and before the xf86-video-msm driver in wheezy Debian.
Congratulations, you should now have a fully working Debian install on your Huawei S7!
-------------------------------------------------------------------------------
Clean booting into the Debian partition!
Configure /etc/fstab: # Outdated , needs updating, see arm-linux.img
Code:
# /etc/fstab: static file system information.
#
# file system mount point type options dump pass
/dev/block/mmcblk0p2 / ext2 defaults 1 1
proc /proc proc defaults 0 0
/dev/mmcblk0p1 /media/sdcard vfat defaults 0 0
Add "/sbin/adbd &" to /etc/rc.local and make a symlink so adbd can find sh or bash. (NB, was unsuccessful in my attempts at this for unknown reasons, did not fight it to long.)
# mkdir -p /system/bin/
# ln -s /bin/bash /system/bin/sh
apt-get install wpasupplicant network-manager-gnome wireless-tools
mv /etc/init.d/udev /etc/init.d/dis for now, this is a showstopper.
Get fastboot http://developer.htc.com/adp.html
Grab the zImage
(s7 10x -- Self compiled kernel,with ext3-4,drm,alsa(hopefully,powermanagement etc. _TESTING_ONLY_ copy lib to / , System.map to /boot/ and add dhd.ko to /etc/modules run depmod somehow ) http://threader.zapto.org/s7/kernel/2.6.32.9-ideos-fs-snd-drm-sane-5.tar.bz2
(s7 101 -- stock rom image ) http://threader.zapto.org/s7/rom/extracted/output-brazil/kern/zImage
(s7 other then 101 -- stock rom image ) http://threader.zapto.org/s7/rom/extracted/output/zImage
Configure the network:
To configure the network we need to copy a module from android dhd.ko from /lib/modules/ to /lib/modules/2.6.32.9-ideos/kernel/ and create an entry in /lib/modules/2.6.32.9-ideos/modules.dep kernel/dhd.ko: then run depmod -a from within Debian and add dhd to /etc/modules
Boot Debian:
Put the device into fastboot mode
$ adb reboot bootloader
The '-c' flag specifies arguments to pass to the kernel for boot.
This is probably the bare minimum.
Format is "fastboot -c 'kernelcmdline' boot zImage"
fastboot -c 'root=/dev/mmcblk0p2 rw rootfs=ext2 init=/sbin/init rootwait noinitrd' boot zImage
Please help feed my Linux addiction! Go to http://threader.zapto.org and click Donate!
TODO:
Clean boot from the Debian partition using fastboot.- DONE
Compile the codeaurora.org MSM/QSD X11 drv - DONE
Compile a sane kernel, with all the features you'd expect from a Linux kernel - DONE
Create a boot image with the new kernel compatible with the S7 101-105 possibly 201(slim) capable of booting Android and Linux, either from an early boot menu or using chroot. (WIP)
Hack up an existing rom, or compile 2.3.7 and make a complete solution. (TBA)
Stop playing Angry Birds, Dragon, FLY! XConstruct, Finger physics and Skies Of Glory when i should be doing this! - NEARLY ALMOST MOSTLY COMPLETELY DONE(ish) ;Þ
References & useful stuff! This would never have been possible in this short of a time if it weren't for these excellent posts. (Woaw, i sounded so optimistic in june 2011. The initial work was quick, over half a year later though im still not done! "Just gotta fix that last little ting before... Hey! i discover another little thing ...!
http://www.saurik.com/id/10
http://www.debian.org/releases/stable/i386/apds03.html
http://www.irregular-expression.com/?p=30
forum.xda-developers.com/archive/index.php/t-830077.html
http://forum.xda-developers.com/archive/index.php/t-830077.html
For development
git clone git://codeaurora.org/kernel/msm.git android-msm-2.6.32
https://www.codeaurora.org/gitweb/quic/xwin/
https://www.codeaurora.org/gitweb/quic/xwin/?p=xf86-video-msm.git;a=shortlog;h=refs/heads/chromium
http://gitorious.org/htc-msm-2-6-32...d65936b8bbc8708f352719/include/drm/kgsl_drm.h
https://github.com/tmzt/androix-xserver
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
/etc/X11/xorg.conf
Code:
Section "Device"
Identifier "msm"
# For MSM/QSD X11
Driver "msm"
Option "fb" "/dev/fb0"
# For fbdev
# Driver "fbdev"
# Option "ShadowFB" "on"
# Option "Rotate" "CW"
# for MSM/QSD X11
Option "NoAccel" "true"
# Option "SWBlit" "true"
EndSection
Section "Screen"
Identifier "Framebuffer"
# Device "fbdev"
Device "msm"
Monitor "Monitor"
# DefaultFbBpp 24
SubSection "Display"
# Depth 24
Modes "800x480"
EndSubSection
EndSection
Section "ServerLayout"
Identifier "Builtin Default Layout"
Screen "Framebuffer"
# InputDevice "Trackball" "CorePointer" # Reserved for buttons .
InputDevice "Touchscreen" "CorePointer"
InputDevice "Keyboard" "CoreKeyboard"
EndSection
Section "InputDevice"
Identifier "Touchscreen"
Driver "evdev"
Option "Device" "/dev/input/input1"
# Option "ScreenNumber" "0"
Option "ReportingMode" "Raw"
Option "ReportingMode" "Scaled"
Option "ButtonNumber" "1"
Option "SendCoreEvents"
EndSection
Section "InputDevice"
Identifier "Keyboard"
Driver "kbd"
# Option "XkbLayout" "en_US"
EndSection
This is Debian running cleanly from without the chroot environment
After doing some debugging from within chroot and Android, without the /etc/xorg.conf doing a startx -- :1 and repeatedly pressing the power button (quite frantically) (once the screen blanked out) the x session miraculously appeared! But i couldn't use it since it didn't know of a pointer device.
I managed today to configure the touchsreen correctly, i can now use xfce and x11 from within chroot in android ,but ironically enough im unable to get it up (phun intended) in a clean boot at all, here im using matchbox-keyboard
zImage
Hello,
the links about zImage
Grab the zImage link(s7 101) link (s7 other then 101 dont know why this is 2 megs! and the other 1.4)
are broken.
Can you share zImage again?
Best regards and thanx for great work
Hi!
I've extract kernel using guide: HOWTO: Unpack, Edit, and Re-Pack Boot Images on android-dls.com/wiki/.
but at the end, i've have problems in dhd module. Can't modprobe without error at linux boot.
Now trying to run ubuntu 11.04. Installing "ubuntu-desktop" packages in chroot
santiagax99 said:
Hi!
I've extract kernel using guide: HOWTO: Unpack, Edit, and Re-Pack Boot Images on android-dls.com/wiki/.
but at the end, i've have problems in dhd module. Can't modprobe without error at linux boot.
Now trying to run ubuntu 11.04. Installing "ubuntu-desktop" packages in chroot
Click to expand...
Click to collapse
Hey, good stuff, use whatever kernel from whatever rom absolutely works on your droid.
It's also dawned on me there most probably might be an issue with the port of the x11 driver, thankfully i still have everything.
http://threader.zapto.org/ - im guessing everything i used is there, if i find more i'll put it up, if its down try again later. I also added a donate button to help feed my Linux addiction =)
The dhd.ko is here - http://threader.zapto.org/s7/rom/extracted/output/sys/lib/modules/dhd.ko
Also Ubuntu is a memory hungry beast, i would recommend Debian 6.0x/squeeze lxde+xfce.
Hi, how it's going with TODO:
Stop playing angrybirds, xconstruct and skies of glory when i should be doing this!
?
=)
installing Ubuntu fails because of my lazy =(
now i get some free time and trying to get working debian queeze on my S7.
I'll report back after finish.
---------- Post added at 03:22 PM ---------- Previous post was at 03:20 PM ----------
Also i think it's good idea to share complete image of partition with linux. Installing all packages on S7 takes much time =)
Hey,
Quite time consuming yes, and fiddly.
I was planning on sharing an image, but i had planned on having it a bit more complete and polished first. That just didn't happen however. But today i cleaned up http://threader.zapto.org and added an image of the partition. And got a fresh breath of motivation.
The image is 2.1 GB. If you write it to a partition, it needs to be equal to or greater then the image you write or you risk trashing the next partition or just failing to complete the write, i guess.
However, you can use a loop device Use the last available loop device, mknod /dev/block/loop255 b 7 255 to avoid conflict, and to mount the image using losetup /dev/block/loop255 s7-linux.img && mount -o noatime -t ext2 /dev/block/loop255 /sdcard2 . Do sync as root before rebooting.
http://threader.zapto.org/s7
http://shell.consolegfx.net/s7-linux.img.bz2 # Outdated - see post #11 or http://threader.zapto.org/arm-linux.tar.bz2
md5sum s7-linux.img
275b2fe0bbe0172910933e583835164c s7-linux.img
-rw-r--r-- 1 root root 2169503744 Nov 19 17:49 s7-linux.img
Password for root is root .
Now, i wont be working too much more on the fastboot approach, carrying around a pc to boot linux on the tablet just isnt practical at all. And i really need to have usb host confirmed and working. I have made progress on starting X11 cleanly. My current method of "setprop ctl.stop media & setprop ctl.stop zygote && chroot /mnt/sdcard/linux/ /bin/bash && setprop ctl.start media & setprop ctl.start zygote" works great from adb, but will fail in an android terminal emulator instantly restarting zygote as it quits the terminal app.
I also compiled some kernel modules and put up, mainly ext3 & 4, fuse, msdos, ntfs, but eventually some other goodies. Check http://threader.zapto.org/s7/modules/. None of these are included currently, and wont be until i upload a future version. That will be ext3, which hopefully wont be too far off, and i can already tell you it will include some substantial changes. It should also be infinently more usable, even for those that havent spent some 10+ years on linux. It would definitively be cool if i could releasing something with Digital video usb dongle support, wouldn't it?
Cheers!
-Mike
Btw. here's the next image running on the s7, as you can see there were some problems with the x11 driver, but i managed to fix that a bit so this is now working, but still Option "NoAccel". I can also report that even firefox 3.5 is running surprisingly smoothly. Over the next few days i will be working on the x11 driver and then internal gsm modem and bluetooth.
Driver working with Red and Blue switched:
Tada! Fixed driver!
Thanks where thanks are due must be given to Visor and Hydro for helping with hosting "o'huge ass image file" and such! Thanks!
KERNEL 'UPDATE!: :
--------------------------
I managed to find time to fix and compile the kernel! The new kernel boasts plenty of improvements over the stock kernel, most noticeably ext3-4 built in, drm, alsa, swap, some experimental features enabled like a new scheduler for the usb, and switch to the no-op scheduler, also a feature that could let us change kernels "mid flight", hopefully, with kexec. Added some fpu related optimizations. I was unable to get it booting with a newer compiler for now though, so its still soft-float. This kernel is half the size, or even less as debug symbols are disabled. The old kernel crawled to 7mb's , this is 3.3.
http://threader.zapto.org/s7/kernel/2.6.32.9-ideos-fs-snd-drm-sane-5.tar.bz2
Usage:
Take the tools folder from the tar.bz2 and copy it somewhere, preferably your home directory (as google sdk binaries are picky little pricks) extract the above archive and put zimage into the tools directory:
adb reboot fastboot
Kernel with modules, http://threader.zapto.org/s7/kernel/2.6.32.9-ideos-fs-snd-drm-sane-5.tar.bz2
Ramdisk extracted from stock bootrom: http://threader.zapto.org/s7/kernel/boot.img-ramdisk.gz
Extract 2.6.32.9-ideos-fs-snd-drm-sane-5.tar.bz2 somewhere on your machine, zImage is inside there.
Dont extract boot.img-ramdisk.gz
For booting Android:
Code:
fastboot -c 'console=ttyMSM2,115200n8 androidboot.hardware=qsd8k_s7' boot /path/to/2.6.32.9-ideos-fs-snd-drm-sane-5/zImage /path/to/boot.img-ramdisk.gz
For booting into linux (mmcblk0p2 is the device node for the second partition created on the 8gb internal sdcard, use mmcblk1p1 or 1p2 for external sdcard):
Code:
fastboot -c 'root=/dev/mmcblk0p2 rw rootfs=ext3 init=/sbin/init rootwait noinitrd' boot zImage
Thanks where thanks are due must be given to -ZEROsignal-. Visor and Hydro, for helping with hosting "o'huge ass image file" and such! Thanks!
Aosp 2.3.7 available for modders and powerusers!
Code:
experimental/aosp2.3/s7/README
Experimetnal build of gingerbread for the s7
Notes:
The build is 2G split, (vmsplit 2g), so given that a given library is compatible
these can be exchanged from 2.2 .
Its still software rendering via pixelflinger.
OpenGL works.
Notes on Wifi and Bluetooth, bcm4329 chipset.
An updated kernel driver, is included in /system/modules (bcm4329.ko).
I have however not come as far as to implement it properly, as i am currently fo
cused on the graphics bit.
Notes on graphics, gralloc-qsd8k has been fixed. Which meant updating the kernel
pmem driver a bit to accomodate this change.
renderscript (libRS and librs_ something ) crashes. Probably due to pixelflinger
Im sure a rom modder could have this rom running smoothly using the huawei 2.2 l
ibraries and such, and dhd.ko. Also delete /system/app/Provision.apk as this prevents booting!
Notes on boot.img:
The ramdisk content might be wrong! I might have copieid the wrong boot.img befo
re i left! This will get fixed.
And so it has, boot.img-dead is the old dead one, boot.img is the working one.
Directory structure named after build date
Cheers
-mike aka threader
Also arm-linux0.7 is shaping up, this is still an early version where i change a lot in preparation for a more general solution to publish on the google.code page.
Were now using freedreno x11 driver, which works well in chroot but doesnt work if you boot linux normally, the old msm-x11 driver works for this purpose.
I improved rendering alot, but still pixelflinger....it also appears that i introduced some rendering artefacts, these are however minimal.
http://code.google.com/p/lrfa/downloads/detail?name=system.img.bz2&can=2&q=
boot.img still on http://threader.zapto.org/experimental .
.
Hi! how's it going? what's new? long time no updates. Is there any success in running Linux? I would like to move to Linux as the primary operating system.
Hey.
Not much, still occasionally working to port the Codeaura Adreno GPU driver to the huawei kernel, which is a **** because of the version screweup which is the huawei kernel. Other then that there has been no news on the Android Gingerbread front since i last published http://threader.zapto.org/experimental/aosp2.3/s7/021212/ , which fixed audio and found a bug in the MDP which resulted in less glitching when fixed.
New kernel up on http://threader.zapto.org/experimental/s7/kernels/
Incomplete change list off the top of my head:
Patched from 2.6.32.9 to 2.6.32.60
Asturals msm kgsl with the following changes
- fixed kgsl_drm_init(null) which caused a kernel panic in older kgsl.
- patched exploit in kgsl
gcc 4.7 compatible - updated assembly.
clock code taken from 2.6.38.
AVS from 2.6.38
DRM from 2.6.38
Added memblock. Genalloc. Genlock.
Redone board file. (use board-qsd8x50-s7.c-full for full functionality)
msm-fb updated. Lcdc. Etc.
Retouched msm_battery-s7
and probably lots more.
Known bugs:
TBA ( TO BE ANSWERED )
Source : http://threader.zapto.org/experimental/s7/kernels/source/kernel-ideos-experimental-2.6.32.60.tar.bz2
Binary: http://threader.zapto.org/experimen...l-ideos-experimental-2.6.32.60/zimage-2gsplit
Happy hacking!
Hi threader, great work, will try and tell you how it goes.
One question have you tryied to move to 2.6.38 ?
cant we patch the 2.6.38 kernel with files we may need from 2.6.32 ?
hal_2000
Hey Hal.
Likewise
Still fixing some minor bugs, re-worked the board-qsd8x50-s7 file again to make dhd happy, and found a hw def that makes anything we compile think its a 8250. Tell me, is it the 103 or 20x that uses the 8250? I think that code should be moved to the board file.
I've been trying to move to 2.6.38, but i cant get it booting for some reason, i've actually got two 2.6.38 kernels i've been working on, neither give as much as a bleep. The one up in s7/experimental/ has everything it needs to boot, i think. I backported the board-qsd8x50.c file to the 2.6.32 kernel trying to rule that out, and thats whats in use there.. But its pretty hard to debug when i have no frame of reference (console output or anything).
Cheers
-Mike
hal_2000 said:
Hi threader, great work, will try and tell you how it goes.
One question have you tryied to move to 2.6.38 ?
cant we patch the 2.6.38 kernel with files we may need from 2.6.32 ?
hal_2000
Click to expand...
Click to collapse
Hi, i pick up the zimage file and make a boot.img file, it boot up the rom fusion but touch screen did not work and menu and home key also did not work.
Then used your kernel sources to try to compile a kernel for cm9 and it did not work, it hang at boot, i have a s7 model 105.
If you need more tests let me know.
as far i know que s7-10x uses a qsd8k board type and a cpu qualcomm snapdragon qsd8250 at 998Mhz, the 20x uses a diferent cpu. That why it uses diferent kernels, and i think there is more diference in hardware.
hal_2000

[HELP] HTC One max Dump mmcblk0

I have european version t6 16gb. Can someone give me a mmcblk0 dump, i have brick my phone hard, service center can't help. I think the dump, you can to make so
( i found this instruction on ru thread, but nobody has uploaded a dump
In general, you first need to put the Root and Busybox Pro. Then observe and record Root explorer path where installed. It so happens that is placed in / system / bin / busybox and sometimes in the / system / xbin / busybox. Then download Cygwin start the installation, specify the installation path C: \ cygwin64
Further, during the installation himself appears the list of packages in which it is necessary to select the following items:
- In paragraph Devel all sub-items whose name begins with the letters gcc (they go in a row = 10 pieces)
- In paragraph Debug sub pv-debugininfo
- In paragraph Utils sub pv
Download the add-on for Cygwin, which is called Netcat here:
unzip all the files in the directory C: \ cygwin. The main thing that would be located in the archive, in the bin folder, file nc.exe
move to the folder C: \ cygwin \ bin. I took the version 1.12 Then download the ADB
Unpack the archive in the folder C: \ cygwin \ bin in the folder C: \ cygwin create a folder called, for example, the VHD.
Download the file VHDtool.exe https: //drive.google.c...hGeEE/view usp = sharing?
Copy it into the folder C: \ cygwin \ VHD This initial training is completed.
Connect your phone to a computer and run Cygwin.bat
Next, enter the following text line by line (Note:
In order to avoid being tortured on the clave, you can copy-paste to copy this sdes line and Cygwin-e klatsat on cap
window, right-click - edit - paste)
adb forward tcp: 5555 tcp: 5555
adb shell
su
/ System / xbin / busybox nc -l -p 5555 -e / system / xbin / busybox dd if = / dev / block / mmcblk0 (and here we must remember where
busybox installed in xbin or bin, which should be the correct.)
This window does not close.
Open another Cygwin terminal (Cygwin.bat) and enter:
adb forward tcp: 5555 tcp: 5555
cd / VHD
nc64 127.0.0.1 5555 | pv -i 0.5> mmcblk0.img
replace 127.0.0.1 ip phone on the network (if connected on Wi-Faya look at the connection properties)
Note: Look carefully at the command input terminal. Sometimes when copying slips such prefix: [Gi EEE should be washed.
After all this is completed will dump up in the folder C: \ cygwin \ VHD. File mmcblk0.img if it enters the 9008 port to write to a micro SD program (run as administrator)
Recording to a USB flash drive. Further instructions on the USB flash drive and then the computer can be formatnut a normal file system only on Linux or formatnut on the phone. Wind will not see her.

Porting LineageOS 14 to SM-A310F: Tutorial for building from source

Hi,
I tried porting LinageOS 14 to the Samsung Galaxy A3(2016) SM-A310F and this is a summary of my endeavors. The end result will be a flashabel .zip-file, also called OTA-package. I should say, that the resulting image does not yet boot!
There is little information on how to exactly port LineageOS to a new device, so I had to read a bit:
https : // source . android . com / source/ initializing . html
http : // web . archive . org /web / 2 0161224192644 / https :// wiki . cyanogenmod . org / w / Doc:_porting_intro
http : // web . archive . org / web / 20161224194055 / https : // wiki . cyanogenmod . org / w /Local_manifest
http : // wiki . lineageos . org / devices/ hero2lte /build
http : // www . trcompu . com / MySmartPhone / AndroidKitchen / Breakfast -Brunch -Lunch . html
http : // wiki . lineageos . org /signing_builds . html # generating-and-signing -target-files.
We start with installing TWRP onto our phone and rooting it afterwards. Now we look around and inspect the partition layout. The following command are run on the device with the help of adb (sudo apt-get install adb):
Code:
adb shell
su
[email protected]:/ # ls -al /dev/block/platform/13540000.dwmmc0/by-name/
lrwxrwxrwx root root 2017-03-06 17:48 BOOT -> /dev/block/mmcblk0p10
lrwxrwxrwx root root 2017-03-06 17:48 BOTA0 -> /dev/block/mmcblk0p1
lrwxrwxrwx root root 2017-03-06 17:48 BOTA1 -> /dev/block/mmcblk0p2
lrwxrwxrwx root root 2017-03-06 17:48 CACHE -> /dev/block/mmcblk0p21
lrwxrwxrwx root root 2017-03-06 17:48 CARRIER -> /dev/block/mmcblk0p8
lrwxrwxrwx root root 2017-03-06 17:48 CDMA-RADIO -> /dev/block/mmcblk0p13
lrwxrwxrwx root root 2017-03-06 17:48 CPEFS -> /dev/block/mmcblk0p4
lrwxrwxrwx root root 2017-03-06 17:48 DNT -> /dev/block/mmcblk0p16
lrwxrwxrwx root root 2017-03-06 17:48 EFS -> /dev/block/mmcblk0p3
lrwxrwxrwx root root 2017-03-06 17:48 HIDDEN -> /dev/block/mmcblk0p22
lrwxrwxrwx root root 2017-03-06 17:48 OTA -> /dev/block/mmcblk0p12
lrwxrwxrwx root root 2017-03-06 17:48 PARAM -> /dev/block/mmcblk0p9
lrwxrwxrwx root root 2017-03-06 17:48 PERSDATA -> /dev/block/mmcblk0p18
lrwxrwxrwx root root 2017-03-06 17:48 PERSISTENT -> /dev/block/mmcblk0p17
lrwxrwxrwx root root 2017-03-06 17:48 RADIO -> /dev/block/mmcblk0p14
lrwxrwxrwx root root 2017-03-06 17:48 RECOVERY -> /dev/block/mmcblk0p11
lrwxrwxrwx root root 2017-03-06 17:48 RESERVED2 -> /dev/block/mmcblk0p19
lrwxrwxrwx root root 2017-03-06 17:48 SYSTEM -> /dev/block/mmcblk0p20
lrwxrwxrwx root root 2017-03-06 17:48 TOMBSTONES -> /dev/block/mmcblk0p15
lrwxrwxrwx root root 2017-03-06 17:48 USERDATA -> /dev/block/mmcblk0p23
lrwxrwxrwx root root 2017-03-06 17:48 m9kefs1 -> /dev/block/mmcblk0p5
lrwxrwxrwx root root 2017-03-06 17:48 m9kefs2 -> /dev/block/mmcblk0p6
lrwxrwxrwx root root 2017-03-06 17:48 m9kefs3 -> /dev/block/mmcblk0p7
Also, take note of the CPU
Code:
[email protected]:/ # cat /proc/c
cgroups cmdline consoles cpuinfo crypto
[email protected]:/ # cat /proc/cpuinfo
Processor : AArch64 Processor rev 3 (aarch64)
processor : 0
Features : fp asimd aes pmull sha1 sha2 crc32 wp half thumb fastmult vfp edsp neon vfpv3 tlsi vfpv4 idiva idivt
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 3
Hardware : SAMSUNG Exynos7580
We also need to find the block-size:
Code:
[email protected]:/ # df -k
This will tell us 4.0 K block size.
Note: if you install parted on the device it will tell you:
Model: MMC AJNB3R (sd/mmc)
Disk /dev/block/mmcblk0: 15758000128B
Sector size (logical/physical): 512B/512B
Partition Table: gpt
I started with a fresh install of Ubuntu 14.04 LTS 64-Bit, as described by Google. If you use some newer Ubuntu, there may be some problems with packages. I did not suceed with e.g. 16.10.
Install some basic packages:
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \
lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache \
libgl1-mesa-dev libxml2-utils xsltproc unzip
Install LinageOS packages:
Code:
sudo apt-get install bc bison build-essential curl flex g++-multilib gcc-multilib git gnupg gperf imagemagick lib32ncurses5-dev lib32readline-gplv2-dev lib32z1-dev libesd0-dev liblz4-tool libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop openssl-dev pngcrush rsync schedtool squashfs-tools xsltproc zip zlib1g-dev
Install OpenJDK-8 (remove openjdk-7 first!)
Code:
sudo apt-get autoremove openjdk-7-jre
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-8-jdk
Download the repo command
replace XXXX with https : // storage.googleapis.
Code:
curl XXXXcom/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
Prepare you bash environment:
Edit the file ~/.profile (it is a hidden file in your home directory). You can make it visible in the Ubuntu file manager (called Nautilus) by pressing CTR+H.
Add this to the end of the file.
Code:
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
export USE_CCACHE=1
export ANDROID_JACK_VM_ARGS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx8G"
The last line will increase the memory for the build process with 'jack'. If the size -Xmx8G is too small (here 8 gigabytes), the build process will fail.
Restart you terminal window for the changes to take effect, or run
Code:
source ~/.profile
Download LineageOS
Preparation
replace XXX with https : // github.com
Code:
mkdir -p ~/bin
mkdir -p ~/android/lineage
cd ~/android/lineage
repo init -u XXX/LineageOS/android.git -b cm-14.1
Start the download with:
Code:
repo sync
If it fails, just start it again. This will be several Gbs and take a few hours.
If everything goes well, we can download some more files specific to our device a3xelte. We are lucky and there is already some GitHub-Repository Exynos 7580 with device-specific code, I think maintained by aapav01.
Create or open the file android/lineage/.repo/local_manifests/roomservice.xml.
Replace it with the following content and save the file:
Code:
<manifest>
<project name="Exynos7580/android_device_samsung_a3xeltexx" path="device/samsung/a3xeltexx" remote="github" revision="cm-14.1"/>
<project name="Exynos7580/android_device_samsung_exynos7580-common" path="device/samsung/exynos7580-common" remote="github" revision="cm-14.1"/>
<project name="Exynos7580/android_vendor_samsung_a3xeltexx" path="vendor/samsung/a3xeltexx" remote="github" revision="cm-14.1"/>
<project name="LineageOS/android_hardware_samsung_slsi-cm_exynos5" path="hardware/samsung_slsi-cm/exynos5" remote="github" revision="cm-14.1"/><project name="Exynos7580/android_hardware_samsung_slsi-cm_exynos7580" path="hardware/samsung_slsi-cm/exynos7580" remote="github" revision="cm-14.1"/>
<project name="LineageOS/android_external_stlport" path="external/stlport" remote="github"/>
<project name="LineageOS/android_hardware_samsung" path="hardware/samsung" remote="github"/>
<project name="LineageOS/android_hardware_samsung_slsi-cm_exynos" path="hardware/samsung_slsi-cm/exynos" remote="github"/><project name="LineageOS/android_hardware_samsung_slsi-cm_openmax" path="hardware/samsung_slsi-cm/openmax" remote="github"/>
</manifest>
Run the repo synch command again in the root of the LinageOS folder:
Code:
cd ~/android/lineage
repo sync
I should mention, that there is a repository https : // github . com / Exynos7580/android_kernel_samsung_a3xelte, but I did not use that. You could try to use this, if it will give you better results.
I instead, choose to try to use the raw Samsung kernel source. To do that, got to http :/ opensource. samsung . com/reception .do and type 'SM-A310F' in the search box. I choose to download the Android 6.0.1 files SM-A310F_MEA_MM_Opensource.zip
Extract it to some place, extract again resulting the Kernel.tar.gz.
Create the directory ~/android/lineage/kernel/samsung/ and copy the just extracted 'kernel'-directory to it. Rename the directory to a3xeltexx, so that you now have the kernel in ~/android/lineage/kernel/samsung/a3xeltexx.
Edit the device properties
go to device/samsung/a3xeltexx
and edit the files BoardConfig.mk and lineage.mk to your liking and do the same with /device/samsung/exynos7580-common/BoardConfigCommon.mk.
I don't know what the right values are, but for example, I set the number of SIM-cards to match my phone:
Code:
SIM_COUNT := 1
Also adjust the name of the kernel configuration file.
I should mention that for the SM-A310F the following values are defined in the original build.prop, and therefore this device should be called 'a3xelte' instead of 'a3xeltexx' according to the LineageOS nomenclature rules. But I did not yet change all the directroy names. That is left to when the image will boot up.
Code:
ro.product.model=SM-A310F
ro.product.brand=samsung
ro.product.name=a3xeltexx
ro.product.device=a3xelte
ro.product.board=universal7580
Extract proprietary blobs
I choose to extract the binary blobs from running phone, not a firmware image. To do so, you need have a rooted phone with adb debug enabled and granted adb root permission.
I needed to edit the file ~/android/lineage/device/samsung/a3xeltexx/extract-files.sh to look like this
Code:
...
if [ "$SRC" = "adb" ]; then
echo $DEST
set +e
# Try CM target first
adb pull /system/$DEST $2/$DEST
# if file does not exist try OEM target
if [ "$?" != "0" ]; then
echo "Try using OEM target"
adb pull /system/$FILE $2/$DEST
fi
set -e
if [ ! -f $2/$DEST ]; then
echo "File not yet copied -> try as root!"
adb shell mkdir -p /sdcard/tmp
adb shell mkdir -p /sdcard/tmp/$DIR
echo "Copy to temp location"
adb shell su -c "cp /system/$FILE /sdcard/tmp/$FILE"
adb pull /sdcard/tmp/$FILE $2/$DEST
adb shell rm /sdcard/tmp/$FILE
adb shell rm /sdcard/tmp/$DIR
fi
...
then run
Code:
cd ~/android/lineage/device/samsung/a3xeltexx
./extract-files.sh
Fix build-problems
The kernel will not build successfully right now, but we can help it compile, if we create a bunch of empty directories. Must be done after each cleaning of the build tree.
Create a new file ~/android/linage/cerres-prepare-kernel.sh and paste the following lines
Code:
mkdir -p out/target/product/a3xeltexx/obj/KERNEL_OBJ/security/tima_uevent
mkdir -p out/target/product/a3xeltexx/obj/KERNEL_OBJ/drivers/gud/gud-exynos7580/MobiCoreDriver/platforms
mkdir -p out/target/product/a3xeltexx/obj/KERNEL_OBJ/drivers/gud/gud-exynos7580/MobiCoreDriver/platforms/EXYNOS_7580_STD
mkdir -p out/target/product/a3xeltexx/obj/KERNEL_OBJ/firmware/tsp_synaptics
mkdir -p out/target/product/a3xeltexx/obj/KERNEL_OBJ/firmware/tsp_atmel
mkdir -p out/target/product/a3xeltexx/obj/KERNEL_OBJ/firmware/tsp_stm
mkdir -p out/target/product/a3xeltexx/obj/KERNEL_OBJ/drivers/media/platform/exynos/fimc-is2/hardware/api
mkdir -p out/target/product/a3xeltexx/obj/KERNEL_OBJ/drivers/muic/universal
make it executable and run it:
Code:
cd ~/android/lineage
chmod a+x cerres-prepare-kernel.sh
./cerres-prepare-kernel.sh
Fix include errors
For some reason, unknown to me, some required header files are not copied to out/target/product/a3xeltexx/obj/KERNEL_OBJ/usr/include.
Go to kernel/samsung/a3xeltexx/include/uapi/linux and find the files
Code:
videodev2_exynos_camera.h
videodev2_exynos_camera_ext.h
videodev2_exynos_media.h
and copy them to these newly created directories:
Code:
~/android/lineage/hardware/samsung_slsi-cm/exynos/include/linux
~/android/lineage/hardware/samsung_slsi-cm/exynos5/include/linux
To start building type:
Code:
cd ~/android/lineage
. build/envsetup.sh
lunch lineage_a3xeltexx-userdebug
mka target-files-package dist
The build will run now for several hours. For my machine, with only 4GB of ram this will take around 24 hours. Also, the mka command uses too many threads for me (the build script would loose connection to the jack server), so I had to reduce the number of threads by editing the file /home/cerres/android/system/vendor/cm/build/envsetup.sh (look for the make command!)
Generating the flashable zip-package
Create key-pairs for your own use:
Code:
subject='/C=US/ST=California/L=Mountain View/O=Android/OU=Android/CN=Android/[email protected]'
mkdir ~/.android-certs
for x in releasekey platform shared media; do \
./development/tools/make_key ~/.android-certs/$x "$subject"; \
done
Sign the target files:
Code:
cd ~/android/lineage
croot
./build/tools/releasetools/sign_target_files_apks -o -d ~/.android-certs \
out/dist/*-target_files-*.zip \
out/dist/signed-target_files.zip
The signing doesn't currently work, because this error is generated:
Code:
ERROR: couldn't find ro.build.date.utc in build.prop
I'll have to figure out, how to fix that. However, we can create an OTA package from the unsigend target files. Just modify the file name accordingly.
And, finally, build the OTA-package:
Code:
./build/tools/releasetools/ota_from_target_files -k ~/.android-certs/releasekey \
--block --verbose --no_prereq \
out/dist/signed-target_files.zip \
out/signed-ota_update.zip
Copy the file out/signed-ota_update.zip to an extenal sd-card and flash it using TWRP -> boot loop.
Points for future improvements
To debug boot problems in the kernel ('boot-loop') it would be wise to enable logging in the kernel config:
Code:
CONFIG_PSTORE=y
CONFIG_PSTORE_CONSOLE=y
CONFIG_PSTORE_RAM=y
Try building with integrated root support
create a .sh file with the following content and run it before building:
Code:
export WITH_SU=true
Final remarks:
some problems could be due to the fact, that I'm trying to use the Samsung kernel for 6.0.1 with Android 7.0 (LineageOS 14).
I hope this post helps you getting started to play around with your own code-base.
We have a Lineage OS that boots up in the Development section. Maybe you could use that kernel? Cuz the only two major bugs i faced was the microphone not working properly and a deep sleep issue wherein the phone would not wake up if it wasnt used for a long while.
Why not try Lineage OS 13.x instead. I'm going to give this a shot on my build env
Can you send us the output ??
Thanks
Ok, I'll share my ROM, because it was requested.
Warning: This will not boot! It will cause a boot loop (aka. soft-brick)!
However, You can recover the device by flashing a good kernel-image like lineage-14.1-a3xeltex-patch-2.zip from the thread by @EmpireIsHere .
Ok, you have been warned, here is the link: https : //www . androidfilehost . com/?fid=673368273298945673
I think there is problem in the very early stages of the kernel bootloader process, but I don't know what goeswrong.
If anybody can give a hint, that would be very appreciated!
Cerres1 said:
Ok, I'll share my ROM, because it was requested.
Warning: This will not boot! It will cause a boot loop (aka. soft-brick)!
However, You can recover the device by flashing a good kernel-image like lineage-14.1-a3xeltex-patch-2.zip from the thread by @EmpireIsHere .
Ok, you have been warned, here is the link: https : //www . androidfilehost . com/?fid=673368273298945673
I think there is problem in the very early stages of the kernel bootloader process, but I don't know what goeswrong.
If anybody can give a hint, that would be very appreciated!
Click to expand...
Click to collapse
Now, if it boots, are there any things which are not working ?
if i understand you correctly, we can fix the "its not booting" by flashing the patch from alexax66
Edit:
tried it, its garbage
Cerres1 said:
Ok, I'll share my ROM, because it was requested.
Warning: This will not boot! It will cause a boot loop (aka. soft-brick)!
However, You can recover the device by flashing a good kernel-image like lineage-14.1-a3xeltex-patch-2.zip from the thread by @EmpireIsHere .
Ok, you have been warned, here is the link: https : //www . androidfilehost . com/?fid=673368273298945673
I think there is problem in the very early stages of the kernel bootloader process, but I don't know what goeswrong.
If anybody can give a hint, that would be very appreciated!
Click to expand...
Click to collapse
Ok, thanks
This kernel problem is very strange
Deleted

Ubuntu, Arch Linux, Tails on Acer Chromebook C720P & Asus CS10 Chromebook stick

placeholder
I will try & summarise all my works to install Linux distros on USB's or using crouton on Chromebooks...
Make sure you are in developer mode...
1. crouton
Download crouton in ~/Downloads
Useful command in Chrome/Chromium OS to install crouton Linux distro ubuntu xenial with xfce & xiwi in Acer Chromebook C720P
in a ctrl-alt-t shell -
shell
sudo sh ~/Downloads/crouton -r xenial -t xfce,xiwi,touch,extension
After running the command, one should get the following message (generally)
Here's some tips:
Audio from the chroot will now be forwarded to CRAS (Chromium OS audio server),
through an ALSA plugin.
Future Chromium OS upgrades may break compatibility with the installed version
of CRAS. Should this happen, simply update your chroot.
You already have the Chromium OS extension installed, so you're good to go!
You can open your running chroot desktops by clicking on the extension icon.
Once in a crouton window, press fullscreen or the "switch window" key to switch
back to Chromium OS.
You can launch individual apps in crouton windows by using the "xiwi" command
in the chroot shell. Use startxiwi to launch directly from the host shell.
Use the startxiwi parameter -b to run in the background.
Example: sudo startxiwi -b xterm
You can start Xfce via the startxfce4 host command: sudo startxfce4
Unmounting /mnt/stateful_partition/crouton/chroots/xenial...
Sending SIGTERM to processes under /mnt/stateful_partition/crouton/chroots/xenial...
Done! You can enter the chroot using enter-chroot.
( to use xiwi, you need to install the crouton extension from the Google Web Store).
Not re-inventing the wheel, head on for further info to:
Complete Crouton Installation Guide (Linux on any Chromebook):
https://www.codedonut.com/chromebook/install-crouton-chromebook/
& the dev's crouton's github:
https://github.com/dnschneid/crouton
In case the crouton chroot is already installed without xiwi,
To update an installation with xiwi, apply:
sudo sh ~/Downloads/crouton -n xenial -t xfce,xiwi,touch,extension -u
Notes:
cons -
with crouton one is stuck with the Chrome OS host Linux Kernel , which for Acer CB C720P is Kernel v3.8
it is a chroot environment, so new Ubunture features such as snap packaging cannot be used.
pros -
xiwi allows running Linux apps in separate windows
share of the clipboard & ~/Downloads folder between host & guest
one does not leave the Chrome OS environment
it is like the new crostini feature they are pushing on Kernel 3.18 & above
I think crostini is crouton in Italian
Chromebrew
All I have to say about skycocker's chromebrew -
For a full arsenal of Linux commands at your fingertips in a crosh shell, install Chromebrew package manager on Chromebook or Chrome OS -
requisites: developer mode enabled.
https://github.com/skycocker/chromebrew …
curl -Ls http://git.io/vddgY | bash
crew <command> [-k|--keep] <package1> ...]
Note -
sad but true, I installed chromebrew to get access to the nano text editor - as I have never made the effort to master vi/vim despite using Linux since 1995...
Tails Linux distro with Tor privacy
Tails is an operating system based on Linux & the Tor anonymity project.
It's easy to install on a USB, & very portable as it can boot off MBR & EFI partitions.
It's only available for x86 & x86_64 computers, though they are looking into porting it to Arm.
I got it on a USB following instructions in the developers website: https://tails.boum.org/
Tor browser on any computer, Linux, Mac, Windows, Android.
1. relevant to Chromebooks or hacked with Android & Play Store - Orbot / Orfox:
Tor anonymising solution is now available on Play Store - the Tor proxy is called Orbot & a web browser was compiled to run with it based on mozilla firefox called Orfox.
The set Orbot / Orfox are available to download for free from the Play Store -
I won't describe any of it -
Initially before it was on Play Store, it could be downloaded from the devs group who ported it to Android it: https://guardianproject.info/apps/orbot/
It was also made available through an open source Android Store: F-Droid - https://guardianproject.info/fdroid/
F-Droid is a great source for free open source alternative Android software - it works seamlessly through the Android platform or within proprietary Android based like Amazon Fire.
2. For other x86 platforms like Windows, Linux, Mac...
all is in here: https://www.torproject.org/
F-Droid - a great open source software repository for Android applications
Great way to complement Amazon Appstore, or Android Play Store is F-Droid -
a software repository for Android applications, similar to Google Play store.
The main repository, hosted by the project, contains only apps that are free and open-source software.
https://f-droid.org/en/
https://twitter.com/inabster/status/956226183477317633
F-Droid have a repository for a Tor powered solution on Android platform worthy to those concerned about privacy Orbot is the open source app, & Orfox is the associated Tor Mozilla based (Firefox fork) browser - https://guardianproject.info/apps/orbot/ https://guardianproject.info/apps/orfox/
https://twitter.com/inabster/status/956229034169520130
Ubuntu on Chromebook from USB.
Seabios emulates an mbr boot, so allows booting to mbr using Ctrl-L
Ubuntu then installs as normal to mbr using a Ubuntu livecd.
It might be possible to install Ubuntu so it boots using Ctrl-U. I did not look into it.
Arch Linux on Chromebook & Asus Chromebit CS10
Arch Linux on Asus Chromebit CS10 -
Full instructions here:
https://archlinuxarm.org/platforms/armv7/rockchip/asus-chromebit-cs10
Mainline Kernel
The installation above will use the ChromeOS 3.14 kernel. The mainline kernel can be used instead, though some hardware may not be working yet. Two options are available to switch to the mainline kernel:
Replace kernel packages after installation
Install linux-armv7 packages, replacing the linux-veyron package, and the firmware-veyron package:
pacman -S linux-armv7 linux-armv7-chromebook firmware-veyron
Type y and hit enter when prompted to flash the kernel to the kernel partition.
Remove the veyron-libgl and xf86-video-armsoc-rockchip packages. Mali is not supported in mainline.
pacman -R veyron-libgl xf86-video-armsoc-rockchip
Reboot.
Perform a new installation with the above steps using the armv7-chromebook tarball:
http://os.archlinuxarm.org/os/ArchLinuxARM-armv7-chromebook-latest.tar.gz
Install the firmware-veyron package, or copy it to the drive for later installation for wifi support.
pacman -S firmware-veyron
Arch Linux on Chromebook -
Easiest instructions to install Arch Linux on a USB of Chromebook in BIOS legacy mode here:
https://gist.github.com/alphazo/3285090
https://twitter.com/inabster/status/692098848391610372
General consideration on Linux installs with uefi - notes to self
These are notes to myself to link up to - I have posted them on @twitter - but nice to have them ready for copy & paste.
Not related to Chromebooks generally, unless one uses Ctrl-U which is an uefi boot... I did not dabble in it...
Two important config files to get a successful Arch Linux or Ubuntu boot are:
grub.cfg
fstab
fstab is in /etc/
/etc/fstab
& tells the OS where relevant partitions are
... TBC
Linux Kernel related building commands for reference...
Build Ubuntu Kernel
sudo apt-get install git fakeroot build-essential ncurses-dev xz-utils libssl-dev bc
clone git kernel for source in home user folder ~/kernel
cd kernel
cp /boot/config-$(uname -r) .config
make menuconfig
sudo make -j 4 && sudo make modules_install -j 4 && sudo make install -j 4
sudo update-initramfs -c -k 4.xx.xx
sudo update-grub .../...
also
build kernel headers from source with: (at root of kernel directory) -
sudo make headers_install INSTALL_HDR_PATH=/usr/include
Arch Linux 4.19-LTS & 5.0.8 nasty bug
Testing Arch Linux on Chromebook
Arch Linux 4.19-LTS & 5.0.8 nasty bug
but for those using Arch Linux, avoid kernel 4.19-LTS & 5.0.8 like the plague,
both damage Arch Linux by disabling usb input devices, trackpad, mouse, keybooard, touch...
I had to put my rant somewhere, it damaged a 3 year Arch Linux USB stick for me
Since I am here, might as well post for reference my experience with getting a new USB loaded with Arch Linux
not doing it from scratch, too much effort...
found this - quite good too, Live USB persistent -
Arch Linux USB OS https://sourceforge.net/projects/arch-linux-usb-os/ …
It saves the trouble of building Arch Linux OS from scratch.
Uses Kernel 5.0.5 -
Linux robot 5.0.5-arch1-1-ARCH #1 SMP PREEMPT Wed Mar 27 17:53:10 UTC 2019 x86_64 GNU/Linux
if allowed to upgrade to 5.0.8 will bork the input, so only upgrade to 5.0.7 maximum (linux-rt), which I built through aur.
upgrading through aur to linux-rt 5.0.7
$ uname -a
Linux robot 5.0.7-rt5-1-rt #1 SMP PREEMPT RT Mon Apr 22 14:42:29 CEST 2019 x86_64 GNU/Linux
to get to boot with this kernel needs to replace linux with linux-rt in loader settings.
to stop kernel from upgrading -
ArchLinux is updated to the newest version with the command:
pacman -Syu
To stop it from updating the kernel (until they get their **** together) add
IgnorePkg = linux linux-headers
into /etc/pacman.conf
stuff / thingies
[email protected] ~ $ cd /run/archiso/bootmnt
[email protected] bootmnt $ ls
arch EFI loader
[email protected] bootmnt $ ls arch/boot
amd-ucode.img grub intel-ucode.img intel_ucode.LICENSE x86_64
[email protected] bootmnt $ ls arch/boot/x86_64/
initramfs-linux.img initramfs-linux-rt.img vmlinuz-linux vmlinuz-linux-rt
notes -
original shipped linux version is 5.0.5
upgraded linux version though aur is linux-rt 5.0.7
so needed to copy vmlinuz-linux-rt & initramfs-linux-rt.img to /run/archiso/bootmnt/arch/boot/x86_64/
cannot be done from a running instance, so had to boot from another live usb to copy it over from
[email protected] bootmnt $ ls /boot
amd-ucode.img initramfs-linux-rt-fallback.img syslinux
grub initramfs-linux-rt.img vmlinuz-linux
initramfs-linux.img intel-ucode.img vmlinuz-linux-rt
to automate replace loading linux with linux-rt, modify
/run/archiso/bootmnt/loader/entries/
[email protected] entries $ ls
Archlinux.conf Archlinux-terminal.conf uefi-shell-v2-x86_64.conf
Archlinux-copytoram.conf uefi-shell-v1-x86_64.conf
example
Archlinux.conf original
title Arch Linux UEFI
linux /arch/boot/x86_64/vmlinuz-linux
initrd /arch/boot/intel-ucode.img
initrd /arch/boot/amd-ucode.img
initrd /arch/boot/x86_64/initramfs-linux.img
options archisobasedir=arch archisolabel=USB-BOOT cow_label=usb-save loglevel=3
change to:
title Arch Linux UEFI
linux /arch/boot/x86_64/vmlinuz-linux-rt
initrd /arch/boot/intel-ucode.img
initrd /arch/boot/amd-ucode.img
initrd /arch/boot/x86_64/initramfs-linux-rt.img
options archisobasedir=arch archisolabel=USB-BOOT cow_label=usb-save loglevel=3
to be able to modify bootloader files
do above from a separate linux usb (mine is Ubuntu 18.04)
$ mkdir efi
$ sudo mount /dev/sdb1 efi
$ cd efi
$ ls
arch EFI loader
... etc as above.
News - Arch Linux released Kernel 5.0.9 - still has the nasty bug - do not upgrade, if you did, downgrade by installing the downgrade script from aur...
How to downgrade a Linux kernel...
https://arcolinux.com/how-to-downgrade-a-linux-kernel/
Borking my 3 year arch linux USB was a blessing in disguise, made me look for a persistent USB alternative...
the one described above boots Acer Chromebook C720P well, it works great, with kernels 5.0.5 & 5.0.7 -
I tested it on the modded full ROM MrChromebox firmware, but believe it will work as well in Seabios legacy mode.
notes to myself
Linux pot-pourri commands from my notes, for reference
these are copy & paste commands which I need put into one place, here...
I will rearrange them later with context where to be used...
placeholder...
Chromebook: Updating xenial to bionic w/ crouton:
$ sudo enter-chroot -n xenial
(xenial)[email protected]:~$ sudo apt-get install update-manager-core python-apt
(xenial)[email protected]:~$ sudo do-release-upgrade
$ sudo sh ~/Downloads/crouton -n xenial -u
$ sudo edit-chroot xenial -m bionic
Creating a dev environment in all Chrome OS x86 or arm:
shell
sudo dev_install
Creating a Visual Studio environment in arm:
shell
sudo su -
. <( curl -s https://code.headmelted.com/installers/chromebook.sh … )
Creating a Ubuntu chroot & X-Windows environment:
sudo sh ~/Downloads/crouton -t xfce -r xenial
If using rEFInd as bootloader, a useful command to get entries at boot in the UEFI menu is:
$ sudo efibootmgr -c -g -d /dev/sda -p 1 -w -L "rEFInd" -l '\EFI\refind\refind_x64.efi'
replace /dev/sda by /dev/sdx x=b,c... in other cases.
To check install is correct, issue:
$ [ -d /sys/firmware/efi ] && echo "EFI boot on HDD" || echo "Legacy boot on HDD]
Sometimes needed
1.:
$ sudo apt-get install --reinstall efibootmgr
$ sudo grub-install /dev/sda
$ sudo apt-get install --reinstall grub-efi
$ sudo grub-install /boot/efi
$ sudo grub-install --target=i386-efi /dev/sda1 --efi-directory=/boot/efi/ --boot-directory=/boot
2.:
$ sudo grub-mkconfig -o /boot/grub/grub.cfg
then again:
$ sudo apt-get -y install --reinstall grub-efi-ia32 grub-efi-ia32-bin
@ubuntu 18.04.1 works with efi on @bbenTech Intel Compute Stick (ICS) cherrytrail clone & with mbr (seabios legacy) on @Acer Chromebook C720P.
Managed to get it to boot w/ efi 32bit bootlader - but I had to get into GUI 1st & bypass the initramfs emergency mode - what was needed was correct UUID of EFI partition in /etc/fstab - then boot through grub manually...
UUID=XXXX-XXXX /boot/efi vfat umask=0077 0 1
When in grub, issue
set root=(hd0,gpt2)
configfile (hd0,gpt1)/efi/ubuntu/grub.cfg
(grub.cfg must have the UUID of (hd0,gpt2) in my case of /dev/sdb2
use
sudo blkid /dev/sdX to find UUID's)
that boots into Ubuntu 18.04
open terminal...
When in the GUI
in terminal issue:
sudo apt-get update
sudo apt-get -y install --reinstall grub-efi-ia32 grub-efi-ia32-bin
reboot
Notes:
Arch Linux
$ sudo grub-install --target=i386-efi /dev/sda2 --efi-directory=/boot/efi/ --boot-directory=/boot
$ sudo efibootmgr -c -g -d /dev/sda -p 2 -w -L "Arch" -l '\EFI\EFI\arch\grubia32.efi'
then:
$ sudo grub-mkconfig -o /boot/EFI/EFI/arch/grub.cfg
$ sudo mkinitcpio -p linux
from http://www.rodsbooks.com/efi-bootloaders/installation.html#alternative-naming
Arch Linux mainline kernel
$ sudo mount -o remount,size=6G,noatime /tmp
$ yaourt linux-mainline
more crouton / crostini stuff
Latest crostini kernel is 4.19.16 -
for lolz I installed mplayer, mpv & gnome-mpv (all Linux video players)
they do load videos from crostini, but with no sound (this is using cyan & eve v73) -
of course video works great in crouton Linux distros... or in Android with VLC etc...
RFC - Any idea how to get sound working through crostini?
of course this is not needed as within Android or crouton with say Ubuntu bionic, sound is perfectly fine
just fooling around crostini
from - https://forum.xda-developers.com/showpost.php?p=79527257&postcount=215
crouton bionic sound issues -
add following to /etc/pulse/daemon.conf -
default-sample-rate = 48000
default-fragments = 5
default-fragment-size-msec = 2
Access audio hardware directly (ALSA, JACK)
add yourself to the hwaudio group.
sudo usermod -a -G hwaudio "$USER"
Log out and log back in.
Test:
$ groups
slee2 hwaudio video sudo plugdev audio input
Stop CRAS
Make sure you've stopped CRAS, or else it will hold on to your audio device. In either ChromeOS or your chroot, run
$ sudo initctl stop cras
You might also need this to control audio -
$ alsamixer -c 0
from - https://github.com/dnschneid/crouton/wiki/Access-audio-hardware-directly-(ALSA,-JACK)
& https://github.com/dnschneid/crouton/wiki/Audio
Reinstall GRUB to the EFI partition using chroot
Notes to self-
sudo mount /dev/sdXXX /mnt
sudo mount /dev/sdXX /mnt/boot/efi
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
sudo chroot /mnt
grub-install /dev/sdX
update-grub
Note : sdX = disk | sdXX = efi partition | sdXXX = system partition
To identify the partitions use GParted, the tool is included in the installation medium.
After having run the commands GRUB will be installed in the separate EFI partition.
Deploying, bootloading OSes such as Ubuntu manually
I like to initially install an OS to a 16/32 GB USB 3.0 stick, then dd it to a bigger SSD of I am happy with it, follows some notes on how it is done...
In previous post, I described how to fix an efi booting, but there is a caveat, one needs to know where & how to modify settings of efi bootlader, & /etc/fstab that tells the OS where to find partitions to load itself (bootstrap)...
These are some successful partition settings I had to deal with -
1. efi/mbr mix
$ sudo fdisk -l
Disk /dev/sdb: 465.8 GiB, 500107861504 bytes, 976773167 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 33553920 bytes
Disklabel type: gpt
Disk identifier: ***
Device Start End Sectors Size Type
/dev/sdb1 2048 411647 409600 200M EFI System
/dev/sdb2 411648 210208767 209797120 100G Microsoft basic data
/dev/sdb3 210415616 337403903 126988288 60.6G Linux filesystem
/dev/sdb4 337403904 430872575 93468672 44.6G Linux filesystem
/dev/sdb5 430872576 435066879 4194304 2G Linux swap
/dev/sdb6 435066880 624490495 189423616 90.3G Microsoft basic data
/dev/sdb7 624490496 976766975 352276480 168G Microsoft basic data
/dev/sdb8 210208768 210415615 206848 101M BIOS boot
Partition table entries are not in disk order.
/dev/sdb8 is BIOS boot invoked by bios_grub flag in gparted manage flags partition editor
/dev/sdb1 is efi partition flagged as boot, esp & legacy_boot in gparted manage flags partition editor
$ sudo fdisk -l
Disk /dev/sdc: 931.5 GiB, 1000204885504 bytes, 1953525167 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: xxx
Device Start End Sectors Size Type
/dev/sdc1 2048 206847 204800 100M BIOS boot
/dev/sdc2 206848 135235583 135028736 64.4G Linux filesystem
/dev/sdc3 135235584 286480383 151244800 72.1G Linux filesystem
/dev/sdc4 286480384 599062527 312582144 149.1G Microsoft basic data
/dev/sdc5 599062528 599984127 921600 450M Windows recovery environment
/dev/sdc6 599984128 1007575039 407590912 194.4G Microsoft basic data
/dev/sdc7 1007575040 1949327359 941752320 449.1G Microsoft basic data
/dev/sdc8 1949329408 1953103871 3774464 1.8G Linux swap
/dev/sdc9 1953105920 1953519615 413696 202M EFI System
/dev/sdc1 is BIOS boot invoked by bios_grub flag in gparted manage flags partition editor
/dev/sdc9 is efi partition flagged as boot, esp & legacy_boot in gparted manage flags partition editor
2. pure mbr / no BIOS boot - using Windows boot loader & easyBCD 3.2 to load Linux/Ubuntu
$ sudo fdisk -l
Disk /dev/sdc: 931.5 GiB, 1000204885504 bytes, 1953525167 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 33553920 bytes
Disklabel type: dos
Disk identifier: 0x767e7d2d
Device Boot Start End Sectors Size Id Type
/dev/sdc1 * 2048 472768511 472766464 225.4G 7 HPFS/NTFS/exFAT
/dev/sdc2 472768512 1422079999 949311488 452.7G 7 HPFS/NTFS/exFAT
/dev/sdc3 1422080221 1479591932 57511712 27.4G 83 Linux
/dev/sdc4 1479591933 1953523711 473931779 226G f W95 Ext'd (LBA)
/dev/sdc5 1479591936 1949331455 469739520 224G 83 Linux
/dev/sdc6 1949333504 1953523711 4190208 2G 82 Linux swap / Solaris
3. pure mbr (just Ubuntu, nothing else)
$ sudo fdisk -l
Disk /dev/sdc: 14.6 GiB, 15693664256 bytes, 30651688 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 2BB06DCE-2D30-4778-94BD-2FD214CD3C3B
Device Start End Sectors Size Type
/dev/sdc1 2048 206847 204800 100M BIOS boot
/dev/sdc2 206848 28555263 28348416 13.5G Linux filesystem
/dev/sdc3 28555264 30650367 2095104 1023M Linux swap
In 3. this is what to expect when you install Ubuntu to mbr, it will ask you to also create a BIOS boot partition of at least 1 MB - I chose here 100 MB to safeguard for future change, it's kind of a blob with core image for booting...
4. pure efi (just Ubuntu & EFI partition, nothing else)
$ sudo fdisk -l
Disk /dev/sdc: 29.3 GiB, 31406948352 bytes, 61341696 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 0B9FB340-99D5-03A3-D0EC-E74275E6E800
Device Start End Sectors Size Type
/dev/sdc1 2048 411647 409600 200M EFI System
/dev/sdc2 411648 58195967 57784320 27.6G Linux filesystem
/dev/sdc3 58195968 61335551 3139584 1.5G Microsoft basic data
in 4. I prep a disk with the three partitions EFI, ROOT & SWAP Assign the flags for the EFI partition as as boot, esp & legacy_boot in gparted, then use an install dvd/usb disk to install by assigning the correct partitions...
3 & 4 I use to deploy, if it's just them, I just dd to a bigger disk,
if not, I use the ROOT to dd to a partition in a target partition in a bigger disk that is already populated with say Windows or OS X, or any other,
care has then to be taken not to disturb the initial order,
so ROOT for Ubuntu should be put at the end of the original installations, etc.
In the next post I will take an example & walk through it...
efi/mbr partitions in pictures
1. efi/mbr mix
https://forum.xda-developers.com/attachment.php?attachmentid=4779410&stc=1&d=1560960108
https://forum.xda-developers.com/attachment.php?attachmentid=4779411&stc=1&d=1560960108
2. pure mbr / no BIOS boot - using Windows boot loader & easyBCD 3.2 to load Linux/Ubuntu
https://forum.xda-developers.com/attachment.php?attachmentid=4779413&stc=1&d=1560960108
3. pure mbr (just Ubuntu, nothing else)
https://forum.xda-developers.com/attachment.php?attachmentid=4779412&stc=1&d=1560960108
4. pure efi (just Ubuntu & EFI partition, nothing else)
https://forum.xda-developers.com/attachment.php?attachmentid=4779414&stc=1&d=1560960108
pictures in @twitter feeds -
https://twitter.com/inabster/status/1141482400112926723
https://twitter.com/inabster/status/1141482980151615488
RFC - how do we get the pictures to appear in the posts?
Bootloading examples
Method in post #13 required to have both the efi & bios boot partitions present
https://forum.xda-developers.com/showpost.php?p=79742668&postcount=13
This is a set piece for
Device Start End Sectors Size Type
/dev/sdb1 2048 411647 409600 200M EFI System
/dev/sdb2 411648 210208767 209797120 100G Microsoft basic data
/dev/sdb3 210415616 337403903 126988288 60.6G Linux filesystem
/dev/sdb4 337403904 430872575 93468672 44.6G Linux filesystem
/dev/sdb5 430872576 435066879 4194304 2G Linux swap
/dev/sdb6 435066880 624490495 189423616 90.3G Microsoft basic data
/dev/sdb7 624490496 976766975 352276480 168G Microsoft basic data
/dev/sdb8 210208768 210415615 206848 101M BIOS boot
sudo mount /dev/sdb3 /mnt
sudo mount /dev/sdb1 /mnt/boot/efi
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
sudo chroot /mnt
grub-install /dev/sdb
update-grub
2nd example -
Device Start End Sectors Size Type
/dev/sdc1 2048 206847 204800 100M BIOS boot
/dev/sdc2 206848 135235583 135028736 64.4G Linux filesystem
/dev/sdc3 135235584 286480383 151244800 72.1G Linux filesystem
/dev/sdc4 286480384 599062527 312582144 149.1G Microsoft basic data
/dev/sdc5 599062528 599984127 921600 450M Windows recovery environment
/dev/sdc6 599984128 1007575039 407590912 194.4G Microsoft basic data
/dev/sdc7 1007575040 1949327359 941752320 449.1G Microsoft basic data
/dev/sdc8 1949329408 1953103871 3774464 1.8G Linux swap
/dev/sdc9 1953105920 1953519615 413696 202M EFI System
sudo mount /dev/sdc3 /mnt
sudo mount /dev/sdc9 /mnt/boot/efi
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
sudo chroot /mnt
grub-install /dev/sdc
update-grub
out of chroot, these commands are also useful:
sudo efibootmgr -c -g -d /dev/sdc -p 9 -w -L "ubuntu" -l '\EFI\refind\refind_x64.efi' #efi partition /dev/sdc9
sudo grub-install /boot/efi # this after having mounted in /etc/fstab /dev/sdc9 in /boot/efi
sudo efibootmgr -c -g -d /dev/sdb -p 1 -w -L "ubuntu" -l '\EFI\refind\refind_x64.efi' #efi partition /dev/sdb1
sudo grub-install --target=x86_64-efi /dev/sdb3 --efi-directory=/boot/efi/ --boot-directory=/boot
sudo grub-install --target=x86_64-efi /dev/sdc3 --efi-directory=/boot/efi/ --boot-directory=/boot
sudo grub-mkconfig -o /boot/grub/grub.cfg
sudo update-grub
To check install is correct, issue:
$ [ -d /sys/firmware/efi ] && echo "EFI boot on HDD" || echo "Legacy boot on HDD]
Two important config files to get a successful Arch Linux or Ubuntu boot are:
grub.cfg
fstab
fstab is in /etc/
/etc/fstab
grub.cfg can be found in /boot/grub & mounted efi partition /boot/efi in /boot/efi/EFI/ubuntu
grub.cfg can be used in a grub command line as follows:
set root=(hd0,gpt2)
configfile (hd0,gpt1)/efi/ubuntu/grub.cfg
(grub.cfg must have the UUID of (hd0,gpt2) in my case of /dev/sdb2
use
sudo blkid /dev/sdX to find UUID's)
or
configfile (hd0,gpt2)/boot/grub/grub.cfg
grub.cfg, fstab examples...
First
Disk /dev/sdb: 931.5 GiB, 1000204885504 bytes, 1953525167 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 807AFD80-12D5-03A5-60BF-1E60B544E900
Device Start End Sectors Size Type
/dev/sdb1 2048 206847 204800 100M BIOS boot
/dev/sdb2 206848 135235583 135028736 64.4G Linux filesystem
/dev/sdb3 135235584 286480383 151244800 72.1G Linux filesystem
/dev/sdb4 286480384 599062527 312582144 149.1G Microsoft basic data
/dev/sdb5 599062528 599984127 921600 450M Windows recovery environment
/dev/sdb6 599984128 1007575039 407590912 194.4G Microsoft basic data
/dev/sdb7 1007575040 1949327359 941752320 449.1G Microsoft basic data
/dev/sdb8 1949329408 1953103871 3774464 1.8G Linux swap
/dev/sdb9 1953105920 1953519615 413696 202M EFI System
$ sudo blkid /dev/sdb9
/dev/sdb9: LABEL="UEFI" UUID="B07A-6430" TYPE="vfat" PARTLABEL="Basic data partition" PARTUUID="f7ffc8f0-896a-01d2-78e0-eb63b544e900"
$ sudo blkid /dev/sdb3
/dev/sdb3: LABEL="UBUNTU16" UUID="8082d3f4-ec43-4310-af55-934b67078f05" TYPE="ext4" PARTLABEL="Basic data partition" PARTUUID="c0428fd0-896a-01d2-e843-2160b544e900"
$ sudo blkid /dev/sdb8
/dev/sdb8: TYPE="swap" PARTLABEL="Basic data partition" PARTUUID="0000e5a5-f7e0-c5fd-6ae9-f2754acb0100"
$ nano /etc/fstab
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sdc3 during installation
UUID=6e69ee53-1a57-4cb5-b46f-f0f079fdf666 / ext4
# /boot/efi was on /dev/sda2 during installation
UUID=B07A-6430 /boot/efi vfat defaults 0 1
# swap was on /dev/sdc1 during installation
UUID=0000e5a5-f7e0-c5fd-6ae9-f2754acb0100 none swap sw $
$ nano /boot/efi/EFI/ubuntu/grub.cfg
search.fs_uuid 3fcb8592-bcc3-cf01-3048-8592bcc3cf01 root hd1,gpt3
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg
Second
Disk /dev/sda: 465.8 GiB, 500107861504 bytes, 976773167 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 33553920 bytes
Disklabel type: gpt
Disk identifier: 4CACF8A0-B3A8-039F-283E-2B13EAECE700
Device Start End Sectors Size Type
/dev/sda1 2048 411647 409600 200M EFI System
/dev/sda2 411648 210208767 209797120 100G Microsoft basic data
/dev/sda3 210415616 337403903 126988288 60.6G Linux filesystem
/dev/sda4 337403904 430872575 93468672 44.6G Linux filesystem
/dev/sda5 430872576 435066879 4194304 2G Linux swap
/dev/sda6 435066880 624490495 189423616 90.3G Microsoft basic data
/dev/sda7 624490496 976766975 352276480 168G Microsoft basic data
/dev/sda8 210208768 210415615 206848 101M BIOS boot
Partition table entries are not in disk order.
$ sudo blkid /dev/sda1
/dev/sda1: LABEL="EFI" UUID="4579-67B0" TYPE="vfat" PARTLABEL="Basic data partition" PARTUUID="42f7ecf0-d3b5-01d0-78f6-7ba1da69e800"
$ sudo blkid /dev/sda3
/dev/sda3: LABEL="UBUNTU18" UUID="6e69ee53-1a57-4cb5-b46f-f0f079fdf666" TYPE="ext4" PARTUUID="99b3c3d8-2c44-488b-a130-fefb68abbe5d"
$ sudo blkid /dev/sda5
/dev/sda5: UUID="93471658-7099-45fc-ac61-75e09b4bf08f" TYPE="swap" PARTUUID="fdb07319-debf-4394-9e71-27b3bca2a9ac"
$ nano /etc/fstab
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sdc3 during installation
UUID=6e69ee53-1a57-4cb5-b46f-f0f079fdf666 / ext4
# /boot/efi was on /dev/sda2 during installation
UUID=4579-67B0 /boot/efi vfat defaults 0 1
# swap was on /dev/sdc1 during installation
UUID=93471658-7099-45fc-ac61-75e09b4bf08f none swap sw
$ nano /boot/efi/EFI/ubuntu/grub.cfg
search.fs_uuid 6e69ee53-1a57-4cb5-b46f-f0f079fdf666 root hd1,gpt3
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg
Looking at the above examples, you can tease out where identifiers need be, usually the commands listed on previous posts would look after that, but sometimes they do not, so you need to amend / correct grub.cfg & fstab manually...
I hope this helps
Fixing Windows 10 EFI boot
In multi boot situations installing Ubuntu, one sometimes loses UEFI settings booting Windows 10 - here are some ways to repair / recover...
Resource needed - relevant boot install usb/dvd for Windows 10.
Use diskpart to repair uefi from troubleshooting repair command prompt.

How to create a Swap partition of any size for any Android ROM

No need to follow this instructions, but only if you want to learn!
Flash files are available here that will automatically do all this in TWRP Recovery.
https://forum.xda-developers.com/hp-touchpad/general/hp-touchpad-optimize-android-swap-t3901773
Before making this modifications, do this first:​
https://forum.xda-developers.com/hp-touchpad/general/how-to-backup-restore-using-twrp-copy-t3892047​
How to create a Swap partition of any size for any Android ROM
This is only need it to be create one time only and will work with any OS install in the Tablet( Any Android ROM, Any Linux OS, LunesOS, WebOS, Sailfish and many more ).
The following steps will partition the storage to create a swap partition that can be use for all Android ROM ever created for the HP Touchpad.
Also take a look at this link:
https://forum.xda-developers.com/hp-touchpad/general/powerful-feature-hp-touchpad-lvm-t3889068
Code:
[B]For the Experience User this are the simple steps, to get it out of the way and not need to read all the details. [/B]
If you know what you are doing, you can use it inside Android, TWRP using adb shell with root access is up to you.
Have unallocated space after creating all partitions.
(make a partition of whatever free space is available ) or you can specified the size you want, you know how to do it or
read above link)
./lvm.static lvcreate -l 100%FREE -C y -M y --major 254 --minor 0 -n /dev/store/swap
mkswap /dev/store/swap
Add to the fstab in Ramdisk:
/dev/store/swap swap swap defaults swapprio=1, 0 0
This steps are for the learning user, hopefully I am explaining it clearly and correctly!
My comments and Suggestion
Code:
I am making the steps as simple as I can. You can achieve this faster if you have done this before.
Basically is creating all the partitions but have 824MB unallocated free space for swap.
You can assign any size you want.
I recommend the following:
Media at least 1GB, this will be the USB Storage. This partition is the best to shrink if you ever need more space on other partitions.
cm-cache 200MB. If you want to use more you can, but I have not found any issues using 200MB.
cm-system 2048MB. If you ever want to install the FULL google open apps, it will take over 1.5GB. This will ensure, you can install anything and not have an issue.
cm-data (as much as you need to only have unallocated free space for swap )
A size of 500MB will be enough ( WebOS has a swap file size of 400 MB )
The maximum I will recommend is 1GB, but you can make it any size you want. Is all up to what you use your tablet for.
Starting all fresh, from zero. All Data will be erase. Back up your data before proceeding.
THE BEGINNING of the process.
1. Load the ToolBox v42 2015-01-08
2. Complete Data Reset ( If you want to clear all partitions )
3. Resize Android Volumes (Using the ToolBox)
3.A Select Media ( select -1024 ) press home button 28 times
New size 1112
unallocated 28672
Select BACK (on top)
3.B Select cm-cache (select +8 ) press home button 25 times
New size 200
unallocated 28472
Select BACK (on top)
3.C Select cm-system (select +1024) press home button 2 times
New size 2048
unallocated 26424
Select BACK (on top)
3.D Select cm-data (select +1024) press home button 25 times
New size 25600
unallocated 824
Select Back (on top)
4. Select Apply Changes
5. Select Reboot
<<< moboot 0.3.8 >>>
6. Select boot webOS Recovery (connect the TP to computer)
7. Unzip FLINTMAN-TWRP-touch-data_media-SELINUX-f2fs-3.1.0-0-5-09-17.zip
8. Open a terminal in the directory of the unzip file.
9. Copy and paste the following in terminal.
Code:
novacom boot mem:// <uImage.TWRP
At this point The ToolBox already created all the partitions or volumes, but the unallocated space left is the one that we need to manually create
and format as a native Linux partition. This is why we need to use TWRP Recovery and to enter two lines of code, create the partition and format it.!
<<< TWRP >>>
10. Select Mount --->> check BOOT --->> select back (triangle lower left)
11. Entering adb shell :In the open Terminal paste the following
adb shell
Code:
cd /boot/usr/sbin
./lvm.static vgchange -ay
Result: /boot/usr/sbin # ./lvm.static vgchange -ay
4 logical volume(s) in volume group "store" now active
Code:
./lvm.static lvcreate -l 100%FREE -C y -M y --major 254 --minor 0 -n /dev/store/swap
Result: /boot/usr/sbin # ./lvm.static lvcreate -l 100%FREE -C y -M y --major 254 --minor
0 -n /dev/store/swap
ffff0000-ffff1000 r-xp 00000000 00:00 0 [vectors]: mlock failed: Cannot allocate memory
ffff0000-ffff1000 r-xp 00000000 00:00 0 [vectors]: munlock failed: Cannot allocate memory
Logical volume "swap" created
Code:
mkswap /dev/store/swap
Result: /boot/usr/sbin # mkswap /dev/store/swap
Setting up swapspace version 1, size = 864022528 bytes
Code:
./lvm.static vgchange -ay
Result: /boot/usr/sbin # ./lvm.static vgchange -ay
5 logical volume(s) in volume group "store" now active
<<<-- All Done Swap partition created -->>>
12. Copy FLINTMAN-TWRP-touch-data_media-SELINUX-f2fs-3.1.0-0-5-09-17.zip file in the Micro SDCard showing on your Computer.
13. Select Install --->> Up one level --->> external_sd ( the TWRP.zip file should be there ) Install it, Reboot System.
14. TWRP is on the moboot menu. Now you can install any ROM.
But Files in the Ramdisk needs to be modified for Android to mount the swap partition at boot.
I have done all this already, you can use the boot uImages that I posted below for Dirty Unicorns and Evervolv. If you feel like doing it yourself then keep having fun!
15. To modify the Ramdisk, click on this link:
https://forum.xda-developers.com/hp-touchpad/development/make-root-permanet-read-write-to-t3846567
16. The following needs to be added to fstab.tenderloing
/dev/store/swap swap swap defaults swapprio=1, 0 0
The zRAM needs to be disable, by placing # in front of the mount point.
# /dev/block/zram0
The fun has just started and now Android will see the swap partition and start swapping, but changes need to be made on more files in the ramdisk to optimize Android to work on a Tablet with swapping and not be use as a smartphone with zRAM and limited resources like it has been use from all this years.
The system is not optimized and it will not work properly with current settings. I have created modified boot images for the Evervol 7.1.2 and Dirty Unicorns V12.5.3 with all the best optimization possible to use the Touchpad as a tablet and not a smartphone. The links are below, just copy the files into your boot directory.
Before you boot using the new image, disable any optimization apps or changes that you have done because it will override any settings done after boot is completed and make the system very slow.
Dirty Unicorns:
https://forum.xda-developers.com/hp...ty-unicorns-v12-5-3-20181116-0140-rc-t3894042
Everlvolv:
https://forum.xda-developers.com/hp...rvol-7-1-2-skz-kernel-swap-partition-t3892091
Attention: This is extremely easy to deploy by all developers creating any ROM or Kernel for the TP. The regular user does not need to do none of this.
The only thing the user needs to do is left some space available when creating the Android partitions using the ToolBox, which everyone needs to do.
Is up to the user to select how much space they want for their Swap partition.
Then the developer that provides the ROM or Kernel can create an script to run after installation that will create the partition from whatever free space is available and format it. No input is need it by the user to do so. And if the partition is already created, nothing will happen, LVM is smart enough to not recreated.
./lvm.static lvcreate -l 100%FREE -C y -M y --major 254 --minor 0 -n /dev/store/swap
mkswap /dev/store/swap
HP_TOUCHPAD said:
Before making this modifications, do this first:​https://forum.xda-developers.com/hp-touchpad/general/how-to-backup-restore-using-twrp-copy-t3892047​
How to create a Swap partition of any size for any Android ROM
The following steps will partition the storage to create a swap partition that can be use for all Android ROM ever created for the HP Touchpad.
Also take a look at this link:
https://forum.xda-developers.com/hp-touchpad/general/powerful-feature-hp-touchpad-lvm-t3889068
For the Expert is as simple as:
Have unallocated space.
(make a partition of whatever free space is avalaible ) or it can be specified.
Code:
./lvm.static lvcreate -l 100%FREE -C y -M y --major 254 --minor 0 -n /dev/store/swap
Format
Code:
mkswap /dev/store/swap
Where? adb shell? That's where I'm doing it, and I get "unable to create new logical volume with no extents"
Add to the fstab in Ramdisk:
/dev/store/swap swap swap defaults swapprio=1, 0 0
Optimize Swapping settings.
I am making the steps as simple as I can. You can achieve this faster if you have done this before.
Basically is creating all the partitions but have 824MB unallocated free space for swap.
You can assign any size you want.
I recommend the following:
Media at least 1GB, this will be the USB Storage. This partition is the best to shrink if you ever need more space on other partitions.
cm-cache 200MB. If you want to use more you can, but I have not found any issues using 200MB.
cm-system 2048MB. If you ever want to install the FULL google open apps, it will take over 1.5GB. This will ensure, you can install anything and not have an issue.
cm-data (as much as you need to only have unallocated free space for swap )
A size of 500MB will be enough ( WebOS has a swap file size of 400 MB )
The maximum I will recommend is 1GB, but you can make it any size you want. Is all up to what you use your tablet for.
Starting all fresh, from zero. All Data will be erase. Back up your data before proceeding.
Is this where we're supposed to start. Is all the rest above this just commentary?
1. Load the ToolBox v42 2015-01-08
2. Complete Data Reset ( If you want to clear all partitions )
3. Resize Android Volumes (Using the ToolBox)
3.A Select Media ( select -1024 ) press home button 28 times
New size 1112
unallocated 28672
Select BACK (on top)
3.B Select cm-cache (select +8 ) press home button 25 times
New size 200
unallocated 28472
Select BACK (on top)
3.C Select cm-system (select +1024) press home button 2 times
New size 2048
unallocated 26424
Select BACK (on top)
3.D Select cm-data (select +1024) press home button 25 times
New size 25600
unallocated 824
Select Back (on top)
4. Select Apply Changes
5. Select Reboot
<<< moboot 0.3.8 >>>
6. Select boot webOS Recovery (connect the TP to computer)
7. Unzip FLINTMAN-TWRP-touch-data_media-SELINUX-f2fs-3.1.0-0-5-09-17.zip
8. Open a terminal in the directory of the unzip file.
9. Copy and paste the following in terminal.
Code:
novacom boot mem:// <uImage.TWRP
<<< TWRP >>>
10. Select Mount --->> check BOOT --->> select back (triangle lower left)
11. Entering adb shell :In the open Terminal paste the following
Is this actually the place where the lvm volumes are created after we go through TPTB and reinstall TWRP?
adb shell
Code:
cd /boot/usr/sbin
./lvm.static vgchange -ay
Result: /boot/usr/sbin # ./lvm.static vgchange -ay
4 logical volume(s) in volume group "store" now active
Code:
./lvm.static lvcreate -l 100%FREE -C y -M y --major 254 --minor 0 -n /dev/store/swap
Result: /boot/usr/sbin # ./lvm.static lvcreate -l 100%FREE -C y -M y --major 254 --minor
0 -n /dev/store/swap
ffff0000-ffff1000 r-xp 00000000 00:00 0 [vectors]: mlock failed: Cannot allocate memory
ffff0000-ffff1000 r-xp 00000000 00:00 0 [vectors]: munlock failed: Cannot allocate memory
Logical volume "swap" created
Code:
mkswap /dev/store/swap
Result: /boot/usr/sbin # mkswap /dev/store/swap
Setting up swapspace version 1, size = 864022528 bytes
Code:
./lvm.static vgchange -ay
Result: /boot/usr/sbin # ./lvm.static vgchange -ay
5 logical volume(s) in volume group "store" now active
<<<-- All Done Swap partition created -->>>
12. Copy FLINTMAN-TWRP-touch-data_media-SELINUX-f2fs-3.1.0-0-5-09-17.zip file in the Micro SDCard showing on your Computer.
13. Select Install --->> Up one level --->> external_sd ( the TWRP.zip file should be there ) Install it, Reboot System.
14. TWRP is on the moboot menu. Now you can install any ROM.
But Files in the Ramdisk needs to be modified for Android to mount the swap partition at boot.
15. To modify the Ramdisk, click on this link:
https://forum.xda-developers.com/hp-touchpad/development/make-root-permanet-read-write-to-t3846567
16. The following needs to be added to fstab.tenderloing
/dev/store/swap swap swap defaults swapprio=1, 0 0
The zRAM needs to be disable, by placing # in front of the mount point.
# /dev/block/zram0
The fun has just started and now Android will see the swap partition and start swapping, but changes need to be made on more files in the ramdisk to optimize Android to work on a Tablet with swapping and not be use as a smartphone with zRAM and limited resources like it has been use from all this years.
The system is not optimized and it will not work properly with current settings. I have created modified boot images for the Evervol 7.1.2 and Dirty Unicorns V12.5.3 with all the best optimization possible to use the Touchap as a tablet and not a smartphone. The links are below, just copy the files into your boot directory.
Before you boot using the new image, disable any optimization apps or changes that you have done because it will override any settings done after boot is completed and make the system very slow.
<<--link will be here --->>
Click to expand...
Click to collapse
This may be clear to you, but it isn't to me. See my comments in red above. How about cleaning this up? Anything you want to add that is extraneous to just getting this done should be in a second post.
I kinda get the feeling you are hoping the ROM builders will add this to their Roms but i don't think we have too many programmers left for the touchpad.
I can't even get this far
8. Open a terminal in the directory of the unzip file. ( on windows? with what?)
9. Copy and paste the following in terminal.
Sorry ...i'm trying though...Thanks for your effort
Touchie Pad said:
I kinda get the feeling you are hoping the ROM builders will add this to their Roms but i don't think we have too many programmers left for the touchpad.
I can't even get this far
8. Open a terminal in the directory of the unzip file. ( on windows? with what?)
9. Copy and paste the following in terminal.
Sorry ...i'm trying though...Thanks for your effort
Click to expand...
Click to collapse
The tablet originally came with a swap partition on webOS, is nothing new.
Do not worry about doing this, I already created a zip file that can be install using TWRP Recovery!
Everything will be done in less than two minutes and everything will be created!
Working on getting the files on here...
my touchpads are in twrp and attached to my computer!
Touchie Pad said:
my touchpads are in twrp and attached to my computer!
Click to expand...
Click to collapse
It will be very quick thing to apply, download the zip file. Flash it and in less than 2 minutes is done!
HP_TOUCHPAD said:
It will be very quick thing to apply, download the zip file. Flash it and in less than 2 minutes is done!
Click to expand...
Click to collapse
I did not see the zip available anywhere. Where is the zip file?
Well I was able to create the swap partition by following your instructions in the terminal of the twrp on the touchpad. When i type in #free it does show a swap file with numbers, so i think i got it right. Did it on a DU Rom and a Lineage build. Never could get your optimized settings to boot though. Or get into the ramdisk yet. I used 3ctoolbox to try to mimic your suggested settings. It does seem to be quite a bit improved...especially when watching videos on youtube etc...I still do come across lag at times, if more than a couple things are running at the same time...and some apps are still tough for it to handle, but every bit helps.
Touchie Pad said:
Well I was able to create the swap partition by following your instructions in the terminal of the twrp on the touchpad. When i type in #free it does show a swap file with numbers, so i think i got it right. Did it on a DU Rom and a Linaro build. Never could get your optimized settings to boot though. Or get into the ramdisk yet. I used 3ctoolbox to try to mimic your suggested settings. It does seem to be quite a bit improved...especially when watching videos on youtube etc...I still do come across lag at times, if more than a couple things are running at the same time...and some apps are still tough for it to handle, but every bit helps.
Click to expand...
Click to collapse
Thanks for trying it out!
Today I will upload all the zip files than can be easily flash using TWRP, it will be extremely simple, just touch and install and it will do a complete fresh install of everything, like a brand new Device!
Also the DU optimized Kernel and Evervolv, just touch and Install.
You will see how fast and stable the HP Touchpad really is!
Here are the Flash files to Install ! Thanks to shumash for the help of providing the script binary and for initiating the idea to make it easy!
https://forum.xda-developers.com/hp-touchpad/general/hp-touchpad-optimize-android-swap-t3901773

Categories

Resources