Skip to content

Commit

Permalink
kiss-vm: add --ks-fstype option
Browse files Browse the repository at this point in the history
Signed-off-by: Jianhong Yin <[email protected]>
  • Loading branch information
tcler committed Jan 10, 2025
1 parent e8e2461 commit 9036549
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
11 changes: 8 additions & 3 deletions kiss-vm
Original file line number Diff line number Diff line change
Expand Up @@ -2140,6 +2140,9 @@ Usage() {
#append to kickstart '%packages' section
--ks-only-use <sda[,sdb]>
#forward to kickstart 'ignoredisk --only-use='
--ks-fstype <ext4|xfs|...>
#Note: only for OS that install from automated kickstart file
#That is to say, it can only be used with the -L option and for OS like rhel/centos/rocky/alma/fedora.
--kernel-opts <kernel args>
#apped kernel options/args
#Note: conflict with '--ks + -L[url]' option
Expand Down Expand Up @@ -2481,6 +2484,7 @@ _at=`getopt -o hu:d:m:L::l:C:F:fn:gb:p:I::i:rvdx::Pqw:: \
--long user: \
--long enable-nested-vm \
--long debug \
--long ks-fstype: \
--long ks: \
--long ks-pkgs: \
--long ks-append: --long ks-post: --long ks-pre: \
Expand Down Expand Up @@ -2621,7 +2625,8 @@ while true; do
--ks-append) KS_APPEND+=$'\n'"$2"; InstallType=location; shift 2;;
--ks-post) KS_APPEND+=$'\n%post --interpreter=/usr/bin/bash\n'"$2"$'\n%end'; InstallType=location; shift 2;;
--ks-pre) KS_APPEND+=$'\n%pre --interpreter=/usr/bin/bash\n'"$2"$'\n%end'; InstallType=location; shift 2;;
--ks-only-use) KS_OnlyUse="$2"; shift 2;;
--ks-only-use) KS_OnlyUse="$2"; InstallType=location; shift 2;;
--ks-fstype) KS_FSTYPE_OPT="--fstype=$2"; InstallType=location; shift 2;;
--kernel-opts) KOPTS="$2"; shift 2;;
--rm) RM=yes; shift 1;;
--xzopt) XZ="$2"; shift 2;;
Expand Down Expand Up @@ -3865,12 +3870,12 @@ if [[ "$InstallType" = location ]]; then
if [[ "$NO_SSHKEY" = yes ]]; then
ks-generator.sh -d $Distro $URL_OPT $REPO_OPTS $_REPO_OPTS --post $postscript \
--kopts="$KOPTS" --pkgs=$KS_PKGS --only-use=$KS_OnlyUse --append="$KS_APPEND" \
--netn ${#NETWORK_OPTS[@]} --default-dns=$defaultDNS >$KSPath
--netn ${#NETWORK_OPTS[@]} --default-dns=$defaultDNS $KS_FSTYPE_OPT >$KSPath
else
ks-generator.sh -d $Distro $URL_OPT $REPO_OPTS $_REPO_OPTS --post $postscript \
--kopts="$KOPTS" --pkgs=$KS_PKGS --only-use=$KS_OnlyUse --append="$KS_APPEND" \
--sshkeyf ~/.ssh/id_rsa.pub --sshkeyf ~/.ssh/id_ecdsa.pub \
--netn ${#NETWORK_OPTS[@]} --default-dns=$defaultDNS >$KSPath
--netn ${#NETWORK_OPTS[@]} --default-dns=$defaultDNS $KS_FSTYPE_OPT >$KSPath
fi
}

Expand Down
4 changes: 3 additions & 1 deletion utils/ks-generator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ IgnoreDisk=
Usage() {
cat <<-EOF >&2
Usage:
$0 <-d distroname> <-url url> [-repo name1:url1 [-repo name2:url2 ...]] [-post <script>] [-sshkeyf <file>] [-kernel-opts=<params>] [-pkgs=<pkg1[ pkg2 ..]>]
$0 <-d distroname> <-url url> [-repo name1:url1 [-repo name2:url2 ...]] [-post <script>] [-sshkeyf <file>] [-kernel-opts=<params>] [-pkgs=<pkg1[ pkg2 ..]>] [--fstype=<ext4|xfs|...>]
Example:
$0 -d centos-5 -url http://vault.centos.org/5.11/os/x86_64/
Expand All @@ -32,6 +32,7 @@ _at=`getopt -o hd: \
--long url: \
--long repo: \
--long post: \
--long fstype: \
--long sshkeyf: \
--long kernel-opts: --long kopts: \
--long only-use: \
Expand All @@ -48,6 +49,7 @@ while true; do
--url) URL="$2"; shift 2;;
--repo) Repos+=("$2"); shift 2;;
--post) Post="$2"; shift 2;;
--fstype) FSTYPE="$2"; PartConf+=\ --fstype=$FSTYPE; shift 2;;
--sshkeyf) sshkeyf+=" $2"; shift 2;;
--kernel-opts|--kopts) KernelOpts="$2"; shift 2;;
--only-use) [[ -n "${2// /}" ]] && IgnoreDisk="ignoredisk --only-use=$2"; shift 2;;
Expand Down

0 comments on commit 9036549

Please sign in to comment.