diff options
author | V3n3RiX <venerix@rogentos.ro> | 2015-09-26 11:20:16 +0100 |
---|---|---|
committer | V3n3RiX <venerix@rogentos.ro> | 2015-09-26 11:20:16 +0100 |
commit | 50528cc875eb7869bf96b5c623adcee009abade1 (patch) | |
tree | 76faeaef7377446ae61676d979f64bf5492bdb20 | |
parent | 9fa9e4692de2f6d600ebe13fdf0ff80f136df91d (diff) |
adapt vasile to kernel 4.1 LTS, and to build.git repo change
-rwxr-xr-x | build32 | 8 | ||||
-rwxr-xr-x | build64 | 10 | ||||
-rwxr-xr-x | libvasile | 19 |
3 files changed, 23 insertions, 14 deletions
@@ -5,15 +5,15 @@ chrootpreparex86 () { # 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 "$overlaydir" ]] ; then - for i in "$rodir" "$rwdir" "$overlaydir" ; 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 "$overlaydir" ]] ; then + elif [[ -d "$rodir" && -d "$rwdir" && -d "$workdir" && -d "$overlaydir" ]] ; then chrootstop - for i in "$rodir" "$rwdir" "$overlaydir" ; do + for i in "$rodir" "$rwdir" "$workdir" "$overlaydir" ; do rm -rf "$i" done continue @@ -5,15 +5,15 @@ chrootpreparex64 () { # 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 "$overlaydir" ]] ; then - for i in "$rodir" "$rwdir" "$overlaydir" ; 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 "$overlaydir" ]] ; then + elif [[ -d "$rodir" && -d "$rwdir" && -d "$workdir" && -d "$overlaydir" ]] ; then chrootstop - for i in "$rodir" "$rwdir" "$overlaydir" ; do + for i in "$rodir" "$rwdir" "$workdir" "$overlaydir" ; do rm -rf "$i" done continue @@ -33,5 +33,5 @@ main () { fi } -main +main exit 0 @@ -1,6 +1,7 @@ # arch agnostic code export local rodir="rodir" export local rwdir="rwdir" +export local workdir="workdir" # only needed for overlayfs on kernel greather than 3.18 export local overlaydir="overlaydir" export local chrootuser="root" export local chroottarget="${@:2}" @@ -8,7 +9,7 @@ export local chrootbuildtarget="emerge -kav "$chroottarget"" export local chrootoverlay="layman -f -a kogaion -o https://gitlab.com/kogaion/kogaion-main/raw/master/overlay.xml" export local chrootdesktopoverlay="layman -f -a kogaion-desktop -o https://gitlab.com/kogaion/kogaion-desktop/raw/master/overlay.xml" export local chrootbuildgit="cd /opt && git clone https://gitlab.com/kogaion/kogaion-build.git" -export local chrootportageconfig="ln -sf /opt/build/conf/intel/portage /etc/portage" +export local chrootportageconfig="ln -sf /opt/kogaion-build/conf/intel/portage /etc/portage" export local chrootenvupdate="/usr/sbin/env-update && . /etc/profile" export local chrootprofile="eselect profile set 1" @@ -37,7 +38,7 @@ chrootstop () { # x64 specific code export local chrootx64="kogaiondevelx64.squashfs" export local chrootx64md5=""$chrootx64".md5" -export local chrootmakeconfx64="ln -sf /opt/build/conf/intel/portage/make.conf.amd64 /etc/portage/make.conf" +export local chrootmakeconfx64="ln -sf /opt/kogaion-build/conf/intel/portage/make.conf.amd64 /etc/portage/make.conf" chrootchecksumx64 () { while : true ; do @@ -62,7 +63,11 @@ chrootchecksumx64 () { chrootstartx64 () { mount -t squashfs "$chrootx64" "$rodir" - mount -t overlayfs -o lowerdir="$rodir",upperdir="$rwdir" overlayfs "$overlaydir" + if [[ "$(uname -r | cut -d - -f1)" = "3.14.0" ]] ; then + mount -t overlayfs -o lowerdir="$rodir",upperdir="$rwdir" overlayfs "$overlaydir" + elif [[ "(uname -r | cut -d - -f1)" = "4.1.0" ]] ; then + mount -t overlay -o lowerdir="$rodir",upperdir="$rwdir",workdir="$workdir" overlay "$overlaydir" + fi while : true ; do if [[ ! -d packages ]] ; then mkdir packages @@ -139,7 +144,7 @@ chrootx64() { # x86 specific code export local chrootx86="kogaiondevelx86.squashfs" export local chrootx86md5=""$chrootx86".md5" -export local chrootmakeconfx86="ln -sf /opt/build/conf/intel/portage/make.conf.x86 /etc/portage/make.conf" +export local chrootmakeconfx86="ln -sf /opt/kogaion-build/conf/intel/portage/make.conf.x86 /etc/portage/make.conf" chrootchecksumx86 () { while : true ; do @@ -164,7 +169,11 @@ chrootchecksumx86 () { chrootstartx86 () { mount -t squashfs "$chrootx86" "$rodir" - mount -t overlayfs -o lowerdir="$rodir",upperdir="$rwdir" overlayfs "$overlaydir" + if [[ "$(uname -r | cut -d - -f1)" = "3.14.0" ]] ; then + mount -t overlayfs -o lowerdir="$rodir",upperdir="$rwdir" overlayfs "$overlaydir" + elif [[ "(uname -r | cut -d - -f1)" = "4.1.0" ]] ; then + mount -t overlay -o lowerdir="$rodir",upperdir="$rwdir",workdir="$workdir" overlay "$overlaydir" + fi while : true ; do if [[ ! -d packages ]] ; then mkdir packages |