Create disk architecture in a TMP directory
This commit is contained in:
parent
8be47ee171
commit
63ad27b2f5
1 changed files with 13 additions and 10 deletions
23
init.sh
23
init.sh
|
@ -87,24 +87,27 @@ then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
bootfiles_Debian="http://ftp.debian.org/debian/dists/jessie/main/installer-${DEBIAN_ARCH}/current/images/hd-media"
|
bootfiles_Debian="http://ftp.debian.org/debian/dists/jessie/main/installer-${DEBIAN_ARCH}/current/images/hd-media"
|
||||||
iso_url="http://cdimage.debian.org/debian-cd/${DEBIAN_VERSION}/${DEBIAN_ARCH}/iso-cd/"
|
iso_url="http://cdimage.debian.org/debian-cd/${DEBIAN_VERSION}/${DEBIAN_ARCH}/iso-cd"
|
||||||
iso_file="debian-${DEBIAN_VERSION}-${DEBIAN_ARCH}-netinst.iso "
|
iso_file="debian-${DEBIAN_VERSION}-${DEBIAN_ARCH}-netinst.iso "
|
||||||
syslinux_mod="/usr/lib/syslinux/"
|
syslinux_mod="/usr/lib/syslinux"
|
||||||
current_dir=`pwd`
|
current_dir=`pwd`
|
||||||
|
|
||||||
# Download Debian files (kernel, initrd and iso)
|
# Download Debian files (kernel, initrd and iso)
|
||||||
echo -e "\nPrepare Debian files\n---"
|
echo -e "\nPrepare Debian files\n---"
|
||||||
|
cd $TMP_DIR
|
||||||
for file in "vmlinuz" "initrd.gz"
|
for file in "vmlinuz" "initrd.gz"
|
||||||
do
|
do
|
||||||
download $file $bootfiles_Debian 1
|
download $file $bootfiles_Debian 1
|
||||||
done
|
done
|
||||||
download $iso_file $iso_url 1
|
download $iso_file $iso_url 1
|
||||||
|
cd $current_dir
|
||||||
|
|
||||||
# Copy wanted syslinux file from archive
|
# Copy wanted syslinux file from archive
|
||||||
|
create_dir ${TMP_DIR}/syslinux 1
|
||||||
for file in $SYSLINUX_FILES
|
for file in $SYSLINUX_FILES
|
||||||
do
|
do
|
||||||
echo "copie de $file"
|
echo "copie de $file"
|
||||||
cp ${syslinux_mod}/${BOOT_TYPE}/${file} ./syslinux/
|
cp ${syslinux_mod}/${BOOT_TYPE}/${file} ${TMP_DIR}/syslinux/
|
||||||
done
|
done
|
||||||
|
|
||||||
case $BOOT_TYPE in
|
case $BOOT_TYPE in
|
||||||
|
@ -112,19 +115,21 @@ case $BOOT_TYPE in
|
||||||
for file in $SYSLINUX_EFI_FILES
|
for file in $SYSLINUX_EFI_FILES
|
||||||
do
|
do
|
||||||
echo "copying $file ..."
|
echo "copying $file ..."
|
||||||
cp ${syslinux_mod}/${BOOT_TYPE}/${file} ./syslinux/
|
cp ${syslinux_mod}/${BOOT_TYPE}/${file} ${TMP_DIR}/syslinux/
|
||||||
done
|
done
|
||||||
create_dir "EFI/boot"
|
create_dir "${TMP_DIR}/EFI/boot"
|
||||||
cp -T ${syslinux_mod}/${BOOT_TYPE}/efi/syslinux.efi EFI/boot/bootx64.efi
|
cp -T ${syslinux_mod}/${BOOT_TYPE}/syslinux.efi ${TMP_DIR}/EFI/boot/bootx64.efi
|
||||||
;;
|
;;
|
||||||
bios)
|
bios)
|
||||||
for file in $SYSLINUX_BIOS_FILES
|
for file in $SYSLINUX_BIOS_FILES
|
||||||
do
|
do
|
||||||
echo "copying $file ..."
|
echo "copying $file ..."
|
||||||
cp ${syslinux_mod}/${BOOT_TYPE}/${file} ./syslinux/
|
cp ${syslinux_mod}/${BOOT_TYPE}/${file} ${TMP_DIR}/syslinux/
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
echo Copying configuration file
|
||||||
|
cp -R syslinux $TMP_DIR &> /dev/null
|
||||||
|
|
||||||
if [[ -n $dest ]]
|
if [[ -n $dest ]]
|
||||||
then
|
then
|
||||||
|
@ -142,9 +147,7 @@ then
|
||||||
create_dir $MOUNT_DIR
|
create_dir $MOUNT_DIR
|
||||||
mount ${dest}1 $MOUNT_DIR
|
mount ${dest}1 $MOUNT_DIR
|
||||||
echo "copying all file to USB drive"
|
echo "copying all file to USB drive"
|
||||||
cp * $MOUNT_DIR &> /dev/null
|
cp ${TMP_DIR}/* $MOUNT_DIR &> /dev/null
|
||||||
cp -R syslinux $MOUNT_DIR &> /dev/null
|
|
||||||
if [[ $BOOT_TYPE == "efi64" ]];then cp -R EFI $MOUNT_DIR &> /dev/null; fi
|
|
||||||
sync
|
sync
|
||||||
umount $MOUNT_DIR
|
umount $MOUNT_DIR
|
||||||
# Make key bootable if bios.
|
# Make key bootable if bios.
|
||||||
|
|
Reference in a new issue