From c9d7d6f9d182148daa27597c66f058a68ccfecf6 2018-11-15 19:34:50 From: drtyhlpr Date: 2018-11-15 19:34:50 Subject: [PATCH] Merge pull request #150 from burnbabyburn/exclude Exclude --- diff --git a/README.md b/README.md index 5588cf8..0b7eabb 100644 --- a/README.md +++ b/README.md @@ -200,6 +200,9 @@ Install Xorg open-source X Window System. ##### `ENABLE_WM`="" Install a user defined window manager for the X Window System. To make sure all X related package dependencies are getting installed `ENABLE_XORG` will automatically get enabled if `ENABLE_WM` is used. The `rpi23-gen-image.sh` script has been tested with the following list of window managers: `blackbox`, `openbox`, `fluxbox`, `jwm`, `dwm`, `xfce4`, `awesome`. +##### `ENABLE_SYSVINIT`=false +Support for halt,init,poweroff,reboot,runlevel,shutdown,telinit commands + --- #### Advanced system features: diff --git a/bootstrap.d/10-bootstrap.sh b/bootstrap.d/10-bootstrap.sh index 93bf254..d8cfb69 100644 --- a/bootstrap.d/10-bootstrap.sh +++ b/bootstrap.d/10-bootstrap.sh @@ -7,7 +7,6 @@ VARIANT="" COMPONENTS="main" -EXCLUDES="" # Use non-free Debian packages if needed if [ "$ENABLE_NONFREE" = true ] ; then @@ -19,13 +18,8 @@ if [ "$ENABLE_MINBASE" = true ] ; then VARIANT="--variant=minbase" fi -# Exclude packages if required by Debian release -if [ "$RELEASE" = "stretch" ] || [ "$RELEASE" = "buster" ] ; then - EXCLUDES="--exclude=init,systemd-sysv" -fi - # Base debootstrap (unpack only) -http_proxy=${APT_PROXY} debootstrap ${EXCLUDES} --arch="${RELEASE_ARCH}" --foreign ${VARIANT} --components="${COMPONENTS}" --include="${APT_INCLUDES}" "${RELEASE}" "${R}" "http://${APT_SERVER}/debian" +http_proxy=${APT_PROXY} debootstrap ${APT_EXCLUDES} --arch="${RELEASE_ARCH}" --foreign ${VARIANT} --components="${COMPONENTS}" --include="${APT_INCLUDES}" "${RELEASE}" "${R}" "http://${APT_SERVER}/debian" # Copy qemu emulator binary to chroot install -m 755 -o root -g root "${QEMU_BINARY}" "${R}${QEMU_BINARY}" diff --git a/rpi23-gen-image.sh b/rpi23-gen-image.sh index d8d008a..1e4703c 100755 --- a/rpi23-gen-image.sh +++ b/rpi23-gen-image.sh @@ -176,6 +176,7 @@ ENABLE_USER=${ENABLE_USER:=true} USER_NAME=${USER_NAME:="pi"} ENABLE_ROOT=${ENABLE_ROOT:=false} ENABLE_QEMU=${ENABLE_QEMU:=false} +ENABLE_SYSVINIT=${ENABLE_SYSVINIT:=false} # SSH settings SSH_ENABLE_ROOT=${SSH_ENABLE_ROOT:=false} @@ -244,6 +245,9 @@ CHROOT_SCRIPTS=${CHROOT_SCRIPTS:=""} APT_INCLUDES=${APT_INCLUDES:=""} APT_INCLUDES="${APT_INCLUDES},apt-transport-https,apt-utils,ca-certificates,debian-archive-keyring,dialog,sudo,systemd,sysvinit-utils" +#Packages to exclude from chroot build environment +APT_EXCLUDES=${APT_EXCLUDES:=""} + # Packages required for bootstrapping REQUIRED_PACKAGES="debootstrap debian-archive-keyring qemu-user-static binfmt-support dosfstools rsync bmap-tools whois git bc psmisc dbus sudo" MISSING_PACKAGES="" @@ -253,6 +257,11 @@ COMPILER_PACKAGES="" set +x +#If init and systemd-sysv are wanted e.g. halt/reboot/shutdown scripts +if [ "$ENABLE_SYSVINIT" = false ] ; then +APT_EXCLUDES="--exclude=${APT_EXCLUDES},init,systemd-sysv" +fi + # Set Raspberry Pi model specific configuration if [ "$RPI_MODEL" = 0 ] ; then DTB_FILE=${RPI0_DTB_FILE}