diff --git a/pkg/de-p1st-hosts/.install b/pkg/de-p1st-hosts/.install new file mode 100644 index 0000000..8ef8a94 --- /dev/null +++ b/pkg/de-p1st-hosts/.install @@ -0,0 +1,35 @@ +# This is a default template for a post-install scriptlet. +# Uncomment only required functions and remove any functions +# you don't need (and this header). + +## arg 1: the new package version +#pre_install() { + # do something here +#} + +## arg 1: the new package version +post_install() { + holo apply +} + +## arg 1: the new package version +## arg 2: the old package version +#pre_upgrade() { + # do something here +#} + +## arg 1: the new package version +## arg 2: the old package version +post_upgrade() { + holo apply +} + +## arg 1: the old package version +#pre_remove() { + # do something here +#} + +## arg 1: the old package version +post_remove() { + holo apply +} diff --git a/pkg/de-p1st-hosts/PKGBUILD b/pkg/de-p1st-hosts/PKGBUILD new file mode 100644 index 0000000..89e94ba --- /dev/null +++ b/pkg/de-p1st-hosts/PKGBUILD @@ -0,0 +1,30 @@ +# Maintainer: Daniel Langbein +_pkgname=hosts +_reponame=arch +pkgname="de-p1st-$_pkgname" +pkgver=0.0.1 +pkgrel=1 +pkgdesc="/etc/hosts file" +arch=('any') +url="https://codeberg.org/privacy1st/${_reponame}" +license=('MIT') +groups=() +depends=('holo') +makedepends=('git') +optdepends=() +provides=() +conflicts=() +replaces=() +backup=() +options=() +install='.install' +changelog= +source=("git+${url}.git") +noextract=() +sha256sums=('SKIP') + +package() { + cd "${_reponame}/pkg/${pkgname}" + + install -Dm0544 hosts.holoscript "$pkgdir"/usr/share/holo/files/"$pkgname"/etc/hosts.holoscript +} diff --git a/pkg/de-p1st-hosts/README.md b/pkg/de-p1st-hosts/README.md new file mode 100644 index 0000000..b0ac13c --- /dev/null +++ b/pkg/de-p1st-hosts/README.md @@ -0,0 +1,4 @@ +# /etc/hosts + +If the system has a permanent IP address, it should be used instead of `127.0.1.1`. +* Archwiki: [Installation_guide#Network_configuration](https://wiki.archlinux.org/index.php/Installation_guide#Network_configuration) diff --git a/pkg/de-p1st-hosts/hosts.holoscript b/pkg/de-p1st-hosts/hosts.holoscript new file mode 100644 index 0000000..d41f251 --- /dev/null +++ b/pkg/de-p1st-hosts/hosts.holoscript @@ -0,0 +1,8 @@ +#!/bin/sh +# stdin: default config +# stdout: modified config + +echo "127.0.0.1 localhost +::1 localhost +127.0.1.1 ${HOST}.localdomain ${HOST} +" diff --git a/pkg/de-p1st-installer/de-p1st-installer.sh b/pkg/de-p1st-installer/de-p1st-installer.sh index 49514fe..61a06e8 100755 --- a/pkg/de-p1st-installer/de-p1st-installer.sh +++ b/pkg/de-p1st-installer/de-p1st-installer.sh @@ -162,11 +162,40 @@ function run_pacstrap() { # KERNEL # CPU_VENDOR - # TODO: intel/amd/none CPU_VENDOR + PKGS=() + + case "${KERNEL}" in + linux) + PKGS+=("${KERNEL}" "${KERNEL}-headers") + ;; + linux-lts) + PKGS+=("${KERNEL}" "${KERNEL}-headers") + ;; + *) + echo "Not yet implemented!" + return 1 + ;; + esac + + case "${CPU_VENDOR}" in + amd) + PKGS+=("${CPU_VENDOR}-ucode") + ;; + intel) + PKGS+=("${CPU_VENDOR}-ucode") + ;; + none) + true + ;; + *) + echo "Not yet implemented!" + return 1 + ;; + esac case "${BIOS_TYPE}" in uefi) - pacstrap /mnt "${KERNEL}" "${KERNEL}-headers" de-p1st-base-efi || return $? + PKGS+=('de-p1st-base-efi') ;; bios) echo "Not yet implemented" @@ -177,6 +206,8 @@ function run_pacstrap() { return 1 ;; esac + + pacstrap /mnt "${PKGS[@]}" || return $? } function run_genfstab() {