mirror of
https://github.com/rancher/os.git
synced 2025-09-19 00:59:53 +00:00
GPT partition option
UNTESTED: This adds a `-g` flag to select gptmbr.bin for MBR image, allowing installation on a GPT harddrive.
This commit is contained in:
@@ -5,7 +5,9 @@ SCRIPTS_DIR=$(dirname ${0})
|
|||||||
|
|
||||||
VERSION=${VERSION:?"VERSION not set"}
|
VERSION=${VERSION:?"VERSION not set"}
|
||||||
|
|
||||||
while getopts "i:f:c:d:t:r:o:p:ka:" OPTION
|
MBR_FILE=mbr.bin
|
||||||
|
|
||||||
|
while getopts "i:f:c:d:t:r:o:p:ka:g" OPTION
|
||||||
do
|
do
|
||||||
case ${OPTION} in
|
case ${OPTION} in
|
||||||
i) DIST="$OPTARG" ;;
|
i) DIST="$OPTARG" ;;
|
||||||
@@ -18,6 +20,7 @@ do
|
|||||||
k) KEXEC=y ;;
|
k) KEXEC=y ;;
|
||||||
a) APPEND="$OPTARG" ;;
|
a) APPEND="$OPTARG" ;;
|
||||||
t) ENV="$OPTARG" ;;
|
t) ENV="$OPTARG" ;;
|
||||||
|
g) MBR_FILE=gptmbr.bin ;;
|
||||||
*) exit 1 ;;
|
*) exit 1 ;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
@@ -85,14 +88,14 @@ create_boot_dirs()
|
|||||||
}
|
}
|
||||||
|
|
||||||
install_syslinux() {
|
install_syslinux() {
|
||||||
dd bs=440 count=1 if=/usr/lib/syslinux/mbr/mbr.bin of=${DEVICE}
|
dd bs=440 count=1 if=/usr/lib/syslinux/mbr/${MBR_FILE} of=${DEVICE}
|
||||||
cp /usr/lib/syslinux/modules/bios/* ${BASE_DIR}/${BOOT}syslinux
|
cp /usr/lib/syslinux/modules/bios/* ${BASE_DIR}/${BOOT}syslinux
|
||||||
extlinux --install ${BASE_DIR}/${BOOT}syslinux
|
extlinux --install ${BASE_DIR}/${BOOT}syslinux
|
||||||
}
|
}
|
||||||
|
|
||||||
install_syslinux_raid() {
|
install_syslinux_raid() {
|
||||||
dd bs=440 count=1 if=/usr/lib/syslinux/mbr/mbr.bin of=/dev/sda
|
dd bs=440 count=1 if=/usr/lib/syslinux/mbr/${MBR_FILE} of=/dev/sda
|
||||||
dd bs=440 count=1 if=/usr/lib/syslinux/mbr/mbr.bin of=/dev/sdb
|
dd bs=440 count=1 if=/usr/lib/syslinux/mbr/${MBR_FILE} of=/dev/sdb
|
||||||
cp /usr/lib/syslinux/modules/bios/* ${BASE_DIR}/${BOOT}syslinux
|
cp /usr/lib/syslinux/modules/bios/* ${BASE_DIR}/${BOOT}syslinux
|
||||||
extlinux --install --raid ${BASE_DIR}/${BOOT}syslinux
|
extlinux --install --raid ${BASE_DIR}/${BOOT}syslinux
|
||||||
}
|
}
|
||||||
@@ -275,3 +278,4 @@ fi
|
|||||||
if [ "$KEXEC" = "y" ]; then
|
if [ "$KEXEC" = "y" ]; then
|
||||||
kexec -l ${DIST}/vmlinuz --initrd=${DIST}/initrd --append="${KERNEL_ARGS} ${APPEND}" -f
|
kexec -l ${DIST}/vmlinuz --initrd=${DIST}/initrd --append="${KERNEL_ARGS} ${APPEND}" -f
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user