Archive for the ‘Cuntoo’ 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 2

Friday, April 26th, 2019

I recently made a post about building a musltronic GNAT for Cuntoo. Today, I wanted to write about my success with building ave1's latest version 2018-09-24, as I said I would in the previous post.

I took the same basic steps that I took with the previous version, detailed in the previous post. What follows is my log of the building of the 2018-09-24 version, as well as some testing steps on the Cuntoo target machine:

mod6@gentoo-lappy ~/AVE1_GNAT $ gpg --verify ada-musl-cross-2018-09-24.txt
gpg: Signature made Mon Sep 24 05:12:01 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-09-24.tgz
gentoo-lappy AVE1_GNAT # cd ada-musl-cross-2018-09-24
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 # cd ada-musl-cross-2018-09-24
gentoo-lappy ada-musl-cross-2018-09-24 # mkdir bin
gentoo-lappy ada-musl-cross-2018-09-24 # ls -al
total 92
drwx------ 7  902 users 4096 Apr 21 14:49 .
drwxr-xr-x 6 mod6 mod6  4096 Apr 21 14:49 ..
-rw------- 1  902 users 4354 Sep 24  2018 README.md
drwxr-xr-x 2 root root  4096 Apr 21 14:49 bin
-rwx------ 1  902 users  186 Sep 24  2018 build-ada-arm64.sh
-rwx------ 1  902 users  187 Sep 24  2018 build-ada.sh
-rwx------ 1  902 users 2764 Sep 24  2018 build-native.sh
-rwx------ 1  902 users 4512 Sep 24  2018 build.sh
-rwx------ 1  902 users  125 Sep 24  2018 clean.sh
-rw------- 1  902 users  448 Sep 24  2018 config-static.sh
-rw------- 1  902 users  762 Sep 24  2018 config.sh
-rw------- 1  902 users 8931 Sep 24  2018 defs.sh
-rwx------ 1  902 users 2018 Sep 24  2018 download-adacore-2015.sh
-rwx------ 1  902 users 2685 Sep 24  2018 download-adacore-2016.sh
drwx------ 2  902 users 4096 Sep 24  2018 extra
-rw------- 1  902 users   41 Sep 24  2018 extraconfig.sh
drwx------ 2  902 users 4096 Sep 24  2018 hashes
drwx------ 2  902 users 4096 Sep 24  2018 patches
drwx------ 2  902 users 4096 Sep 24  2018 tarballs

gentoo-lappy ada-musl-cross-2018-09-24 # vim ~/.bashrc
gentoo-lappy ada-musl-cross-2018-09-24 # tail -1 /root/.bashrc
PATH="/home/mod6/AVE1_GNAT/ada-musl-cross-2018-09-24/bin/x86_64-linux-musl/bin/:$PATH"; export PATH
gentoo-lappy ada-musl-cross-2018-09-24 # source ~/.bashrc
gentoo-lappy ada-musl-cross-2018-09-24 # echo $PATH
/home/mod6/AVE1_GNAT/ada-musl-cross-2018-09-24/bin/x86_64-linux-musl/bin/:/usr/gnat/bin:/sbin:/bin:/usr/sbin:/usr/bin
gentoo-lappy ada-musl-cross-2018-09-24 # export MAKEOPTS=-j4
gentoo-lappy ada-musl-cross-2018-09-24 # echo $MAKEOPTS
-j4

gentoo-lappy ada-musl-cross-2018-09-24 # nohup ./build-ada.sh /home/mod6/AVE1_GNAT/ada-musl-cross-2018-09-24/bin &

... Some hours later ...

