summaryrefslogtreecommitdiff
path: root/xib_env
blob: 60d09ef49dd04836713931e346f20b2b63ca8426 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh

export CHECKMARK="✔"
export CROSSMARK="✘"
export TABCHAR="╰┈➤ "
export INFOCHAR=" ~ "


export MAKEFLAGS="-j$(grep "processor" /proc/cpuinfo | wc -l)"

export XIB_DIR="/var/lib/xib"
export XIB_BUILDFILES="$XIB_DIR/buildfiles"
export XIB_CHROOT="$XIB_DIR/chroot"
export XIB_EXPORT="$XIB_DIR/export"

export PRIV_KEY="/home/david/.ssh/xi.pem"
export PUB_KEY="/home/david/.ssh/xi.pub"
export DEVELOPMENT_BUILDFILES="/home/david/docs/proj/xilinux/buildfiles"

export BUILDFILES_GIT_REPO="https://xi.davidovski.xyz/git/buildfiles.git"
export INSTALLED_PACKAGES="$XIB_CHROOT/installed"

mkdir -p $XIB_DIR $XIB_BUILDFILES $XIB_CHROOT $XIB_EXPORT

if [ -d $DEVELOPMENT_BUILDFILES ]; then
    cp -r $DEVELOPMENT_BUILDFILES/* $XIB_BUILDFILES/
else
    if [ -d $XIB_BUILDFILES/.git ]; then
        cd $XIB_BUILDFILES
        git pull
        cd $OLDPWD
    else
        git clone $BUILDFILES_GIT_REPO $XIB_BUILDFILES
    fi
fi

[ -f $INSTALLED_PACKAGES ] || touch $INSTALLED_PACKAGES

[ -f $XIB_CHROOT/etc/resolv.conf ] || cp /etc/resolv.conf $XIB_CHROOT/etc/resolv.conf