Archive for the ‘V’ Category

Building TRB on Cuntoo: Part 1

Wednesday, May 22nd, 2019

Continuing to build upon last month's post (building ave1's musltronic GNAT on Gentoo), I wanted to try building TRB on Cuntoo.

I utilized diana_coman's Keccak-V to press Keccak-V TRB vpatches and seals that I created back in January. These have not yet been reviewed by other TMSR~ Lords, and subsequently, still are considered experimental at the time of this writing.

After pressing the Keccak TRB Tree up through asciilifeform_aggressive_pushgetblocks.vpatch into directory 'a', I copied all of it's contents into directory 'b'. This way, I'm able to make changes in directory 'b'; removing all of the buildroot requirements throughout the Makefiles. Once these changes were complete, I was able to use the Keccak vdiff tool to compare the original press directory in 'a', with the changes made in 'b' to output a new vpatch.

As a preliminary step, I simply set out to update the Makefile.rotor file in the 'build' directory so that I could utilize the deployed musltronic toolset in '/opt/20180924' and build the following: Boost, BDB, and OpenSSL. I was successful in building both Boost and OpenSSL without any changes at all; however, I did get an error when building BDB:

-L/opt/20180924/x86_64-linux-musl-native/lib -lpthread
-Wl,-soname -Wl,libdb-4.8.so -o
.libs/libdb-4.8.so /opt/20180924/x86_64-linux-musl-native/bin/../lib/gcc/x86_64-linux-musl/4.9.4/../../../../x86_64-linux-musl/bin/ld:
/opt/20180924/x86_64-linux-musl-native/bin/../lib/gcc/x86_64-linux-musl/4.9.4/../../../../x86_64-linux-musl/lib/libc.a(sysconf.o):
relocation R_X86_64_32S against `.rodata.values.2406' can not be used when making a shared object;
recompile with -fPIC /opt/20180924/x86_64-linux-musl-native/bin/../lib/gcc/x86_64-linux-musl/4.9.4/../../../../x86_64-linux-musl/lib/libc.a:
error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:771: libdb-4.8.la] Error 1
make[1]: Leaving directory
'/home/mod6/trb/trb054/bitcoin/build/db-4.8.30/build_unix'
make: *** [Makefile.rotor:41: db-4.8.30] Error 2

Seeing that this was a relocation record error was a clue for me. I wanted ensure that we're not building a shared library, so I dug up some BDB documentation here. Specifically:

--disable-shared, --disable-static

On systems supporting shared libraries, Berkeley DB builds both static and shared libraries by default. (Shared libraries are built using the GNU Project's Libtool distribution, which supports shared library builds on many (although not all) systems.) To not build shared libraries, configure using the --disable-shared argument. To not build static libraries, configure using the --disable-static argument.

I then added the '--disable-shared' flag to the configure options for BDB, it compiled, no problem at all.

The changes to the Makefiles were as follows:

  1. Removal of buildroot, its dependencies, and their checksums
  2. Updating the following environment variables in Makefile.rotor to point at my deployed musltronic native binaries from ave1's 20180924 version:
    1. CC
    2. CXX
    3. LD
    4. CFLAGS
    5. LDFLAGS
    6. PATH
  3. The addition of the '--disable-shared' configure flag for BDB

Once I had a vpatch of the necessary changes, I did another press up through asciilifeform_aggressive_pushgetblocks.vpatch into the 'test' directory. Next, I simply just applied my own vpatch manually (just for testing purposes). I then conducted a full TRB build, with success. Lastly, I started up TRB and was able to connect to the network and pull blocks. More testing is required, of course, but it was nice to see this working!

What follows below is a full log of all of the things that I conducted, as well as the (unsigned) vpatch of the changes that I created.

mod6@cuntoo-test1 ~ $ mkdir trb
mod6@cuntoo-test1 ~ $ cd trb/
mod6@cuntoo-test1 ~/trb $ touch log.txt
mod6@cuntoo-test1 ~/trb $ curl -sL
"http://ossasepia.com/vpatches/starter_v.zip" -O
mod6@cuntoo-test1 ~/trb $ curl -sL
"http://ossasepia.com/vpatches/starter_v.zip.diana_coman.sig" -O
mod6@cuntoo-test1 ~/trb $ gpg --verify starter_v.zip.diana_coman.sig
starter_v.zip
gpg: Signature made Wed Nov 14 10:39:50 2018 UTC using RSA key ID 390F999E
gpg: Good signature from "Diana Coman "
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: E72D CCB7 3A5E 0669 4C5C  D781 D519 6EE6 390F 999E
mod6@cuntoo-test1 ~/trb $ unzip starter_v.zip
Archive:  starter_v.zip
   creating: starter_v/
  inflating: starter_v/clean.sh
  inflating: starter_v/build.sh
   creating: starter_v/vtools/
  inflating: starter_v/vtools/vdiff.gpr
  inflating: starter_v/vtools/vpatch.gpr
  inflating: starter_v/vtools/Makefile
  inflating: starter_v/vtools/ksum.gpr
  inflating: starter_v/vtools/manifest
   creating: starter_v/v/
  inflating: starter_v/v/v.pl
  inflating: starter_v/v/v_quick_start.txt
  inflating: starter_v/v/manifest
   creating: starter_v/vtools/src/
  inflating: starter_v/vtools/src/bits.ads
  inflating: starter_v/vtools/src/keccak_c.adb
  inflating: starter_v/vtools/src/vpatch.adb
  inflating: starter_v/vtools/src/dir.c
  inflating: starter_v/vtools/src/util.c
  inflating: starter_v/vtools/src/keccak.h
  inflating: starter_v/vtools/src/diff.h
  inflating: starter_v/vtools/src/bits.adb
  inflating: starter_v/vtools/src/character_io.ads
  inflating: starter_v/vtools/src/context.c
  inflating: starter_v/vtools/src/smg_keccak.adb
  inflating: starter_v/vtools/src/character_io.adb
  inflating: starter_v/vtools/src/ksum.adb
  inflating: starter_v/vtools/src/analyze.c
  inflating: starter_v/vtools/src/keccak_c.ads
  inflating: starter_v/vtools/src/io.c
  inflating: starter_v/vtools/src/diff.c
  inflating: starter_v/vtools/src/smg_keccak.ads
  inflating: starter_v/vtools/src/system.h
   creating: starter_v/vtools/lib/
  inflating: starter_v/vtools/lib/hash.c
  inflating: starter_v/vtools/lib/cmpbuf.c
  inflating: starter_v/vtools/lib/progname.c
  inflating: starter_v/vtools/lib/filetype.h
  inflating: starter_v/vtools/lib/xalloc.c
  inflating: starter_v/vtools/lib/dirname.h
  inflating: starter_v/vtools/lib/filetype.c
  inflating: starter_v/vtools/lib/progname.h
  inflating: starter_v/vtools/lib/cmpbuf.h
  inflating: starter_v/vtools/lib/error.h
  inflating: starter_v/vtools/lib/error.c
  inflating: starter_v/vtools/lib/filenamecat.c
  inflating: starter_v/vtools/lib/dirname.c
  inflating: starter_v/vtools/lib/diffseq.h
  inflating: starter_v/vtools/lib/hash.h
  inflating: starter_v/vtools/lib/filenamecat.h
  inflating: starter_v/vtools/lib/xalloc.h
   creating: starter_v/vtools/obj/
 extracting: starter_v/vtools/obj/readme
mod6@cuntoo-test1 ~/trb $
mod6@cuntoo-test1 ~/trb $ cd starter_v
mod6@cuntoo-test1 ~/trb/starter_v $ chmod +x build.sh
mod6@cuntoo-test1 ~/trb/starter_v $ ./build.sh
Compile
   [C]            diff.c
   [C]            filetype.c
   [C]            error.c
   [C]            cmpbuf.c
   [C]            progname.c
   [C]            dirname.c
   [C]            hash.c
   [C]            filenamecat.c
   [C]            xalloc.c
   [C]            dir.c
   [C]            io.c
   [C]            util.c
   [C]            context.c
   [C]            analyze.c
   [Ada]          bits.adb
   [Ada]          ksum.adb
   [Ada]          character_io.adb
   [Ada]          keccak_c.adb
   [Ada]          smg_keccak.adb
Bind
   [gprbind]      diff.bexch
   [Ada]          bits.ali -n
Link
   [archive]      libvdiff.a
   [index]        libvdiff.a
   [link]         diff.c
Compile
   [Ada]          vpatch.adb
Bind
   [gprbind]      vpatch.bexch
   [Ada]          vpatch.ali
Link
   [link]         vpatch.adb
Bind
   [gprbind]      ksum.bexch
   [Ada]          ksum.ali
Link
   [link]         ksum.adb
Done.
mod6@cuntoo-test1 ~/trb/starter_v $
mod6@cuntoo-test1 ~/trb/starter_v $ command -v ksum
/usr/local/bin/ksum
mod6@cuntoo-test1 ~/trb/starter_v $ command -v vdiff
/usr/local/bin/vdiff
mod6@cuntoo-test1 ~/trb/starter_v $ command -v vpatch
/usr/local/bin/vpatch
mod6@cuntoo-test1 ~/trb $ mkdir .wot
mod6@cuntoo-test1 ~/trb $ mkdir .seals
mod6@cuntoo-test1 ~/trb $ mkdir patches
mod6@cuntoo-test1 ~/trb $ cd .wot
mod6@cuntoo-test1 ~/trb/.wot $ cp ~/pubkeys/mod6.asc .
mod6@cuntoo-test1 ~/trb/.wot $ cd ../
mod6@cuntoo-test1 ~/trb $ cp starter_v/vk.pl .
mod6@cuntoo-test1 ~/trb $ ./vk.pl w
mod6:027A8D7C0FB8A16643720F40721705A8B71EADAF:mod6 (mod6) 
mod6@cuntoo-test1 ~/trb $ curl -sL "http://mod6.net/trb/regrinds/keccak_trb_20190112.tar.gz" -O
mod6@cuntoo-test1 ~/trb $ curl -sL "http://mod6.net/trb/regrinds/keccak_trb_20190112.tar.gz.mod6.sig" -O
mod6@cuntoo-test1 ~/trb $ gpg --import ~/pubkeys/mod6.asc
gpg: key B71EADAF: public key "mod6 (mod6) " imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
gpg: no ultimately trusted keys found
mod6@cuntoo-test1 ~/trb $ gpg --verify keccak_trb_20190112.tar.gz.mod6.sig keccak_trb_20190112.tar.gz
gpg: Signature made Sun Jan 13 18:39:41 2019 UTC using RSA key ID B71EADAF
gpg: Good signature from "mod6 (mod6) "
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 027A 8D7C 0FB8 A166 4372  0F40 7217 05A8 B71E ADAF
mod6@cuntoo-test1 ~/trb $ tar -xf keccak_trb_20190112.tar.gz
mod6@cuntoo-test1 ~/trb $ ls
keccak_trb_20190112.tar.gz  keccak_trb_20190112.tar.gz.mod6.sig  log.txt  seals  starter_v  starter_v.zip  starter_v.zip.diana_coman.sig  vk.pl  vpatches
mod6@cuntoo-test1 ~/trb $ mv seals/ .seals
mod6@cuntoo-test1 ~/trb $ mv vpatches/ patches
mod6@cuntoo-test1 ~/trb $ ./vk.pl f
genesis.vpatch (mod6)
bitcoin-asciilifeform.1.vpatch (mod6)
rm_rf_upnp.vpatch (mod6)
bitcoin-asciilifeform.3-turdmeister-alert-snip.vpatch (mod6)
bitcoin-asciilifeform.2-https_snipsnip.vpatch (mod6)
bitcoin-asciilifeform.4-goodbye-win32.vpatch (mod6)
asciilifeform_dnsseed_snipsnip.vpatch (mod6)
asciilifeform_zap_hardcoded_seeds.vpatch (mod6)
asciilifeform-kills-integer-retardation.vpatch (mod6)
asciilifeform_zap_showmyip_crud.vpatch (mod6)
asciilifeform_dns_thermonyukyoolar_kleansing.vpatch (mod6)
asciilifeform_and_now_we_have_block_dumper_corrected.vpatch (mod6)
mod6_fix_dumpblock_params.vpatch (mod6)
bitcoin-v0_5_3_1-static_makefile_v002.8.vpatch (mod6)
bitcoin-v0_5_3_1-rev_bump.7.vpatch (mod6)
asciilifeform_ver_now_5_4_and_irc_is_gone_and_now_must_give_ip.vpatch (mod6)
asciilifeform_orphanage_thermonuke.vpatch (mod6)
asciilifeform_and_now_we_have_eatblock.vpatch (mod6)
bitcoin-v0_5_3-db_config.6.vpatch (mod6)
asciilifeform_tx-orphanage_amputation.vpatch (mod6)
asciilifeform_maxint_locks_corrected.vpatch (mod6)
asciilifeform_lets_lose_testnet.vpatch (mod6)
asciilifeform_add_verifyall_option.vpatch (mod6)
programmable-versionstring.vpatch (mod6)
mod6_der_high_low_s.vpatch (mod6)
malleus_mikehearnificarum.vpatch (mod6)
makefiles.vpatch (mod6)
asciilifeform_aggressive_pushgetblocks.vpatch (mod6)
mod6@cuntoo-test1 ~/trb $ ./vk.pl p a asciilifeform_aggressive_pushgetblocks.vpatch
mod6@cuntoo-test1 ~/trb $ cp -pr a b
mod6@cuntoo-test1 ~/trb $ ls a
bitcoin
mod6@cuntoo-test1 ~/trb $ ls b
bitcoin

# Here's where I went into directory 'b' and made my changes.
#
# See the full (keccak) vpatch at the bottom of this blog post, or here.

mod6@cuntoo-test1 ~/trb $ vdiff a b > mod6_cuntoo_with_ave1_tools.vpatch
mod6@cuntoo-test1 ~/trb $ ./vk.pl p test asciilifeform_aggressive_pushgetblocks.vpatch
mod6@cuntoo-test1 ~/trb $ cd test/
mod6@cuntoo-test1 ~/trb/test $ cp ../mod6_cuntoo_with_ave1_tools.vpatch .
# ( patching manually just for testing! )
mod6@cuntoo-test1 ~/trb/test $ patch -p1 < mod6_cuntoo_with_ave1_tools.vpatch
patching file bitcoin/build/Makefile
patching file bitcoin/build/Makefile.rotor
patching file bitcoin/deps/Makefile
patching file bitcoin/deps/Manifest.sha512

mod6@cuntoo-test1 ~/trb/test $ cd bitcoin
mod6@cuntoo-test1 ~/trb/test/bitcoin $ make ONLINE=1

...

trb/test/bitcoin/build/ourlibs/include -fno-stack-protector -fstack-protector-all -Wstack-protector -Wl,-z,relro -Wl,-z,now -D_FORTIFY_SOURCE=2 -O2 -MMD -o obj/nogui/init.o init.cpp
/opt/20180924/x86_64-linux-musl-native/bin/g++ -c -pthread -Wno-invalid-offsetof -Wformat -g -DNOPCH -I/home/mod6/trb/test/bitcoin/build/ourlibs/include -I/home/mod6/trb/test/bitcoin/build/ourlibs/include -I/home/mod6/trb/test/bitcoin/build/ourlibs/include -fno-stack-protector -fstack-protector-all -Wstack-protector -Wl,-z,relro -Wl,-z,now -D_FORTIFY_SOURCE=2 -O2 -MMD -o obj/nogui/keystore.o keystore.cpp
/opt/20180924/x86_64-linux-musl-native/bin/g++ -c -pthread -Wno-invalid-offsetof -Wformat -g -DNOPCH -I/home/mod6/trb/test/bitcoin/build/ourlibs/include -I/home/mod6/trb/test/bitcoin/build/ourlibs/include -I/home/mod6/trb/test/bitcoin/build/ourlibs/include -fno-stack-protector -fstack-protector-all -Wstack-protector -Wl,-z,relro -Wl,-z,now -D_FORTIFY_SOURCE=2 -O2 -MMD -o obj/nogui/main.o main.cpp
/opt/20180924/x86_64-linux-musl-native/bin/g++ -c -pthread -Wno-invalid-offsetof -Wformat -g -DNOPCH -I/home/mod6/trb/test/bitcoin/build/ourlibs/include -I/home/mod6/trb/test/bitcoin/build/ourlibs/include -I/home/mod6/trb/test/bitcoin/build/ourlibs/include -fno-stack-protector -fstack-protector-all -Wstack-protector -Wl,-z,relro -Wl,-z,now -D_FORTIFY_SOURCE=2 -O2 -MMD -o obj/nogui/net.o net.cpp
/opt/20180924/x86_64-linux-musl-native/bin/g++ -c -pthread -Wno-invalid-offsetof -Wformat -g -DNOPCH -I/home/mod6/trb/test/bitcoin/build/ourlibs/include -I/home/mod6/trb/test/bitcoin/build/ourlibs/include -I/home/mod6/trb/test/bitcoin/build/ourlibs/include -fno-stack-protector -fstack-protector-all -Wstack-protector -Wl,-z,relro -Wl,-z,now -D_FORTIFY_SOURCE=2 -O2 -MMD -o obj/nogui/protocol.o protocol.cpp
/opt/20180924/x86_64-linux-musl-native/bin/g++ -c -pthread -Wno-invalid-offsetof -Wformat -g -DNOPCH -I/home/mod6/trb/test/bitcoin/build/ourlibs/include -I/home/mod6/trb/test/bitcoin/build/ourlibs/include -I/home/mod6/trb/test/bitcoin/build/ourlibs/include -fno-stack-protector -fstack-protector-all -Wstack-protector -Wl,-z,relro -Wl,-z,now -D_FORTIFY_SOURCE=2 -O2 -MMD -o obj/nogui/bitcoinrpc.o bitcoinrpc.cpp
In file included from /home/mod6/trb/test/bitcoin/build/ourlibs/include/boost/asio/detail/socket_types.hpp:50:0,
                 from /home/mod6/trb/test/bitcoin/build/ourlibs/include/boost/asio/detail/epoll_reactor.hpp:32,
                 from /home/mod6/trb/test/bitcoin/build/ourlibs/include/boost/asio/detail/reactor.hpp:21,
                 from /home/mod6/trb/test/bitcoin/build/ourlibs/include/boost/asio/detail/impl/task_io_service.ipp:24,
                 from /home/mod6/trb/test/bitcoin/build/ourlibs/include/boost/asio/detail/task_io_service.hpp:217,
                 from /home/mod6/trb/test/bitcoin/build/ourlibs/include/boost/asio/impl/io_service.hpp:71,
                 from /home/mod6/trb/test/bitcoin/build/ourlibs/include/boost/asio/io_service.hpp:767,
                 from /home/mod6/trb/test/bitcoin/build/ourlibs/include/boost/asio/basic_io_object.hpp:19,
                 from /home/mod6/trb/test/bitcoin/build/ourlibs/include/boost/asio/basic_socket.hpp:19,
                 from /home/mod6/trb/test/bitcoin/build/ourlibs/include/boost/asio/basic_datagram_socket.hpp:20,
                 from /home/mod6/trb/test/bitcoin/build/ourlibs/include/boost/asio.hpp:20,
                 from bitcoinrpc.cpp:11:
/opt/20180924/x86_64-linux-musl-native/x86_64-linux-musl/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include  to
 [-Wcpp]
 #warning redirecting incorrect #include  to

  ^
/opt/20180924/x86_64-linux-musl-native/bin/g++ -c -pthread -Wno-invalid-offsetof -Wformat -g -DNOPCH -I/home/mod6/trb/test/bitcoin/build/ourlibs/include -I/home/mod6/trb/test/bitcoin/build/ourlibs/include -I/home/mod6/trb/test/bitcoin/build/ourlibs/include -fno-stack-protector -fstack-protector-all -Wstack-protector -Wl,-z,relro -Wl,-z,now -D_FORTIFY_SOURCE=2 -O2 -MMD -o obj/nogui/script.o script.cpp
/opt/20180924/x86_64-linux-musl-native/bin/g++ -c -pthread -Wno-invalid-offsetof -Wformat -g -DNOPCH -I/home/mod6/trb/test/bitcoin/build/ourlibs/include -I/home/mod6/trb/test/bitcoin/build/ourlibs/include -I/home/mod6/trb/test/bitcoin/build/ourlibs/include -fno-stack-protector -fstack-protector-all -Wstack-protector -Wl,-z,relro -Wl,-z,now -D_FORTIFY_SOURCE=2 -O2 -MMD -o obj/nogui/util.o util.cpp
/opt/20180924/x86_64-linux-musl-native/bin/g++ -c -pthread -Wno-invalid-offsetof -Wformat -g -DNOPCH -I/home/mod6/trb/test/bitcoin/build/ourlibs/include -I/home/mod6/trb/test/bitcoin/build/ourlibs/include -I/home/mod6/trb/test/bitcoin/build/ourlibs/include -fno-stack-protector -fstack-protector-all -Wstack-protector -Wl,-z,relro -Wl,-z,now -D_FORTIFY_SOURCE=2 -O2 -MMD -o obj/nogui/wallet.o wallet.cpp
/opt/20180924/x86_64-linux-musl-native/bin/g++ -pthread -Wno-invalid-offsetof -Wformat -g -DNOPCH -I/home/mod6/trb/test/bitcoin/build/ourlibs/include -I/home/mod6/trb/test/bitcoin/build/ourlibs/include -I/home/mod6/trb/test/bitcoin/build/ourlibs/include -fno-stack-protector -fstack-protector-all -Wstack-protector -Wl,-z,relro -Wl,-z,now -D_FORTIFY_SOURCE=2 -O2 -o bitcoind obj/nogui/checkpoints.o obj/nogui/crypter.o obj/nogui/db.o obj/nogui/init.o obj/nogui/keystore.o obj/nogui/main.o obj/nogui/net.o obj/nogui/protocol.o obj/nogui/bitcoinrpc.o obj/nogui/script.o obj/nogui/util.o obj/nogui/wallet.o -L/opt/20180924/x86_64-linux-musl-native/lib -L/home/mod6/trb/test/bitcoin/build/ourlibs/lib -L/home/mod6/trb/test/bitcoin/build/ourlibs/lib -L/home/mod6/trb/test/bitcoin/build/ourlibs/lib -Wl,-Bstatic -l boost_system -l boost_filesystem -l boost_program_options -l boost_thread -l db_cxx -l ssl -l crypto -static-libgcc -Wl,-Bstatic -l pthread
make[3]: Leaving directory '/home/mod6/trb/test/bitcoin/src'
strip ../src/bitcoind
make[2]: Leaving directory '/home/mod6/trb/test/bitcoin/build'
cp ../src/bitcoind .
make[1]: Leaving directory '/home/mod6/trb/test/bitcoin/build'
make -C bin
make[1]: Entering directory '/home/mod6/trb/test/bitcoin/bin'
cp ../build/bitcoind .
#grep "  bitcoind$" Manifest.sha512 | sha512sum -c || (mv bitcoind bitcoind.badsum && false)
make[1]: Leaving directory '/home/mod6/trb/test/bitcoin/bin'
mod6@cuntoo-test1 ~/trb/test/bitcoin $ ls -al bin/bitcoind
-rwxr-xr-x 1 mod6 mod6 5085296 May 18 00:40 bin/bitcoind
mod6@cuntoo-test1 ~/trb/test/bitcoin $ mkdir ~/.bitcoin
mod6@cuntoo-test1 ~/trb/test/bitcoin $ vim ~/.bitcoin/bitcoin.conf
mod6@cuntoo-test1 ~/trb/test/bitcoin $
...
From here I started up bitcoind, and pulled the first 2000 blocks.

Here is the full (keccak) 'mod6_cuntoo_with_ave1_tools.vpatch' file (for review):

diff -uNr a/bitcoin/build/Makefile b/bitcoin/build/Makefile
--- a/bitcoin/build/Makefile c958ddef742cd53043ad744166918e1e0a16da6e660341adfddb34280e650031dd0ada7ebf0679764a2dbd41a70d78204af34f381f8ed4e48be0098227a19358
+++ b/bitcoin/build/Makefile 1199de9a81356a54737644c0177c48f7c6e558eb0b3e37e3f5a4129b748505725c0117c2f0b96f3d0bec812b6aed042c2cff4dd679426e7675f23c544885119e
@@ -1,6 +1,6 @@
 BUILDER=rotor

-all: buildroot-2015.05 rotor bitcoind
+all: rotor bitcoind

 clean:
 	find . -maxdepth 1 \
@@ -9,31 +9,11 @@
 	-not -name '.' \
 	-exec rm -rf {} \;

-buildroot-2015.05:
-	tar -xvzf ../deps/buildroot-2015.05.tar.gz
-	tar -xvzf ../deps/rotor.tar.gz
-	cp rotor_buildroot_dot_config buildroot-2015.05/.config
-	mkdir -p buildroot-2015.05/dl
-	cp ../deps/binutils-2.24.tar.bz2 \
-	../deps/busybox-1.23.2.tar.bz2 \
-	../deps/expat-2.1.0.tar.gz \
-	../deps/fakeroot_1.18.4.orig.tar.bz2 \
-	../deps/gcc-4.9.2.tar.bz2 \
-	../deps/gdb-7.8.2.tar.xz \
-	../deps/gmp-6.0.0a.tar.xz \
-	../deps/linux-3.18.14.tar.xz \
-	../deps/m4-1.4.17.tar.xz \
-	../deps/mpc-1.0.3.tar.gz \
-	../deps/mpfr-3.1.2.tar.xz \
-	../deps/musl-1.1.8.tar.gz \
-	../deps/ncurses-5.9.tar.gz \
-	../deps/pkgconf-0.8.9.tar.bz2 \
-	buildroot-2015.05/dl
-
 	$(MAKE) -C buildroot-2015.05

 .PHONY: $(BUILDER)
 $(BUILDER):
+	tar -xvzf ../deps/rotor.tar.gz
 	$(MAKE) -f Makefile.$(BUILDER)

 bitcoind:
diff -uNr a/bitcoin/build/Makefile.rotor b/bitcoin/build/Makefile.rotor
--- a/bitcoin/build/Makefile.rotor ba5a6c72cf444b5872fb006ca025ea4df3c7293a8986019b64fb57ef9d28e6a3080a81a169197b956825c1fee92fc025c0ec9a8e36f50d9fb7c2f3a9bd8ac5de
+++ b/bitcoin/build/Makefile.rotor a3138a9e927585e84258b1ab008120e5be73dfa2f1f6bebc41c54fff75e601baf24263b707af9ebcb2ecca8d3436e45242fba0ee456335858b6cd8ff3cafabb6
@@ -7,12 +7,12 @@

 export DIST=$(shell readlink -f ../deps)
 export OURLIBS=$(shell readlink -f ./ourlibs)
-export CC=$(shell readlink -f toolchain/usr/bin/x86_64-therealbitcoin-linux-musl-gcc)
-export CXX=$(shell readlink -f toolchain/usr/bin/x86_64-therealbitcoin-linux-musl-g++)
-export LD=$(shell readlink -f toolchain/usr/bin/x86_64-therealbitcoin-linux-musl-ld)
-export CFLAGS=-I$(shell readlink -f toolchain/usr/include)
-export LDFLAGS=-L$(shell readlink -f toolchain/usr/lib)
-export PATH := $(PATH):$(shell readlink -f toolchain/usr/bin)
+export CC=$(shell readlink -f /opt/20180924/x86_64-linux-musl-native/bin/gcc)
+export CXX=$(shell readlink -f /opt/20180924/x86_64-linux-musl-native/bin/g++)
+export LD=$(shell readlink -f /opt/20180924/x86_64-linux-musl-native/bin/ld)
+export CFLAGS=-I$(shell readlink -f /opt/20180924/x86_64-linux-musl-native/include)
+export LDFLAGS=-L$(shell readlink -f /opt/20180924/x86_64-linux-musl-native/lib)
+export PATH := $(PATH):$(shell readlink -f /opt/20180924/x86_64-linux-musl-native/bin)
 export BOOST_INCLUDE_PATH=$(OURLIBS)/include
 export BDB_INCLUDE_PATH=$(OURLIBS)/include
 export OPENSSL_INCLUDE_PATH=$(OURLIBS)/include
@@ -38,7 +38,7 @@
 $(BDB):
 	tar xvfz $(DIST)/$(BDB).tar.gz
 	cd $(BDB)/build_unix && \
-	../dist/configure --enable-cxx --prefix=$(OURLIBS) --host=x86_64-linux && \
+	../dist/configure --disable-shared --enable-cxx --prefix=$(OURLIBS) --host=x86_64-linux && \
 	$(MAKE) && \
 	$(MAKE) install

diff -uNr a/bitcoin/deps/Makefile b/bitcoin/deps/Makefile
--- a/bitcoin/deps/Makefile 84410767530f3081269fbc0f494b5a00f7d7f665ed442a7330b87cee22fb83d5bd4acdb47f75e0cce984a37372cb81ef16931280aa3b8abcf879caa632258548
+++ b/bitcoin/deps/Makefile 4b8ba13ff82f0e6095a5d1a8a4928b3223fb2be6acb4335eb8026e0f441a49d58fb93dfabbf1f4f8ce8e9ddc613706b8986da4e495d9a4f66452d74544ace01d
@@ -1,32 +1,17 @@
 include ../verify.mk

-all: boost_1_52_0.tar.bz2 buildroot-2015.05.tar.gz db-4.8.30.tar.gz \
-     openssl-1.0.1g.tar.gz binutils-2.24.tar.bz2 busybox-1.23.2.tar.bz2 \
-     expat-2.1.0.tar.gz fakeroot_1.18.4.orig.tar.bz2 gcc-4.9.2.tar.bz2 \
-     gdb-7.8.2.tar.xz gmp-6.0.0a.tar.xz linux-3.18.14.tar.xz \
-     m4-1.4.17.tar.xz mpc-1.0.3.tar.gz mpfr-3.1.2.tar.xz musl-1.1.8.tar.gz \
-     ncurses-5.9.tar.gz pkgconf-0.8.9.tar.bz2 rotor.tar.gz \
-     rotor-db-configure-fix.patch
+all: boost_1_52_0.tar.bz2 db-4.8.30.tar.gz openssl-1.0.1g.tar.gz \
+     rotor.tar.gz rotor-db-configure-fix.patch

 check:
 	$(SHA512) -c Manifest.sha512

 clean:
-	rm -f boost_1_52_0.tar.bz2 buildroot-2015.05.tar.gz db-4.8.30.tar.gz \
-	openssl-1.0.1g.tar.gz binutils-2.24.tar.bz2 busybox-1.23.2.tar.bz2 \
-	expat-2.1.0.tar.gz fakeroot_1.18.4.orig.tar.bz2 gcc-4.9.2.tar.bz2 \
-	gdb-7.8.2.tar.xz gmp-6.0.0a.tar.xz linux-3.18.14.tar.xz \
-	m4-1.4.17.tar.xz mpc-1.0.3.tar.gz mpfr-3.1.2.tar.xz musl-1.1.8.tar.gz \
-	ncurses-5.9.tar.gz pkgconf-0.8.9.tar.bz2 rotor.tar.gz \
-	rotor-db-configure-fix.patch boost_1_52_0.tar.bz2.asc \
-	buildroot-2015.05.tar.gz.asc db-4.8.30.tar.gz.asc \
-	openssl-1.0.1g.tar.gz.asc binutils-2.24.tar.bz2.asc \
-	busybox-1.23.2.tar.bz2.asc expat-2.1.0.tar.gz.asc \
-	fakeroot_1.18.4.orig.tar.bz2.asc gcc-4.9.2.tar.bz2.asc \
-	gdb-7.8.2.tar.xz.asc gmp-6.0.0a.tar.xz.asc linux-3.18.14.tar.xz.asc \
-	m4-1.4.17.tar.xz.asc mpc-1.0.3.tar.gz.asc mpfr-3.1.2.tar.xz.asc \
-	musl-1.1.8.tar.gz.asc ncurses-5.9.tar.gz.asc pkgconf-0.8.9.tar.bz2.asc \
-	rotor.tar.gz.asc rotor-db-configure-fix.patch.asc
+	rm -f boost_1_52_0.tar.bz2.asc boost_1_52_0.tar.bz2 \
+	db-4.8.30.tar.gz.asc db-4.8.30.tar.gz \
+	openssl-1.0.1g.tar.gz.asc openssl-1.0.1g.tar.gz \
+	rotor.tar.gz.asc rotor.tar.gz \
+	rotor-db-configure-fix.patch.asc rotor-db-configure-fix.patch

 boost_1_52_0.tar.bz2:
 ifdef ONLINE
@@ -36,14 +21,6 @@
 	$(DECODE_DEED)
 	$(CHECKSUM_OR_DIE)

-buildroot-2015.05.tar.gz:
-ifdef ONLINE
-	curl -s http://deedbot.org/deed-422651-2.txt -o $@.asc
-endif
-	$(VERIFY_DEED_OR_DIE)
-	$(DECODE_DEED)
-	$(CHECKSUM_OR_DIE)
-
 db-4.8.30.tar.gz:
 ifdef ONLINE
 	curl -s http://deedbot.org/deed-422651-3.txt -o $@.asc
@@ -58,118 +35,6 @@
 endif
 	$(VERIFY_DEED_OR_DIE)
 	$(DECODE_DEED)
-	$(CHECKSUM_OR_DIE)
-
-binutils-2.24.tar.bz2:
-ifdef ONLINE
-	curl -s http://deedbot.org/deed-427443-1.txt -o $@.asc
-endif
-	$(VERIFY_DEED_OR_DIE)
-	$(DECODE_DEED)
-	$(CHECKSUM_OR_DIE)
-
-busybox-1.23.2.tar.bz2:
-ifdef ONLINE
-	curl -s http://deedbot.org/deed-427443-2.txt -o $@.asc
-endif
-	$(VERIFY_DEED_OR_DIE)
-	$(DECODE_DEED)
-	$(CHECKSUM_OR_DIE)
-
-expat-2.1.0.tar.gz:
-ifdef ONLINE
-	curl -s http://deedbot.org/deed-427443-3.txt -o $@.asc
-endif
-	$(VERIFY_DEED_OR_DIE)
-	$(DECODE_DEED)
-	$(CHECKSUM_OR_DIE)
-
-fakeroot_1.18.4.orig.tar.bz2:
-ifdef ONLINE
-	curl -s http://deedbot.org/deed-427443-4.txt -o $@.asc
-endif
-	$(VERIFY_DEED_OR_DIE)
-	$(DECODE_DEED)
-	$(CHECKSUM_OR_DIE)
-
-gcc-4.9.2.tar.bz2:
-ifdef ONLINE
-	curl -s http://deedbot.org/deed-427443-5.txt -o $@.asc
-endif
-	$(VERIFY_DEED_OR_DIE)
-	$(DECODE_DEED)
-	$(CHECKSUM_OR_DIE)
-
-gdb-7.8.2.tar.xz:
-ifdef ONLINE
-	curl -s http://deedbot.org/deed-427443-6.txt -o $@.asc
-endif
-	$(VERIFY_DEED_OR_DIE)
-	$(DECODE_DEED)
-	$(CHECKSUM_OR_DIE)
-
-gmp-6.0.0a.tar.xz:
-ifdef ONLINE
-	curl -s http://deedbot.org/deed-427443-7.txt -o $@.asc
-endif
-	$(VERIFY_DEED_OR_DIE)
-	$(DECODE_DEED)
-	$(CHECKSUM_OR_DIE)
-
-linux-3.18.14.tar.xz:
-ifdef ONLINE
-	curl -s http://deedbot.org/deed-427443-8.txt -o $@.asc
-endif
-	$(VERIFY_DEED_OR_DIE)
-	$(DECODE_DEED)
-	$(CHECKSUM_OR_DIE)
-
-m4-1.4.17.tar.xz:
-ifdef ONLINE
-	curl -s http://deedbot.org/deed-427443-9.txt -o $@.asc
-endif
-	$(VERIFY_DEED_OR_DIE)
-	$(DECODE_DEED)
-	$(CHECKSUM_OR_DIE)
-
-mpc-1.0.3.tar.gz:
-ifdef ONLINE
-	curl -s http://deedbot.org/deed-427443-10.txt -o $@.asc
-endif
-	$(VERIFY_DEED_OR_DIE)
-	$(DECODE_DEED)
-	$(CHECKSUM_OR_DIE)
-
-mpfr-3.1.2.tar.xz:
-ifdef ONLINE
-	curl -s http://deedbot.org/deed-427443-11.txt -o $@.asc
-endif
-	$(VERIFY_DEED_OR_DIE)
-	$(DECODE_DEED)
-	$(CHECKSUM_OR_DIE)
-
-musl-1.1.8.tar.gz:
-ifdef ONLINE
-	curl -s http://deedbot.org/deed-427443-12.txt -o $@.asc
-endif
-	$(VERIFY_DEED_OR_DIE)
-	$(DECODE_DEED)
-	$(CHECKSUM_OR_DIE)
-
-ncurses-5.9.tar.gz:
-ifdef ONLINE
-	curl -s http://deedbot.org/deed-427443-13.txt -o $@.asc
-endif
-	$(VERIFY_DEED_OR_DIE)
-	$(DECODE_DEED)
-	$(CHECKSUM_OR_DIE)
-
-pkgconf-0.8.9.tar.bz2:
-ifdef ONLINE
-	curl -s http://deedbot.org/deed-427443-14.txt -o $@.asc
-endif
-	$(VERIFY_DEED_OR_DIE)
-	$(DECODE_DEED)
 	$(CHECKSUM_OR_DIE)

 rotor-db-configure-fix.patch:
diff -uNr a/bitcoin/deps/Manifest.sha512 b/bitcoin/deps/Manifest.sha512
--- a/bitcoin/deps/Manifest.sha512 15a253bba8d7d35ac2f19017ae7350fd8906ad4ec93783d83aca5d07f9d4e0bab5bbaeef0e091276aac7f1cd7c00f64b3edf23c8a74e0ae66273ac99edf1bda2
+++ b/bitcoin/deps/Manifest.sha512 9a04e9d02fb697d6c5a2b45965d09edc14172a3205159899126c8d26effaa0aa8508c665e44f5d3ad3dfd3b4e92a9d58ab3d719185d857700944a811ab8b0675
@@ -1,20 +1,5 @@
-5ec95ad47d49b12c4558a8db0ca2109d3ee1955e3776057f3330c4506f8f4d1cf5e505fbf8a16b98403a0fcdeaaf986fe0a22be6456247dbdace63ce1f776b12  binutils-2.24.tar.bz2
 fc512d3bfa6a39a60fee548775c97239271cf757587b8df7ed739c800844a819a359dca172be0e69ad7752753753139bf11f0813d650066d58386662fe32842d  boost_1_52_0.tar.bz2
-c42fdd39cb2bc46804a86a7d7b2605bd3cd9ddcb365c4e5a1fb147eb02b234fc31a70c8140be2f4d27cd371c84e0c6701f8cb47697dd1c18dd0e0cce784aa07a  buildroot-2015.05.tar.gz
-209c8ef26e40ccb81510f6b663202b080f9bbecac7faf386bbabf7e36a43d63b15dd6ce9f7a84c1ccc5345c524999812251da1e113ef9faadc6af1fedd24c7c9  busybox-1.23.2.tar.bz2
 d1a3c52b0ab54ae3fd6792e6396c9f74d25f36b2eb9e853b67ef9c872508a58c784c7818108d06d184f59601b70cc877916e67dfea6f0ee1ca2b07468c1041f1  db-4.8.30.tar.gz
-2a9ad2b44b87b84087979fe4114d661838df3b03dbdcb74d590cb74096bf35ce9d5a86617b0941a2655ea441a94537bcbcd78252da92342238823be36de2d09d  expat-2.1.0.tar.gz
-497292fe21d18a37eadd657fbe01db8902f4b8d87d63605928efd59789f4c14737997b9f0abc4d794dbef78066b952064bdb2dd9f0910ec75349d7dd313cd058  fakeroot_1.18.4.orig.tar.bz2
-e96cba06d572dbe7f382a2b00fd9297dcf9f9219d46a9ad0bd904dc36d5e7db3335e422640b79a27fed6fde91b0731732b94a0e2fbcd47344d6779f8ba1f4f9c  gcc-4.9.2.tar.bz2
-face5bf1b4ce144fc8604fc84620beed956177a11fd632b4e41906fc7f632910b2b43a50e6cfdfd6cbd876ee527c813bddab8df29dc560a6c36694cdb8edc4e4  gdb-7.8.2.tar.xz
-50368f4368b244b442438ce1768cf0f1166e490d1bafb8feda1ffc90fea3807e7328f30f3faa861799e4f5ff6e3113049ca3231b2f48571e4583fc3d60441816  gmp-6.0.0a.tar.xz
-688a107e7ff2f0d21196fbf809173fee6620ec8e7694188ff38e45a1b16632bca33c617e012726142d8bd80307fc05207badfb115df95df05ee0734d5569a9cb  linux-3.18.14.tar.xz
-406e6e97c3f5c5f3c8055bac748d4fe8c2e861d97e84ab6d840a2caa7df04f523cc662d6d51f6afae7d6c219d03693c7ae0c1e669a80246a3ceb5e8342b82389  m4-1.4.17.tar.xz
-0028b76df130720c1fad7de937a0d041224806ce5ef76589f19c7b49d956071a683e2f20d154c192a231e69756b19e48208f2889b0c13950ceb7b3cfaf059a43  mpc-1.0.3.tar.gz
-8d594206afb2637ed39ad564d42c8c4d02b042b95925f5c6ec891e5cb87f7155195559c7ff477256a088ecaaa3c2b0d35a9d11a74ed526a1080d49b2950e5587  mpfr-3.1.2.tar.xz
-de2f0b03fd199e2ceb9937686d1092838744dccaddb3916f9baef9cdd2621624fb3c4af2206a3366d12852d84ccc8b0b68350f9d06a9e2bcdbc0309dc05383ff  musl-1.1.8.tar.gz
-d7c5e54b6d4d8b9211f0006ca8786f7609d180cc1aaebf4f25e7e35e12959779cf66447359a602daed625621ca32b0d910d67aef3eb8b6fdc3c373819a88faa1  ncurses-5.9.tar.gz
 66ebbad3c8ad98a07b486d39d0c3ae62b00133f8f2877cf8b97c461e7c7f40b29cf9c3cae82cf73a92dcf1daa63d33aa76c910fbcbe60158589fc7cb48f41e6d  openssl-1.0.1g.tar.gz
-3acb571412dedc2587203ed05537ce3adbaa64f2fab4f561da9824917c15e2ea771db7525f9a026261086f4ae196c3a5183e1bb3d33e14fdd779fbe74e6215c3  pkgconf-0.8.9.tar.bz2
 e232c07238feb16ce055211fba68ed283c47753a8716681ac47c869c21936f48768fafaac678f64ee17cf2b62b669a0d2c481008b5ccaf76007f66501a02990d  rotor.tar.gz
 2c1152a88dd6d8e4b0f736dbf0ce2691c66fc592c1ef6c332a976ae7e9ca86850091032d23042558e3eabc0dc2b591f482566ef433606fb91a06dee9a0485063  rotor-db-configure-fix.patch

Building Musltronic GNAT: Part 1

Sunday, April 21st, 2019

Recently, I built a working Cuntoo workstation for testing. After this, I wanted to continue building Republican tooling on this workstation. Now that we have a proper keccak-vtron, which requires Ada to build, I wanted to get ave1's musltronic GNAT built statically, so I could try it out on my Cuntoo box. I began with ave1's version 2018-05-15, and this post discusses this version explicitly. In another post, I'll write up my findings when building his latest, 2018-09-24.

There has been much forum discussion surrounding the musltronic GNAT. Likewise, there are a whole number of blog posts by various TMSR Lords, including, ave1, and bvt. However, for this first attempt at building, I used these notes as my main source of help.
* asciilifeform's very useful comments in the forum - steps begin here.
* diana_coman's GNAT Compilation Notes.

To begin with, I downloaded the tarball and notes included at ave1's blog post onto my x86_64 (quad core) gentoo machine, which already had a working GNAT 2016 (from AdaCore) deployed into the environment. From there, I followed the steps that asciilifeform gave in the forum and was successful.

Here's a log of what I actually did:

mod6@gentoo-lappy ~/AVE1_GNAT $ curl -sL "http://ave1.org/tarpit/ada-musl-cross-2018-05-15.tgz" -O
mod6@gentoo-lappy ~/AVE1_GNAT $ curl -sL "http://ave1.org/tarpit/ada-musl-cross-2018-05-15.txt" -O
mod6@gentoo-lappy ~/AVE1_GNAT $ gpg --verify ada-musl-cross-2018-05-15.txt
gpg: Signature made Tue May 15 07:50:39 2018 CDT using RSA key ID 77BC59F9
gpg: Good signature from "ave--"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 57EE 94EA 6F20 49A4 7DAF  A856 8F4C E8F7 77BC 59F9
mod6@gentoo-lappy ~/AVE1_GNAT $ su
gentoo-lappy AVE1_GNAT # tar -xf ada-musl-cross-2018-05-15.tgz
gentoo-lappy AVE1_GNAT #
gentoo-lappy AVE1_GNAT # gnat --version
GNAT GPL 2016 (20160515-49)
Copyright (C) 1996-2016, Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
gentoo-lappy AVE1_GNAT #
gentoo-lappy AVE1_GNAT # cd ada-musl-cross-2018-05-15
gentoo-lappy ada-musl-cross-2018-05-15 # ls
README.md  build-ada.sh  build-native.sh  build.sh  clean.sh  config-static.sh  config.sh  defs.sh  download-adacore-2015.sh  download-adacore-2016.sh  extra  extraconfig.sh  hashes  patches  tarballs

#####
# The next part was specifically from asciilifeform's notes:
# http://btcbase.org/log/2018-05-15#1813719
# http://btcbase.org/log/2018-05-15#1813726
#####

gentoo-lappy ada-musl-cross-2018-05-15 # mkdir bin 

gentoo-lappy ada-musl-cross-2018-05-15 # vim /root/.bash_profile 

######
# Adding this PATH definition into my /root/.bashrc file:  PATH="/home/mod6/AVE1_GNAT/ada-musl-cross-2018-05-15/bin/x86_64-linux-musl/bin/:$PATH"; export PATH
######

gentoo-lappy ada-musl-cross-2018-05-15 # source /root/.bash_profile
gentoo-lappy ada-musl-cross-2018-05-15 # echo $PATH
/home/mod6/AVE1_GNAT/ada-musl-cross-2018-05-15/bin/x86_64-linux-musl/bin/:/usr/gnat/bin:/sbin:/bin:/usr/sbin:/usr/bin
gentoo-lappy ada-musl-cross-2018-05-15 # export MAKEOPTS=-j4
gentoo-lappy ada-musl-cross-2018-05-15 # echo $MAKEOPTS
-j4
gentoo-lappy ada-musl-cross-2018-05-15 # nohup ./build-ada.sh /home/mod6/AVE1_GNAT/ada-musl-cross-2018-05-15/bin & 

...

Some hours later...

...

gentoo-lappy ada-musl-cross-2018-05-15 # ls -al bin/
total 940944
drwxr-xr-x  7 root root       4096 Apr 13 23:42 .
drwx------ 12  902 users      4096 Apr 13 18:18 ..
drwxr-xr-x  8 root root       4096 Apr 13 21:20 aarch64-linux-musl
drwxr-xr-x  9 root root       4096 Apr 13 23:44 aarch64-linux-musl-native
drwxr-xr-x  8 root root       4096 Apr 13 19:04 bootstrap
-rw-r--r--  1 root root  316206446 Apr 13 23:44 muslaarch64-linux-musl-nativeada.tar.gz
-rw-r--r--  1 root root  146969625 Apr 13 21:20 muslaarch64-linux-muslada.tar.gz
-rw-r--r--  1 root root  341775984 Apr 13 22:32 muslx86_64-linux-musl-nativeada.tar.gz
-rw-r--r--  1 root root  158535800 Apr 13 20:15 muslx86_64-linux-muslada.tar.gz
drwxr-xr-x  8 root root       4096 Apr 13 20:15 x86_64-linux-musl
drwxr-xr-x  8 root root       4096 Apr 13 22:32 x86_64-linux-musl-native
gentoo-lappy ada-musl-cross-2018-05-15 # sha512sum bin/*.tar.gz
2de85d5b3b574eb8126007928b0a6a5e7d0a26a65a53b49699e5f61ad857acbf0d3666998775c5dcae513d0e58ec054f3eceda1b16dde053a52e41f55be3d02d  bin/muslaarch64-linux-musl-nativeada.tar.gz
c772632df48d6eae4c097203cb2d1605f7dc4118072df1a8d7d4aefec426479de23dbec365d6380f661d43a497bdbf2008afde503d25e9be943d212cdd67b24a  bin/muslaarch64-linux-muslada.tar.gz
2af6ba6aded0dbf5ee46cacd7727506889668c4d211a75b649d3d0439e953cb4602c61d88a4a15cb87c56e5241930b7d9e6f295d33ef2dc51eb95f403958b272  bin/muslx86_64-linux-musl-nativeada.tar.gz
2d32aa6f7bd6323813b3f2f119bab06c16dd9d39b63412b74b734f92a33e03460bb4261719a8f5b8732941f41028466f9d3ee10a4210b39e43bca5a332465372  bin/muslx86_64-linux-muslada.tar.gz

I then copied up these two tarballs to my cuntoo-test1 machine:
muslx86_64-linux-musl-nativeada.tar.gz
muslx86_64-linux-muslada.tar.gz

With the tarballs copied up, I simply extracted 'muslx86_64-linux-musl-nativeada.tar.gz' in /opt

Then modified my PATH in /home/mod6/.bashrc :
cuntoo-test1 /home/mod6 # tail -1 /home/mod6/.bashrc
export PATH="$PATH:/opt/x86_64-linux-musl-native/bin"

With a new mod6 shell open...

mod6@cuntoo-test1 ~ $ echo $PATH
/usr/x86_64-gentoo-linux-musl/gcc-bin/4.9.4:/usr/local/bin:/usr/bin:/bin:/opt/bin:/opt/x86_64-linux-musl-native/bin
mod6@cuntoo-test1 ~ $ gcc --version
gcc (Gentoo 4.9.4-r100 p1.0, pie-0.6.4) 4.9.4
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

mod6@cuntoo-test1 ~ $ gnat --version
GNAT GPL 2016 (20160515)
Copyright (C) 1996-2016, Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

mod6@cuntoo-test1 ~ $ curl -sL "http://ossasepia.com/vpatches/starter_v.zip" -O
mod6@cuntoo-test1 ~ $ curl -sL "http://ossasepia.com/vpatches/starter_v.zip.diana_coman.sig" -O
mod6@cuntoo-test1 ~ $ gpg --import diana_coman.asc
gpg: key 390F999E: public key "Diana Coman " imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
mod6@cuntoo-test1 ~ $ gpg --verify starter_v.zip.diana_coman.sig starter_v.zip
gpg: Signature made Wed Nov 14 10:39:50 2018 UTC using RSA key ID 390F999E
gpg: Good signature from "Diana Coman "
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: E72D CCB7 3A5E 0669 4C5C  D781 D519 6EE6 390F 999E

mod6@cuntoo-test1 ~ $ unzip starter_v.zip
Archive:  starter_v.zip
   creating: starter_v/
  inflating: starter_v/clean.sh
  inflating: starter_v/build.sh
   creating: starter_v/vtools/
  inflating: starter_v/vtools/vdiff.gpr
  inflating: starter_v/vtools/vpatch.gpr
  inflating: starter_v/vtools/Makefile
  inflating: starter_v/vtools/ksum.gpr
  inflating: starter_v/vtools/manifest
   creating: starter_v/v/
  inflating: starter_v/v/v.pl
  inflating: starter_v/v/v_quick_start.txt
  inflating: starter_v/v/manifest
   creating: starter_v/vtools/src/
  inflating: starter_v/vtools/src/bits.ads
  inflating: starter_v/vtools/src/keccak_c.adb
  inflating: starter_v/vtools/src/vpatch.adb
  inflating: starter_v/vtools/src/dir.c
  inflating: starter_v/vtools/src/util.c
  inflating: starter_v/vtools/src/keccak.h
  inflating: starter_v/vtools/src/diff.h
  inflating: starter_v/vtools/src/bits.adb
  inflating: starter_v/vtools/src/character_io.ads
  inflating: starter_v/vtools/src/context.c
  inflating: starter_v/vtools/src/smg_keccak.adb
  inflating: starter_v/vtools/src/character_io.adb
  inflating: starter_v/vtools/src/ksum.adb
  inflating: starter_v/vtools/src/analyze.c
  inflating: starter_v/vtools/src/keccak_c.ads
  inflating: starter_v/vtools/src/io.c
  inflating: starter_v/vtools/src/diff.c
  inflating: starter_v/vtools/src/smg_keccak.ads
  inflating: starter_v/vtools/src/system.h
   creating: starter_v/vtools/lib/
  inflating: starter_v/vtools/lib/hash.c
  inflating: starter_v/vtools/lib/cmpbuf.c
  inflating: starter_v/vtools/lib/progname.c
  inflating: starter_v/vtools/lib/filetype.h
  inflating: starter_v/vtools/lib/xalloc.c
  inflating: starter_v/vtools/lib/dirname.h
  inflating: starter_v/vtools/lib/filetype.c
  inflating: starter_v/vtools/lib/progname.h
  inflating: starter_v/vtools/lib/cmpbuf.h
  inflating: starter_v/vtools/lib/error.h
  inflating: starter_v/vtools/lib/error.c
  inflating: starter_v/vtools/lib/filenamecat.c
  inflating: starter_v/vtools/lib/dirname.c
  inflating: starter_v/vtools/lib/diffseq.h
  inflating: starter_v/vtools/lib/hash.h
  inflating: starter_v/vtools/lib/filenamecat.h
  inflating: starter_v/vtools/lib/xalloc.h
   creating: starter_v/vtools/obj/
 extracting: starter_v/vtools/obj/readme
mod6@cuntoo-test1 ~ $ cd starter_v
mod6@cuntoo-test1 ~/starter_v $ chmod +x build.sh
mod6@cuntoo-test1 ~/starter_v $ ./build.sh

Compile
   [C]            diff.c
   [C]            filetype.c
   [C]            error.c
   [C]            cmpbuf.c
   [C]            progname.c
   [C]            dirname.c
   [C]            hash.c
   [C]            filenamecat.c
   [C]            xalloc.c
   [C]            dir.c
   [C]            io.c
   [C]            util.c
   [C]            context.c
   [C]            analyze.c
   [Ada]          bits.adb
   [Ada]          ksum.adb
   [Ada]          character_io.adb
   [Ada]          keccak_c.adb
   [Ada]          smg_keccak.adb
Bind
   [gprbind]      diff.bexch
   [Ada]          bits.ali -n
Link
   [archive]      libvdiff.a
   [index]        libvdiff.a
   [link]         diff.c
Compile
   [Ada]          vpatch.adb
Bind
   [gprbind]      vpatch.bexch
   [Ada]          vpatch.ali
Link
   [link]         vpatch.adb
Bind
   [gprbind]      ksum.bexch
   [Ada]          ksum.ali
Link
   [link]         ksum.adb
Done.

mod6@cuntoo-test1 ~/starter_v $ ./ksum vk.pl
115b06a799eae048ffbd18642234dc234e9bf879ebdedf0ed9b4be69a410187537b618d2b4b581954b89d1f63ef0925f9ff1ae26f0882c28f05d3a1fcdb1a732  vk.pl
mod6@cuntoo-test1 ~/starter_v $ ./ksum vdiff
53751a217b0257f716955eff2177aea68815aa1f0076e1b5a7137e843a30a85741dc3b58ef63cdfc4fe5abdbe558f2f614f601da1797bc50032a43594a9b221d  vdiff
mod6@cuntoo-test1 ~/starter_v $ ./ksum vpatch
82b8851c2bbe6bf5e10558152d3bdbde448b6185af4cb2d41afd3339053e9b8b61539a28e55c8aa96fe44d3cdfec832fe5418b2977dab47b67222ee47b8cae67  vpatch
mod6@cuntoo-test1 ~/starter_v $ cd ..
mod6@cuntoo-test1 ~ $ mkdir ffa
mod6@cuntoo-test1 ~ $ cd ffa
mod6@cuntoo-test1 ~/ffa $ mv ../ffa-keccak.tar.gz .
mod6@cuntoo-test1 ~/ffa $ mkdir .wot
mod6@cuntoo-test1 ~/ffa $ mkdir .seals
mod6@cuntoo-test1 ~/ffa $ mkdir patches
mod6@cuntoo-test1 ~/ffa $ tar -xf ffa-keccak.tar.gz
mod6@cuntoo-test1 ~/ffa $ mv keccak/*.sig .seals/
mod6@cuntoo-test1 ~/ffa $ mv keccak/*.vpatch patches
mod6@cuntoo-test1 ~/ffa $ rm -rf keccak/
mod6@cuntoo-test1 ~/ffa $ mv ../asciilifeform.asc .wot/
mod6@cuntoo-test1 ~/ffa $ echo $PATH
/usr/x86_64-gentoo-linux-musl/gcc-bin/4.9.4:/usr/local/bin:/usr/bin:/bin:/opt/bin:/opt/x86_64-linux-musl-native/bin
mod6@cuntoo-test1 ~/ffa $ su
cuntoo-test1 /home/mod6/ffa # cp ../starter_v/{ksum,vdiff,vpatch} /usr/local/bin
cuntoo-test1 /home/mod6/ffa # exit
mod6@cuntoo-test1 ~/ffa $ cp ../starter_v/vk.pl .
mod6@cuntoo-test1 ~/ffa $ ./vk.pl f
ffa_ch1_genesis.kv.vpatch (asciilifeform)
ffa_ch2_logicals.kv.vpatch (asciilifeform)
ffa_ch3_shifts.kv.vpatch (asciilifeform)
ffa_ch4_ffacalc.kv.vpatch (asciilifeform)
ffa_ch5_egypt.kv.vpatch (asciilifeform)
ffa_ch6_simplest_rsa.kv.vpatch (asciilifeform)
ffa_ch7_turbo_egyptians.kv.vpatch (asciilifeform)
ffa_ch8_randomism.kv.vpatch (asciilifeform)
ffa_ch9_exodus.kv.vpatch (asciilifeform)
ffa_ch10_karatsuba.kv.vpatch (asciilifeform)
ffa_ch11_tuning_and_api.kv.vpatch (asciilifeform)
ffa_ch12_karatsuba_redux.kv.vpatch (asciilifeform)
ffa_w_borrow_expr.kv.vpatch (asciilifeform)
ffa_ch13_measure_and_qshifts.kv.vpatch (asciilifeform)
ffa_ch14_barrett.kv.vpatch (asciilifeform)
ffa_ch15_gcd.kv.vpatch (asciilifeform)
ffa_ch16_miller_rabin.kv.vpatch (asciilifeform)
ffa_ch17_peh.kv.vpatch (asciilifeform)
ffa_ch18_subroutines.kv.vpatch (asciilifeform)
mod6@cuntoo-test1 ~/ffa $
mod6@cuntoo-test1 ~/ffa $ ./vk.pl p v ch1 ffa_ch1_genesis.kv.vpatch
ffa_ch1_genesis.kv.vpatch
  creating ffa/README
  creating ffa/ffademo/README
  creating ffa/ffademo/bin/README
  creating ffa/ffademo/demo_ch1.adb
  creating ffa/ffademo/demo_ch1.ads
  creating ffa/ffademo/ffa_demo.adb
  creating ffa/ffademo/ffa_demo.gpr
  creating ffa/ffademo/ffa_io.adb
  creating ffa/ffademo/ffa_io.ads
  creating ffa/ffademo/obj/README
  creating ffa/libffa/README
  creating ffa/libffa/ffa.gpr
  creating ffa/libffa/fz_arith.adb
  creating ffa/libffa/fz_arith.ads
  creating ffa/libffa/fz_type.ads
  creating ffa/libffa/iron.ads
  creating ffa/libffa/lib/README
  creating ffa/libffa/obj/README
  creating ffa/libffa/restrict.adc
  creating ffa/libffa/w_shifts.ads
  creating ffa/libffa/word_ops.adb
  creating ffa/libffa/word_ops.ads
  creating ffa/libffa/words.ads
mod6@cuntoo-test1 ~/ffa $ cd ch1
mod6@cuntoo-test1 ~/ffa/ch1 $ cd ffa
mod6@cuntoo-test1 ~/ffa/ch1/ffa $ cd ffademo/
mod6@cuntoo-test1 ~/ffa/ch1/ffa/ffademo $ ls
README  bin  demo_ch1.adb  demo_ch1.ads  ffa_demo.adb  ffa_demo.gpr  ffa_io.adb  ffa_io.ads  obj
mod6@cuntoo-test1 ~/ffa/ch1/ffa/ffademo $ gprbuild
using project file ffa_demo.gpr
Compile
   [Ada]          ffa_demo.adb
   [Ada]          iron.ads
   [Ada]          word_ops.adb
   [Ada]          w_shifts.ads
   [Ada]          fz_arith.adb
   [Ada]          words.ads
   [Ada]          fz_type.ads
   [Ada]          demo_ch1.adb
   [Ada]          ffa_io.adb
Build Libraries
   [gprlib]       FFA.lexch
   [archive]      libFFA.a
   [index]        libFFA.a
Bind
   [gprbind]      ffa_demo.bexch
   [Ada]          ffa_demo.ali
Link
   [link]         ffa_demo.adb
mod6@cuntoo-test1 ~/ffa/ch1/ffa/ffademo $ ./bin/ffa_demo
X         =
0000000000000000000000000000000000000000000000000000000000000000
Y         =
0000000000000000000000000000000000000000000000000000000000005555
X + Y     =
0000000000000000000000000000000000000000000000000000000000005555
C         =  0
X - Y     =
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAAAB
C         =  1
mod6@cuntoo-test1 ~/ffa/ch1/ffa/ffademo $

As you can see, worked great! Was able to build diana_coman's keccak-vtron, and asciilifeform's FFA (Chapter 1, genesis) without problems at all.

Thanks to all who worked through this adventure before me and left good notes to work from. Much appreciated.

Keccak V Genesis Testing

Wednesday, January 2nd, 2019
     ..::[ Diana Coman's Keccak V Genesis ]::..

  Recently, diana_coman created a V Genesis of my vtron.  Up until this
point, it had been distributed in non-Vtronic form, as a simple tarball.  This
step to make it into a Genesis is important and necessary.  I applaud
diana_coman for taking the initiative.  diana_coman utilized my vtron version
V99994 [signature] as the Genesis [signature].  Additionally, she provides
a vpatch [signature] of the changes between V99994 and V99993 (the latest
release from mod6 on 2018.02.22).  Furthermore, there is a third vpatch
[signature] she released that alters my vtron to utilize keccak tools.  Lastly,
there is a Keccak V Starter Kit [signature] that is bundled up as well.

  The change to move to using the keccak tools is an important milestone as
TMSR~ breaks away from the heathen hashing algorithms, to using it's own Keccak
Tools.

  With excitement to try out the new vtree with the corresponding changes, I
went ahead and downloaded all the aforementioned files and setup a sandbox
to try it out.  What follows here is recreation of diana_coman's vpatches
for validation purposes, the building of diana_coman's Keccak Vtron, and a small
bit of happy-path testing.

This post will basically consist of the following parts:

  0x01: Setting Up Our Test Sandbox
  0x02: Vpatch Validation
  0x03: Building Keccak Vtron

0x01]: Setting Up Our Test Sandbox

// Let's create a sandbox directory to contain all of this:

mod6@gentoo ~ $ mkdir v_keccak
mod6@gentoo ~ $ cd v_keccak/

// Next, let's download all of the vpatches and seals from diana_coman's Ossasepia:

mod6@gentoo ~/v_keccak $ curl -sL "http://ossasepia.com/vpatches/v_mod6_genesis.vpatch" -O
mod6@gentoo ~/v_keccak $ curl -sL "http://ossasepia.com/vpatches/v_mod6_genesis.vpatch.diana_coman.sig" -O
mod6@gentoo ~/v_keccak $ curl -sL "http://ossasepia.com/vpatches/v_mod6_99993.vpatch" -O
mod6@gentoo ~/v_keccak $ curl -sL "http://ossasepia.com/vpatches/v_mod6_99993.vpatch.diana_coman.sig" -O
mod6@gentoo ~/v_keccak $ curl -sL "http://ossasepia.com/vpatches/v_keccak_vtools.vpatch" -O
mod6@gentoo ~/v_keccak $ curl -sL "http://ossasepia.com/vpatches/v_keccak_vtools.vpatch.diana_coman.sig" -O
mod6@gentoo ~/v_keccak $ curl -sL "http://ossasepia.com/vpatches/starter_v.zip" -O
mod6@gentoo ~/v_keccak $ curl -sL "http://ossasepia.com/vpatches/starter_v.zip.diana_coman.sig" -O

// Let's put everything where it's supposed to go in true vtron style;
// vptaches in 'patches', signature files in '.seals, and pubkeys in '.wot'

mod6@gentoo ~/v_keccak $ mkdir .wot

// Let's check, see what we're working with.
mod6@gentoo ~/v_keccak $ ls
starter_v.zip                  v_keccak_vtools.vpatch.diana_coman.sig  v_mod6_genesis.vpatch
starter_v.zip.diana_coman.sig  v_mod6_99993.vpatch                     v_mod6_genesis.vpatch.diana_coman.sig
v_keccak_vtools.vpatch         v_mod6_99993.vpatch.diana_coman.sig

// Move the vpatches into 'patches'
mod6@gentoo ~/v_keccak $ mv *.vpatch patches/
mod6@gentoo ~/v_keccak $ ls patches/
v_keccak_vtools.vpatch  v_mod6_99993.vpatch  v_mod6_genesis.vpatch

// Move the signatures into '.seals'
mod6@gentoo ~/v_keccak $ mv *.vpatch.diana_coman.sig .seals/
mod6@gentoo ~/v_keccak $ ls .seals/
v_keccak_vtools.vpatch.diana_coman.sig  v_mod6_99993.vpatch.diana_coman.sig  v_mod6_genesis.vpatch.diana_coman.sig

// Let's verify all of the files and their signatures:
mod6@gentoo ~/v_keccak $ for i in `ls patches`; do echo "Vpatch: patches/$i" && gpg --verify .seals/$i.diana_coman.sig patches/$i; done
Vpatch: patches/v_keccak_vtools.vpatch
gpg: Signature made Wed Nov 14 10:35:28 2018  using RSA key ID 390F999E
gpg: Good signature from "Diana Coman <office@dianacoman.com>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: E72D CCB7 3A5E 0669 4C5C  D781 D519 6EE6 390F 999E
Vpatch: patches/v_mod6_99993.vpatch
gpg: Signature made Wed Nov 14 10:06:15 2018  using RSA key ID 390F999E
gpg: Good signature from "Diana Coman <office@dianacoman.com>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: E72D CCB7 3A5E 0669 4C5C  D781 D519 6EE6 390F 999E
Vpatch: patches/v_mod6_genesis.vpatch
gpg: Signature made Tue Nov 13 20:10:22 2018  using RSA key ID 390F999E
gpg: Good signature from "Diana Coman <office@dianacoman.com>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: E72D CCB7 3A5E 0669 4C5C  D781 D519 6EE6 390F 999E
mod6@gentoo ~/v_keccak $ gpg --verify starter_v.zip.diana_coman.sig starter_v.zip
gpg: Signature made Wed Nov 14 10:39:50 2018  using RSA key ID 390F999E
gpg: Good signature from "Diana Coman <office@dianacoman.com>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: E72D CCB7 3A5E 0669 4C5C  D781 D519 6EE6 390F 999E

// Place diana_coman's pubkey in .wot
mod6@gentoo ~/v_keccak $ cp ~/pubkeys/diana_coman.asc .wot

---------------------------------------------------------------------------------

0x02]: Vpatch Validation

// Let's setup another little sandbox to replicate the vpatches diana_coman created:
mod6@gentoo ~/v_keccak $ mkdir check_diffs
mod6@gentoo ~/v_keccak $ cd check_diffs/
mod6@gentoo ~/v_keccak/check_diffs $ mkdir -p v99994 v99993

// Let's grab my published Vtrons from The Bitcoin Foundation website:
mod6@gentoo ~/v_keccak/check_diffs $ cd v99994; curl -sL "http://thebitcoin.foundation/v/V-20170317.tar.gz" -O ; curl -sL "http://thebitcoin.foundation/v/V-20170317.tar.gz.mod6.sig" -O ; cd ..
mod6@gentoo ~/v_keccak/check_diffs $ cd v99993; curl -sL "http://thebitcoin.foundation/v/V-20180222.tar.gz" -O ; curl -sL "http://thebitcoin.foundation/v/V-20180222.tar.gz.mod6.sig" -O ; cd ..

// Always check the signatures!
mod6@gentoo ~/v_keccak/check_diffs $ gpg --verify v99994/V-20170317.tar.gz.mod6.sig v99994/V-20170317.tar.gz
gpg: Signature made Fri Mar 17 19:25:29 2017  using RSA key ID B71EADAF
gpg: Good signature from "mod6 (mod6) <modsix@gmail.com>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 027A 8D7C 0FB8 A166 4372  0F40 7217 05A8 B71E ADAF
mod6@gentoo ~/v_keccak/check_diffs $ gpg --verify v99993/V-20180222.tar.gz.mod6.sig v99993/V-20180222.tar.gz
gpg: Signature made Thu Feb 22 21:19:30 2018  using RSA key ID B71EADAF
gpg: Good signature from "mod6 (mod6) <modsix@gmail.com>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 027A 8D7C 0FB8 A166 4372  0F40 7217 05A8 B71E ADAF

// Extract the tarballs into their respective directories
mod6@gentoo ~/v_keccak/check_diffs $ for i in `ls`; do cd $i; tar -xf V-201*.tar.gz; cd ..; done

// Start by going to the v99994 (older version from 2017.03.17)
mod6@gentoo ~/v_keccak/check_diffs $ cd v99994

// Let's match up the directory structure with diana_coman's: Add a 'v' subdir:
mod6@gentoo ~/v_keccak/check_diffs/v99994 $ mkdir -p a/v b/v

// Let's add all of the included files in diana_coman's 'v_mod6_genesis.vpatch':
mod6@gentoo ~/v_keccak/check_diffs/v99994 $ cp v.pl v_quick_start.txt v_users_manual.txt b/v/

// Now diff them with vdiff into their own output vpatch '99994_genesis.vpatch'
mod6@gentoo ~/v_keccak/check_diffs/v99994 $ vdiff a b > 99994_genesis.vpatch

// Finally, vdiff our genesis '99994_genesis.vpatch' to diana_coman's genesis 'v_mod6_genesis.vpatch'
mod6@gentoo ~/v_keccak/check_diffs/v99994 $ vdiff ../../patches/v_mod6_genesis.vpatch 99994_genesis.vpatch
mod6@gentoo ~/v_keccak/check_diffs/v99994 $

// Matches perfectly.  Excellent!

// Next let's create our own diff of v99994 to v99993 and compare it to diana_coman's:
mod6@gentoo ~/v_keccak/check_diffs/v99994 $ cd ../v99993

// Make our compare directories
mod6@gentoo ~/v_keccak/check_diffs/v99993 $ mkdir -p a/v b/v

// Let's copy in our v99994 files into 'a/v' (the old)
mod6@gentoo ~/v_keccak/check_diffs/v99993 $ cp -pv ../v99994/{v.pl,v_quick_start.txt,v_users_manual.txt} a/v
'../v99994/v.pl' -> 'a/v/v.pl'
'../v99994/v_quick_start.txt' -> 'a/v/v_quick_start.txt'
'../v99994/v_users_manual.txt' -> 'a/v/v_users_manual.txt'

// Let's copy in our v99993 files into 'b/v' (the new)
mod6@gentoo ~/v_keccak/check_diffs/v99993 $ cp -pv v.pl v_quick_start.txt v_users_manual.txt b/v
'v.pl' -> 'b/v/v.pl'
'v_quick_start.txt' -> 'b/v/v_quick_start.txt'
'v_users_manual.txt' -> 'b/v/v_users_manual.txt'

// Let's diff them with vdiff into our own output vpatch 'v99994_v99993.vpatch'
mod6@gentoo ~/v_keccak/check_diffs/v99993 $ vdiff a b > v99994_v99993.vpatch

// Finally vdiff my vpatch 'v99994_v99993.vpatch' against diana's distributed vpatch 'v_mod6_v99993.vpatch'
mod6@gentoo ~/v_keccak/check_diffs/v99993 $ vdiff ../../patches/v_mod6_99993.vpatch v99994_v99993.vpatch
mod6@gentoo ~/v_keccak/check_diffs/v99993 $

// Matches perfectly.  Excellent!

---------------------------------------------------------------------------------

0x03]: Building Keccak Vtron

// Unpack starter_v.zip (Archive and corresponding seal, already verified in section 0x02).

// Check which Ada version we have installed
mod6@gentoo ~/v_keccak $ gprbuild --version
GPRBUILD GPL 2015 (20150428) (x86_64-pc-linux-gnu)
Copyright (C) 2004-2015, Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

mod6@gentoo ~/v_keccak $ gnat --version
GNAT GPL 2015 (20150428-49)
Copyright (C) 1996-2015, Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

mod6@gentoo ~/v_keccak $ unzip starter_v.zip
Archive:  starter_v.zip
   creating: starter_v/
  inflating: starter_v/clean.sh
  inflating: starter_v/build.sh
   creating: starter_v/vtools/
  inflating: starter_v/vtools/vdiff.gpr
  inflating: starter_v/vtools/vpatch.gpr
  inflating: starter_v/vtools/Makefile
  inflating: starter_v/vtools/ksum.gpr
  inflating: starter_v/vtools/manifest
   creating: starter_v/v/
  inflating: starter_v/v/v.pl
  inflating: starter_v/v/v_quick_start.txt
  inflating: starter_v/v/manifest
   creating: starter_v/vtools/src/
  inflating: starter_v/vtools/src/bits.ads
  inflating: starter_v/vtools/src/keccak_c.adb
  inflating: starter_v/vtools/src/vpatch.adb
  inflating: starter_v/vtools/src/dir.c
  inflating: starter_v/vtools/src/util.c
  inflating: starter_v/vtools/src/keccak.h
  inflating: starter_v/vtools/src/diff.h
  inflating: starter_v/vtools/src/bits.adb
  inflating: starter_v/vtools/src/character_io.ads
  inflating: starter_v/vtools/src/context.c
  inflating: starter_v/vtools/src/smg_keccak.adb
  inflating: starter_v/vtools/src/character_io.adb
  inflating: starter_v/vtools/src/ksum.adb
  inflating: starter_v/vtools/src/analyze.c
  inflating: starter_v/vtools/src/keccak_c.ads
  inflating: starter_v/vtools/src/io.c
  inflating: starter_v/vtools/src/diff.c
  inflating: starter_v/vtools/src/smg_keccak.ads
  inflating: starter_v/vtools/src/system.h
   creating: starter_v/vtools/lib/
  inflating: starter_v/vtools/lib/hash.c
  inflating: starter_v/vtools/lib/cmpbuf.c
  inflating: starter_v/vtools/lib/progname.c
  inflating: starter_v/vtools/lib/filetype.h
  inflating: starter_v/vtools/lib/xalloc.c
  inflating: starter_v/vtools/lib/dirname.h
  inflating: starter_v/vtools/lib/filetype.c
  inflating: starter_v/vtools/lib/progname.h
  inflating: starter_v/vtools/lib/cmpbuf.h
  inflating: starter_v/vtools/lib/error.h
  inflating: starter_v/vtools/lib/error.c
  inflating: starter_v/vtools/lib/filenamecat.c
  inflating: starter_v/vtools/lib/dirname.c
  inflating: starter_v/vtools/lib/diffseq.h
  inflating: starter_v/vtools/lib/hash.h
  inflating: starter_v/vtools/lib/filenamecat.h
  inflating: starter_v/vtools/lib/xalloc.h
   creating: starter_v/vtools/obj/
 extracting: starter_v/vtools/obj/readme
mod6@gentoo ~/v_keccak $ cd starter_v
mod6@gentoo ~/v_keccak/starter_v $ ls
build.sh  clean.sh  v  vtools
mod6@gentoo ~/v_keccak/starter_v $ chmod +x build.sh
mod6@gentoo ~/v_keccak/starter_v $ ./build.sh
gcc -c diff.c
gcc -c progname.c
gcc -c dirname.c
gcc -c hash.c
gcc -c cmpbuf.c
gcc -c filenamecat.c
gcc -c filetype.c
gcc -c error.c
gcc -c xalloc.c
gcc -c dir.c
gcc -c analyze.c
gcc -c util.c
gcc -c context.c
gcc -c io.c
gcc -c bits.adb
gcc -c ksum.adb
gcc -c character_io.adb
gcc -c keccak_c.adb
gcc -c smg_keccak.adb
gprbind diff.bexch
gnatbind bits.ali ... -n
gcc -c b__diff.adb
ar cr libvdiff.a ...
ranlib libvdiff.a
gcc diff.o -o vdiff
gcc -c vpatch.adb
gprbind vpatch.bexch
gnatbind vpatch.ali
gcc -c b__vpatch.adb
gcc vpatch.o -o vpatch
vpatch.o: In function `vpatch__temp_file_name.3044':
vpatch.adb:(.text+0xbb1): warning: the use of `mktemp' is dangerous, better use `mkstemp'
gprbind ksum.bexch
gnatbind ksum.ali
gcc -c b__ksum.adb
gcc ksum.o -o ksum
Done.

// Compile complete.

mod6@gentoo ~/v_keccak/starter_v $ ls
build.sh  clean.sh  ksum  v  vdiff  vk.pl  vpatch  vtools
mod6@gentoo ~/v_keccak/starter_v $ ./vk.pl v
Dependent program not found! : vpatch

// Let's place the compiled binaries in our PATH
mod6@gentoo ~/v_keccak/starter_v $ su
Password:
gentoo starter_v # cp vdiff vpatch ksum /usr/bin/
gentoo starter_v # exit
exit

// Ok, now let's try and see if it can find the binaries it needs...
mod6@gentoo ~/v_keccak/starter_v $ ./vk.pl v
/home/mod6/v_keccak/starter_v/.wot directory does not exist.
See 'init' or 'sync' commands in 'help'.

// Ok, better!

mod6@gentoo ~/v_keccak/starter_v $ cd ..

// Let's place the version from the starter_v bundle where we can test it properly
// with keccak vpatches.

mod6@gentoo ~/v_keccak $ cp starter_v/vk.pl .
mod6@gentoo ~/v_keccak $ ./vk.pl v
################################################################################
#               ..::[ The Bitcoin Foundation: V ]::..                          #
#                                                                              #
#     Version: 99992 K                                                         #
#      Author: mod6                                                            #
# Fingerprint: 0x027A8D7C0FB8A16643720F40721705A8B71EADAF                      #
#                                                                              #
################################################################################
mod6@gentoo ~/v_keccak $ ./vk.pl p v vk v_keccak_vtools.vpatch
v_mod6_genesis.vpatch
  creating v/v.pl
  creating v/v_quick_start.txt
  creating v/v_users_manual.txt
