diff --git a/bin/build.sh b/bin/build.sh index 40b36fd..76ff90e 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -74,7 +74,7 @@ do fi done -source ${BASEDOR/}lib/00-depcheck.func.sh +source ${BASEDIR}/lib/00-depcheck.func.sh if [ ! -f "./BUILDNO" ]; then @@ -114,13 +114,15 @@ EOF ## FUNCTIONS ## #source ${BASEDIR}/lib/00-depcheck.func.sh ## this should be called like, VERYYYY first thing, right after sanity/safety checks and such. -#source ${BASEDIR}/lib/01-mk.chroot.func.sh ## this is called automatically and only if no chroot exists +source ${BASEDIR}/lib/01-mk.chroot.func.sh ## this is called automatically and only if no chroot exists source ${BASEDIR}/lib/02-holla_atcha_boi.func.sh source ${BASEDIR}/lib/03-release_me.func.sh source ${BASEDIR}/lib/04-facehugger.func.sh source ${BASEDIR}/lib/05-chroot_wrapper.func.sh source ${BASEDIR}/lib/06-jenny_craig.func.sh -source ${BASEDIR}/lib/07-centos_is_stupid.func.sh +if [[ "${HOST_DIST}" == "CentOS" || "${HOST_DIST}" == "RHEL" ]]; + source ${BASEDIR}/lib/07-centos_is_stupid.func.sh +fi source ${BASEDIR}/lib/08-will_it_blend.func.sh source ${BASEDIR}/lib/09-stuffy.func.sh source ${BASEDIR}/lib/10-yo_dj.func.sh @@ -141,7 +143,9 @@ if [[ -f "${CHROOTDIR}root.x86_64/root/chroot" || -f "${CHROOTDIR}root.i686/root then chroot_wrapper 64 chroot_wrapper 32 - centos_is_stupid + if [[ "${HOST_DIST}" == "CentOS" || "${HOST_DIST}" == "RHEL" ]]; + centos_is_stupid + fi will_it_blend 64 will_it_blend 32 yo_dj @@ -150,7 +154,9 @@ fi if [[ ${1} == "update" ]]; then mentos - centos_is_stupid + if [[ "${HOST_DIST}" == "CentOS" || "${HOST_DIST}" == "RHEL" ]]; + centos_is_stupid + fi will_it_blend 32 will_it_blend 64 yo_dj @@ -166,7 +172,7 @@ then fi # or are we just building? -if [[ ${1} == "build" ]] || [ -z ${1} ] || [[ ${1} == "all" ]]; +if [[ ${1} == "build" || -z ${1} || ${1} == "all" ]]; then if [[ "${MULTIARCH}" == "y" ]]; then diff --git a/lib/07-centos_is_stupid.func.sh b/lib/07-centos_is_stupid.func.sh index 763ca9a..c26790d 100644 --- a/lib/07-centos_is_stupid.func.sh +++ b/lib/07-centos_is_stupid.func.sh @@ -2,72 +2,23 @@ function centos_is_stupid { FUNCNAME="centos_is_stupid" - echo "Checking for appropriate kernel version and mksquashfs version..." - SQFS_VER=$(mksquashfs -version 2>&1 | head -n1 | awk '{print $3}' | sed -re 's/(^[0-9]*\.[0-9]*).*$/\1/g') - KERN_VER=$(uname -r | cut -f1 -d"-") - SQUASH_OPTS="-noappend -comp xz" - - set +e - ver_check() { - [ "$1" == "$2" ] && return 10 - ver1front=`echo $1 | cut -d "." -f -1` - ver1back=`echo $1 | cut -d "." -f 2-` - ver2front=`echo $2 | cut -d "." -f -1` - ver2back=`echo $2 | cut -d "." -f 2-` - if [ "$ver1front" != "$1" ] || [ "$ver2front" != "$2" ]; then - [ "$ver1front" -gt "$ver2front" ] && return 11 - [ "$ver1front" -lt "$ver2front" ] && return 9 - [ "$ver1front" == "$1" ] || [ -z "$ver1back" ] && ver1back=0 - [ "$ver2front" == "$2" ] || [ -z "$ver2back" ] && ver2back=0 - ver_check "$ver1back" "$ver2back" - return $? - else - [ "$1" -gt "$2" ] && return 11 || return 9 - fi - } - ver_check ${KERN_VER} "2.6.38" - KERNTEST=${?} - ver_check ${SQFS_VER} "4.2" - SQFSTEST=${?} - if [ ${KERNTEST} -lt "10" ]; + rpm -qa | egrep "^xorriso-[0-9]" > /dev/null 2>&1 + if [[ "${?}" != "0" ]]; then - echo "You need a newer kernel to even think about doing this. (>= 2.6.38)" - echo "If you're on CentOS, there are 3.x branches available via the elrepo repository." - echo "I recommend the 'kernel-lt' package from there." - echo "Bailing out." - exit 1 - #elif [ ${SQFS_VER} -ge "4.2" ] && [ ${KERN_VER} -ge "2.6.38" ]; - elif [ ${SQFSTEST} -ge "10" ] && [ ${KERNTEST} -ge "10" ]; - then - #echo "Awesome; your mksquashfs (if found) is not less than v4.2." - SQUASH_CMD=$(which mksquashfs) - if [ ${?} != "0" ]; + # Download/install the proper xorriso + EL_VER="$(rpm -qa coreutils | sed -re 's/^coreutils-[0-9.-]*el([0-9])*.*$/\1/g')" + if (("${EL_VER}" < "7")); then - echo "...Except you need to install whatever package you need to for mksquashfs." + echo "Wow. Your CentOS/RHEL is too old. Sorry; this is only supported on CentOS/RHEL 7 and up." exit 1 - else - SQUASH_CMD=$(which mksquashfs) - fi - elif [ ${SQFSTEST} -lt "10" ] && [ ${KERNTEST} -ge "10" ]; - then - if [ ! -f ${SRCDIR}/squashfs4.2/squashfs-tools/mksquashfs ]; - then - echo "Boy howdy. We need to compile a custom version of the squashfs-tools because you aren't running a version that supports XZ. Give me a second." - set -e - mkdir -p ${SRCDIR} ${BASEDIR}/bin - cd ${SRCDIR} - #wget --quiet -O squashfs4.2.tar.gz "http://downloads.sourceforge.net/project/squashfs/squashfs/squashfs4.2/squashfs4.2.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fsquashfs%2Ffiles%2F&ts=1387047818&use_mirror=hivelocity" - curl -o squashfs4.2.tar.gz "http://downloads.sourceforge.net/project/squashfs/squashfs/squashfs4.2/squashfs4.2.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fsquashfs%2Ffiles%2F&ts=1387047818&use_mirror=hivelocity" >> "${LOGFILE}.${FUNCNAME}" 2>&1 - tar -zxf squashfs4.2.tar.gz - cd squashfs4.2/squashfs-tools - make clean - sed -i -e 's/^#\(XZ_SUPPORT\)/\1/g' Makefile - make - SQUASH_CMD="${SRCDIR}/squashfs4.2/squashfs-tools/mksquashfs" - else - echo "Using custom-compiled mksquashfs from an earlier run." - SQUASH_CMD="${SRCDIR}/squashfs4.2/squashfs-tools/mksquashfs" fi + XORRISO_RPM=$(curl -s http://pkgs.repoforge.org/xorriso/ | egrep "\"xorriso-[0-9.-]*el${EL_VER}.rf.x86_64.rpm\"" | sed -re "s/^.*\"(xorriso[0-9.-]*el${EL_VER}.rf.x86_64.rpm).*$/\1/g") + echo "Since you're using either CentOS or RHEL, we need to install xorriso directly from an RPM. Please wait while we do this..." + curl -sLo /tmp/${XORRISO_RPM} http://pkgs.repoforge.org/xorriso/${XORRISO_RPM} + yum -y install /tmp/${XORRISO_RPM} >> "${LOGFILE}.${FUNCNAME}" 2>&1 + echo "Done." + echo fi - set -e + # We used to fetch and compile mksquashfs from source here, but no longer- because a new enough version is *finally* in CentOS repos as of CentOS 7. + } diff --git a/lib/prereqs/Arch/pkgs b/lib/prereqs/Arch/pkgs index cbaf88f..dcc369e 100644 --- a/lib/prereqs/Arch/pkgs +++ b/lib/prereqs/Arch/pkgs @@ -6,6 +6,7 @@ git libisoburn lynx make +mtools patch perl rsync diff --git a/lib/prereqs/CentOS/meta b/lib/prereqs/CentOS/meta index 660c2d6..03fb02a 100644 --- a/lib/prereqs/CentOS/meta +++ b/lib/prereqs/CentOS/meta @@ -5,3 +5,5 @@ PKG_MGR='yum -y install ${pkgname}' PRE_RUN='none' PKG_CHK='rpm -q ${pkgname} | egrep "^${pkgname}-[0-9]"' URL='http://centos.org/' +# NOTE: we handle installing of squashfs-tools (maybe) and xorriso in centos_is_stupid function. +# because they *suck*. Seriously. I need to install tk just to install xorriso. I mean, what? diff --git a/lib/prereqs/Debian/pkgs b/lib/prereqs/Debian/pkgs index 286e17b..5dccfb9 100644 --- a/lib/prereqs/Debian/pkgs +++ b/lib/prereqs/Debian/pkgs @@ -1,6 +1,6 @@ -git curl dosfstools +git libisoburn1 lynx rsync diff --git a/lib/prereqs/Fedora/pkgs b/lib/prereqs/Fedora/pkgs index 8af1b50..0691c4e 100644 --- a/lib/prereqs/Fedora/pkgs +++ b/lib/prereqs/Fedora/pkgs @@ -1,5 +1,5 @@ -git curl +git libisofs lynx rsync diff --git a/lib/prereqs/RHEL/pkgs b/lib/prereqs/RHEL/pkgs index 8af1b50..3cc03ac 100644 --- a/lib/prereqs/RHEL/pkgs +++ b/lib/prereqs/RHEL/pkgs @@ -1,9 +1,19 @@ -git +binutils +binutils-devel curl +gcc +git libisofs lynx +make +patch +perl rsync sed squashfs-tools -xorriso +syslinux +syslinux-devel xz +xz-devel +zlib +zlib-devel diff --git a/lib/prereqs/Ubuntu/pkgs b/lib/prereqs/Ubuntu/pkgs index 286e17b..5dccfb9 100644 --- a/lib/prereqs/Ubuntu/pkgs +++ b/lib/prereqs/Ubuntu/pkgs @@ -1,6 +1,6 @@ -git curl dosfstools +git libisoburn1 lynx rsync