gentoo-lappy ada-musl-cross-2018-09-24 # cd bin
gentoo-lappy bin # pwd
/home/mod6/AVE1_GNAT/ada-musl-cross-2018-09-24/bin
gentoo-lappy bin # ls -al
total 837704
drwxr-xr-x  7 root root       4096 Apr 21 20:05 .
drwx------ 12  902 users      4096 Apr 21 14:58 ..
drwxr-xr-x  8 root root       4096 Apr 21 17:52 aarch64-linux-musl
drwxr-xr-x  9 root root       4096 Apr 21 20:07 aarch64-linux-musl-native
drwxr-xr-x  8 root root       4096 Apr 21 15:41 bootstrap
-rw-r--r--  1 root root  277760306 Apr 21 20:07 muslaarch64-linux-musl-nativeada.tar.gz
-rw-r--r--  1 root root  135554542 Apr 21 17:52 muslaarch64-linux-muslada.tar.gz
-rw-r--r--  1 root root  298885391 Apr 21 19:00 muslx86_64-linux-musl-nativeada.tar.gz
-rw-r--r--  1 root root  145566406 Apr 21 16:50 muslx86_64-linux-muslada.tar.gz
drwxr-xr-x  8 root root       4096 Apr 21 16:50 x86_64-linux-musl
drwxr-xr-x  8 root root       4096 Apr 21 19:00 x86_64-linux-musl-native
gentoo-lappy bin # sha512sum musl*.tar.gz
97115def5223707837ab83ec661d6f418ef8e4c54cb0a729559011d4b18f1f516cb74ec4a2f4a86a388cfcabadaa542b6fc4cf56521478b089ebe342a4a14765  muslaarch64-linux-musl-nativeada.tar.gz
98c8185f4a38c1db8069915f704cfafabf929a935245b49d3598783106fce3af7fca7e0dee5643bc08ddd2d6f92c31368cfc2e39657cfcd771f281aa031eae91  muslaarch64-linux-muslada.tar.gz
f56931c10a5d49ab779cf3a3b034d5080bb45c1210ae44198900ed16c61391da98aafe1959b65155c1cf3c32899f8320d0b336ad865bba3945f3621728e15b12  muslx86_64-linux-musl-nativeada.tar.gz
04f5506532b512f856a922278a0227eaca52abe30e5ffe0a3f47ab48b3aa5112f12b155878eff2c7c59f89f768f49431249209037ad057cc6f1b45728d45a963  muslx86_64-linux-muslada.tar.gz
gentoo-lappy bin #

# 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

# I then created a directory for ave1's 2018-09-24 version:
cuntoo-test1 /opt # mkdir 20180924
cuntoo-test1 /opt # cd 20180924
cuntoo-test1 /opt/20180924 # cp /home/mod6/AVE1_GNAT/20180924/muslx86_64-linux-musl-nativeada.tar.gz .
cuntoo-test1 /opt/20180924 # tar -xf muslx86_64-linux-musl-nativeada.tar.gz
cuntoo-test1 /opt/20180924 # ls
muslx86_64-linux-musl-nativeada.tar.gz  x86_64-linux-musl-native

Back to a regular mod6 shell...

