[Galaxy S III Mini Android Development] Android-Andi:
[MENTION=4021423]ketut.kumajaya[/MENTION] :D fixed it.

Fpund another typo. Will place my commit in some seconds and let you know.

From 7263570513117bea623561b249d5e6aec0d7a723 Mon Sep 17 00:00:00 2001
From: andi34 <skate4life@gmx.de>
Date: Fri, 19 Sep 2014 18:58:28 +0200
Subject: [PATCH] golden: blackhawk: Fix bootmenu.sh

We need to bind mount
"/.secondrom/media"
and
"/.secondrom/media/.secondrom/data /data" before replaceing
original mount and umount scripts for second recovery.
This will fix failing backup for 2nd Rom in recovery.

Change-Id: I37993f8af40733b8ce2786858e252afb3f0ae9aa
---
recovery/root/sbin/bootmenu.sh | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/recovery/root/sbin/bootmenu.sh b/recovery/root/sbin/bootmenu.sh
index 2b260fc..74608df 100755
--- a/recovery/root/sbin/bootmenu.sh
+++ b/recovery/root/sbin/bootmenu.sh
@@ -73,13 +73,8 @@ if [ "$DEFAULTROM" == "1" ]; then
format_to_ext4 $HIDDENDEV
fi

[COLOR="Red"]- # 2nd recovery spesific files[/COLOR]
[COLOR="DarkGreen"]+ # 2nd recovery spesific fstab[/COLOR]
mv -f /res/misc/recovery.fstab.2 /etc/recovery.fstab
[COLOR="Red"]- rm -f /sbin/mount /sbin/umount
- mv -f /res/misc/mount.2 /sbin/mount
- mv -f /res/misc/umount.2 /sbin/umount
- mv -f /res/misc/virtual_keys.2.png /res/images/virtual_keys.png
- chmod 755 /sbin/mount /sbin/umount[/COLOR]

# Associate /dev/block/loop0 with system.img
losetup /dev/block/loop0 /.secondrom/media/.secondrom/system.img
@@ -92,11 +87,18 @@ if [ "$DEFAULTROM" == "1" ]; then

# Bind mount /.secondrom/media/.secondrom/data to /data for transparent operation
# no real block device and always locked
[COLOR="DarkGreen"]+ mkdir -p /data/media[/COLOR]
mkdir -p /.secondrom/media/.secondrom/data
busybox mount --bind /.secondrom/media/.secondrom/data /data
[COLOR="Red"]- mkdir -p /data/media[/COLOR]
busybox mount --bind /.secondrom/media /data/media

[COLOR="DarkGreen"]+ # 2nd recovery spesific files
+ rm -f /sbin/mount /sbin/umount
+ mv -f /res/misc/mount.2 /sbin/mount
+ mv -f /res/misc/umount.2 /sbin/umount
+ mv -f /res/misc/virtual_keys.2.png /res/images/virtual_keys.png
+ chmod 755 /sbin/mount /sbin/umount
+[/COLOR]
# Create philz-touch_6.ini if not available and set menu_text_color to blue
if [ ! -f /data/philz-touch/philz-touch_6.ini ]; then
mkdir -p /data/philz-touch

Edit:

