hwe kernel to fix btrfs-send bug
[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 EOF
28 $script_dir/fai/config/basefiles/mk-basefile -h
29 exit $1
30 }
31
32 case $1 in
33 -h|--help)
34 usage
35 ;;
36 esac
37
38 if [[ $EUID != 0 ]]; then
39 s=sudo
40 fi
41
42 cd /usr/share/debootstrap/scripts
43 for d in belenos flidas; do
44 if [[ ! -L $d && ! -e $d ]]; then
45 $s ln -sf gutsy $d;
46 fi
47 done
48
49 if [[ $BASEFILE_DIR ]]; then
50 cd $BASEFILE_DIR
51 fi
52
53 $s $script_dir/fai/config/basefiles/mk-basefile "$@"