2021-04-28 17:21:39 +02:00
|
|
|
|
#!/bin/bash
|
2021-06-12 20:47:54 +02:00
|
|
|
|
|
2021-06-12 11:55:25 +02:00
|
|
|
|
BUILD_DIR=/out
|
2021-04-28 17:21:39 +02:00
|
|
|
|
|
2021-06-11 14:20:12 +02:00
|
|
|
|
PKGS=()
|
|
|
|
|
PKGS+=('de-p1st-keyboard') # german keyboard
|
|
|
|
|
PKGS+=('de-p1st-nano') # syntax hilighting in nano
|
|
|
|
|
PKGS+=('de-p1st-screen') # longer scrollback history in screen
|
|
|
|
|
PKGS+=('de-p1st-pacman') # [de-p1st] mirror enabled
|
|
|
|
|
PKGS+=('de-p1st-installer') # de-p1st-installer script
|
2021-04-28 17:21:39 +02:00
|
|
|
|
|
2021-06-12 20:47:54 +02:00
|
|
|
|
ENABLE_SSH=true
|
|
|
|
|
SSH_PUB_KEY='ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCpgihAg8Qzu5q+AGXHLR7p+rrS1yB0KlZb/Y/EwZT15EhEtsUMqBMRiY0TdjKQU0broyygZnymccLmCXvihEgk3zk/hP8VEDmN5wmE2tRBPR4lSjo8E1R8N79G+gaFkwi93QYh57MsGfa9k4tvGrJy0yaD7GrPqtQf+IIuvV14WJQAqnikTdbFqRjk5JGearYLU7jSKa+9NmR7JQ9NExoyIPgmQ/pd0Xc2qt8k5UGfz3HM9MAmIVQ30whK6m1iYZ8nxEidHrfreQx8NOa7ujo4zQnV1NYvRUjObr/qyIhPU6DYLT2mVRNupQFKx6LI38O4U13heugUFqJ3zvog3aDsriFiv8jzJAJvWXx7Q3TqKhqiG9VTkwBw1NDbCAOXKiEdMfiCYbdCfpNgdepU75bMloJcSQQVUqoH2tQhSbwKLuRFgOnyaHpvWbieXBRcUnfG8gg4p4jqiwx5laweEeOIOD/i7G1Mjx7Dj2ctnT/ILat/xsf+Y0W4eJr3bc5L9ghgw6wsKbNSqwjFUCFcHcARK3gvSH+hO2/BpgMVoyvZjO5PNuUqfsZ7bIIs5cDdyB/ly3irKuaRz1+3x1x4gPgSiOcji7HxPwogzhPsyfoRLHNt9tJ5X4nF2Iz1M5RTJpbZCi6yEj+9Q85FVjD76BEWuZe18kRrwhuLf/XgKdF9tQ== openpgp:0xA8B75370'
|
|
|
|
|
|
2021-04-28 17:21:39 +02:00
|
|
|
|
################################
|
|
|
|
|
|
2021-06-12 11:55:25 +02:00
|
|
|
|
# Write-permission for user "build"
|
|
|
|
|
sudo chown "build:wheel" /out
|
|
|
|
|
|
2021-06-11 14:20:12 +02:00
|
|
|
|
function isEmptyDir() {
|
2021-06-12 11:55:25 +02:00
|
|
|
|
# arg $1: directory to check
|
|
|
|
|
|
|
|
|
|
if [ -z "$(find "${1}" -maxdepth 0 -type d -empty 2>/dev/null)" ]; then
|
2021-06-11 14:20:12 +02:00
|
|
|
|
# echo "Not empty or NOT a directory"
|
|
|
|
|
return 1
|
2021-06-12 17:52:54 +02:00
|
|
|
|
else
|
|
|
|
|
# "Empty directory"
|
|
|
|
|
return 0
|
2021-06-11 14:20:12 +02:00
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ -d "${BUILD_DIR}" ]; then
|
|
|
|
|
if ! isEmptyDir "${BUILD_DIR}"; then
|
|
|
|
|
if [ "$1" = "clean" ]; then
|
2021-06-12 11:55:25 +02:00
|
|
|
|
sudo rm -r "${BUILD_DIR}"/* || exit $?
|
2021-06-11 14:20:12 +02:00
|
|
|
|
else
|
2021-06-12 11:55:25 +02:00
|
|
|
|
echo "BUILD_DIR not empty: ${BUILD_DIR}";
|
|
|
|
|
echo "Run with argument 'clean' to clean up BUILD_DIR and then continue building the ISO."
|
2021-06-11 14:20:12 +02:00
|
|
|
|
exit 1;
|
|
|
|
|
fi
|
|
|
|
|
fi # else: BUILD_DIR exists and is empty :)
|
|
|
|
|
elif ! mkdir -p "${BUILD_DIR}"; then
|
2021-06-12 11:55:25 +02:00
|
|
|
|
echo "Could not create BUILD_DIR: ${BUILD_DIR}";
|
2021-06-11 14:20:12 +02:00
|
|
|
|
exit 1;
|
2021-04-28 17:21:39 +02:00
|
|
|
|
fi
|
|
|
|
|
|
2021-04-29 12:09:36 +02:00
|
|
|
|
|
2021-04-28 17:21:39 +02:00
|
|
|
|
# The releng profile is used to create the official monthly installation ISO
|
|
|
|
|
PROFILE=/usr/share/archiso/configs/releng/
|
2021-06-11 14:20:12 +02:00
|
|
|
|
if [ ! -d "${PROFILE}" ]; then
|
2021-06-12 11:55:25 +02:00
|
|
|
|
echo "Dependency 'archiso' is missing. Please install this first!"
|
|
|
|
|
exit 1
|
2021-04-28 17:21:39 +02:00
|
|
|
|
fi
|
|
|
|
|
|
2021-05-24 15:09:45 +02:00
|
|
|
|
cp -r "$PROFILE" "$BUILD_DIR"/profile || exit $?
|
2021-04-28 17:21:39 +02:00
|
|
|
|
|
2021-04-29 20:25:30 +02:00
|
|
|
|
# extend the builder's pacman.conf (add de-p1st mirrors)
|
2021-04-28 17:21:39 +02:00
|
|
|
|
# https://wiki.archlinux.org/index.php/Archiso#Custom_local_repository
|
2021-06-12 11:55:25 +02:00
|
|
|
|
# cat ../pkg/de-p1st-pacman/pacman.d/de-p1st >>"$BUILD_DIR"/profile/pacman.conf || exit $?
|
|
|
|
|
echo '[de-p1st]
|
|
|
|
|
SigLevel = Optional TrustAll
|
|
|
|
|
Server = https://arch.p1st.de' | sudo tee -a "$BUILD_DIR"/profile/pacman.conf || exit $?
|
2021-04-28 17:21:39 +02:00
|
|
|
|
|
|
|
|
|
for PKG in "${PKGS[@]}"; do
|
2021-06-11 14:20:12 +02:00
|
|
|
|
echo "${PKG}" >>"${BUILD_DIR}"/profile/packages.x86_64
|
2021-04-28 17:21:39 +02:00
|
|
|
|
done
|
|
|
|
|
|
2021-06-12 20:47:54 +02:00
|
|
|
|
# source: https://gitlab.archlinux.org/archlinux/archiso/-/blob/master/configs/releng/airootfs/etc/motd
|
|
|
|
|
echo 'To install [38;2;23;147;209mArch Linux[0m run the following command:
|
|
|
|
|
[35mde-p1st-installer[0m
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
For Wi-Fi, authenticate to the wireless network using the [35miwctl[0m utility.
|
|
|
|
|
For mobile broadband (WWAN) modems, connect with the [35mmmcli[0m utility.
|
|
|
|
|
Ethernet, WLAN and WWAN interfaces using DHCP should work automatically.
|
|
|
|
|
' > "${BUILD_DIR}"/profile/airootfs/etc/motd || exit $?
|
|
|
|
|
|
2021-04-28 17:21:39 +02:00
|
|
|
|
###
|
|
|
|
|
|
2021-05-24 15:09:45 +02:00
|
|
|
|
mkdir "${BUILD_DIR}/work_dir" && mkdir "${BUILD_DIR}/out_dir" || exit $?
|
2021-04-28 17:21:39 +02:00
|
|
|
|
|
|
|
|
|
echo "running 'sudo mkarchiso' ..."
|
2021-05-24 15:09:45 +02:00
|
|
|
|
sudo mkarchiso -v -w "${BUILD_DIR}/work_dir" -o "${BUILD_DIR}/out_dir" "${BUILD_DIR}/profile" || exit $?
|
2021-06-12 20:47:54 +02:00
|
|
|
|
|
|
|
|
|
sudo chown -R "build:wheel" /out/out_dir
|