mirror of
https://github.com/rancher/os.git
synced 2025-08-31 14:23:11 +00:00
Add swap support in cloud config mounts
This commit is contained in:
13
scripts/run
13
scripts/run
@@ -64,6 +64,9 @@ while [ "$#" -gt 0 ]; do
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
--second-drive)
|
||||
SECOND_DRIVE=1
|
||||
;;
|
||||
--arch)
|
||||
shift 1
|
||||
ARCH="$1"
|
||||
@@ -132,12 +135,19 @@ fi
|
||||
if [ "$QEMU" == "1" ]; then
|
||||
|
||||
HD=${BASE}/state/hd.img
|
||||
[ "$FRESH" == "1" ] && rm -f ${HD} >/dev/null 2>&1 || :
|
||||
HD2=${BASE}/state/hd2.img
|
||||
[ "$FRESH" == "1" ] && rm -f ${HD} ${HD2} >/dev/null 2>&1 || :
|
||||
|
||||
if [ ! -e ${HD} ]; then
|
||||
mkdir -p $(dirname ${HD})
|
||||
qemu-img create -f qcow2 -o size=10G ${HD}
|
||||
fi
|
||||
|
||||
if [ "$SECOND_DRIVE" == "1" ]; then
|
||||
qemu-img create -f qcow2 -o size=10G ${HD2}
|
||||
SECOND_DRIVE_ENABLE=$(eval "${hd["$ARCH"]} ${HD2}")
|
||||
fi
|
||||
|
||||
CCROOT=${BUILD}/cloud-config
|
||||
rm -rf ${CCROOT}
|
||||
mkdir -p ${CCROOT}
|
||||
@@ -170,6 +180,7 @@ if [ "$QEMU" == "1" ]; then
|
||||
-m 2048 \
|
||||
${network["$ARCH"]} \
|
||||
$(eval "${hd["$ARCH"]} ${HD}") \
|
||||
${SECOND_DRIVE_ENABLE} \
|
||||
-smp 1 \
|
||||
-append "${KERNEL_ARGS}" \
|
||||
-nographic \
|
||||
|
Reference in New Issue
Block a user