Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Yeah, now it's outputting not found errors in the recovery log
Yeah, now it's outputting not found errors in the recovery log
Try,
gcc -static -Iinclude mkbootimg/mkbootimg.c libmincrypt/sha.c libmincrypt/rsa.c libmincrypt/sha256.c -o mkbootimg
And,
gcc -static -Iinclude mkbootimg/unmkbootimg.c -o unmkbootimg
Going off the top of my head while at work but hopefully that does the trick?
And possibly afterwards,
strip unmkbootimg mkbootimg
Built using the above commands (except the strip command, I didn't see that until after I started flashing the zip)
No worries, if it fails, try with the strip command. Fingers crossed!
Yeah, one of the lines in the recovery log was something about an "unexpected (" so I am trying after strip
using my new script.Sweet, making progress. Send me those binaries so I can download them and run tests on my endusing my new script.
Sent you a PM
Did my tests, they were not compiled properly. Working on it now. But I can confirm that by statically linking these binaries will make the zip work. Been in contact with osm0sis over on xda in regards with his binaries and he was getting reports for the same issue. He sent me his binaries for testing and sure enough they worked ;-).
I just got home from work lol.
Gotcha, understand
Well, let me rephrase that lol. You compiled them correctly but not for android lol. Works on pc but not the phone. I forgot to mention that gcc should be referenced to your toolchain. No biggy though. Should have my binaries working soon.
I did a "export PATH=/path/to/arm-eabi-4.6/bin:$PATH" before building. Maybe I needed to build using "arm-eabi-gcc" instead of the host gcc

I have CM 10.2 building as i type this so wish me luck on getting it booted
.
same device tree simonsimons has on his github. Figured i would start with that. A better starting point would probably be the ville (One S).
On a side note, will probably be developing for the Samsung Galaxy Victory as well, should be getting one soon![]()
. #!/sbin/sh
# 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;
}
# 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/kernel" ]]; 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() {
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 "Error, no ramdisk found?!";
fi
KERNEL_ABORT
fi
}
# Aborts kernel repacking - performs cleaning
KERNEL_ABORT() {
rm -rf "$ACTIVE_PROJECT/TEMP"
rm -f "$ACTIVE_PROJECT/newboot.img"
}
# 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
}
# 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
}
# 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
COMMUNICATION
KERNEL_EXTRACT
exit 0
same device tree simonsimons has on his github. Figured i would start with that. A better starting point would probably be the ville (One S).
On a side note, will probably be developing for the Samsung Galaxy Victory as well, should be getting one soon![]()
.