nope, correct EOF, sort out apt-get install dependencies
[dev-env-setup.git] / mk-deb-chroot
index 9853493336e0203dbdee4717dd988ee3e8c57427..91b0a1e92c5b2abf464e8905362c8857ab323fdc 100755 (executable)
@@ -31,6 +31,7 @@ mount /opt/chroot/$chrootdir/proc
 mount /opt/chroot/$chrootdir/sys
 mount /opt/chroot/$chrootdir/tmp
 echo "$chrootdir" > /opt/chroot/$chrootdir/etc/debian_chroot
+
 # Install apt dependencies in the chroot
 chroot /opt/chroot/$chrootdir /bin/bash << EOF
 echo Installing necessary apt dependencies in the chroot
@@ -39,8 +40,17 @@ apt-get upgrade -y
 apt-get install -y automake binutils-dev build-essential \
 ccache cmake gcc git \
 libtool \
+sysvinit-core \
+sysvinit-utils \
+sudo \
 python3 python3-pip \
-python3-setuptools python-dev 
+python3-setuptools python3-dev
+
+# yeah systemd in a chroot? not very funny joke.
+apt-get remove -y systemd
+
+# add sudo no password
+echo '$SUDO_USER ALL=NOPASSWD: ALL' >> /etc/sudoers.d/$chrootdir
 
 # Create user with same UID in the chroot
 useradd -m -p `python -c 'import crypt; print crypt.crypt("1234","Fx")'` -s /bin/bash $SUDO_USER -k /etc/skel