[Android Software/Hacking General [Developers Only]] :
Dont mind the approach I have taken with this. More so just testing, and plan to redo it once I better understand how it is read.

# This will report back to the recovery to show it's progress to let the user know it's currently moving along.
show_progress() {
if [ $OUTFD != "" ]; then
echo "progress ${1} ${2}" 1>&$OUTFD;
fi;
}

# Sets variables for changing requested text
SED_CHANGE_WORD() {
# $1 - What we're changing
# $2 - To what we're changing
# $3 - File location for that
# $4 - Unique delimiter (optional)
if [[ -z "$4" ]]; then
sed -i 's/'"$1"'/'"$2"'/g' "$3"
else
sed -i 's'"$4""$1""$4""$2""$4"'g' "$3"
fi
}

# This will change our temporary progress to a number of all words in the designated script, making progress bar truly reliable. Many thanks to JustArchi for this idea. I made some changes to his original method.
PROGRESS() {
SED_CHANGE_WORD "700777007" "$(wc -l "/tmp/MyMind" | sed 's/^\([0-9]*\).*$/\1/')" "/tmp/MyMind"
}

show_progress 1.0 700777007;

#!/sbin/sh

# Some but not all of this script has been snippets here and there from ArchiKitchen and DSIXDA Kitchen.
# This has allowed me to formulate a zip as such without the need to technically build from scratch saving me LOADS OF HOURS.
# It currently uses my static compiled mkbootimg, unmkbootimg, and mkbootfs binaries to allow editing, and rebuilding of the boot.img.
# Some serious modifications were made to get this to work successfully with MUCH DEBUGGING. If you change something and it breaks another function then that is on you!
# IT IS CURRENTLY STABLE!

#MAKE SURE YOU CHANGE "$BOOT_PARTITION" ACCORDING TO YOUR DEVICE BEFORE USING THIS SCRIPT!!!!!!

# What does this script do?
# 1. It will pull your current boot.img using dd.
# 2. It will search for the Android! header in the boot.img and remove the unneccasary junk before it if needed to.
# 3. It will split the boot.img in to the kernel and ramdisk.
# 4. It will unpack the contents inside the ramdisk.
# 5. It will modify the default.prop file giving you insecure ADB. If you already have it then this will not affect you.
# 6. It will modify the init.rc file to give support for init.d. If you already have it then this will not affect you.
# 7. It will write to sysinit and install-recovery.sh for the completion of init.d support. If already done, then this will not affect you.
# 8. It will make the init.d folder under /system/etc on your device with required permissions.
# 9. It will place an init.d script to test to see if init.d is fully working. If it works, you will find a file called, HAS_INIT, located in the /dev directory of your device.
# 10. It will swap out the original kernel with a new prebuilt kernel upon rebuilding the new boot.img
# 11. It will repack you a new ramdisk using mkbootfs to be applied to your new boot.img upon rebuilding it.
# 12. It will remove your old modules and push your new modules that came with your new prebuilt kernel.
# 13. It will write your new boot.img to your boot partition using dd.
# 14. Hopefully, more to come!

# automatically cd to directory where this script is running
cd "$(dirname "$0")"
# /tmp/MyMind

# Set Variables here
ACTIVE_PROJECT="/tmp"
BOOT_PARTITION="/dev/block/mmcblk0p20"

# Lets report back to the recovery to allow users to know what is taking place using "ui_print"
COMMUNICATION() {
OUTFD="$("$ACTIVE_PROJECT/binaries/busybox" ps | "$ACTIVE_PROJECT/binaries/busybox" grep -v "grep" | "$ACTIVE_PROJECT/binaries/busybox" grep -o -E "updater(.*)" | "$ACTIVE_PROJECT/binaries/busybox" cut -d " " -f 3)";
}

ui_print() {
if [ $OUTFD != "" ]; then
echo "ui_print ${1} " 1>&$OUTFD;
echo "ui_print " 1>&$OUTFD;
else
echo "${1}";
fi;
}

# This will report back to the recovery to show it's progress to let the user know it's currently moving along.
show_progress() {
if [ $OUTFD != "" ]; then
echo "progress ${1} ${2}" 1>&$OUTFD;
fi;
}

