mkrootfs

Carbs rootfs generator
git clone git://git.carbslinux.org/mkrootfs
Log | Files | Refs | README | LICENSE

commit d4b2f804aaa6bbd65cf70eb6cdeaf5ba4899ba22
parent 989ba82fd00558de17de9e7450128e9fdbccc3fb
Author: Cem Keylan <cem@ckyln.com>
Date:   Fri, 29 May 2020 13:02:26 +0300

mkrootfs: handle rsync repositories

Diffstat:
Mmkrootfs.sh | 23+++++++++++++++++------
1 file changed, 17 insertions(+), 6 deletions(-)

diff --git 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!"