summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2014-08-21 12:00:01 (EDT)
committer P. J. McDermott <pj@pehjota.net>2014-08-21 12:00:01 (EDT)
commitfb26038e26edfc57e5408cd39446da293d837692 (patch)
tree080409b1618b0ff89a9f9eb34f004eb7b30a8203
parent529f182aaeb0e477f1837ff5ad08e772f67e9dda (diff)
profile_configure_system_native(): New function
-rw-r--r--lib/profile.sh7
-rw-r--r--lib/profiles/proteanos.sh15
2 files changed, 22 insertions, 0 deletions
diff --git a/lib/profile.sh b/lib/profile.sh
index a8beedd..846b22d 100644
--- a/lib/profile.sh
+++ b/lib/profile.sh
@@ -122,3 +122,10 @@ profile_get_fstab()
"prof_${profile}_get_fstab" "${arch}" "${plat}"
}
+
+profile_configure_system_native()
+{
+ local root="${1}"
+
+ "prof_${profile}_configure_system_native" "${root}"
+}
diff --git a/lib/profiles/proteanos.sh b/lib/profiles/proteanos.sh
index 4f52611..cddef89 100644
--- a/lib/profiles/proteanos.sh
+++ b/lib/profiles/proteanos.sh
@@ -17,6 +17,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+use opkg
+
# TODO: This should be replaced with a prof_proteanos_validate_archplat()
# function that gets valid architectures and platforms from the package archive
# (which pro-archman needs to list in the distribution).
@@ -161,3 +163,16 @@ prof_proteanos_get_fstab()
;;
esac
}
+
+prof_proteanos_configure_system_native()
+{
+ local root="${1}"
+
+ printf 'disabled\n' >"${root}/etc/rc.policy"
+ opkg_install_all
+ printf 'enabled\n' >"${root}/etc/rc.policy"
+ [ -r /etc/resolv.conf ] && cp /etc/resolv.conf "${root}/etc"
+ [ -r /etc/hostname ] && cp /etc/hostname "${root}/etc"
+ [ -e "${root}/etc/passwd" ] || printf \
+ 'root::0:0:root:/root:/bin/sh\n' >"${root}/etc/passwd"
+}