The next problem I encountered is that Android loses the connection to the NFS server during boot. This is a known problem: http://code.google.com/p/android/issues/detail?id=24335
For now, I have applied the workaround described in that issue (modify netd to disable routing table flush).
The proper solution, again as described in the issue, is to add a script to the ramdisk image which will restore the relevant routing rules - this should be done by linaro-android-nfs-tool.sh.
I think that this should be possible as follows:
1. Modify external/iptables/Android.mk to build iptables-save and iptables-restore 2. Boot the system with the netd workaround described above, and run iptables-save 3. Convert the output into a script containing iptables commands (using e.g. http://www.3open.org/d/tips/perl_script_to_convert_iptables-save_output_to_s...) 4. Add to the ramdisk in /system/bin/oem-iptables-init.sh (and possibly also copy in /system/bin/iptables) 5. Modify fstab.arm-versatilexpress to mount /system and /data from NFS
Having done steps 1-4, I'm stuck on 5 - whatever I put in the fstab, it fails to mount: [ 7.012569] fs_mgr: Cannot mount filesystem on 10.1.193.42:/work/local/build/linaro/13.08-4.3/rootfs/system at /system [ 7.016630] init: fs_mgr_mount_all returned an error
I have tried the following 10.1.193.42:/work/local/build/linaro/13.08-4.3/rootfs/system /system nfs ro wait
And variants, using different NFS options: ro ro,tcp ro,tcp,vers=3 ro,tcp,vers=3,nolock ...
Does anyone know the correct fstab incantation to make this work?
From: Vishal Bhoj [mailto:vishal.bhoj@linaro.org] Sent: 09 September 2013 16:39 To: Gareth Stockwell Cc: linaro-android@lists.linaro.org Subject: Re: Android NFS boot problem
Hi Gareth,
Thanks for the patch. Its merged.
On 9 September 2013 15:16, Gareth Stockwell Gareth.Stockwell@arm.com wrote: The fix turned out to be pretty straightforward: clear the shell's umask prior to extracting from the tarballs, to ensure that the permissions of the rootfs contents are preserved.
commit 6095bb5ef1e068e6d14baf26588b3a67a501a2cc Author: Gareth Stockwell gareth.stockwell@arm.com AuthorDate: Mon Sep 9 10:43:04 2013 +0100 Commit: Gareth Stockwell gareth.stockwell@arm.com CommitDate: Mon Sep 9 10:43:04 2013 +0100
linaro-android-nfs-tool.sh: clear umask before creating rootfs
This ensures that all files and directories are extracted from the tarballs with the correct permissions.
diff --git a/linaro-android-nfs-tool.sh b/linaro-android-nfs-tool.sh index 2432a45..e1cfbcf 100755 --- a/linaro-android-nfs-tool.sh +++ b/linaro-android-nfs-tool.sh @@ -313,6 +313,8 @@ function func_install_binaries(){ }
function func_create_rootfs(){ + umask 0 + if [ -z "${rootfs_dir}" ];then template=$(date '+%y%m%d-%H%M%S') rootfs_dir=`mktemp -d -u --tmpdir=${default_nfs_root_dir} -t $template.XXX`
-----Original Message----- From: linaro-android-bounces@lists.linaro.org [mailto:linaro-android- bounces@lists.linaro.org] On Behalf Of Gareth Stockwell Sent: 06 September 2013 17:24 To: linaro-android@lists.linaro.org Subject: Android NFS boot problem
I am facing a problem booting Android on TC2 via NFS, using the scripts provided in linaro-android-tools.
http://android.git.linaro.org/gitweb?p=platform/external/linaro- android-tools.git;a=shortlog;h=refs/heads/linaro_android_4.3
The rootfs is successfully mounted and /init is executed, but system services fail to launch due to a permissions problem:
Command line 'earlyprintk mem=2G rw ip=dhcp --no-log console=ttyAMA0,38400n8 root=/dev/nfs nfsrootdebug nfsroot=10.1.193.42:/work/local/build/linaro/13.08-4.3/rootfs,tcp,v3 init=/init' ... [ 15.584115] VFS: Mounted root (nfs filesystem) on device 0:12. ... [ 18.447297] init: cannot execve('/system/bin/servicemanager'): Permission denied
I am using the prebuilt binaries from the 4.3-13.08 release for vexpress: https://android-build.linaro.org/builds/~linaro-android/vexpress- linaro-4.3-13.08-release/#build=1
My /etc/exports has this: /work/local/build/linaro/13.08-4.3/rootfs *(rw,sync,no_root_squash,no_subtree_check)
I have tried adding various options to the nfsroot kernel argument (proto=tcp; vers=3; nolock; exec), but none of these has any effect.
Using a Debian rootfs created using qemu-debootstrap, with the same options in /etc/exports and using the same kernel image, the system boots up successfully.
Has anyone seen this problem before?
-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2557590 ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2548782
linaro-android mailing list linaro-android@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-android
-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2557590 ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2548782
_______________________________________________ linaro-android mailing list linaro-android@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-android
-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2557590 ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2548782