From d70c3471eb242dd0aba65bb633a355bcf32ee5ff Mon Sep 17 00:00:00 2001 From: parazyd Date: Fri, 13 Nov 2020 12:46:39 +0100 Subject: [PATCH] Update for latest libdevuansdk (overhaul). This commit makes live-sdk work with latest libdevuansdk. We also drop fetching blends from http. These should be created beforehand and put in a file for live-sdk to load. --- CONTRIBUTORS.md | 3 --- README.md | 29 --------------------- config | 23 +++++++++------- lib/libdevuansdk | 2 +- sdk | 68 ++++++++++++++++-------------------------------- 5 files changed, 37 insertions(+), 88 deletions(-) delete mode 100644 CONTRIBUTORS.md diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md deleted file mode 100644 index 5e0445d..0000000 --- a/CONTRIBUTORS.md +++ /dev/null @@ -1,3 +0,0 @@ -Thank you very much for your help and advices! - -- fsmithred diff --git a/README.md b/README.md index 304fb99..221b7de 100644 --- a/README.md +++ b/README.md @@ -69,32 +69,3 @@ Once initialized, you can run the helper command: The image will automatically be build for you. Once finished, you will be able to find it in the `dist/` directory in live-sdk's root. - -For more info, see the `doc/` directory. - -## Acknowledgments - -Devuan's SDK was originally conceived during a period of residency at the -Schumacher college in Dartington, UK. Greatly inspired by the laborious and -mindful atmosphere of its wonderful premises. - -The Devuan SDK is Copyright (c) 2015-2017 by the Dyne.org Foundation - -Devuan SDK components were designed, and are written and maintained by: - -- Ivan J. -- Denis Roio -- Enzo Nicosia - -This source code is free software: you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the Free -Software Foundation, either version 3 of the License, or (at your option) -any later version. - -This software is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -more details. - -You should have received a copy of the GNU General Public License along -with this source code. If not, see . diff --git a/config b/config index 6379a1d..35ce62e 100644 --- a/config +++ b/config @@ -1,5 +1,6 @@ #!/usr/bin/env zsh -# Copyright (c) 2016-2017 Dyne.org Foundation +# shellcheck shell=bash +# Copyright (c) 2016-2020 Dyne.org Foundation # live-sdk is written and maintained by Ivan J. # # This file is part of live-sdk @@ -17,18 +18,14 @@ # You should have received a copy of the GNU General Public License # along with this source code. If not, see . +arch="amd64" -## live-sdk configuration -## ---------------------- +export PATH="$PATH:/usr/sbin:/sbin" -MAKEOPTS="-j$(grep -c 'processor' /proc/cpuinfo)" +# Comment if you wish to disable stage4 archives for faster rebuilding +CPIO_STAGE4=1 -export PATH="$PATH:/usr/sbin:/sbin:/usr/bin:/bin" - -## uncomment if you wish to create stage4 tarballs for faster rebuilding -# TAR_STAGE4=true - -## extra_packages for all images +# extra_packages for all images extra_packages+=( live-config live-config-sysvinit @@ -39,4 +36,10 @@ extra_packages+=( squashfs-tools xorriso cryptsetup + firmware-linux ) + +case "$arch" in +i386) extra_packages+=(linux-image-686) ;; +amd64) extra_packages+=(linux-image-amd64) ;; +esac diff --git a/lib/libdevuansdk b/lib/libdevuansdk index 0611dcc..8e7a779 160000 --- a/lib/libdevuansdk +++ b/lib/libdevuansdk @@ -1 +1 @@ -Subproject commit 0611dccb1726bb4085bd98c5ddc0bb10930a2e0a +Subproject commit 8e7a779237a55bbedf4b28c0980ff0ca2464fc8a diff --git a/sdk b/sdk index 558fce1..cc3c7c9 100755 --- a/sdk +++ b/sdk @@ -1,5 +1,6 @@ #!/usr/bin/env zsh -# Copyright (c) 2016-2017 Dyne.org Foundation +# shellcheck shell=bash +# Copyright (c) 2016-2020 Dyne.org Foundation # live-sdk is written and maintained by Ivan J. # # This file is part of live-sdk @@ -17,51 +18,39 @@ # You should have received a copy of the GNU General Public License # along with this source code. If not, see . -livesdk_version="0.2" +livesdk_version="1.0" -R=${LIVE_SDK-$PWD} +R="${LIVE_SDK-$PWD}" -DEBUG=1 -QUIET=0 +source "$R/lib/zuper/zuper" -source $R/lib/zuper/zuper - -## global vars +# Global vars vars+=(livesdk_version) vars+=(R workdir strapdir) vars+=(os oslib blendlib) vars+=(release) -vars+=(MAKEOPTS) -## global arrs +# Global arrs arrs+=(extra_packages) -## global maps +# Global maps maps+=(os_map blend_map) -source $R/config -#source $R/lib/helpers +source "$R/config" -## conclude zuper initialization -source $R/lib/zuper/zuper.init +# Conclude zuper initialization +source "$R/lib/zuper/zuper.init" load() { fn load "$@" os="$1" - arch="$2" - blend="$3" + blend="$2" - [[ $# -gt 3 ]] && release="$4" + [[ $# -gt 2 ]] && release="$3" req=(os arch) ckreq || return 1 - case $arch in - amd64) earch="x86_64" ;; - i386) earch="i686" ;; - *) error "invalid arch specified"; zerr;; - esac - os_map=( "devuan" "$R/lib/libdevuansdk/libdevuansdk" ) @@ -74,40 +63,29 @@ load() { ) oslib="${os_map[$os]}" + [[ -f "$oslib" ]] || { die "No valid distro specified"; return 1; } + source "$oslib" + blendlib="${blend_map[$blend]}" - [[ $blendlib =~ '^http' ]] && { - notice "grabbing blend from the internetz" - mkdir -p $R/extra/blends - pushd $R/extra/blends - curl -Ls -O $blendlib - popd - blendlib="$R/extra/blends/$(basename $blendlib)" - } - - [[ -f $oslib ]] || { die "no valid distro specified"; exit 1 } - [[ -f $blendlib ]] || { act "no blend specified" } - - source $oslib - [[ -f $blendlib ]] && { - source $blendlib || zerr - act "$os blend loaded -- ($blend -- release: $release)" + [[ -f "$blendlib" ]] || act "No blend specified" + [[ -f "$blendlib" ]] && { + source "$blendlib" || { zerr; return 1; } + act "$(basename "$blend") blend loaded" export BLEND=1 } workdir="$R/tmp/${os}-${arch}-build" strapdir="$workdir/bootstrap" - mkdir -p $strapdir + mkdir -p "$strapdir" export LANG=C export LC_ALL=C - source $R/lib/zuper/zuper.init + source "$R/lib/zuper/zuper.init" } TRAPZERR() { zerr; return $? } -notice "live-sdk loaded" +notice "live-sdk $livesdk_version loaded" export PROMPT="%F{yellow}%(?..%? )%{$reset_color%}livesdk@%{$fg[red]%}%m %{$reset_color%} %{$fg[blue]%}%#%{$fg_bold[blue]%}%{$reset_color%} " - -echo "release is: $release"