[英]Install linux-headers on nexus 7 2013 running ubuntu touch
I have installed ubuntu touch on my nexus 7 2013 recently, and have faced problem installing driver for Moxa Uport usb adapter.我最近在我的 nexus 7 2013 上安装了 ubuntu touch,但在为 Moxa Uport USB 适配器安装驱动程序时遇到了问题。 Actually the driver needs to be compilled and this is why I need linux headers to be installed.实际上驱动程序需要编译,这就是为什么我需要安装 linux 头文件。 I have found, that:我发现:
apt-get install linux-headers-`uname -r`
needs to write something to /lib/modules and this path belongs to /dev/loop1 which is mounted as readonly.需要向 /lib/modules 写入一些内容,该路径属于以只读方式挂载的 /dev/loop1。 I'm able to remount it to rw, but on single attempt to write there, it falls back to readonly.我可以将它重新安装到 rw,但是在一次尝试写入时,它会回退到只读状态。
nothing about loop1 or /lib/modules in /etc/fstab没有关于 /etc/fstab 中的 loop1 或 /lib/modules
command:命令:
mount | grep loop1
output:输出:
/dev/loop1 on /android/system type ext4 (ro,relatime,data=ordered)
/dev/loop1 on /etc/ubuntu-touch-session.d/android.conf type ext4 (ro,relatime,data=ordered)
/dev/loop1 on /lib/udev/rules.d/70-android.rules type ext4 (ro,relatime,data=ordered)
/dev/loop1 on /usr/share/powerd/device_configs/config-default.xml type ext4 (ro,relatime,data=ordered)
/dev/loop1 on /lib/modules type ext4 (ro,relatime,data=ordered)
/dev/loop1 on /var/lib/lxc/android/rootfs/system type ext4 (ro,relatime,data=ordered)
command:命令:
blockdev --report |grep loop1
output:输出:
ro 256 512 4096 0 126427136 /dev/loop1
then:然后:
blockdev --setrw /dev/loop1
blockdev --report |grep loop1
output:输出:
rw 256 512 4096 0 126427136 /dev/loop1
command:命令:
mount -o remount,rw /dev/loop1
mount | grep loop1
output:输出:
/dev/loop1 on /android/system type ext4 (ro,relatime,data=ordered)
/dev/loop1 on /etc/ubuntu-touch-session.d/android.conf type ext4 (ro,relatime,data=ordered)
/dev/loop1 on /lib/udev/rules.d/70-android.rules type ext4 (ro,relatime,data=ordered)
/dev/loop1 on /usr/share/powerd/device_configs/config-default.xml type ext4 (ro,relatime,data=ordered)
/dev/loop1 on /lib/modules type ext4 (ro,relatime,data=ordered)
/dev/loop1 on /var/lib/lxc/android/rootfs/system type ext4 (rw,relatime,data=ordered)
strange, only /var/lib/lxc/android/rootfs/system was set to rw奇怪,只有 /var/lib/lxc/android/rootfs/system 被设置为 rw
so:所以:
mount -o remount,rw /lib/modules
mount | grep loop1
output:输出:
/dev/loop1 on /android/system type ext4 (ro,relatime,data=ordered)
/dev/loop1 on /etc/ubuntu-touch-session.d/android.conf type ext4 (ro,relatime,data=ordered)
/dev/loop1 on /lib/udev/rules.d/70-android.rules type ext4 (ro,relatime,data=ordered)
/dev/loop1 on /usr/share/powerd/device_configs/config-default.xml type ext4 (ro,relatime,data=ordered)
/dev/loop1 on /lib/modules type ext4 (rw,relatime,data=ordered)
/dev/loop1 on /var/lib/lxc/android/rootfs/system type ext4 (rw,relatime,data=ordered)
but:但是:
mkdir /lib/modules/rrr
output:输出:
mkdir: cannot create directory Б─≤/lib/modules/rrrБ─≥: Read-only file system
dmesg:留言:
[ 8280.681213] EXT4-fs (loop1): previous I/O error to superblock detected
[ 8280.681579] Buffer I/O error on device loop1, logical block 0
[ 8280.682006] lost page write due to I/O error on loop1
[ 8280.682037] EXT4-fs error (device loop1): ext4_journal_start_sb:328: Detected aborted journal
[ 8280.682891] EXT4-fs (loop1): Remounting filesystem read-only
[ 8280.683135] EXT4-fs (loop1): previous I/O error to superblock detected
[ 8280.683593] Buffer I/O error on device loop1, logical block 0
I think the abowe is the reason of:我认为abowe是以下原因:
apt-get install linux-headers-`uname -r`
fails with:失败:
Unpacking linux-headers-3.4.0-5-flo (3.4.0-5.19~15.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/linux-headers-3.4.0-5-flo_3.4.0-5.19~15.04.1_armhf.deb (--unpack):
error creating symbolic link `./lib/modules/3.4.0-5-flo/build': Read-only file system
Errors were encountered while processing:
/var/cache/apt/archives/linux-headers-3.4.0-5-flo_3.4.0-5.19~15.04.1_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
So, I got stuck on this, could please anybody help me?所以,我被困在这个问题上,请问有人可以帮助我吗?
Regards, Victor问候, 维克多
Well, being not very experienced in ubuntu touch, android, linux, armhf stuff, I wasn't able to do it right and straightforward way.好吧,由于在 ubuntu touch、android、linux、armhf 方面不是很有经验,我无法以正确和直接的方式做到这一点。 Perhaps hacking boot.img could help but I'm not ready for this.也许破解 boot.img 会有所帮助,但我还没准备好。
The only workaround I was able to imagine is mounting /lib/modules/3.4.0-5-flo to different new loop device.我能想到的唯一解决方法是将 /lib/modules/3.4.0-5-flo 安装到不同的新循环设备。 It works though.它虽然有效。
cd /userdata
dd bs=1M count=100 if=/dev/zero of=build.img
losetup /dev/loop2 build.img
mkfs -t ext3 -m 1 -v /dev/loop2
mkdir /eee
mount -t ext3 /dev/loop2 /eee
cp -r /lib/modules/3.4.0-5-flo/. /eee
umount /eee
mount /dev/loop2 /lib/modules/3.4.0-5-flo
rmdir /eee
From this point I got able to install linux headers and compile Moxa's drivers.从这一点上,我能够安装 linux 头文件并编译 Moxa 的驱动程序。 I have discovered that drivers makefile aslo writes to /lib/modules/3.4.0-5-flo by the way.顺便说一下,我发现驱动程序 makefile 也写入 /lib/modules/3.4.0-5-flo 。
So, to make mount permanent, and failed to change /etc/fstab I had to add to rc.local:因此,为了使挂载永久化,并且无法更改 /etc/fstab,我必须添加到 rc.local:
losetup /dev/loop2 /userdata/build.img
mount /dev/loop2 /lib/modules/3.4.0-5-flo
modprobe mxu11x0
I know it's rather wierd solution, but worked for me :)我知道这是相当奇怪的解决方案,但对我有用:)
在 ubuntu touch 上,rootfs 是只读的,因此您通常必须将其重新安装为读写才能在其上使用 apt。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.