mod6@cuntoo-test1 ~ $ source ~/.bashrc
mod6@cuntoo-test1 ~ $ tail -1 ~/.bashrc
export PATH="$PATH:/opt/20180924/x86_64-linux-musl-native/bin"
mod6@cuntoo-test1 ~ $ echo $PATH
/usr/gnat/bin:/usr/x86_64-gentoo-linux-musl/gcc-bin/4.9.4:/usr/local/bin:/usr/bin:/bin:/opt/bin:/opt/20180924/x86_64-linux-musl-native/bin
mod6@cuntoo-test1 ~ $ command -v gnat
/opt/20180924/x86_64-linux-musl-native/bin/gnat
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 ~ $ command -v gnat
/opt/20180924/x86_64-linux-musl-native/bin/gnat
mod6@cuntoo-test1 ~ $ /opt/20180924/x86_64-linux-musl-native/bin/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 ~ $
mod6@cuntoo-test1 ~/test-ave1gnat-20180924 $ curl -sL "http://ossasepia.com/vpatches/starter_v.zip" -O
mod6@cuntoo-test1 ~/test-ave1gnat-20180924 $ curl -sL "http://ossasepia.com/vpatches/starter_v.zip.diana_coman.sig" -O
mod6@cuntoo-test1 ~/test-ave1gnat-20180924 $ gpg --import ../diana_coman.asc
gpg: key 390F999E: "Diana Coman " not changed
gpg: Total number processed: 1
gpg:              unchanged: 1
mod6@cuntoo-test1 ~/test-ave1gnat-20180924 $ 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 ~/test-ave1gnat-20180924 $ unzip starter_v.zip                                                                                                                                                    [3/76]
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 ~/test-ave1gnat-20180924 $ cd starter_v
mod6@cuntoo-test1 ~/test-ave1gnat-20180924/starter_v $ chmod +x build.sh
mod6@cuntoo-test1 ~/test-ave1gnat-20180924/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 ~/test-ave1gnat-20180924/starter_v $ cd ..
mod6@cuntoo-test1 ~/test-ave1gnat-20180924 $ cp ../ffa/ffa-keccak.tar.gz .
mod6@cuntoo-test1 ~/test-ave1gnat-20180924 $ mkdir ffa
mod6@cuntoo-test1 ~/test-ave1gnat-20180924 $ mv ffa-keccak.tar.gz ffa
mod6@cuntoo-test1 ~/test-ave1gnat-20180924 $ cd ffa/
mod6@cuntoo-test1 ~/test-ave1gnat-20180924/ffa $ tar -xf ffa-keccak.tar.gz
mod6@cuntoo-test1 ~/test-ave1gnat-20180924/ffa $ mkdir -p .wot patches .seals
mod6@cuntoo-test1 ~/test-ave1gnat-20180924/ffa $ mv keccak/*.sig .seals/
mod6@cuntoo-test1 ~/test-ave1gnat-20180924/ffa $ mv keccak/*.vpatch patches/
mod6@cuntoo-test1 ~/test-ave1gnat-20180924/ffa $ cp ../starter_v/vk.pl .
mod6@cuntoo-test1 ~/test-ave1gnat-20180924/ffa $ ./vk.pl w
asciilifeform:17215D118B7239507FAFED98B98228A001ABFFC7:Stanislav Datskovskiy 
mod6@cuntoo-test1 ~/test-ave1gnat-20180924/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 ~/test-ave1gnat-20180924/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 ~/test-ave1gnat-20180924/ffa $ cd ch1/ffa/ffademo/
mod6@cuntoo-test1 ~/test-ave1gnat-20180924/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 ~/test-ave1gnat-20180924/ffa/ch1/ffa/ffademo $ bin/ffa_demo
X         =
0000000000000000000000000000000000000000000000000000000000000000
Y         =
0000000000000000000000000000000000000000000000000000000000005555
X + Y     =
0000000000000000000000000000000000000000000000000000000000005555
C         =  0
X - Y     =
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAAAB
C         =  1
mod6@cuntoo-test1 ~/test-ave1gnat-20180924/ffa/ch1/ffa/ffademo $

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.

A Cuntoo Adventure Part Two

Sunday, March 3rd, 2019

Let's continue from the earlier cuntoo adventure.

So there I was, attempting to build a Cuntoo from my Gentoo installation on my system: Lenovo M-7033; Intel i5-2400 @ 3.10Ghz CPU; 8 Gb RAM; 500Gb SATA SSD.

To recap a bit from last time, the system's working Gentoo installation was on a 500 Gb WD SATA SSD, plugged into SATA channel 1 on the motherboard. To create a cuntoo, I simply powered down the box. Unplugged the mains, disconnected the CDROM drive from the power supply and it's SATA cable from SATA channel 2. I then proceeded to connect a 250 Gb WD SATA SSD to the power supply and then SATA channel 2. This way I could boot up gentoo, build/configure cuntoo, and target /dev/sdb (250 Gb WD SSD) as the block-device in-which to inflate cuntoo upon. These are the same initial steps that I had taken all during part one of this adventure.

I stopped into the forum for some help, however, I didn't go about all of this in the correct manner, so I caused more harm than good. But asciilifeform did mention to me that I needed to remove all modules from the kernel config. I then proceeded to build Cuntoo without any modules, but actually didn't return to check or work on it for about five days. Once I did manage to get more time to work on it, I did the following steps; powered down Gentoo, unplugged mains, unplugged the Gentoo 500 Gb SSD from the power supply, unplugged its SATA cable from channel 1, unplugged the Cuntoo 250 Gb SSD from the power supply, unplugged its SATA cable from channel 2, then plugged the Cuntoo 250 Gb SSD into the power supply and the SATA cable into channel 1. Additionally, I plugged the CDROM drive's power supply cable and the SATA cable back into channel 2. With that, everything was in place on the inside of the box for a test-boot. On the outside of the box, I ensured that my Null Modem cable was plugged in to the serial port, and to another machine where I could capture the output in case of Kernel Panic.

I set:

stty -F /dev/sttys0 115200 raw -echo -echoe -echok

on my secondary box, then immediately ran:

dd if=/dev/ttyS0 of=kern.nomods

Now that I was collecting output data from the serial line, it was time to power on the Cuntoo box and see if it helped anything by having no kernel modules at all, everything compiled in directly. After the box started up, the Cuntoo Lilo screen came up as expected, and then after 5 seconds, proceeded to boot. What was interesting was, I had the same output message on the screen as the previous times:

boot:
Loading Cuntoo.......................................
BIOS data check successful
early console in extract_kernel
input_data: 0x0000000001dd23b4
input_len: 0x0000000004f8f38
output: 0x0000000001000000
output_len: 0x00000000012b9908
kernel_total_size: 0x000000000106c000

Decompressing Linux... Parsing ELF... done.
Booting the kernel.

The main difference here was that instead of 39 dots after Cuntoo, there were hundreds (maybe?). My guess at that being that the kernel, with no modules, is just larger which outputs more dots during extraction time. Fine. Then after that message above posted, the screen flickered (which didn't happen on any previous attempt), and then changed fonts to a much smaller point value and displayed 4 penguins at the top of the screen (also something not seen in any previous attempt). I was somewhat convinced that this may just fully boot up! But after about 5 or 6 minutes (I wanted to give it time since it's a fairly large kernel), I finally powered it down. Snake-eyes. And with that I had run out of time to work on for another four or five days.

Side quest: We've gotten a whopping 51.4 inches of snow in February. It's been keeping me hopping from one foot to the next to keep it all cleared. I've also used 250 pounds of salt in one single month! I bought three hundred pounds, which I figured would easily last me a year, and maybe two. One month later, I'm pretty convinced I'll go through the remaining 50 pounds before it's all over.

Back to our adventure... I'd been rightly flogged for being an asshat and idiotically tilting at windmills. So I decided to slow down, and take a measured and calculated approach to figuring out what the problem might be. The first step here being to look at the kernel panic output from the 'no kernel modules' build that I had made a number of days prior. At first glance, I didn't see anything really too different in the actual reported error, with the subtle difference this time that the VFS was not able to mount root fs on unknown-block(8,3). Which in previous attempts it had said unknown-block(0,0). I walked away for about half an hour to think on it, and decided to read through the entire huge readout from the kernel panic. This one was much larger output from the first part of the adventure as this time, everything was compiled in directly.

Going through the entire massive output, I happened across the following:

[ 18.289235] sd 1:0:0:0: Attached scsi generic sg1 type 0
[ 18.289271] sd 1:0:0:0: [sdb] 488397168 512-byte logical blocks: (250 GB/233 GiB)
[ 18.289480] sd 1:0:0:0: [sdb] Write Protect is off
[ 18.289526] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 18.320978] Initializing XFRM netlink socket
[ 18.321079] sdb: sdb1 sdb2 sdb3
[ 18.321383] sd 1:0:0:0: [sdb] Attached SCSI disk
[ 18.322469] scsi 2:0:0:0: CD-ROM HL-DT-ST DVD-RAM GH70N NYA2 PQ: 0 ANSI: 5

Now this really struck me, because this part was never present before in the previous kernel panics that I had read through during the adventure. In this case, it seems that it found my disk! But it was strange to me that I found it labeled 'sdb', where I expected it to be 'sda'.

Once again, I put the Gentoo Live CD into the CDROM drive, booted into the live disk, and made a cuntoo chroot. Inside there, I simply changed the /etc/fstab to the following:

/dev/sdb1 /boot ext2 noatime 1 2
/dev/sdb2 none  swap sw      0 0
/dev/sdb3 /       ext4 noatime 0 1

And then I only changed 1 line in lilo.conf, from:

append="root=/dev/sda3 console=ttyS0,115200n8 net.ifnames=0"

to:

append="root=/dev/sdb3 console=ttyS0,115200n8 net.ifnames=0"

Then I ran the following command to update the lilo:

/sbin/lilo

Once that was finished, I exited the chroot, and did a shutdown on the box. I removed the Live CD, and then I booted my first Cuntoo.

That's all there really is to tell for this part of the adventure. There is more yak shaving to be done, of course. I'll post more when I have updates.

A Cuntoo Adventure

Sunday, February 10th, 2019

They say the best way to tell any story is to start at the beginning. This story could be a bit long but, I'll try to tell it in the shortest way possible.

There I was about ten days ago, wanting to get a Cuntoo going not only for TRB purposes, but also for want to run TMSR~'s own UNIX. I have a number of different machines at my disposal that I could have chosen to attempt to build Cuntoo upon; however, they are all Intel hardware (for whatever reason I don't have a working AMD box at the moment - Cuntoo does ship with a APU2 kernel config), and I do have one machine that was a good choice to try Cuntoo out. This machine in particular is named 'trb-test1', and I built it in early 2018 and has been running Gentoo happily ever since. It's main job is a TRB testing environment. Never had a problem with it since I plugged it in late last spring. Let me give some context about it's hardware; the trb-test1 box is a Lenovo M-7033 with an Intel i5-2400 @ 3.10Ghz CPU, 8 Gb RAM, and a 500 Gb WD SATA SSD.

Let me give some further context about the working Gentoo environment that is installed on the 500 Gb WD SATA SSD (on SATA channel 1). Gentoo was built upon it in the usual fashion with a Live CD and through following the Gentoo Handbook. There was nothing out of the ordinary regarding its Kernel, I didn't do any custom Kernel configuration. It has a generic Grub boot-loader. The /etc/fstab/ has three partitions, as shown by the fdisk -l /dev/sda, very simple.

With all of this in mind, I went off to start on this Cuntoo adventure. To do so, I didn't want to use my existing Gentoo SSD for this, as I wanted to keep that around in case of problems. So I bought a new 250 Gb WD SSD for the job. I powered down the trb-test1 box, unplugged the CDROM from SATA channel 2, and plugged in the new 250 Gb SSD into channel 2. This allowed me to boot back into my working Gentoo and begin going through the steps as outlined on trinque's blog. To keep things totally simple, I copied over my working kernel config /usr/src/linux/.config from my working Gentoo on the same box (currently plugged into SATA channel 1, /dev/sda), and dropped it into the cuntoo/config directory and ran the following command: `./bootstrap.sh -k config/trb-test1 -d /dev/sdb`. Everything seemed to work well, however, the output genesis file didn't verify with trinque's signature. I decided to put that aside for a moment as I wanted to just see if I could get it to boot.

After the Cuntoo script had completed, I powered down trb-test1 and unplugged the 500 Gb SSD Gentoo disk from SATA1, placed it in an anti-static bag, and then unplugged the newly created Cuntoo disk from SATA2, and into SATA1, and plugged the CDROM drive back into SATA2. Now it was time to try booting Cuntoo for the first time. I powered on the box, and this was the message I received, and it just "hung" there for at least 5 minutes, which indicated to me that there was some kind of problem and it wasn't going to boot.

After that kernel hang, I was somewhat convinced that I had procured a bad SSD out of the box. So I decided to drive to go buy another one of the exact same specs, and try that one. It's never bad to have an extra laying around anyway, and I at least wanted to remove one possible variable from the equation. After a full rebuild of Cuntoo on the new 250 Gb WD SSD, I received the same panic message. If anything, it told me that it wasn't a hard drive issue. I did, many times, boot up into the Gentoo Live CD and mount the Cuntoo disk in a chroot to check various configuration files and paramters. The /etc/lilo.conf looked fine, I checked that the UUIDs for the /boot and / directories matched up from what was in /dev/disk/by-uuid, etc. And after that didn't seem to help, I went back to the /etc/lilo.conf and commented out those lines, and instead put in the proper 'boot=/dev/sda', and 'root=/dev/sda3'. After which, running `/sbin/lilo` to refresh the /boot/map and other things that lilo does when installing. Neither of which seemed to help here. I also looked over the /etc/fstab and a `fdisk -l /dev/sda` while in the chroot, all of which looked perfect. All in all, everything that I looked at that was installed by the Cuntoo bootstrap script, looked like it should have worked. Nothing at all seemed out of the ordinary.

The message at boot time was barely anything to go on, so I spent some time relearning how to get Kernel Panic messages out of the boot process. trinque's lilo configuration contained a 'console=ttyS0,115200n8' in the append section of the 'image' portion of the file. So, I unearthed my Null Modem Cable and plugged that into one of my other Gentoo boxes. On the other Gentoo box, I su'd to root, and ran the following command to enable reading from the Serial Line `stty -F /dev/sttys0 115200 raw -echo -echoe -echok`. I then executed a `dd if=/dev/ttyS0 of=kern.debug`. Back over to the Cuntoo box, I then powered it on, and when I received the hang-message, I waited about 1 minute to ensure that I had captured all of the panic output. Then I simply ^C'd the `dd` on the other box and sure enough, I had captured the panic in the file kern.debug.

After this, I tried a myriad of other things, I initially wrote them out here, but I'm going to cut them as they are pretty much irrelevant. Every type of different attempt yielded the same panic message.

There may be something about this particular iron it does not seem to be "happy" with. It seems strange to me that the same kernel configuration that I use for Gentoo, on the exact same box, would not work here properly. However, there could be something weird happening with the boot-loader, but it's beyond my area of expertise. One thing that I did note from comparing my working Gentoo to Cuntoo, is that my Gentoo does have an initrd installed into /boot. At one point, I even hand-built an initrd and placed it into the Cuntoo /boot and re-ran /sbin/lilo, but that didn't seem to help either. It just dropped me into a shell, that didn't get me much of anywhere. And additionally, I'm not super convinced that I even did that part 100% correctly as I've never hand-rolled an initrd before. I'm not sure that I will continue to try to get Cuntoo working on this particular hardware, maybe instead I'll have to acquire some APU2 iron and try trinque's provided APU2 kernel config. If I ever do find success on this particular hardware, I'll be sure to write about it on this blog as a follow up.