From c8637e9779e1798e103ea1ccc8f00c9f6f0e6020 Mon Sep 17 00:00:00 2001 From: r00t Date: Sun, 20 Nov 2016 01:46:01 -0500 Subject: [PATCH] temporary checkin... working on the chrooted bash script --- .gitignore | 5 ++-- extra/pre-build.d/root/pre-build.sh | 45 +++++++++++++++++++++++++---- extra/templates/VARS.txt.j2 | 8 +++++ 3 files changed, 50 insertions(+), 8 deletions(-) create mode 100644 extra/templates/VARS.txt.j2 diff --git a/.gitignore b/.gitignore index 7385ba3..cc9cac2 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ /root.i686 # We don't want the copied/stripped/compressed chroots +# might not be relevant anymore in the python rewrite /build64 /build32 @@ -15,8 +16,8 @@ /temp /TMPBOOT /tftpboot -/latest.64.tar.gz -/latest.32.tar.gz +/.latest.x86_64.tar.gz +/.latest.i686.tar.gz /lockfile.lck /VERSION_INFO.txt /BUILDNO diff --git a/extra/pre-build.d/root/pre-build.sh b/extra/pre-build.d/root/pre-build.sh index 92ac7f8..62b9bc4 100755 --- a/extra/pre-build.d/root/pre-build.sh +++ b/extra/pre-build.d/root/pre-build.sh @@ -1,5 +1,21 @@ #!/bin/bash +# Import settings. +if [[ -f /root/VARS.txt ]]; +then + source /root/VARS.txt +else + # TODO: do these defaults via the config stuff in python instead. + export DISTNAME='BDISK' + export UXNAME='bdisk' + export PNAME='BDisk' + export DISTPUB='r00t^2' + export DISTDESC='j00 got 0wnz0r3d lulz.' + export REGUSR="${UXNAME}" + export REGUSR_PASS='' + export ROOT_PASS='' +fi + # Logging! exec 3>&1 4>&2 trap 'exec 2>&4 1>&3' 0 1 2 3 @@ -41,7 +57,7 @@ pacman --noconfirm -U /root/apacman*.tar.xz &&\ mkdir /var/tmp/apacman && chmod 0750 /var/tmp/apacman &&\ chown root:aurbuild /var/tmp/apacman cleanPacorigs -apacman -S --noconfirm --noedit --skipinteg -S apacman apacman-deps apacman-utils expac +apacman -S --noconfirm --noedit --skipinteg --needed -S apacman apacman-deps apacman-utils expac apacman --gendb cleanPacorigs # Install multilib-devel if we're in an x86_64 chroot. @@ -49,15 +65,32 @@ if $(egrep -q '^\[multilib' /etc/pacman.conf); then pacman --noconfirm -R gcc-libs libtool pacman --noconfirm -S --needed multilib-devel + cleanPacorigs TGT_ARCH='x86_64' else TGT_ARCH='i686' fi # Install some stuff we need for the ISO. PKGLIST=$(sed -e '/^[[:space:]]*#/d ; /^[[:space:]]*$/d' /root/prereqs/iso.pkgs.both | tr '\n' ' ') -cleanPacorigs -apacman --noconfirm --noedit --skipinteg -S --needed ${PKGLIST} -apacman --gendb -cleanPacorigs +if [[ -n "${PKGLIST}" ]]; +then + apacman --noconfirm --noedit --skipinteg -S --needed ${PKGLIST} + apacman --gendb + cleanPacorigs +fi +# And install arch-specific packages for the ISO, if there are any. PKGLIST=$(sed -e '/^[[:space:]]*#/d ; /^[[:space:]]*$/d' /root/prereqs/iso.pkgs.${TGT_ARCH} | tr '\n' ' ') - +if [[ -n "${PKGLIST}" ]]; +then + apacman --noconfirm --noedit --skipinteg -S --needed ${PKGLIST} + apacman --gendb + cleanPacorigs +fi +# And install EXTRA functionality packages, if there are any. +PKGLIST=$(sed -e '/^[[:space:]]*#/d ; /^[[:space:]]*$/d' /root/packages.both | tr '\n' ' ') +if [[ -n "${PKGLIST}" ]]; +then + apacman --noconfirm --noedit --skipinteg -S --needed ${PKGLIST} + apacman --gendb + cleanPacorigs +fi diff --git a/extra/templates/VARS.txt.j2 b/extra/templates/VARS.txt.j2 new file mode 100644 index 0000000..678d0ce --- /dev/null +++ b/extra/templates/VARS.txt.j2 @@ -0,0 +1,8 @@ +export DISTNAME={{ bdisk['name']|upper }} +export UXNAME={{ bdisk['name']|lower }} +export PNAME={{ bdisk['name'] }} +export DISTPUB={{ bdisk['dev'] }} +export DISTDESC={{ bdisk['desc'] }} +export REGUSR={{ bdisk['name']|lower }} +export REGUSR_PASS={{ bdisk['usr_pass'] }} +export ROOT_PASS={{ bdisk['root_pass'] }}