Android平板改装成了Debian的系统,有点小问题

笔记本/便携移动设备,手机平板等软硬件
回复
米路王子
帖子: 1
注册时间: 2012-11-24 17:16
系统: 安卓

Re: Android平板改装成了Debian的系统,有点小问题

#106

帖子 米路王子 »

楼主的教程在哪??。
sdwshlsdx888
帖子: 3
注册时间: 2013-04-19 13:55
系统: ubuntu12.04

Re: Android平板改装成了Debian的系统,有点小问题

#107

帖子 sdwshlsdx888 »

楼主去哪了,求如何解决声音问题?
头像
ud狼图腾
帖子: 75
注册时间: 2010-03-23 11:20

Re: Android平板改装成了Debian的系统,有点小问题

#108

帖子 ud狼图腾 »

oppop007 写了:Android平板改装成了Debian的系统,有点小问题

之前把自己一台平板电脑【Rockchip RK2818芯片组,内存256MB,CPU600Mhz。(话说这配置有点渣?)】的Android系统换成了Debian (Squeeze)。内核换不了(或者说不敢换 -_-||| ),是原来的2.6.25(无preempt)。桌面是GNOME 2.3。不过窗口管理器被换成了kwin。(因为特效的缘故嘛,(*^__^*) 嘻嘻……)截图见此:viewtopic.php?f=12&t=63953&start=1215 (Page 82)

现在声音(Use pulseaudio)、Wifi(Use Networkmanager&nm-applet)等都没什么问题,主要就是电源管理的问题。前天好不容易折腾好了HAL Daemon(hald),现在能检测到充电状态和调节屏幕亮度,但是却显示不出电池的电量,也不能屏幕休眠、待机、休眠。(电池状态能在/sys/platform/......(中间忘了 -_-)..../rk28_battery/.....(cap开头的那个) 看到)

请问各位,这是怎么回事?若能解决,不胜感激。
LZ 你的签名碉堡了啊。。
百度给个面试机会呗。。
chinatslsz
帖子: 111
注册时间: 2007-06-08 11:38

Re: Android平板改装成了Debian的系统,有点小问题

#109

帖子 chinatslsz »

当年初二开始玩Linux……不过那时候也没有平板,连笔记本和手机都没有,只能在台式机上搞
头像
liyafe1997
帖子: 491
注册时间: 2009-07-18 0:14

Re: Android平板改装成了Debian的系统,有点小问题

#110

帖子 liyafe1997 »

chinatslsz 写了:当年初二开始玩Linux……不过那时候也没有平板,连笔记本和手机都没有,只能在台式机上搞
当年09年我折腾linux时是五年级,后来做windows开发之后折腾linux越来越少了。直到现在折腾树莓派&arm再次接触linux。。
Linux爱好者,只为效率,有空会常来灌水。
——————
强推:WebQQ桌面化方案,体验很好
稻草软件论坛
Strawing Blog
adqiy
帖子: 8
注册时间: 2013-10-10 0:03
系统: ubuntu1204

Re: Android平板改装成了Debian的系统,有点小问题

#111

帖子 adqiy »

oppop007 写了:
ganhailin 写了:话说我还在研究用chroot做双系统呢,我用蓝魔v65pro,mips处理器,官方就有root文件系统,但就不知道怎么用,我还是个小白,也是初二,但我五年级时才开始玩linux,不知楼主怎么做到的 :em01
(至于如何建立Debian镜像,请各位自行查阅debootstrap的使用说明,本大侠在此不再赘述。)



Debian on Android·Load scripts


看好咯~本大侠的杰作们~ :em02 :em09
各位可以根据自己的实际情况修改这些脚本(为了方便,建议分开添加进Connectbot(一个很棒的Android终端)的“登入后动作”,方可『一爽到底』~ :em04 )。


『装载Debian镜像』

代码: 全选

su
busybox losetup /dev/block/loop2 /flash/debian/debian.img
busybox mount /dev/block/loop2 /flash/debian/loop/ -o loop
busybox losetup /dev/block/loop4 /sdcard/debian-extend-1.img
busybox mount /dev/block/loop4 /flash/debian/loop/disks/ext1 -o loop
exit
exit

『进入Debian shell』

代码: 全选

su
busybox chroot /flash/debian/loop/
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
mount proc /proc -t proc
mount sysfs /sys -t sysfs
mount devpts /dev/pts -t devpts
hostname Jingtian-Pad
bash
export USER=root
export HOME=/root
export DISPLAY=:1
export TERM=xterm
mount /dev/mtdblock8 /mnt/flash
mount /dev/mmcblk0p1 /mnt/tf
clear

『开启swap』

代码: 全选

su
busybox swapoff /dev/bl*/mtd*10
busybox swapon /dev/block/mmcblk0p2
busybox swapon /sdcard/swap*
exit
exit

『修复镜像,用于非正常断电后』

代码: 全选

su
e2fsck -fy /flash/debian/debian.img
e2fsck -fy /sdcard/debian-extended-1.img
exit
exit

『进入GNOME桌面!』

代码: 全选

su
busybox swapon /dev/block/mmcblk0p2
busybox chroot /flash/debian/loop/
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
mount proc /proc -t proc
mount sysfs /sys -t sysfs
mount devpts /dev/pts -t devpts
hostname Jingtian-Pad
bash
export USER=root
export HOME=/root
export DISPLAY=:1
export TERM=xterm
mount /dev/mtdblock8 /mnt/flash
mount /dev/mmcblk0p1 /mnt/tf
clear
#echo "***WILL STOP mediaserver NOW.***"
#echo
#echo "***PRESS ENTER TO CONTINUE***"
#read
cd
pkill -KILL media



################LOOK AT BELOW!!!###############


# Place a wave sound file (At least 6 seconds) in the /root directory!!!


################LOOK AT ABOVE!!!###############




aplay *wav&
sleep 3
pkill -STOP media
pkill -STOP debugg
sleep 5
echo "Good! The mediaserver has been stopped"
pkill aplay
sync
sleep 5
rm nohup.out
start-system-services
nohup stop-android&
nohup X :1&
sleep 9;nohup gnome-session&
#sleep 8;nohup icewm&
#sleep 9;nohup kvkbd&
Contents of sub-scripts: (Just put them in $PATH.)
『stop-android』

代码: 全选

#!/bin/sh

sleep 20
killall -STOP system_server
nohup udevd&
killall -STOP org.connectbot
『start-system-services』

代码: 全选

#!/bin/sh


/etc/init.d/dbus start
/etc/init.d/hal start
/etc/init.d/acpid start
Modified init.d scripts:
『/etc/init.d/hal 』

代码: 全选

#! /bin/sh
### BEGIN INIT INFO
# Provides:          hal
# Required-Start:    $remote_fs dbus
# Required-Stop:     $remote_fs dbus
# Should-Start:      $syslog acpid
# Should-Stop:       $syslog acpid
# Default-Start:     2 3 4 5
# Default-Stop:      1
# Short-Description: Hardware abstraction layer
# Description:       The HAL daemon collects and maintains information about
#                    your hardware.
### END INIT INFO

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/hald
PIDDIR=/var/run/hald
PIDFILE=$PIDDIR/hald.pid
NAME=hald
DAEMONUSER=haldaemon
DESC="Hardware abstraction layer"

test -x $DAEMON || exit 0

. /lib/lsb/init-functions

# Include hal defaults if available
if [ -f /etc/default/hal ] ; then
        . /etc/default/hal
fi

set -e

do_start() {
        if [ ! -d $PIDDIR ]; then
                mkdir -p $PIDDIR
                chown $DAEMONUSER:$DAEMONUSER $PIDDIR
        fi
        start-stop-daemon --start --oknodo --pidfile $PIDFILE \
                --exec $DAEMON -- $DAEMON_OPTS
}

