diff --git a/bare_image.sh b/bare_image.sh index 80e7f1ddbbf924fa6b85edd497163297ff227e7d..ab6f95bb901e9353b87ea176c6d055c56e9b8f4a 100755 --- a/bare_image.sh +++ b/bare_image.sh @@ -70,6 +70,7 @@ minimal_armel () { include_firmware="${include_firmware}" chroot_no_lsb_release="${chroot_no_lsb_release}" + chroot_no_sudo="${chroot_no_sudo}" chroot_rcnee_startup_scripts="${chroot_rcnee_startup_scripts}" chroot_ENABLE_DEB_SRC="${chroot_ENABLE_DEB_SRC}" chroot_KERNEL_HTTP_DIR="${chroot_KERNEL_HTTP_DIR}" @@ -143,6 +144,7 @@ is_debian () { pkg_list chroot_no_lsb_release="Debian" + chroot_no_sudo="enable" } #13.04 diff --git a/base_image.sh b/base_image.sh index de286a678a8e1d9fb1345842679922c1610213ea..6cc28dd038105bb521b17df73b3ad9acfaa4a4ae 100755 --- a/base_image.sh +++ b/base_image.sh @@ -70,6 +70,7 @@ minimal_armel () { include_firmware="${include_firmware}" chroot_no_lsb_release="${chroot_no_lsb_release}" + chroot_no_sudo="${chroot_no_sudo}" chroot_rcnee_startup_scripts="${chroot_rcnee_startup_scripts}" chroot_ENABLE_DEB_SRC="${chroot_ENABLE_DEB_SRC}" chroot_KERNEL_HTTP_DIR="${chroot_KERNEL_HTTP_DIR}" @@ -143,6 +144,7 @@ is_debian () { pkg_list # chroot_no_lsb_release="Debian" +# chroot_no_sudo="enable" } #13.04 diff --git a/build_image.sh b/build_image.sh index 4174e4205cd45df61b7ecc7c94a3e9b3a8a661a4..4ccfbb23a7463bb42c6e2c316a334c6a3ef21306 100755 --- a/build_image.sh +++ b/build_image.sh @@ -83,6 +83,7 @@ minimal_armel () { include_firmware="${include_firmware}" chroot_no_lsb_release="${chroot_no_lsb_release}" + chroot_no_sudo="${chroot_no_sudo}" chroot_rcnee_startup_scripts="${chroot_rcnee_startup_scripts}" chroot_ENABLE_DEB_SRC="${chroot_ENABLE_DEB_SRC}" chroot_KERNEL_HTTP_DIR="${chroot_KERNEL_HTTP_DIR}" @@ -192,6 +193,7 @@ is_debian () { pkg_list # chroot_no_lsb_release="Debian" +# chroot_no_sudo="enable" } #12.10 diff --git a/scripts/chroot.sh b/scripts/chroot.sh index 377a79a77fd7d29a52764027768de66685c8962a..eff9f3a78e18e7421349b28cef74d957e9d83ce9 100755 --- a/scripts/chroot.sh +++ b/scripts/chroot.sh @@ -318,7 +318,7 @@ cat > ${DIR}/chroot_script.sh <<-__EOF__ install_pkgs () { #These packages have binaries needed by this script. - packages="locales sudo" + packages="locales" for pkg in \${packages} ; do check_n_install ; done if [ ! "x\${base_pkg_list}" = "x" ] ; then @@ -409,9 +409,14 @@ cat > ${DIR}/chroot_script.sh <<-__EOF__ add_user () { groupadd admin || true - echo "%admin ALL=(ALL) ALL" >>/etc/sudoers default_groups="admin,adm,dialout,cdrom,floppy,audio,dip,video" + if [ "x${chroot_no_sudo}" = "x" ] ; then + packages="sudo" + for pkg in \${packages} ; do check_n_install ; done + echo "%admin ALL=(ALL) ALL" >>/etc/sudoers + fi + pass_crypt=\$(perl -e 'print crypt(\$ARGV[0], "rcn-ee-salt")' ${password}) useradd -G "\${default_groups}" -s /bin/bash -m -p \${pass_crypt} -c "${full_name}" ${user_name}