Merge pull request #6 from crystal-linux/development

Add bootstrap build files
main
axtloss 2 years ago committed by GitHub
commit 8f52c83077
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -23,7 +23,10 @@ jobs:
git clone https://github.com/crystal-linux/iso/
cd iso
bash build_iso.sh
md5sum *.iso > MD5SUMS
md5sum *.iso > MD5SUM-iso
rm chrooted.sh
bash build_rootfs.sh
md5sum *.tar.gz > MD5SUM-rootfs
- name: Get current date
@ -33,7 +36,7 @@ jobs:
- name: Upload
uses: ncipollo/release-action@v1
with:
artifacts: "iso/*.iso,iso/MD5SUMS"
artifacts: "iso/*.iso,iso/MD5SUM-iso,iso/*.tar.gz,iso/MD5SUM-rootfs"
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.date.outputs.date }}

2
.gitignore vendored

@ -1,3 +1,5 @@
*.iso
*.tar.gz
crystal/airootfs/etc/pacman.conf
crystal/airootfs/etc/buildstamp
chrooted.sh

@ -29,10 +29,8 @@
You will have to use Arch or Arch-Based distros to build this ISO File.
* Install Dependencies
* Go to the project folder
* Run `./build_iso.sh`
* If you get an error about `/tmp/<something>` running out of space, reboot (to clear tmpfs), then re-run with a dir to use as temp (e.g. `./build_iso.sh FOOBAR`)
* If you also add a second arg as in `./build_iso.sh /some/folder testing`, you'll pull from our testing repo
* Run `./build.sh --build-iso` to build an iso image
* Or Run `./build.sh --build-bootstrap` to build a rootfs tarball
### How to build inside of Docker or Podman:
* The container **MUST** be ran as root to build.
* Other than needing to be ran as root, it should function correctly. You may need to install a few more dependencies aside from the ones listed here.

@ -0,0 +1,43 @@
#!/usr/bin/env bash
if [[ "$2" == "" ]]; then
WORKDIR=$(mktemp -d)
else
WORKDIR="$2"
if [[ ! -d "$WORKDIR" ]]; then
mkdir -p "$WORKDIR"
fi
fi
if [[ "$1" == "--build-iso" ]]; then
cp chrooted-iso.sh chrooted.sh
MKARCHISO_FLAGS="-v -w $WORKDIR -o . crystal"
rm -fv *.iso
elif [[ "$1" == "--build-bootstrap" ]]; then
cp chrooted-bootstrap.sh chrooted.sh
MKARCHISO_FLAGS="-m bootstrap -v -w $WORKDIR -o . crystal"
rm -fv *.tar.gz
else
RESULTCODE=0
if [[ "$1" == "" ]]; then
echo "no option given, available options are:"
RESULTCODE=1
elif [[ "$1" != "--help" ]]; then
echo "option '$1' not known, available options are:"
RESULTCODE=1
fi
echo "--build-iso builds a crystal linux iso"
echo "--build-bootstrap builds a crystal linux rootfs tarball"
echo "--help display this message"
exit $RESULTCODE
fi
cp crystal/pacman.conf crystal/airootfs/etc/.
echo "Built on $(date +"%D @ %T EST")" > crystal/airootfs/etc/buildstamp
time sudo ./mkarchiso $MKARCHISO_FLAGS
sudo rm -rf $WORKDIR
if [[ "$1" == "--build-iso" ]]; then
sudo chown $USER:$USER *.iso
else
sudo chown $USER:$USER *.tar.gz
fi

@ -1,20 +0,0 @@
#!/usr/bin/env bash
rm -fv *.iso
cp crystal/pacman.conf crystal/airootfs/etc/.
if [[ "$1" == "" ]]; then
WORKDIR=$(mktemp -d)
else
WORKDIR="$1"
if [[ ! -d "$WORKDIR" ]]; then
mkdir -p "$WORKDIR"
fi
fi
echo "Built on $(date +"%D @ %T EST")" > crystal/airootfs/etc/buildstamp
time sudo ./mkarchiso -v -w $WORKDIR -o . crystal
sudo rm -rf $WORKDIR
sudo chown $USER:$USER *.iso

@ -0,0 +1,19 @@
#!/usr/bin/env bash
echo "Chrooted in the new system, running as $(whoami)"
# Fix pacman config being put in / instead of /etc
mv /pacman.conf /etc/pacman.conf
# Mirrorlist
reflector > /etc/pacman.d/mirrorlist
# Hostname
echo "crystal-live" > /etc/hostname
# Locale
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf
locale-gen
echo "Configured the system. Exiting chroot."

@ -23,12 +23,17 @@ chown -R crystal:crystal /home/crystal/
# Services
systemctl enable NetworkManager
systemctl enable mirrorlist
systemctl enable gdm
# Hostname and Locale
# Mirrorlist
reflector > /etc/pacman.d/mirrorlist
# Hostname
echo "crystal-live" > /etc/hostname
# Locale
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
locale-gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf
locale-gen
echo "Configured the system. Exiting chroot."

@ -1,11 +0,0 @@
[Unit]
Description=Generates Base Crystal ISO Mirrorlist
Requires=network-online.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/bash -c "reflector > /etc/pacman.d/mirrorlist"
[Install]
WantedBy=multi-user.target

@ -0,0 +1,25 @@
# Arch packages
cowsay
curl
openbsd-netcat
openssh
pacman-contrib
reflector
tree
zsh
# Things we're hosting
base
filesystem
lsb-release
neofetch
pfetch
sudo
# Our packages
amethyst
# Text editors
micro
nano
vim

@ -37,6 +37,7 @@ ILoveCandy
# We cannot check disk space from within a chroot environment
#CheckSpace
#VerbosePkgLists
ParallelDownloads = 3
# By default, pacman accepts packages signed by keys that its local keyring
# trusts (see pacman-key and its man page), as well as unsigned packages.

Loading…
Cancel
Save