do_stop() {
        start-stop-daemon --stop --retry 5 --oknodo --quiet --pidfile $PIDFILE \
                --exec $DAEMON
}

check_prerequisites() {
        UNAME=`uname`
        if [ ! -d /proc/sys/fs/inotify ] && [ $UNAME = "Linux" ]; then
                log_failure_msg "Can't start $DESC - enable inotify support in your kernel"
                exit 0
        fi
        if [ ! -e /var/run/dbus/system_bus_socket ]; then
                log_failure_msg "Can't start $DESC - please ensure dbus is running"
                exit 0
        fi

        if [ ! -d /sys/devices ] && [ $UNAME = "Linux" ]; then
                log_failure_msg "Can't start $DESC - sysfs not mounted on /sys"
                exit 0
        fi

        if [ "$(stat -c %d/%i /)" != "$(stat -Lc %d/%i /proc/1/root 2>/dev/null)" ] && [ $UNAME != "GNU" ]; then
                echo "Can't start $DESC - detected chrooted session"
      echo "Jingtian: It doesn't matter...So let's continue."
                #exit 0
        fi
}

case "$1" in
  start)
        check_prerequisites
        log_daemon_msg "Starting $DESC" "$NAME"
        do_start
        log_end_msg $?
        ;;
  stop)
        log_daemon_msg "Stopping $DESC" "$NAME"
        do_stop
        log_end_msg $?
        ;;
  restart|force-reload)
        check_prerequisites
        log_daemon_msg "Restarting $DESC" "$NAME"
        do_stop
        do_start
        log_end_msg $?
        ;;
  status)
        status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $?
        ;;
  *)
        log_success_msg "Usage: $0 {start|stop|restart|force-reload|status}" >&2
        exit 1
        ;;
esac

exit 0

Modified application configs:
『/etc/pulse/default.pa』

代码: 全选

#!/usr/bin/pulseaudio -nF
#
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.

# This startup script is used only if PulseAudio is started per-user
# (i.e. not in system mode)

.nofail

### Load something into the sample cache
load-sample-lazy x11-bell /usr/share/sounds/gtk-events/activate.wav
load-sample-lazy pulse-hotplug /usr/share/sounds/startup3.wav
load-sample-lazy pulse-coldplug /usr/share/sounds/startup3.wav
load-sample-lazy pulse-access /usr/share/sounds/generic.wav

.fail

### Automatically restore the volume of streams and devices
#load-module module-device-restore
#load-module module-stream-restore
#load-module module-card-restore

### Automatically augment property information from .desktop files
### stored in /usr/share/application
load-module module-augment-properties

### Load audio drivers statically (it's probably better to not load
### these drivers manually, but instead use module-hal-detect --
### see below -- for doing this automatically)
load-module module-alsa-sink
load-module module-alsa-source device=hw:0,0
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
#load-module module-null-sink
#load-module module-pipe-sink

### Automatically load driver modules depending on the hardware available
.ifexists module-udev-detect.so
#3load-module module-udev-detect
.else
### Alternatively use the static hardware detection module (for systems that
### lack udev support)
load-module module-detect
.endif

### Automatically load driver modules for Bluetooth hardware
.ifexists module-bluetooth-discover.so
#33load-module module-bluetooth-discover
.endif

### Load several protocols
.ifexists module-esound-protocol-unix.so
#load-module module-esound-protocol-unix
.endif
load-module module-native-protocol-unix

### Network access (may be configured with paprefs, so leave this commented
### here if you plan to use paprefs)
#load-module module-esound-protocol-tcp
#load-module module-native-protocol-tcp
#load-module module-zeroconf-publish

### Load the RTP reciever module (also configured via paprefs, see above)
#load-module module-rtp-recv

