Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Maintainer: Jonathan Steel <jsteel at archlinux.org>
- # Contributor: Peter Simons <[email protected]>
- pkgname=nhos
- pkgver=1.1.5
- pkgrel=1
- pkgdesc="nicehash os miner without the os part"
- arch=('x86_64')
- url="https://www.nicehash.com/my/"
- license=('multi')
- depends=('glibc')
- makedepends=('glibc')
- source=(https://www.nicehash.com/my/mining/rigs/$pkgname-$pkgver.img)
- conflicts=('nhos')
- md5sums=('72a097a2a025a08bfefabed1790b2177')
- BASEDIR="`pwd`"
- build() {
- BUILDDIR="$BASEDIR/build";
- SRCDIR="$BASEDIR/src"
- mkdir -p "$BUILDDIR"
- mkdir -p "$SRCDIR"
- # mount nhos img file as root
- OFFSET=$((`fdisk -u sectors -l "$BASEDIR/$pkgname-$pkgver.img" 2> /dev/null | tail -n1 | awk -F' ' '{print $2}'`*512))
- mkdir -p $SRCDIR/$pkgname-$pkgver
- #mount -t auto -o loop,ro,user=image,offset=$OFFSET $pkgname-$pkgver.img $SRCDIR/$pkgname-$pkgver/
- # extract nhos-miner image
- cd "$BUILDDIR"
- echo "Extracting to `pwd`"
- for d in `ls $SRCDIR/$pkgname-$pkgver/apps/default/*.tcz`;
- do
- DIR=`basename $d | rev | cut -c5- | rev`;
- unsquashfs "$d";
- cp -Rf squashfs-root/* ./;
- rm -rf squashfs-root;
- done
- # extract initramfs
- echo "Extract initramfs"
- cd "$BUILDDIR"
- mkdir -p "$BUILDDIR/initramfs"
- cd "$BUILDDIR/initramfs/"
- zcat "$SRCDIR/$pkgname-$pkgver/boot/default/initrd.gz" | cpio -idmvu -Wall && echo
- echo "Return status is $?"
- echo "Changing to $BASEDIR"
- cd "$BASEDIR"
- # cp initramfs etc/sysconfig/nhos dir to unsquashed merged folder
- echo "Copy etc config files for nhos miner"
- mkdir -p "$BUILDDIR/etc/sysconfig/nhos"
- cp -r $BUILDDIR/initramfs/etc/sysconfig/nhos/* "$BUILDDIR/etc/sysconfig/nhos/"
- # cp initramfs opt dir to unsquashed merged folder
- echo "Copy nhos miner scripts to opt folder"
- cp -r $BUILDDIR/initramfs/opt/* "$BUILDDIR/opt/"
- # cleanup package folder
- echo "cleaning up"
- rm -rf "$BUILDDIR/initramfs"
- }
- package() {
- BUILDDIR="$BASEDIR/build";
- echo "Copying $BUILDDIR/* to $BASEDIR/pkg/nhos"
- cp -r $BUILDDIR/* "$BASEDIR/pkg/nhos/"
- }
Add Comment
Please, Sign In to add comment