Hello,
If anyone is interested in editing rootfs here's how:
To enable root account I used 10-usb method
- passwd and set new one
- copy /etc/shadow to usb or your PC
Read rootfs:
- nvrammanager --read=/tmp/yourfilenamehere --partition=file-system
- copy to your Linux distro
Editing rootfs:
- unsquash it, replace shadow
- mksquashfs squashfs-root/ yournewrootfs -noappend -all-root
(for making rootfs I used mksquashfs from GPL source code, you can get it here)
I had an issue replacing stock binaries (busybox/proftpd...) with newer ones as this drove system unbootable so to obtain busybox with more features I simply copied it under /root directory with permissions 4755, after that I log in to root with /root/busybox login
If the result is bigger than 13 107 200 bytes, it won't fit into flash, I gained space by removing unwanted languages under /www/webpages/locale and linking them to en_US
To copy new file-system back, use scp (write under /tmp)
Rewriting file-system:
- nvrammanager --write=/tmp/yournewfilesystem --partition=file-system
- reboot
If everything went well, you should have working busybox and passworded root.
If not, reflash firmware via recovery.
I also removed startup of few modules from init.d/ and modules.d/ (you can experiment with that if you feel for it)
About overlay:
I was going through uci config and noticed fstab mentioning it
root@Akronite:~# uci show fstab
fstab.automount=global
fstab.automount.from_fstab=1
fstab.automount.anon_mount=1
fstab.autoswap=global
fstab.autoswap.anon_swap=0
fstab.autoswap.from_fstab=1
fstab.@mount[0]=mount
fstab.@mount[0].enabled_fsck=0
fstab.@mount[0].options=rw,sync
fstab.@mount[0].device=/dev/sda1
fstab.@mount[0].fstype=ext4
fstab.@mount[0].target=/overlay
fstab.@mount[0].enabled=0
fstab.@swap[0]=swap
fstab.@swap[0].device=/dev/sda2
fstab.@swap[0].enabled=0
I haven't tested it out, but it looks like formatting usb drive with ext4 fs and setting enabled to 1 might do the trick (although it's not the jffs2 overlay)
I tried to port my old patches to new kernel, but I quickly found out that my serial is no longer working (I can send commands, but I can't see anything) so I can't debug and progress. I built both squashfs and initramfs (both in drive), but only the latter might boot. None of them has working ethernet link out of the box. You can send me dmesg log if there is an issue, I can't really tell. I recommend doing full flash backup before proceeding. (I managed to overwrite tp-link partition once and had to write my backup directly to the unsoldered flash...)