summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2014-12-03 22:49:03 (EST)
committer P. J. McDermott <pj@pehjota.net>2015-05-24 14:43:42 (EDT)
commit7b960a0e2ebae7df45d377d173581d1b779929ee (patch)
tree7fc1e8dda8c77e4c28a660afb9276b3b68a07210
parenta7ef23dd2fc275f1ea253d9cb3bfc9eba6e849ef (diff)
install_system(): New function
-rw-r--r--lib/install.sh53
1 files changed, 53 insertions, 0 deletions
diff --git a/lib/install.sh b/lib/install.sh
new file mode 100644
index 0000000..7abb558
--- /dev/null
+++ b/lib/install.sh
@@ -0,0 +1,53 @@
+# Functions for installing systems
+#
+# Copyright (C) 2013, 2014 Patrick "P. J." McDermott
+#
+# This file is part of the ProteanOS Development Kit.
+#
+# The ProteanOS Development Kit is free software: you can redistribute
+# it and/or modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# The ProteanOS Development Kit is distributed in the hope that it
+# will be useful, but WITHOUT ANY WARRANTY; without even the implied
+# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with the ProteanOS Development Kit. If not, see
+# <http://www.gnu.org/licenses/>.
+
+[ "x${_INSTALL_SM+set}" = 'xset' ] && return 0
+_INSTALL_SM=1
+
+install_system()
+{
+ local mirror="${1}"
+ local suite="${2}"
+ local arch="${3}"
+ local plat="${4}"
+
+ info "$(get_msg 'cmd_install_setting_up_chroot')"
+ if [ -d "${chroot}" ] && ! dir_is_empty "${chroot}" 'lost+found'; then
+ error 2 "$(get_msg 'cmd_install_chroot_dir_exists')" "${chroot}"
+ fi
+ if ! mkdir -p "${chroot}/.prokit" "${chroot}/prokit"; then
+ error 2 "$(get_msg 'cmd_install_mkdir_chroot_fail')" "${chroot}"
+ fi
+ >"${chroot}/prokit/installing"
+
+ info "$(get_msg 'cmd_install_find_pkgs')"
+ cmd_install_find_pkgs "${mirror}" "${suite}" "${arch}" "${plat}" \
+ "${chroot}"
+ cmd_install_get_pkgs "${chroot}"
+
+ info "$(get_msg 'cmd_install_configuring')"
+ if ! ${foreign}; then
+ profile_configure_system_native "${chroot}" "${arch}" "${plat}"
+ else
+ profile_configure_system_foreign "${chroot}" "${arch}" "${plat}"
+ fi
+
+ rm "${chroot}/prokit/installing"
+}