diff options
author | Yongqin Liu <yongqin.liu@linaro.org> | 2013-08-02 21:10:55 +0800 |
---|---|---|
committer | Yongqin Liu <yongqin.liu@linaro.org> | 2013-08-02 21:10:55 +0800 |
commit | 69624a2a21023063172d5bfe8982207fd07a40c4 (patch) | |
tree | fb6c70fe2ab2bf7e2debc4060c0f95096da42210 | |
parent | b327762182364f28585a8e87ec6ff2f7c24faec0 (diff) | |
download | linaro-android-tools-69624a2a21023063172d5bfe8982207fd07a40c4.tar.gz |
linaro-android-nfs-tool.sh: remove the hard coded omap4pandaboard
change to get the hardware from the fstab.* file at root directory
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rwxr-xr-x | linaro-android-nfs-tool.sh | 13 | ||||
-rwxr-xr-x | nfs-sample.sh | 2 |
2 files changed, 11 insertions, 4 deletions
diff --git a/linaro-android-nfs-tool.sh b/linaro-android-nfs-tool.sh index d1102d4..58f68af 100755 --- a/linaro-android-nfs-tool.sh +++ b/linaro-android-nfs-tool.sh @@ -262,13 +262,20 @@ function uncompress_tarball(){ } function update_init_files(){ - file_fstab="${nfs_entry_path}/fstab.omap4pandaboard" + count=$(ls -l ${nfs_entry_path}/fstab.* 2>/dev/null|wc -l) + if [ "X${count}" != "X1" ];then + echo "Failed to find the fstab file in root directory" + exit 1 + fi + file_fstab="$(ls ${nfs_entry_path}/fstab.*)" sed -i "\%\s\+/data\s\+%d" ${file_fstab} sed -i "\%\s\+/system\s\+%d" ${file_fstab} sed -i "\%\s\+/cache\s\+%d" ${file_fstab} + file_fstab_basename=$(basename "${file_fstab}") + hardware=${file_fstab_basename#fstab.} #hack on installd command to support boot via nfs - sed -i "/on boot/a\ setprop hack.installd.for.nfs 1" "${nfs_entry_path}/init.omap4pandaboard.rc" + sed -i "/on boot/a\ setprop hack.installd.for.nfs 1" "${nfs_entry_path}/init.${hardware}.rc" } function func_install_binaries(){ @@ -458,7 +465,7 @@ function main(){ if [ $? -eq 0 ]; then if [ "X$(id -u)" != "X0" ]; then echo "You need have the root permission to manage the nfs service or nfs entry" - exit 0 + exit 1 fi fi diff --git a/nfs-sample.sh b/nfs-sample.sh index 1347af6..ee65023 100755 --- a/nfs-sample.sh +++ b/nfs-sample.sh @@ -8,7 +8,7 @@ netmask="255.255.255.0" board_ip="192.168.9.110" #board_ip="dhcp" -rm -fr "${rootfs_dir}" +./linaro-android-nfs-tool.sh delete-rootfs --rootfs-dir "${rootfs_dir}" if [ $? -ne 0 ]; then echo "Faild to remove the old ${rootfs_dir}" exit 1 |