v_mod6_99993.vpatch
  patching v/v.pl
  patching v/v_quick_start.txt
  patching v/v_users_manual.txt
v_keccak_vtools.vpatch
  patching v/v.pl
  patching v/v_quick_start.txt
  deleting v/v_users_manual.txt
mod6@gentoo ~/v_keccak $ cd vk
mod6@gentoo ~/v_keccak/vk $ ls
v
mod6@gentoo ~/v_keccak/vk $ cd v/
mod6@gentoo ~/v_keccak/vk/v $ ls
v.pl  v_quick_start.txt
mod6@gentoo ~/v_keccak/vk/v $ ksum v.pl ../../starter_v/vk.pl
115b06a799eae048ffbd18642234dc234e9bf879ebdedf0ed9b4be69a410187537b618d2b4b581954b89d1f63ef0925f9ff1ae26f0882c28f05d3a1fcdb1a732  v.pl
115b06a799eae048ffbd18642234dc234e9bf879ebdedf0ed9b4be69a410187537b618d2b4b581954b89d1f63ef0925f9ff1ae26f0882c28f05d3a1fcdb1a732  ../../starter_v/vk.pl

// Alright!  The press of diana_coman's keccak vpatches for her V genesis worked great,
// and produced the same ksum (keccak sum) as the original from the starter_v.zip archive.

----------------------------------------------

That's all for now, if or when I do some more work surrounding `vk.pl`, I'll
write it up and make another blog post about it.