2021-09-10 20:37:36 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# created by Tobias Powalowski <tpowa@archlinux.org>
|
|
|
|
|
|
|
|
_BASENAME="$(basename "${0}")"
|
|
|
|
usage () {
|
2021-09-10 22:13:26 +02:00
|
|
|
echo "${_BASENAME}:"
|
2021-09-10 20:37:36 +02:00
|
|
|
echo "CREATE ARCHBOOT RELEASE IMAGE"
|
|
|
|
echo "-----------------------------"
|
|
|
|
echo "Usage: ${_BASENAME} <directory>"
|
2021-09-10 22:13:26 +02:00
|
|
|
echo "This will create an archboot release image in <directory>."
|
2021-09-10 20:37:36 +02:00
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
|
|
|
[[ -z "${1}" ]] && usage
|
|
|
|
|
|
|
|
### check for root
|
|
|
|
if ! [[ ${UID} -eq 0 ]]; then
|
|
|
|
echo "ERROR: Please run as root user!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
mkdir -p $1
|
|
|
|
cd $1
|
2021-09-11 10:26:04 +02:00
|
|
|
# create container
|
2021-09-10 22:14:54 +02:00
|
|
|
archboot-create-container.sh archboot-release
|
2021-09-11 10:26:04 +02:00
|
|
|
# generate tarball in container
|
2021-09-10 22:14:54 +02:00
|
|
|
systemd-nspawn -D archboot-release archboot-x86_64-iso.sh -t -i=archrelease
|
2021-09-11 10:26:04 +02:00
|
|
|
# generate iso in container
|
2021-09-10 22:13:26 +02:00
|
|
|
systemd-nspawn -D archboot-release archboot-x86_64-iso.sh -g -T=archrelease.tar
|
2021-09-11 10:26:04 +02:00
|
|
|
# move iso out of container
|
2021-09-10 22:13:26 +02:00
|
|
|
mv archboot-release/*.iso ./
|
2021-09-11 10:26:04 +02:00
|
|
|
# create boot directory with ramdisks
|
|
|
|
mkdir boot
|
2021-09-17 10:43:00 +02:00
|
|
|
mkdir -p boot/licenses/amd-ucode
|
|
|
|
mkdir -p boot/licenses/intel-ucode
|
2021-09-11 10:26:04 +02:00
|
|
|
isoinfo -R -i *.iso -x /boot/amd-ucode.img > boot/amd-ucode.img
|
|
|
|
isoinfo -R -i *.iso -x /boot/intel-ucode.img > boot/intel-ucode.img
|
2021-09-13 16:18:46 +02:00
|
|
|
isoinfo -R -i *.iso -x /boot/initramfs_x86_64.img > boot/initramfs_archboot_x86_64.img
|
|
|
|
isoinfo -R -i *.iso -x /boot/vmlinuz_x86_64 > boot/vmlinuz_archboot_x86_64
|
2021-09-17 10:43:00 +02:00
|
|
|
cp /usr/share/licenses/amd-ucode/* boot/licenses/amd-ucode/
|
|
|
|
cp /usr/share/licenses/intel-ucode/* boot/licenses/intel-ucode/
|
2021-09-11 10:26:04 +02:00
|
|
|
# create torrent file
|
|
|
|
archboot-mktorrent.sh archboot/$1 *.iso
|
|
|
|
# create sha256sums
|
|
|
|
sha256sum boot/* >> boot/sha256sum.txt
|
|
|
|
sha256sum * >> sha256sum.txt
|
|
|
|
# remove container
|
|
|
|
rm -r archboot-release
|