Skip to content

Commit

Permalink
Prepare release 3.0.0, add section in .env to define additional packa…
Browse files Browse the repository at this point in the history
…ge to add and to remove
  • Loading branch information
stevleibelt committed Nov 18, 2024
1 parent 2681bd7 commit f38140c
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 21 deletions.
3 changes: 3 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ BUILD_FILE_NAME="archlinux-archzfs-${KERNEL}" #<string>
IS_DRY_RUN=0 #0|1
IS_FORCED=0 #0|1
KERNEL="linux" #linux|linux-lts
PACKAGES_TO_ADD=git,ksh,mailx,nmon
# ref: https://github.com/r-maerz/archlinux-lts-zfs/blob/main/.github/workflows/wf_build_archiso.yaml
PACKAGES_TO_REMOVE=b43-fwcutter,boardcom-wl
PATH_TO_SSH_KEY_FILE="~/.ssh/example_key" # used for uploading iso
REPO_INDEX="last" #week|month|yyyy/mm/dd
SCP_HOST_PATH="foo@bar.org:/my/path/" # used for uploading iso
Expand Down
17 changes: 14 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,35 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Added in unreleased

### Changed in unreleased

## [3.0.0](https://github.com/stevleibelt/arch-linux-live-cd-iso-with-zfs/tree/3.0.0) - tba

### Added in 3.0.0

