aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCem Keylan <cem@ckyln.com>2020-05-29 13:02:26 +0300
committerCem Keylan <cem@ckyln.com>2020-05-29 13:02:26 +0300
commitd4b2f804aaa6bbd65cf70eb6cdeaf5ba4899ba22 (patch)
tree36130fbc25bd5dbb9a7e5f9c727da90f9d132cdc
parent989ba82fd00558de17de9e7450128e9fdbccc3fb (diff)
downloadmkrootfs-d4b2f804aaa6bbd65cf70eb6cdeaf5ba4899ba22.tar.gz
mkrootfs: handle rsync repositories
-rwxr-xr-xmkrootfs.sh23
1 files changed, 17 insertions, 6 deletions
diff --git a/mkrootfs.sh b/mkrootfs.sh
index e030d2e..41ee289 100755
--- a/mkrootfs.sh
+++ b/mkrootfs.sh
@@ -42,6 +42,7 @@ BASEDIR="$PWD"
pkg_order $PKGS
# Print variables from the configuration file
+# shellcheck disable=2154
cat <<EOF
Here are the configuration values:
@@ -80,11 +81,21 @@ export KISS_ROOT="$MNTDIR"
# Create parent directories for the repositories, and
# remove pre-existing repositories. We then shallow
# clone the repositories to both locations.
-msg "Cloning repository"
-mkdir -p "$MNTDIR/var/db/kiss" /tmp
-rm -rf /tmp/repo "$MNTDIR/var/db/kiss/repo"
-git clone --depth 1 "$REPO" /tmp/repo
-cp -r /tmp/repo "$MNTDIR/var/db/kiss/repo"
+case $REPO in
+ rysnc://*)
+ msg "Acquiring repository"
+ mkdir -p "$MNTDIR/var/db/kiss" /tmp
+ rm -rf /tmp/repo "$MNTDIR/var/db/kiss/repo"
+ rsync "$REPO/" /tmp/repo
+ cp -r /tmp/repo "$MNTDIR/var/db/kiss/repo"
+ ;;
+ *)
+ msg "Cloning repository"
+ mkdir -p "$MNTDIR/var/db/kiss" /tmp
+ rm -rf /tmp/repo "$MNTDIR/var/db/kiss/repo"
+ git clone --depth 1 "$REPO" /tmp/repo
+ cp -r /tmp/repo "$MNTDIR/var/db/kiss/repo"
+esac
# Install extra repositories defined in a 'repositories'
# file if it exists. The file is formed by these three
@@ -142,6 +153,6 @@ postinstall
msg "Generating rootfs to $BASEDIR"
(
cd "$MNTDIR" || die "Could not change directory to $MNTDIR"
- tar -cpvJf "$BASEDIR/carbs-rootfs-$(date +%Y%m%d)-$(uname -m).tar.xz" .
+ tar -cJf "$BASEDIR/carbs-rootfs-$(date +%Y%m%d)-$(uname -m).tar.xz" .
)
msg "Done!"