From d4d566b85fb34ca4f57fee06c5f4b52bb675d687 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 17 Apr 2016 12:48:50 +0100 Subject: allow argent version of vasile to be installed side by side --- build | 40 ++++++++++++++++++++++++++++++ build64 | 40 ------------------------------ iso | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ iso64 | 86 ----------------------------------------------------------------- vasile | 8 +++--- 5 files changed, 130 insertions(+), 130 deletions(-) create mode 100755 build delete mode 100755 build64 create mode 100755 iso delete mode 100755 iso64 diff --git a/build b/build new file mode 100755 index 0000000..c4c507f --- /dev/null +++ b/build @@ -0,0 +1,40 @@ +#!/usr/bin/env bash + +# Vasile needs root privileges and a proper kernel to run + +kernelconfig +checkroot + +chrootpreparex64 () { + # check our environment for sanity + # if safe, trigger start && break the loop to build packages + # else trigger stop && cleanup && check again + while : true ; do + if [[ ! -d "$rodir" && ! -d "$rwdir" && ! -d "$workdir" && ! -d "$overlaydir" ]] ; then + for i in "$rodir" "$rwdir" "$workdir" "$overlaydir" ; do + mkdir "$i" + done + chrootstartx64 + break + elif [[ -d "$rodir" && -d "$rwdir" && -d "$workdir" && -d "$overlaydir" ]] ; then + chrootstop + for i in "$rodir" "$rwdir" "$workdir" "$overlaydir" ; do + rm -rf "$i" + done + continue + fi + done +} + +main () { + chrootchecksumx64 + chrootpreparex64 + chrootoverlaysx64 + chrootbuildsystemx64 + chrootbuildx64 + chrootx64 + chrootstop +} + +main +exit 0 diff --git a/build64 b/build64 deleted file mode 100755 index c4c507f..0000000 --- a/build64 +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env bash - -# Vasile needs root privileges and a proper kernel to run - -kernelconfig -checkroot - -chrootpreparex64 () { - # check our environment for sanity - # if safe, trigger start && break the loop to build packages - # else trigger stop && cleanup && check again - while : true ; do - if [[ ! -d "$rodir" && ! -d "$rwdir" && ! -d "$workdir" && ! -d "$overlaydir" ]] ; then - for i in "$rodir" "$rwdir" "$workdir" "$overlaydir" ; do - mkdir "$i" - done - chrootstartx64 - break - elif [[ -d "$rodir" && -d "$rwdir" && -d "$workdir" && -d "$overlaydir" ]] ; then - chrootstop - for i in "$rodir" "$rwdir" "$workdir" "$overlaydir" ; do - rm -rf "$i" - done - continue - fi - done -} - -main () { - chrootchecksumx64 - chrootpreparex64 - chrootoverlaysx64 - chrootbuildsystemx64 - chrootbuildx64 - chrootx64 - chrootstop -} - -main -exit 0 diff --git a/iso b/iso new file mode 100755 index 0000000..462c67b --- /dev/null +++ b/iso @@ -0,0 +1,86 @@ +#!/usr/bin/env bash + +# Vasile needs root privileges and a proper kernel to run + +kernelconfig +checkroot + +prepareisox64 () { + # we really need this folder as quick as possible + mkdir -p "$isosyncdirx64" + # create an empty 20GB ext4 fs were our rootfs will stay + dd if=/dev/zero of=""$isosyncdirx64".img" bs=50M count=400 + mkfs.ext4 ""$isosyncdirx64".img" + # create live iso layout + mkdir -p "$isostagingdirx64" + mkdir -p "$isobootdirx64" + mkdir -p "$isoefibootdirx64" + mkdir -p "$isoliveosdirx64" + mkdir -p "$isosupersquashdirx64" + mkdir -p "$isolivesqfsdirx64" + # mount && copy core stage 4 image + mount -t squashfs "$chrootx64" "$isostagingdirx64" + mount -t ext4 ""$isosyncdirx64".img" "$isosyncdirx64" + rsync -aHAXr --progress "$isostagingdirx64/" "$isosyncdirx64/" + # copy kernel into cdroot + cp -avx ""$isosyncdirx64"/boot/"$isokernelnamex64"" ""$isorootdirx64"/boot/vmlinuz" + # generate live initramfs + isostartx64 + isoramfsx64 + isostopx64 + # generate system initramfs + isostartx64 + systemramfsx64 + isostopx64 + # copy live initramfs into cdroot + mv ""$isosyncdirx64"/boot/"$isodracutrd"" ""$isorootdirx64"/boot/initrd" + # generate live efi image + isostartx64 + isoefiimgx64 + isostopx64 + # copy efi image into cdroot + mv ""$isosyncdirx64"/root/bootx64.efi" "$isoefibootdirx64" + chmod 755 ""$isoefibootdirx64"/bootx64.efi" + # configure portage && give up control for package / desktop environment installation + isostartx64 + isooverlaysx64 + isobuildsystemx64 + isochrootx64 + isostopx64 + # unmount rootfs before compression + umount -l "$isosyncdirx64" > /dev/null 2>&1 + # move rootfs in place + mv ""$isosyncdirx64".img" "$isolivesqfsdirx64" + # squash rootfs with best compression + mksquashfs "$isosupersquashdirx64" ""$isorootdirx64"/squashfs.img" -b 1048576 -comp xz -Xdict-size 100% + # move squashed rootfs in place + mv ""$isorootdirx64/"squashfs.img" "$isoliveosdirx64" +} + +bootcoreisox64 () { + # configure live bootloader + git clone https://gitlab.com/"$releasename"/boot-core.git "$bootcorepath" + cp -avx "$bootcorefiles" "$isorootdirx64" +} + +cleanupisox64 () { + umount "$isostagingdirx64" + rm -rf "$isosyncdirx64" + rm -rf "$isostagingdirx64" + rm -rf "$isosupersquashdirx64" + rm -rf "$bootcorepath" +} + +makeisox64 () { + grub2-mkrescue -o ""$releasename"-"$releasetarget"-"$releaseversion"-"$isomainarchx64".iso" "$isorootdirx64" +} + +main () { + chrootchecksumx64 + prepareisox64 + bootcoreisox64 + cleanupisox64 + makeisox64 +} + +main diff --git a/iso64 b/iso64 deleted file mode 100755 index 462c67b..0000000 --- a/iso64 +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env bash - -# Vasile needs root privileges and a proper kernel to run - -kernelconfig -checkroot - -prepareisox64 () { - # we really need this folder as quick as possible - mkdir -p "$isosyncdirx64" - # create an empty 20GB ext4 fs were our rootfs will stay - dd if=/dev/zero of=""$isosyncdirx64".img" bs=50M count=400 - mkfs.ext4 ""$isosyncdirx64".img" - # create live iso layout - mkdir -p "$isostagingdirx64" - mkdir -p "$isobootdirx64" - mkdir -p "$isoefibootdirx64" - mkdir -p "$isoliveosdirx64" - mkdir -p "$isosupersquashdirx64" - mkdir -p "$isolivesqfsdirx64" - # mount && copy core stage 4 image - mount -t squashfs "$chrootx64" "$isostagingdirx64" - mount -t ext4 ""$isosyncdirx64".img" "$isosyncdirx64" - rsync -aHAXr --progress "$isostagingdirx64/" "$isosyncdirx64/" - # copy kernel into cdroot - cp -avx ""$isosyncdirx64"/boot/"$isokernelnamex64"" ""$isorootdirx64"/boot/vmlinuz" - # generate live initramfs - isostartx64 - isoramfsx64 - isostopx64 - # generate system initramfs - isostartx64 - systemramfsx64 - isostopx64 - # copy live initramfs into cdroot - mv ""$isosyncdirx64"/boot/"$isodracutrd"" ""$isorootdirx64"/boot/initrd" - # generate live efi image - isostartx64 - isoefiimgx64 - isostopx64 - # copy efi image into cdroot - mv ""$isosyncdirx64"/root/bootx64.efi" "$isoefibootdirx64" - chmod 755 ""$isoefibootdirx64"/bootx64.efi" - # configure portage && give up control for package / desktop environment installation - isostartx64 - isooverlaysx64 - isobuildsystemx64 - isochrootx64 - isostopx64 - # unmount rootfs before compression - umount -l "$isosyncdirx64" > /dev/null 2>&1 - # move rootfs in place - mv ""$isosyncdirx64".img" "$isolivesqfsdirx64" - # squash rootfs with best compression - mksquashfs "$isosupersquashdirx64" ""$isorootdirx64"/squashfs.img" -b 1048576 -comp xz -Xdict-size 100% - # move squashed rootfs in place - mv ""$isorootdirx64/"squashfs.img" "$isoliveosdirx64" -} - -bootcoreisox64 () { - # configure live bootloader - git clone https://gitlab.com/"$releasename"/boot-core.git "$bootcorepath" - cp -avx "$bootcorefiles" "$isorootdirx64" -} - -cleanupisox64 () { - umount "$isostagingdirx64" - rm -rf "$isosyncdirx64" - rm -rf "$isostagingdirx64" - rm -rf "$isosupersquashdirx64" - rm -rf "$bootcorepath" -} - -makeisox64 () { - grub2-mkrescue -o ""$releasename"-"$releasetarget"-"$releaseversion"-"$isomainarchx64".iso" "$isorootdirx64" -} - -main () { - chrootchecksumx64 - prepareisox64 - bootcoreisox64 - cleanupisox64 - makeisox64 -} - -main diff --git a/vasile b/vasile index f0190a4..39cc017 100755 --- a/vasile +++ b/vasile @@ -59,15 +59,15 @@ export local isoefibootdirx64=""$isorootdirx64"/efi/boot" export local dracutrdx64="initramfs-genkernel-"$isomainarchx64"-"$kernelver"" export local dracutcmdx64="dracut -N -o systemd -o systemd-initrd -o systemd-networkd -o dracut-systemd --force --kver "$kernelver" "/boot/"$dracutrdx64""" -source /usr/lib/vasile/libvasile +source /usr/lib/vasile-kogaion/libvasile case $1 in - --build64) source /usr/share/vasile/build64 + --build) source /usr/share/vasile-kogaion/build ;; - --iso64) source /usr/share/vasile/iso64 + --iso) source /usr/share/vasile-kogaion/iso ;; --help) echo -e "" - echo -e "Usage: vasile [options]" + echo -e "Usage: vasile-kogaion [options]" echo -e "" echo -e "Options:" echo -e "--build64 : build package/target in a clean x64 squashed core" -- cgit v1.2.3