From 34b4ee0f3bdf46ef2d9a9151cf17add400a0a6c8 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 21 May 2016 11:44:13 +0100 Subject: small improvements --- buildiso | 94 ---------------------------------------------------------------- buildpkg | 41 ---------------------------- kvasile | 8 +++--- makeiso | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ makepkg | 41 ++++++++++++++++++++++++++++ 5 files changed, 139 insertions(+), 139 deletions(-) delete mode 100755 buildiso delete mode 100755 buildpkg create mode 100755 makeiso create mode 100755 makepkg diff --git a/buildiso b/buildiso deleted file mode 100755 index fdf993b..0000000 --- a/buildiso +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/env bash - -# Vasile needs root privileges and a proper kernel to run - -kernelconfig -checkroot - -prepareiso () { - # we really need this folder as quick as possible - mkdir -p "$isosyncdir" - # create an empty 20GB ext4 fs were our rootfs will stay - dd if=/dev/zero of=""$isosyncdir".img" bs=50M count=400 - mkfs.ext4 ""$isosyncdir".img" - # create live iso layout - mkdir -p "$isostagingdir" - mkdir -p "$isobootdir" - mkdir -p "$isoefibootdir" - mkdir -p "$isoliveosdir" - mkdir -p "$isosupersquashdir" - mkdir -p "$isolivesqfsdir" - # mount && copy core stage 4 image - mount -t squashfs "$chrootx64" "$isostagingdir" - mount -t ext4 ""$isosyncdir".img" "$isosyncdir" - rsync -aHAXr --progress "$isostagingdir/" "$isosyncdir/" - # copy kernel into cdroot - cp -avx ""$isosyncdir"/boot/"$isokernelname"" ""$isorootdir"/boot/vmlinuz" - # generate live initramfs - isostart - isoramfs - isostop - # generate system initramfs - isostart - systemramfs - isostop - # copy live initramfs into cdroot - mv ""$isosyncdir"/boot/"$isodracutrd"" ""$isorootdir"/boot/initrd" - # generate live efi image - isostart - isoefiimg - isostop - # copy efi image into cdroot - mv ""$isosyncdir"/root/bootx64.efi" "$isoefibootdir" - chmod 755 ""$isoefibootdir"/bootx64.efi" - # generate grub chainloader for syslinux - isostart - isochainload - isostop - # copy chainloader parts into cdroot - mv ""$isosyncdir"/root/core.img" "$isobootdir" - cp -avx ""$isosyncdir"/usr/lib64/grub/i386-pc/lnxboot.img" "$isobootdir" - # configure portage && give up control for package / desktop environment installation - isostart - isooverlays - isobuildsystem - isousertree - isochroot - isostop - # unmount rootfs before compression - umount -l "$isosyncdir" > /dev/null 2>&1 - # move rootfs in place - mv ""$isosyncdir".img" "$isolivesqfsdir" - # squash rootfs with best compression - mksquashfs "$isosupersquashdir" ""$isorootdir"/squashfs.img" -b 1048576 -comp xz -Xdict-size 100% - # move squashed rootfs in place - mv ""$isorootdir/"squashfs.img" "$isoliveosdir" -} - -bootcoreiso () { - # configure live bootloader - git clone https://gitlab.com/"$releasename"/boot-core.git "$bootcorepath" - cp -avx "$bootcorefiles" "$isorootdir" -} - -cleanupiso () { - umount "$isostagingdir" - rm -rf "$isosyncdir" - rm -rf "$isostagingdir" - rm -rf "$isosupersquashdir" - rm -rf "$bootcorepath" -} - -makeiso () { - grub2-mkrescue -o ""$releasename"-"$releasetarget"-"$releaseversion"-"$isomainarch".iso" "$isorootdir" -} - -main () { - chrootchecksum - prepareiso - bootcoreiso - cleanupiso - makeiso -} - -main diff --git a/buildpkg b/buildpkg deleted file mode 100755 index 3121bf4..0000000 --- a/buildpkg +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bash - -# Vasile needs root privileges and a proper kernel to run - -kernelconfig -checkroot - -chrootprepare () { - # 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 - chrootstart - 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 () { - chrootchecksum - chrootprepare - chrootoverlays - chrootbuildsystem - chrootdevtree - chrootbuild - chrootx64 - chrootstop -} - -main -exit 0 diff --git a/kvasile b/kvasile index 5259e7a..80e3a03 100755 --- a/kvasile +++ b/kvasile @@ -57,9 +57,9 @@ export local dracutcmd="dracut -N -o systemd -o systemd-initrd -o systemd-networ source /usr/lib/kvasile/libkvasile case $1 in - --buildpkg) source /usr/share/kvasile/buildpkg + --buildpkg) source /usr/share/kvasile/makepkg ;; - --buildiso) source /usr/share/kvasile/buildiso + --buildiso) source /usr/share/kvasile/makeiso ;; --usermode) source /usr/share/kvasile/modereset source /usr/share/kvasile/usermodeset @@ -71,8 +71,8 @@ case $1 in echo -e "Usage: kvasile [options]" echo -e "" echo -e "Options:" - echo -e "--buildpkg : build package/target in a clean squashed core" - echo -e "--buildiso : build iso based on clean squashed core + targets" + echo -e "--makepkg : build package/target in a clean squashed core" + echo -e "--makeiso : build iso based on clean squashed core + targets" echo -e "--usermode : switch INSTALLED Kogaion system to usermode (use binary packages from repositories)" echo -e "--devmode : switch INSTALLED Kogaion system to devmode (use source packages from portage tree )" echo -e "--help : display this help and exit" diff --git a/makeiso b/makeiso new file mode 100755 index 0000000..fdf993b --- /dev/null +++ b/makeiso @@ -0,0 +1,94 @@ +#!/usr/bin/env bash + +# Vasile needs root privileges and a proper kernel to run + +kernelconfig +checkroot + +prepareiso () { + # we really need this folder as quick as possible + mkdir -p "$isosyncdir" + # create an empty 20GB ext4 fs were our rootfs will stay + dd if=/dev/zero of=""$isosyncdir".img" bs=50M count=400 + mkfs.ext4 ""$isosyncdir".img" + # create live iso layout + mkdir -p "$isostagingdir" + mkdir -p "$isobootdir" + mkdir -p "$isoefibootdir" + mkdir -p "$isoliveosdir" + mkdir -p "$isosupersquashdir" + mkdir -p "$isolivesqfsdir" + # mount && copy core stage 4 image + mount -t squashfs "$chrootx64" "$isostagingdir" + mount -t ext4 ""$isosyncdir".img" "$isosyncdir" + rsync -aHAXr --progress "$isostagingdir/" "$isosyncdir/" + # copy kernel into cdroot + cp -avx ""$isosyncdir"/boot/"$isokernelname"" ""$isorootdir"/boot/vmlinuz" + # generate live initramfs + isostart + isoramfs + isostop + # generate system initramfs + isostart + systemramfs + isostop + # copy live initramfs into cdroot + mv ""$isosyncdir"/boot/"$isodracutrd"" ""$isorootdir"/boot/initrd" + # generate live efi image + isostart + isoefiimg + isostop + # copy efi image into cdroot + mv ""$isosyncdir"/root/bootx64.efi" "$isoefibootdir" + chmod 755 ""$isoefibootdir"/bootx64.efi" + # generate grub chainloader for syslinux + isostart + isochainload + isostop + # copy chainloader parts into cdroot + mv ""$isosyncdir"/root/core.img" "$isobootdir" + cp -avx ""$isosyncdir"/usr/lib64/grub/i386-pc/lnxboot.img" "$isobootdir" + # configure portage && give up control for package / desktop environment installation + isostart + isooverlays + isobuildsystem + isousertree + isochroot + isostop + # unmount rootfs before compression + umount -l "$isosyncdir" > /dev/null 2>&1 + # move rootfs in place + mv ""$isosyncdir".img" "$isolivesqfsdir" + # squash rootfs with best compression + mksquashfs "$isosupersquashdir" ""$isorootdir"/squashfs.img" -b 1048576 -comp xz -Xdict-size 100% + # move squashed rootfs in place + mv ""$isorootdir/"squashfs.img" "$isoliveosdir" +} + +bootcoreiso () { + # configure live bootloader + git clone https://gitlab.com/"$releasename"/boot-core.git "$bootcorepath" + cp -avx "$bootcorefiles" "$isorootdir" +} + +cleanupiso () { + umount "$isostagingdir" + rm -rf "$isosyncdir" + rm -rf "$isostagingdir" + rm -rf "$isosupersquashdir" + rm -rf "$bootcorepath" +} + +makeiso () { + grub2-mkrescue -o ""$releasename"-"$releasetarget"-"$releaseversion"-"$isomainarch".iso" "$isorootdir" +} + +main () { + chrootchecksum + prepareiso + bootcoreiso + cleanupiso + makeiso +} + +main diff --git a/makepkg b/makepkg new file mode 100755 index 0000000..3121bf4 --- /dev/null +++ b/makepkg @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +# Vasile needs root privileges and a proper kernel to run + +kernelconfig +checkroot + +chrootprepare () { + # 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 + chrootstart + 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 () { + chrootchecksum + chrootprepare + chrootoverlays + chrootbuildsystem + chrootdevtree + chrootbuild + chrootx64 + chrootstop +} + +main +exit 0 -- cgit v1.2.3