From ad057ec1d88d71018e1d82c2fb765a4f7a746579 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 12 Jul 2016 01:55:16 -0400 Subject: initial commit --- .gitignore | 9 ++++ Makefile | 21 ++++++++++ config-etckeeper.PKGBUILD | 61 ++++++++++++++++++++++++++++ config-pacman-mirrorlist-repo.PKGBUILD | 16 ++++++++ config-pacman-mirrorlist-repomirror.PKGBUILD | 16 ++++++++ config-pacman.PKGBUILD.sh | 39 ++++++++++++++++++ config-timedate.PKGBUILD | 18 ++++++++ config-users-base.PKGBUILD | 22 ++++++++++ config-winston-base.PKGBUILD.sh | 47 +++++++++++++++++++++ config-winston-bootloader.PKGBUILD.sh | 20 +++++++++ config-winston-fstab.PKGBUILD.wip | 39 ++++++++++++++++++ config-winston-network.PKGBUILD | 44 ++++++++++++++++++++ write-ifchanged | 25 ++++++++++++ 13 files changed, 377 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 config-etckeeper.PKGBUILD create mode 100644 config-pacman-mirrorlist-repo.PKGBUILD create mode 100644 config-pacman-mirrorlist-repomirror.PKGBUILD create mode 100644 config-pacman.PKGBUILD.sh create mode 100644 config-timedate.PKGBUILD create mode 100644 config-users-base.PKGBUILD create mode 100644 config-winston-base.PKGBUILD.sh create mode 100644 config-winston-bootloader.PKGBUILD.sh create mode 100644 config-winston-fstab.PKGBUILD.wip create mode 100644 config-winston-network.PKGBUILD create mode 100755 write-ifchanged diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..860c242 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +*.db +*.db.tar.gz +*.files +*.files.tar.gz +/pkg/ +/src/ +*.pkg.tar.* +/.var.* +/.tmp.* diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6eeb052 --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +all: config.db + +pkgbuilds = $(wildcard *.PKGBUILD) +$(foreach e,$(shell grep -e ^pkgver= -e ^pkgrel= -e ^pkgname= -- $(pkgbuilds)|sed 's/\.PKGBUILD:/./'),$(eval $e)) +$(foreach p,$(patsubst %.PKGBUILD,%,$(pkgbuilds)), \ + $(eval pkgfiles += $($p.pkgname)-$($p.pkgver)-$($p.pkgrel)-any.pkg.tar.xz) \ + $(eval $($p.pkgname)-$($p.pkgver)-$($p.pkgrel)-any.pkg.tar.xz: $p.PKGBUILD) ) + +%.pkg.tar.xz: + makepkg -d -f -p $< + +%.db %.db.tar.gz %.files %.files.tar.gz: .var.pkgfiles $(pkgfiles) + find $^ -newer $*.db + rm -f $*.db $*.db.tar.gz $*.files $*.files.tar.gz + repo-add $*.db.tar.gz $(filter %.pkg.tar.xz,$^) + touch --no-create --no-dereference $*.db $*.db.tar.gz $*.files $*.files.tar.gz + +.var.%: FORCE + @printf '%s' '$(subst ','\\'',$($*))' | sed 's/^/#/' | ./write-ifchanged $@ +-include $(wildcard .var.*) +.PHONY: FORCE diff --git a/config-etckeeper.PKGBUILD b/config-etckeeper.PKGBUILD new file mode 100644 index 0000000..0bf09a5 --- /dev/null +++ b/config-etckeeper.PKGBUILD @@ -0,0 +1,61 @@ +pkgver=1 +pkgrel=1 +arch=(any) + +pkgname=config-etckeeper +depends=(etckeeper pristine-etc-keeper) + +package() { +cd "$pkgdir" + +install -dm755 etc/systemd/system/multi-user.target.wants +# etckeeper is configured to use git (the default) to keep track of +# changes in /etc. The systemd unit etckeeper.timer is enabled, which +# makes a commit (if necessary) daily. It will also run before and +# after pacman via libalpm hooks. +ln -s /usr/lib/systemd/system/etckeeper.timer etc/systemd/system/multi-user.target.wants/etckeeper.timer + +# In addition to etckeeper keeping track of the current configuration, +# lukeshu's pristine-etc-keeper maintains a branch of what /etc would +# be like if we never made any changes from the default files. The +# clean version of etc is available as the clean remote's master +# branch. Doing a git diff clean/master master should be helpful in +# investigating how things have been configured. +ln -s /usr/lib/systemd/system/pristine-etc-keeper.timer etc/systemd/system/multi-user.target.wants/pristine-etc-keeper.timer + +# Add a stub to customize /etc/.gitignrore a bit +install -Dm755 /dev/stdin etc/etckeeper/update-ignore.d/02custom <<_EOF_ +#!/bin/bash +sed -i '/^# end section managed by etckeeper$/,$d' .gitignore +cat >> .gitignore <> etc/pacman.conf + fi +} + +pre_remove() { + sed -i '/^Include = \/etc\/pacman\.d\/*\.conf$/d' etc/pacman.conf + trim +} diff --git a/config-timedate.PKGBUILD b/config-timedate.PKGBUILD new file mode 100644 index 0000000..8c8cf19 --- /dev/null +++ b/config-timedate.PKGBUILD @@ -0,0 +1,18 @@ +pkgver=1 +pkgrel=1 +arch=(any) + +pkgname=config-timedate + +package() { + cd "$pkgdir" + + install -dm755 etc/systemd/system/sysinit.target.wants + + # Consider UTC to be the timezone, since we have admins all + # over the place. + ln -s ../usr/share/zoneinfo/UTC etc/localtime + + # Use timesyncd NTP client daemon. + ln -s /usr/lib/systemd/system/systemd-timesyncd.service etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service +} diff --git a/config-users-base.PKGBUILD b/config-users-base.PKGBUILD new file mode 100644 index 0000000..72ffc35 --- /dev/null +++ b/config-users-base.PKGBUILD @@ -0,0 +1,22 @@ +pkgver=1 +pkgrel=1 +arch=(any) + +pkgname=config-users-base + +package() { +cd "$pkgdir" + +install -dm755 etc +install -dm750 etc/sudoers.d +install -m644 /dev/stdin etc/sudoers.d/00-wheel <> etc/default/grub \ + 'GRUB_CMDLINE_LINUX_DEFAULT=""' \ + 'GRUB_TERMINAL_OUTPUT=console' +} + +pre_remove() { + sed -i \ + -e '/^GRUB_CMDLINE_LINUX_DEFAULT=""$/d' \ + -e '/^GRUB_TERMINAL_OUTPUT=console$/d' \ + etc/default/grub +} diff --git a/config-winston-fstab.PKGBUILD.wip b/config-winston-fstab.PKGBUILD.wip new file mode 100644 index 0000000..1996ee3 --- /dev/null +++ b/config-winston-fstab.PKGBUILD.wip @@ -0,0 +1,39 @@ +pkgver=1 +pkgrel=1 +arch=(any) +install=${BUILDFILE#${PWD}/} + +pkgname=config-winston-fstab +depends=(systemd-swap) + +package() { + cd "$pkgdir" + + ln -s /usr/lib/systemd/system/systemd-swap.service etc/systemd/system/local-fs.target.wants/systemd-swap.service + ln -s /usr/lib/systemd/system/remote-fs.target etc/systemd/system/multi-user.target.wants/remote-fs.target +} + +post_install() { + TODO + +cat >> etc/systemd-swap.conf <. + +outfile=$1 +tmpfile="$(dirname "$outfile")/.tmp${outfile##*/}" + +cat > "$tmpfile" || exit $? +if cmp -s "$tmpfile" "$outfile"; then + rm -f "$tmpfile" || : +else + mv -f "$tmpfile" "$outfile" +fi -- cgit v1.2.3