[ostree] parallel-debian: Support being run as non-root
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ostree] parallel-debian: Support being run as non-root
- Date: Thu, 10 Nov 2011 18:00:44 +0000 (UTC)
commit 1103284645f1c7505d7bce42ab878885602e8da3
Author: Colin Walters <walters verbum org>
Date: Thu Nov 10 11:52:48 2011 -0500
parallel-debian: Support being run as non-root
parallel-debian/.gitignore | 1 -
parallel-debian/Makefile | 6 +-
parallel-debian/chroot_break.c | 117 --------------------
parallel-debian/debian-setup.sh | 29 ++---
...{gnomeos-make-image.sh => gnomeos-make-base.sh} | 15 +--
5 files changed, 15 insertions(+), 153 deletions(-)
---
diff --git a/parallel-debian/.gitignore b/parallel-debian/.gitignore
index 95bdbbe..d42173a 100644
--- a/parallel-debian/.gitignore
+++ b/parallel-debian/.gitignore
@@ -1,2 +1 @@
-chroot_break
ostree_switch_root
diff --git a/parallel-debian/Makefile b/parallel-debian/Makefile
index 97ec6c0..a00e611 100644
--- a/parallel-debian/Makefile
+++ b/parallel-debian/Makefile
@@ -1,8 +1,4 @@
-
-all: ostree_switch_root chroot_break
+all: ostree_switch_root
ostree_switch_root: ostree_switch_root.c Makefile
gcc -Wall -o $@ $<
-
-chroot_break: chroot_break.c Makefile
- gcc -Wall -o $@ $<
diff --git a/parallel-debian/debian-setup.sh b/parallel-debian/debian-setup.sh
index c5aabb7..732a383 100755
--- a/parallel-debian/debian-setup.sh
+++ b/parallel-debian/debian-setup.sh
@@ -5,31 +5,31 @@
set -e
set -x
-echo gnomeos > /etc/hostname
+echo gnomeos >./etc/hostname
-cat > /etc/default/locale <<EOF
+cat >./etc/default/locale <<EOF
LANG="en_US.UTF-8"
EOF
-cp -p /usr/share/sysvinit/inittab /etc/inittab
-cp -p /usr/share/base-files/nsswitch.conf /etc/nsswitch.conf
+cp -p ./usr/share/sysvinit/inittab ./etc/inittab
+cp -p ./usr/share/base-files/nsswitch.conf ./etc/nsswitch.conf
-cat >/etc/pam.d/common-account <<EOF
+cat >./etc/pam.d/common-account <<EOF
account [success=1 new_authtok_reqd=done default=ignore] pam_unix.so
account requisite pam_deny.so
account required pam_permit.so
EOF
-cat >/etc/pam.d/common-auth <<EOF
+cat >./etc/pam.d/common-auth <<EOF
auth [success=1 default=ignore] pam_unix.so nullok_secure
auth requisite pam_deny.so
auth required pam_permit.so
EOF
-cat >/etc/pam.d/common-password <<EOF
+cat >./etc/pam.d/common-password <<EOF
password [success=1 default=ignore] pam_unix.so obscure sha512
password requisite pam_deny.so
password required pam_permit.so
EOF
-cat >/etc/pam.d/common-session <<EOF
+cat >./etc/pam.d/common-session <<EOF
session [default=1] pam_permit.so
session requisite pam_deny.so
session required pam_permit.so
@@ -37,14 +37,8 @@ session required pam_unix.so
EOF
# base-passwd
-cp -p /usr/share/base-passwd/passwd.master /etc/passwd
-cp -p /usr/share/base-passwd/group.master /etc/group
-
-# From debian-installer user-setup
-shadowconfig on
-chpasswd <<EOF
-root:root
-EOF
+cp -p ./usr/share/base-passwd/passwd.master ./etc/passwd
+cp -p ./usr/share/base-passwd/group.master ./etc/group
# Service rc.d defaults
setuprc () {
@@ -56,8 +50,7 @@ setuprc () {
shift
for x in $@; do
- cd /etc/rc${x}.d
- ln -s ../init.d/$name ${type}${priority}${name}
+ ln -s ../init.d/$name ./etc/rc${x}.d/${type}${priority}${name}
done
}
diff --git a/parallel-debian/gnomeos-make-image.sh b/parallel-debian/gnomeos-make-base.sh
similarity index 95%
rename from parallel-debian/gnomeos-make-image.sh
rename to parallel-debian/gnomeos-make-base.sh
index 8f10705..eb80b04 100755
--- a/parallel-debian/gnomeos-make-image.sh
+++ b/parallel-debian/gnomeos-make-base.sh
@@ -24,7 +24,7 @@ set -x
SRCDIR=`dirname $0`
WORKDIR=`pwd`
-DEPENDS="debootstrap qemu-img grubby"
+DEPENDS="debootstrap"
for x in $DEPENDS; do
if ! command -v $x; then
@@ -35,13 +35,6 @@ EOF
fi
done
-if test $(id -u) != 0; then
- cat <<EOF
-This script must be run as root.
-EOF
- exit 1
-fi
-
if test -z "${OSTREE}"; then
OSTREE=`command -v ostree || true`
fi
@@ -163,10 +156,8 @@ if ! test -d ${OBJ}; then
cd ${OBJ}.tmp/ostree;
rm -rf worktree
$OSTREE --repo=repo checkout gnomeos worktree
- cp ${SRCDIR}/debian-setup.sh worktree
- chroot worktree ./debian-setup.sh
- rm worktree/debian-setup.sh
- cd worktree;
+ cd worktree
+ ${SRCDIR}/debian-setup.sh
$OSTREE --repo=../repo commit -b gnomeos -s "Run debian-setup.sh"
cd ..
rm -rf worktree
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]