Possible Syslinux for bios parameters fixes
This commit is contained in:
parent
7f3ab8830c
commit
838ea9ce7f
1 changed files with 15 additions and 8 deletions
23
init.sh
23
init.sh
|
@ -147,13 +147,8 @@ then
|
|||
echo -e "\nCreating partition"
|
||||
parted -s ${dest} mklabel msdos mkpart primary fat32 1MiB 100% set 1 boot on
|
||||
mkfs.vfat ${dest}1 -n debian &> /dev/null
|
||||
if [[ $BOOT_TYPE == "bios" ]]
|
||||
then
|
||||
# In bis mode, we need to write syslinux MBR.
|
||||
echo "Writing syslinux mbr.ini fo $dest"
|
||||
dd bs=440 count=1 conv=notrunc if=${TMP_DIR}/syslinux-${SYSLINUX_VERSION}/bios/mbr/mbr.bin of=${dest}
|
||||
./tmp/syslinux-6.03/bios/linux/syslinux -i -d syslinux ${dest}1
|
||||
fi
|
||||
|
||||
# mount and copy
|
||||
create_dir $MOUNT_DIR
|
||||
mount ${dest}1 $MOUNT_DIR
|
||||
echo "copying all file to USB drive"
|
||||
|
@ -161,5 +156,17 @@ then
|
|||
cp -R syslinux $MOUNT_DIR &> /dev/null
|
||||
if [[ $BOOT_TYPE == "efi64" ]];then cp -R EFI $MOUNT_DIR &> /dev/null; fi
|
||||
umount $MOUNT_DIR
|
||||
exit 0
|
||||
sleep 5
|
||||
# Make key bootable if bios.
|
||||
if [[ $BOOT_TYPE == "bios" ]]
|
||||
then
|
||||
# In this mode, we need to write syslinux MBR.
|
||||
echo "Writing syslinux mbr.ini fo $dest"
|
||||
dd bs=440 count=1 conv=notrunc if=${TMP_DIR}/syslinux-${SYSLINUX_VERSION}/bios/mbr/mbr.bin of=${dest}
|
||||
sleep 5
|
||||
cd ${TMP_DIR}/syslinux-${SYSLINUX_VERSION}/bios/linux/
|
||||
linux32 syslinux --directory /syslinux/ --install ${dest}1
|
||||
cd $current_dir
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
|
Reference in a new issue