Skip to content

Instantly share code, notes, and snippets.

@unxmaal
Last active January 24, 2022 13:08
Show Gist options
  • Save unxmaal/4e697fdbc6e2a6b22ad14b9585c1f37a to your computer and use it in GitHub Desktop.
Save unxmaal/4e697fdbc6e2a6b22ad14b9585c1f37a to your computer and use it in GitHub Desktop.
#!/bin/bash
_srpms=~/rpmbuild/SRPMS
_tinybuild=~/btw/tiny_build
_gitrepo=~/sgug-rse.git
_tbgit="${_tinybuild}/sgug-rse.git"
_releasepackages="${_tbgit}/releasepackages.lst"
#setup
echo "Setup"
mkdir -p "${_tinybuild}/SRPMS"
mkdir -p "${_tinybuild}/chroot"
if [[ ! -L "${_tinybuild}/sgug-rse.git" ]] ; then
ln -s "${_gitrepo}" "${_tbgit}"
fi
_systune=$(systune allow_chroot_with_open_dirs| cut -d' ' -f4 )
if [[ $_systune -ne 2 ]] ; then
echo "As root, run 'systune allow_chroot_with_open_dirs 2' "
exit 1
fi
#fetch srpms
echo "Fetching SRPMS"
for _pkg in $(grep -v ^# "${_releasepackages}"); do
# this is a naughty glob and will bring in all the perl and python crap
# there's better ways to handle this
cp ${_srpms}/${_pkg}*.src.rpm ${_tinybuild}/SRPMS/.
done
#create minimal list
cd "${_tinybuild}"
sgug_minimal_computer -g "${_tbgit}"
if [[ -f leaveinstalled.txt ]] ; then
cut -f1 -d' ' leaveinstalled.txt > "${_tinybuild}/releasepackages.lst"
else
echo "leaveinstalled.txt missing!"
exit 1
fi
#build tinyenv
cd "${_tinybuild}"
sgug_world_builder -i "${_tinybuild}/SRPMS" \
-o "${_tinybuild}/packages" \
-g "${_tbgit}"
bash -x worldrebuilder.sh "${_tinybuild}/rpmbuild"
# initdb
sudo rpm --root="${_tinybuild}/chroot" --initd
# install base packages
for _brpm in ${_tinybuild}/packages/RPMS/*/*.rpm ; do
sudo rpm -ivh --root=${_tinybuild}/chroot $_brpm
done
@Jenna64bit
Copy link

line 50 I think should be --initdb not initd...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment