fix release error handling

This commit is contained in:
Tobias Powalowski 2022-03-25 11:58:26 +01:00
parent d1a37b495e
commit 92624aa6e3
2 changed files with 15 additions and 6 deletions

View file

@ -27,7 +27,7 @@ kver() {
zram_mount() { zram_mount() {
modprobe zram modprobe zram
echo zstd >/sys/block/zram0/comp_algorithm echo zstd >/sys/block/zram0/comp_algorithm
echo 3G >/sys/block/zram0/disksize echo ${_DISKSIZE} >/sys/block/zram0/disksize
echo 4 >/sys/block/zram0/max_comp_streams echo 4 >/sys/block/zram0/max_comp_streams
mkfs.btrfs --mixed /dev/zram0 > /dev/tty7 2>&1 || exit 1 mkfs.btrfs --mixed /dev/zram0 > /dev/tty7 2>&1 || exit 1
mkdir "${_W_DIR}" mkdir "${_W_DIR}"
@ -132,6 +132,7 @@ if [[ "${_L_COMPLETE}" == "1" || "${_L_INSTALL_COMPLETE}" == "1" ]]; then
exit 1 exit 1
fi fi
touch /.update-installer touch /.update-installer
_DISKSIZE="3G"
zram_mount zram_mount
echo "Step 1/9: Removing not necessary files from / ..." echo "Step 1/9: Removing not necessary files from / ..."
clean_archboot clean_archboot
@ -216,6 +217,7 @@ fi
# Generate new images # Generate new images
if [[ "${_G_RELEASE}" == "1" ]]; then if [[ "${_G_RELEASE}" == "1" ]]; then
_DISKSIZE="5G"
zram_mount zram_mount
echo "Step 1/2: Removing not necessary files from / ..." echo "Step 1/2: Removing not necessary files from / ..."
clean_archboot clean_archboot

View file

@ -36,13 +36,14 @@ _create_iso() {
systemd-nspawn -D "${_W_DIR}" /bin/bash -c "pacman -Rdd lvm2 openssh --noconfirm" >/dev/null 2>&1 systemd-nspawn -D "${_W_DIR}" /bin/bash -c "pacman -Rdd lvm2 openssh --noconfirm" >/dev/null 2>&1
# generate latest tarball in container # generate latest tarball in container
echo "Generate latest ISO ..." echo "Generate latest ISO ..."
# generate local iso in container
systemd-nspawn -q -D "${_W_DIR}" /bin/bash -c "umount /tmp;archboot-${_ARCH}-iso.sh -g -p=${_PRESET_LOCAL} \
-i=archlinux-archboot-$(date +%Y.%m.%d-%H.%M)-local-${_ARCH}" || exit 1
rm -rf "${_W_DIR}"/var/cache/pacman/pkg/*
# generate latest iso in container # generate latest iso in container
systemd-nspawn -q -D "${_W_DIR}" /bin/bash -c "umount /tmp;archboot-${_ARCH}-iso.sh -g -p=${_PRESET_LATEST} \ systemd-nspawn -q -D "${_W_DIR}" /bin/bash -c "umount /tmp;archboot-${_ARCH}-iso.sh -g -p=${_PRESET_LATEST} \
-i=archlinux-archboot-$(date +%Y.%m.%d-%H.%M)-latest-${_ARCH}" || exit 1 -i=archlinux-archboot-$(date +%Y.%m.%d-%H.%M)-latest-${_ARCH}" || exit 1
echo "Generate local ISO ..." echo "Generate local ISO ..."
# generate local iso in container
systemd-nspawn -q -D "${_W_DIR}" /bin/bash -c "umount /tmp;archboot-${_ARCH}-iso.sh -g -p=${_PRESET_LOCAL} \
-i=archlinux-archboot-$(date +%Y.%m.%d-%H.%M)-local-${_ARCH}" || exit 1
# create Release.txt with included main archlinux packages # create Release.txt with included main archlinux packages
echo "Generate Release.txt ..." echo "Generate Release.txt ..."
(echo "Welcome to ARCHBOOT INSTALLATION / RESCUEBOOT SYSTEM";\ (echo "Welcome to ARCHBOOT INSTALLATION / RESCUEBOOT SYSTEM";\
@ -78,8 +79,14 @@ _create_boot() {
isoinfo -R -i "${i}" -x /"${_INITRAMFS}" 2>/dev/null > "${_INITRAMFS_LOCAL}" isoinfo -R -i "${i}" -x /"${_INITRAMFS}" 2>/dev/null > "${_INITRAMFS_LOCAL}"
fi fi
done done
[[ -d /usr/share/licenses/amd-ucode ]] && cp /usr/share/licenses/amd-ucode/* boot/licenses/amd-ucode/ if [[ -d /usr/share/licenses/amd-ucode ]]; then
[[ "${_ARCH}" == "aarch64" ]] || [[ -d /usr/share/licenses/intel-ucode ]] && cp /usr/share/licenses/intel-ucode/* boot/licenses/intel-ucode/ cp /usr/share/licenses/amd-ucode/* boot/licenses/amd-ucode/
fi
if ! [[ "${_ARCH}" == "aarch64" ]]; then
if [[ -d /usr/share/licenses/intel-ucode ]]; then
cp /usr/share/licenses/intel-ucode/* boot/licenses/intel-ucode/
fi
fi
} }
_create_cksum() { _create_cksum() {