[Galaxy S I9000 General] xc-racer99:
Alright, here goes. This is assuming you have all data backed up to somewhere safe.

1) Clone the u-boot port from https://github.com/xc-racer99/u-boot-galaxys4g/ - the v2018.05-aries branch is probably best

git clone https://github.com/xc-racer99/u-boot-galaxys4g -b v2018.05-aries
cd u-boot-galaxys4g

2) Build u-boot:

export ARCH=arm CROSS_COMPILE=/path/to/arm/cc
make s5p_aries_defconfig
make -j6

3) The resulting u-boot.bin is the u-boot file to flash:

heimdall flash --KERNEL u-boot.bin

4) Clone the linux kernel. You can use a variety of branches - linus' branch (aka v4.19 stable), any of the ones from https://github.com/PabloPL/linux/branches - note that I recommend the for-upstream/aries-patches-v2 branch as a base and cherry-pick the commits from the other branches for peripherals you want to use

git clone https://github.com/PabloPL/linux -b for-upstream/aries-patches-v2
cd linux

5) Build linux. First, make sure that the correct debug uart is defined in the defconfig

sed -i -- 's/CONFIG_DEBUG_S3C_UART1/CONFIG_DEBUG_S3C_UART2/g' arch/arm/configs/s5pv210_defconfig
export ARCH=arm CROSS_COMPILE=/path/to/arm/cc
make s5pv210_defconfig
make

6) Create the u-boot uImage. Replace fascinate4g.dtb with galaxys.dtb if not using an SGH-T959V/SGH-T959W/SGH-T959P. Note that if not using the i9000 or one of the above models, there could be some minor incompatabilities.

cat arch/arm/boot/zImage arch/arm/boot/dts/s5pv210-fascinate4g.dtb > zImage-dtb
mkimage -A arm -T kernel -a 30008000 -e 30008000 -O linux -d zImage-dtb -C none uImage

7) Flash the u-boot boot image. This could also be placed in a different place that u-boot knows how to boot from (mmc partition 1/2, sd card partition 1/2)

heimdall flash --RECOVERY uImage

---------- Post added at 09:45 AM ---------- Previous post was at 09:26 AM ----------

Installing a Linux distro

1) Format the first partition on your SD card as a Linux-compatible filesystem (eg ext4)

2) Arch Linux

a) Download the ARMv7 multi-platform zip from https://archlinuxarm.org/about/downloads

b) Extract the ArchLinuxARM-armv7-latest.tar.gz to the first partition on your SD card

3) Debian

a) From a Debian host, install debootstrap and qemu-arm-static

# apt install qemu-arm-static debootstrap

b) Bootstrap the system

# mkdir debian_armhf_stretch
# qemu-debootstrap --arch armhf stretch debian_armhf_stretch http://deb.debian.org/debian/

c) Enter the chroot and configure it

# chroot debian_armhf_stretch

i) Set password

passwd <your new password for user root here>

ii) Install any desired packages, eg xfce4

apt install xfce4

d) Exit the chroot

exit

e) Copy the contents of debian_armhf_stretch to your SD card. Alternatively, you could have run qemu-debootstrap to setup directly on the SD card

4) Stick your SD card into your phone and boot!

Arch Linux is a minimal, non-GUI install while Debian can be customized as desired. I personally use Debian. Note that if using some things such as wifi or bluetooth, you may need some firmware and/or some of the kernel modules to be copied to their required places.

Update

The aries-patches-v2 branch doesn't have the touchscreen enabled. You'll need to merge the commits from https://github.com/PabloPL/linux/commits/for-upstream/atmel-mxt-fixes

You'll also probably want to follow the instructions in the answers in https://askubuntu.com/questions/369621/how-to-get-the-onscreen-keybord-appear-on-login to install an on-screen keyboard. Make sure when you're running the commands that you're in the debian chroot.