Skip to content

Commit c734ae1

Browse files
author
Daniel Martinez
committed
Add option to ingore services
1 parent f9551cb commit c734ae1

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

mklive.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ usage() {
8989
-g "<pkg> ..." Ignore packages when building the ISO image
9090
-I <includedir> Include directory structure under given path in the ROOTFS
9191
-S "<service> ..." Enable services in the ISO image
92+
-D "<service> ..." Ignore services when building the ISO image
9293
-C "<arg> ..." Add additional kernel command line arguments
9394
-T <title> Modify the bootloader title (default: Void Linux)
9495
-v linux<version> Install a custom Linux version on ISO image (default: linux metapackage)
@@ -153,10 +154,12 @@ ignore_packages() {
153154
enable_services() {
154155
SERVICE_LIST="$*"
155156
for service in $SERVICE_LIST; do
156-
if ! [ -e $ROOTFS/etc/sv/$service ]; then
157-
die "service $service not in /etc/sv"
157+
if ! [[ $IGNORE_SV =~ (^|[[:space:]])$service($|[[:space:]]) ]] ; then
158+
if ! [ -e $ROOTFS/etc/sv/$service ] ; then
159+
die "service $service not in /etc/sv"
160+
fi
161+
ln -sf /etc/sv/$service $ROOTFS/etc/runit/runsvdir/default/
158162
fi
159-
ln -sf /etc/sv/$service $ROOTFS/etc/runit/runsvdir/default/
160163
done
161164
}
162165

@@ -313,7 +316,7 @@ generate_iso_image() {
313316
#
314317
# main()
315318
#
316-
while getopts "a:b:r:c:C:T:Kk:l:i:I:S:s:o:p:g:v:Vh" opt; do
319+
while getopts "a:b:r:c:C:D:T:Kk:l:i:I:S:s:o:p:g:v:Vh" opt; do
317320
case $opt in
318321
a) BASE_ARCH="$OPTARG";;
319322
b) BASE_SYSTEM_PKG="$OPTARG";;
@@ -326,6 +329,7 @@ while getopts "a:b:r:c:C:T:Kk:l:i:I:S:s:o:p:g:v:Vh" opt; do
326329
i) INITRAMFS_COMPRESSION="$OPTARG";;
327330
I) INCLUDE_DIRS+=("$OPTARG");;
328331
S) SERVICE_LIST="$SERVICE_LIST $OPTARG";;
332+
D) IGNORE_SV="$IGNORE_SV $OPTARG";;
329333
s) SQUASHFS_COMPRESSION="$OPTARG";;
330334
o) OUTPUT_FILE="$OPTARG";;
331335
p) PACKAGE_LIST="$PACKAGE_LIST $OPTARG";;

0 commit comments

Comments
 (0)