add de-p1st-hosts

This commit is contained in:
Daniel Langbein 2021-05-02 15:08:20 +02:00
parent eaf7fb138e
commit 738bc78aee
5 changed files with 110 additions and 2 deletions

View File

@ -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
}

View File

@ -0,0 +1,30 @@
# Maintainer: Daniel Langbein <daniel@systemli.org>
_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
}

View File

@ -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)

View File

@ -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}
"

View File

@ -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() {