### Load the RTP sender module (also configured via paprefs, see above)
#load-module module-null-sink sink_name=rtp format=s16le channels=2 rate=48000 description="RTP Multicast Sink"
#load-module module-rtp-send source=rtp.monitor

### Load additional modules from GConf settings. This can be configured with the paprefs tool.
### Please keep in mind that the modules configured by paprefs might conflict with manually
### loaded modules.
.ifexists module-gconf.so
.nofail
load-module module-gconf
.fail
.endif

### Automatically restore the default sink/source when changed by the user during runtime
load-module module-default-device-restore

### Automatically move streams to the default sink if the sink they are
### connected to dies, similar for sources
load-module module-rescue-streams

### Make sure we always have a sink around, even if it is a null sink.
load-module module-always-sink

### Honour intended role device property
load-module module-intended-roles

### Automatically suspend sinks/sources that become idle for too long
load-module module-suspend-on-idle

### If autoexit on idle is enabled we want to make sure we only quit
### when no local session needs us anymore.
#33load-module module-console-kit

### Enable positioned event sounds
load-module module-position-event-sounds

### Cork music streams when a phone stream is active
load-module module-cork-music-on-phone

# X11 modules should not be started from default.pa so that one daemon
# can be shared by multiple sessions.

### Load X11 bell module
#load-module module-x11-bell sample=bell-windowing-system

### Register ourselves in the X11 session manager
#load-module module-x11-xsmp

### Publish connection data in the X11 root window
#.ifexists module-x11-publish.so
#.nofail
#load-module module-x11-publish
#.fail
#.endif

### Make some devices default
#set-default-sink output
#set-default-source input
『/etc/pulse/daemon.conf』

代码: 全选

# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA.

## Configuration file for the PulseAudio daemon. See pulse-daemon.conf(5) for
## more information. Default values a commented out.  Use either ; or # for
## commenting.

; daemonize = no
; fail = yes
; allow-module-loading = yes
; allow-exit = no
; use-pid-file = yes
; system-instance = no
; enable-shm = no
; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB
; lock-memory = no
; cpu-limit = no

; high-priority = yes
; nice-level = -1

; realtime-scheduling = no
; realtime-priority = 5

; exit-idle-time = 20
; scache-idle-time = 20

; dl-search-path = (depends on architecture)

; load-default-script-file = yes
; default-script-file = 

; log-target = auto
; log-level = notice
; log-meta = no
; log-time = no
; log-backtrace = 0

; resample-method = ffmpeg
; enable-remixing = no
; enable-lfe-remixing = no

; flat-volumes = yes

; rlimit-fsize = -1
; rlimit-data = -1
; rlimit-stack = -1
; rlimit-core = -1
; rlimit-as = -1
; rlimit-rss = -1
; rlimit-nproc = -1
; rlimit-nofile = 256
; rlimit-memlock = -1
; rlimit-locks = -1
; rlimit-sigpending = -1
; rlimit-msgqueue = -1
; rlimit-nice = 31
; rlimit-rtprio = 9
; rlimit-rttime = 1000000

; default-sample-format = s16le
; default-sample-rate = 48000
; default-sample-channels = 2
; default-channel-map = front-left,front-right

; default-fragments = 4
; default-fragment-size-msec = 25
Tips:
1、To start the pulseaudio server, execute "pulseaudio --resample-method=ffmpeg". You can add this to GNOME's autostart list.
2、If your original system (Android) has some external drivers (modules), remember to copy them into <Debian_root>/lib/modules/<Kernel_version>/...... and execute depmod for better experience.(You can modprobe them easily in the debian terminal when works without Android.) :em09

这里再附几张图,哈哈~ :em05

