OSDN Git Service

[fix] : Fixed mirror .
[alterlinux/LUBS.git] / lubs
1 #!/usr/bin/env bash
2
3 set -e -u
4
5 export LANG=C
6
7
8 arch=amd64
9 work_dir="work"
10 script_path=$(readlink -f ${0%/*})
11 script_dir=$(dirname ${script_path})
12 codename="bionic"
13 mirror="http://ftp.jaist.ac.jp/pub/Linux/ubuntu/"
14
15
16 # Show an INFO message
17 # _msg_info <message>
18 function _msg_info () {
19     local _msg="${@}"
20     echo "[LUBS Core] INFO: ${_msg}"
21 }
22
23 # Show an ERROR message then exit with status
24 # _msg_error <message> <exit code>
25 function _msg_error() {
26     local _msg="${1}"
27     local _error=${2}
28     echo
29     echo "[LUBS Core] ERROR: ${_msg}" >&2
30     echo
31     if [[ ! ${_error} = 0 ]]; then
32         exit ${_error}
33     fi
34 }
35
36 function install_ubuntu() {
37     _msg_info "Installing Ubuntu to '${work_dir}/airootfs/'..."
38     mkdir -p ${work_dir}/airootfs
39     debootstrap --arch=${arch} --verbose --merged-usr ${codename} ${work_dir}/airootfs ${mirror}
40     _msg_info "${codename} installed successfully!"
41 }
42
43 install_ubuntu