From f12b08b09e258d5a45a80f8432b8cf46d24ff899 Mon Sep 17 00:00:00 2001 From: psarria Date: Sat, 5 Mar 2022 13:15:27 +0000 Subject: [PATCH] =?UTF-8?q?a=C3=B1ado=20el=20script=20para=20ajustar=20el?= =?UTF-8?q?=20m=C3=A1ximo=20numero=20de=20grupos=20en=20el=20arranque?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- custom_boot.sh | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 custom_boot.sh diff --git a/custom_boot.sh b/custom_boot.sh new file mode 100755 index 0000000..5338184 --- /dev/null +++ b/custom_boot.sh @@ -0,0 +1,46 @@ +#!/usr/bin/bash + +usage() +{ + echo "Usage: $0 [ -d dirname ]" >&2 + echo "ex: $0 -d /zones/boot/boot-20220113T011608Z" + exit 1 +} + +while getopts ":d:" opt; +do + case "$opt" in + d) + DIR=$OPTARG + ;; + \?) + echo "Error: Invalid Option: -${OPTARG}" >&2 + usage + ;; + :) + echo "Error: -${OPTARG} requires an argument." + usage + ;; + *) + usage + ;; + esac +done + +shift $((OPTIND -1 )) + +if [ -z ${DIR} ]; then + usage +fi + +mkdir -p $DIR/bootfs/etc +cp /etc/system $DIR/bootfs/etc/ + +echo 'set ngroups_max=1024' >> $DIR/bootfs/etc/system + +cat << EOF >> $DIR/loader.conf.local +etc_system_load=YES +etc_system_type=file +etc_system_name=/boot/bootfs/etc/system +etc_system_flags="name=/etc/system" +EOF