[Epic 4G Android Development] AndyYan:
After repo sync and sorting some errors out, the build of cm-10.2 went for 40+ minutes and just as it was packaging the zip, it suddenly halted like this:

Package target files: /home/crossgate/android/system/out/target/product/epicmtd/obj/PACKAGING/target_files_intermediates/cm_epicmtd-target_files-eng.crossgate.zip
Package OTA: /home/crossgate/android/system/out/target/product/epicmtd/cm_epicmtd-ota-eng.crossgate.zip
MKBOOTIMG=device/samsung/epicmtd/shbootimg.mk \
./device/samsung/epicmtd/releasetools/epicmtd_ota_from_target_files -v \
-p /home/crossgate/android/system/out/host/linux-x86 \
-k build/target/product/security/testkey \
--backup=true \
--override_device=epic,epicmtd,SPH-D700 \
/home/crossgate/android/system/out/target/product/epicmtd/obj/PACKAGING/target_files_intermediates/cm_epicmtd-target_files-eng.crossgate.zip /home/crossgate/android/system/out/target/product/epicmtd/cm_epicmtd-ota-eng.crossgate.zip
unzipping target target-files...
running: unzip -o -q /home/crossgate/android/system/out/target/product/epicmtd/obj/PACKAGING/target_files_intermediates/cm_epicmtd-target_files-eng.crossgate.zip -d /tmp/targetfiles-JGSSmJ
--- target info ---
blocksize = (int) 131072
build.prop = (dict) {'ro.ril.gprsclass': '10', 'dalvik.vm.heapsize': '128m', 'ro.build.display.id': 'cm_epicmtd-userdebug 4.3 JSS15J eng.crossgate.20130801.085015 test-keys', 'ro.wifi.channels': '', 'ro.setupwizard.enterprise_mode': '1', 'ro.build.characteristics': 'default', 'net.cdma.pppd.user': 'user[SPACE]SprintNextel', 'ro.url.legal': 'http://www.google.com/intl/%s/mobile/android/basic/phone-legal.html', 'dalvik.vm.heaptargetutilization': '0.25', 'ril.ecclist': '112,911,#911,*911', 'ro.build.product': 'SPH-D700', 'wifi.supplicant_scan_interval': '20', 'ro.telephony.ril_class': 'EpicRIL', 'ro.build.host': 'Erazer', 'ro.product.name': 'SPH-D700', 'ro.com.android.dataroaming': 'false', 'ro.build.id': 'JSS15J', 'ro.rommanager.developerid': 'cyanogenmod', 'ro.com.android.dateformat': 'MM-dd-yyyy', 'ro.telephony.ril.v3': 'datacall', 'ro.carrier': 'unknown', 'ro.cwm.enable_key_repeat': 'true', 'ro.build.version.incremental': 'eng.crossgate.20130801.085015', 'ro.product.board': 's5pc110', 'ro.config.vc_call_vol_steps': '15', 'rild.libargs': '-d /dev/ttyS0', 'ro.com.google.clientidbase': 'android-google', 'net.cdma.pppd.authtype': 'require-pap', 'ro.ril.samsung_cdma': 'true', 'ro.build.tags': 'test-keys', 'dalvik.vm.heapminfree': '512k', 'ro.sf.lcd_density': '240', 'dalvik.vm.checkjni': 'false', 'ro.build.version.sdk': '18', 'net.interfaces.defaultroute': 'cdma', 'ro.modversion': '10.2-20130801-UNOFFICIAL-epicmtd', 'ro.build.date': 'Thu Aug 1 08:51:35 CST 2013', 'dalvik.vm.lockprof.threshold': '500', 'ro.ril.hsxpa': '1', 'dalvik.vm.heapmaxfree': '2m', 'ro.kernel.android.checkjni': '0', 'ro.board.platform': 's5pc110', 'ro.cwm.repeatable_keys': '39,48,49,50,51,52', 'net.connectivity.type': 'CDMA1', 'ro.build.fingerprint': 'sprint/SPH-D700/SPH-D700:2.3.5/GINGERBREAD/EI22:user/release-keys', 'ro.build.date.utc': '1375318295', 'ro.product.cpu.abi2': 'armeabi', 'ro.product.manufacturer': 'samsung', 'ro.config.notification_sound': 'Argon.ogg', 'ro.build.user': 'crossgate', 'ro.product.locale.language': 'en', 'mobiledata.interfaces': 'ppp0,uwbr0', 'dalvik.vm.heapstartsize': '5m', 'dalvik.vm.dexopt-flags': 'm=y', 'ro.product.device': 'SPH-D700', 'ro.adb.qemud': '1', 'ro.build.description': 'SPH-D700-user 2.3.5 GINGERBREAD EI22 release-keys', 'ro.wimax.interface': 'uwbr0', 'dalvik.vm.heapgrowthlimit': '48m', 'ro.product.locale.region': 'US', 'ro.product.cpu.abi': 'armeabi-v7a', 'ro.cm.device': 'epicmtd', 'dalvik.vm.stack-trace-file': '/data/anr/traces.txt', 'ro.product.brand': 'samsung', 'net.tcp.buffersize.wimax': '4092,87380,1520768,4092,16384,1520768', 'wifi.interface': 'wlan0', 'ro.com.google.networklocation': '1', 'ro.build.version.release': '4.3', 'ro.cm.version': '10.2-20130801-UNOFFICIAL-epicmtd', 'ro.build.version.codename': 'REL', 'ro.com.android.wifi-watchlist': 'GoogleGuest', 'ro.config.ringtone': 'Orion.ogg', 'net.bt.name': 'Android', 'ro.url.legal.android_privacy': 'http://www.google.com/intl/%s/mobile/android/basic/privacy.html', 'ro.build.type': 'userdebug', 'ro.product.model': 'SPH-D700', 'ro.config.alarm_alert': 'Hassium.ogg', 'ro.com.google.locationfeatures': '1', 'keyguard.no_require_sim': 'true', 'ro.cdma.home.operator.alpha': 'Sprint', 'ro.opengles.version': '131072', 'dalvik.vm.dexopt-data-only': '1', 'ro.cdma.home.operator.numeric': '310120', 'rild.libpath': '/system/lib/libsec-ril40.so', 'ro.telephony.default_network': '4'}
default_system_dev_certificate = (str) build/target/product/security/testkey
extfs_sparse_flag = (str) -s
extra_recovery_keys = (str) build/target/product/security/cm
fstab = (dict) {'/sdcard': <common.Partition object at 0x202d710>, '/cache': <common.Partition object at 0x202d790>, '/data': <common.Partition object at 0x202d7d0>, '/system': <common.Partition object at 0x202d750>, '/recovery': <common.Partition object at 0x202d850>, '/boot': <common.Partition object at 0x202d810>}
fstab_version = (int) 1
mkbootimg_args = (str)
mkyaffs2_extra_flags = (str) -c 4096 -s 128
recovery_api_version = (int) 2
selinux_fc = (str) /tmp/targetfiles-JGSSmJ/BOOT/RAMDISK/file_contexts
tool_extensions = (str) device/samsung/epicmtd/../common
using device-specific extensions in device/samsung/common
unable to load device-specific module; assuming none
Traceback (most recent call last):
File "./device/samsung/epicmtd/releasetools/epicmtd_ota_from_target_files", line 135, in <module>
main(sys.argv[1:])
File "/home/crossgate/android/system/build/tools/releasetools/ota_from_target_files", line 842, in main
WriteFullOTAPackage(input_zip, output_zip)
File "./device/samsung/epicmtd/releasetools/epicmtd_ota_from_target_files", line 91, in WriteFullOTAPackage
writePolicyConfig(OPTIONS.info_dict["selinux_fc"], output_zip)
NameError: global name 'writePolicyConfig' is not defined
make: *** [/home/crossgate/android/system/out/target/product/epicmtd/cm_epicmtd-ota-eng.crossgate.zip] Error 1

Is that the said SELinux problem that messed up my build?

I ignored this and go to the output folder and grabbed system.img, boot.img, the whole /system folder and whatever necessary and

1) Since there's no fastboot for Epic, I TURNED ON THE PHONE (this could be where the problem lies), used adb shell then "flash_image system /(path)/system.img and similar commands for boot and recovery partitions, then rebooted. The phone gets stuck in CWM recovery, saying "root permission is broken" or sth. "adb devices" tell me that this devices has no permissions. I ended up in Odin.

2) I took the liberty to download the latest CM10.1 nightly and replaced /system, boot.img, the scripts and recovery with what I built, but when flashing, the recovery fails, saying: "set_perm: some changes failed". Guess file structure has been different.
[MENTION=4000778]bbelos[/MENTION], have't you met any build problems? How come you successfully flashed it?