Browse Source

initial import

master
parazyd 4 years ago
parent
commit
bd92e5d9f9
Signed by untrusted user: parazyd <parazyd@dyne.org> GPG Key ID: F0CB28FCF78637DE
4 changed files with 103 additions and 44 deletions
  1. +3
    -0
      .gitmodules
  2. +1
    -0
      lib/libdevuansdk
  3. +99
    -0
      sdk
  4. +0
    -44
      vm-sdk

+ 3
- 0
.gitmodules View File

@@ -0,0 +1,3 @@
[submodule "lib/libdevuansdk"]
path = lib/libdevuansdk
url = https://git.devuan.org/sdk/libdevuansdk.git

+ 1
- 0
lib/libdevuansdk

@@ -0,0 +1 @@
Subproject commit 0cfdec721fcddd47980673b2c341c28f225c7206

+ 99
- 0
sdk View File

@@ -0,0 +1,99 @@
#!/usr/bin/env zsh
# Copyright (c) 2016-2017 Dyne.org Foundation
# vm-sdk is written and maintained by Ivan J. <parazyd@dyne.org>
#
# This file is part of vm-sdk
#
# 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 <http://www.gnu.org/licenses/>.

vmsdk_version="0.2"

R=${VM_SDK:-$PWD}

DEBUG=0
QUIET=0

source $R/lib/zuper/zuper

## global vars
vars+=(vmsdk_version)
vars+=(R workdir strapdir)
vars+=(os oslib blendlib)
vars+=(MAKEOPTS)

## global arrs
arrs+=(extra_packages)

## global maps
maps+=(board_map os_map blend_map)

source $R/config
source $R/lib/helpers

## conclude zuper initialization
source $R/lib/zuper/zuper.init

load() {
fn load "$@"
os="$1"
dev="$2"
blend="$3"
req=(os dev)
ckreq || return 1

## initialize binfmt_misc if not already, needed to run qemu
#if [[ -f /etc/init.d/binfmt-support ]]; then
# sudo /etc/init.d/binfmt-support restart
#else
# [[ -d /proc/sys/fs/binfmt_misc ]] \
# || sudo modprobe binfmt_misc
# [[ -f /proc/sys/fs/binfmt_misc/register ]] \
# || sudo mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc
#fi

os_map=(
"devuan" "$R/lib/libdevuansdk/libdevuansdk"
)

oslib="${os_map[$os]}"
blendlib="${blend_map[$blend]}"

[[ $blendlib =~ '^http' ]] && {
notice "grabbing blend from the internetz"
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 ]] || { warn "no valid blend specified" }

source $oslib
[[ -f $blendlib ]] && source $blendlib && act "$os blend loaded" && export BLEND=1

workdir="$R/tmp/${os}-${arch}-build"
strapdir="$workdir/bootstrap"
${=mkdir} -p $strapdir

export LANG=C
export LC_ALL=C

source $R/lib/zuper/zuper.init
}

TRAPZERR() { zerr; return $? }

notice "vm-sdk loaded"
export PROMPT="%F{yellow}%(?..%? )%{$reset_color%}vmsdk@%{$fg[red]%}%m %{$reset_color%} %{$fg[blue]%}%#%{$fg_bold[blue]%}%{$reset_color%} "

+ 0
- 44
vm-sdk View File

@@ -1,44 +0,0 @@
#!/usr/bin/env zsh


scope=vm-sdk

SDK_LIB=../libdevuansdk
SDK_BLENDS=../devuan-sdk-blends

pushd $SDK_LIB
source libdevuansdk
popd

pushd $SDK_BLENDS
source $SDK_BLENDS/

source
R=`pwd`
H=`pwd`
E=`pwd`


vm_sdk_init(){

fn vm_sdk_init $@

project_file=${1:-projects/devuan-jessie-latest-amd64-qcow2}
act "$scope: using project file ::1 file:: " ${project_file}
source ${project_file}
sdk_init
}

vm_sdk_init

# example workflow:

# 1st stage
bootstrap amd64
kernel_x86_install_default

# 2nd stage
blend #install opennebula.deb

# 3rd stage
#qemu_make_img

Loading…
Cancel
Save