From 1299108c165f743102b3df11ba9491eeabfd35b6 Mon Sep 17 00:00:00 2001
From: James Meyer <james.meyer@operamail.com>
Date: Wed, 8 Aug 2012 18:48:52 -0500
Subject: filesystem

---
 abs/core/filesystem/PKGBUILD                       | 163 ++++++++++-----------
 abs/core/filesystem/__changelog                    |   2 +-
 abs/core/filesystem/filesystem.install             | 120 +++++++--------
 abs/core/filesystem/fstab                          |   5 +-
 abs/core/filesystem/group                          |   2 +
 abs/core/filesystem/gshadow                        |   3 +
 abs/core/filesystem/hosts                          |   3 +-
 abs/core/filesystem/issue                          |   3 +-
 abs/core/filesystem/modprobe.d.usb-load-ehci-first |   4 +-
 abs/core/filesystem/os-release                     |   8 +
 abs/core/filesystem/profile                        |  41 ++----
 abs/core/filesystem/securetty                      |   3 +-
 abs/core/filesystem/shells                         |   1 -
 13 files changed, 160 insertions(+), 198 deletions(-)
 create mode 100644 abs/core/filesystem/os-release

diff --git a/abs/core/filesystem/PKGBUILD b/abs/core/filesystem/PKGBUILD
index 01b8a0d..0098c1f 100644
--- a/abs/core/filesystem/PKGBUILD
+++ b/abs/core/filesystem/PKGBUILD
@@ -1,111 +1,96 @@
-# $Id: PKGBUILD 96685 2010-10-24 09:56:25Z pierre $
-# Maintainer: Aaron Griffin <aaron@archlinux.org>
-# Contributor: judd <jvinet@zeroflux.org>
+# $Id: PKGBUILD 163828 2012-07-20 23:48:47Z tomegun $
+# Maintainer: Tom Gundersen <teg@jklm.no>
 
 pkgname=filesystem
-pkgver=2010.10
+pkgver=2012.7
 pkgrel=1
-pkgdesc="Base filesystem"
+pkgdesc='Base filesystem'
 arch=('any')
 license=('GPL')
-url="http://www.archlinux.org"
+url='http://www.archlinux.org'
 groups=('base')
