[HTC One SV] old.splatterhand:
[HTC One SV][Kernel] Jelly Bean 4.1.2: System write protection removed (k2u & k2ul)

I make a thread here for a kernel for the HTC One SV with Jelly Bean 4.1.2 (for k2u & k2ul).

It is not made by me, i only start the thread for discussion here!

Credits:

- to rollon76 for providing it on xda

- to BrateloSlava for changelog

- to jmztaylor and Facepalm crew for getting S-Off and for his tips

- bkcokota (for his cwm recovery, a start for development)

- MikG for TWRP 2.5 recovery

- the community where it did a lot of research

Features:

- System write protection removed

- USB OTG (you need external charger)

- Fast charging

- many more

Changelog:

-------------------
ADD:
-------------------
zramdisk + snappy compression for swap
Force AC charge mode at will
dynamic file sync control
Cpupower driver
CPR (core power reduction) in S/W mode
framework for synchronization between multiple drivers
pwrctrl - krait droop detectors are always off
Adaptive Voltage Scaling (AVS) + software controlled AVS

---As can be seen, there are several approaches to power management. Which / what alone or in combination - undecided. Time left: it's time to return the device..
-------------------
Tweaks and patches:
-------------------
MMC secure disabled
msm: pil-riva: allow forcing of insecure mode
optimize slack
optimize slub
teak to smpc
switch do_fsync() to fget_light()
USB: otg: undo HTC's USB_OTG_HOST ifdef
arm: Allow CPU-supported unaligned accesses
ARM: net: JIT compiler for packet filters enabled by default
LIB: ARM: use generic strnlen_user and strncpy_from_user
sched.fair improve the group logic
Use AC charging for unknown chargers.
patch from caf to cpufreq
add dynamic fsync from Chad Goodman
reclaim some ram from logger
sched: Fix load avg vs cpu-hotplug
sched: Change rq->nr_running to unsigned int
sched/nohz: Fix rq->cpu_load calculations
Autogroup patch group by current user android UID
sched: Improve scalability via 'CPU buddies'
lib/memcopy: use glibc version
lib/string: use glibc version
SCHEDULER: Autogroup patch group by current user android UID instead
cpupower: update the cpu_power according to cpu load
ARM: 7011/1: Add ARM cpu topology definition
Optimized ARM RWSEM algorithm
scheduler: compute time-average nr_running per run-queue
proc: enhance time-average nr_running stats
scheduler: Re-compute time-average nr_running on read
sched: fix rq->lock recursion
fix possible memory leak
sched: Improve scalability via 'CPU buddies', which withstand random
msm: mdp: Disable vsync in video off
msm: mdp: Set clock rates on external interface as needed
msm: mdp: Send fake vsync only when enabled from userspace
ARM: 7663/1: perf: fix ARMv7 EVTYPE_MASK to include NSH bit
ARM: VFP: fix emulation of second VFP instruction
ARM: fix scheduling while atomic warning in alignment handling code
Don't force RUN_QUEUE_STATS to be on
Disable CONFIG_MSM_SHOW_RESUME_IRQ
lib/lzo: Update LZO compression to current upstream version
cpufreq: Convert the cpufreq_driver_lock to a rwlock
cpufreq: Convert the cpufreq_driver_lock to use RCU
rwsem: steal writing sem for better performance
PM: Introduce suspend state PM_SUSPEND_FREEZE
wakelock: instead of directly going to suspend_mem, use the new suspend
posix-cpu-timers: Fix nanosleep task_struct leak
tty: Prevent deadlock in n_gsm driver
Driver core: treat unregistered bus_types as having no devices
mm: mmu_notifier: have mmu_notifiers use a global SRCU
mm: mmu_notifier: make the mmu_notifier srcu static
mmu_notifier_unregister NULL Pointer deref and multiple ->release()
futex: Revert "futex: Mark get_robust_list as deprecated"
inotify: remove broken mask checks causing unmount to be EINVAL
fs/block_dev.c: page cache wrongly left invalidated after revalidate
drivers/video/backlight/adp88?0_bl.c: fix resume
mm/fadvise.c: drain all pagevecs if POSIX_FADV_DONTNEED fails to disc
drivercore: Fix ordering between deferred_probe and exiting initcalls
umount oops when remove blocklayoutdriver first
NLM: Ensure that we resend all pending blocking locks after a reclaim
sunvdc: Fix off-by-one in generic_request().
vgacon/vt: clear buffer attributes when we load a 512 character font
ondemand: add default values for new ondemand parameters
target: Fix divide by zero bug in fabric_max_sectors for unconfigured
ASoC: wm2200: correct IN2L and IN3L digital mute
ARM: 7643/1: sched: correct update_sched_clock()
drivers/video: fsl-diu-fb: fix pixel formats for 24 and 16 bpp
fbcon: don't lose the console font across generic->chip driver switch
fb: rework locking to fix lock ordering on takeover
fb: Yet another band-aid for fixing lockdep mess
mmc: sdhci-esdhc-imx: fix host version read
bridge: set priority of STP packets
net: fix infinite loop in __skb_recv_datagram()
ipv4: fix a bug in ping_err()
ipv6: use a stronger hash for tcp
sock_diag: Fix out-of-bounds access to sock_diag_handlers
vlan: adjust vlan_set_encap_proto() for its callers
ftrace: Call ftrace cleanup module notifier after all other notifiers
block: fix ext_devt_idr handling
block: fix synchronization and limit check in blk_alloc_devt()
sysctl: fix null checking in bin_dn_node_address()
fs: Fix possible use-after-free with AIO
ext4: check bh in ext4_read_block_bitmap()
ext4: fix race in ext4_mb_add_n_trim()
ext4: fix xattr block allocation/release with bigalloc
ext4: fix free clusters calculation in bigalloc filesystem
nfsd: Fix memleak
vhost: fix length for cross region descriptor
svcrpc: make svc_age_temp_xprts enqueue under sv_lock
cpuset: fix cpuset_print_task_mems_allowed() vs rename() race
cgroup: fix exit() vs rmdir() race
sched: remove HTC attempt to patch exit/rename race condition
kernel/workqueue.c: avoid array subscript above array boundaries
net/sunrpc: fix 'subbuf.[...]' may be used uninitialized in this func
slimbus: Fix channel concurrent usage during reconfiguration sequence
slimbus: Decrement channel reference during reconfigure now
msm: kgsl: Always reset global ts_cmp_enable on GPU interrupts
msm: kgsl: Remove extra interrupts when setting MMU state
iommu/msm: fix the include guard in iommu.h
msm: kgsl: Make the GPU device aware of the next pending event
hw_random: make buffer usable in scatterlist
virtio: rng: disallow multiple device registrations, fixes crashes
PM / Sleep: Look for wakeup events in later stages of device suspend
PM / Sleep: Use wait queue to signal "no wakeup events in progress"
PM / Sleep: Change wakeup source statistics to follow Android
power: Remove legacy wakelock code
fs: proc: stat: fix /proc/stat not showing all cpus
gpu: ion: Align va address to biggest buffer size
ARM: DMA: Fix struct page iterator in dma_cache_maint() to work with sparsemem
writeback: fix writeback cache thrashing
Asoc: msm: Add G711 media type support for Voip
msm: socinfo: Add support for detecting Krait and Krait Pass

Notice:

I tested this myself on a european non-lte phone and it works. But as always bricks can happen and i am not responsible if your phone is dead afterwards.

Don't do this, if you are not experienced enough! Flash it on your own risk!

Download:

k2_ul (with LTE): htc_k2_ul_jb_s​ense_kernel.zi​p

k2_u (without LTE): htc_k2u_only_jb_kernel.zip

Sourcecode:

Github

How to install:

Download the zip file that fits to your device.

If you are S-Off, flash over recovery.

If you are Htcdev.com unlocked, extract (only!) boot.img and copy it to your fastboot folder.

Copy the zip to the external sd card and flash it over recovery.

Flash the boot.img over fastboot with the following command:

fastboot flash boot boot.img

For both: wipe Cache and Dalvik Cache afterwards.

Have fun. :cool: