libdevuansdk

common library for devuan's simple distro kits
git clone https://git.parazyd.org/libdevuansdk
Log | Files | Refs | Submodules | README | LICENSE

commit 5787cc14c4ab207fd634919196799bff6e585909
parent ad29e93415d6796ea1b0fd07f68827b8fe5fc68a
Author: KatolaZ <katolaz@yahoo.it>
Date:   Mon, 13 Jun 2016 00:44:54 +0100

make_qemu_image produces an "almost-bootable" qemu image

Diffstat:
Mdoc/README-functions.md | 7+++++--
Mzlibs/customise | 29+++++++++++++++++++++++++++--
2 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/doc/README-functions.md b/doc/README-functions.md @@ -116,4 +116,7 @@ Prints default `/etc/apt/sources.list` # zlibs/customise ## install_default_kernel() -Install the default kernel in the bootstrapped system- \ No newline at end of file +Install the default kernel in the bootstrapped system + +## make_qemu_image() +Make a raw/qcow2 qemu image of workdir+ \ No newline at end of file diff --git a/zlibs/customise b/zlibs/customise @@ -56,6 +56,30 @@ install_default_kernel(){ notice "default kernel installed" } +_install_bootloader(){ + fn _install_bootloader $@ + root=$1 + install_dev=$2 + + sudo chroot ${root} apt-get install --assume-yes --no-install-recommends grub-pc + if [[ ! -d ${root}/boot/grub ]]; then + sudo mkdir ${root}/boot/grub + fi + + ztmp + devicemap=$ztmpfile + + + cat > ${devicemap} <<EOF +(hd0) /dev/loop0 +(hd0,1) /dev/loop1 +EOF + sudo cp ${devicemap} ${root}/boot/grub/device.map + sudo chroot ${root} grub-mkconfig -o /boot/grub/grub.cfg + + sudo grub-install --root-directory=${root} --no-floppy \ + --modules="ext2 part_msdos" ${install_dev} +} make_qemu_img(){ @@ -103,8 +127,9 @@ make_qemu_img(){ sudo rsync -av ${strapdir}/ $mntdir # we now install the grub bootloader - #_install_bootloader $mntdir - + mountdevprocsys ${mntdir} + _install_bootloader $mntdir ${loop1} + umountdevprocsys ${mntdir} sync sudo umount ${mntdir}