-install=filesystem.install
-# These dependencies are not needed for initial installation.
-# They are only required on upgrade to create missing groups.
-#depends=('sh' 'coreutils')
-depends=('iana-etc')
-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 )
-source=(group  nsswitch.conf securetty host.conf ld.so.conf
-        passwd shadow fstab crypttab hosts motd resolv.conf shells
-        gshadow profile modprobe.d.usb-load-ehci-first)
-md5sums=('75c7e1770305e1f3b75c52785c137611'
-         '1bdc5dba66947d74866a5df8ce9ef3b1'
-         '13753e4e0964f3652b0cc60a28528bdf'
-         '933dee67c58d452334d342c294342910'
-         'f28150d4c0b22a017be51b9f7f9977ed'
-         '6e488ffecc8ba142c0cf7e2d7aeb832e'
-         '8a9042a2cedf6b6b47eb8973f14289cb'
-         'b8355d9d2782f424f4cedcf682651be0'
-         'ef40305da5803ca69d22e428ffc2ab9b'
-         'e5d8323a4dbee7a6d0d2a19cbf4b819f'
-         '81b3cb42a6ddabc2ed2310511ee9c859'
-         'd41d8cd98f00b204e9800998ecf8427e'
-         '6f48288b6fcaf0065fcb7b0e525413e0'
-         '40dac0de4c6b99c8ca97effbd7527c84'
-         '5340b9287b71ffe9d4d99510bffe933f'
-         'ccc4e6292ae594f16b44c66c7769765c'
-         '8098ffd9fbf890468d3198277596b85a')
-
-build()
-{
-  cd ${pkgdir}
-  mkdir -p bin boot dev etc home lib media mnt proc root sbin tmp usr var opt srv sys
-  chmod 555 proc
-  mkdir -p usr/{bin,include,lib,sbin,share/misc,src}
-
-  mkdir -p usr/share/man/man{1,2,3,4,5,6,7,8}
-
-  # fhs compliance
-  mkdir -p usr/local/{bin,games,include,lib,man,sbin,share,src}
-  ln -s ../man ${pkgdir}/usr/local/share/man
-  mkdir -p var/{cache/man,local,lock,opt,run,spool/mail,tmp,games}
-  chmod 1777 var/lock
-  mkdir -p var/log/old
-  mkdir -p etc/{ld.so.conf.d,skel,profile.d}
-  mkdir -p lib/modules
-  mkdir -p var/lib/misc
-  (cd ${pkgdir}/var; ln -s spool/mail mail)
+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')
 
-  # vsftpd won't run with write perms on /srv/ftp
-  mkdir -p srv/ftp
-  chown root.ftp srv/ftp
-  chmod 555 srv/ftp
+package() {
+	cd ${pkgdir}
 
-  install -d -o root -g root -m 755 srv/http
+	#
+	# 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
 
-  chmod 1777 var/spool/mail tmp var/tmp
-  chmod 0750 root
+	# 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
 
-  #Allow setgid games to write scores:
-  chmod 775 ${pkgdir}/var/games
-  chown root:50 ${pkgdir}/var/games
+	# 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
 
-  cd ${srcdir}
-  cp fstab crypttab group host.conf hosts  ld.so.conf motd nsswitch.conf \
-    passwd resolv.conf securetty shadow shells profile \
-    ${pkgdir}/etc/
-  install -m 600 ${srcdir}/gshadow ${pkgdir}/etc/gshadow
-  chmod 600 ${pkgdir}/etc/shadow
-  chmod 600 ${pkgdir}/etc/crypttab
+	#
+	# 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
 
-  # re-add /etc/arch-release, some software uses it
-  # to check whether arch is running
-  touch ${pkgdir}/etc/arch-release
-  
-  # Add /etc/modprobe.d/
-  install -D -m644 ${srcdir}/modprobe.d.usb-load-ehci-first \
-    ${pkgdir}/etc/modprobe.d/usb-load-ehci-first.conf
 
-  # Prevent pacman from removing directory (FS#16886)
-  mkdir ${pkgdir}/var/empty
-  touch ${pkgdir}/var/empty/.keep
+	#
+	# 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=('75c7e1770305e1f3b75c52785c137611'
+md5sums=('45940618da782cc391c59f88ab3333c3'
+         'b153cc716cd73e8ec17bc27fa127d052'
          '13753e4e0964f3652b0cc60a28528bdf'
-         'f97799ef3d8990f2eda9166122d8d5aa'
+         '4c4540eeb748bf1f71d631b8c1dcf0b3'
          'f28150d4c0b22a017be51b9f7f9977ed'
          '6e488ffecc8ba142c0cf7e2d7aeb832e'
          '8a9042a2cedf6b6b47eb8973f14289cb'
          'b8355d9d2782f424f4cedcf682651be0'
-         'ef40305da5803ca69d22e428ffc2ab9b'
+         'ca716f853860199c1286e7939b2f2666'
          'e5d8323a4dbee7a6d0d2a19cbf4b819f'
-         '81b3cb42a6ddabc2ed2310511ee9c859'
+         '7bc65f234dfb6abf24e7c3b03e86f4ff'
          'd41d8cd98f00b204e9800998ecf8427e'
+         'c1e795aa3bae70bf0fb76b8a720e4825'
          '6f48288b6fcaf0065fcb7b0e525413e0'
-         '40dac0de4c6b99c8ca97effbd7527c84'
-         '5340b9287b71ffe9d4d99510bffe933f'
-         'ccc4e6292ae594f16b44c66c7769765c'
-         '8098ffd9fbf890468d3198277596b85a')
+         '22518e922891f9359f971f4f5b4e793c'
+         'f95416882cef800edef08382a1176b7d'
+         'f3b6ae7db8adffaaa4bffc6099dcbd50'
+         'a8a962370cd0128465d514e6a1f74130')
diff --git a/abs/core/filesystem/__changelog b/abs/core/filesystem/__changelog
index 87707ff..941c6ba 100644
--- a/abs/core/filesystem/__changelog
+++ b/abs/core/filesystem/__changelog
@@ -1,2 +1,2 @@
-removed /etc/issue
 added tty10 to securetty
+os.system
diff --git a/abs/core/filesystem/filesystem.install b/abs/core/filesystem/filesystem.install
index e0ce1e2..c8717f0 100644
--- a/abs/core/filesystem/filesystem.install
+++ b/abs/core/filesystem/filesystem.install
@@ -1,74 +1,60 @@
-# arg 1:  the new package version
 post_install() {
-  [ -f var/log/lastlog ] ||  : >var/log/lastlog
-  [ -f var/log/wtmp ]    ||  : >var/log/wtmp
-  [ -f var/run/utmp ]    ||  : >var/run/utmp
-  [ -f var/log/btmp ]    || (: >var/log/btmp && bin/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 var/lock
+	[ -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: <group> [options]
+_addgroup() {
+	if ! getent group "$1" >/dev/null; then
+		groupadd "$@" >/dev/null
+	fi
+}
+
+# args: <group> [options]
+_adduser() {
+	if ! getent passwd "$1" >/dev/null; then
+		useradd "$@" >/dev/null
+	fi
 }
 
-# arg 1:  the new package version
-# arg 2:  the old package version
 post_upgrade() {
-  post_install $1
-  if [ ! "`grep ^optical: etc/group`" ]; then
-    echo "adding new groups: audio optical"
-    usr/sbin/groupadd -g 92 audio   >/dev/null
-    usr/sbin/groupadd -g 93 optical >/dev/null
-  fi
-  if [ ! "`grep ^video: etc/group`" ]; then
-    echo "adding new groups: video floppy storage"
-    usr/sbin/groupadd -g 91 video   >/dev/null
-    usr/sbin/groupadd -g 94 floppy  >/dev/null
-    usr/sbin/groupadd -g 95 storage >/dev/null
-  fi
-  if [ ! "`grep ^log: etc/group`" ]; then
-    echo "adding new group: log"
-    usr/sbin/groupadd -g 19 log     >/dev/null
-  fi
-  if [ ! "`grep ^power: etc/group`" ]; then
-    echo "adding new group: power"
-    usr/sbin/groupadd -g 98 power   >/dev/null
-  fi
-  if [ ! "`grep ^network: etc/group`" ]; then
-    echo "adding new group: network"
-    usr/sbin/groupadd -g 90 network >/dev/null
-  fi
-  if [ ! "`grep ^games: etc/group`" ]; then
-    echo "adding new group: games"
-    usr/sbin/groupadd -g 50 games >/dev/null
-  fi
-  if [ ! "`grep ^uucp: etc/group`" ]; then
-    echo "adding new group: uucp"
-    usr/sbin/groupadd -g 14 uucp >/dev/null
-  fi
-  if [ ! "`grep ^http: etc/group`" ]; then
-    echo "adding new group: http"
-    usr/sbin/groupadd -g 33 http >/dev/null
-  fi
-  if [ ! "`grep ^http: etc/passwd`" ]; then
-    echo "adding new user http"
-    usr/sbin/useradd -u 33 -d /srv/http -g http -s /bin/false http >/dev/null
-  fi
-  if [ ! "`grep ^scanner: etc/group`" ]; then
-    echo "adding new group: scanner"
-    usr/sbin/groupadd -g 96 scanner >/dev/null
-  fi
-  if [ ! "`grep ^rfkill: etc/group`" ]; then
-    echo "adding new group: rfkill"
-    usr/sbin/groupadd -g 24 rfkill >/dev/null
-  fi
+	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
 
-  grep -q '^include /etc/ld.so.conf.d/\*.conf$' etc/ld.so.conf \
-    || echo 'include /etc/ld.so.conf.d/*.conf' >> etc/ld.so.conf
+	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
+	# 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/abs/core/filesystem/fstab b/abs/core/filesystem/fstab
index a23e795..f7f9298 100644
--- a/abs/core/filesystem/fstab
+++ b/abs/core/filesystem/fstab
@@ -1,6 +1,5 @@
 # 
 # /etc/fstab: static file system information
 #
-# <file system>        <dir>         <type>    <options>          <dump> <pass>
-devpts                 /dev/pts      devpts    defaults            0      0
-shm                    /dev/shm      tmpfs     nodev,nosuid        0      0
+# <file system>	<dir>	<type>	<options>	<dump>	<pass>
+tmpfs		/tmp	tmpfs	nodev,nosuid	0	0
diff --git a/abs/core/filesystem/group b/abs/core/filesystem/group
index 4bd635c..6e8e773 100644
--- a/abs/core/filesystem/group
+++ b/abs/core/filesystem/group
@@ -13,11 +13,13 @@ 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:
diff --git a/abs/core/filesystem/gshadow b/abs/core/filesystem/gshadow
index a6d78a3..c5c7635 100644
--- a/abs/core/filesystem/gshadow
+++ b/abs/core/filesystem/gshadow
@@ -13,10 +13,13 @@ ftp:::
 mail:::
 uucp:::
 log:::root
+utmp:x::
 locate:::
+rfkill:x::
 smmsp:::
 http:::
 games:::
+lock:::
 network:x::
 video:x::
 audio:::
diff --git a/abs/core/filesystem/hosts b/abs/core/filesystem/hosts
index ec12849..1747f91 100644
--- a/abs/core/filesystem/hosts
+++ b/abs/core/filesystem/hosts
@@ -3,6 +3,7 @@
 #
 
 #<ip-address>	<hostname.domain.org>	<hostname>
-127.0.0.1		localhost.localdomain	localhost
+127.0.0.1	localhost.localdomain	localhost
+::1		localhost.localdomain	localhost
 
 # End of file
diff --git a/abs/core/filesystem/issue b/abs/core/filesystem/issue
index 3db753d..36067f0 100644
--- a/abs/core/filesystem/issue
+++ b/abs/core/filesystem/issue
@@ -1,3 +1,2 @@
-[H[2J
-Arch Linux \r  (\n) (\l)
+LinHES\r (\l)
 
diff --git a/abs/core/filesystem/modprobe.d.usb-load-ehci-first b/abs/core/filesystem/modprobe.d.usb-load-ehci-first
index 3b5db0e..9473794 100644
--- a/abs/core/filesystem/modprobe.d.usb-load-ehci-first
+++ b/abs/core/filesystem/modprobe.d.usb-load-ehci-first
@@ -1,2 +1,2 @@
-install ohci_hcd /sbin/modprobe ehci_hcd ; /sbin/modprobe --ignore-install ohci_hcd $CMDLINE_OPTS
-install uhci_hcd /sbin/modprobe ehci_hcd ; /sbin/modprobe --ignore-install uhci_hcd $CMDLINE_OPTS
+softdep ohci_hcd pre: ehci_hcd
+softdep uhci_hcd pre: ehci_hcd
diff --git a/abs/core/filesystem/os-release b/abs/core/filesystem/os-release
new file mode 100644
index 0000000..c36b91c
--- /dev/null
+++ b/abs/core/filesystem/os-release
@@ -0,0 +1,8 @@
+NAME="LinHES"
+ID=linhes
+PRETTY_NAME="LinHES The Home Entertainment System"
+ANSI_COLOR="0;36"
+HOME_URL="http://www.linhes.org/"
+SUPPORT_URL="http://forum.archlinux.org/"
+BUG_REPORT_URL="http://bugs.linhes.org/"
+
diff --git a/abs/core/filesystem/profile b/abs/core/filesystem/profile
index e7a958a..3bc22db 100644
--- a/abs/core/filesystem/profile
+++ b/abs/core/filesystem/profile
@@ -1,44 +1,23 @@
-# 
 # /etc/profile
-#
-# This file is intended to be used for ALL common
-# Bourne-compatible shells. Shell specifics should be
-# handled in /etc/profile.$SHELL where $SHELL is the name
-# of the binary being run (discounting symlinks)
-#
-# Sections taken from SuSe's /etc/profile
-# Note the explicit use of 'test' to cover all bases
-#  and potentially incompatible shells
-
-#Determine our shell without using $SHELL, which may lie
-shell="sh"
-if test -f /proc/mounts; then
-   case $(/bin/ls -l /proc/$$/exe) in
-        *bash) shell=bash ;;
-        *dash) shell=dash ;;
-        *ash)  shell=ash ;;
-        *ksh)  shell=ksh ;;
-        *zsh)  shell=zsh ;;
-    esac
-fi
-
-# Load shell specific profile settings
-test -f "/etc/profile.$shell" &&  . "/etc/profile.$shell"
-unset shell
 
 #Set our umask
 umask 022
 
 # Set our default path
-PATH="/bin:/usr/bin:/sbin:/usr/sbin"
+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 -x $profile && . $profile
-    done
-    unset profile
+	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.
diff --git a/abs/core/filesystem/securetty b/abs/core/filesystem/securetty
index 7fcd451..5a2235c 100644
--- a/abs/core/filesystem/securetty
+++ b/abs/core/filesystem/securetty
@@ -9,6 +9,7 @@ tty3
 tty4
 tty5
 tty6
+ttyS0
 hvc0
-tty10
+
 # End of file
diff --git a/abs/core/filesystem/shells b/abs/core/filesystem/shells
index ff9e383..18c1aef 100644
--- a/abs/core/filesystem/shells
+++ b/abs/core/filesystem/shells
@@ -4,6 +4,5 @@
 
 /bin/sh
 /bin/bash
-/bin/dash
 
 # End of file
-- 
cgit v0.12

