From 403672750f78c548e19d4806d0f428b55b89ceb5 Mon Sep 17 00:00:00 2001 From: Kevin Mihelich Date: Mon, 23 Jul 2012 23:42:50 -0400 Subject: [PATCH] added core/filesystem, fixes #205 --- core/filesystem/PKGBUILD | 99 +++++++++++++++++++ core/filesystem/crypttab | 33 +++++++ core/filesystem/filesystem.install | 60 +++++++++++ core/filesystem/fstab | 5 + core/filesystem/group | 32 ++++++ core/filesystem/gshadow | 32 ++++++ core/filesystem/host.conf | 8 ++ core/filesystem/hosts | 9 ++ core/filesystem/issue | 2 + core/filesystem/ld.so.conf | 7 ++ .../filesystem/modprobe.d.usb-load-ehci-first | 2 + core/filesystem/motd | 0 core/filesystem/nsswitch.conf | 19 ++++ core/filesystem/os-release | 9 ++ core/filesystem/passwd | 7 ++ core/filesystem/profile | 27 +++++ core/filesystem/resolv.conf | 8 ++ core/filesystem/securetty | 15 +++ core/filesystem/shadow | 7 ++ core/filesystem/shells | 8 ++ 20 files changed, 389 insertions(+) create mode 100644 core/filesystem/PKGBUILD create mode 100644 core/filesystem/crypttab create mode 100644 core/filesystem/filesystem.install create mode 100644 core/filesystem/fstab create mode 100644 core/filesystem/group create mode 100644 core/filesystem/gshadow create mode 100644 core/filesystem/host.conf create mode 100644 core/filesystem/hosts create mode 100644 core/filesystem/issue create mode 100644 core/filesystem/ld.so.conf create mode 100644 core/filesystem/modprobe.d.usb-load-ehci-first create mode 100644 core/filesystem/motd create mode 100644 core/filesystem/nsswitch.conf create mode 100644 core/filesystem/os-release create mode 100644 core/filesystem/passwd create mode 100644 core/filesystem/profile create mode 100644 core/filesystem/resolv.conf create mode 100644 core/filesystem/securetty create mode 100644 core/filesystem/shadow create mode 100644 core/filesystem/shells diff --git a/core/filesystem/PKGBUILD b/core/filesystem/PKGBUILD new file mode 100644 index 000000000..b96085d86 --- /dev/null +++ b/core/filesystem/PKGBUILD @@ -0,0 +1,99 @@ +# $Id: PKGBUILD 162213 2012-06-23 17:56:53Z tomegun $ +# Maintainer: Tom Gundersen + +# ALARM: Kevin Mihelich +# - add our information to os-release + +pkgname=filesystem +pkgver=2012.6 +pkgrel=4.1 +pkgdesc='Base filesystem' +arch=('any') +license=('GPL') +url='http://www.archlinux.org' +groups=('base') +install='filesystem.install' +depends=('iana-etc' 'bash' 'coreutils') +backup=('etc/fstab' 'etc/crypttab' 'etc/group' 'etc/hosts' 'etc/ld.so.conf' 'etc/passwd' + 'etc/shadow' 'etc/gshadow' 'etc/resolv.conf' 'etc/motd' 'etc/nsswitch.conf' + 'etc/shells' 'etc/host.conf' 'etc/securetty' 'etc/profile' 'etc/issue') +source=('group' 'issue' 'nsswitch.conf' 'securetty' 'host.conf' 'ld.so.conf' + 'passwd' 'shadow' 'fstab' 'crypttab' 'hosts' 'motd' 'os-release' 'resolv.conf' + 'shells' 'gshadow' 'profile' 'modprobe.d.usb-load-ehci-first') + +package() { + cd ${pkgdir} + + # + # setup root filesystem + # + for d in boot dev etc home media mnt usr var opt srv/http run; do + install -d -m755 ${d} + done + install -d -m555 proc + install -d -m555 sys + install -d -m0750 root + install -d -m1777 tmp + # vsftpd won't run with write perms on /srv/ftp + install -d -m555 -g ftp srv/ftp + + # setup /etc + install -d etc/{ld.so.conf.d,skel,profile.d} + for f in fstab group host.conf hosts issue ld.so.conf motd nsswitch.conf os-release passwd resolv.conf securetty shells profile; do + install -m644 ${srcdir}/${f} etc/ + done + ln -s /proc/self/mounts etc/mtab + for f in gshadow shadow crypttab; do + install -m600 ${srcdir}/${f} etc/ + done + touch etc/arch-release + install -D -m644 ${srcdir}/modprobe.d.usb-load-ehci-first usr/lib/modprobe.d/usb-load-ehci-first.conf + + # setup /var + for d in cache/man local opt log/old lib/misc empty; do + install -d -m755 var/${d} + done + install -d -m1777 var/{tmp,spool/mail} + # allow setgid games to write scores + install -d -m775 -g games var/games + ln -s spool/mail var/mail + ln -s ../run var/run + ln -s ../run/lock var/lock + + # + # setup /usr hierarchy + # + for d in bin include lib sbin share/misc src; do + install -d -m755 usr/${d} + done + for d in $(seq 8); do + install -d -m755 usr/share/man/man${d} + done + + + # + # setup /usr/local hierarchy + # + for d in bin etc games include lib man sbin share src; do + install -d -m755 usr/local/${d} + done + ln -s ../man usr/local/share/man +} +md5sums=('45940618da782cc391c59f88ab3333c3' + '7813c481156f6b280a3ba91fc6236368' + '13753e4e0964f3652b0cc60a28528bdf' + '4c4540eeb748bf1f71d631b8c1dcf0b3' + 'f28150d4c0b22a017be51b9f7f9977ed' + '6e488ffecc8ba142c0cf7e2d7aeb832e' + '8a9042a2cedf6b6b47eb8973f14289cb' + 'b8355d9d2782f424f4cedcf682651be0' + 'ca716f853860199c1286e7939b2f2666' + 'e5d8323a4dbee7a6d0d2a19cbf4b819f' + '7bc65f234dfb6abf24e7c3b03e86f4ff' + 'd41d8cd98f00b204e9800998ecf8427e' + '52db9503314f639b8f47bd9a251a6ea9' + '6f48288b6fcaf0065fcb7b0e525413e0' + '22518e922891f9359f971f4f5b4e793c' + 'f95416882cef800edef08382a1176b7d' + 'f3b6ae7db8adffaaa4bffc6099dcbd50' + 'a8a962370cd0128465d514e6a1f74130') diff --git a/core/filesystem/crypttab b/core/filesystem/crypttab new file mode 100644 index 000000000..dd6994b5a --- /dev/null +++ b/core/filesystem/crypttab @@ -0,0 +1,33 @@ +# crypttab: Mappings for encrypted partitions +# +# Each mapped device will be created in /dev/mapper, so your /etc/fstab +# should use the /dev/mapper/{NAME} paths for encrypted devices. +# +# Each PASSWORD field can be an absolute pathname to a key file (starting +# with a slash, recommended) or a literal string that will be used as +# a passphrase. To use special characters in the passphrase, surround it +# by quotes, the usual bash quoting rules apply. +# There are two special keywords that cannot be used as passphrases: +# - ASK ask for a passphrase on boot +# - SWAP use a random key and create a swapspace afterwards +# WARNING: use the SWAP keyword carefully, as it overwrites the data +# on the specified partition +# +# To create a key file: +# hashalot -n 32 ripemd160 >/etc/crytfs.key +# or +# dd if=/dev/urandom of=/etc/cryptfs.key bs=256 count=1 +# +# To pass additional options to cryptsetup for non-LUKS partitions, use the +# fourth column. +# +# NOTE: Do not list your root (/) partition here, it must be set up +# beforehand by the initramfs (/etc/mkinitcpio.conf). + + +# NAME SOURCE DEVICE PASSWORD OPTIONS +#home /dev/hda4 mypassword +#data1 /dev/hda3 "my \"password\"" +#data2 /dev/hda5 /etc/cryptfs.key +#swap /dev/hdx4 SWAP -c aes-cbc-essiv:sha256 -s 256 +#vol /dev/hdb7 ASK diff --git a/core/filesystem/filesystem.install b/core/filesystem/filesystem.install new file mode 100644 index 000000000..c8717f01b --- /dev/null +++ b/core/filesystem/filesystem.install @@ -0,0 +1,60 @@ +post_install() { + [ -f var/log/lastlog ] || : >var/log/lastlog + [ -f var/log/wtmp ] || : >var/log/wtmp + [ -f var/log/btmp ] || { : >var/log/btmp && chmod 600 var/log/btmp; } + # workaround for bug #7194 + # readded due to bug #9465 + # please do not remove! + chmod 1777 var/spool/mail tmp var/tmp +} + +# args: [options] +_addgroup() { + if ! getent group "$1" >/dev/null; then + groupadd "$@" >/dev/null + fi +} + +# args: [options] +_adduser() { + if ! getent passwd "$1" >/dev/null; then + useradd "$@" >/dev/null + fi +} + +post_upgrade() { + post_install + + _addgroup optical -g 93 + _addgroup audio -g 92 + _addgroup video -g 91 + _addgroup floppy -g 94 + _addgroup storage -g 95 + _addgroup log -g 19 + _addgroup utmp -g 20 + _addgroup power -g 98 + _addgroup network -g 90 + _addgroup games -g 50 + _addgroup uucp -g 14 + _addgroup http -g 33 + _adduser http -u 33 -d /srv/http -g http -s /bin/false + _addgroup scanner -g 96 + _addgroup rfkill -g 24 + _addgroup lock -g 54 + + # sync gshadow to group (fixes FS#19869 + if ! grep -q '^lock:' etc/gshadow; then + grpconv >/dev/null + fi + + if ! grep -q '^include /etc/ld.so.conf.d/\*.conf$' etc/ld.so.conf; then + echo 'include /etc/ld.so.conf.d/*.conf' >> etc/ld.so.conf + fi + + # set "Last password change" > 0; otherwise su $user wont work + for user in bin daemon mail ftp http nobody; do + if LANG=C chage -l ${user} | grep -q 'password must be changed'; then + chage -d 14871 ${user} + fi + done +} diff --git a/core/filesystem/fstab b/core/filesystem/fstab new file mode 100644 index 000000000..f7f9298d4 --- /dev/null +++ b/core/filesystem/fstab @@ -0,0 +1,5 @@ +# +# /etc/fstab: static file system information +# +# +tmpfs /tmp tmpfs nodev,nosuid 0 0 diff --git a/core/filesystem/group b/core/filesystem/group new file mode 100644 index 000000000..6e8e773d8 --- /dev/null +++ b/core/filesystem/group @@ -0,0 +1,32 @@ +root:x:0:root +bin:x:1:root,bin,daemon +daemon:x:2:root,bin,daemon +sys:x:3:root,bin +adm:x:4:root,daemon +tty:x:5: +disk:x:6:root +lp:x:7:daemon +mem:x:8: +kmem:x:9: +wheel:x:10:root +ftp:x:11: +mail:x:12: +uucp:x:14: +log:x:19:root +utmp:x:20: +locate:x:21: +rfkill:x:24: +smmsp:x:25: +http:x:33: +games:x:50: +lock:x:54: +network:x:90: +video:x:91: +audio:x:92: +optical:x:93: +floppy:x:94: +storage:x:95: +scanner:x:96: +power:x:98: +nobody:x:99: +users:x:100: diff --git a/core/filesystem/gshadow b/core/filesystem/gshadow new file mode 100644 index 000000000..c5c76354e --- /dev/null +++ b/core/filesystem/gshadow @@ -0,0 +1,32 @@ +root:::root +bin:::root,bin,daemon +daemon:::root,bin,daemon +sys:::root,bin +adm:::root,daemon +tty::: +disk:::root +lp:::daemon +mem::: +kmem::: +wheel:::root +ftp::: +mail::: +uucp::: +log:::root +utmp:x:: +locate::: +rfkill:x:: +smmsp::: +http::: +games::: +lock::: +network:x:: +video:x:: +audio::: +optical::: +floppy:x:: +storage:x:: +scanner:x:: +power:x:: +nobody::: +users::: diff --git a/core/filesystem/host.conf b/core/filesystem/host.conf new file mode 100644 index 000000000..cf52fe561 --- /dev/null +++ b/core/filesystem/host.conf @@ -0,0 +1,8 @@ +# +# /etc/host.conf +# + +order hosts,bind +multi on + +# End of file diff --git a/core/filesystem/hosts b/core/filesystem/hosts new file mode 100644 index 000000000..1747f9196 --- /dev/null +++ b/core/filesystem/hosts @@ -0,0 +1,9 @@ +# +# /etc/hosts: static lookup table for host names +# + +# +127.0.0.1 localhost.localdomain localhost +::1 localhost.localdomain localhost + +# End of file diff --git a/core/filesystem/issue b/core/filesystem/issue new file mode 100644 index 000000000..dd702dcfb --- /dev/null +++ b/core/filesystem/issue @@ -0,0 +1,2 @@ +Arch Linux \r (\l) + diff --git a/core/filesystem/ld.so.conf b/core/filesystem/ld.so.conf new file mode 100644 index 000000000..dfac45683 --- /dev/null +++ b/core/filesystem/ld.so.conf @@ -0,0 +1,7 @@ +# +# /etc/ld.so.conf +# + +include /etc/ld.so.conf.d/*.conf + +# End of file diff --git a/core/filesystem/modprobe.d.usb-load-ehci-first b/core/filesystem/modprobe.d.usb-load-ehci-first new file mode 100644 index 000000000..947379411 --- /dev/null +++ b/core/filesystem/modprobe.d.usb-load-ehci-first @@ -0,0 +1,2 @@ +softdep ohci_hcd pre: ehci_hcd +softdep uhci_hcd pre: ehci_hcd diff --git a/core/filesystem/motd b/core/filesystem/motd new file mode 100644 index 000000000..e69de29bb diff --git a/core/filesystem/nsswitch.conf b/core/filesystem/nsswitch.conf new file mode 100644 index 000000000..6e459adb6 --- /dev/null +++ b/core/filesystem/nsswitch.conf @@ -0,0 +1,19 @@ +# Begin /etc/nsswitch.conf + +passwd: files +group: files +shadow: files + +publickey: files + +hosts: files dns +networks: files + +protocols: files +services: files +ethers: files +rpc: files + +netgroup: files + +# End /etc/nsswitch.conf diff --git a/core/filesystem/os-release b/core/filesystem/os-release new file mode 100644 index 000000000..308fae7a7 --- /dev/null +++ b/core/filesystem/os-release @@ -0,0 +1,9 @@ +NAME="Arch Linux ARM" +ID=archarm +ID_LIKE=arch +PRETTY_NAME="Arch Linux ARM" +ANSI_COLOR="0;36" +HOME_URL="http://archlinuxarm.org/" +SUPPORT_URL="https://archlinuxarm.org/forum" +BUG_REPORT_URL="https://github.com/archlinuxarm/PKGBUILDs/issues" + diff --git a/core/filesystem/passwd b/core/filesystem/passwd new file mode 100644 index 000000000..a4a24e34f --- /dev/null +++ b/core/filesystem/passwd @@ -0,0 +1,7 @@ +root:x:0:0:root:/root:/bin/bash +bin:x:1:1:bin:/bin:/bin/false +daemon:x:2:2:daemon:/sbin:/bin/false +mail:x:8:12:mail:/var/spool/mail:/bin/false +ftp:x:14:11:ftp:/srv/ftp:/bin/false +http:x:33:33:http:/srv/http:/bin/false +nobody:x:99:99:nobody:/:/bin/false diff --git a/core/filesystem/profile b/core/filesystem/profile new file mode 100644 index 000000000..3bc22db9f --- /dev/null +++ b/core/filesystem/profile @@ -0,0 +1,27 @@ +# /etc/profile + +#Set our umask +umask 022 + +# Set our default path +PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin" +export PATH + +# Load profiles from /etc/profile.d +if test -d /etc/profile.d/; then + for profile in /etc/profile.d/*.sh; do + test -r "$profile" && . "$profile" + done + unset profile +fi + +# Source global bash config +if test "$PS1" && test "$BASH" && test -r /etc/bash.bashrc; then + . /etc/bash.bashrc +fi + +# Termcap is outdated, old, and crusty, kill it. +unset TERMCAP + +# Man is much better than us at figuring this out +unset MANPATH diff --git a/core/filesystem/resolv.conf b/core/filesystem/resolv.conf new file mode 100644 index 000000000..cecafba03 --- /dev/null +++ b/core/filesystem/resolv.conf @@ -0,0 +1,8 @@ +# +# /etc/resolv.conf +# + +#search +#nameserver + +# End of file diff --git a/core/filesystem/securetty b/core/filesystem/securetty new file mode 100644 index 000000000..5a2235ce7 --- /dev/null +++ b/core/filesystem/securetty @@ -0,0 +1,15 @@ +# +# /etc/securetty +# + +console +tty1 +tty2 +tty3 +tty4 +tty5 +tty6 +ttyS0 +hvc0 + +# End of file diff --git a/core/filesystem/shadow b/core/filesystem/shadow new file mode 100644 index 000000000..ccab68d33 --- /dev/null +++ b/core/filesystem/shadow @@ -0,0 +1,7 @@ +root::14871:::::: +bin:x:14871:::::: +daemon:x:14871:::::: +mail:x:14871:::::: +ftp:x:14871:::::: +http:x:14871:::::: +nobody:x:14871:::::: diff --git a/core/filesystem/shells b/core/filesystem/shells new file mode 100644 index 000000000..18c1aeffa --- /dev/null +++ b/core/filesystem/shells @@ -0,0 +1,8 @@ +# +# /etc/shells +# + +/bin/sh +/bin/bash + +# End of file