From 7b960a0e2ebae7df45d377d173581d1b779929ee Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Wed, 03 Dec 2014 22:49:03 -0500 Subject: install_system(): New function --- (limited to 'lib') 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 +# . + +[ "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" +} -- cgit v0.9.1