289 lines
9.5 KiB
Bash
289 lines
9.5 KiB
Bash
#!/usr/bin/env zsh
|
||
## configuration file for devuan-desktop-metal blend
|
||
|
||
vars+=(username userpass default_shell mkefi grubversion hookscripts)
|
||
arrs+=(disk_name esp_partitions swap_partitions custom_deb_packages apt_extra_repos)
|
||
|
||
DEBUG=1 # prevents the deletion of $workdir on completion. Turns on debugging information.
|
||
|
||
|
||
blend_name="devuan-desktop"
|
||
uname_ostype="Linux"
|
||
uname_os="GNU/${uname_ostype}"
|
||
|
||
release="daedalus"
|
||
version="5.0.1"
|
||
|
||
hostname="devuan"
|
||
username="devuan"
|
||
userpass="devuan"
|
||
userskel="/etc/skel"
|
||
default_shell="/usr/bin/zsh"
|
||
|
||
|
||
# Turn on/off copy-root-overlay()
|
||
# copies the files in $R/extra/generic-root to $strapdir
|
||
skip_arm_generic_root="true"
|
||
|
||
# copies the files in $R/extra/$device_name to $strapdir
|
||
skip_arm_device_root="true"
|
||
|
||
# comment to disable:
|
||
#hookscripts="yes"
|
||
|
||
# debootstrap options
|
||
# From lib/libdevuansdk/zlib/bootstrap we need to add the options variable.
|
||
# debootstrap --keyring="$LIBPATH/extra/devuan-keyring/keyrings/devuan-archive-keyring.gpg" \
|
||
# --include=devuan-keyring,wget,ca-certificates \
|
||
# --foreign \
|
||
# >>> ${bootstrap_options} \ <<<
|
||
# --arch
|
||
# Currently we have put a wrapper in blend_helpers-docker to add these optiions using an alias.
|
||
bootstrap_options=("--force-check-gpg --no-merged-usr --variant=minbase")
|
||
|
||
# debootstrap mirror
|
||
#mirror="tor+http://devuanauxrkggcowgm2vcs6go3c5pgxdidd5wqjpg7zpfaxkmgspr6id.onion/merged"
|
||
#mirror="http://pkgmaster.devuan.org/merged" #
|
||
#mirror="http://deb.devuan.org" #
|
||
#mirror="http://localhost:3142/deb.devuan.org/merged/" # apt-cacher-ng
|
||
#mirror="http://192.168.1.50:3142/deb.devuan.org/merged/" # apt-cacher-ng
|
||
mirror="http://192.168.1.49:3142" # apt-cacher-ng
|
||
|
||
# the mirror to use in /etc/apt/apt.conf.d/02proxy
|
||
apt_proxy="http://192.168.1.49:3142"
|
||
|
||
#arch="amd64"
|
||
#arch="i386"
|
||
#arch="armhf"
|
||
arch="arm64"
|
||
target_arch="aarch64"
|
||
|
||
case "$arch" in
|
||
# for minimal-live
|
||
i386) extra_packages+=(linux-image-686) ;;
|
||
|
||
# for desktop-live
|
||
i386_live) extra_packages+=(linux-image-686-pae) ;;
|
||
|
||
amd64) extra_packages+=(linux-image-amd64) ;;
|
||
|
||
armhf) extra_packages+=(linux-image-armmp) ;;
|
||
|
||
arm64) extra_packages+=(linux-image-arm64) ;;
|
||
esac
|
||
|
||
#kernel_version="5.10.0-11"
|
||
|
||
# ZFS install parameters
|
||
#rootfs="zfs"
|
||
rootfs="ext4"
|
||
|
||
uefi="true"
|
||
uefi_secure=
|
||
|
||
# grub install an image usable with UEFI Secure Boot.
|
||
if [[ -n "$uefi_secure" ]]; then
|
||
secure_boot="uefi-secure-boot"
|
||
else
|
||
secure_boot="no-uefi-secure-boot"
|
||
fi
|
||
|
||
disk_path="/dev/disk/by-id"
|
||
#disk_name="ata-HGST_HTS541010A9E680_JA1000102T3RVP"
|
||
#disk2_name="ata-HGST_HTS541010A9E680_JB10001329MG7R"
|
||
|
||
#raid=unset # raid0: striped 1 or more
|
||
#raid=mirror # raid1: mirror 2
|
||
##raid=raidz # raid1: mirror 3
|
||
##raid=raidz2 # raid2: mirror 4
|
||
##raid=raidz3 # raid3: mirror 5
|
||
##raid=stripedmirror # raid10: mirror 4 and paired
|
||
|
||
available_disks=("${disk_name}")
|
||
if [[ -v $raid ]]; then
|
||
available_disks+="${disk2_name}"
|
||
fi
|
||
|
||
root_name="devuan-1"
|
||
rpool_name="rpool"
|
||
bpool_name="bpool"
|
||
#encrypt=yes
|
||
|
||
# polite to use somewhere other than /etc/zfs rather than squash it.
|
||
#zpool_cache_dir="/etc/zfs"
|
||
zpool_cache_dir="/var/tmp"
|
||
|
||
## underlying physical block size for zpool create.
|
||
# ashift=9 means 512B sectors (used by all ancient drives),
|
||
# ashift=12 means 4K sectors (used by most modern hard drives), and
|
||
# ashift=13 means 8K sectors (used by some modern SSDs).
|
||
ashift=12
|
||
|
||
# Rockchip partition layout for ARM devices
|
||
bios_part_number="1" # LOADER1
|
||
efi_part_number="2" # LOADER2
|
||
trust_part_number="3" # ARM Trusted Firmware
|
||
esp_part_number="4" # EFI System Partition
|
||
boot_part_number="5" # BOOT
|
||
root_part_number="6" # ROOT
|
||
|
||
# set in the arm-sdk/boards/<board>.sh
|
||
# espopts="-s1 -F32" # options to mkfs.vfat
|
||
# bootopts="-s1 -F32" # options to mkfs.vfat
|
||
|
||
|
||
# Suggested Partitionition layout for non-ARM devices using UEFI.
|
||
# FIXME: metal install is currently not arm64 compatible. If we want to do the same install using two harddrives on arm64 we need to change the partitions to include ATF and ESP
|
||
# these work with the image_partition_disk_zfs() but efi_part_size refers to the esp efi_partition and clashes with the gpt partitioning scheme above
|
||
# the esp partition gets mounted to /boot/efi uefi=1 and /boot/grub if not.
|
||
|
||
# bios_part_number="1" # BIOS_Boot_Partition
|
||
# esp_part_number="2" # EFI_System partition
|
||
# swap_part_number="3" # SWAP
|
||
# boot_part_number="4" # Boot partition
|
||
# root_part_number="5" # Root Partition
|
||
|
||
esp_start="2048"
|
||
|
||
bios_part_size="1MB"
|
||
esp_part_size="512MB" # > 260 MiB (273 MB) to ensure its properly formatted with FAT32 so that you avoid UEFI implementation compatibility issues.
|
||
swap_part_size="8GB"
|
||
boot_part_size="2GB"
|
||
|
||
# zvol requires resume to be disabled
|
||
#swap_type="zvol"
|
||
swap_type="physical"
|
||
|
||
tmp_exec_state="off"
|
||
var_tmp_exec_state="on"
|
||
|
||
# uncomment to create uefi-bootable iso causes iso_make_efi and iso_write_grub_cfg
|
||
# to be called in blend_postinst
|
||
#MKEFI=1
|
||
efi_work="$BLENDPATH/${release}/efi-files"
|
||
|
||
|
||
zero_uefi="no"
|
||
|
||
if [[ -n $uefi ]]; then
|
||
grub_mount="/boot/efi"
|
||
grubversion="grub-efi-${arch}"
|
||
|
||
case "$arch" in
|
||
amd64) grub_efi_target="x86_64-efi" \
|
||
base_packages+=(grub-efi-amd64 grub-efi-ia32-bin grub-efi-amd64-signed efivar efibootmgr u-boot-menu flash-kernel) \
|
||
;;
|
||
arm64) grub_efi_target="arm64-efi" \
|
||
base_packages+=(grub-efi-arm64 grub-efi-amd64-signed efivar efibootmgr u-boot-menu flash-kernel) \
|
||
;;
|
||
armhf) grub_efi_target="armhf-efi" \
|
||
base_packages+=(grub-efi-arm grub-efi-amd64-signed efivar efibootmgr u-boot-menu flash-kernel) \
|
||
;;
|
||
esac
|
||
|
||
else
|
||
grub_mount="/boot/grub"
|
||
grubversion="grub-pc"
|
||
fi
|
||
|
||
esp_partitions+=("/dev/disk/by-id/${disk_name}-part${esp_part_number}")
|
||
if [[ -v ${raid} ]]; then
|
||
esp_partitions+="/dev/disk/by-id/${disk2_name}-part${esp_part_number}"
|
||
fi
|
||
|
||
swap_partitions+=("/dev/disk/by-id/${disk_name}-part${swap_part_number}")
|
||
if [[ -v ${raid} ]]; then
|
||
swap_partitions+="/dev/disk/by-id/${disk2_name}-part${swap_part_number}"
|
||
fi
|
||
|
||
|
||
|
||
|
||
# devuan grub themes: cinnabar-grub darkpurpy-grub deepsea-grub
|
||
# grub themes must be placed on filesystems visable to grub ie not zfs.
|
||
grub_theme="deepsea-grub"
|
||
grub_gfxmode="1920x1200x32,1920x1200x8"
|
||
|
||
mirror="http://deb.devuan.org/merged"
|
||
section="main contrib non-free non-free-firmware"
|
||
|
||
# both backports and experimental additional repos have /contrib after the variable
|
||
# and so if a new repo is added that doesn't, changes need to the update_package()
|
||
# function in blend helpers.
|
||
# Adding backports to provide a version of ZFS-dkms that suports 6.5 kernels
|
||
# in daedalus.
|
||
# apt_extra_repos=(experimental)
|
||
apt_extra_repos=(${release}-backports)
|
||
|
||
## NB we have a 020 script: 001_apt_sources.sh that removes the sources.list
|
||
# file and populations separate files under sources.list.d but that script needs t
|
||
# o be updated to use mirror merged and mirror devuan as well as the fixes below
|
||
# FIXME; devuan backports uses "deb http://deb.devuan.org/devuan ${release}-backports main"
|
||
# so we need to handle that in sysconf or the blend file where we override it.
|
||
mirror_backports="http://deb.devuan.org/merged"
|
||
section_backports="main"
|
||
|
||
# FIXME; devuan proposed-updates uses "deb http://deb.devuan.org/devuan ${release}-updates main"
|
||
# so we need to handle that in sysconf. or the blend file where we override it.
|
||
mirror_updates="http://deb.devuan.org/merged"
|
||
section_updates="main"
|
||
|
||
# FIXME; devuan proposed-updates uses "deb http://deb.devuan.org/devuan ${release}-proposed-updates main"
|
||
# so we need to handle that in sysconf or the blend file where we override it.
|
||
mirror_proposed_updates="http://deb.devuan.org/devuan"
|
||
section_proposed_updates="main"
|
||
|
||
# FIXME: devuan experimental uses "deb http://deb.devuan.org/devuan experimental main"
|
||
# so we need to handle that in sysconf or the blend file where we override it.
|
||
mirror_experimental="http://deb.devuan.org/devuan"
|
||
section_experimental="main"
|
||
|
||
|
||
# need to add to the debootstrap command in lib/libdevuansdk/zlibs/bootstrap
|
||
#debootstrap_options="--extra-suites=ascii-proposed-updates --include=libupower-glib3,dbus-x11,xfce4"
|
||
|
||
# if we can find a way of changing the logcation of the schroot config files we
|
||
# would change the schroot_dir value.
|
||
schroot_dir="/etc/schroot"
|
||
# schroot_dir="$BLENDPATH/etc/schroot"
|
||
schroot_config="arm-sdk" # name of the schroot custom config directory
|
||
sources_dir="$R/tmp/kernels/rockpro64" # where the sources outside the chroot are placed.
|
||
sources_dest="/scratch" # where the sources inside the chroot are placed.
|
||
|
||
# apt get options
|
||
# Configuration Item: APT::Get::force-yes. This is deprecated and replaced
|
||
# by --allow-unauthenticated , --allow-downgrades , --allow-remove-essential ,
|
||
# --allow-change-held-packages
|
||
force_packages_option=(--allow-change-held-packages)
|
||
base_packages_option=(--no-install-recommends)
|
||
extra_packages_option=(--no-install-recommends)
|
||
|
||
# dpkg options
|
||
# Configuration Item: DPKG::Options
|
||
dpkg_options=(Dpkg::Options:: --force-confold)
|
||
|
||
# dpkg-buildpackage options
|
||
# Configuration Item: DPKG::Options
|
||
dpkg_buildpackage_options=(--host-arch=${arch} --target-arch=${arch} --no-pre-clean)
|
||
|
||
|
||
|
||
release_conf="$BLENDPATH/${release}/config"
|
||
|
||
|
||
### package sets are defined in the corresponding $release/config file
|
||
|
||
source $release_conf
|
||
|
||
## image_name depends on release and version
|
||
|
||
# FIXME: Removed gitbranch from image_name because it is set after the strapdir
|
||
# is created. If we want the kernel version in the image name we need to rename
|
||
# the image at the end of the build.
|
||
#
|
||
# with the v in front of the kernel version
|
||
image_name="${os}_${release}-${version}_${gitbranch}-${arch}_desktop"
|
||
|
||
# without the v in front of the kernel version
|
||
# image_name="${os}_${release}-${version}_${git_kernel_version}-${arch}_desktop"
|