search syslinux file from differents locations (Arch and debian unstable compatible)
This commit is contained in:
parent
18f6603943
commit
53216dc68d
1 changed files with 28 additions and 2 deletions
30
init.sh
30
init.sh
|
@ -16,7 +16,6 @@ SYSLINUX_EFI_FILES="ldlinux.e64"
|
||||||
TMP_DIR="tmp"
|
TMP_DIR="tmp"
|
||||||
REPO_DIR="repo"
|
REPO_DIR="repo"
|
||||||
MOUNT_DIR="/mnt/usbstick"
|
MOUNT_DIR="/mnt/usbstick"
|
||||||
syslinux_mod="/usr/lib/syslinux"
|
|
||||||
current_dir=`pwd`
|
current_dir=`pwd`
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
|
@ -66,6 +65,20 @@ then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -d /usr/lib/syslinux/efi64 ]
|
||||||
|
then
|
||||||
|
syslinux_mod="/usr/lib/syslinux"
|
||||||
|
else
|
||||||
|
if [ -d /usr/lib/syslinux/modules/efi64 ]
|
||||||
|
then
|
||||||
|
syslinux_mod="/usr/lib/syslinux/modules"
|
||||||
|
else
|
||||||
|
echo "Syslinux modules folder not found, exiting"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Arguments ...
|
# Arguments ...
|
||||||
while getopts "ha:bd:" opt; do
|
while getopts "ha:bd:" opt; do
|
||||||
case "$opt" in
|
case "$opt" in
|
||||||
|
@ -125,9 +138,22 @@ cp $repo_path/$iso_file $TMP_DIR
|
||||||
|
|
||||||
case $BOOT_TYPE in
|
case $BOOT_TYPE in
|
||||||
efi64)
|
efi64)
|
||||||
|
if [ -f /usr/lib/syslinux/efi64/syslinux.efi ]
|
||||||
|
then
|
||||||
|
syslinux_efi="/usr/lib/syslinux/efi64/syslinux.efi"
|
||||||
|
else
|
||||||
|
if [ -d /usr/lib/SYSLINUX.EFI/modules/efi64/syslinux.efi ]
|
||||||
|
then
|
||||||
|
syslinux_efi="/usr/lib/SYSLINUX.EFI/efi64/syslinux.efi"
|
||||||
|
else
|
||||||
|
echo "Syslinux efi bootlader not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
syslinux_folder=${TMP_DIR}/efi/EFI/boot
|
syslinux_folder=${TMP_DIR}/efi/EFI/boot
|
||||||
create_dir $syslinux_folder
|
create_dir $syslinux_folder
|
||||||
cp -T ${syslinux_mod}/${BOOT_TYPE}/syslinux.efi $syslinux_folder/bootx64.efi
|
cp -T ${syslinux_efi} $syslinux_folder/bootx64.efi &> /dev/null
|
||||||
for file in $SYSLINUX_EFI_FILES
|
for file in $SYSLINUX_EFI_FILES
|
||||||
do
|
do
|
||||||
echo "copying $file ..."
|
echo "copying $file ..."
|
||||||
|
|
Reference in a new issue