[SuperR Kitchen] Pyr0ball:
Apologies for wall of text, but I've got a tricky one here. I'm trying to pull and develop a rom for a device that basically has only had development to the point where CWM and TWRP were ported to it, and you can root the stock firmware. Sin'ce I'm relatively new to building ROM's I'm just trying to pull a working image from my device, debloat, and re-flash and see if it works. So far I've not had much success, but I've overcome a couple of the issues.

First off, info:

What Kitchen version?

1.1.1.2

What Linux are you running (OS and architecture (32/64-bit))?

Ubuntu 16.04 x64

What device are you working on (make/model)?

Alcatel OneTouch Pixi 7 9006w

What was the source you started from (system.img, system.ext4.tar, rom.zip, etc.)

1st try: extracted from stock https://www.androidfilehost.com/?w=files&flid=38647

2nd try: Pulled from rooted android

3rd try: Pulled from TWRP recovery adb

What Android version?

5.0.2

Build # B2Z-UM0

What perm method (set_perm, set_metadata, sparse_dat, raw_img)?

set_metadata

What did you do after extracting and before building?

default debloat

add root

add busybox

add su.d

Were there errors on the screen if you scroll up in the terminal?

Yes, will get into this in a moment

Can you send a link that does not require registration to the files you started with (nandroid, system.img, boot.img, etc)?

Edit: Just got ADF developer approval so everything I have is being uploaded there

Issues:

First issue I came across was that the installer script's mount locations were off. There's a disparity between the /dev/block locations under Android and TWRP. This is the list of partitions while booted to android (not including the symlinks under /dev/block/platform:

root@Pixi2-7_4G_TMO:/ # ls -l /dev/block/bootdevice/by-name/
lrwxrwxrwx root root 1971-01-16 17:54 DDR -> /dev/block/mmcblk0p18
lrwxrwxrwx root root 1971-01-16 17:54 aboot -> /dev/block/mmcblk0p21
lrwxrwxrwx root root 1971-01-16 17:54 abootbak -> /dev/block/mmcblk0p22
lrwxrwxrwx root root 1971-01-16 17:54 boot -> /dev/block/mmcblk0p23
lrwxrwxrwx root root 1971-01-16 17:54 cache -> /dev/block/mmcblk0p31
lrwxrwxrwx root root 1971-01-16 17:54 config -> /dev/block/mmcblk0p34
lrwxrwxrwx root root 1971-01-16 17:54 efsdata -> /dev/block/mmcblk0p17
lrwxrwxrwx root root 1971-01-16 17:54 fota -> /dev/block/mmcblk0p30
lrwxrwxrwx root root 1971-01-16 17:54 fsc -> /dev/block/mmcblk0p4
lrwxrwxrwx root root 1971-01-16 17:54 fsg -> /dev/block/mmcblk0p19
lrwxrwxrwx root root 1971-01-16 17:54 hdcp -> /dev/block/mmcblk0p29
lrwxrwxrwx root root 1971-01-16 17:54 hyp -> /dev/block/mmcblk0p12
lrwxrwxrwx root root 1971-01-16 17:54 hypbak -> /dev/block/mmcblk0p13
lrwxrwxrwx root root 1971-01-16 17:54 keystore -> /dev/block/mmcblk0p33
lrwxrwxrwx root root 1971-01-16 17:54 misc -> /dev/block/mmcblk0p32
lrwxrwxrwx root root 1971-01-16 17:54 modem -> /dev/block/mmcblk0p1
lrwxrwxrwx root root 1971-01-16 17:54 modemst1 -> /dev/block/mmcblk0p14
lrwxrwxrwx root root 1971-01-16 17:54 modemst2 -> /dev/block/mmcblk0p15
lrwxrwxrwx root root 1971-01-16 17:54 oem -> /dev/block/mmcblk0p35
lrwxrwxrwx root root 1971-01-16 17:54 persist -> /dev/block/mmcblk0p26
lrwxrwxrwx root root 1971-01-16 17:54 recovery -> /dev/block/mmcblk0p24
lrwxrwxrwx root root 1971-01-16 17:54 rpm -> /dev/block/mmcblk0p8
lrwxrwxrwx root root 1971-01-16 17:54 rpmbak -> /dev/block/mmcblk0p9
lrwxrwxrwx root root 1971-01-16 17:54 sbl1 -> /dev/block/mmcblk0p6
lrwxrwxrwx root root 1971-01-16 17:54 sbl1bak -> /dev/block/mmcblk0p7
lrwxrwxrwx root root 1971-01-16 17:54 sec -> /dev/block/mmcblk0p20
lrwxrwxrwx root root 1971-01-16 17:54 simlock -> /dev/block/mmcblk0p16
lrwxrwxrwx root root 1971-01-16 17:54 splash -> /dev/block/mmcblk0p27
lrwxrwxrwx root root 1971-01-16 17:54 ssd -> /dev/block/mmcblk0p5
lrwxrwxrwx root root 1971-01-16 17:54 system -> /dev/block/mmcblk0p25
lrwxrwxrwx root root 1971-01-16 17:54 tctpersist -> /dev/block/mmcblk0p28
lrwxrwxrwx root root 1971-01-16 17:54 traceability -> /dev/block/mmcblk0p3
lrwxrwxrwx root root 1971-01-16 17:54 tunning -> /dev/block/mmcblk0p2
lrwxrwxrwx root root 1971-01-16 17:54 tz -> /dev/block/mmcblk0p10
lrwxrwxrwx root root 1971-01-16 17:54 tzbak -> /dev/block/mmcblk0p11
lrwxrwxrwx root root 1971-01-16 17:54 userdata -> /dev/block/mmcblk0p36

root@Pixi2-7_4G_TMO:/ # ls -l /dev/block/platform/
drwxr-xr-x root root 1971-01-16 17:54 7824900.sdhci
drwxr-xr-x root root 1971-01-16 17:54 7864900.sdhci

root@Pixi2-7_4G_TMO:/ # ls -l /dev/block/platform/7824900.sdhci/by-name/
lrwxrwxrwx root root 1971-01-16 17:54 DDR -> /dev/block/mmcblk0p18
lrwxrwxrwx root root 1971-01-16 17:54 aboot -> /dev/block/mmcblk0p21
lrwxrwxrwx root root 1971-01-16 17:54 abootbak -> /dev/block/mmcblk0p22
lrwxrwxrwx root root 1971-01-16 17:54 boot -> /dev/block/mmcblk0p23
lrwxrwxrwx root root 1971-01-16 17:54 cache -> /dev/block/mmcblk0p31
lrwxrwxrwx root root 1971-01-16 17:54 config -> /dev/block/mmcblk0p34
lrwxrwxrwx root root 1971-01-16 17:54 efsdata -> /dev/block/mmcblk0p17
lrwxrwxrwx root root 1971-01-16 17:54 fota -> /dev/block/mmcblk0p30
lrwxrwxrwx root root 1971-01-16 17:54 fsc -> /dev/block/mmcblk0p4
lrwxrwxrwx root root 1971-01-16 17:54 fsg -> /dev/block/mmcblk0p19
lrwxrwxrwx root root 1971-01-16 17:54 hdcp -> /dev/block/mmcblk0p29
lrwxrwxrwx root root 1971-01-16 17:54 hyp -> /dev/block/mmcblk0p12
lrwxrwxrwx root root 1971-01-16 17:54 hypbak -> /dev/block/mmcblk0p13
lrwxrwxrwx root root 1971-01-16 17:54 keystore -> /dev/block/mmcblk0p33
lrwxrwxrwx root root 1971-01-16 17:54 misc -> /dev/block/mmcblk0p32
lrwxrwxrwx root root 1971-01-16 17:54 modem -> /dev/block/mmcblk0p1
lrwxrwxrwx root root 1971-01-16 17:54 modemst1 -> /dev/block/mmcblk0p14
lrwxrwxrwx root root 1971-01-16 17:54 modemst2 -> /dev/block/mmcblk0p15
lrwxrwxrwx root root 1971-01-16 17:54 oem -> /dev/block/mmcblk0p35
lrwxrwxrwx root root 1971-01-16 17:54 persist -> /dev/block/mmcblk0p26
lrwxrwxrwx root root 1971-01-16 17:54 recovery -> /dev/block/mmcblk0p24
lrwxrwxrwx root root 1971-01-16 17:54 rpm -> /dev/block/mmcblk0p8
lrwxrwxrwx root root 1971-01-16 17:54 rpmbak -> /dev/block/mmcblk0p9
lrwxrwxrwx root root 1971-01-16 17:54 sbl1 -> /dev/block/mmcblk0p6
lrwxrwxrwx root root 1971-01-16 17:54 sbl1bak -> /dev/block/mmcblk0p7
lrwxrwxrwx root root 1971-01-16 17:54 sec -> /dev/block/mmcblk0p20
lrwxrwxrwx root root 1971-01-16 17:54 simlock -> /dev/block/mmcblk0p16
lrwxrwxrwx root root 1971-01-16 17:54 splash -> /dev/block/mmcblk0p27
lrwxrwxrwx root root 1971-01-16 17:54 ssd -> /dev/block/mmcblk0p5
lrwxrwxrwx root root 1971-01-16 17:54 system -> /dev/block/mmcblk0p25
lrwxrwxrwx root root 1971-01-16 17:54 tctpersist -> /dev/block/mmcblk0p28
lrwxrwxrwx root root 1971-01-16 17:54 traceability -> /dev/block/mmcblk0p3
lrwxrwxrwx root root 1971-01-16 17:54 tunning -> /dev/block/mmcblk0p2
lrwxrwxrwx root root 1971-01-16 17:54 tz -> /dev/block/mmcblk0p10
lrwxrwxrwx root root 1971-01-16 17:54 tzbak -> /dev/block/mmcblk0p11
lrwxrwxrwx root root 1971-01-16 17:54 userdata -> /dev/block/mmcblk0p36

root@Pixi2-7_4G_TMO:/ # ls -l /dev/block/platform/7864900.sdhci/
drwxr-xr-x root root 1971-01-16 17:54 by-num
lrwxrwxrwx root root 1971-01-16 17:54 mmcblk1 -> /dev/block/mmcblk1
lrwxrwxrwx root root 1971-01-16 17:54 mmcblk1p1 -> /dev/block/mmcblk1p1

However /dev/block/bootdevice does not exist under TWRP, and the platform folder structure is different:

~ # ls -l /dev/block/
__bionic_open_tzdata: couldn't find any tzdata when looking for localtime!
__bionic_open_tzdata: couldn't find any tzdata when looking for GMT!
__bionic_open_tzdata: couldn't find any tzdata when looking for posixrules!
brw------- root root 7, 0 1971-01-17 02:55 loop0
brw------- root root 7, 1 1971-01-17 02:55 loop1
brw------- root root 7, 2 1971-01-17 02:55 loop2
brw------- root root 7, 3 1971-01-17 02:55 loop3
brw------- root root 7, 4 1971-01-17 02:55 loop4
brw------- root root 7, 5 1971-01-17 02:55 loop5
brw------- root root 7, 6 1971-01-17 02:55 loop6
brw------- root root 7, 7 1971-01-17 02:55 loop7
brw------- root root 179, 0 1971-01-17 02:55 mmcblk0
brw------- root root 179, 1 1971-01-17 02:55 mmcblk0p1
brw------- root root 179, 10 1971-01-17 02:55 mmcblk0p10
brw------- root root 179, 11 1971-01-17 02:55 mmcblk0p11
brw------- root root 179, 12 1971-01-17 02:55 mmcblk0p12
brw------- root root 179, 13 1971-01-17 02:55 mmcblk0p13
brw------- root root 179, 14 1971-01-17 02:55 mmcblk0p14
brw------- root root 179, 15 1971-01-17 02:55 mmcblk0p15
brw------- root root 179, 16 1971-01-17 02:55 mmcblk0p16
brw------- root root 179, 17 1971-01-17 02:55 mmcblk0p17
brw------- root root 179, 18 1971-01-17 02:55 mmcblk0p18
brw------- root root 179, 19 1971-01-17 02:55 mmcblk0p19
brw------- root root 179, 2 1971-01-17 02:55 mmcblk0p2
brw------- root root 179, 20 1971-01-17 02:55 mmcblk0p20
brw------- root root 179, 21 1971-01-17 02:55 mmcblk0p21
brw------- root root 179, 22 1971-01-17 02:55 mmcblk0p22
brw------- root root 179, 23 1971-01-17 02:55 mmcblk0p23
brw------- root root 179, 24 1971-01-17 02:55 mmcblk0p24
brw------- root root 179, 25 1971-01-17 02:55 mmcblk0p25
brw------- root root 179, 26 1971-01-17 02:55 mmcblk0p26
brw------- root root 179, 27 1971-01-17 02:55 mmcblk0p27
brw------- root root 179, 28 1971-01-17 02:55 mmcblk0p28
brw------- root root 179, 29 1971-01-17 02:55 mmcblk0p29
brw------- root root 179, 3 1971-01-17 02:55 mmcblk0p3
brw------- root root 179, 30 1971-01-17 02:55 mmcblk0p30
brw------- root root 179, 31 1971-01-17 02:55 mmcblk0p31
brw------- root root 259, 0 1971-01-17 02:55 mmcblk0p32
brw------- root root 259, 1 1971-01-17 02:55 mmcblk0p33
brw------- root root 259, 2 1971-01-17 02:55 mmcblk0p34
brw------- root root 259, 3 1971-01-17 02:55 mmcblk0p35
brw------- root root 259, 4 1971-01-17 02:55 mmcblk0p36
brw------- root root 179, 4 1971-01-17 02:55 mmcblk0p4
brw------- root root 179, 5 1971-01-17 02:55 mmcblk0p5
brw------- root root 179, 6 1971-01-17 02:55 mmcblk0p6
brw------- root root 179, 7 1971-01-17 02:55 mmcblk0p7
brw------- root root 179, 8 1971-01-17 02:55 mmcblk0p8
brw------- root root 179, 9 1971-01-17 02:55 mmcblk0p9
brw------- root root 179, 32 1971-01-17 02:55 mmcblk0rpmb
brw------- root root 179, 64 1971-01-17 02:55 mmcblk1
brw------- root root 179, 65 1971-01-17 02:55 mmcblk1p1
drwxr-xr-x root root 1971-01-17 02:55 platform
brw------- root root 1, 0 1971-01-17 02:55 ram0
brw------- root root 1, 1 1971-01-17 02:55 ram1
brw------- root root 1, 10 1971-01-17 02:55 ram10
brw------- root root 1, 11 1971-01-17 02:55 ram11
brw------- root root 1, 12 1971-01-17 02:55 ram12
brw------- root root 1, 13 1971-01-17 02:55 ram13
brw------- root root 1, 14 1971-01-17 02:55 ram14
brw------- root root 1, 15 1971-01-17 02:55 ram15
brw------- root root 1, 2 1971-01-17 02:55 ram2
brw------- root root 1, 3 1971-01-17 02:55 ram3
brw------- root root 1, 4 1971-01-17 02:55 ram4
brw------- root root 1, 5 1971-01-17 02:55 ram5
brw------- root root 1, 6 1971-01-17 02:55 ram6
brw------- root root 1, 7 1971-01-17 02:55 ram7
brw------- root root 1, 8 1971-01-17 02:55 ram8
brw------- root root 1, 9 1971-01-17 02:55 ram9
brw------- root root 253, 0 1971-01-17 02:55 zram0

~ # ls -l /dev/block/platform/soc.0/by-name/

__bionic_open_tzdata: couldn't find any tzdata when looking for localtime!

__bionic_open_tzdata: couldn't find any tzdata when looking for GMT!

__bionic_open_tzdata: couldn't find any tzdata when looking for posixrules!

lrwxrwxrwx root root 1971-01-17 02:55 DDR -> /dev/block/mmcblk0p18

lrwxrwxrwx root root 1971-01-17 02:55 aboot -> /dev/block/mmcblk0p21

lrwxrwxrwx root root 1971-01-17 02:55 abootbak -> /dev/block/mmcblk0p22

lrwxrwxrwx root root 1971-01-17 02:55 boot -> /dev/block/mmcblk0p23

lrwxrwxrwx root root 1971-01-17 02:55 cache -> /dev/block/mmcblk0p31

lrwxrwxrwx root root 1971-01-17 02:55 config -> /dev/block/mmcblk0p34

lrwxrwxrwx root root 1971-01-17 02:55 efsdata -> /dev/block/mmcblk0p17

lrwxrwxrwx root root 1971-01-17 02:55 fota -> /dev/block/mmcblk0p30

lrwxrwxrwx root root 1971-01-17 02:55 fsc -> /dev/block/mmcblk0p4

lrwxrwxrwx root root 1971-01-17 02:55 fsg -> /dev/block/mmcblk0p19

lrwxrwxrwx root root 1971-01-17 02:55 hdcp -> /dev/block/mmcblk0p29

lrwxrwxrwx root root 1971-01-17 02:55 hyp -> /dev/block/mmcblk0p12

lrwxrwxrwx root root 1971-01-17 02:55 hypbak -> /dev/block/mmcblk0p13

lrwxrwxrwx root root 1971-01-17 02:55 keystore -> /dev/block/mmcblk0p33

lrwxrwxrwx root root 1971-01-17 02:55 misc -> /dev/block/mmcblk0p32

lrwxrwxrwx root root 1971-01-17 02:55 modem -> /dev/block/mmcblk0p1

lrwxrwxrwx root root 1971-01-17 02:55 modemst1 -> /dev/block/mmcblk0p14

lrwxrwxrwx root root 1971-01-17 02:55 modemst2 -> /dev/block/mmcblk0p15

lrwxrwxrwx root root 1971-01-17 02:55 oem -> /dev/block/mmcblk0p35

lrwxrwxrwx root root 1971-01-17 02:55 persist -> /dev/block/mmcblk0p26

lrwxrwxrwx root root 1971-01-17 02:55 recovery -> /dev/block/mmcblk0p24

lrwxrwxrwx root root 1971-01-17 02:55 rpm -> /dev/block/mmcblk0p8

lrwxrwxrwx root root 1971-01-17 02:55 rpmbak -> /dev/block/mmcblk0p9

lrwxrwxrwx root root 1971-01-17 02:55 sbl1 -> /dev/block/mmcblk0p6

lrwxrwxrwx root root 1971-01-17 02:55 sbl1bak -> /dev/block/mmcblk0p7

lrwxrwxrwx root root 1971-01-17 02:55 sec -> /dev/block/mmcblk0p20

lrwxrwxrwx root root 1971-01-17 02:55 simlock -> /dev/block/mmcblk0p16

lrwxrwxrwx root root 1971-01-17 02:55 splash -> /dev/block/mmcblk0p27

lrwxrwxrwx root root 1971-01-17 02:55 ssd -> /dev/block/mmcblk0p5

lrwxrwxrwx root root 1971-01-17 02:55 system -> /dev/block/mmcblk0p25

lrwxrwxrwx root root 1971-01-17 02:55 tctpersist -> /dev/block/mmcblk0p28

lrwxrwxrwx root root 1971-01-17 02:55 traceability -> /dev/block/mmcblk0p3

lrwxrwxrwx root root 1971-01-17 02:55 tunning -> /dev/block/mmcblk0p2

lrwxrwxrwx root root 1971-01-17 02:55 tz -> /dev/block/mmcblk0p10

lrwxrwxrwx root root 1971-01-17 02:55 tzbak -> /dev/block/mmcblk0p11

lrwxrwxrwx root root 1971-01-17 02:55 userdata -> /dev/block/mmcblk0p36

This led me to try extracting the image from TWRP instead of rooted android, but it keeps failing, and I haven't yet figured out why. As a workaround, I edited the install script with the partitions instead of relying on the symlinks:

*Edit: to clarify, what's hanging is the part of the script attempting to determine partition sizes through ADB when running on TWRP

mount("ext4", "EMMC", "/dev/block/mmcblk0p25", "/system", "");
run_program("/tmp/install/bin/backuptool.sh", "backup");
unmount("/system");
show_progress(0.750000, 0);
ui_print("Extracting system...");
ui_print(" ");
block_image_update("/dev/block/mmclk0p25", package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat");
show_progress(0.020000, 10);
mount("ext4", "EMMC", "/dev/block/mmcblk0p25", "/system", "");

I'm now seeing what appears to be a successful extraction of the system.img to the right partition, however I still see (near the end of the script:

"unmount of /system failed; no such volume"

Everything else appears to run fine, but I'm stuck at the bootloader logo on reboot. Restoring a backup brings the system back up just fine, but no logcat file seems to be present when still under TWRP, and the system will not boot to the point I can get adb access after:

xenial@Android-Kitchen:/kitchen/android$ adb shell
~ # logcat
/sbin/sh: logcat: Permission denied
~ # exit
xenial@Android-Kitchen:/kitchen/android$ sudo adb logcat
[sudo] password for xenial:
logcat read failure: No such file or directory
xenial@Android-Kitchen:/kitchen/android$ sudo adb logcat
/sbin/sh: exec: line 1: logcat: not found
xenial@Android-Kitchen:/kitchen/android$ adb devices
List of devices attached

halp?