URI: 
       tInstall Electrum from upstream source. - uwu - hardware bitcoin wallet software and build system
  HTML git clone https://git.parazyd.org/uwu
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit 199e84931a15c9fc3ab34d9b06658422bd7085db
   DIR parent e433596e4c8c93c86e0425f9ba39565c04d17b86
  HTML Author: parazyd <parazyd@dyne.org>
       Date:   Wed,  3 Feb 2021 00:50:17 +0100
       
       Install Electrum from upstream source.
       
       Diffstat:
         M Makefile                            |      13 ++++++-------
         M chroot.mk                           |       7 +++----
         M config.mk                           |       4 +++-
         A electrum.mk                         |      19 +++++++++++++++++++
         M install.sh.in                       |      12 ++++--------
       
       5 files changed, 35 insertions(+), 20 deletions(-)
       ---
   DIR diff --git a/Makefile b/Makefile
       t@@ -17,16 +17,18 @@ INIT_BINS = initramfs/bin
        all: $(BINS) $(BOOT_BINS)
        
        include alpine.mk
       -include chroot.mk
        include busybox.mk
       +include electrum.mk
        include kernel.mk
       +include chroot.mk
        
        clean:
                rm -rf $(BINS) $(BOOT_BINS) $(INIT_BINS) rpi-boot/filesystem.squashfs \
                        $(IMAGE) qemu-wrapper.c
        
        distclean: clean
       -        rm -rf $(ALPINE_BINS) $(BUSYBOX_BINS) $(CHROOT_BINS) $(KERNEL_BINS)
       +        rm -rf $(ALPINE_BINS) $(BUSYBOX_BINS) $(CHROOT_BINS) $(KERNEL_BINS) \
       +                $(ELECTRUM_BINS)
        
        qemu-wrapper.c: qemu-wrapper.c.in
                sed -e 's,@QEMU_ARM@,$(QEMU_ARM),g' < $@.in > $@
       t@@ -35,16 +37,13 @@ qemu-wrapper: qemu-wrapper.c
                $(CC) -static $@.c -O3 -s -o $@
        
        install.sh: install.sh.in
       -        sed \
       -                -e 's,@USERCREDENTIALS@,$(USERCREDENTIALS),g' \
       -                -e 's,@ROOTCREDENTIALS@,$(ROOTCREDENTIALS),g' \
       -                < $@.in > $@
       +        sed -e 's,@ROOTCREDENTIALS@,$(ROOTCREDENTIALS),g' < $@.in > $@
        
        initramfs/bin/busybox: $(BUSYBOX_SRC)/busybox
                mkdir -p initramfs/bin
                cp $(BUSYBOX_SRC)/busybox $@
        
       -rpi-boot/filesystem.squashfs: chroot/usr/bin/electrum
       +rpi-boot/filesystem.squashfs: chroot/root/electrum
                mksquashfs chroot $@ -comp xz -Xbcj arm -noappend
        
        rpi-boot/upstream/initramfs.cpio: initramfs/bin/busybox initramfs/init
   DIR diff --git a/chroot.mk b/chroot.mk
       t@@ -6,20 +6,19 @@
        
        CHROOT_BINS = chroot
        
       -chroot/bin/busybox: $(ALPINE_TAR) $(ALPINE_SIG)
       +chroot/bin/busybox: $(ALPINE_BINS)
                gpg --no-default-keyring --keyring=./verification_keyring.gpg \
                        --verify $(ALPINE_SIG)
                mkdir -p chroot
                ( cd chroot && tar xpf ../$(ALPINE_TAR) --xattrs )
        
       -chroot/usr/bin/electrum: chroot/bin/busybox qemu-wrapper
       +chroot/root/electrum: $(ELECTRUM_BINS) chroot/bin/busybox qemu-wrapper
                ./devprocsys.sh mount chroot
                cp install.sh chroot/install.sh
                cp qemu-wrapper chroot
                cp -a $(QEMU_ARM) chroot/usr/bin
                chmod 755 chroot/install.sh chroot/qemu-wrapper
       +        cp -r $(ELECTRUM_SRC) chroot/root/electrum
                chroot chroot /install.sh || ( ./devprocsys.sh umount chroot ; exit 1 )
                ./devprocsys.sh umount chroot
       -        mkdir -p chroot/home/uwu/.electrum
       -        chown 1000:1000 chroot/home/uwu/.electrum
                rm -f chroot/usr/bin/$(QEMU_ARM) chroot/qemu-wrapper chroot/install.sh
   DIR diff --git a/config.mk b/config.mk
       t@@ -11,7 +11,6 @@ IMAGE = uwu-$(VERSION).cpio
        QEMU_ARM = /usr/bin/qemu-arm
        
        # System credentials
       -USERCREDENTIALS = uwu:uwu
        ROOTCREDENTIALS = root:toor
        
        # Crosscompiler prefix for compiling Linux and Busybox
       t@@ -26,3 +25,6 @@ ALPINE_VER = $(ALPINE_MAJ).1
        
        # Busybox version
        BUSYBOX_VER = 1.33.0
       +
       +# Electrum version
       +ELECTRUM_VER = 4.0.9
   DIR diff --git a/electrum.mk b/electrum.mk
       t@@ -0,0 +1,19 @@
       +.POSIX:
       +
       +# Copyright (c) 2020-2021 Ivan J. <parazyd@dyne.org>
       +# This file is part of uwu.
       +# See LICENSE file for copyright and license details.
       +
       +ELECTRUM_SRC = Electrum-$(ELECTRUM_VER)
       +ELECTRUM_TAR = $(ELECTRUM_SRC).tar.gz
       +ELECTRUM_SIG = $(ELECTRUM_TAR).asc
       +
       +ELECTRUM_BINS = $(ELECTRUM_SRC) $(ELECTRUM_TAR) $(ELECTRUM_SIG)
       +
       +$(ELECTRUM_TAR) $(ELECTRUM_SIG):
       +        wget -c https://download.electrum.org/$(ELECTRUM_VER)/$@
       +
       +$(ELECTRUM_SRC): $(ELECTRUM_TAR) $(ELECTRUM_SIG)
       +        gpg --no-default-keyring --keyring=./verification_keyring.gpg \
       +                --verify $(ELECTRUM_SIG)
       +        tar xf $(ELECTRUM_TAR)
   DIR diff --git a/install.sh.in b/install.sh.in
       t@@ -17,15 +17,13 @@ echo "nameserver 8.8.8.8" > /etc/resolv.conf
        
        apk update
        apk upgrade
       -apk add rng-tools electrum openrc alpine-base
       +apk add rng-tools openrc libsecp256k1 py3-cryptography alpine-base
        
        #rm -f /etc/resolv.conf
        
        echo "uwu" > /etc/hostname
        echo "127.0.0.1 localhost uwu" > /etc/hosts
        
       -adduser -D -s /bin/ash uwu
       -echo "@USERCREDENTIALS@" | chpasswd
        echo "@ROOTCREDENTIALS@" | chpasswd
        
        sed -e 's/^#rc_parallel=.*/rc_parallel="YES"/' \
       t@@ -38,22 +36,20 @@ cat <<EOF > /etc/inittab
        ::sysinit:/sbin/openrc sysinit
        ::sysinit:/sbin/openrc boot
        ::wait:/sbin/openrc default
       -ttyGS0::respawn:/sbin/getty -L ttyGS0 115200 vt100
       -ttyAMA0::respawn:/sbin/getty -L ttyAMA0 115200 vt100
        ::shutdown:/sbin/openrc shutdown
       +ttyGS0::respawn:/sbin/getty -L ttyGS0 115200 vt100
        EOF
        
        echo "ttyGS0" >> /etc/securetty
       -echo "ttyAMA0" >> /etc/securetty
        
        boot_initscripts="rngd urandom hostname sysfs devfs sysctl"
        default_initscripts="local"
        for i in $boot_initscripts; do
       -        rc-update add $i boot
       +        rc-update add "$i" boot
        done
        
        for i in $default_initscripts; do
       -        rc-update add $i default
       +        rc-update add "$i" default
        done
        
        # Final cleanup