# This will change our temporary progress to a number of all words in the designated script, making progress bar truly reliable. Many thanks to JustArchi for this idea. I made some changes to his original method.
PROGRESS() {
SED_CHANGE_WORD "700777007" "$(wc -l "/tmp/MyMind" | sed 's/^\([0-9]*\).*$/\1/')" "/tmp/MyMind"
}

# Boot.img uses a magic header of ANDROID! so, lets check for strange boot.img headers
SIGNATURE_CHECK() {
check_header=`"$ACTIVE_PROJECT/TEMP/binaries/busybox" od -A n -h -j 0 -N 8 "$ACTIVE_PROJECT/TEMP/boot.img" | sed 's/ //g'`

if [ "$check_header" != "4e415244494f2144" ]
then
ui_print " ";
ui_print "Android magic header not found at start of boot.img";
ui_print " ";
ui_print "Checking if it exists elsewhere ...";
# Look for Header
hex_offset=`$ACTIVE_PROJECT/TEMP/binaries/busybox od -x -A x $ACTIVE_PROJECT/TEMP/boot.img | grep -m 1 "4e41 [ ]*5244 [ ]*494f [ ]*2144" | sed -e 's/ .*//'`

if [ "$hex_offset" != "" ]
then
# Remove leading bytes before the Android header
dec_offset=`printf "%d" 0x$hex_offset`
ui_print " ";
ui_print "Android header found at offset $dec_offset";
ui_print " ";
ui_print "Removing extra stuff before it so boot.img can be read properly ..."
dd if="$ACTIVE_PROJECT/TEMP/boot.img" of="$ACTIVE_PROJECT/TEMP/modboot.img" bs=1 skip=$dec_offset
rm -f "$ACTIVE_PROJECT/TEMP/boot.img"
cp "$ACTIVE_PROJECT/TEMP/modboot.img" "$ACTIVE_PROJECT/TEMP/boot.img"
rm -f "$ACTIVE_PROJECT/TEMP/modboot.img"
ui_print " ";
else
ui_print "Warning: Android header not found in boot.img (unsupported format)";
fi
fi
}

# Remember the output to rebuild the boot image
UNMKBOOTIMG_INFO() {
KERNEL_INFO=$(echo $KERNEL_INFO_RAW | grep mkbootimg)
KERNEL_BASE=$(echo $KERNEL_INFO | cut -d " " -f 25)
KERNEL_PAGESIZE=$(echo $KERNEL_INFO | cut -d " " -f 27)
KERNEL_OFFSET=$(echo $KERNEL_INFO | cut -d " " -f 29)
RAMDISK_OFFSET=$(echo $KERNEL_INFO | cut -d " " -f 31)
SECOND_OFFSET=$(echo $KERNEL_INFO | cut -d " " -f 33)
TAGS_OFFSET=$(echo $KERNEL_INFO | cut -d " " -f 35)
KERNEL_CMDLINE=$(echo $KERNEL_INFO | cut -d " " -f 37-38)
RAMDISK_NAME=$(echo $KERNEL_INFO | cut -d " " -f 42) # Not in use
}

# Extracts the kernel
KERNEL_EXTRACT() {
if [[ ! -e "$ACTIVE_PROJECT/TEMP" ]]; then
mkdir -p "$ACTIVE_PROJECT/TEMP"
mv "$ACTIVE_PROJECT/binaries/" "$ACTIVE_PROJECT/TEMP/"
if [[ -e "$ACTIVE_PROJECT/TEMP/binaries/mkbootimg" || -e "$ACTIVE_PROJECT/TEMP/binaries/unmkbootimg" || -e "$ACTIVE_PROJECT/TEMP/binaries/mkbootfs" ]]; then
cd "$ACTIVE_PROJECT/TEMP/binaries"
if [[ ! -e mkbootimg || ! -e unmkbootimg || ! -e mkbootfs ]]; then
ui_print "ERROR! Something went wrong! Binaries are missing!";
return 1
fi
cd "$(dirname "$0")"
dd if="$BOOT_PARTITION" of="$ACTIVE_PROJECT/TEMP/boot.img"
SIGNATURE_CHECK
cd "$ACTIVE_PROJECT/TEMP"
fi
if [[ -e "$ACTIVE_PROJECT/TEMP/boot.img" ]]; then
KERNEL_INFO_RAW=$("$ACTIVE_PROJECT/TEMP/binaries/unmkbootimg" -i "$ACTIVE_PROJECT/TEMP/boot.img")
mkdir -p "$ACTIVE_PROJECT/TEMP/ramdisk"
if [[ -e "$ACTIVE_PROJECT/TEMP/ramdisk.cpio.gz" ]]; then
cd "$ACTIVE_PROJECT/TEMP/ramdisk"
ui_print " ";
ui_print "Unpacking the ramdisk ...";
"$ACTIVE_PROJECT/TEMP/binaries/busybox" gunzip -c ../ramdisk.cpio.gz | "$ACTIVE_PROJECT/TEMP/binaries/busybox" cpio -i
cd "$(dirname "$0")"
ui_print " ";
ui_print "Will now modify init.rc and give you init.d support!";
INITD
fi
else
ui_print "No kernel found!";
return 1
fi
fi
}

