diff --git a/libdevuansdk b/libdevuansdk index fce280f..6392eac 100755 --- a/libdevuansdk +++ b/libdevuansdk @@ -56,12 +56,14 @@ vars+=(R H E) vars+=(name_default) # source $R/zlibs/library source $E/config -source $R/zlibs/debootstrap +source $R/zlibs/bootstrap source $R/zlibs/helpers -source $R/zlibs/imaging -source $R/zlibs/iso +# source $R/zlibs/imaging +source $R/zlibs/isolinux +source $R/zlibs/kernel +source $R/zlibs/qemu source $R/zlibs/sysconf -source $R/zlibs/customise + # conclude initialization diff --git a/zlibs/debootstrap b/zlibs/bootstrap similarity index 100% rename from zlibs/debootstrap rename to zlibs/bootstrap diff --git a/zlibs/grub b/zlibs/grub new file mode 100755 index 0000000..6179959 --- /dev/null +++ b/zlibs/grub @@ -0,0 +1,54 @@ +#!/usr/bin/env zsh +# +# Copyright (c) 2016 Dyne.org Foundation +# libdevuansdk is written and maintained by +# Jaromil +# KatolaZ +# parazyd +# +# This file is part of libdevuansdk +# +# 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 . + + +grub_install_target_dev(){ + fn grub_install_target_dev $@ + root=$1 + install_dev=$2 + req=(root install_dev) + freq=($root/.done $root/dev/pts/0) + ckreq || return 1 + + # TODO: should we use qemu-chroot here for $arch = arm (parazyd?) + sudo chroot ${root} apt-get install --assume-yes --no-install-recommends grub-common + if [[ ! -d ${root}/boot/grub ]]; then + sudo mkdir ${root}/boot/grub + fi + + ztmp + devicemap=$ztmpfile + + cat > ${devicemap} < +# KatolaZ +# parazyd +# +# This file is part of libdevuansdk +# +# 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 . + + +kernel_x86_install_default(){ + fn kernel_x86_install_default $@ + req=(strapdir os release version arch) + root=$strapdir + freq=($root/.done) + reqck || return 1 + + local kernel_base=linux-image + local kernel="" + + case $arch in + amd64) + kernel=${kernel_base}-amd64 + ;; + i386) + kernel=${kernel_base}-586 + ;; + *) + error "Architecture ::1 arch:: is not supported!!!" ${arch} + zerr; zshexit + ;; + esac + + notice "Installing stock kernel for ::1 arch:: (::2 kernel::)" $arch $kernel + + mountdevprocsys ${root} + + sudo chroot ${root} apt-get --yes --force-yes --no-install-recommends install $kernel + + umountdevprocsys ${root} + notice "default kernel installed" +} diff --git a/zlibs/customise b/zlibs/qemu similarity index 67% rename from zlibs/customise rename to zlibs/qemu index ba1e46f..8113395 100755 --- a/zlibs/customise +++ b/zlibs/qemu @@ -21,73 +21,6 @@ # You should have received a copy of the GNU General Public License # along with this source code. If not, see . -### customise - -kernel_x86_install_default(){ - fn kernel_x86_install_default $@ - req=(strapdir os release version arch) - root=$strapdir - freq=($root/.done) - reqck || return 1 - - local kernel_base=linux-image - local kernel="" - - case $arch in - amd64) - kernel=${kernel_base}-amd64 - ;; - i386) - kernel=${kernel_base}-586 - ;; - *) - error "Architecture ::1 arch:: is not supported!!!" ${arch} - zerr; zshexit - ;; - esac - - notice "Installing stock kernel for ::1 arch:: (::2 kernel::)" $arch $kernel - - mountdevprocsys ${root} - - sudo chroot ${root} apt-get --yes --force-yes --no-install-recommends install $kernel - - umountdevprocsys ${root} - notice "default kernel installed" -} - -grub_install_target_dev(){ - fn grub_install_target_dev $@ - root=$1 - install_dev=$2 - req=(root install_dev) - freq=($root/.done $root/dev/pts/0) - ckreq || return 1 - - # TODO: should we use qemu-chroot here for $arch = arm (parazyd?) - sudo chroot ${root} apt-get install --assume-yes --no-install-recommends grub-common - if [[ ! -d ${root}/boot/grub ]]; then - sudo mkdir ${root}/boot/grub - fi - - ztmp - devicemap=$ztmpfile - - - cat > ${devicemap} <. -## Default system configuration - -conf_install_grub() { - fn conf_install_grub $@ - chrootpath="$1" - req=(chrootpath) - ckreq || return 1 - - notice "Installing grub-pc" - sudo chroot ${chrootpath} apt-get --yes --force-yes install grub-pc -} - -conf_install_kernel() { - fn conf_install_kernel $@ - chrootpath="$1" - req=(arch chrootpath) - ckreq || return 1 - - local kernel_base=linux-image - local kernel="" - - case $arch in - amd64) - kernel=${kernel_base}-amd64 - ;; - i386) - kernel=${kernel_base}-586 - ;; - *) - error "Architecture ::1 arch:: is not supported!!!" ${arch} - zerr; zshexit - ;; - esac - - notice "Installing stock kernel for ::1 arch:: (::2 kernel::)" $arch $kernel - sudo chroot ${chrootpath} apt-get --yes --force-yes install $kernel -} +## base system configurations conf_print_debconf() { fn conf_print_debconf