在Nexus7平板上安装Ubuntu Touch(by quqi99)

作者:张华  发表于:2016-06-11
版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本版权声明

( http://blog.csdn.net/quqi99 )

解锁

1, 打开“开发者模式”中的“Debug模式”

2, 手机采用USB和Ubuntu 14.04电脑相连后使用lsusb始终看不到设备,折腾了近两小时后换了一根USB线就好了

3, 安装adb与fastboot工具包
wget http://esausilva.com/wp-content/plugins/cimy-counter/cc_redirect.php?cc=platform-tools-linux&fn=http://esausilva.com/misc/android/platform-tools-linux.tar.gz
export ANDROID_HOME=/bak/java/android/adt-bundle-linux-x86_64-20131030/sdk
export PATH=$ANDROID_HOME/platform-tools:$PATH

4, Double Check
hua@node1:~$ sudo lsusb |grep Google
   Bus 003 Device 041: ID 18d1:4ee2 Google Inc. Nexus 4 (debug)
hua@node1:~$ cat /etc/udev/rules.d/51-android.rules
   SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", SYMLINK+="android_adb"
hua@node1:~$ cat ~/.android/adb_usb.ini
   18d1
hua@node1:~$ sudo udevadm control --reload-rules && sudo udevadm trigger
hua@node1:~$ adb kill-server && adb start-server
hua@node1:~$ adb devices
   List of devices attached
   091bbb72    offline
hua@node1:~$ sudo apt-get install mtpfs mtp-tools gmtp
hua@node1:~$ sudo mtp-detect

5, 解锁,要解锁设备,首先请将设备关闭。接下来,同时按住电源键和音量减小键,此时设备将以fastboot模式启动。然后用USB线将Nexus设备与电脑连接起来,打开一个终端,运行如下的命令:
hua@node1:~$ sudo fastboot devices
091bbb72    fastboot

hua@node1:~$ sudo fastboot oem unlock
...
(bootloader) Unlocking bootloader...
(bootloader) erasing userdata...
(bootloader) erasing userdata done
(bootloader) erasing cache...
(bootloader) erasing cache done
(bootloader) Unlocking bootloader done!
OKAY [ 48.615s]
finished. total time: 48.615s

hua@node1:~$ sudo fastboot reboot-bootloader
rebooting into bootloader...
OKAY [  0.006s]
finished. total time: 0.006s

6, 解锁后android将重置,再次打开“开发者模式”中的“Debug模式”

Ubuntu Touch与Android双启动

1, 在android平板上安装UPDATE-UbuntuInstaller.zip解压后一一个安装文件,在电脑上下载后,然后从平板通过http下载解压后的UbuntuInstaller.apk安装。也可以直接在电脑上运行脚本http://humpolec.ubuntu.com/latest/dualboot.sh安装。
wget http://humpolec.ubuntu.com/latest/UPDATE-UbuntuInstaller.zip
unzip UPDATE-UbuntuInstaller.zip
python -m SimpleHTTPServer

2,打开UbuntuInstaller即可图形化的安装并切换至Ubuntu Touch。注意:UbuntuInstaller程序应该使用SuperSu软件给它root权限才能安装。dualboot.sh脚本能自动安装SuperSu

3, 实际上,我在安装成功后无法切换至Ubuntu Touch,所以继续采用下列的安装方式

ubuntu-device-flash安装Ubuntu Touch

sudo add-apt-repository ppa:phablet-team/tools
sudo add-apt-repository ppa:snappy-dev/beta
sudo apt-get update
sudo apt-get install phablet-tools android-tools-adb android-tools-fastboot
sudo apt-get install ubuntu-device-flash
ubuntu-device-flash touch --channel=ubuntu-touch/stable/ubuntu --bootstrap


电脑上SSH登录Ubuntu Touch

1, 在ubuntu touch中打开“Developer mode”,重启后就可以用usb连接电脑和平板在电脑上操作一些命令了。
2, 打开ssh, 
adb shell android-gadget-service enable ssh
adb shell mkdir /home/phablet/.ssh
adb push ~/.ssh/id_rsa.pub /home/phablet/.ssh/authorized_keys
adb shell chown -R phablet.phablet /home/phablet/.ssh
adb shell chmod 700 /home/phablet/.ssh
adb shell chmod 600 /home/phablet/.ssh/authorized_keys
adb shell ip addr show wlan0|grep inet
ssh [email protected] -v
3, Read-only file system, sudo mount -o remount,rw /
4, Apt repository
sudo sed -i -e 's/archive.ubuntu.com\|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
sudo dpkg --configure -a
sudo apt-get update


刷回Android

1, 下载镜像razor-jss15q-factory-4f77b811.tgz, 
   https://developers.google.com/android/nexus/images#sojus

3, 关机后,同时按电源和音量下键进入bootloader模式

3, razor-jss15q-factory-4f77b811.tgz解压后有boot.img,recovery.img, system.img, userdata.img, cache.img五个文件,用它们执行下列命令刷机。
hua@node1:/bak/tools/nexus7/razor-jss15q$ fastboot devices 
091bbb72 fastboot
hua@node1:/bak/tools/nexus7/razor-jss15q$ fastboot flash boot boot.img
sending 'boot' (6880 KB)...
OKAY [  0.225s]
writing 'boot'...
OKAY [  0.760s]
finished. total time: 0.985s
hua@node1:/bak/tools/nexus7/razor-jss15q$ fastboot flash recovery recovery.img
sending 'recovery' (7424 KB)...
OKAY [  0.253s]
writing 'recovery'...
OKAY [  0.317s]
finished. total time: 0.570s
hua@node1:/bak/tools/nexus7/razor-jss15q$ fastboot erase system
******** Did you mean to fastboot format this partition?
erasing 'system'...
OKAY [  0.254s]
finished. total time: 0.254s
hua@node1:/bak/tools/nexus7/razor-jss15q$ fastboot flash system system.img
erasing 'system'...
OKAY [  0.099s]
sending 'system' (603355 KB)...
OKAY [ 19.456s]
writing 'system'...
OKAY [ 27.385s]

finished. total time: 46.940s


MultiROM安装双系统

上面使用UbuntuInstaller.apk工具安装Android与Ubuntu Touch失败,但也可以使用MultiROM来安装,同样需要SuperSu工具给MultiROM权限,注意一点就够了(在用MultiROM下载Ubuntu Touch镜像时总失败是因为被墙了的原因)。

root@flo:/data/media/0/Download/UbuntuTouch # ls
device-e357b4c1570f5d586167571a8e5e5a64224e2b6ec5a14fbbe62304228cbfc289.tar.xz
ubuntu-0144c0d9ab780d8b40477987c3004d4c25d1861e6dd067125e77970c11ec76a1.tar.xz
ubuntu-0144c0d9ab780d8b40477987c3004d4c25d1861e6dd067125e77970c11ec76a1.tar.xz.asc
ubuntu-59b0c7aa8af63dda3a06005a6087c1faa4ed8993321293b276e7f7021d0cb0a3.delta-ubuntu-9757249d38ed16e6f64001d84cbb99e95289955deef433d9f00c0b3bc1f0ab51.tar.xz
ut_test_file


参考

[1] https://github.com/LCTT/TranslateProject/blob/master/published/201405/Ubuntu%20Touch%20and%20Android%20Dual%20Boot%20Installation.md
[2] https://wiki.ubuntu.com/Touch/Devices
[3] https://developer.ubuntu.com/en/phone/devices/installing-ubuntu-for-devices/

你可能感兴趣的:(在Nexus7平板上安装Ubuntu Touch(by quqi99))