diff options
author | V3n3RiX <venerix@rogentos.ro> | 2016-04-17 12:42:37 +0100 |
---|---|---|
committer | V3n3RiX <venerix@rogentos.ro> | 2016-04-17 12:42:37 +0100 |
commit | 69c168189bb006835794755fd026f83c723106c7 (patch) | |
tree | 24056f94e64bfa73505873cfcedf07a99e70dee9 | |
parent | 049bae8660e0734be5be8f9e1052f69e9983868a (diff) |
drop x86 on kogaion
-rwxr-xr-x | build32 | 40 | ||||
-rwxr-xr-x | iso32 | 78 | ||||
-rwxr-xr-x | libvasile | 169 | ||||
-rwxr-xr-x | vasile | 74 |
4 files changed, 21 insertions, 340 deletions
diff --git a/build32 b/build32 deleted file mode 100755 index 56a391b..0000000 --- a/build32 +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env bash - -# Vasile needs root privileges and a proper kernel to run - -checkroot -kernelconfig - -chrootpreparex86 () { - # 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 - chrootstartx86 - 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 () { - chrootchecksumx86 - chrootpreparex86 - chrootoverlaysx86 - chrootbuildsystemx86 - chrootbuildx86 - chrootx86 - chrootstop -} - -main -exit 0 @@ -1,78 +0,0 @@ -#!/usr/bin/env bash - -# Vasile needs root privileges and a proper kernel to run - -kernelconfig -checkroot - -prepareisox86 () { - # we really need this folder as quick as possible - mkdir -p "$isosyncdirx86" - # create an empty 20GB ext4 fs were our rootfs will stay - dd if=/dev/zero of=""$isosyncdirx86".img" bs=50M count=400 - mkfs.ext4 ""$isosyncdirx86".img" - # create live iso layout - mkdir -p "$isostagingdirx86" - mkdir -p "$isobootdirx86" - mkdir -p "$isoliveosdirx86" - mkdir -p "$isosupersquashdirx86" - mkdir -p "$isolivesqfsdirx86" - # mount && copy core stage 4 image - mount -t squashfs "$chrootx86" "$isostagingdirx86" - mount -t ext4 ""$isosyncdirx86".img" "$isosyncdirx86" - rsync -aHAXr --progress "$isostagingdirx86/" "$isosyncdirx86/" - # copy kernel into cdroot - cp -avx ""$isosyncdirx86"/boot/"$isokernelnamex86"" ""$isorootdirx86"/boot/vmlinuz" - # generate live initramfs - isostartx86 - isoramfsx86 - isostopx86 - # generate system initramfs - isostartx86 - systemramfsx86 - isostopx86 - # copy live initramfs - mv ""$isosyncdirx86"/boot/"$isodracutrd"" ""$isorootdirx86"/boot/initrd" - # configure portage && give up control for package / desktop environment installation - isostartx86 - isooverlaysx86 - isobuildsystemx86 - isochrootx86 - isostopx86 - # umount rootfs before compression - umount -l "$isosyncdirx86" > /dev/null 2>&1 - # move rootfs in place - mv ""$isosyncdirx86".img" "$isolivesqfsdirx86" - # squash rootfs with best compression - mksquashfs "$isosupersquashdirx86" ""$isorootdirx86"/squashfs.img" -b 1048576 -comp xz -Xdict-size 100% - # move squashed rootfs in place - mv ""$isorootdirx86"/squashfs.img" "$isoliveosdirx86" -} - -bootcoreisox86 () { - # configure live bootloader - git clone https://gitlab.com/"$releasename"/boot-core.git "$bootcorepath" - cp -avx "$bootcorefiles" "$isorootdirx86" -} - -cleanupisox86 () { - umount "$isostagingdirx86" - rm -rf "$isosyncdirx86" - rm -rf "$isostagingdirx86" - rm -rf "$bootcorepath" - rm -rf "$isosupersquashdirx86" -} - -makeisox86 () { - grub2-mkrescue -o ""$releasename"-"$releasetarget"-"$releaseversion"-"$isomainarchx86".iso" "$isorootdirx86" -} - -main () { - chrootchecksumx86 - prepareisox86 - bootcoreisox86 - cleanupisox86 - makeisox86 -} - -main @@ -1,4 +1,4 @@ -# generic arch independent functions (used for both build && iso creation) +# generic functions (used for both build && iso creation) kernelconfig () { if [[ $(zgrep 'CONFIG_OVERLAYFS_FS=' /proc/config.gz) && $(zgrep "CONFIG_SQUASHFS=" /proc/config.gz) && $(zgrep "CONFIG_BLK_DEV_LOOP=" /proc/config.gz) ]] ; then @@ -25,51 +25,28 @@ checkroot () { fi } -# generic x64 functions (used for both build && iso creation) - chrootchecksumx64 () { while : true ; do if [[ -f "$chrootx64" && -f "$chrootx64md5" ]] ; then - echo "good, x64 squashed chroot && checksum file found ... verifying integrity" + echo "good, squashed chroot && checksum file found ... verifying integrity" echo "" if [[ "$(md5sum -c "$chrootx64md5")" ]] ; then - echo "good, x64 squashed chroot checksum passed ... starting engines" + echo "good, squashed chroot checksum passed ... starting engines" echo "" sleep 1 break else - echo "ooops, x64 squashed chroot checksum failed ... aborting" + echo "ooops, squashed chroot checksum failed ... aborting" exit 1 fi else - echo "ooops, x64 squashed chroot or checksum file not found ... aborting" + echo "ooops, squashed chroot or checksum file not found ... aborting" exit 1 fi done } -chrootchecksumx86 () { - while : true ; do - if [[ -f "$chrootx86" && -f "$chrootx86md5" ]] ; then - echo "good, x86 squashed chroot && checksum file found ... verifying integrity" - echo "" - if [[ "$(md5sum -c "$chrootx86md5")" ]] ; then - echo "good, x86 squashed chroot checksum found ... starting engines" - echo "" - sleep 1 - break - else - echo "ooops, x86 squashed chroot checksum failed ... aborting" - exit 1 - fi - else - echo "ooops, x86 squashed chroot or checksum file not found ... aborting" - exit 1 - fi - done -} - -# arch independent build functions +# build functions chrootstop () { umount -l "$overlaydir"/proc > /dev/null 2>&1 @@ -84,8 +61,6 @@ chrootstop () { umount -l "$rodir" > /dev/null 2>&1 } -# x64 specific build functions - chrootstartx64 () { mount -t squashfs "$chrootx64" "$rodir" if [[ "$(uname -r | cut -d . -f1,2)" = "3.14" ]] ; then @@ -104,19 +79,19 @@ chrootstartx64 () { } chroottreex64 () { - echo "injecting full portage tree into x64 environment" + echo "injecting full portage tree into build environment" sleep 1 chroot "$overlaydir" su - "$chrootuser" -c "$chroottree" } chrootoverlaysx64 () { - echo "injecting "$releasename" "$releasetarget" overlay into x64 environment" + echo "injecting "$releasename" "$releasetarget" overlay into build environment" sleep 1 chroot "$overlaydir" su - "$chrootuser" -c "$chrootmainoverlay" } chrootbuildsystemx64 () { - echo "injecting "$releasename" x64 buildsystem && setting up portage" + echo "injecting "$releasename" buildsystem && setting up portage" echo "" sleep 1 for cmd in "$chrootbuildgit" "$chrootportageconfig" "$chrootmakeconfx64" "$chrootprofile" "$chrootenvupdate" ; do @@ -126,7 +101,7 @@ chrootbuildsystemx64 () { chrootbuildx64 () { echo "" - echo "x64 Environment is up && running ... building targets" + echo "Environment is up && running ... building targets" sleep 1 chroot "$overlaydir" su - "$chrootuser" -c "$chrootbuildtarget" } @@ -150,73 +125,7 @@ chrootx64 () { chroot "$overlaydir" su - "$chrootuser" } -# x86 specific build functions - -chrootstartx86 () { - mount -t squashfs "$chrootx86" "$rodir" - if [[ "$(uname -r | cut -d . -f1,2)" = "3.14" ]] ; then - mount -t overlayfs -o lowerdir="$rodir",upperdir="$rwdir" overlayfs "$overlaydir" - else # kernel version equal or above 3.18 - mount -t overlay -o lowerdir="$rodir",upperdir="$rwdir",workdir="$workdir" overlay "$overlaydir" - fi - mount -o bind packages "$overlaydir"/usr/portage/packages - mount -o bind distfiles "$overlaydir"/usr/portage/distfiles - mount -t proc proc "$overlaydir"/proc - mount -t sysfs sysfs "$overlaydir"/sys - mount -t devtmpfs -o relatime,size=3055348k,nr_inodes=763837,mode=755 none "$overlaydir"/dev - mount -t devpts -o nosuid,noexec,relatime,gid=5,mode=620 none "$overlaydir"/dev/pts - mount -t tmpfs -o nosuid,nodev none "$overlaydir"/dev/shm - mount -t tmpfs -o nosuid,nodev,noexec none "$overlaydir"/tmp -} - -chrottreex86 () { - echo "injecting full portage tree into x86 environment" - sleep 1 - linux32 chroot "$overlaydir" su - "$chrootuser" -c "$chroottree" -} - -chrootoverlaysx86 () { - echo "injecting "$releasename" "$releasetarget" overlay into x86 environment" - sleep 1 - linux32 chroot "$overlaydir" su - "$chrootuser" -c "$chrootmainoverlay" -} - -chrootbuildsystemx86 () { - echo "injecting "$releasename" x86 buildsystem && setting up portage" - echo "" - sleep 1 - for cmd in "$chrootbuildgit" "$chrootportageconfig" "$chrootmakeconfx86" "$chrootprofile" "$chrootenvupdate" ; do - linux32 chroot "$overlaydir" su - "$chrootuser" -c "$cmd" - done -} - -chrootbuildx86 () { - echo "" - echo "x86 environment is up && running ... building targets" - sleep 1 - chroot "$overlaydir" su - "$chrootuser" -c "$chrootbuildtarget" -} - -chrootx86 () { - echo -e "" - echo -e "#################################################################" - echo -e "# ENTERING CHROOT ENV FOR YOU TO PUSH BUILT PACKAGES #" - echo -e "# OR TO FIX EVENTUAL BUILD ERRORS #" - echo -e "#################################################################" - echo -e "# !!! WARNING !!! WARNING !!! WARNING !!! #" - echo -e "#################################################################" - echo -e "# NEXT RUN OF THIS SCRIPT WILL DESTROY ALL YOUR WORK #" - echo -e "# DO NOT EXIT CHROOT UNTIL ALL PACKAGES ARE PUSHED TO REPOS #" - echo -e "# OR, IN CASE OF BUILD FAILURES, UNTIL ALL FIXES ARE COMMITED #" - echo -e "#################################################################" - echo -e "# !!! WARNING !!! WARNING !!! WARNING !!! #" - echo -e "#################################################################" - echo -e "" - echo -e "" - linux32 chroot "$overlaydir" su - "$chrootuser" -} - -# x64 specific iso functions +# iso functions isostartx64 () { mount -o bind packages "$isosyncdirx64"/usr/portage/packages @@ -245,7 +154,7 @@ isooverlaysx64 () { } isobuildsystemx64 () { - echo "injecting "$releasename" x64 buildsystem && setting up portage" + echo "injecting "$releasename" buildsystem && setting up portage" echo "" sleep 1 for cmd in "$isobuildgit" "$isoportageconfig" "$isomakeconfx64" "$isoprofile" "$isoenvupdate" ; do @@ -273,57 +182,3 @@ isochrootx64 () { echo -e "" chroot "$isosyncdirx64" su - "$isouser" } - -# x86 specific iso functions - -isostartx86 () { - mount -o bind packages "$isosyncdirx86"/usr/portage/packages - mount -t proc proc "$isosyncdirx86"/proc - mount -t sysfs sysfs "$isosyncdirx86"/sys - mount -t devtmpfs -o relatime,size=3055348k,nr_inodes=763837,mode=755 none "$isosyncdirx86"/dev - mount -t devpts -o nosuid,noexec,relatime,gid=5,mode=620 none "$isosyncdirx86"/dev/pts - mount -t tmpfs -o nosuid,nodev none "$isosyncdirx86"/dev/shm - mount -t tmpfs -o nosuid,nodev,noexec none "$isosyncdirx86"/tmp -} - -isostopx86 () { - umount -l "$isosyncdirx86"/proc > /dev/null 2>&1 - umount -l "$isosyncdirx86"/sys > /dev/null 2>&1 - umount -l "$isosyncdirx86"/dev/pts > /dev/null 2>&1 - umount -l "$isosyncdirx86"/dev/shm > /dev/null 2>&1 - umount -l "$isosyncdirx86"/dev > /dev/null 2>&1 - umount -l "$isosyncdirx86"/tmp > /dev/null 2>&1 - umount -l "$isosyncdirx86"/usr/portage/packages > /dev/null 2>&1 -} - -isooverlaysx86 () { - echo "injecting "$releasename" "$releasetarget" overlay into x86 environment" - sleep 1 - linux32 chroot "$isosyncdirx86" su - "$isouser" -c "$isomainoverlay" -} - -isobuildsystemx86 () { - echo "injecting "$releasename" x86 buildsystem && setting up portage" - echo "" - sleep 1 - for cmd in "$isobuildgit" "$isoportageconfig" "$isomakeconfx86" "$isoprofile" "$isoenvupdate" ; do - linux32 chroot "$isosyncdirx86" su - "$isouser" -c "$cmd" - done -} - -isoramfsx86 () { - linux32 chroot "$isosyncdirx86" su - "$isouser" -c "$isodracutcmd" -} - -systemramfsx86 () { - linux32 chroot "$isosyncdirx86" su - "$isouser" -c "dracutcmdx86" -} - -isochrootx86 () { - echo -e "" - echo -e "DROPPING YOU TO A ROOT SHELL INTO ISO ENVIRONMENT" - echo -e "INSTALL APPS & TARGETS & DES YOU WANT INSIDE ISO" - echo -e "EXIT WHEN YOU'RE DONE AND I'LL CREATE THE IMAGE" - echo -e "" - linux32 chroot "$isosyncdirx86" su - "$isouser" -} @@ -6,35 +6,14 @@ # generic variables -echo -e "" -echo -e "Choose the system core you want me to use" -echo -e "" -OPTIONS="Kogaion Argent" -select systemcore in $OPTIONS; do - if [[ "$systemcore" = "Kogaion" ]] ; then - echo -e "" - echo -e "Adjusting variables for Kogaion Desktop 3" - export local releasename="kogaion" - export local releasetarget="desktop" - export local releaseversion="3" - export local kernelver="3.14.50-"$releasename"" - break - elif [[ "$systemcore" = "Argent" ]] ; then - echo -e "" - echo -e "Adjusting variables for Argent Server 2" - export local releasename="argent" - export local releasetarget="server" - export local releaseversion="2" - export local kernelver="3.14.51-"$releasename"" - break - else - echo -e "" - echo -e "Wrong choice, bye bye" - exit 1 - fi -done +export local releasename="kogaion" +export local releasetarget="desktop" +export local releaseversion="3" +export local kernelver="3.14.50-"$releasename"" +export local chrootx64=""$releasename"_"$releaseversion"_core_x64.squashfs" +export local chrootx64md5=""$chrootx64".md5" -# arch independent build variables +# build variables export local rodir="rodir" export local rwdir="rwdir" @@ -47,10 +26,11 @@ export local chroottree="/usr/share/vasile/devmod" export local chrootmainoverlay="layman -f -a "$releasename"-"$releasetarget" -o https://gitlab.com/"$releasename"/"$releasename"-"$releasetarget"/raw/master/overlay.xml" export local chrootbuildgit="cd /opt && git clone https://gitlab.com/"$releasename"/"$releasename"-build.git" export local chrootportageconfig="ln -sf /opt/"$releasename"-build/conf/intel/portage /etc/portage" +export local chrootmakeconfx64="ln -sf /opt/"$releasename"-build/conf/intel/portage/make.conf.amd64-devel /etc/portage/make.conf" export local chrootenvupdate="/usr/sbin/env-update && . /etc/profile" export local chrootprofile="eselect profile set 1" -# arch independent iso variables +# iso variables export local bootcorepath="/tmp/bootcore" export local bootcorefiles="/tmp/bootcore/cdroot/boot" @@ -65,21 +45,6 @@ export local isoprofile="eselect profile set 1" export local isodracutcmd="dracut -N -a dmsquash-live -a pollcdrom -o systemd -o systemd-initrd -o systemd-networkd -o dracut-systemd --force --kver "$kernelver"" export local isodracutrd="initramfs-"$kernelver".img" export local isoeficmd="grub2-mkimage -d /usr/lib64/grub/x86_64-efi -o bootx64.efi -O x86_64-efi ext2 fat udf btrfs ntfs reiserfs xfs hfsplus lvm ata part_msdos part_gpt part_apple bsd search_fs_uuid normal chain iso9660 configfile help loadenv reboot cat search memdisk tar boot linux chain" - -# x64 specific build variables - -export local chrootx64=""$releasename"_"$releaseversion"_core_x64.squashfs" -export local chrootx64md5=""$chrootx64".md5" -export local chrootmakeconfx64="ln -sf /opt/"$releasename"-build/conf/intel/portage/make.conf.amd64-devel /etc/portage/make.conf" - -# x86 specific build variables - -export local chrootx86=""$releasename"_"$releaseversion"_core_x86.squashfs" -export local chrootx86md5=""$chrootx86".md5" -export local chrootmakeconfx86="ln -sf /opt/"$releasename"-build/conf/intel/portage/make.conf.x86-devel /etc/portage/make.conf" - -# x64 specific iso variables - export local isomainarchx64="x86_64" export local isomakeconfx64="ln -sf /opt/"$releasename"-build/conf/intel/portage/make.conf.amd64-user /etc/portage/make.conf" export local isorootdirx64=""$releasename"-"$releasetarget"-"$releaseversion"-"$isomainarchx64"" @@ -94,40 +59,19 @@ 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""" -# x86 specific iso variables - -export local isomainarchx86="x86" -export local isomakeconfx86="ln -sf /opt/"$releasename"-build/conf/intel/portage/make.conf.x86-user /etc/portage/make.conf" -export local isorootdirx86=""$releasename"-"$releasetarget"-"$releaseversion"-"$isomainarchx86"" -export local isokernelnamex86="kernel-genkernel-"$isomainarchx86"-"$kernelver"" -export local isostagingdirx86="/tmp/"$isorootdirx86"" -export local isosupersquashdirx86=""$isorootdirx86"/CDroot" -export local isolivesqfsdirx86=""$isosupersquashdirx86"/LiveOS" -export local isoliveosdirx86=""$isorootdirx86"/LiveOS" -export local isosyncdirx86=""$isorootdirx86"/rootfs" -export local isobootdirx86=""$isorootdirx86"/boot/grub" -export local dracutrdx86="initramfs-genkernel-"$isomainarchx86"-"$kernelver"" -export local dracutcmdx86="dracut -N -o systemd -o systemd-initrd -o systemd-networkd -o dracut-systemd --force --kver "$kernelver" "/boot/"$dracutrdx86""" - source /usr/lib/vasile/libvasile case $1 in --build64) source /usr/share/vasile/build64 ;; - --build32) source /usr/share/vasile/build32 - ;; --iso64) source /usr/share/vasile/iso64 ;; - --iso32) source /usr/share/vasile/iso32 - ;; --help) echo -e "" echo -e "Usage: vasile [options]" echo -e "" echo -e "Options:" echo -e "--build64 : build package/target in a clean x64 squashed core" - echo -e "--build32 : build package/target in a clean x86 squashed core" echo -e "--iso64 : build x64 iso based on clean squashed core + targets" - echo -e "--iso32 : build x86 iso based on clean squashed core + targets" echo -e "--help : display this help and exit" echo -e "" ;; |