mirror of
https://codeberg.org/privacy1st/arch
synced 2025-01-11 03:46:05 +01:00
installer script: work in progress (8)
This commit is contained in:
parent
b13bd32922
commit
0cd2fa661e
@ -55,7 +55,7 @@ Files from `/etc/skel` are copied to `/home/$USER` when new users are created.
|
|||||||
|
|
||||||
Example: [pkg/de-p1st-gnupg/PKGBUILD](pkg/de-p1st-gnupg/PKGBUILD)
|
Example: [pkg/de-p1st-gnupg/PKGBUILD](pkg/de-p1st-gnupg/PKGBUILD)
|
||||||
|
|
||||||
### enabling services
|
### Enabling services
|
||||||
|
|
||||||
* systemd.preset - Service enablement presets
|
* systemd.preset - Service enablement presets
|
||||||
* [man 5 systemd.preset](https://www.systutorials.com/docs/linux/man/5-systemd.preset/)
|
* [man 5 systemd.preset](https://www.systutorials.com/docs/linux/man/5-systemd.preset/)
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# -> git
|
# -> git
|
||||||
#
|
#
|
||||||
BUILD_DIR=./archlive
|
BUILD_DIR=./archlive
|
||||||
PKGS=('git' 'de-p1st-keyboard' 'de-p1st-nano' 'de-p1st-pacman' 'de-p1st-pacman-mirrorlist' 'de-p1st-systemd')
|
PKGS=('git' 'de-p1st-keyboard' 'de-p1st-nano' 'de-p1st-pacman' 'de-p1st-systemd')
|
||||||
PACMAN_CFG_ADDITION='pkg/de-p1st-pacman/pacman.d/de-p1st' # will be used to extend the builder's pacman.conf
|
PACMAN_CFG_ADDITION='pkg/de-p1st-pacman/pacman.d/de-p1st' # will be used to extend the builder's pacman.conf
|
||||||
|
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ function get_default_mount_options() {
|
|||||||
|
|
||||||
function choose_mount_options() {
|
function choose_mount_options() {
|
||||||
# return: the following variables:
|
# return: the following variables:
|
||||||
# FS_MOUNT_OPTIONS (array)
|
# FS_CHOSEN_MOUNT_OPTIONS (array)
|
||||||
|
|
||||||
case "${FS}" in
|
case "${FS}" in
|
||||||
BTRFS)
|
BTRFS)
|
||||||
@ -149,7 +149,7 @@ function choose_mount_options() {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
get_multi_choice FS_MOUNT_OPTIONS "Select mount options" TMP1 || return $?
|
get_multi_choice FS_CHOSEN_MOUNT_OPTIONS "Select mount options" TMP1 || return $?
|
||||||
}
|
}
|
||||||
|
|
||||||
function main() {
|
function main() {
|
||||||
@ -163,15 +163,30 @@ function main() {
|
|||||||
partition "${TARGET_BLOCK_DEVICE}" "$BIOS_TYPE" || return $?
|
partition "${TARGET_BLOCK_DEVICE}" "$BIOS_TYPE" || return $?
|
||||||
format "$BIOS_TYPE" "${BOOT_PART}" "${LUKS_PART}" "${LUKS_PWD}" "${FS}" DATA_PART || return $?
|
format "$BIOS_TYPE" "${BOOT_PART}" "${LUKS_PART}" "${LUKS_PWD}" "${FS}" DATA_PART || return $?
|
||||||
|
|
||||||
# TODO: use FS_DEFAULT_MOUNT_OPTIONS and FS_MOUNT_OPTIONS in combination
|
# Combine default and chosen mount options
|
||||||
mount "$DATA_PART" /mnt || return $?
|
TMP1=("${FS_DEFAULT_MOUNT_OPTIONS[@]}" "${FS_CHOSEN_MOUNT_OPTIONS[@]}") || return $?
|
||||||
mkdir /mnt/boot && mount "$BOOT_PART" /mnt/boot || return $?
|
# Join array elements by ","
|
||||||
|
join_by "," TMP1 FS_MOUNT_OPTIONS || return $?
|
||||||
|
echo "Mounting data partition with options: ${FS_MOUNT_OPTIONS}"
|
||||||
|
mount -o "${FS_MOUNT_OPTIONS}" "$DATA_PART" /mnt || return $?
|
||||||
|
# mount boot partition
|
||||||
|
mkdir /mnt/boot || return $?
|
||||||
|
mount "$BOOT_PART" /mnt/boot || return $?
|
||||||
|
|
||||||
|
case "${BIOS_TYPE}" in
|
||||||
|
uefi)
|
||||||
|
pacstrap /mnt "${KERNEL}" "${KERNEL}-headers" de-p1st-base-efi || return $?
|
||||||
|
;;
|
||||||
|
bios)
|
||||||
|
echo "Not yet implemented"
|
||||||
|
return 1
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Not yet implemented!"
|
||||||
|
return 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
# TODO: testing
|
|
||||||
# if bios type is bios then ... :/
|
|
||||||
# amd/intel-ucode
|
|
||||||
pacstrap /mnt "${KERNEL}" "${KERNEL}-headers" de-p1st-base-efi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
|
@ -11,7 +11,7 @@ KERNEL=linux
|
|||||||
TARGET_BLOCK_DEVICE=/dev/sda
|
TARGET_BLOCK_DEVICE=/dev/sda
|
||||||
BOOT_PART_SIZE=500 # MiB
|
BOOT_PART_SIZE=500 # MiB
|
||||||
FS=BTRFS
|
FS=BTRFS
|
||||||
FS_MOUNT_OPTIONS=('noatime')
|
FS_CHOSEN_MOUNT_OPTIONS=('noatime')
|
||||||
|
|
||||||
CPU_VENDOR=none
|
CPU_VENDOR=none
|
||||||
BIOS_TYPE=uefi
|
BIOS_TYPE=uefi
|
||||||
|
@ -1,3 +1,15 @@
|
|||||||
|
function join_by() {
|
||||||
|
# Join array elements with character $1
|
||||||
|
# $1: delimiter
|
||||||
|
# $2: name of source array
|
||||||
|
# $3: variable name to store result
|
||||||
|
|
||||||
|
local -n ptr=$2 || return $?
|
||||||
|
local -n ptr2=$3 || return $?
|
||||||
|
ptr2=$(printf ",%s" "${ptr[@]}")
|
||||||
|
ptr2=${ptr2:1}
|
||||||
|
}
|
||||||
|
|
||||||
function newline_to_space() {
|
function newline_to_space() {
|
||||||
# Replaces all newlines with spaces
|
# Replaces all newlines with spaces
|
||||||
# $1: name of variable
|
# $1: name of variable
|
||||||
|
Loading…
x
Reference in New Issue
Block a user