Skip to content

Commit

Permalink
Add option to ingore services
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Martinez committed Feb 29, 2024
1 parent f9551cb commit c734ae1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions mklive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ usage() {
-g "<pkg> ..." Ignore packages when building the ISO image
-I <includedir> Include directory structure under given path in the ROOTFS
-S "<service> ..." Enable services in the ISO image
-D "<service> ..." Ignore services when building the ISO image
-C "<arg> ..." Add additional kernel command line arguments
-T <title> Modify the bootloader title (default: Void Linux)
-v linux<version> Install a custom Linux version on ISO image (default: linux metapackage)
Expand Down Expand Up @@ -153,10 +154,12 @@ ignore_packages() {
enable_services() {
SERVICE_LIST="$*"
for service in $SERVICE_LIST; do
if ! [ -e $ROOTFS/etc/sv/$service ]; then
die "service $service not in /etc/sv"
if ! [[ $IGNORE_SV =~ (^|[[:space:]])$service($|[[:space:]]) ]] ; then
if ! [ -e $ROOTFS/etc/sv/$service ] ; then
die "service $service not in /etc/sv"
fi
ln -sf /etc/sv/$service $ROOTFS/etc/runit/runsvdir/default/
fi
ln -sf /etc/sv/$service $ROOTFS/etc/runit/runsvdir/default/
done
}

Expand Down Expand Up @@ -313,7 +316,7 @@ generate_iso_image() {
#
# main()
#
while getopts "a:b:r:c:C:T:Kk:l:i:I:S:s:o:p:g:v:Vh" opt; do
while getopts "a:b:r:c:C:D:T:Kk:l:i:I:S:s:o:p:g:v:Vh" opt; do
case $opt in
a) BASE_ARCH="$OPTARG";;
b) BASE_SYSTEM_PKG="$OPTARG";;
Expand All @@ -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
i) INITRAMFS_COMPRESSION="$OPTARG";;
I) INCLUDE_DIRS+=("$OPTARG");;
S) SERVICE_LIST="$SERVICE_LIST $OPTARG";;
D) IGNORE_SV="$IGNORE_SV $OPTARG";;
s) SQUASHFS_COMPRESSION="$OPTARG";;
o) OUTPUT_FILE="$OPTARG";;
p) PACKAGE_LIST="$PACKAGE_LIST $OPTARG";;
Expand Down

0 comments on commit c734ae1

Please sign in to comment.