summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2011-03-21 17:38:49 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2011-03-21 17:38:49 +0100
commitf3feabdc1a3fed977010ffc3fa73c70c674b5562 (patch)
treec4b4c8db3c56144de3ff4762833c136908948a8c
parent2081ff5d2b74687915aa0deee96bff96d720e8c3 (diff)
Use useradd instead of adduser to fix debootstrap
* debian/hurd.postinst: use useradd from required passwd package instead of adduser, which is not required and thus not available at debootstrap. * debian/control: Bump Standards-Version to 3.9.1 (no change needed).
-rw-r--r--debian/changelog8
-rw-r--r--debian/control2
-rw-r--r--debian/hurd.postinst30
3 files changed, 36 insertions, 4 deletions
diff --git a/debian/changelog b/debian/changelog
index 873dacb3..a26c2460 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+hurd (20110319-2) unstable; urgency=low
+
+ * debian/hurd.postinst: use useradd from required passwd package instead of
+ adduser, which is not required and thus not available at debootstrap.
+ * debian/control: Bump Standards-Version to 3.9.1 (no change needed).
+
+ -- Samuel Thibault <sthibault@debian.org> Mon, 21 Mar 2011 17:33:19 +0100
+
hurd (20110319-1) unstable; urgency=low
[ Samuel Thibault ]
diff --git a/debian/control b/debian/control
index 4aadcf9f..5f302748 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: hurd
Section: admin
Priority: required
Maintainer: GNU Hurd Maintainers <debian-hurd@lists.debian.org>
-Standards-Version: 3.8.4
+Standards-Version: 3.9.1
Build-Depends: mig (>= 1.3-2), gnumach-dev (>= 2:1.3.99.dfsg.cvs20070526),
libc0.3-dev (>= 2.9), texinfo, texi2html, libncursesw5-dev, cdbs,
debhelper (>= 4.2.0), gcc-4.4, dpkg (>= 1.15.4) | install-info,
diff --git a/debian/hurd.postinst b/debian/hurd.postinst
index 98945eed..965f8ab9 100644
--- a/debian/hurd.postinst
+++ b/debian/hurd.postinst
@@ -20,12 +20,36 @@ update-alternatives \
update-alternatives \
--install /usr/bin/w w /usr/bin/w-hurd 60
+ADDUSERCONF='/etc/adduser.conf'
+
+if test -f $ADDUSERCONF; then
+ FIRST_SYSTEM_UID=$(sed -n "s/^[[:space:]]*FIRST_SYSTEM_UID[[:space:]]*=[[:space:]]*[\"']\?\([^\"']*\)[\"']\?/\1/p" $ADDUSERCONF)
+ LAST_SYSTEM_UID=$(sed -n "s/^[[:space:]]*LAST_SYSTEM_UID[[:space:]]*=[[:space:]]*[\"']\?\([^\"']*\)[\"']\?/\1/p" $ADDUSERCONF)
+ FIRST_SYSTEM_GID=$(sed -n "s/^[[:space:]]*FIRST_SYSTEM_GID[[:space:]]*=[[:space:]]*[\"']\?\([^\"']*\)[\"']\?/\1/p" $ADDUSERCONF)
+ LAST_SYSTEM_GID=$(sed -n "s/^[[:space:]]*LAST_SYSTEM_GID[[:space:]]*=[[:space:]]*[\"']\?\([^\"']*\)[\"']\?/\1/p" $ADDUSERCONF)
+fi
+
+if test -z "$FIRST_SYSTEM_UID"; then
+ FIRST_SYSTEM_UID=100
+fi
+if test -z "$LAST_SYSTEM_UID"; then
+ LAST_SYSTEM_UID=999
+fi
+if test -z "$FIRST_SYSTEM_GID"; then
+ FIRST_SYSTEM_GID=100
+fi
+if test -z "$LAST_SYSTEM_GID"; then
+ LAST_SYSTEM_GID=999
+fi
+
if [ "$1" = configure ]; then
add-shell /bin/loginpr || true
if ! getent passwd login >/dev/null; then
- adduser --disabled-password --quiet --system \
- --home /etc/login --no-create-home --shell /bin/loginpr \
- --gecos "login user" --group login
+ useradd -K UID_MIN=$FIRST_SYSTEM_UID -K UID_MAX=$LAST_SYSTEM_UID \
+ -K GID_MIN=$FIRST_SYSTEM_GID -K GID_MAX=$LAST_SYSTEM_GID \
+ --home-dir /etc/login --no-create-home \
+ --shell /bin/loginpr --comment "login user" \
+ --user-group login
fi
fi