ipv6 allow firewall
[automated-distro-installer] / mymk-basefile
1 #!/bin/bash
2
3 x="$(readlink -f "$BASH_SOURCE")"; source "${x%/*}/bash-trace"
4 script_dir="${x%/*}"
5
6 usage() {
7 cat <<EOF
8 Usage: ${0##*/} [-h|--help] [mk-basefile_args]
9 Wrap fai's mk-basefile so output dir is $BASEFILE_DIR if it exists.
10
11 And fix things for trisquel. mk-basefile has a trisquel mirror added.
12
13 fai-project maintains ubuntu and debian basefiles, but it doesn't update
14 them often. Better to build our all our own.
15
16
17 Args I've used before:
18
19 -z STRETCH64
20 -z XENIAL64
21 -z FLIDAS64
22 -z BELENOS64
23
24 -h|--help Print help and exit.
25
26 Note: Uses GNU getopt options parsing style.
27
28 Usage of mk-basefile:
29
30 EOF
31 $script_dir/fai/config/basefiles/mk-basefile -h
32 exit $1
33 }
34
35 case $1 in
36 -h|--help)
37 usage
38 ;;
39 esac
40
41 if [[ $EUID != 0 ]]; then
42 s=sudo
43 fi
44
45 cd /usr/share/debootstrap/scripts
46 for d in belenos flidas; do
47 if [[ ! -L $d && ! -e $d ]]; then
48 $s ln -sf gutsy $d;
49 fi
50 done
51
52 if [[ $BASEFILE_DIR ]]; then
53 cd $BASEFILE_DIR
54 fi
55
56 $s $script_dir/fai/config/basefiles/mk-basefile "$@"