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-tool...
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-...
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
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
Hi Gareth,
Thanks for the patch. Its merged.
On 9 September 2013 15:16, Gareth Stockwell Gareth.Stockwell@arm.comwrote:
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
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
On 10 September 2013 14:30, Gareth Stockwell Gareth.Stockwell@arm.comwrote:
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:
- 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)
Its surprising that we have not hit this issue. Can you share the logs if you have for the above issue ?
- 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
linaro-android-nfs-tool merges initrd+system+data partitions to create a single rootfs which is available for nfs mount. linaro-android-nfs-tool script deletes the entries from fstab. Are you doing any changes to have /system and userdata being mounted as separate partitions ?
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
linaro-android mailing list linaro-android@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-android
Hi Vishal,
/work/local/build/linaro/13.08-4.3/rootfs is the directory produced by linaro-android-nfs-tool.sh.
If I leave this unchanged, and give "nfsroot=10.1.193.42:/work/local/build/linaro/13.08-4.3/rootfs" on the kernel command line, it works fine.
However, to work around the netd problem, I need to provide a ramdisk image. So, I add the following lines to the fstab
10.1.193.42:/work/local/build/linaro/13.08-4.3/rootfs/system /system nfs ro wait 10.1.193.42:/work/local/build/linaro/13.08-4.3/rootfs/data /data nfs ro wait
and then regenerate the ramdisk image, including these changes.
Linux boots using the ramdisk image, but then fails to mount the NFS rootfs as described previously.
I also tried mounting the whole rootfs as a single partition:
10.1.193.42:/work/local/build/linaro/13.08-4.3/rootfs / nfs ro wait
This fails in the same way.
Regards, Gareth
From: Vishal Bhoj [mailto:vishal.bhoj@linaro.org] Sent: 10 September 2013 10:17 To: Gareth Stockwell Cc: linaro-android@lists.linaro.org Subject: Re: Android NFS boot problem
On 10 September 2013 14:30, Gareth Stockwell Gareth.Stockwell@arm.com wrote: 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) Its surprising that we have not hit this issue. Can you share the logs if you have for the above issue ? 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
linaro-android-nfs-tool merges initrd+system+data partitions to create a single rootfs which is available for nfs mount. linaro-android-nfs-tool script deletes the entries from fstab. Are you doing any changes to have /system and userdata being mounted as separate partitions ?
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
_______________________________________________ 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
Hi, Gareth
Sorry for the late response:(.
Have you resolved this problem, what's the status now?
For the nfs mount entry in fstab.arm-versatilexpress, I have not investigated the source of init, but I am afraid the nfs mount is not support in init, although the rootfs is mounted by kernel during boot. I tried to mount and nfs via the mount command before, it did not work.
For the ramdisk, I am sorry I did not get why you need to regenerate the ramdisk. if you just want to include the fstab.arm-verstilexpress in it, you can add it to the rootfs directory directly I think. As Vishal said, the linaro-android-nfs-tool.sh will extract the contents in ramdisk to the rootfs directory.
And I also did not get why you need to change the fstab.arm-verstilexpress file to mount the system/data partition. could you please explain this for me again?
And for the netd problem, Vishal said he did not have such problem on his side, (I do not have the vexpress board, I can not check it:( ) so I guess there maybe other factors there that caused this problem, like the network configuration of your side. could you share me the log when the nfs connection lost?
Thanks, Yongqin Liu
On 10 September 2013 20:12, Gareth Stockwell Gareth.Stockwell@arm.comwrote:
Hi Vishal,
/work/local/build/linaro/13.08-4.3/rootfs is the directory produced by linaro-android-nfs-tool.sh.
If I leave this unchanged, and give "nfsroot=10.1.193.42:/work/local/build/linaro/13.08-4.3/rootfs" on the kernel command line, it works fine.
However, to work around the netd problem, I need to provide a ramdisk image. So, I add the following lines to the fstab
10.1.193.42:/work/local/build/linaro/13.08-4.3/rootfs/system /system nfs ro wait 10.1.193.42:/work/local/build/linaro/13.08-4.3/rootfs/data /data nfs ro wait
and then regenerate the ramdisk image, including these changes.
Linux boots using the ramdisk image, but then fails to mount the NFS rootfs as described previously.
I also tried mounting the whole rootfs as a single partition:
10.1.193.42:/work/local/build/linaro/13.08-4.3/rootfs / nfs ro wait
This fails in the same way.
Regards, Gareth
From: Vishal Bhoj [mailto:vishal.bhoj@linaro.org] Sent: 10 September 2013 10:17 To: Gareth Stockwell Cc: linaro-android@lists.linaro.org Subject: Re: Android NFS boot problem
On 10 September 2013 14:30, Gareth Stockwell Gareth.Stockwell@arm.com wrote: 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:
- 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) Its surprising that we have not hit this issue. Can you share the logs if you have for the above issue ? 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
linaro-android-nfs-tool merges initrd+system+data partitions to create a single rootfs which is available for nfs mount. linaro-android-nfs-tool script deletes the entries from fstab. Are you doing any changes to have /system and userdata being mounted as separate partitions ?
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
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
linaro-android@lists.linaro.org