android-andi@buildbot:~/android/philztouch/device/samsung/golden$ adb shell mount
rootfs on / type rootfs (rw)
tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,mode=755)
devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,seclabel,relatime)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
[COLOR="Red"]/dev/block/mmcblk0p25 on /.secondrom type ext4 (rw,seclabel,noatime,nodiratime,user_xattr,acl,barrier=1,data=ordered,noauto_da_alloc)
/dev/block/mmcblk0p25 on /data type ext4 (rw,seclabel,noatime,nodiratime,user_xattr,acl,barrier=1,data=ordered,noauto_da_alloc)
/dev/block/mmcblk0p25 on /data/media type ext4 (rw,seclabel,noatime,nodiratime,user_xattr,acl,barrier=1,data=ordered,noauto_da_alloc)[/COLOR]
tmpfs on /tmp type tmpfs (rw,seclabel,relatime)
tmpfs on /storage type tmpfs (rw,seclabel,relatime,mode=050,gid=1028)
tmpfs on /mnt/secure type tmpfs (rw,seclabel,relatime,mode=700)
tmpfs on /mnt/fuse type tmpfs (rw,seclabel,relatime,mode=775,gid=1000)
/dev/block/mmcblk0p19 on /mnt/.lfs type j4fs (rw,relatime)
/dev/block/vold/179:97 on /storage/sdcard1 type vfat (rw,dirsync,nosuid,nodev,noexec,relatime,uid=1023,gid=1023,fmask=0007,dmask=0007,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
/dev/block/mmcblk0p24 on /cache type ext4 (rw,seclabel,noatime,nodiratime,user_xattr,acl,barrier=1,noauto_da_alloc)
android-andi@buildbot:~/android/philztouch/device/samsung/golden$ adb shell ls -l dev/block
__bionic_open_tzdata: couldn't find any tzdata when looking for Europe/Berlin!
__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------- 1 root root 7, 0 Sep 19 17:22 loop0
brw------- 1 root root 7, 1 Sep 19 17:22 loop1
brw------- 1 root root 7, 2 Sep 19 17:22 loop2
brw------- 1 root root 7, 3 Sep 19 17:22 loop3
brw------- 1 root root 7, 4 Sep 19 17:22 loop4
brw------- 1 root root 7, 5 Sep 19 17:22 loop5
brw------- 1 root root 7, 6 Sep 19 17:22 loop6
brw------- 1 root root 7, 7 Sep 19 17:22 loop7
brw------- 1 root root 179, 0 Sep 19 17:22 mmcblk0
brw------- 1 root root 179, 32 Sep 19 17:22 mmcblk0boot0
brw------- 1 root root 179, 64 Sep 19 17:22 mmcblk0boot1
brw------- 1 root root 179, 1 Sep 19 17:22 mmcblk0p1
brw------- 1 root root 179, 10 Sep 19 17:22 mmcblk0p10
brw------- 1 root root 179, 11 Sep 19 17:22 mmcblk0p11
brw------- 1 root root 179, 12 Sep 19 17:22 mmcblk0p12
brw------- 1 root root 179, 13 Sep 19 17:22 mmcblk0p13
brw------- 1 root root 179, 14 Sep 19 17:22 mmcblk0p14
brw------- 1 root root 179, 15 Sep 19 17:22 mmcblk0p15
brw------- 1 root root 179, 16 Sep 19 17:22 mmcblk0p16
brw------- 1 root root 179, 17 Sep 19 17:22 mmcblk0p17
brw------- 1 root root 179, 18 Sep 19 17:22 mmcblk0p18
brw-rw---- 1 system system 179, 19 Sep 19 17:22 mmcblk0p19
brw------- 1 root root 179, 2 Sep 19 17:22 mmcblk0p2
brw------- 1 root root 179, 20 Sep 19 17:22 mmcblk0p20
brw------- 1 root root 179, 21 Sep 19 17:22 mmcblk0p21
[COLOR="Red"]lrwxrwxrwx 1 root root 16 Sep 19 17:22 mmcblk0p22 -> /dev/block/loop0
lrwxrwxrwx 1 root root 21 Sep 19 17:22 mmcblk0p23 -> /dev/block/mmcblk0p24[/COLOR]
brw------- 1 root root 179, 24 Sep 19 17:22 mmcblk0p24
[COLOR="Red"]brw------- 1 root root 179, 25 Sep 19 17:22 mmcblk0p25[/COLOR]
brw------- 1 root root 179, 3 Sep 19 17:22 mmcblk0p3
brw------- 1 root root 179, 4 Sep 19 17:22 mmcblk0p4
brw------- 1 root root 179, 5 Sep 19 17:22 mmcblk0p5
brw------- 1 root root 179, 6 Sep 19 17:22 mmcblk0p6
brw------- 1 root root 179, 7 Sep 19 17:22 mmcblk0p7
brw------- 1 root root 179, 8 Sep 19 17:22 mmcblk0p8
brw------- 1 root root 179, 9 Sep 19 17:22 mmcblk0p9
brw------- 1 root root 179, 96 Sep 19 17:22 mmcblk1
brw------- 1 root root 179, 97 Sep 19 17:22 mmcblk1p1
brw------- 1 root root 1, 0 Sep 19 17:22 ram0
brw------- 1 root root 1, 1 Sep 19 17:22 ram1
brw------- 1 root root 1, 10 Sep 19 17:22 ram10
brw------- 1 root root 1, 11 Sep 19 17:22 ram11
brw------- 1 root root 1, 12 Sep 19 17:22 ram12
brw------- 1 root root 1, 13 Sep 19 17:22 ram13
brw------- 1 root root 1, 14 Sep 19 17:22 ram14
brw------- 1 root root 1, 15 Sep 19 17:22 ram15
brw------- 1 root root 1, 2 Sep 19 17:22 ram2
brw------- 1 root root 1, 3 Sep 19 17:22 ram3
brw------- 1 root root 1, 4 Sep 19 17:22 ram4
brw------- 1 root root 1, 5 Sep 19 17:22 ram5
brw------- 1 root root 1, 6 Sep 19 17:22 ram6
brw------- 1 root root 1, 7 Sep 19 17:22 ram7
brw------- 1 root root 1, 8 Sep 19 17:22 ram8
brw------- 1 root root 1, 9 Sep 19 17:22 ram9
drwx------ 2 root root 80 Sep 19 17:22 vold
android-andi@buildbot:~/android/philztouch/device/samsung/golden$

recovery filesystem table
=========================
0 /system ext4 /dev/block/loop0 0
1 /efs ext4 /dev/block/mmcblk0p11 0
2 /cache ext4 /dev/block/mmcblk0p24 0
[COLOR="Red"] 3 /data ext4 /dev/block/mmcblk0p25 0[/COLOR]
4 /storage/sdcard1 vfat /devices/sdi0/mmc_host/mmc1/mmc1 0
/storage/sdcard1 auto /devices/sdi0/mmc_host/mmc1/mmc1 0
5 /modemfs ext4 /dev/block/mmcblk0p12 0
6 /boot emmc /dev/block/mmcblk0p20 0
7 /recovery emmc /dev/block/mmcblk0p21 0
8 /tmp ramdisk ramdisk 0

[COLOR="Red"]I:/data locked in 2nd recovery![/COLOR]
(...)
[COLOR="Red"]I:/data: tot size=4754Mb, free=4142Mb, backup size=75Mb, used=1623Mb, media=1548Mb[/COLOR]
I:/storage/sdcard1/.android_secure backup size=0Mb

>> Free space: 1370Mb (9%)
>> Needed space: 411Mb

>> Backing up /boot...
Backing up boot image...
Backup of boot image completed.

>> Backing up /recovery...
Backing up recovery image...
Backup of recovery image completed.

>> Backing up /system...

Press Back to cancel.

Backup of system completed.

[COLOR="Red"]>> Backing up /data...

Press Back to cancel.

I:/data locked in 2nd recovery!
Backup of data completed.
[/COLOR]
>> Backing up /storage/sdcard1/.android_secure...

Press Back to cancel.

Backup of .android_secure completed.

>> Backing up /cache...

Press Back to cancel.

Backup of cache completed.
I:No sd-ext found. Skipping backup of sd-ext.

>> Generating md5 sum...
> .android_secure.vfat.tar.a
> .android_secure.vfat.tar
> boot.img
> cache.ext4.tar
> cache.ext4.tar.a
> data.ext4.tar.a
> data.ext4.tar
> recovery.img
> system.ext4.tar.a
> system.ext4.tar
Finalizing, please wait...

Backup complete!
Backup time: 00:47 mn
Backup size: 386.32Mb
Compression: 0.00%
press any key to continue.