summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2014-08-21 12:01:14 (EDT)
committer P. J. McDermott <pj@pehjota.net>2014-08-21 12:01:14 (EDT)
commit2e1898e771c1ab91796aa162b45353e79b4e23ce (patch)
treef5ffd02b447974852223665df6773ceb7ae016b6
parentfb26038e26edfc57e5408cd39446da293d837692 (diff)
profile_configure_system_foreign(): New function
-rw-r--r--lib/profile.sh7
-rw-r--r--lib/profiles/proteanos.sh23
2 files changed, 30 insertions, 0 deletions
diff --git a/lib/profile.sh b/lib/profile.sh
index 846b22d..b37b6f7 100644
--- a/lib/profile.sh
+++ b/lib/profile.sh
@@ -129,3 +129,10 @@ profile_configure_system_native()
"prof_${profile}_configure_system_native" "${root}"
}
+
+profile_configure_system_foreign()
+{
+ local root="${1}"
+
+ "prof_${profile}_configure_system_foreign" "${root}"
+}
diff --git a/lib/profiles/proteanos.sh b/lib/profiles/proteanos.sh
index cddef89..822072a 100644
--- a/lib/profiles/proteanos.sh
+++ b/lib/profiles/proteanos.sh
@@ -35,6 +35,18 @@ sys /sys sysfs defaults
/dev /dev none bind
devpts /dev/pts devpts noexec,nosuid,gid=5,mode=0620
"
+prof_proteanos_install_service=\
+'#!/bin/sh /etc/rc.common
+
+start()
+{
+ log "Configuring packages"
+ printf "disabled\n" >/etc/rc.policy
+ opkg install $(opkg list-installed | cut -d " " -f 1)
+ printf "enabled\n" >/etc/rc.policy
+ rm "${SCRIPT}"
+}
+'
prof_proteanos_normalize_suite()
{
@@ -176,3 +188,14 @@ prof_proteanos_configure_system_native()
[ -e "${root}/etc/passwd" ] || printf \
'root::0:0:root:/root:/bin/sh\n' >"${root}/etc/passwd"
}
+
+prof_proteanos_configure_system_foreign()
+{
+ local root="${1}"
+
+ printf '%s' "${prof_proteanos_install_service}" >"${root}/etc/rc.d/S10install"
+ chmod 0755 "${root}/etc/rc.d/S10install"
+ printf 'proteanos\n' >"${root}/etc/hostname"
+ [ -e "${root}/etc/passwd" ] || printf \
+ 'root::0:0:root:/root:/bin/sh\n' >"${root}/etc/passwd"
+}