Jump to content
Sign in to follow this  

How to Build Custom Raspbian Image [Denarius] [pi] denariian pi-gen

Recommended Posts

Basic setup to building your own custom Raspbian Image from the offician pi-gen repo using you Denarius daemon wallet as the example. I like that someone can build completely from source and compile the entire OS on their own for their precious crypto.



Go to https://github.com/RPi-Distro/pi-gen. Read this a few times how it works.

I am using Windows 10, so I downloaded VirtualBox and created an Ubuntu 16.04 VM with 2 cpu's, 100GB hard drive, and 3GB of ram.

git clone https://github.com/RPi-Distro/pi-gen

You want to build the stock image to make sure this works from the get go.

nano config

Put this one line in for your image name, ex. testimage


Once this is done building you can find the image in the work folder with a date and name of image. The image is in /pi-gen/work/date-imagename/export-image


For the first run I wanted to build only the lite command line Raspbian with denariusd daemon. This is found in stage2 directory.

I made a new directory called 04-denariusd. And put the files required in there.

cd ~/pi-gen/stage2
mkdir 04-denariusd
cd 04-denariusd
nano 00-packages
dependencies to compile denariusd and openssl 1.0.1j
git unzip
libdb++-dev libboost-all-dev libqrencode-dev libminiupnpc-dev libevent-dev
autogen automake libtool 

Next create a file to compile openssl 1.0.1j and denariusd.

nano 04-run.sh
#!/bin/bash -e
on_chroot << EOF
  apt-get install make
  wget https://www.openssl.org/source/openssl-1.0.1j.tar.gz
  tar -xzvf openssl-1.0.1j.tar.gz
  cd openssl-1.0.1j
  make depend
#  make test
  make install
  sudo ln -sf /usr/local/ssl/bin/openssl `which openssl`

  git clone https://github.com/carsenk/denarius
  cd denarius
  git checkout v3.4
  git pull
  cd src
  OPENSSL_INCLUDE_PATH=/usr/local/ssl/include OPENSSL_LIB_PATH=/usr/local/ssl/lib make -f makefile.arm
  strip denariusd
  cp denariusd /usr/local/bin/denariusd
chmod +x 04-run.sh

Now the basic setup is done. Go back to ~/pi-gen, run some commands to skip stages after stage2 and run the build command.

# Example for building denariian lite system
touch ./stage3/SKIP ./stage4/SKIP ./stage5/SKIP
touch ./stage4/SKIP_IMAGES ./stage5/SKIP_IMAGES
sudo ./build.sh


Grab your image from /pi-gen/work/date-imagename/export-image, etch to microsd card and go tinker away with your raspberry pi.

tip: this is a really easy way to cross compile for your raspberry pi. This uses qemu so you get 1 cpu and minimal ram, but outside of compiling everything else is maxing out the VM.

  • Like 1

Share this post

Link to post
Share on other sites

stage 3, qt wallet place hodler

#02-denariusqt folder layout




nano 00-packages
libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools qt5-default
nano 05-run.sh

Throw in custom denarius lava pi by icanhaz and setup the Denarius QT compile. After compile copy Denarius binary to user pi desktop.

#!/bin/bash -e

install -m 644 files/Lava-PI-2.jpg "{ROOTFS_DIR}/usr/share/rpd-wallpaper/"

  on_chroot << EOF
  cd denarius
  export QT_SELECT=qt5
  qmake -v
  qmake "USE_NATIVETOR=-" "USE_UPNP=1" "USE_QRCODE=1" OPENSSL_INCLUDE_PATH=/usr/local/ssl/include OPENSSL_LIB_PATH=/usr/local/ssl/lib denarius-qt.pro
  cp Denarius /home/pi/Desktop/Denarius
chmod +x 05-run.sh



  • Like 1

Share this post

Link to post
Share on other sites

Changed up the github to compile lite or full desktop. Both include the daemon and QT with compiled openssl 1.0.1j. Instructions added to get VNC Server working on Raspberry Pi and VNC Viewer. No monitor required. Attached video shows no denarius.conf syncing from block 0.


Share this post

Link to post
Share on other sites

An example of how to create a directory and put files into there. Trying to keep the config as stock as possible, so FIRST_USER_NAME is staying "pi". The idea here is to put the compiled QT into a Denarius folder and also put the desktop wallpaper there. Still trying to figure out how to properly set the default wallpaper to something besides road.jpg.



#!/bin/sh -e
install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/Denarius"
install -v -o 1000 -g 1000 -m 755 "${ROOTFS_DIR}/usr/local/bin/Denarius" "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/Denarius/"
install -v -o 1000 -g 1000 -m 644 "files/Lava-PI-2.jpg" "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/Denarius/"


Share this post

Link to post
Share on other sites

If someone wants to try the built image for CLI or Desktop. Torrent link or magnet below.



2019-03-16 Denariian.torrent

Share this post

Link to post
Share on other sites

The QT and wallpaper is in home/pi/Denarius which you probably have to chmod to execute the QT file.

Or both QT and daemon are in /usr/local/bin and should work from there

This all is a work in progress as it takes nearly 10 hours to do a full build and then burn the image and test it out.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...