* Added content of repository [bht](https://github.com/ezonakiusagi/bht) below `software`
* Added `compose.yml` to be able to build iso inside a privileged docker container
* Added links to openssf and badge
* Added packages mailx, ksh and nmon
* Added [SECURITY.md](SECURITY.md)
* Added script `create_efibootmgr_entry.sh` to ease up fixing lost `ZFSBootMenu` entries
* Added script `start_sshd.sh`
* Added section in `.env` to add or to remove packages
* Added support for `-l|--lts` as kernel in [upload_iso.sh](upload_iso.sh)

### Changed in unreleased
### Changed in 3.0.0

* Changed default values for [replace_zfsbootmenu.sh](source/replace_zfsbootmenu.sh)
* Default path for old ZBM is now `/mnt/efi...`
* Default path for new ZBM is now basepath of the called script
* Changed configuration file place (breaking change)
* Instead of different configuration files below `configuration`, there is now a unified `.env` file and a `.env.dist`
* Moved from build image `archlinux:latest` to `archlinux/archlinux:latest` to fix issues like [archinstal#2443](https://github.com/archlinux/archinstall/issues/2443)
* Moved archzfs mirrorlist to dedicated file `/etc/pacman.d/archzfs`

### Breaking Changes in 3.0.0

* Instead of different configuration files below `<project_root>/configuration/`, there is now a unified `.env` file and a `.env.dist`
* Migration should work by executing `cat configuration/*.sh > .env`

## [2.11.1](https://github.com/stevleibelt/arch-linux-live-cd-iso-with-zfs/tree/2.11.1) - 20231111

### Changed in 2.11.1
Expand Down
62 changes: 44 additions & 18 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ function add_files ()
exit_if_last_exit_code_is_not_zero ${?} "Creation of directory >>${PATH_TO_THE_ARCHLIVE_ROOT_USER}/software<< failed."

_echo_if_be_verbose " Adding repository >>arch-linux-configuration<< "
git clone https://github.com/stevleibelt/arch-linux-configuration "${PATH_TO_THE_ARCHLIVE_ROOT_USER}/software/arch-linux-configuration"
git clone https://github.com/stevleibelt/arch-linux-configuration "${PATH_TO_THE_ARCHLIVE_ROOT_USER}/software/arch-linux-configuration/"
exit_if_last_exit_code_is_not_zero ${?} "Checkout and creation of directory >>${PATH_TO_THE_ARCHLIVE_ROOT_USER}/software/arch-linux-configuration<< failed."

_echo_if_be_verbose " Adding repository >>arch-linux-live-cd-zfs-setup<< "
git clone https://github.com/stevleibelt/arch-linux-live-cd-zfs-setup "${PATH_TO_THE_ARCHLIVE_ROOT_USER}/software/arch-linux-live-cd-zfs-setup"
git clone https://github.com/stevleibelt/arch-linux-live-cd-zfs-setup "${PATH_TO_THE_ARCHLIVE_ROOT_USER}/software/arch-linux-live-cd-zfs-setup/"
exit_if_last_exit_code_is_not_zero ${?} "Checkout and creation of directory >>${PATH_TO_THE_ARCHLIVE_ROOT_USER}/software/arch-linux-live-cd-zfs-setup<< failed."

_echo_if_be_verbose " Adding repository >>downgrade<< "
git clone https://github.com/archlinux-downgrade/downgrade "${PATH_TO_THE_ARCHLIVE_ROOT_USER}/software/downgrade"
git clone https://github.com/archlinux-downgrade/downgrade "${PATH_TO_THE_ARCHLIVE_ROOT_USER}/software/downgrade/"
exit_if_last_exit_code_is_not_zero ${?} "Checkout and creation of directory >>${PATH_TO_THE_ARCHLIVE_ROOT_USER}/software/downgrade<< failed."

_echo_if_be_verbose " Adding directory >>zfsbootmenu<< with latest EFI file "
Expand All @@ -79,19 +79,19 @@ function add_files ()
exit_if_last_exit_code_is_not_zero ${?} "Copy of >>${PATH_TO_THIS_SCRIPT}/source/replace_zfsbootmenu.sh<< to >>${PATH_TO_THE_ARCHLIVE_ROOT_USER}/software/zfsbootmenu/<< failed."

_echo_if_be_verbose " Adding repository >>archinstall<< "
git clone https://github.com/archlinux/archinstall "${PATH_TO_THE_ARCHLIVE_ROOT_USER}/software/archinstall"
git clone https://github.com/archlinux/archinstall "${PATH_TO_THE_ARCHLIVE_ROOT_USER}/software/archinstall/"
exit_if_last_exit_code_is_not_zero ${?} "Checkout and creation of directory >>${PATH_TO_THE_ARCHLIVE_ROOT_USER}/software/archinstall<< failed."
cp "${PATH_TO_THIS_SCRIPT}/source/start_archinstall.sh" "${PATH_TO_THE_ARCHLIVE_ROOT_USER}/software/archinstall/"
exit_if_last_exit_code_is_not_zero ${?} "Copy of >>${PATH_TO_THIS_SCRIPT}/source/start_archinstall.sh<< to >>${PATH_TO_THE_ARCHLIVE_ROOT_USER}/software/archinstall/<< failed."

_echo_if_be_verbose " Adding repository >>general_howtos<< "
git clone https://github.com/stevleibelt/general_howtos "${PATH_TO_THE_ARCHLIVE_ROOT_USER}/document/general_howtos"
exit_if_last_exit_code_is_not_zero ${?} "Checkout and creation of directory >>${PATH_TO_THE_ARCHLIVE_ROOT_USER}/document/general_howtos<< failed."

_echo_if_be_verbose " Adding repository >>bulk_hdd_testing<< "
git clone https://github.com/ezonakiusagi/bht "${PATH_TO_THE_ARCHLIVE_ROOT_USER}/software/bulk_hdd_testing"
git clone https://github.com/ezonakiusagi/bht "${PATH_TO_THE_ARCHLIVE_ROOT_USER}/software/bulk_hdd_testing/"
exit_if_last_exit_code_is_not_zero ${?} "Checkout and creation of directory >>${PATH_TO_THE_ARCHLIVE_ROOT_USER}/software/bulk_hdd_testing<< failed."

_echo_if_be_verbose " Adding repository >>general_howtos<< "
git clone https://github.com/stevleibelt/general_howtos "${PATH_TO_THE_ARCHLIVE_ROOT_USER}/document/general_howtos/"
exit_if_last_exit_code_is_not_zero ${?} "Checkout and creation of directory >>${PATH_TO_THE_ARCHLIVE_ROOT_USER}/document/general_howtos<< failed."

_echo_if_be_verbose " Adding script >>create_efibootmgr_entry.sh<< "
cp "${PATH_TO_THIS_SCRIPT}/source/create_efibootmgr_entry.sh" "${PATH_TO_THE_ARCHLIVE_ROOT_USER}/software/"
exit_if_last_exit_code_is_not_zero ${?} "Copy of >>${PATH_TO_THIS_SCRIPT}/source/create_efibootmgr_entry.sh<< to >>${PATH_TO_THE_ARCHLIVE_ROOT_USER}/software/<< failed."
Expand Down Expand Up @@ -180,6 +180,19 @@ function add_packages_and_repository ()
fi
#eo: environment check

#bo: add archzfs key
if ! pacman-key --list-keys | grep -q "DDF7DB817396A49B2A2723F7403BD972F75D9D76";
then
_echo_if_be_verbose ":: Adding archzfs keys to keyring"

pacman-key --init
pacman-key --recv-keys DDF7DB817396A49B2A2723F7403BD972F75D9D76
pacman-key --lsign-key DDF7DB817396A49B2A2723F7403BD972F75D9D76

pacman -Sy
fi
#eo: add archzfs key

#bo: repo index
if [[ "${#REPO_INDEX_OR_EMPTY_STRING}" -gt 0 ]];
then
Expand All @@ -206,6 +219,10 @@ function add_packages_and_repository ()

if [[ ${IS_DRY_RUN} -ne 1 ]];
then
local PACKAGE_NAME
local PACKAGE_TO_REMOVE_ARRAY
local PACKAGE_TO_ADD_ARRAY

_echo_if_be_verbose " Creating archzfs mirrorlist file >>${PATH_TO_THE_PACMAN_D_ARCHZFS_FILE}<<."

#bo: adding repository
Expand All @@ -220,17 +237,26 @@ function add_packages_and_repository ()
echo "Include = ${PATH_TO_THE_PACMAN_D_ARCHZFS_FILE}" >> ${PATH_TO_THE_PACMAN_CONF_FILE}
#eo: adding repository

_echo_if_be_verbose " Adding packages."
#bo: removing package
IFS=',' read -r -a PACKAGE_TO_REMOVE_ARRAY <<< "${PACKAGES_TO_REMOVE}"

for PACKAGE_NAME in "${PACKAGE_TO_REMOVE_ARRAY[@]}";
do
_echo_if_be_verbose " Removing package >>${PACKAGE_NAME}<<."
sed -i "/${PACKAGE_NAME}/d" "${PATH_TO_THE_PACKAGES_FILE}"
done;
#eo: removing package

#bo: adding package
_echo_if_be_verbose " Adding package >>git<<."
echo "git" >> "${PATH_TO_THE_PACKAGES_FILE}"
_echo_if_be_verbose " Adding package >>mailx<<."
echo "mailx" >> "${PATH_TO_THE_PACKAGES_FILE}"
_echo_if_be_verbose " Adding package >>ksh<<."
echo "ksh" >> "${PATH_TO_THE_PACKAGES_FILE}"
_echo_if_be_verbose " Adding package >>nmon<<."
echo "nmon" >> "${PATH_TO_THE_PACKAGES_FILE}"
_echo_if_be_verbose " Adding packages."

IFS=',' read -r -a PACKAGE_TO_ADD_ARRAY <<< "${PACKAGES_TO_ADD}"

for PACKAGE_NAME in "${PACKAGE_TO_ADD_ARRAY[@]}";
do
_echo_if_be_verbose " Adding package >>${PACKAGE_NAME}<<."
echo "${PACKAGE_NAME}" >> "${PATH_TO_THE_PACKAGES_FILE}"
done

if [[ ${USE_DKMS} -eq 1 ]];
then
Expand Down
9 changes: 9 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
services:

archlinux-container:
cap_add:
- DAC_OVERRIDE
- SYS_ADMIN
- SYS_CHROOT
- SYS_MODULE
devices:
- /dev/loop-control:/dev/loop-control
image: archlinux:latest
# Replace privileged it with cap_add or devices section
#privileged: true # Needed to build since mkarchiso is doing a chroot
volumes:
- .:/app

0 comments on commit f38140c

Please sign in to comment.