Skip to content

Commit

Permalink
Merge branch 'release/0.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldotknopf committed Oct 13, 2017
2 parents 1beff3e + 04ac7e3 commit 33d9f3b
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 8 deletions.
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,14 @@ all: build
build: deps
$(GO) build -ldflags "-X main.GitCommit=${GIT_COMMIT}${GIT_DIRTY} -X main.Version=${SEMVAR_VERSION}" -o bin/${BIN}
package: build
cp grub-mkconfig-script bin/
tar cvzpf bin/darch-${GOARCH}.tar.gz -C bin darch grub-mkconfig-script
mkdir -p bin/etc/grub.d/
mkdir -p bin/usr/bin/
cp grub-mkconfig-script bin/etc/grub.d/60_darch
cp bin/darch bin/usr/bin/darch
tar cvzpf bin/darch-${GOARCH}.tar.gz -C bin usr/bin/darch etc/grub.d/60_darch
clean:
$(GO) clean -i $(PKG)
rm -r bin/
rm -r -f bin/
deps:
$(GO) get -d $(PKG)
$(GO) install $(DEPS)
Expand Down
3 changes: 2 additions & 1 deletion grub-mkconfig-script
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ for i in $(find /boot/darch/ -type d); do
linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
initrd=initramfs-linux.img


darch_source_block_device=`df --output=source $i | tail -1`
darch_source_uuid=`blkid $darch_source_block_device | sed -n 's/.* UUID=\"\([^\"]*\)\".*/\1/p'`
darch_source_absolute=`echo ${i#$(df $i --output=target | tail -1)}`
darch_cmdline="darchdir=UUID=$darch_source_uuid:$darch_source_absolute"
linux_entry "Darch - $image_name" "${version}" "simple" "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT} $darch_cmdline"
linux_entry "Darch - $rel_dirname" "${version}" "simple" "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT} $darch_cmdline"
done
6 changes: 2 additions & 4 deletions scripts/arch/PKGBUILD-template
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ md5sums=()
noextract=()
validpgpkeys=()
package() {
install -d $pkgdir/usr/bin
install darch $pkgdir/usr/bin
install -d $pkgdir/etc/grub.d/
install grub-mkconfig-script $pkgdir/etc/grub.d/60_darch
# The tarball has all the directories setup correctly.
cp * -r $pkgdir
}
40 changes: 40 additions & 0 deletions scripts/install
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash
set -e

if [[ ! $EUID -eq 0 ]]; then
echo "This script should only be run as root user."
exit 1
fi


if [ -z "$DARCH_TAG" ]; then
DARCH_TAG=`curl https://api.github.com/repos/pauldotknopf/darch/releases/latest -s | jq .tag_name -r`
if [ -z "$DARCH_TAG" ]; then
echo Could not get the latest tag from GitHub.
exit 1
fi
fi

echo "Installing tag: $DARCH_TAG"

echo "Checking for previously installed Darch..."

if [ -f /etc/grub.d/60_darch ]; then
echo "Found /etc/grub.d/60_darch, removing..."
rm /etc/grub.d/60_darch
fi

if [ -f /usr/bin/darch ]; then
echo "Found /usr/bin/darch, removing..."
rm /usr/bin/darch
fi

echo "Downloading and extracting darch..."

wget -O- -q https://github.com/pauldotknopf/darch/releases/download/$DARCH_TAG/darch-amd64.tar.gz | tar xpz -C /

echo "Verifying installation..."

darch version

echo "Darch is now installed!"

0 comments on commit 33d9f3b

Please sign in to comment.