2020-11-06 06:46:00 +00:00
|
|
|
#!/bin/bash
|
2021-01-22 20:07:57 +00:00
|
|
|
if [ $(id -u) -ne 0 ]
|
|
|
|
then echo "Please run the installer with sudo/as root"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2020-11-06 06:46:00 +00:00
|
|
|
set -ex
|
|
|
|
export LUET_NOLOCK=true
|
|
|
|
|
2021-01-22 20:07:57 +00:00
|
|
|
LUET_VERSION=$(curl -s https://api.github.com/repos/mudler/luet/releases/latest | ( grep -oP '"tag_name": "\K(.*)(?=")' || echo "0.9.24" ))
|
2020-11-06 06:46:00 +00:00
|
|
|
LUET_ROOTFS=${LUET_ROOTFS:-/}
|
2020-11-08 13:33:34 +00:00
|
|
|
LUET_DATABASE_PATH=${LUET_DATABASE_PATH:-/var/luet/db}
|
2020-11-06 06:46:00 +00:00
|
|
|
LUET_DATABASE_ENGINE=${LUET_DATABASE_ENGINE:-boltdb}
|
2020-11-08 13:33:34 +00:00
|
|
|
LUET_CONFIG_PROTECT=${LUET_CONFIG_PROTECT:-1}
|
2020-11-06 06:46:00 +00:00
|
|
|
|
2021-01-16 18:55:46 +00:00
|
|
|
curl -L https://github.com/mudler/luet/releases/download/${LUET_VERSION}/luet-${LUET_VERSION}-linux-amd64 --output luet
|
2020-11-06 06:46:00 +00:00
|
|
|
chmod +x luet
|
|
|
|
|
|
|
|
mkdir -p /etc/luet/repos.conf.d || true
|
2020-11-08 13:33:34 +00:00
|
|
|
mkdir -p $LUET_DATABASE_PATH || true
|
|
|
|
mkdir -p /var/tmp/luet || true
|
|
|
|
|
2020-11-06 06:46:00 +00:00
|
|
|
if [ "${LUET_CONFIG_PROTECT}" = "1" ] ; then
|
|
|
|
mkdir -p /etc/luet/config.protect.d || true
|
2021-01-16 18:55:46 +00:00
|
|
|
curl -L https://raw.githubusercontent.com/mudler/luet/master/contrib/config/config.protect.d/01_etc.yml.example --output /etc/luet/config.protect.d/01_etc.yml
|
2020-11-06 06:46:00 +00:00
|
|
|
fi
|
2021-01-16 18:55:46 +00:00
|
|
|
curl -L https://raw.githubusercontent.com/mocaccinoOS/repository-index/master/packages/mocaccino-repository-index.yml --output /etc/luet/repos.conf.d/mocaccino-repository-index.yml
|
2020-11-06 06:46:00 +00:00
|
|
|
|
|
|
|
cat > /etc/luet/luet.yaml <<EOF
|
|
|
|
general:
|
|
|
|
debug: false
|
|
|
|
system:
|
|
|
|
rootfs: ${LUET_ROOTFS}
|
|
|
|
database_path: "${LUET_DATABASE_PATH}"
|
|
|
|
database_engine: "${LUET_DATABASE_ENGINE}"
|
2020-11-08 13:33:34 +00:00
|
|
|
tmpdir_base: "/var/tmp/luet"
|
2020-11-06 06:46:00 +00:00
|
|
|
EOF
|
|
|
|
|
2021-01-22 20:07:57 +00:00
|
|
|
./luet install -y repository/luet repository/mocaccino-repository-index
|
|
|
|
./luet install -y system/luet system/luet-extensions
|
2020-11-06 06:46:00 +00:00
|
|
|
|
|
|
|
rm -rf luet
|
2021-01-22 20:07:57 +00:00
|
|
|
|