From ef25dda3f1a6f75b070d0d856e841e5698a72254 Mon Sep 17 00:00:00 2001 From: Moses Narrow Date: Tue, 4 Oct 2022 10:41:26 -0500 Subject: [PATCH] revise build system with common features between builds moved to skybian-conf.sh & skyraspbian-conf.sh ; update skywire to v1.2.1 --- CHANGELOG.md | 6 ++ PKGBUILD | 2 +- script/skywire.conf | 2 + skybian-conf.sh | 149 ++++++++++++++++++++++++++++++++++ skybian-script.tar.gz | Bin 5512 -> 5585 bytes skybian.opi3.IMGBUILD | 152 +++-------------------------------- skybian.prime.IMGBUILD | 163 +++----------------------------------- skyraspbian-conf.sh | 119 ++++++++++++++++++++++++++++ skyraspbian.rpi3.IMGBUILD | 127 +---------------------------- skyraspbian.rpi4.IMGBUILD | 127 +---------------------------- 10 files changed, 306 insertions(+), 541 deletions(-) create mode 100644 script/skywire.conf create mode 100644 skybian-conf.sh create mode 100644 skyraspbian-conf.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 25e9aece..0eb2e926 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,12 @@ This is a note for developers about the recommended tags to keep track of the ch Dates must be YEAR-MONTH-DAY --> +## [1.2.1] - 2022-10-3 +### Changed + +- update skywire to 1.2.1 +- APT repo and skybian releases migrated to github. + ## [1.1.0] - 2022-08-27 ### Changed diff --git a/PKGBUILD b/PKGBUILD index 0d78cb38..f0606148 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -15,7 +15,7 @@ _debdeps="" source=("skybian-static.tar.gz" "skybian-script.tar.gz") sha256sums=('3111f03858e7aa857b938e6b7902fcf615bcb80e8167eeac0f58212fc9fa48c9' - 'c6e11e08d051a3ef5d754c9e340fc2dd6e028597efc32ca6fbfe5e70a796a56c') + '1009a6672475ad6b051e322f022f4a8c983f616d35031d4ee7d382c9303515d6') build() { for i in ${_pkgarches[@]}; do diff --git a/script/skywire.conf b/script/skywire.conf new file mode 100644 index 00000000..ccf8b08c --- /dev/null +++ b/script/skywire.conf @@ -0,0 +1,2 @@ +[Service] +ExecStart=/bin/skywire -mp diff --git a/skybian-conf.sh b/skybian-conf.sh new file mode 100644 index 00000000..69f44b23 --- /dev/null +++ b/skybian-conf.sh @@ -0,0 +1,149 @@ +#skybian-conf.sh +pkgname=skybian-${_board}${ENABLEAUTOPEER} +pkgdesc="Skybian ${_board} image build" +_img="Armbian_22.08.2_${_imgname}_bullseye_current_5.15.69.img" +_imgxz="${_img}.xz" +_imgsha="Bullseye_current.sha" +_imgshalink="https://redirect.armbian.com/${_board}/${_imgsha}" +_xzlink="https://www.armbian.com/dl/${_board}/archive/${_imgxz}" +#pkgver & pkgrel match the version & release of the skywire .deb in the apt repo +pkgver='1.2.1' +pkgrel=1 +arch=('any') +_imgarch="arm64" +_hostarch="$(dpkg --print-architecture)" +_torrent="${_xzlink}.torrent" +_imgfinal="${pkgname}-${pkgver}.img" +_root_partition=/dev/loop0p1 +_defaultuser=root +_skywiredeb="skywire-bin-${pkgver}-${pkgrel}-${_imgarch}.deb" +_skybiandeb="skybian-${_imgarch}.deb" +url="http://github.com/skycoin/skybian" +makedepends=('arch-install-scripts' 'aria2' 'dpkg' 'dtrx' 'gnome-disk-utility' 'qemu-user-static' 'qemu-user-static-binfmt') +_aptrepo="https://github.com/skycoin/apt-repo/releases/download" +source=("${_torrent}" +"${_torrent}.md5" +"${_imgshalink}" +"${_aptrepo}/archive/${_skywiredeb}" +"${_aptrepo}/current/${_skybiandeb}" +"skybian-conf.sh" +) +#"https://fl.us.mirror.archlinuxarm.org/aarch64/extra/gnu-netcat-0.7.1-8-aarch64.pkg.tar.xz" +noextract=("${_skywiredeb}" "${_skybiandeb}") + +prepare() { +cd "${srcdir}" +if [[ ! -f ${_imgxz} ]] && [[ ! -f ../${_imgxz} ]]; then +_msg2 "Downloading sources via torrent" # very fast! +aria2c -V --seed-time=0 ${_torrent} +mv ${_imgxz} ../${_imgxz} +else +_msg2 "found downloaded sources" +if [[ ! -f ../${_imgxz} ]]; then +mv ${_imgxz} ../${_imgxz} +fi +fi +} + +build() { +#standard extraction utilities don't recognizes the armbian archive for some reason. +[[ ! -f ../${_img} ]] && _msg2 "extracting with dtrx" && dtrx ../${_imgxz} && mv ${_img} ../${_img} +_msg2 "checking image archive integrity" +_sum=$(sha256sum ../${_imgxz}) +_msg2 "image sha256sum: ${_sum%%' '*}" +_check=$(cat ${_imgsha}) +_msg2 "${_imgsha}: ${_check%%' '*}" +[[ "${_check%%' '*}" != "${_sum%%' '*}" ]] && _error "image integrity verification failed" && rm ${_imgsha} && exit 1 +[[ "${_check%%' '*}" == "${_sum%%' '*}" ]] && _msg2 "image checksums verified" && rm ${_imgsha} +_msg2 "copying image.." #so we don't have to extract it every time +cp -b ../${_img} ${_imgfinal} +_msg2 "adding extra space" #may or may not be necessary +truncate -s +512M ${_imgfinal} +echo ", +" | sfdisk -N1 ${_imgfinal} +_msg2 "creating mount dir" +sudo umount -l ${srcdir}/mnt && _msg2 "unmounted lingering mounted dir" || true +rm -rf ${srcdir}/mnt +sudo losetup -d /dev/loop0 && _msg2 "detatched loop device after previous unclean exit" || true +mkdir -p ${srcdir}/mnt +_msg2 "mounting image to loop device.." +sudo gnome-disk-image-mounter -w ${_imgfinal} +_msg2 "mounting ${_root_partition} to mount point" +sudo mount ${_root_partition} ${srcdir}/mnt +_msg2 "copying packages into image" +sudo install -Dm644 ${srcdir}/${_skywiredeb} ${srcdir}/mnt/root/${_skywiredeb} +sudo install -Dm644 ${srcdir}/${_skybiandeb} ${srcdir}/mnt/root/${_skybiandeb} +#_msg2 "installing newer version of netcat binary to the image" +#sudo install -Dm755 ${srcdir}/usr/bin/netcat ${srcdir}/mnt/usr/bin/ +#sudo install -Dm755 ${srcdir}/usr/bin/nc ${srcdir}/mnt/usr/bin/ +_msg2 "copying qemu-aarch64-static command to chroot bin" +sudo cp "$(command -v qemu-aarch64-static)" "${srcdir}/mnt/usr/bin/" +################## chroot modifications for apt repo & package ################# +#sudo is used for all commands to give correct environmental vars in chroot +_msg2 "disabling user creation on first login" +sudo rm -f ${srcdir}/mnt/root/.not_logged_in_yet +##set password for _defaultuser +_msg2 "CHROOT: setting password skybian for ${_defaultuser}" +echo ${_defaultuser}:skybian | sudo arch-chroot ${srcdir}/mnt sudo chpasswd +sleep 1 +_msg2 "CHROOT: installing skywire with dpkg" +sudo arch-chroot ${srcdir}/mnt sudo NOAUTOCONFIG=true dpkg -i /root/${_skywiredeb} +sudo rm ${srcdir}/mnt/root/${_skywiredeb} +_msg2 "CHROOT: installing packages in chroot with dpkg" +if [[ ${ENABLEAUTOPEER} == "-autopeer" ]] ; then +sudo arch-chroot ${srcdir}/mnt sudo INSTALLFIRSTBOOT=1 CHROOTCONFIG=true dpkg -i /root/${_skybiandeb} +else +sudo arch-chroot ${srcdir}/mnt sudo INSTALLFIRSTBOOT=1 dpkg -i /root/${_skybiandeb} +fi +sudo rm ${srcdir}/mnt/root/${_skybiandeb} +## included from chroot-commands.sh +_msg2 "CHROOT: Setting the chroot clock to now to avoid bugs with the date..." +sudo arch-chroot ${srcdir}/mnt sudo /sbin/fake-hwclock save force +_msg2 "CHROOT: Generating locale en_US.UTF-8..." +sudo arch-chroot ${srcdir}/mnt sudo locale-gen en_US.UTF-8 +#fix console / tty +_msg2 "CHROOT: setting TERM=linux in /root/.bashrc" +echo 'TERM=linux' | sudo arch-chroot ${srcdir}/mnt tee -a /root/.bashrc +#set SKYBIAN=true +_msg2 "CHROOT: exporting SKYBIAN=true in /root/.bashrc" +echo 'export SKYBIAN=true' | sudo arch-chroot ${srcdir}/mnt tee -a /root/.bashrc +if [[ ${ENABLEAUTOPEER} == "-autopeer" ]] ; then +_msg2 "CHROOT: exporting AUTOPEER=1 in /root/.bashrc" +echo 'export AUTOPEER=1' | sudo arch-chroot ${srcdir}/mnt tee -a /root/.bashrc +fi +_msg2 "CHROOT: configuring unattended-upgrades" +echo unattended-upgrades unattended-upgrades/enable_auto_updates boolean true | sudo arch-chroot ${srcdir}/mnt sudo debconf-set-selections +sudo arch-chroot ${srcdir}/mnt sudo dpkg-reconfigure -f noninteractive unattended-upgrades +######################## end chroot modifications ############################## +[[ -d ${srcdir}/mnt/lost+found ]] && sudo rm -rf ${srcdir}/mnt/lost+found +_msg2 "Unmounting image" +sudo umount ${srcdir}/mnt +_msg2 "detatching /dev/loop0" +sudo losetup -d /dev/loop0 +mv ${_imgfinal} ../${_imgfinal} +cd .. +echo "created image(s):" +ls $_imgfinal +} + +package() { +#let makepkg compress the archive as it does automatically for any package +#afterwards remove the metadata from the archive and change the extension +#avoid the compression step with makepkg --noarchive +#package only, assuming ${_imgfinal} exists with makepkg -R +install -Dm644 ${srcdir}/../${_imgfinal} ${pkgdir}/ +cd ${pkgdir} +_msg2 "Creating image checksum" +sha256sum ${_imgfinal} > ${_imgfinal}.sha +cat ${_imgfinal}.sha +} + +_msg2() { +(( QUIET )) && return +local mesg=$1; shift +printf "${BLUE} ->${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" +} + +_error() { +local mesg=$1; shift +printf "${RED}==> $(gettext "ERROR:")${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2 +} diff --git a/skybian-script.tar.gz b/skybian-script.tar.gz index 6ca77f94469b643f098f5b2e7d0d3ccfc94f7888..bb8281a2200248391364c3c0cc12f01cd3857920 100644 GIT binary patch literal 5585 zcmV;?6)x%@iwFP!000001MFG}SQA&*Mnr{isiL)@RWAu5A|X5A5|Fi`2ndKGq7KPG zMv_UKnSdy`pr}~IrHD&i>b{`;s6ySU(xT#4wc1aMb-{hB>!+;?>VIb@31LyRwf6u1 zpZoY2X6D>`?mhRs?>*-m3aqqzO2lG8N0Bo7KBQ*b5ro^>!A>?xDI zcK_v`l4|=emCMCeK=hvHQEU5uzW;Fp37n2c0x`}Ja2=sg)3hF7gi5c&2^u8oNC3Sf z6(=zOU4%jgp#)7SjJHf4gCKEH++XoXbebMhP`FmF!H}TQm@*0)m{tfAa6(8ZfgnW# z|I-7n?%lnC00Uk0Bvg|KczvRyBZOiP5s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*l; zE_SRuA6Ix`=XZH$_80fxi|FgdhNSywx%o;C(?Vl?^g0^fJ@&f&!La9=dRmB=+K%s? z;|1FV&*gtsr`~6gV@x&wn~DC*HtS8sEUEu&nE3ve!!`0hL!XT8!k6-WX@wwzQzfn&U}5Eabvd}kw;GuLLw9t8jZ0000000000000000001RbNm8^ Ksu+#{cmMz%-s*Dz diff --git a/skybian.opi3.IMGBUILD b/skybian.opi3.IMGBUILD index 4589a671..fb299a62 100755 --- a/skybian.opi3.IMGBUILD +++ b/skybian.opi3.IMGBUILD @@ -1,141 +1,11 @@ -pkgname=skybian-opi3 -pkgdesc="Skybian orange pi 3 image build" -_img="Armbian_22.08.1_Orangepi3_bullseye_current_5.15.63.img" -_imgxz="${_img}.xz" -_imgsha="Bullseye_current.sha" -_imgshalink="https://redirect.armbian.com/orangepi3/${_imgsha}" -_xzlink="https://www.armbian.com/dl/orangepi3/archive/${_imgxz}" -#pkgver & pkgrel match the version & release of the skywire .deb in the apt repo -pkgver='1.1.0' -pkgrel=1 -arch=('any') -_imgarch="arm64" -_hostarch="$(dpkg --print-architecture)" -_torrent="${_xzlink}.torrent" -_imgfinal="${pkgname}-${pkgver}.img" -_root_partition=/dev/loop0p1 -_defaultuser=root -_aptrepo="http://176.9.28.105" #omit DNS issues by using server IP -if [[ "${TESTDEPLOYMENT}" == "1" ]] ; then - _aptrepo="http://deb.skywire.dev" #omit DNS issues by using server IP -fi -_skywiredeb="skywire-bin-${pkgver}-${pkgrel}-${_imgarch}.deb" -_skybiandeb="skybian-${_imgarch}.deb" -url="http://github.com/skycoin/skybian" -makedepends=('arch-install-scripts' 'aria2' 'dpkg' 'dtrx' 'gnome-disk-utility' 'qemu-arm-static') -source=("${_torrent}" -"${_torrent}.md5" -"${_imgshalink}" -"${_aptrepo}/archive/${_skywiredeb}" -"${_aptrepo}/archive/${_skybiandeb}" -) -noextract=("${_skywiredeb}" "${_skybiandeb}") -sha256sums=('1ee4e520317c28c1a4d347d1c9994625ab7d52c47363558ab2fa75767fc20017' - '2ff57465b18cdc8be9e285dd53e1de48a21d555f716e7a5e5a1205446a4656af' - 'db8f02fdfa740a6e107aadee45d8b9b83b2b1fa9d83d399b921ec8c74d583934' - '1949f6d6c1204cea27bbc1e6776d9549daaf64bb79b7145b897a690476cb763e' - 'ef0e00774ab3a1170cbb165a5f82b737d27dbdc75f0ba3a968aabb89ba488518') - -prepare() { -cd "${srcdir}" -if [[ ! -f ${_imgxz} ]] && [[ ! -f ../${_imgxz} ]]; then -_msg2 "Downloading sources via torrent" # very fast! -aria2c -V --seed-time=0 ${_torrent} -mv ${_imgxz} ../${_imgxz} -else -_msg2 "found downloaded sources" -if [[ ! -f ../${_imgxz} ]]; then -mv ${_imgxz} ../${_imgxz} -fi -fi -} - -build() { -#standard extraction utilities don't recognizes the armbian archive for some reason. -[[ ! -f ../${_img} ]] && _msg2 "extracting with dtrx" && dtrx ../${_imgxz} && mv ${_img} ../${_img} -_msg2 "checking image archive integrity" -_sum=$(sha256sum ../${_imgxz}) -_msg2 "image sha256sum: ${_sum%%' '*}" -_check=$(cat ${_imgsha}) -_msg2 "${_imgsha}: ${_check%%' '*}" -[[ "${_check%%' '*}" != "${_sum%%' '*}" ]] && _error "image integrity verification failed" && rm ${_imgsha} && exit 1 -[[ "${_check%%' '*}" == "${_sum%%' '*}" ]] && _msg2 "image checksums verified" && rm ${_imgsha} -_msg2 "copying image.." #so we don't have to extract it every time -cp -b ../${_img} ${_imgfinal} -_msg2 "adding extra space" #may or may not be necessary -truncate -s +512M ${_imgfinal} -echo ", +" | sfdisk -N1 ${_imgfinal} -_msg2 "mounting image to loop device.." -sudo gnome-disk-image-mounter -w ${_imgfinal} -_msg2 "creating mount dir" -mkdir -p ${srcdir}/mnt -_msg2 "mounting ${_root_partition} to mount point" -sudo mount ${_root_partition} ${srcdir}/mnt -_msg2 "copying packages into image" -sudo install -Dm644 ${srcdir}/${_skywiredeb} ${srcdir}/mnt/root/${_skywiredeb} -sudo install -Dm644 ${srcdir}/${_skybiandeb} ${srcdir}/mnt/root/${_skybiandeb} -_msg2 "copying qemu-aarch64-static command to chroot bin" -sudo cp "$(command -v qemu-aarch64-static)" "${srcdir}/mnt/usr/bin/" -################## chroot modifications for apt repo & package ################# -#sudo is used for all commands to give correct environmental vars in chroot -_msg2 "disabling user creation on first login" -sudo rm -f ${srcdir}/mnt/root/.not_logged_in_yet -##set password for _defaultuser -_msg2 "CHROOT: setting password skybian for ${_defaultuser}" -echo ${_defaultuser}:skybian | sudo arch-chroot ${srcdir}/mnt sudo chpasswd -sleep 1 -_msg2 "CHROOT: installing skywire with dpkg" -sudo arch-chroot ${srcdir}/mnt sudo NOAUTOCONFIG=true dpkg -i /root/${_skywiredeb} -sudo rm ${srcdir}/mnt/root/${_skywiredeb} -sudo arch-chroot ${srcdir}/mnt sudo systemctl enable skywire-autoconfig -_msg2 "CHROOT: installing packages in chroot with dpkg" -sudo arch-chroot ${srcdir}/mnt sudo INSTALLFIRSTBOOT=1 dpkg -i /root/${_skybiandeb} -sudo rm ${srcdir}/mnt/root/${_skybiandeb} -## included from chroot-commands.sh -_msg2 "CHROOT: Setting the chroot clock to now to avoid bugs with the date..." -sudo arch-chroot ${srcdir}/mnt sudo /sbin/fake-hwclock save force -_msg2 "CHROOT: Generating locale en_US.UTF-8..." -sudo arch-chroot ${srcdir}/mnt sudo locale-gen en_US.UTF-8 -#fix console / tty -_msg2 "CHROOT: setting TERM=linux in /root/.bashrc" -echo 'TERM=linux' | sudo arch-chroot ${srcdir}/mnt tee -a /root/.bashrc -#set SKYBIAN=true -_msg2 "CHROOT: exporting SKYBIAN=true in /root/.bashrc" -echo 'export SKYBIAN=true' | sudo arch-chroot ${srcdir}/mnt tee -a /root/.bashrc -_msg2 "CHROOT: configuring unattended-upgrades" -echo unattended-upgrades unattended-upgrades/enable_auto_updates boolean true | sudo arch-chroot ${srcdir}/mnt sudo debconf-set-selections -sudo arch-chroot ${srcdir}/mnt sudo dpkg-reconfigure -f noninteractive unattended-upgrades -######################## end chroot modifications ############################## -[[ -d ${srcdir}/mnt/lost+found ]] && sudo rm -rf ${srcdir}/mnt/lost+found -_msg2 "Unmounting image" -sudo umount ${srcdir}/mnt -_msg2 "detatching /dev/loop0" -sudo losetup -d /dev/loop0 -mv ${_imgfinal} ../${_imgfinal} -cd .. -echo "created image(s):" -ls $_imgfinal -} - -package() { -#let makepkg compress the archive as it does automatically for any package -#afterwards remove the metadata from the archive and change the extension -#avoid the compression step with makepkg --noarchive -#package only, assuming ${_imgfinal} exists with makepkg -R -install -Dm644 ${srcdir}/../${_imgfinal} ${pkgdir}/ -cd ${pkgdir} -_msg2 "Creating image checksum" -sha256sum ${_imgfinal} > ${_imgfinal}.sha -cat ${_imgfinal}.sha -} - -_msg2() { -(( QUIET )) && return -local mesg=$1; shift -printf "${BLUE} ->${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" -} - -_error() { -local mesg=$1; shift -printf "${RED}==> $(gettext "ERROR:")${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2 -} +#makepkg -fp skybian.opi3.IMGBUILD +#export ENABLEAUTOPEER="-autopeer" +_imgname="Orangepi3" +_board="orangepi3" +source skybian-conf.sh +sha256sums=('91afc8e6717a748bd82824b67eda8bdd9bab71f9d8df600db7a72692ccc07409' + '4068a03635b16bda430ce4ac8dbc2e8714272bcf9b0439f31814961843390c44' + 'b645a1257c93a85b5094cca4f1310d76dc7d7faf17da781ed1d8c827eacf30b5' + 'cc69909c80c952d2e6ede9b4bb5bd45414ae21d499931615a07c34d71fdaec1e' + '823f73dd44003c80bb0c7900a0ce50820d417bbadd8e977f9c58f44163c91f39' + '06fddcb9c972a1fd36eb3c30aedad82284f4aa4d67afa3345f4b500901a40cdb') diff --git a/skybian.prime.IMGBUILD b/skybian.prime.IMGBUILD index ac1a5f5b..9f4f4880 100755 --- a/skybian.prime.IMGBUILD +++ b/skybian.prime.IMGBUILD @@ -1,154 +1,11 @@ +#makepkg -fp skybian.prime.IMGBUILD #export ENABLEAUTOPEER="-autopeer" -pkgname=skybian-prime${ENABLEAUTOPEER} -pkgdesc="Skybian orange pi prime image build" -_img="Armbian_22.08.1_Orangepiprime_bullseye_current_5.15.63.img" -_imgxz="${_img}.xz" -_imgsha="Bullseye_current.sha" -_imgshalink="https://redirect.armbian.com/orangepiprime/${_imgsha}" -_xzlink="https://www.armbian.com/dl/orangepiprime/archive/${_imgxz}" -#pkgver & pkgrel match the version & release of the skywire .deb in the apt repo -pkgver='1.1.0' -pkgrel=1 -arch=('any') -_imgarch="arm64" -_hostarch="$(dpkg --print-architecture)" -_torrent="${_xzlink}.torrent" -_imgfinal="${pkgname}-${pkgver}.img" -_root_partition=/dev/loop0p1 -_defaultuser=root -_aptrepo="http://176.9.28.105" #omit DNS issues by using server IP -#export TESTDEPLOYMENT=1 -if [[ "${TESTDEPLOYMENT}" == "1" ]] ; then - _aptrepo="http://deb.skywire.dev" #omit DNS issues by using server IP -fi -_skywiredeb="skywire-bin-${pkgver}-${pkgrel}-${_imgarch}.deb" -_skybiandeb="skybian-${_imgarch}.deb" -url="http://github.com/skycoin/skybian" -makedepends=('arch-install-scripts' 'aria2' 'dpkg' 'dtrx' 'gnome-disk-utility' 'qemu-arm-static') -source=("${_torrent}" -"${_torrent}.md5" -"${_imgshalink}" -"${_aptrepo}/archive/${_skywiredeb}" -"${_aptrepo}/archive/${_skybiandeb}" -) -#"https://fl.us.mirror.archlinuxarm.org/aarch64/extra/gnu-netcat-0.7.1-8-aarch64.pkg.tar.xz" -noextract=("${_skywiredeb}" "${_skybiandeb}") -sha256sums=('29af44d04419fec5070a2919e6c3b656bfe113dabcd04179af4e5786de8b0107' - '944abd576ed93434b88a4b9b24c95a3d744cc79a16962468bd3647177c3b7dd6' - '8ec92b6015761ad25641049593b38d8771858ebf827aa0728ef0d91235c34ddd' - '1949f6d6c1204cea27bbc1e6776d9549daaf64bb79b7145b897a690476cb763e' - 'ef0e00774ab3a1170cbb165a5f82b737d27dbdc75f0ba3a968aabb89ba488518') - -prepare() { -cd "${srcdir}" -if [[ ! -f ${_imgxz} ]] && [[ ! -f ../${_imgxz} ]]; then -_msg2 "Downloading sources via torrent" # very fast! -aria2c -V --seed-time=0 ${_torrent} -mv ${_imgxz} ../${_imgxz} -else -_msg2 "found downloaded sources" -if [[ ! -f ../${_imgxz} ]]; then -mv ${_imgxz} ../${_imgxz} -fi -fi -} - -build() { -#standard extraction utilities don't recognizes the armbian archive for some reason. -[[ ! -f ../${_img} ]] && _msg2 "extracting with dtrx" && dtrx ../${_imgxz} && mv ${_img} ../${_img} -_msg2 "checking image archive integrity" -_sum=$(sha256sum ../${_imgxz}) -_msg2 "image sha256sum: ${_sum%%' '*}" -_check=$(cat ${_imgsha}) -_msg2 "${_imgsha}: ${_check%%' '*}" -[[ "${_check%%' '*}" != "${_sum%%' '*}" ]] && _error "image integrity verification failed" && rm ${_imgsha} && exit 1 -[[ "${_check%%' '*}" == "${_sum%%' '*}" ]] && _msg2 "image checksums verified" && rm ${_imgsha} -_msg2 "copying image.." #so we don't have to extract it every time -cp -b ../${_img} ${_imgfinal} -_msg2 "adding extra space" #may or may not be necessary -truncate -s +512M ${_imgfinal} -echo ", +" | sfdisk -N1 ${_imgfinal} -_msg2 "mounting image to loop device.." -sudo gnome-disk-image-mounter -w ${_imgfinal} -_msg2 "creating mount dir" -mkdir -p ${srcdir}/mnt -_msg2 "mounting ${_root_partition} to mount point" -sudo mount ${_root_partition} ${srcdir}/mnt -_msg2 "copying packages into image" -sudo install -Dm644 ${srcdir}/${_skywiredeb} ${srcdir}/mnt/root/${_skywiredeb} -sudo install -Dm644 ${srcdir}/${_skybiandeb} ${srcdir}/mnt/root/${_skybiandeb} -#_msg2 "installing newer version of netcat binary to the image" -#sudo install -Dm755 ${srcdir}/usr/bin/netcat ${srcdir}/mnt/usr/bin/ -#sudo install -Dm755 ${srcdir}/usr/bin/nc ${srcdir}/mnt/usr/bin/ -_msg2 "copying qemu-aarch64-static command to chroot bin" -sudo cp "$(command -v qemu-aarch64-static)" "${srcdir}/mnt/usr/bin/" -################## chroot modifications for apt repo & package ################# -#sudo is used for all commands to give correct environmental vars in chroot -_msg2 "disabling user creation on first login" -sudo rm -f ${srcdir}/mnt/root/.not_logged_in_yet -##set password for _defaultuser -_msg2 "CHROOT: setting password skybian for ${_defaultuser}" -echo ${_defaultuser}:skybian | sudo arch-chroot ${srcdir}/mnt sudo chpasswd -sleep 1 -_msg2 "CHROOT: installing skywire with dpkg" -sudo arch-chroot ${srcdir}/mnt sudo NOAUTOCONFIG=true dpkg -i /root/${_skywiredeb} -sudo rm ${srcdir}/mnt/root/${_skywiredeb} -_msg2 "CHROOT: installing packages in chroot with dpkg" -if [[ ${ENABLEAUTOPEER} == "-autopeer" ]] ; then -sudo arch-chroot ${srcdir}/mnt sudo INSTALLFIRSTBOOT=1 CHROOTCONFIG=true dpkg -i /root/${_skybiandeb} -else -sudo arch-chroot ${srcdir}/mnt sudo INSTALLFIRSTBOOT=1 dpkg -i /root/${_skybiandeb} -fi -sudo rm ${srcdir}/mnt/root/${_skybiandeb} -## included from chroot-commands.sh -_msg2 "CHROOT: Setting the chroot clock to now to avoid bugs with the date..." -sudo arch-chroot ${srcdir}/mnt sudo /sbin/fake-hwclock save force -_msg2 "CHROOT: Generating locale en_US.UTF-8..." -sudo arch-chroot ${srcdir}/mnt sudo locale-gen en_US.UTF-8 -#fix console / tty -_msg2 "CHROOT: setting TERM=linux in /root/.bashrc" -echo 'TERM=linux' | sudo arch-chroot ${srcdir}/mnt tee -a /root/.bashrc -#set SKYBIAN=true -_msg2 "CHROOT: exporting SKYBIAN=true in /root/.bashrc" -echo 'export SKYBIAN=true' | sudo arch-chroot ${srcdir}/mnt tee -a /root/.bashrc -if [[ ${ENABLEAUTOPEER} == "-autopeer" ]] ; then -_msg2 "CHROOT: exporting AUTOPEER=1 in /root/.bashrc" -echo 'export AUTOPEER=1' | sudo arch-chroot ${srcdir}/mnt tee -a /root/.bashrc -fi -_msg2 "CHROOT: configuring unattended-upgrades" -echo unattended-upgrades unattended-upgrades/enable_auto_updates boolean true | sudo arch-chroot ${srcdir}/mnt sudo debconf-set-selections -sudo arch-chroot ${srcdir}/mnt sudo dpkg-reconfigure -f noninteractive unattended-upgrades -######################## end chroot modifications ############################## -[[ -d ${srcdir}/mnt/lost+found ]] && sudo rm -rf ${srcdir}/mnt/lost+found -_msg2 "Unmounting image" -sudo umount ${srcdir}/mnt -_msg2 "detatching /dev/loop0" -sudo losetup -d /dev/loop0 -mv ${_imgfinal} ../${_imgfinal} -cd .. -echo "created image(s):" -ls $_imgfinal -} - -package() { -#let makepkg compress the archive as it does automatically for any package -#afterwards remove the metadata from the archive and change the extension -#avoid the compression step with makepkg --noarchive -#package only, assuming ${_imgfinal} exists with makepkg -R -install -Dm644 ${srcdir}/../${_imgfinal} ${pkgdir}/ -cd ${pkgdir} -_msg2 "Creating image checksum" -sha256sum ${_imgfinal} > ${_imgfinal}.sha -cat ${_imgfinal}.sha -} - -_msg2() { -(( QUIET )) && return -local mesg=$1; shift -printf "${BLUE} ->${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" -} - -_error() { -local mesg=$1; shift -printf "${RED}==> $(gettext "ERROR:")${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2 -} +_imgname="Orangepiprime" +_board="orangepiprime" +source skybian-conf.sh +sha256sums=('0e4ed422b68bf8d70062a0c63c93504fe3df7f8202abf5153df7b69aa6d5dfa7' + '2071b546fbba6f688474014b353e062de8fe328c677c88c9abaa0d4aa5c7d338' + '7985902ebb9a399791046d7a14e4689d50d91141565e404749b76b8c192a4488' + 'cc69909c80c952d2e6ede9b4bb5bd45414ae21d499931615a07c34d71fdaec1e' + '823f73dd44003c80bb0c7900a0ce50820d417bbadd8e977f9c58f44163c91f39' + '06fddcb9c972a1fd36eb3c30aedad82284f4aa4d67afa3345f4b500901a40cdb') diff --git a/skyraspbian-conf.sh b/skyraspbian-conf.sh new file mode 100644 index 00000000..dce629dd --- /dev/null +++ b/skyraspbian-conf.sh @@ -0,0 +1,119 @@ +pkgname=skyraspbian-${_imgarch} +pkgdesc="Skyraspbian ${_imgarch} image build" +pkgver='1.2.1' +pkgrel=1 +arch=('any') +_hostarch=$(dpkg --print-architecture) +_img="2022-04-04-raspios-bullseye-${_imgarch}-lite.img" +_imgxz="${_img}.xz" +_xzlink="https://downloads.raspberrypi.org/raspios_lite_${_imgarch}/images/raspios_lite_${_imgarch}-2022-04-07/${_imgxz}" +_torrent="${_xzlink}.torrent" +_imgfinal="${pkgname}-${pkgver}.img" +_root_partition=/dev/loop0p2 +_boot_partition=/dev/loop0p1 +_defaultuser=pi +_skywiredeb="skywire-bin-${pkgver}-${pkgrel}-${_imgarch}.deb" +_skybiandeb="skybian-${_imgarch}.deb" +url="http://github.com/skycoin/skybian" +makedepends=('arch-install-scripts' 'aria2' 'dpkg' 'dtrx' 'gnome-disk-utility' 'qemu-user-static') +depends=() +_aptrepo="https://github.com/skycoin/apt-repo/releases/download" +source=("${_torrent}" +"${_aptrepo}/archive/${_skywiredeb}" +"${_aptrepo}/current/${_skybiandeb}" +"skyraspbian-conf.sh" +) +noextract=("${_skywiredeb}" "${_skybiandeb}") + +prepare() { +cd "${srcdir}" +if [[ ! -f ${_imgxz} ]] && [[ ! -f ../${_imgxz} ]]; then +_msg2 "Downloading sources via torrent" # very fast! +aria2c -V --seed-time=0 ${_torrent} +mv ${_imgxz} ../${_imgxz} +else +_msg2 "found downloaded sources" +if [[ ! -f ../${_imgxz} ]]; then +mv ${_imgxz} ../${_imgxz} +fi +fi +} + +build() { +#standard extraction utilities don't recognizes this archive for some reason. +[[ ! -f ../${_img} ]] && _msg2 "extracting with dtrx" && dtrx -no ../${_imgxz} && mv ${_img} ../${_img} +_msg2 "copying image.." #so we don't have to extract it every time +cp -b ../${_img} ${_imgfinal} +_msg2 "mounting image to loop device.." +sudo gnome-disk-image-mounter -w ${_imgfinal} +_msg2 "creating mount dir" +_mntdir="${srcdir}/mnt" +mkdir -p ${_mntdir} +_msg2 "mounting ${_root_partition} to mount point" +sudo mount ${_root_partition} ${_mntdir} +_msg2 "copy packages into apt cache" +sudo install -Dm644 ${srcdir}/${_skywiredeb} ${srcdir}/mnt/root/${_skywiredeb} +sudo install -Dm644 ${srcdir}/${_skybiandeb} ${srcdir}/mnt/root/${_skybiandeb} +_msg2 "copy qemu-aarch64-static command to chroot bin" +sudo cp "$(command -v qemu-aarch64-static)" "${srcdir}/mnt/usr/bin/" +################# chroot modifications for apt repo & package ################# +#sudo is used for all commands to give correct environmental vars in chroot +_msg2 "CHROOT: installing skywire with dpkg" +sudo arch-chroot ${srcdir}/mnt sudo NOAUTOCONFIG=true dpkg -i /root/${_skywiredeb} +sudo rm ${srcdir}/mnt/root/${_skywiredeb} +_msg2 "CHROOT: installing packages in chroot with dpkg" +sudo arch-chroot ${srcdir}/mnt sudo INSTALLFIRSTBOOT=1 dpkg -i /root/${_skybiandeb} +sudo rm ${srcdir}/mnt/root/${_skybiandeb} +sudo arch-chroot ${_mntdir} sudo systemctl enable skywire-autoconfig +##set password for _defaultuser +_msg2 "CHROOT: setting password skybian for ${_defaultuser}" +echo ${_defaultuser}:skybian | sudo arch-chroot ${srcdir}/mnt sudo chpasswd +sleep 1 +## included from chroot-commands.sh +_msg2 "CHROOT: Setting the chroot clock to now to avoid bugs with the date..." +sudo arch-chroot ${_mntdir} sudo /sbin/fake-hwclock save force +_msg2 "CHROOT: Generating locale en_US.UTF-8..." +sudo arch-chroot ${_mntdir} sudo locale-gen en_US.UTF-8 +#set SKYBIAN=true +_msg2 "CHROOT: exporting SKYBIAN=true in /root/.bashrc" +echo 'export SKYBIAN=true' | sudo arch-chroot ${srcdir}/mnt tee -a /root/.bashrc +_msg2 "Unmounting image root partition" +sudo umount ${_mntdir} +######################## end chroot modifications ############################## +################# SKYRASPBIAN SPECIFIC BOOT CONFIG PARAMS ###################### +_msg2 "creating mount dir for boot partition" +_mntdir="${srcdir}/boot" +mkdir -p ${_mntdir} +_msg2 "mounting ${_boot_partition} to mount point" +sudo mount ${_boot_partition} ${_mntdir} +_msg2 "Enabling UART" +sudo sed -i '/^#dtparam=spi=on.*/a enable_uart=1' "${_mntdir}/config.txt" +_msg2 "Enabling HDMI" +sudo sed -i 's/#hdmi_force_hotplug=1/hdmi_force_hotplug=1/' "${_mntdir}/config.txt" +_msg2 "Enabling SSH" +sudo touch "${_mntdir}/SSH.txt" +_msg2 "Unounting image boot partition" +sudo umount ${_mntdir} +########################## end boot param modifications ####################### +_msg2 "detatching /dev/loop0" +sudo losetup -d /dev/loop0 +mv ${_imgfinal} ../${_imgfinal} +} + +package() { +#Just let makepkg compress the archive as it does automatically for a package +#and then remove the metadata from the archive and change the extension +#avoid the compression step with makepkg --noarchive +#package only, assuming ${_imgfinal} exists with makepkg -R +install -Dm644 ${srcdir}/../${_imgfinal} ${pkgdir}/ +cd ${pkgdir} +_msg2 "Creating image checksums" +sha256sum ${_imgfinal} > ${_imgfinal}.sha +cat ${_imgfinal}.sha +} + +_msg2() { +(( QUIET )) && return +local mesg=$1; shift +printf "${BLUE} ->${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" +} diff --git a/skyraspbian.rpi3.IMGBUILD b/skyraspbian.rpi3.IMGBUILD index d80ca23b..d5c83e92 100755 --- a/skyraspbian.rpi3.IMGBUILD +++ b/skyraspbian.rpi3.IMGBUILD @@ -1,125 +1,6 @@ -pkgname=skyraspbian-rpi3 -pkgdesc="Skyraspbian armhf image build" _imgarch="armhf" -pkgver='1.1.0' -pkgrel=1 -arch=('any') -_hostarch=$(dpkg --print-architecture) -_img="2022-04-04-raspios-bullseye-${_imgarch}-lite.img" -_imgxz="${_img}.xz" -_xzlink="https://downloads.raspberrypi.org/raspios_lite_${_imgarch}/images/raspios_lite_${_imgarch}-2022-04-07/${_imgxz}" -_torrent="${_xzlink}.torrent" -_imgfinal="${pkgname}-${pkgver}.img" -_root_partition=/dev/loop0p2 -_boot_partition=/dev/loop0p1 -_defaultuser=pi -_aptrepo="http://176.9.28.105" #omit DNS issues by using server IP -if [[ "${TESTDEPLOYMENT}" == "1" ]] ; then - _aptrepo="http://deb.skywire.dev" #omit DNS issues by using server IP -fi -_skywiredeb="skywire-bin-${pkgver}-${pkgrel}-${_imgarch}.deb" -_skybiandeb="skybian-${_imgarch}.deb" -url="http://github.com/skycoin/skybian" -makedepends=('arch-install-scripts' 'aria2' 'dpkg' 'dtrx' 'gnome-disk-utility' 'qemu-arm-static') -depends=() -source=("${_torrent}" -"${_aptrepo}/archive/${_skywiredeb}" -"${_aptrepo}/archive/${_skybiandeb}" -) -noextract=("${_skywiredeb}" "${_skybiandeb}") +source skyraspbian-conf.sh sha256sums=('cff9b71924560032bb6884d7f78a8c84852f5c38171385aa1446f5281ecbb6a6' - 'c63d1025c3655ef6cdd5e4f69a91f1c5a6f7e7b067af87d49d792e9660e40d16' - '6781d7cdb12719d3251d1a681282dbc19400bebfb9d99cf654bb3153539ec8f0') - -prepare() { -cd "${srcdir}" -if [[ ! -f ${_imgxz} ]] && [[ ! -f ../${_imgxz} ]]; then -_msg2 "Downloading sources via torrent" # very fast! -aria2c -V --seed-time=0 ${_torrent} -mv ${_imgxz} ../${_imgxz} -else -_msg2 "found downloaded sources" -if [[ ! -f ../${_imgxz} ]]; then -mv ${_imgxz} ../${_imgxz} -fi -fi -} - -build() { -#standard extraction utilities don't recognizes this archive for some reason. -[[ ! -f ../${_img} ]] && _msg2 "extracting with dtrx" && dtrx -no ../${_imgxz} && mv ${_img} ../${_img} -_msg2 "copying image.." #so we don't have to extract it every time -cp -b ../${_img} ${_imgfinal} -_msg2 "mounting image to loop device.." -sudo gnome-disk-image-mounter -w ${_imgfinal} -_msg2 "creating mount dir" -_mntdir="${srcdir}/mnt" -mkdir -p ${_mntdir} -_msg2 "mounting ${_root_partition} to mount point" -sudo mount ${_root_partition} ${_mntdir} -_msg2 "copy packages into apt cache" -sudo install -Dm644 ${srcdir}/${_skywiredeb} ${srcdir}/mnt/root/${_skywiredeb} -sudo install -Dm644 ${srcdir}/${_skybiandeb} ${srcdir}/mnt/root/${_skybiandeb} -_msg2 "copy qemu-aarch64-static command to chroot bin" -sudo cp "$(command -v qemu-aarch64-static)" "${srcdir}/mnt/usr/bin/" -################# chroot modifications for apt repo & package ################# -#sudo is used for all commands to give correct environmental vars in chroot -_msg2 "CHROOT: installing skywire with dpkg" -sudo arch-chroot ${srcdir}/mnt sudo NOAUTOCONFIG=true dpkg -i /root/${_skywiredeb} -sudo rm ${srcdir}/mnt/root/${_skywiredeb} -_msg2 "CHROOT: installing packages in chroot with dpkg" -sudo arch-chroot ${srcdir}/mnt sudo INSTALLFIRSTBOOT=1 dpkg -i /root/${_skybiandeb} -sudo rm ${srcdir}/mnt/root/${_skybiandeb} -sudo arch-chroot ${_mntdir} sudo systemctl enable skywire-autoconfig -##set password for _defaultuser -_msg2 "CHROOT: setting password skybian for ${_defaultuser}" -echo ${_defaultuser}:skybian | sudo arch-chroot ${srcdir}/mnt sudo chpasswd -sleep 1 -## included from chroot-commands.sh -_msg2 "CHROOT: Setting the chroot clock to now to avoid bugs with the date..." -sudo arch-chroot ${_mntdir} sudo /sbin/fake-hwclock save force -_msg2 "CHROOT: Generating locale en_US.UTF-8..." -sudo arch-chroot ${_mntdir} sudo locale-gen en_US.UTF-8 -#set SKYBIAN=true -_msg2 "CHROOT: exporting SKYBIAN=true in /root/.bashrc" -echo 'export SKYBIAN=true' | sudo arch-chroot ${srcdir}/mnt tee -a /root/.bashrc -_msg2 "Unmounting image root partition" -sudo umount ${_mntdir} -######################## end chroot modifications ############################## -################# SKYRASPBIAN SPECIFIC BOOT CONFIG PARAMS ###################### -_msg2 "creating mount dir for boot partition" -_mntdir="${srcdir}/boot" -mkdir -p ${_mntdir} -_msg2 "mounting ${_boot_partition} to mount point" -sudo mount ${_boot_partition} ${_mntdir} -_msg2 "Enabling UART" -sudo sed -i '/^#dtparam=spi=on.*/a enable_uart=1' "${_mntdir}/config.txt" -_msg2 "Enabling HDMI" -sudo sed -i 's/#hdmi_force_hotplug=1/hdmi_force_hotplug=1/' "${_mntdir}/config.txt" -_msg2 "Enabling SSH" -sudo touch "${_mntdir}/SSH.txt" -_msg2 "Unounting image boot partition" -sudo umount ${_mntdir} -########################## end boot param modifications ####################### -_msg2 "detatching /dev/loop0" -sudo losetup -d /dev/loop0 -mv ${_imgfinal} ../${_imgfinal} -} - -package() { -#Just let makepkg compress the archive as it does automatically for a package -#and then remove the metadata from the archive and change the extension -#avoid the compression step with makepkg --noarchive -#package only, assuming ${_imgfinal} exists with makepkg -R -install -Dm644 ${srcdir}/../${_imgfinal} ${pkgdir}/ -cd ${pkgdir} -_msg2 "Creating image checksums" -sha256sum ${_imgfinal} > ${_imgfinal}.sha -cat ${_imgfinal}.sha -} - -_msg2() { -(( QUIET )) && return -local mesg=$1; shift -printf "${BLUE} ->${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" -} + 'bf25ad613391b62cc325fde148318bafd2e56bf94f6a747978c419eef32080a0' + '72732f65d0afc82b81b65d01ce4265d3696387419e79f543d4bce87c689e6c2c' + '15c2164c9cea421c8eed3515d46c1cdc0503743641984eb933b9bf62743bfe55') diff --git a/skyraspbian.rpi4.IMGBUILD b/skyraspbian.rpi4.IMGBUILD index 25144ed9..9d435550 100755 --- a/skyraspbian.rpi4.IMGBUILD +++ b/skyraspbian.rpi4.IMGBUILD @@ -1,125 +1,6 @@ -pkgname=skyraspbian-rpi4 -pkgdesc="Skyraspbian arm64 image build" _imgarch="arm64" -pkgver='1.1.0' -pkgrel=1 -arch=('any') -_hostarch=$(dpkg --print-architecture) -_img="2022-04-04-raspios-bullseye-${_imgarch}-lite.img" -_imgxz="${_img}.xz" -_xzlink="https://downloads.raspberrypi.org/raspios_lite_${_imgarch}/images/raspios_lite_${_imgarch}-2022-04-07/${_imgxz}" -_torrent="${_xzlink}.torrent" -_imgfinal="${pkgname}-${pkgver}.img" -_root_partition=/dev/loop0p2 -_boot_partition=/dev/loop0p1 -_defaultuser=pi -_aptrepo="http://176.9.28.105" #omit DNS issues by using server IP -if [[ "${TESTDEPLOYMENT}" == "1" ]] ; then - _aptrepo="http://deb.skywire.dev" #omit DNS issues by using server IP -fi -_skywiredeb="skywire-bin-${pkgver}-${pkgrel}-${_imgarch}.deb" -_skybiandeb="skybian-${_imgarch}.deb" -url="http://github.com/skycoin/skybian" -makedepends=('arch-install-scripts' 'aria2' 'dpkg' 'dtrx' 'gnome-disk-utility' 'qemu-arm-static') -depends=() -source=("${_torrent}" -"${_aptrepo}/archive/${_skywiredeb}" -"${_aptrepo}/archive/${_skybiandeb}" -) -noextract=("${_skywiredeb}" "${_skybiandeb}") +source skyraspbian-conf.sh sha256sums=('113eed9f7facaefd01ea9903c4a108679d6c2ba621d754bbd701440e54127a00' - '1949f6d6c1204cea27bbc1e6776d9549daaf64bb79b7145b897a690476cb763e' - 'ef0e00774ab3a1170cbb165a5f82b737d27dbdc75f0ba3a968aabb89ba488518') - -prepare() { -cd "${srcdir}" -if [[ ! -f ${_imgxz} ]] && [[ ! -f ../${_imgxz} ]]; then -_msg2 "Downloading sources via torrent" # very fast! -aria2c -V --seed-time=0 ${_torrent} -mv ${_imgxz} ../${_imgxz} -else -_msg2 "found downloaded sources" -if [[ ! -f ../${_imgxz} ]]; then -mv ${_imgxz} ../${_imgxz} -fi -fi -} - -build() { -#standard extraction utilities don't recognizes this archive for some reason. -[[ ! -f ../${_img} ]] && _msg2 "extracting with dtrx" && dtrx -no ../${_imgxz} && mv ${_img} ../${_img} -_msg2 "copying image.." #so we don't have to extract it every time -cp -b ../${_img} ${_imgfinal} -_msg2 "mounting image to loop device.." -sudo gnome-disk-image-mounter -w ${_imgfinal} -_msg2 "creating mount dir" -_mntdir="${srcdir}/mnt" -mkdir -p ${_mntdir} -_msg2 "mounting ${_root_partition} to mount point" -sudo mount ${_root_partition} ${_mntdir} -_msg2 "copy packages into apt cache" -sudo install -Dm644 ${srcdir}/${_skywiredeb} ${srcdir}/mnt/root/${_skywiredeb} -sudo install -Dm644 ${srcdir}/${_skybiandeb} ${srcdir}/mnt/root/${_skybiandeb} -_msg2 "copy qemu-aarch64-static command to chroot bin" -sudo cp "$(command -v qemu-aarch64-static)" "${srcdir}/mnt/usr/bin/" -################# chroot modifications for apt repo & package ################# -#sudo is used for all commands to give correct environmental vars in chroot -_msg2 "CHROOT: installing skywire with dpkg" -sudo arch-chroot ${srcdir}/mnt sudo NOAUTOCONFIG=true dpkg -i /root/${_skywiredeb} -sudo rm ${srcdir}/mnt/root/${_skywiredeb} -_msg2 "CHROOT: installing packages in chroot with dpkg" -sudo arch-chroot ${srcdir}/mnt sudo INSTALLFIRSTBOOT=1 dpkg -i /root/${_skybiandeb} -sudo rm ${srcdir}/mnt/root/${_skybiandeb} -sudo arch-chroot ${_mntdir} sudo systemctl enable skywire-autoconfig -##set password for _defaultuser -_msg2 "CHROOT: setting password skybian for ${_defaultuser}" -echo ${_defaultuser}:skybian | sudo arch-chroot ${srcdir}/mnt sudo chpasswd -sleep 1 -## included from chroot-commands.sh -_msg2 "CHROOT: Setting the chroot clock to now to avoid bugs with the date..." -sudo arch-chroot ${_mntdir} sudo /sbin/fake-hwclock save force -_msg2 "CHROOT: Generating locale en_US.UTF-8..." -sudo arch-chroot ${_mntdir} sudo locale-gen en_US.UTF-8 -#set SKYBIAN=true -_msg2 "CHROOT: exporting SKYBIAN=true in /root/.bashrc" -echo 'export SKYBIAN=true' | sudo arch-chroot ${srcdir}/mnt tee -a /root/.bashrc -_msg2 "Unmounting image root partition" -sudo umount ${_mntdir} -######################## end chroot modifications ############################## -################# SKYRASPBIAN SPECIFIC BOOT CONFIG PARAMS ###################### -_msg2 "creating mount dir for boot partition" -_mntdir="${srcdir}/boot" -mkdir -p ${_mntdir} -_msg2 "mounting ${_boot_partition} to mount point" -sudo mount ${_boot_partition} ${_mntdir} -_msg2 "Enabling UART" -sudo sed -i '/^#dtparam=spi=on.*/a enable_uart=1' "${_mntdir}/config.txt" -_msg2 "Enabling HDMI" -sudo sed -i 's/#hdmi_force_hotplug=1/hdmi_force_hotplug=1/' "${_mntdir}/config.txt" -_msg2 "Enabling SSH" -sudo touch "${_mntdir}/SSH.txt" -_msg2 "Unounting image boot partition" -sudo umount ${_mntdir} -########################## end boot param modifications ####################### -_msg2 "detatching /dev/loop0" -sudo losetup -d /dev/loop0 -mv ${_imgfinal} ../${_imgfinal} -} - -package() { -#Just let makepkg compress the archive as it does automatically for a package -#and then remove the metadata from the archive and change the extension -#avoid the compression step with makepkg --noarchive -#package only, assuming ${_imgfinal} exists with makepkg -R -install -Dm644 ${srcdir}/../${_imgfinal} ${pkgdir}/ -cd ${pkgdir} -_msg2 "Creating image checksums" -sha256sum ${_imgfinal} > ${_imgfinal}.sha -cat ${_imgfinal}.sha -} - -_msg2() { -(( QUIET )) && return -local mesg=$1; shift -printf "${BLUE} ->${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" -} + 'cc69909c80c952d2e6ede9b4bb5bd45414ae21d499931615a07c34d71fdaec1e' + '823f73dd44003c80bb0c7900a0ce50820d417bbadd8e977f9c58f44163c91f39' + '15c2164c9cea421c8eed3515d46c1cdc0503743641984eb933b9bf62743bfe55')