created extra script for building tarball

main
amy 3 years ago
parent 7e53ce7768
commit 78b4e437fc

2
.gitignore vendored

@ -1,6 +1,8 @@
*.iso *.iso
*.tar.gz
sysroot/ sysroot/
sysroot.* sysroot.*
crystal/pacman.conf crystal/pacman.conf
crystal/airootfs/etc/pacman.conf crystal/airootfs/etc/pacman.conf
repo/ repo/
chrooted.sh

@ -0,0 +1,59 @@
#!/usr/bin/env bash
rm -fv *.iso
if [[ "$1" == "" ]]; then
WORKDIR=$(mktemp -d)
else
WORKDIR="$1"
if [[ ! -d "$WORKDIR" ]]; then
mkdir -p "$WORKDIR"
fi
fi
if [[ "$2" == "testing" ]]; then
cp pacman.testing crystal/pacman.conf
else
cp pacman.def crystal/pacman.conf
fi
if [[ -f aur-pkgs ]]; then
if [[ ! -d repo ]]; then
mkdir repo
mkdir temp
for pkg in "$(cat aur-pkgs)"; do
pushd temp
git clone https://aur.archlinux.org/$pkg.git
pushd $pkg
makepkg -sf --skippgpcheck
cp *.pkg.tar.zst ../../repo/.
popd
popd
done
rm -rf temp/
pushd repo
repo-add aur.db.tar.gz *.pkg.tar.*
MP=$(pwd)
popd
echo >> crystal/packages.x86_64
for pkg in "$(cat aur-pkgs)"; do
echo "${pkg}" >> crystal/packages.x86_64
done
fi
echo "[aur]" >> crystal/pacman.conf
echo "SigLevel = Never" >> crystal/pacman.conf
echo "Server = file://${MP}" >> crystal/pacman.conf
fi
# idk if this would've happened automatically?
cp crystal/pacman.conf crystal/airootfs/etc/.
cp crystal/packages.x86_64 crystal/airootfs/etc/packages.x86_64
cp /etc/pacman.d/mirrorlist crystal/airootfs/etc/pacman.d/.
echo "Built on $(date +"%D @ %T EST")" > crystal/airootfs/etc/buildstamp
cp chrooted-bootstrp.sh chrooted.sh
time sudo ./mkarchiso -m bootstrap -v -w $WORKDIR -o . crystal
sudo rm -rf $WORKDIR
sudo chown $USER:$USER *.iso

@ -53,6 +53,7 @@ cp crystal/pacman.conf crystal/airootfs/etc/.
cp crystal/packages.x86_64 crystal/airootfs/etc/packages.x86_64 cp crystal/packages.x86_64 crystal/airootfs/etc/packages.x86_64
cp /etc/pacman.d/mirrorlist crystal/airootfs/etc/pacman.d/. cp /etc/pacman.d/mirrorlist crystal/airootfs/etc/pacman.d/.
echo "Built on $(date +"%D @ %T EST")" > crystal/airootfs/etc/buildstamp echo "Built on $(date +"%D @ %T EST")" > crystal/airootfs/etc/buildstamp
cp chrooted-iso.sh chrooted.sh
time sudo ./mkarchiso -v -w $WORKDIR -o . crystal time sudo ./mkarchiso -v -w $WORKDIR -o . crystal
sudo rm -rf $WORKDIR sudo rm -rf $WORKDIR
sudo chown $USER:$USER *.iso sudo chown $USER:$USER *.iso

@ -0,0 +1,33 @@
#!/bin/bash
# This file is run via mkarchiso while chrooted as the new system
echo "chrooted in the new system, running as $(whoami)"
echo "CrystalLive" > /etc/hostname
echo "sudo reflector --verbose --latest 5 --sort rate --save /etc/pacman.d/mirrorlist" >> /usr/bin/mirrorsetup
chmod +x /usr/bin/mirrorsetup
# We don't add crystal until here so that our packages which change
# /etc/skel have been installed already
useradd -m crystal
usermod -p $(echo "crystal" | openssl passwd -6 -stdin) crystal
usermod -p $(echo "crystal" | openssl passwd -6 -stdin) root
chsh -s /usr/bin/zsh crystal
cat >> /home/crystal/.zshrc << EOF
PROMPT="%n@%m %~ %# "
alias paste="nc termbin.com 9999"
clear
pfetch
EOF
echo "zsh" > /home/crystal/.bashrc
chown -R crystal:crystal /home/crystal/
systemctl enable NetworkManager
# i'm tired ok
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
locale-gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf
echo "Configured the system. Exiting chroot."

@ -1 +1 @@
Built on 10/22/21 @ 19:15:37 EST Built on 10/22/21 @ 20:50:17 EST

@ -984,6 +984,8 @@ _build_bootstrap_image() {
cd -- "${_bootstrap_parent}" cd -- "${_bootstrap_parent}"
_msg_info "Creating bootstrap image..." _msg_info "Creating bootstrap image..."
_msg_info "But before that, we're running inject.sh"
pushd ${startdir} && ./inject.sh ${pacstrap_dir} && popd
bsdtar -cf - "root.${arch}" | gzip -cn9 > "${out_dir}/${image_name}" bsdtar -cf - "root.${arch}" | gzip -cn9 > "${out_dir}/${image_name}"
_msg_info "Done!" _msg_info "Done!"
du -h -- "${out_dir}/${image_name}" du -h -- "${out_dir}/${image_name}"

Loading…
Cancel
Save