From 37adce0761ecc99361e035d88f46ad8643ed2ee1 Mon Sep 17 00:00:00 2001 From: Robert Nelson <robertcnelson@gmail.com> Date: Wed, 21 Aug 2013 10:37:03 -0500 Subject: [PATCH] pkg: sudo, every MB counts in this space saving Signed-off-by: Robert Nelson <robertcnelson@gmail.com> --- bare_image.sh | 2 ++ base_image.sh | 2 ++ build_image.sh | 2 ++ scripts/chroot.sh | 9 +++++++-- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/bare_image.sh b/bare_image.sh index 80e7f1ddb..ab6f95bb9 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 de286a678..6cc28dd03 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 4174e4205..4ccfbb23a 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 377a79a77..eff9f3a78 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} -- GitLab