这是我的Connectbot主机列表。【名字取得比较可爱哦!(*^__^*) 嘻嘻……】 :em03 :em02
3.png
正在运行top。 :em09
7.png
这是在写教程,哈哈!(可惜现在平板电脑被老妈收了,哎…… :em20
Screenshost.png
这个就不用介绍了吧!咱们可爱滴Synaptic老兄~ :em02
Screenshot-3.png
Gparted。。。。
Screenshot-2.png
这个比较拉风吧,DosBox! :em09
snapshot_new14.png
话说这是本大侠的另一个头像,可爱吧! :em03
Screenshot.png
WebQQ。
Screenshot-8.png
全屏了。
Screenshot-9.png

嘿嘿,本大侠应该写得还行吧。欢迎各位提出修改意见哦~ :em09

(再插一句,本大侠问的问题至今还没有解决呢…………这楼貌似跑题得很严重啊。。。。。 :em20 :em06
楼主你那个里面的全键盘是安卓下的吗?是什么输入法啊,
felonwan
帖子: 262
注册时间: 2008-09-12 12:32

Re: Android平板改装成了Debian的系统,有点小问题

#112

帖子 felonwan »

mark!

牛!感觉比我这个老骨头技术强不是一点半点的。
felonwan
帖子: 262
注册时间: 2008-09-12 12:32

Re: Android平板改装成了Debian的系统,有点小问题

#113

帖子 felonwan »

要是楼主开发一个Xserver或Wayland的安卓应用,那chroot玩Linux可就方便多了。
felonwan
帖子: 262
注册时间: 2008-09-12 12:32

Re: Android平板改装成了Debian的系统,有点小问题

#114

帖子 felonwan »

哈哈,可能楼主初三了,父母严管中。
felonwan
帖子: 262
注册时间: 2008-09-12 12:32

Re: Android平板改装成了Debian的系统,有点小问题

#115

帖子 felonwan »

oppop007 写了:
『进入Debian shell』

代码: 全选

su
busybox chroot /flash/debian/loop/
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
mount proc /proc -t proc
mount sysfs /sys -t sysfs
mount devpts /dev/pts -t devpts
hostname Jingtian-Pad
bash
export USER=root
export HOME=/root
export DISPLAY=:1
export TERM=xterm
mount /dev/mtdblock8 /mnt/flash
mount /dev/mmcblk0p1 /mnt/tf
clear



『进入GNOME桌面!』

代码: 全选

su
busybox swapon /dev/block/mmcblk0p2
busybox chroot /flash/debian/loop/
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
mount proc /proc -t proc
mount sysfs /sys -t sysfs
mount devpts /dev/pts -t devpts
hostname Jingtian-Pad
bash
export USER=root
export HOME=/root
export DISPLAY=:1
export TERM=xterm
mount /dev/mtdblock8 /mnt/flash
mount /dev/mmcblk0p1 /mnt/tf
clear
#echo "***WILL STOP mediaserver NOW.***"
#echo
#echo "***PRESS ENTER TO CONTINUE***"
#read
cd
pkill -KILL media



################LOOK AT BELOW!!!###############


# Place a wave sound file (At least 6 seconds) in the /root directory!!!


################LOOK AT ABOVE!!!###############




aplay *wav&
sleep 3
pkill -STOP media
pkill -STOP debugg
sleep 5
echo "Good! The mediaserver has been stopped"
pkill aplay
sync
sleep 5
rm nohup.out
start-system-services
nohup stop-android&
nohup X :1&
sleep 9;nohup gnome-session&
#sleep 8;nohup icewm&
#sleep 9;nohup kvkbd&
楼主要是实在没空,能不能直接把参考的英文资料放上来呢。。。这个不费时。

你的这个方法总的来说就是:chroot后启动debian的dbus、hal和acpi服务,杀掉安卓服务,不知道说的对不对?

要是能用触摸屏话,可以试用ubuntu touch,那样就有意思了。
p.s. 我在TF卡上装了一个Linux,启动很快,8s以内,屏保能用,休眠没试过,调节亮度这些没有(太亮了,长时间看不行),触摸屏、重力感应这些不能用,即使是换内核使用自己编译的驱动也不起作用。所以要是能直接使用安卓下的驱动就省事了。
全志A10,1G内存。使用的镜像是:linaro-alip-armhf-t4.img,参考的资料是:http://hi.baidu.com/lang_byebye/item/ea ... f9e7bb7ae4
felonwan
帖子: 262
注册时间: 2008-09-12 12:32

Re: Android平板改装成了Debian的系统,有点小问题

#116

帖子 felonwan »

:em05 搞定chroot的运行Xorg的问题。

我想对许多人都会管用吧。

和以前大家用的chroot一样,只是:
chroot前:

代码: 全选

mount -o bind /dev $chroot_dir/dev
chroot后:

代码: 全选

ln -s /dev/graphics/fb0 /dev/fb0
然后运行

代码: 全选

Xorg :0 vt1 &
就能看到Xorg了,运行桌面的事嘛,嘿嘿,大家各显神通吧。

触摸屏的事还得琢磨一下。。。
头像
photor
论坛版主
帖子: 11004
注册时间: 2008-04-26 12:41

Re: Android平板改装成了Debian的系统,有点小问题

#117

帖子 photor »

felonwan 写了::em05 搞定chroot的运行Xorg的问题。

我想对许多人都会管用吧。

和以前大家用的chroot一样,只是:
chroot前:

代码: 全选

mount -o bind /dev $chroot_dir/dev
chroot后:

代码: 全选

ln -s /dev/graphics/fb0 /dev/fb0
然后运行

代码: 全选

Xorg :0 vt1 &
就能看到Xorg了,运行桌面的事嘛,嘿嘿,大家各显神通吧。

触摸屏的事还得琢磨一下。。。
其实那位小大侠已经说了,不用那么麻烦,直接

代码: 全选

cp -af /dev/graphics/fb0 $chroot_dir/dev/fb0
就可以了
:em09
felonwan
帖子: 262
注册时间: 2008-09-12 12:32

Re: Android平板改装成了Debian的系统,有点小问题

#118

帖子 felonwan »

photor 写了: 其实那位小大侠已经说了,不用那么麻烦,直接

代码: 全选

cp -af /dev/graphics/fb0 $chroot_dir/dev/fb0
就可以了
:em09
嗯,就是。 :em06 我应该就是看到那个才知道可以这么干的。。。
可惜教程一直不出来。所以我又再发了一个主题,呵呵。


ps. 你的触摸屏整好没?
但是他/她这个触摸屏不知道是怎么弄的。。。
我刚弄好xorg.conf文件,android下自带的驱动我不知道该怎么去用它,不过evdev的开源驱动似乎能用。
头像
nexus-s
帖子: 425
注册时间: 2012-05-09 0:06
系统: Ubuntu 16.04.3 LTS

Re: Android平板改装成了Debian的系统,有点小问题

#119

帖子 nexus-s »

rapistor 写了:牛人,太牛了。我好想买个安卓,ubuntu的双系统机器。
nexus 7 一代可以ubuntu desktop arm / android 和ubuntu touch 三系统.... 启动~~ :em11
头像
photor
论坛版主
帖子: 11004
注册时间: 2008-04-26 12:41

Re: Android平板改装成了Debian的系统,有点小问题

#120

帖子 photor »

felonwan 写了:
photor 写了: 其实那位小大侠已经说了,不用那么麻烦,直接

代码: 全选

cp -af /dev/graphics/fb0 $chroot_dir/dev/fb0
就可以了
:em09
嗯,就是。 :em06 我应该就是看到那个才知道可以这么干的。。。
可惜教程一直不出来。所以我又再发了一个主题,呵呵。


ps. 你的触摸屏整好没?
但是他/她这个触摸屏不知道是怎么弄的。。。
我刚弄好xorg.conf文件,android下自带的驱动我不知道该怎么去用它,不过evdev的开源驱动似乎能用。
我没用xorg,直接vnc的 :em09
回复