# Repacks the kernel from the previously extracted one
KERNEL_REPACK() {
ui_print " ";
ui_print "Let's fix ADB before repacking the Kernel";
ADB
if [[ -d "$ACTIVE_PROJECT/TEMP" ]]; then
if [[ -d "$ACTIVE_PROJECT/TEMP/ramdisk" ]]; then
cd "$ACTIVE_PROJECT/TEMP"
ui_print " ";
ui_print "Repacking the ramdisk now.";
"$ACTIVE_PROJECT/TEMP/binaries/mkbootfs" ./ramdisk | gzip > NEWramdisk.cpio.gz
cd "$(dirname "$0")"
UNMKBOOTIMG_INFO
"$ACTIVE_PROJECT/TEMP/binaries/mkbootimg" --base $KERNEL_BASE \
--pagesize $KERNEL_PAGESIZE \
--kernel_offset $KERNEL_OFFSET \
--ramdisk_offset $RAMDISK_OFFSET \
--second_offset $SECOND_OFFSET \
--tags_offset $TAGS_OFFSET \
--cmdline "$KERNEL_CMDLINE" \
--kernel "$ACTIVE_PROJECT/prebuilt/zImage" \
--ramdisk "$ACTIVE_PROJECT/TEMP/NEWramdisk.cpio.gz" \
-o "$ACTIVE_PROJECT/newboot.img"
ui_print " ";
ui_print "Have completed building your modified boot.img!";
FLASH
else
ui_print " ";
ui_print "Error, no ramdisk found?!";
fi
else
ui_print " ";
ui_print "Aborting due to failure finding required directories!";
KERNEL_ABORT
fi
}

# Cleanup old modules and install new modules. Add script to start modules at boot.
# Check for modules. Some kernels may have module support disabled and therefore do not require them.
MODULES() {
ui_print " ";
ui_print "Installing Modules if applicable...";
if [[ -e "$ACTIVE_PROJECT/modules/*.ko" ]]; then
KO=$(find "$ACTIVE_PROJECT/modules/" -name '*.ko')
find "/system/lib/modules/" -name '*.ko' -exec rm -f {} \;
find "$ACTIVE_PROJECT/modules/" -name '*.ko' -exec cp -av {} "/system/lib/modules/" \;
else
ui_print " ";
ui_print "No modules found in this zip...";
fi
}

# Aborts kernel repacking - performs cleaning
KERNEL_ABORT() {
rm -rf "$ACTIVE_PROJECT/TEMP"
rm -f "$ACTIVE_PROJECT/newboot.img"
return 1
}

# Adds kernel's Init.d
INITD() {
if [[ -e "$ACTIVE_PROJECT/TEMP/ramdisk/init.rc" ]]; then
sed -i -e '0,/class_start /s//start sysinit\n\n class_start /' "$ACTIVE_PROJECT/TEMP/ramdisk/init.rc"
sed -i -e 's/service media /service sysinit \/system\/bin\/logwrapper \/system\/xbin\/busybox run-parts \/system\/etc\/init.d\n disabled\n oneshot\n\nservice media /' "$ACTIVE_PROJECT/TEMP/ramdisk/init.rc"
cd "$(dirname "$0")"
cd ..
MOUNT
INSTALL_RECOVERY
SYSINT
PERMISSIONS
KERNEL_REPACK
else
ui_print "ERROR, missing needed contents from the ramdisk?!";
rm -rf "$ACTIVE_PROJECT/TEMP"
return 1
fi
}

