projects
/
grml-debootstrap.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Support --nopassword option to not prompt for the root password
[grml-debootstrap.git]
/
chroot-script
diff --git
a/chroot-script
b/chroot-script
index
fe0becb
..
84086cc
100755
(executable)
--- a/
chroot-script
+++ b/
chroot-script
@@
-182,7
+182,7
@@
packages() {
if [ "$PACKAGES" = 'yes' ] ; then
if ! [ -r /etc/debootstrap/packages ] ; then
if [ "$PACKAGES" = 'yes' ] ; then
if ! [ -r /etc/debootstrap/packages ] ; then
- echo "Error: /etc/debootstrap/packages
not found, exiting."
+ echo "Error: /etc/debootstrap/packages
(inside chroot) not found, exiting." >&2
exit 1
else
$APTUPDATE
exit 1
else
$APTUPDATE
@@
-241,6
+241,11
@@
reconfigure() {
# set password of user root {{{
passwords()
{
# set password of user root {{{
passwords()
{
+ if [ -n "$NOPASSWORD" ] ; then
+ echo "Skip setting root password as requested."
+ return 0
+ fi
+
echo "Activating shadow passwords."
shadowconfig on
echo "Activating shadow passwords."
shadowconfig on
@@
-249,7
+254,6
@@
passwords()
CHPASSWD_OPTION='-m'
fi
CHPASSWD_OPTION='-m'
fi
-
if [ -n "$ROOTPASSWORD" ] ; then
echo root:"$ROOTPASSWORD" | chpasswd $CHPASSWD_OPTION
export ROOTPASSWORD=''
if [ -n "$ROOTPASSWORD" ] ; then
echo root:"$ROOTPASSWORD" | chpasswd $CHPASSWD_OPTION
export ROOTPASSWORD=''