Browse Source

Added suport for bash auto-complete and config options for downloading burrow from the repo

master
B.J. Dweck 1 year ago
parent
commit
fac7876b18
6 changed files with 56 additions and 13 deletions
  1. +4
    -1
      build.sh
  2. +34
    -9
      stage2/04-rudefox-burrow/01-run.sh
  3. +7
    -2
      stage2/04-rudefox-burrow/02-run.sh
  4. +5
    -0
      stage2/04-rudefox-burrow/03-run.sh
  5. +5
    -0
      stage2/04-rudefox-burrow/04-run.sh
  6. +1
    -1
      stage2/07-enable-overlayfs/00-run.sh

+ 4
- 1
build.sh View File

@ -147,7 +147,10 @@ export PI_GEN=${PI_GEN:-pi-gen}
export PI_GEN_REPO=${PI_GEN_REPO:-https://github.com/RPi-Distro/pi-gen}
export IMG_NAME="${IMG_NAME:-RasbianBurrow}"
export RUDEFOX_BURROW_VERSION=${RUDEFOX_BURROW_VERSION:-"0.0.2"}
export RUDEFOX_REPO_USERNAME="${RUDEFOX_REPO_USERNAME:-anonymous}"
export RUDEFOX_REPO_PASSWORD="${RUDEFOX_REPO_PASSWORD:-default}"
export RUDEFOX_BURROW_VERSION="${RUDEFOX_BURROW_VERSION:-latest}"
export USE_QEMU="${USE_QEMU:-0}"
export IMG_DATE="${IMG_DATE:-"$(date +%Y-%m-%d)"}"
export IMG_FILENAME="${IMG_FILENAME:-"${IMG_DATE}-${IMG_NAME}"}"

+ 34
- 9
stage2/04-rudefox-burrow/01-run.sh View File

@ -1,11 +1,36 @@
#!/bin/bash -e
#!/bin/bash
mkdir -p "${ROOTFS_DIR}/opt/"
rm -rf "${ROOTFS_DIR}/opt/rudefox-burrow"
wget "https://repo.rudefox.io/repository/maven-public/io/rudefox/burrow/${RUDEFOX_BURROW_VERSION}/burrow-${RUDEFOX_BURROW_VERSION}.tar"
tar -C "${ROOTFS_DIR}/opt/" -xvf burrow*.tar
mv "${ROOTFS_DIR}/opt/burrow-"* "${ROOTFS_DIR}/opt/rudefox-burrow"
export RUDEFOX_REPO_BASE_URL="https://repo.rudefox.io"
export RUDEFOX_REPO_RELEASES="maven-releases"
export RUDEFOX_GROUP="io.rudefox"
export RUDEFOX_BURROW_ID="burrow"
export OUTFILE="burrow.tar"
export WGET_OPTS="--https-only -O ${OUTFILE} -v"
export WGET_URL="${RUDEFOX_REPO_BASE_URL}/service/rest/v1/search/assets/download?group=${RUDEFOX_GROUP}&name=${RUDEFOX_BURROW_ID}&maven.extension=tar"
if [ $RUDEFOX_BURROW_VERSION != "latest" ]
then
export WGET_URL="${WGET_URL}&maven.baseVersion=${RUDEFOX_BURROW_VERSION}"
else
export WGET_URL="${WGET_URL}&sort=version"
fi
if [ $RUDEFOX_REPO_USERNAME != "anonymous" ]
then
export ENCODED_USERNAME=$(echo -n $RUDEFOX_REPO_USERNAME | base64 | sed 's/+/-/g; s/\//_/g; s/=/%3D/g';)
export ENCODED_PASSWORD=$(echo -n $RUDEFOX_REPO_PASSWORD | base64 | sed 's/+/-/g; s/\//_/g; s/=/%3D/g';)
export POST_DATA="username=${ENCODED_USERNAME}&password=${ENCODED_PASSWORD}"
wget --save-cookies cookies.txt --keep-session-cookies --post-data $POST_DATA "${RUDEFOX_REPO_BASE_URL}/service/rapture/session"
wget --load-cookies cookies.txt $WGET_OPTS $WGET_URL
rm cookies.txt
else
wget $WGET_OPTS "${WGET_URL}&repository=${RUDEFOX_REPO_RELEASES}"
fi
on_chroot <<EOF
ln -fs /opt/rudefox-burrow/bin/burrow /usr/bin/burrow
EOF

+ 7
- 2
stage2/04-rudefox-burrow/02-run.sh View File

@ -1,5 +1,10 @@
#!/bin/bash -e
echo "" >> "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/.bashrc"
echo "unset HISTFILE" >> "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/.bashrc"
mkdir -p "${ROOTFS_DIR}/opt/"
rm -rf "${ROOTFS_DIR}/opt/rudefox-burrow"
tar -C "${ROOTFS_DIR}/opt/" -xvf burrow.tar
mv "${ROOTFS_DIR}/opt/burrow-"* "${ROOTFS_DIR}/opt/rudefox-burrow"
on_chroot <<EOF
ln -fs /opt/rudefox-burrow/bin/burrow /usr/bin/burrow
EOF

+ 5
- 0
stage2/04-rudefox-burrow/03-run.sh View File

@ -0,0 +1,5 @@
#!/bin/bash -e
echo "" >> "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/.bashrc"
echo ". <(burrow generate-completion)" >> "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/.bashrc"

+ 5
- 0
stage2/04-rudefox-burrow/04-run.sh View File

@ -0,0 +1,5 @@
#!/bin/bash -e
echo "" >> "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/.bashrc"
echo "unset HISTFILE" >> "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/.bashrc"

+ 1
- 1
stage2/07-enable-overlayfs/00-run.sh View File

@ -6,7 +6,7 @@ install -m 644 files/enable-overlayfs.target "${ROOTFS_DIR}/etc/systemd/system/"
install -m 755 files/enable_overlayfs.sh "${ROOTFS_DIR}/usr/bin/"
on_chroot << EOF
ln -s /etc/systemd/system/enable-overlayfs.service /etc/systemd/system/enable-overlayfs.target.wants/enable-overlayfs.service
ln -sf /etc/systemd/system/enable-overlayfs.service /etc/systemd/system/enable-overlayfs.target.wants/enable-overlayfs.service
systemctl daemon-reload
systemctl set-default enable-overlayfs.target
EOF

Loading…
Cancel
Save