# Adds insecure ADB
ADB() {
if [[ -e "$ACTIVE_PROJECT/TEMP/ramdisk" ]]; then
if [[ "$(grep -qi "persist.service.adb.enable=0" "$ACTIVE_PROJECT/TEMP/ramdisk/default.prop"; echo $?)" -eq 0 ]]; then
SED_CHANGE_WORD "persist.service.adb.enable=0" "persist.service.adb.enable=1" "$ACTIVE_PROJECT/TEMP/ramdisk/default.prop"
SED_CHANGE_WORD "ro.secure=1" "ro.secure=0" "$ACTIVE_PROJECT/TEMP/ramdisk/default.prop"
ui_print " ";
ui_print "Setting up Adb was successful!";
else
ui_print " ";
ui_print "Adb was already previously set.";
fi
fi
}

# Mount /system as read and write. No need to remount as read only as this will be fixed automatically upon reboot.
MOUNT() {
busybox mount -o remount,rw -t auto /system
}

# Build and write to install-recovery.sh
INSTALL_RECOVERY() {
if [ -e /system/etc/install-recovery.sh ]
then
busybox echo "# init.d support" >> /system/etc/install-recovery.sh
busybox echo "busybox run-parts /system/etc/init.d/" >> /system/etc/install-recovery.sh
busybox echo "" >> /system/etc/install-recovery.sh
busybox awk '!x[$0]++' /system/etc/install-recovery.sh > /tmp/install-recovery.sh
busybox cat /tmp/install-recovery.sh > /system/etc/install-recovery.sh
busybox echo "" >> /system/etc/install-recovery.sh
else
cat > /system/etc/install-recovery.sh
busybox echo "#!/system/bin/sh" >> /system/etc/install-recovery.sh
busybox echo "# init.d support" >> /system/etc/install-recovery.sh
busybox echo "busybox run-parts /system/etc/init.d/" >> /system/etc/install-recovery.sh
busybox echo "" >> /system/etc/install-recovery.sh
fi
}

# Build and write to systint
SYSINT() {
if [ -e /system/bin/sysint ]
then
busybox echo "#!/system/bin/sh" >> /system/bin/sysint
busybox echo "# init.d support" >> /system/bin/sysint
busybox echo "" >> /system/bin/sysint
busybox echo "export PATH=/sbin:/system/sbin:/system/bin:/system/xbin" >> /system/bin/sysint
busybox echo "/system/bin/logwrapper run-parts /system/etc/init.d" >> /system/bin/sysint
busybox echo "" >> /system/bin/sysint
busybox awk '!x[$0]++' /system/bin/sysint > /tmp/sysint
busybox cat /tmp/sysint > /system/bin/sysint
busybox echo "" >> /system/bin/sysint
else
busybox echo "#!/system/bin/sh" > /system/bin/sysint
busybox echo "# init.d support" >> /system/bin/sysint
busybox echo "" >> /system/bin/sysint
busybox echo "export PATH=/sbin:/system/sbin:/system/bin:/system/xbin" >> /system/bin/sysint
busybox echo "/system/bin/logwrapper run-parts /system/etc/init.d" >> /system/bin/sysint
busybox echo "" >> /system/bin/sysint
fi
}

# Set permissions accordingly
PERMISSIONS() {
busybox chmod 755 /system/etc/install-recovery.sh
busybox chown 0.0 /system/etc/install-recovery.sh
busybox chmod 755 /system/bin/sysint
busybox chown 0.2000 /system/bin/sysint
}

# Sets variables for changing requested text
SED_CHANGE_WORD() {
# $1 - What we're changing
# $2 - To what we're changing
# $3 - File location for that
# $4 - Unique delimiter (optional)
if [[ -z "$4" ]]; then
sed -i 's/'"$1"'/'"$2"'/g' "$3"
else
sed -i 's'"$4""$1""$4""$2""$4"'g' "$3"
fi
}

# Install modified boot.img
FLASH() {
if [[ -e "$ACTIVE_PROJECT/newboot.img" ]]; then
dd if=$ACTIVE_PROJECT/newboot.img of=$BOOT_PARTITION
ui_print " ";
ui_print "Your new Boot Image is installed with added init.d support!";
else
ui_print " ";
ui_print "Your new boot image is missing in action!";
ui_print "CANNOT flash your new boot image!";
fi
}

# Start the process here
PROGRESS
COMMUNICATION
show_progress 1.0 700777007;
KERNEL_EXTRACT
MODULES
exit 0