On the 25th of March of 2021, I wrote a message asking for help
to install Debian 10.8 (now 10.9) on a USB stick, booting the Debian-installer
from Windows 7's Boot Manager and having the ISO only on the hard disk drive
with only the Windows' partition and its filesystem.

Many thanks in advance to the great Debian developers that have put so much
functionality on the Debian-installer and related stuff.

Here is what I did to reach my goal:

Copyright (c) 2021 Santiago Pinto
Licensed under the Creative Commons Attribution-ShareAlike 4.0
International Public License
(https://creativecommons.org/licenses/by-sa/4.0/legalcode).
This tutorial comes with "ABSOLUTELY NO WARRANTY".
Tutorial version 1.0

0. TABLE OF CONTENTS

    1. PREINSTALLATION.
        1.1. Downloading required files.
        1.2. Arranging files for preinstallation.
        1.3. Modification of configuration file, "win32-loader.ini".
        1.4. Starting preinstallation program.
        1.5. Preparing the USB stick.
    2. INSTALLATION.
        2.1. Preparing for the special installation procedure.
        2.2. Special installation procedure.
    3. SUMMARY.
        3.1. Preinstallation.
        3.2. Installation.
    4. FINAL CONSIDERATIONS.
    5. FOOTNOTES.

1. PREINSTALLATION

As with any Debian installation, it is recommended to have the installation
manual at hand, just in case...  Please, read at least every step completely
before doing it.  I use quotes to give clarity to the tutorial, do not include
them when I ask you to write something unless I specifically say to
include them.

1.1. Downloading required files.

1.1.1. Download the first ISO DVD image for Debian.  You can do it by
any medium:
http, bittorrent, jigdo, etc.

1.1.2. From the directory at
http://<debian-mirror>/debian/dists/buster/main/installer-<arch>/current/images/hd-media/
download the files "initrd.gz" and "vmlinuz" there if you would like to install
using the text interface or those inside the directory "gtk" if you would rather
prefer the graphical interface.  <debian-mirror> is any debian mirror you want
to use like ftp.debian.org and <arch> is the processor architecture's
corresponding suffix (i386, amd64, etc.) which must be the same as the ISO image
you downloaded previously.  Please take into account that if you want to do
the installation in normal mode and not expert mode, you can only choose to use
the graphical interface.

1.1.3. From the directory at http://<debian-mirror>/debian/pool/main/p/pcre3/
download the file "libpcre3-udeb_8.39-12_i386.udeb".

1.1.4. If you don't already have 7-Zip, find it here https://www.7-zip.org/
and install it. (The installation procedure for 7-Zip is not covered
in this tutorial)

1.2. Arranging files for preinstallation.

1.2.1. Make a temporary folder to store some files for preinstallation.
It is better to make it at the root of C:.  I will assume it is "C:\tmpx\".

1.2.2. Optionally, if you want to be sure that no important installation file
gets accidentally modified, you can make the ISO image, "initrd.gz"
and "vmlinuz"
to be read-only files.  This can be done in the files' properties window or
in cmd.exe with the command attrib.

1.2.3. Move the ISO image to "C:\".

1.2.4. Move "initrd.gz" and "vmlinuz" to "C:\tmpx\".

1.2.5. Open the ISO image with 7-Zip and extract "g2ldr" and "g2ldr.mbr"
from there to "C:\tmpx\".

1.2.6. With the ISO still open, extract "setup.exe" and "win32-loader.ini"
to "C:\".

1.3. Modification of configuration file, "win32-loader.ini".

1.3.1. Open "win32-loader.ini" with Notepad and, if you downloaded the files
for the text installer, delete the two lines that contain the text "gtk",
but if you downloaded the others for the graphical installer, then delete
the two lines above that contain nearly the same text except "gtk".

1.3.2. At the other two lines that you did not deleted, replace the text
from just after the equal sign to just before the last slash
with the name of the temporary folder you made previously, here "tmpx".

1.3.3. At the last two lines, after [grub], add just after the equal sign
"tmpx/".

1.3.4. Double check that you did these three previous steps right.
You should write the name of the temporary folder you made instead of "tmpx"
if you gave it another name.  Do not include the double quotes into the file,
I write them only here for clarity.

1.3.5. Save the file, "win32-loader.ini".

1.4. Starting preinstallation program.

1.4.1. Run "setup.exe" from "C:\".  Follow the instructions there.
If it tells you that you should use a 64-bits version but you are sure
that you need the 32-bits one, then just click on "No", else you should use
the installer and ISO image for that architecture.  I tried the installation
in expert mode but normal might work fine too.  If this preinstallation fails,
retry one more time.

1.5. Preparing the USB stick.

1.5.1. You should backup now anything you don't want to lose from the USB stick.

1.5.2. Make a temporary folder in your hard disk to put some files there.

1.5.3. Open the DVD ISO image again with 7-Zip if you closed it.

1.5.4. Inside 7-Zip, navigate to "pool\main\f\fuse\".

1.5.5. Open "fuse-udeb_2.9.9-1+deb10u1_i386.udeb" (just double click it
or select it and press enter, it will be opened inside 7-Zip).
I will not mention this again, I will write them in the paths in this tutorial
as if those files were folders.

1.5.6. Open "data.tar" (if you think that 7-Zip is buggy because it omitted
some files, read this footnote [1], ignore this if you don't know what I'm
talking about), then open ".".

1.5.7. Extract everything in there from 7-Zip to the temporary folder
(the last one I mentioned at step 1.5.2.).  You can drag and drop to do this.

1.5.8. In 7-Zip, go back into the folder "main".  To do this you can:
click the icon at the left of the path bar, double click the folder "..",
or press Backspace (not Del).

1.5.9. Repeat the steps 1.5.6. to 1.5.8. every time after going to the
following paths one at a time.  If Windows asks you whether you would like
to mix the folders or not, then click on Yes.

"f\fuse\libfuse2-udeb_2.9.9-1+deb10u1_i386.udeb\"
"l\linux-signed-i386\fuse-modules-4.19.0-16-686-pae-di_4.19.181-1_i386.udeb\"
"libs\libselinux\libselinux1-udeb_2.8-1+b1_i386.udeb\"
"n\ntfs-3g\ntfs-3g-udeb_2017.3.23AR.3-3_i386.udeb\"

1.5.10. Look for the file "libpcre3-udeb_8.39-12_i386.udeb" you downloaded
at step 1.1.3. and open it with 7-Zip.  Do the same as the step 1.5.9. before
with the files inside it.

1.5.11. Look for the following files inside the temporary folder
and delete them; do it by clicking on them and pressing Shift+Del one by one,
and please make sure you're deleting the right files.  If you look close,
the files' type is shown as ".symlink".

"lib/libpcre.so.3"
"lib/libpcreposix.so.3"
"lib/i386-linux-gnu/libfuse.so.2"
"lib/i386-linux-gnu/libulockmgr.so.1"
"lib/i386-linux-gnu/libntfs-3g.so.883"
"sbin/mount.ntfs"
"sbin/mount.ntfs-3g"
"usr/lib/i386-linux-gnu/libeatmydata.so"
"usr/lib/i386-linux-gnu/libeatmydata.so.1"

If you ask yourself why you need to do this, it is because Windows can not copy
the symlinks to the USB stick.  We will be creating those files again later.

1.5.12. You backed up your important files from your USB stick at step 1.5.1.,
right?  After this process gets finished, all your files that are
in your USB stick will be deleted.  Now format the USB stick by right clicking
on it in Windows Explorer (Windows' file manager) and click on "Format...".
Make sure that these things are selected/marked: "FAT32" below "File System"
and "Quick format", if not, do it.  Finally click on "Start".

1.5.13. Copy the whole contents of the temporary folder to the root
of the USB stick where you will be installing Debian on.

2. INSTALLATION

2.1. Preparing for the special installation procedure.

2.1.1. Now you will be doing the installation process, but you still need to do
some things before proceeding with the normal installation of Debian.
I advise you to read the remaining of this tutorial and take some notes.
If you have never installed Debian before, read/take a copy of the manual.

2.1.2. From now on, you can follow two paths to finish this special
installation procedure: (A) run a script attached to this tutorial that will
make almost everything for you, or (B) do the same things that the script does
manually.  When I write A or B at the step number in this tutorial is because
it depends on the path you choose here.

2.1.3.A. Copy the script file "prepare-ntfs.sh" attached to this tutorial
to the root of your USB stick.  Do not modify it unless you have the right tools
and you know what you are doing.

2.1.3.B. If you want, copy the file "steps.txt" attached to this tutorial
to the root of your USB stick.  This will make it easier to follow the manual
steps later.

2.2. Special installation procedure.

2.2.1. Insert the USB stick in the USB port of your computer if its not already
there.

2.2.2. Reboot your computer.  When you see a black screen with some
white letters
on it saying "Windows" and "Debian GNU/Linux", use your keyboard arrows
to select "Debian GNU/Linux" and press Enter.

2.2.3. After you get presented with the installer's interface, follow the normal
installation process until you reach the ISO image detection step.
If you are in the normal mode for the installation, that detection
step will fail;
don't worry, just go back and the installer will present you with options
to look for the ISO image, and stop there.

2.2.4. If you are using the text interface, press Alt+F2, but if you are
using the graphical interface, press Ctrl+Alt+F2.  Then press Enter.

2.2.5. Write "blkid | grep 'TYPE="vfat"'" (without the outer quotes)
and press Enter.

2.2.6. If only one line gets displayed, then take note of the path shown
at the start of the line, it should be something like "/dev/sdX1" where X
could be any letter.  If not, then press Alt+F4, unplug and plug in again
the USB stick.  Some information will be displayed and you will see a line
that contains "sdX" where X can be any letter; take note of that "sdX".

2.2.7. Write "mount" (again without the quotes) and press Enter.

2.2.8. Look for a line that has the "sdX1" you took note of before.
If you find it, then take note of the path after it (probably "/media").
If you can not find it, write "ls /media/" and press Enter; if it shows nothing,
write "mount -t vfat -o ro /dev/sdX1 /media/" where X should be the letter
you took note of before and press Enter, else write "umount /media/"
and then write "mount -t vfat -o ro /dev/sdX1 /media/" and press Enter.

2.2.9. Write "cd /media/" and press Enter, then write "ls" and press Enter.
You should see a list of what is inside the USB stick,
if not, review what you did or look for help.

2.2.10.A. Write "sh ./prepare-ntfs.sh /media/" (without the quotes)
and press Enter.
When everything finishes, jump to step 2.2.13. in this tutorial.

2.2.10.B. As a reminder, you should not follow these steps in this tutorial
marked as B if you did the previous one for the automatic procedure.
If you follow these manual steps marked with B I will suppose you know a bit
about Unix based systems.  Use "cd" to navigate through the directory structure
starting from "/media/" and copy the contents with "cp" from every directory
to the corresponding location without the "/media/".  Create any directory
as you see necessary.  If you know how to do it better, then do it.

2.2.11.B. Press Alt+F3 and then Enter.  Use "cat" or "nano" to read the file
"steps.txt" you should have copied to the USB stick at step 2.1.3.B.
It should be at "/media/steps.txt".  Make the links specified there
with "ln -s".
Use Alt+F2 and Alt+F3 to switch between consoles to run the commands and read
the steps at the same time.  You should go to every destination directory
with "cp" and use relative paths except for "/bin/ntfs-3g"
if you want to replicate the original symbolic links.
Of course, if you know how to do it better, then do it that way.

2.2.12.B. Write "depmod" and press Enter, then write "modprobe fuse"
and press Enter.

2.2.13. Write "cd /" and press Enter, then write "umount /media/" and
press Enter.

2.2.14. Write "blkid | grep 'TYPE="ntfs"'" and press Enter.

2.2.15. You should see your hard disk with Windows there.  If there is
only one line, take note of the "/dev/sdXY" where X could be any letter
and Y could be any number.  If there are many you will have to take note of
all those "/dev/sdXY".

2.2.16. If you got only one line with the previous step,
write "ntfs-3g -o ro /dev/sdXY /mnt/" where X is a letter and Y is a number
you took note of before and press Enter.  If you got many lines,
then you will have to write "mkdir /mnt/sdXY/" and press Enter as many times
as lines you got at the previous step, replacing each time X and Y with each
combination you took note of before; then do the same with
"ntfs-3g -o ro /dev/sdXY /mnt/sdXY/".

2.2.17. If you are using the text installer, press Alt+F1, but if you are using
the graphical installer, press Alt+F5.

2.2.18. In the installer's step to look for the ISO image, scan the disk
marked as the "/dev/sdXY" you took note of before at step 2.2.15
or all the disks if you got several "/dev/sdXY".  Use the keyboard
arrows and Enter
or your mouse to select and start the search.

2.2.19. When finished, select the found ISO image and continue.

2.2.20. Then, if you have the text installer, press Alt+F2, else Ctrl+Alt+F2.

2.2.21. If you got only one "/dev/sdXY" before at step 2.2.15., write
"umount /mnt/",
but if you got several, write "umount /mnt/sdXY/" and press Enter as many times
as "sdXY" you got before replacing each time X and Y with each combination.

2.2.22. Finally, if you have the text installer, press Alt+F1, but if you have
the graphical one, press "Alt+F5".  Now you can proceed with the normal
installation process of Debian.

3. SUMMARY

3.1. Preinstallation.

3.1.1. Download Debian's ISO image, the "initrd.gz" and "vmlinuz" from
"hd-media", "libpcre3-udeb_8.39-12_i386.udeb" and 7-Zip, and install 7-Zip.

3.1.2. In a temporary folder (preferably at the root of C:), put "initrd.gz",
"vmlinuz", and "g2ldr" and "g2ldr.mbr" from the ISO image.

3.1.3. At "C:\", put the ISO image, and "setup.exe" and "win32-loader.ini"
from the ISO image.

3.1.4. Modify carefully "win32-loader.ini" giving the path to "initrd.gz",
"vmlinuz", "g2ldr" and "g2ldr.mbr" as indicated at steps 1.3.

3.1.5. Run the preinstallation program "setup.exe".

3.1.6. In another temporary folder, extract from the ISO image the "data"
contents of packages: "fuse-udeb", "libfuse2-udeb", "fuse-modules" from Linux,
"libselinux1-udeb" and "ntfs-3g-udeb", and from the already downloaded
"libpcre3-udeb".

3.1.7. Delete the symbolic links (".symlink" files) and move the contents
of that temporary folder to the root of the USB stick after you format it
with FAT32.

3.2. Installation.

3.2.1. Copy the script "prepare-ntfs.sh" or the file "steps.txt", both attached
to this tutorial at the root of your USB stick.

3.2.2. Plug in the USB stick, reboot the PC, start the installer and continue
until the ISO image detection step.

3.2.3. Use the key combinations Alt+F2, Ctrl+Alt+F2, Alt+F3, Alt+F1, Alt+F5
accordingly to switch between consoles/installer.

3.2.4. Find out the device path of your USB stick ("/dev/sdX1") and mount it
with "mount" at "/media/".

3.2.5. Execute the script "prepare-ntfs.sh" found into "/media/" or do the steps
manually.

3.2.6. Unmount your USB stick with "umount" and mount your NTFS disk(s)
("/dev/sdXY") with "ntfs-3g" at "/mnt/".

3.2.7. Follow the ISO image detection procedure in the installer's menu.
When finished, unmount your disk(s) from "/mnt/".

3.2.8. Install Debian.

4. FINAL CONSIDERATIONS

4.1. If you will be using your system Debian for quite some time
from your USB stick, you should consider disabling the access time feature
of the file system.  This can be done by a manual partitioning of your
USB stick.
If you are in normal mode and not expert mode, you can go back in the menus
until you reach the main menu and then select the partitioning step.
If you disable the access time, you will be extending the lifetime of your
USB stick (yes, they can "die").

4.2. You should read the installation manual anyway for any question you might
have about the installation process.

5. FOOTNOTES

5.1. By default, 7-Zip opens many archive/compression layers in one step
if they are followed one by the other.  Indeed, it is ignoring the control
archive; but if you right click and press the "Open inside *" option, it will
open one layer at a time.
Copyright (c) 2021 Santiago Pinto
License: CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/legalcode)
Tutorial version 1.0

This is an extract from a tutorial to install Debian 10.9 in a USB stick
from a Windows' NTFS-formatted partition.

2.2. Special installation procedure.

2.2.1. Insert the USB stick in the USB port of your computer if its not already
there.

2.2.2. Reboot your computer.  When you see a black screen with some white 
letters
on it saying "Windows" and "Debian GNU/Linux", use your keyboard arrows
to select "Debian GNU/Linux" and press Enter.

2.2.3. After you get presented with the installer's interface, follow the normal
installation process until you reach the ISO image detection step.
If you are in the normal mode for the installation, that detection step will 
fail;
don't worry, just go back and the installer will present you with options
to look for the ISO image, and stop there.

2.2.4. If you are using the text interface, press Alt+F2, but if you are
using the graphical interface, press Ctrl+Alt+F2.  Then press Enter.

2.2.5. Write "blkid | grep 'TYPE="vfat"'" (without the outer quotes) and press 
Enter.

2.2.6. If only one line gets displayed, then take note of the path shown
at the start of the line, it should be something like "/dev/sdX1" where X
could be any letter.  If not, then press Alt+F4, unplug and plug in again
the USB stick.  Some information will be displayed and you will see a line
that contains "sdX" where X can be any letter; take note of that "sdX".

2.2.7. Write "mount" (again without the quotes) and press Enter.

2.2.8. Look for a line that has the "sdX1" you took note of before.
If you find it, then take note of the path after it (probably "/media").
If you can not find it, write "ls /media/" and press Enter; if it shows nothing,
write "mount -t vfat -o ro /dev/sdX1 /media/" where X should be the letter
you took note of before and press Enter, else write "umount /media/"
and then write "mount -t vfat -o ro /dev/sdX1 /media/" and press Enter.

2.2.9. Write "cd /media/" and press Enter, then write "ls" and press Enter.
You should see a list of what is inside the USB stick,
if not, review what you did or look for help.

2.2.10.A. Write "sh ./prepare-ntfs.sh /media/" (without the quotes) and press 
Enter.
When everything finishes, jump to step 2.2.13. in this tutorial.

2.2.10.B. As a reminder, you should not follow these steps in this tutorial
marked as B if you did the previous one for the automatic procedure.
If you follow these manual steps marked with B I will suppose you know a bit
about Unix based systems.  Use "cd" to navigate through the directory structure
starting from "/media/" and copy the contents with "cp" from every directory
to the corresponding location without the "/media/".  Create any directory
as you see necessary.  If you know how to do it better, then do it.

2.2.11.B. Press Alt+F3 and then Enter.  Use "cat" or "nano" to read the file
"steps.txt" you should have copied to the USB stick at step 2.1.3.B.
It should be at "/media/steps.txt".  Make the links specified there with "ln 
-s".
Use Alt+F2 and Alt+F3 to switch between consoles to run the commands and read
the steps at the same time.  You should go to every destination directory
with "cp" and use relative paths except for "/bin/ntfs-3g"
if you want to replicate the original symbolic links.
Of course, if you know how to do it better, then do it that way.

---BEGIN SYMLINKS---
/lib/i386-linux-gnu/libfuse.so.2 -> libfuse.so.2.9.9
/lib/i386-linux-gnu/libntfs-3g.so.883 -> libntfs-3g.so.883.0.0
/lib/i386-linux-gnu/libulockmgr.so.1 -> libulockmgr.so.1.0.1
/sbin/mount.ntfs -> mount.ntfs-3g
/sbin/mount.ntfs-3g -> /bin/ntfs-3g
/usr/lib/libpcre.so.3 -> libpcre.so.3.13.3
/usr/lib/libpcreposix.so.3 -> libpcreposix.so.3.13.3
---END SYMLINKS---

2.2.12.B. Write "depmod" and press Enter, then write "modprobe fuse" and press 
Enter.

2.2.13. Write "cd /" and press Enter, then write "umount /media/" and press 
Enter.

2.2.14. Write "blkid | grep 'TYPE="ntfs"'" and press Enter.

2.2.15. You should see your hard disk with Windows there.  If there is
only one line, take note of the "/dev/sdXY" where X could be any letter
and Y could be any number.  If there are many you will have to take note of
all those "/dev/sdXY".

2.2.16. If you got only one line with the previous step,
write "ntfs-3g -o ro /dev/sdXY /mnt/" where X is a letter and Y is a number
you took note of before and press Enter.  If you got many lines,
then you will have to write "mkdir /mnt/sdXY/" and press Enter as many times
as lines you got at the previous step, replacing each time X and Y with each
combination you took note of before; then do the same with
"ntfs-3g -o ro /dev/sdXY /mnt/sdXY/".

2.2.17. If you are using the text installer, press Alt+F1, but if you are using
the graphical installer, press Alt+F5.

2.2.18. In the installer's step to look for the ISO image, scan the disk
marked as the "/dev/sdXY" you took note of before at step 2.2.15
or all the disks if you got several "/dev/sdXY".  Use the keyboard arrows and 
Enter
or your mouse to select and start the search.

2.2.19. When finished, select the found ISO image and continue.

2.2.20. Then, if you have the text installer, press Alt+F2, else Ctrl+Alt+F2.

2.2.21. If you got only one "/dev/sdXY" before at step 2.2.15., write "umount 
/mnt/",
but if you got several, write "umount /mnt/sdXY/" and press Enter as many times
as "sdXY" you got before replacing each time X and Y with each combination.

2.2.22. Finally, if you have the text installer, press Alt+F1, but if you have
the graphical one, press "Alt+F5".  Now you can proceed with the normal
installation process of Debian.

3. SUMMARY

3.1. Preinstallation.

3.1.1. Download Debian's ISO image, the "initrd.gz" and "vmlinuz" from
"hd-media", "libpcre3-udeb_8.39-12_i386.udeb" and 7-Zip, and install 7-Zip.

3.1.2. In a temporary folder (preferably at the root of C:), put "initrd.gz",
"vmlinuz", and "g2ldr" and "g2ldr.mbr" from the ISO image.

3.1.3. At "C:\", put the ISO image, and "setup.exe" and "win32-loader.ini"
from the ISO image.

3.1.4. Modify carefully "win32-loader.ini" giving the path to "initrd.gz",
"vmlinuz", "g2ldr" and "g2ldr.mbr" as indicated at steps 1.3.

3.1.5. Run the preinstallation program "setup.exe".

3.1.6. In another temporary folder, extract from the ISO image the "data"
contents of packages: "fuse-udeb", "libfuse2-udeb", "fuse-modules" from Linux,
"libselinux1-udeb" and "ntfs-3g-udeb", and from the already downloaded 
"libpcre3-udeb".

3.1.7. Delete the symbolic links (".symlink" files) and move the contents
of that temporary folder to the root of the USB stick after you format it
with FAT32.

3.2. Installation.

3.2.1. Copy the script "prepare-ntfs.sh" or the file "steps.txt", both attached
to this tutorial at the root of your USB stick.

3.2.2. Plug in the USB stick, reboot the PC, start the installer and continue
until the ISO image detection step.

3.2.3. Use the key combinations Alt+F2, Ctrl+Alt+F2, Alt+F3, Alt+F1, Alt+F5
accordingly to switch between consoles/installer.

3.2.4. Find out the device path of your USB stick ("/dev/sdX1") and mount it
with "mount" at "/media/".

3.2.5. Execute the script "prepare-ntfs.sh" found into "/media/" or do the steps
manually.

3.2.6. Unmount your USB stick with "umount" and mount your NTFS disk(s)
("/dev/sdXY") with "ntfs-3g" at "/mnt/".

3.2.7. Follow the ISO image detection procedure in the installer's menu.
When finished, unmount your disk(s) from "/mnt/".

3.2.8. Install Debian.
#!/bin/bash
# Copyright: 2021 Santiago Pinto
# License: CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/legalcode)
# Version: 1.0
#sd = absolute starting directory to look for files
sd="$1"
if [ -z "$sd" ]; then
	echo 'The variable $sd for the absolute starting directory is empty.'
	exit 1
elif [ ! -d "$sd" ]; then
	echo 'The variable $sd is not a directory.'
	exit 1
elif ! echo "$sd" | grep -q "*/"; then sd="${sd}/"
fi
pd="`pwd`"
cd "$sd"
for e in "./bin/" "./lib/i386-linux-gnu/" "./lib/modules/4.19.0-16-686/kernel/fs/fuse/" "./sbin/" "./usr/lib/"; do
	if [ ! -d "$e" ]; then
		echo "The directory '$e' does not exist in the working directory."
		exit 2
	fi
done
for e in "./bin/fusermount" "./bin/ntfs-3g" "./bin/ulockmgr_server" "./lib/libselinux.so.1" "./lib/i386-linux-gnu/libfuse.so.2.9.9" "./lib/i386-linux-gnu/libntfs-3g.so.883.0.0" "./lib/i386-linux-gnu/libulockmgr.so.1.0.1" "./lib/modules/4.19.0-16-686/kernel/fs/fuse/fuse.ko" "./sbin/mount.fuse" "./sbin/ntfsresize" "./usr/lib/libpcre.so.3.13.3" "./usr/lib/libpcreposix.so.3.13.3"; do
	if [ ! -f "$e" ]; then
		echo "The file '$e' does not exist in the working directory."
		exit 2
	fi
done
for e in "/bin/" "/lib/i386-linux-gnu/" "/lib/modules/4.19.0-16-686/kernel/fs/fuse/" "/sbin/" "/usr/lib/"; do
	if [ ! -d "$e" ]; then
		mkdir $e
		if [ ! -d "$e" ]; then
			echo "Something went wrong, directory '$e' could not be created."
			exit 3
		fi
	fi
done
cd "${sd}bin/"
cp ./fusermount ./ntfs-3g ./ulockmgr_server /bin/
cd "${sd}lib/"
cp ./libselinux.so.1 /lib/libselinux.so.1
cd "${sd}lib/i386-linux-gnu/"
cp ./libfuse.so.2.9.9 ./libntfs-3g.so.883.0.0 ./libulockmgr.so.1.0.1 /lib/i386-linux-gnu/
cd "${sd}lib/"
cp ./modules/4.19.0-16-686/kernel/fs/fuse/fuse.ko /lib/modules/4.19.0-16-686/kernel/fs/fuse/fuse.ko
cd "${sd}sbin/"
cp ./mount.fuse ./ntfsresize /sbin/
cd "${sd}usr/lib/"
cp ./libpcre.so.3.13.3 ./libpcreposix.so.3.13.3 /usr/lib/
cd "${sd}"
for e in "/bin/fusermount" "/bin/ntfs-3g" "/bin/ulockmgr_server" "/lib/libselinux.so.1" "/lib/i386-linux-gnu/libfuse.so.2.9.9" "/lib/i386-linux-gnu/libntfs-3g.so.883.0.0" "/lib/i386-linux-gnu/libulockmgr.so.1.0.1" "/lib/modules/4.19.0-16-686/kernel/fs/fuse/fuse.ko" "/sbin/mount.fuse" "/sbin/ntfsresize" "/usr/lib/libpcre.so.3.13.3" "/usr/lib/libpcreposix.so.3.13.3"; do
	if [ ! -f "$e" ]; then
		echo "Something went wrong, file '$e' could not be created."
		exit 3
	fi
done
cd /lib/i386-linux-gnu/
ln -s libfuse.so.2.9.9 libfuse.so.2
ln -s libntfs-3g.so.883.0.0 libntfs-3g.so.883
ln -s libulockmgr.so.1.0.1 libulockmgr.so.1
cd /sbin/
ln -s /bin/ntfs-3g mount.ntfs-3g
ln -s mount.ntfs-3g mount.ntfs
cd /usr/lib/
ln -s libpcre.so.3.13.3 libpcre.so.3
ln -s libpcreposix.so.3.13.3 libpcreposix.so.3
cd "${pd}"
for e in "/lib/i386-linux-gnu/libfuse.so.2" "/lib/i386-linux-gnu/libntfs-3g.so.883" "/lib/i386-linux-gnu/libulockmgr.so.1" "/sbin/mount.ntfs-3g" "/sbin/mount.ntfs" "/usr/lib/libpcre.so.3" "/usr/lib/libpcreposix.so.3"; do
	if [ ! -h "$e" ]; then
		echo "Something went wrong, symbolic link '$e' could not be created."
		exit 3
	fi
done
echo "The files were successfully copied."
depmod
if modprobe fuse; then
	echo "The kernel module 'fuse' was successfully loaded."
else
	echo "The kernel module 'fuse' could not be loaded."
	exit 4
fi
exit 0

Reply via email to