mirror of
https://github.com/rancher/os.git
synced 2025-08-31 22:32:14 +00:00
plain syslinux with mbr works
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
@@ -26,6 +26,10 @@ do
|
||||
done
|
||||
[[ "$ARCH" == "arm" && "$ENV" != "rancher-upgrade" ]] && ENV=arm
|
||||
|
||||
if [[ "$ENV" == "gptsyslinux" ]]; then
|
||||
MBR_FILE="gptmbr.bin"
|
||||
fi
|
||||
|
||||
DIST=${DIST:-/dist}
|
||||
CLOUD_CONFIG=${CLOUD_CONFIG:-"${SCRIPTS_DIR}/conf/empty.yml"}
|
||||
CONSOLE=tty0
|
||||
@@ -89,14 +93,14 @@ create_boot_dirs()
|
||||
|
||||
install_syslinux() {
|
||||
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
|
||||
}
|
||||
|
||||
install_syslinux_raid() {
|
||||
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_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
|
||||
}
|
||||
|
||||
@@ -207,6 +211,16 @@ if [ -n ${ENV} ]; then
|
||||
install_grub
|
||||
"${SCRIPTS_DIR}/seed-data" ${BASE_DIR} ${CLOUD_CONFIG} ${FILES}
|
||||
;;
|
||||
"syslinux")
|
||||
format_and_mount
|
||||
install_syslinux
|
||||
"${SCRIPTS_DIR}/seed-data" ${BASE_DIR} ${CLOUD_CONFIG} ${FILES}
|
||||
;;
|
||||
"gptsyslinux")
|
||||
format_and_mount
|
||||
install_syslinux
|
||||
"${SCRIPTS_DIR}/seed-data" ${BASE_DIR} ${CLOUD_CONFIG} ${FILES}
|
||||
;;
|
||||
"arm")
|
||||
format_and_mount
|
||||
"${SCRIPTS_DIR}/seed-data" ${BASE_DIR} ${CLOUD_CONFIG} ${FILES}
|
||||
|
@@ -4,6 +4,10 @@ set -e
|
||||
set -x
|
||||
|
||||
DEVICE=${1}
|
||||
DISKTYPE=${2}
|
||||
if [[ -z $DISKTYPE ]]; then
|
||||
DISKTYPE="msdos"
|
||||
fi
|
||||
|
||||
if [[ -z $DEVICE ]]; then
|
||||
echo "Need to Pass a device name as arg1." 1>&2
|
||||
@@ -33,7 +37,7 @@ fi
|
||||
dd if=/dev/zero of=${DEVICE} bs=512 count=2048
|
||||
partprobe ${DEVICE}
|
||||
|
||||
parted -s -a optimal ${DEVICE} mklabel msdos -- \
|
||||
parted -s -a optimal ${DEVICE} mklabel ${DISKTYPE} -- \
|
||||
mkpart primary ext4 1 -1 \
|
||||
set 1 boot on
|
||||
|
||||
|
Reference in New Issue
Block a user