From 7fb6e77c3288f264919a3b8f165461e001acff95 Mon Sep 17 00:00:00 2001 From: r00t Date: Wed, 15 Jul 2015 03:26:34 -0400 Subject: [PATCH] more work done... still 100% untested, and i need to finish the package lists, but i have a testing platform built for all the distros. --- LICENSE | 1 + TODO | 4 +++- .../lib/initcpio/install/archiso_http_custom | 3 +++ lib/00-depcheck.func.sh | 5 +++++ lib/02-holla_atcha_boi.func.sh | 2 ++ lib/03-release_me.func.sh | 3 +++ lib/04-facehugger.func.sh | 3 +++ lib/05-chroot_wrapper.func.sh | 3 +++ lib/06-jenny_craig.func.sh | 3 +++ lib/07-centos_is_stupid.func.sh | 3 +++ lib/08-will_it_blend.func.sh | 3 +++ lib/09-stuffy.func.sh | 2 ++ lib/10-yo_dj.func.sh | 3 +++ lib/11-mentos.func.sh | 3 +++ lib/prereqs/Antergos/meta | 4 ++-- lib/prereqs/Antergos/pkgs | 1 + lib/prereqs/Arch/meta | 4 ++-- lib/prereqs/Arch/pkgs | 17 +++++++++++++++++ lib/prereqs/CentOS/pkgs | 1 + lib/prereqs/Debian/meta | 5 ++--- lib/prereqs/Debian/pkgs | 10 ++++++++++ lib/prereqs/Devuan/meta | 7 +++++++ lib/prereqs/Devuan/pkgs | 1 + lib/prereqs/Fedora/pkgs | 9 +++++++++ lib/prereqs/HUMAN | 2 +- lib/prereqs/Manjaro/meta | 4 ++-- lib/prereqs/Manjaro/pkgs | 1 + lib/prereqs/Mint/pkgs | 1 + lib/prereqs/RHEL/pkgs | 9 +++++++++ lib/prereqs/SUSE/meta | 8 ++++---- lib/prereqs/SUSE/pkgs | 1 + lib/prereqs/Ubuntu/pkgs | 10 ++++++++++ lib/prereqs/iso.pkgs.lst | 1 + lib/prereqs/openSUSE/meta | 9 +++++---- 34 files changed, 127 insertions(+), 19 deletions(-) create mode 120000 LICENSE mode change 100644 => 120000 lib/prereqs/Antergos/pkgs mode change 100644 => 120000 lib/prereqs/CentOS/pkgs create mode 100644 lib/prereqs/Devuan/meta create mode 120000 lib/prereqs/Devuan/pkgs mode change 100644 => 120000 lib/prereqs/Manjaro/pkgs mode change 100644 => 120000 lib/prereqs/Mint/pkgs mode change 100644 => 120000 lib/prereqs/SUSE/pkgs create mode 100644 lib/prereqs/iso.pkgs.lst diff --git a/LICENSE b/LICENSE new file mode 120000 index 0000000..d24842f --- /dev/null +++ b/LICENSE @@ -0,0 +1 @@ +COPYING \ No newline at end of file diff --git a/TODO b/TODO index c25be20..48f3320 100644 --- a/TODO +++ b/TODO @@ -38,7 +38,9 @@ -X-platform --what distros are supported? --automatically install what we need for buildtime ---hardcode list of runtime dependencies (e.g. openssh, vim, etc.) +---need to finish pkg lists and then test, but meta files should be done as well as lib script +--hardcode list of runtime (e.g. live media) dependencies (e.g. openssh, vim, etc.) +--...and create separate list for after-the-fact e.g. goodies ## Split into Separate Tools CD ## diff --git a/extra/pre-build.d/usr/lib/initcpio/install/archiso_http_custom b/extra/pre-build.d/usr/lib/initcpio/install/archiso_http_custom index 4e02f98..894892a 100644 --- a/extra/pre-build.d/usr/lib/initcpio/install/archiso_http_custom +++ b/extra/pre-build.d/usr/lib/initcpio/install/archiso_http_custom @@ -4,6 +4,9 @@ build() { add_runscript add_binary curl + + add_full_dir /etc/ssl + add_full_dir /etc/ca-certificates } help() { diff --git a/lib/00-depcheck.func.sh b/lib/00-depcheck.func.sh index 079dc3f..bc4155f 100755 --- a/lib/00-depcheck.func.sh +++ b/lib/00-depcheck.func.sh @@ -2,6 +2,8 @@ function so_check_me_out { + FUNCNAME="depcheck" + if [[ -n ${HOST_DIST} ]]; then if [[ ! -f ${BASEDIR}/lib/prereqs/${HOST_DIST}/meta || ! -f ${BASEDIR}/lib/prereqs/${HOST_DIST}/pkgs ]]; @@ -43,6 +45,9 @@ function so_check_me_out { META="${DISTRO_DIR}/meta" PKGLIST="${DISTRO_DIR}/pkgs" + # And once more, just to be safe. + source ${META} + if [[ "${PRE_RUN}" != 'none' ]]; then echo "Now updating your local package cache..." diff --git a/lib/02-holla_atcha_boi.func.sh b/lib/02-holla_atcha_boi.func.sh index 2c9d02d..0acca19 100644 --- a/lib/02-holla_atcha_boi.func.sh +++ b/lib/02-holla_atcha_boi.func.sh @@ -1,5 +1,7 @@ function holla_atcha_boi { + FUNCNAME="holla_atcha_boi" + if [[ "${I_AM_A_RACECAR}" == "y" ]]; then RACECAR_CHK='nice -n -19 ' diff --git a/lib/03-release_me.func.sh b/lib/03-release_me.func.sh index ae3dafb..f693f0c 100644 --- a/lib/03-release_me.func.sh +++ b/lib/03-release_me.func.sh @@ -1,4 +1,7 @@ function release_me () { + + FUNCNAME="release_me" + ## check for mountpoints from a manual chroot and umount them if they're still mounted. ## NOTE: you can use findmnt(8) to view a tree of mountpoints, including bindmounts etc. # Is there an active chroot? diff --git a/lib/04-facehugger.func.sh b/lib/04-facehugger.func.sh index c906d0b..c35b813 100644 --- a/lib/04-facehugger.func.sh +++ b/lib/04-facehugger.func.sh @@ -1,4 +1,7 @@ function facehugger () { + + FUNCNAME="facehugger" + local ARCHSUFFIX="${1}" if [[ "${1}" == "64" ]]; then diff --git a/lib/05-chroot_wrapper.func.sh b/lib/05-chroot_wrapper.func.sh index a36a208..b8c0069 100644 --- a/lib/05-chroot_wrapper.func.sh +++ b/lib/05-chroot_wrapper.func.sh @@ -1,4 +1,7 @@ function chroot_wrapper () { + + FUNCNAME="chroot_wrapper" + local ARCHSUFFIX="${1}" if [[ "${1}" == "64" ]]; then diff --git a/lib/06-jenny_craig.func.sh b/lib/06-jenny_craig.func.sh index 2e7d50d..e7023c1 100644 --- a/lib/06-jenny_craig.func.sh +++ b/lib/06-jenny_craig.func.sh @@ -1,4 +1,7 @@ function jenny_craig () { + + FUNCNAME="jenny_craig" + BUILDDIR="${BUILDDIR_GLOB}" if [[ "${1}" == "64" ]]; then diff --git a/lib/07-centos_is_stupid.func.sh b/lib/07-centos_is_stupid.func.sh index ad0c4dd..763ca9a 100644 --- a/lib/07-centos_is_stupid.func.sh +++ b/lib/07-centos_is_stupid.func.sh @@ -1,4 +1,7 @@ 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"-") diff --git a/lib/08-will_it_blend.func.sh b/lib/08-will_it_blend.func.sh index 680feb4..97531a5 100644 --- a/lib/08-will_it_blend.func.sh +++ b/lib/08-will_it_blend.func.sh @@ -1,4 +1,7 @@ function will_it_blend () { + + FUNCNAME="will_it_blend" + local ARCHSUFFIX="${1}" if [[ "${1}" == "64" ]]; then diff --git a/lib/09-stuffy.func.sh b/lib/09-stuffy.func.sh index 98f1607..2935707 100644 --- a/lib/09-stuffy.func.sh +++ b/lib/09-stuffy.func.sh @@ -1,5 +1,7 @@ function stuffy { + FUNCNAME="stuffy" + cp -f ${BASEDIR}/VERSION_INFO.txt ${TEMPDIR}/. if [[ "${I_AM_A_RACECAR}" == "y" ]]; diff --git a/lib/10-yo_dj.func.sh b/lib/10-yo_dj.func.sh index 05ddcdd..9dbac8b 100644 --- a/lib/10-yo_dj.func.sh +++ b/lib/10-yo_dj.func.sh @@ -1,4 +1,7 @@ function yo_dj () { + + FUNCNAME="yo_dj" + ARCH="${1}" echo "Building the actual .iso image. This may take a while." #im_batman ## WHYTF IS THIS HERE?! diff --git a/lib/11-mentos.func.sh b/lib/11-mentos.func.sh index 95e7a32..8d979ba 100644 --- a/lib/11-mentos.func.sh +++ b/lib/11-mentos.func.sh @@ -1,4 +1,7 @@ function mentos { + + FUNCNAME="mentos" + # Freshen up the chroots to git's HEAD. Package lists, overlay, etc. sed -i -e '/base-devel/d ; /multilib-devel/d' ${BASEDIR}/extra/packages.* # both diff --git a/lib/prereqs/Antergos/meta b/lib/prereqs/Antergos/meta index d4cfc84..d6e27a0 100644 --- a/lib/prereqs/Antergos/meta +++ b/lib/prereqs/Antergos/meta @@ -1,7 +1,7 @@ NAME='Antergos' SUPPORTED='yes' -CHECK_METHOD='egrep "^NAME=\"Antergos Linux\"" /etc/os-release' -PKG_MGR='pacman --noconfirm -S ${pkgname}' +CHECK_METHOD='egrep "^NAME=\"Antergos Linux\"$" /etc/os-release' +PKG_MGR='pacman -S --needed --noconfirm ${pkgname}' PRE_RUN='pacman -Syyy' PKG_CHK='pacman -Q ${pkgname}' URL='http://antergos.com/' diff --git a/lib/prereqs/Antergos/pkgs b/lib/prereqs/Antergos/pkgs deleted file mode 100644 index e69de29..0000000 diff --git a/lib/prereqs/Antergos/pkgs b/lib/prereqs/Antergos/pkgs new file mode 120000 index 0000000..ca6fc0a --- /dev/null +++ b/lib/prereqs/Antergos/pkgs @@ -0,0 +1 @@ +../Arch/pkgs \ No newline at end of file diff --git a/lib/prereqs/Arch/meta b/lib/prereqs/Arch/meta index 1efef4e..7c0295c 100644 --- a/lib/prereqs/Arch/meta +++ b/lib/prereqs/Arch/meta @@ -1,7 +1,7 @@ NAME='Arch' SUPPORTED='yes' -CHECK_METHOD='egrep "^NAME=\"Arch Linux\"" /etc/os-release' -PKG_MGR='pacman --noconfirm -S ${pkgname}' +CHECK_METHOD='egrep "^NAME=\"Arch Linux\"$" /etc/os-release' +PKG_MGR='pacman -S --needed --noconfirm ${pkgname}' PRE_RUN='pacman -Syyy' PKG_CHK='pacman -Q ${pkgname}' URL='https://www.archlinux.org/' diff --git a/lib/prereqs/Arch/pkgs b/lib/prereqs/Arch/pkgs index e69de29..cbaf88f 100644 --- a/lib/prereqs/Arch/pkgs +++ b/lib/prereqs/Arch/pkgs @@ -0,0 +1,17 @@ +binutils +curl +gcc-libs-multilib +gcc-multilib +git +libisoburn +lynx +make +patch +perl +rsync +sed +squashfs-tools +syslinux +xorriso +xz +zlib diff --git a/lib/prereqs/CentOS/pkgs b/lib/prereqs/CentOS/pkgs deleted file mode 100644 index e69de29..0000000 diff --git a/lib/prereqs/CentOS/pkgs b/lib/prereqs/CentOS/pkgs new file mode 120000 index 0000000..d06549d --- /dev/null +++ b/lib/prereqs/CentOS/pkgs @@ -0,0 +1 @@ +../RHEL/pkgs \ No newline at end of file diff --git a/lib/prereqs/Debian/meta b/lib/prereqs/Debian/meta index 8002207..71fc285 100644 --- a/lib/prereqs/Debian/meta +++ b/lib/prereqs/Debian/meta @@ -1,8 +1,7 @@ NAME='Debian' SUPPORTED='yes' -CHECK_METHOD='egrep "^[0-9.]*$" /etc/debian_version' -CHECK_METHOD='egrep "^NAME=\"Debian\ GNU/Linux\"" /etc/os-release' +CHECK_METHOD='egrep "^NAME=\"Debian\ GNU/Linux\"$" /etc/os-release' PKG_MGR='apt-get -y install ${pkgname}' PRE_RUN='apt-get update' -PKG_CHK='dpkg-query -l ${pkgname}' +PKG_CHK='dpkg-query -l ${pkgname} | egrep "^ii[[:space:]]*${pkgname}"' URL='http://www.debian.org/' diff --git a/lib/prereqs/Debian/pkgs b/lib/prereqs/Debian/pkgs index e69de29..286e17b 100644 --- a/lib/prereqs/Debian/pkgs +++ b/lib/prereqs/Debian/pkgs @@ -0,0 +1,10 @@ +git +curl +dosfstools +libisoburn1 +lynx +rsync +sed +squashfs-tools +xorriso +xz-utils diff --git a/lib/prereqs/Devuan/meta b/lib/prereqs/Devuan/meta new file mode 100644 index 0000000..cd36c19 --- /dev/null +++ b/lib/prereqs/Devuan/meta @@ -0,0 +1,7 @@ +NAME='Devuan' +SUPPORTED='yes' +CHECK_METHOD='egrep "^NAME=\"Devuan\ GNU/Linux\"$" /etc/os-release' +PKG_MGR='apt-get -y install ${pkgname}' +PRE_RUN='apt-get update' +PKG_CHK='dpkg-query -l ${pkgname} | egrep "^ii[[:space:]]*${pkgname}"' +URL='http://www.debian.org/' diff --git a/lib/prereqs/Devuan/pkgs b/lib/prereqs/Devuan/pkgs new file mode 120000 index 0000000..6feb3de --- /dev/null +++ b/lib/prereqs/Devuan/pkgs @@ -0,0 +1 @@ +../Debian/pkgs \ No newline at end of file diff --git a/lib/prereqs/Fedora/pkgs b/lib/prereqs/Fedora/pkgs index e69de29..8af1b50 100644 --- a/lib/prereqs/Fedora/pkgs +++ b/lib/prereqs/Fedora/pkgs @@ -0,0 +1,9 @@ +git +curl +libisofs +lynx +rsync +sed +squashfs-tools +xorriso +xz diff --git a/lib/prereqs/HUMAN b/lib/prereqs/HUMAN index c852969..a78c9d7 100644 --- a/lib/prereqs/HUMAN +++ b/lib/prereqs/HUMAN @@ -1,4 +1,4 @@ -This directory is used to enable cross-distro support. A list of packages is needed for the *host* to build the ISO. Adding distro support is easy; there simply needs to be the following added: +This directory is used to enable cross-distro support and set baseline ISO packages needed for it to boot. A list of packages is needed for the *host* to build the ISO as well, which you'll find detailed below. Adding distro support is easy; there simply needs to be the following added: /lib/prereqs//{meta,pkgs} diff --git a/lib/prereqs/Manjaro/meta b/lib/prereqs/Manjaro/meta index 1ab4a60..3bd7fde 100644 --- a/lib/prereqs/Manjaro/meta +++ b/lib/prereqs/Manjaro/meta @@ -1,7 +1,7 @@ NAME='Manjaro' SUPPORTED='yes' -CHECK_METHOD='egrep "^NAME=\"Manjaro Linux\"" /etc/os-release' -PKG_MGR='pacman --noconfirm -S ${pkgname}' +CHECK_METHOD='egrep "^NAME=\"Manjaro Linux\"$" /etc/os-release' +PKG_MGR='pacman -S --needed --noconfirm ${pkgname}' PRE_RUN='pacman -Syyyu' PKG_CHK='pacman -Q ${pkgname}' URL='https://manjaro.org/' diff --git a/lib/prereqs/Manjaro/pkgs b/lib/prereqs/Manjaro/pkgs deleted file mode 100644 index e69de29..0000000 diff --git a/lib/prereqs/Manjaro/pkgs b/lib/prereqs/Manjaro/pkgs new file mode 120000 index 0000000..ca6fc0a --- /dev/null +++ b/lib/prereqs/Manjaro/pkgs @@ -0,0 +1 @@ +../Arch/pkgs \ No newline at end of file diff --git a/lib/prereqs/Mint/pkgs b/lib/prereqs/Mint/pkgs deleted file mode 100644 index e69de29..0000000 diff --git a/lib/prereqs/Mint/pkgs b/lib/prereqs/Mint/pkgs new file mode 120000 index 0000000..518a5f2 --- /dev/null +++ b/lib/prereqs/Mint/pkgs @@ -0,0 +1 @@ +../Ubuntu/pkgs \ No newline at end of file diff --git a/lib/prereqs/RHEL/pkgs b/lib/prereqs/RHEL/pkgs index e69de29..8af1b50 100644 --- a/lib/prereqs/RHEL/pkgs +++ b/lib/prereqs/RHEL/pkgs @@ -0,0 +1,9 @@ +git +curl +libisofs +lynx +rsync +sed +squashfs-tools +xorriso +xz diff --git a/lib/prereqs/SUSE/meta b/lib/prereqs/SUSE/meta index 9f5fa5a..6c2ae1b 100644 --- a/lib/prereqs/SUSE/meta +++ b/lib/prereqs/SUSE/meta @@ -1,8 +1,8 @@ NAME='SUSE' -SUPPORTED= +SUPPORTED='yes' # Both SLED and SLES. We can probably safely combine them. -CHECK_METHOD='egrep "^NAME=\"SLE(D|S)\"" /etc/os-release' -PKG_MGR='zypper install -l ${pkgname}' -PRE_RUN='none' +CHECK_METHOD='egrep "^NAME=\"SLE(D|S)\"$" /etc/os-release' +PKG_MGR='zypper install --no-confirm -l ${pkgname}' +PRE_RUN='zypper refresh' PKG_CHK='rpm -q ${pkgname} | egrep "^${pkgname}-[0-9]"' URL='https://www.suse.com/' diff --git a/lib/prereqs/SUSE/pkgs b/lib/prereqs/SUSE/pkgs deleted file mode 100644 index e69de29..0000000 diff --git a/lib/prereqs/SUSE/pkgs b/lib/prereqs/SUSE/pkgs new file mode 120000 index 0000000..eef28bc --- /dev/null +++ b/lib/prereqs/SUSE/pkgs @@ -0,0 +1 @@ +../openSUSE/pkgs \ No newline at end of file diff --git a/lib/prereqs/Ubuntu/pkgs b/lib/prereqs/Ubuntu/pkgs index e69de29..286e17b 100644 --- a/lib/prereqs/Ubuntu/pkgs +++ b/lib/prereqs/Ubuntu/pkgs @@ -0,0 +1,10 @@ +git +curl +dosfstools +libisoburn1 +lynx +rsync +sed +squashfs-tools +xorriso +xz-utils diff --git a/lib/prereqs/iso.pkgs.lst b/lib/prereqs/iso.pkgs.lst new file mode 100644 index 0000000..7c06411 --- /dev/null +++ b/lib/prereqs/iso.pkgs.lst @@ -0,0 +1 @@ +syslinux diff --git a/lib/prereqs/openSUSE/meta b/lib/prereqs/openSUSE/meta index 1bef9b1..0966de3 100644 --- a/lib/prereqs/openSUSE/meta +++ b/lib/prereqs/openSUSE/meta @@ -1,7 +1,8 @@ NAME='openSUSE' SUPPORTED='yes' -CHECK_METHOD='' -PKG_MGR='' -PRE_RUN='' -PKG_CHK='' +# Default doesn't have the quotes around the value, but I have a feeling that's a bug that will get "fixed" soon. +CHECK_METHOD='egrep "^NAME=\"?openSUSE\"?$" /etc/os-release' +PKG_MGR='zypper install --no-confirm -l ${pkgname}' +PRE_RUN='zypper refresh' +PKG_CHK='rpm -q ${pkgname} | egrep "^${pkgname}-[0-9]"' URL='https://www.opensuse.org/'