[Q] NativeSD & shared directory /data/app. - HD2 Android Q&A, Help & Troubleshooting and Genera

Is there any script to share one directory /data/app to all NativeSD ROMs?
NativeSD makes you more likely to change the roms but they re doing backup and restore application is annoying.
If they modify NativeSD installation script to using shared EXT partition or directory /data/app on ext (symlinks)? This will be a cool option in Aroma Installer.
Something like mod mount_NativeSD.sh form /kernel directory:
Code:
#!/sbin/sh
# Get $ROM_NAME from ROM_NAME.prop
ROM_NAME=`cat '/tmp/aroma/ROM_NAME.prop' | sed 's/ROM_NAME=//g'`
http://forum.xda-developers.com/editpost.php?do=editpost&p=42598125
# Mount the SD-EXT partition
# Done by SD-EXT_mounter.sh
STATUS=`cat '/tmp/mount.prop' | sed 's/status=//g'`
if [ "$STATUS" = "mounted" ]; then
mkdir -p /NativeSD/$ROM_NAME/system
mkdir -p /NativeSD/$ROM_NAME/data
[COLOR="Lime"][B]mkdir -p /NativeSD/sharedata[/B][/COLOR]
mount --bind /NativeSD/$ROM_NAME/system /system
mount --bind /NativeSD/$ROM_NAME/data /data/[COLOR="Red"][B]data[/B][/COLOR] #? for separated app settings
[COLOR="lime"][B] mount --bind /NativeSD/sharedata /data[/B][/COLOR]
mkdir -p /sdcard/NativeSD/$ROM_NAME
mkdir -p /boot
mkdir -p /boot_dir
mount --bind /sdcard/NativeSD/$ROM_NAME /boot
mount --bind /sdcard/NativeSD /boot_dir
# delete the old system
rm -rf /system/*
echo "NativeSD=true" >> /tmp/nfo.prop
else
# no SD-EXT partition found
echo "NativeSD=false" >> /tmp/nfo.prop
fi
And something like mod updater-script to choose other /data location:
Code:
ui_print("@ Copying files...");
package_extract_file("kernel/boot_NativeSD/initrd.gz", "/boot/initrd.gz");
package_extract_file("kernel/boot_NativeSD/initrd.gz", "/boot_dir/initrd.gz");
package_extract_file("kernel/zImage", "/boot/zImage");
package_extract_file("kernel/zImage", "/boot_dir/zImage");
package_extract_dir("sdcard", "/sdcard");
package_extract_dir("system", "/system");
# package_extract_dir("data", "/data");
[B][COLOR="SeaGreen"] package_extract_dir("data", "/NativeSD/sharedata");
[/COLOR][/B] package_extract_dir("customize/wallpaper", "/sdcard");
package_extract_file("mods/app/NativeSDBootV10.apk", "/system/app/NativeSDBootV10.apk");
show_progress(0.1, 5);
EDIT:
It seems to that it will be a problem with the system apps when they have the same / data.
/data/data would have to stay in their own rom directory (/NativeSD/$ROM_NAME/data).
EDIT2:
I found this:
http://forum.xda-developers.com/showpost.php?p=33174514
http://forum.xda-developers.com/showthread.php?t=1869673&page=52

Related

Ubuntu

Currently trying to get this to work on my S2 and having issues.
My phone is running official KH3, CF-Rooted.
Using ubuntu.zip from here: http://nexusonehacks.net/nexus-one-hacks/how-to-install-ubuntu-on-your-android/
This guide: http://androlinux.com/android-ubuntu-development/how-to-install-ubuntu-on-android/
bootubuntu script:
Code:
#modprobe ext2
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
export kit=/sdcard/ubuntu
export bin=/system/bin
if ! test -d /data/local/ubuntu
then
mkdir /data/local/ubuntu
fi
export mnt=/data/local/ubuntu
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
#mknod /dev/loop1 b 7 0
losetup /dev/block/loop7 /sdcard/ubuntu/ubuntu.img
mount -t ext2 /dev/block/loop7 /data/local/ubuntu
#mount -o loop,noatime -t ext2 $kit/ubuntu.img $mnt
mount -o bind /proc $mnt/proc
mount -o bind /dev $mnt/dev
mount -t devpts devpts $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sysfs sysfs $mnt/sys
sysctl -w net.ipv4.ip_forward=1
echo "Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4"
echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf
echo "nameserver 8.8.4.4" >> $mnt/etc/resolv.conf
echo "Setting localhost on /etc/hosts "
echo "127.0.0.1 localhost" > $mnt/etc/hosts
echo "READY TO ROCK AND ROLL BABY! "
echo "Brought to you by NexusOneHacks.net and the open source community! "
echo " "
chroot $mnt /bin/bash
#After exit command is executed clear it all up
echo " "
echo "Shutting down Ubuntu"
umount $mnt/dev/pts
umount $mnt/proc
umount $mnt/sys
umount $mnt
losetup -d /dev/block/loop7
I get this error (after typing "sh bootubuntu"):
Code:
>adb shell
/ $ su
su
# cd /sdcard
cd /sdcard
# cd ubuntu
cd ubuntu
# sh ubuntu.sh
sh ubuntu.sh
modprobe: chdir(2.6.35.7-I9100XXKH3-CL479037): No such file or directory
←[H←[Jmkdir: can't create directory '/data/local/mnt': File exists
←[H←[Jchmod: bootubuntu: Operation not permitted
chmod: fsrw: Operation not permitted
chmod: mountonly: Operation not permitted
chmod: ubuntu.img: Operation not permitted
chmod: ubuntu.sh: Operation not permitted
chmod: unionfs: Operation not permitted
←[H←[J
Ubuntu Chroot Bootloader v0.1
Ubuntu Bootloader is now installed!
This process does NOT damage Android OS!
Original Installer by Charan Singh
Modified for Ubuntu Chroot by Max Lee at AndroLinux.com ,G2Hacks.com and NexusOn
eHacks.net
To enter the Ubuntu Linux console just type 'bootubuntu'
# sh bootubuntu
sh bootubuntu
failed: No such file or directoryk3 on /system
bootubuntu: line 41: syntax error: unexpected end of file (expecting "then")
#
Any ideas?

[MOD] Increase internal memory [NEED FIX]

Hey guy's i found this on XDA's Android Software Development section
[SCRIPTS]CronMod-A2SD/D2EXT/INT2EXT
Only A2SD script work fine but we must use link2sd or Sd2ext
Some DEVs can fix other scripts please
I think (but it's maybe wrong) D2EXT+ it's better choice for Xpéria user (With INT2EXT i have lags sometimes)
PS: When i use other scripts i lose data/GSM connection (unknown baseband) BUT when i use INT2EXT AND A2SD scripts it's work fine....strange....
I'm on FXP CM9 140 + lupus kernel
Sorry for my bad English I'm French
This is meh. Slow and not very powerful. Try my script instead:
Code:
#!/sbin/sh
#
# CSDX (Cosmic SD-EXT) script
# ==================================================
#
# v1.1
# - Switched back to ext4 because ext2 was unreliable
# - Maybe other minor stuff, can't remember
#
#
# v1.0
# - Initial version
# - Based on AD2SDX Alpha 2 by amarullz, ALL CREDIT
# GOES TO HIM!
# - Doesn't swap /data and /sd-ext mounts (solves race
# condition with dalvik-cache on fresh boot)
# - Moves more system data back to internal (MIUI, Sony
# framework, Google apps)
# - Mounts in ext2 instead of ext4 because it's faster
# - Filesystem check on every boot (safer)
#
#
# Verbose shell output for debugging purposes
# set -xv
LOG=/data/csdx.log
echo "[CSDX] Begin!"
echo "[C2DX] Script started - $(date)" > $LOG
EXT_SDCARD=/sd-ext
if [ ! -d $EXT_SDCARD ];
then
echo "[C2DX] $EXT_SDCARD does not exist, creating..." >> $LOG
mount -o rw,remount -t rootfs rootfs /
rm -r -f $EXT_SDCARD
mkdir -p $EXT_SDCARD
chmod -R 775 $EXT_SDCARD
chown -R 0:0 $EXT_SDCARD
mount -o ro,remount -t rootfs rootfs /
fi
chmod 775 $EXT_SDCARD
chown 0:0 $EXT_SDCARD
mount /data
echo "[C2DX] Setting read_ahead_kb..." >> $LOG
echo "4096" > /sys/devices/virtual/bdi/179:0/read_ahead_kb 1>>$LOG 2>>$LOG
echo "[C2DX] Unmounting (if needed)..." >> $LOG
umount /sd-ext 1>>$LOG 2>>$LOG
umount $EXT_SDCARD 1>>$LOG 2>>$LOG
umount /dev/block/mmcblk0p2 1>>$LOG 2>>$LOG
umount /dev/block/vold/179:2 1>>$LOG 2>>$LOG
#echo "[C2DX] Checking for errors (and fixing if necessary)..." >> $LOG
#e2fsck -p /dev/block/mmcblk0p2 1>>$LOG 2>>$LOG
echo "[C2DX] Mounting..." >> $LOG
#mount -t ext2 -o rw,nouser_xattr,errors=continue,noatime,nodiratime,nosuid,nodev /dev/block/vold/179:2 $EXT_SDCARD 1>>$LOG 2>>$LOG
#mount -t ext2 -o rw,nouser_xattr,errors=continue,noatime,nodiratime,nosuid,nodev /dev/block/mmcblk0p2 $EXT_SDCARD 1>>$LOG 2>>$LOG
mount -t ext4 -o noauto_da_alloc,data=ordered,commit=15,barrier=1,nouser_xattr,errors=continue,noatime,nodiratime,nosuid,nodev /dev/block/mmcblk0p2 $EXT_SDCARD 1>>$LOG 2>>$LOG
mount -t ext4 -o noauto_da_alloc,data=ordered,commit=15,barrier=1,nouser_xattr,errors=continue,noatime,nodiratime,nosuid,nodev /dev/block/vold/179:2 $EXT_SDCARD 1>>$LOG 2>>$LOG
mount >> $LOG
for i in app app_s app-private data framework_s lib_s ;
do
if [ -h $EXT_SDCARD/$i ]
then
echo "[C2DX] Removing incorrect symlink '$i' on sd-ext..." >> $LOG
rm $EXT_SDCARD/$i 1>>$LOG 2>>$LOG
fi;
if [ -d /data/$i ]
then
# Check if already linked
if [ ! -d $EXT_SDCARD/$i ]
then
echo "[C2DX] Moving '$i' to sd-ext..." >> $LOG
mv /data/$i $EXT_SDCARD/ 1>>$LOG 2>>$LOG
fi;
fi;
if [ ! -d /data/$i ]
then
echo "[C2DX] Creating '$i' on sd-ext (just in case)..." >> $LOG
mkdir $EXT_SDCARD/$i 1>>$LOG 2>>$LOG
chmod 0777 $EXT_SDCARD/$i 1>>$LOG 2>>$LOG
fi;
if [ ! -h $EXT_SDCARD/$i ]
then
# Check if already linked
echo "[C2DX] Linking '$i' to sd-ext..." >> $LOG
ln -s $EXT_SDCARD/$i /data/$i 1>>$LOG 2>>$LOG
fi;
done;
###
if [ ! -d /data/data_system ]
then
echo "[C2DX] Creating system data folder..." >> $LOG
mkdir /data/data_system 1>>$LOG 2>>$LOG
chmod 0777 /data/data_system 1>>$LOG 2>>$LOG
fi;
cd $EXT_SDCARD/data/;
for i in `ls -d com.htc* com.android* com.google* com.ijinshan.mguard.provider com.lbe.security.miui com.miui* com.sonyericsson* com.svox.pico com.wali.miui.networkassistant com.xiaomi.xmsf miui`;
do
if [ ! -h $EXT_SDCARD/data/$i ]
then
echo "[C2DX] Moving '$i' back to internal data..." >> $LOG
mv $EXT_SDCARD/data/$i /data/data_system/ 1>>$LOG 2>>$LOG
fi;
done;
cd /data/data_system/
for i in `ls -d *`;
do
if [ ! -h $EXT_SDCARD/data/$i ]
then
echo "[C2DX] Linking '$i' back to internal data..." >> $LOG
ln -s /data/data_system/$i $EXT_SDCARD/data/$i 1>>$LOG 2>>$LOG
fi;
done;
echo "[C2DX] Finished! See $LOG for details."
echo "[C2DX] Script finished - $(date)" >> $LOG
Amaraluz script coooooooool
Original don't work
Thanks cosmicDan i'm testing Now !
Edit:i don't see my 1gb EXT partition in storage section...it's normal ? :/
Increase Internal Memory huh?
Well it's not real internal memory. It's an SD acting as it so it doesn't make a lot of difference.
Unless you have thousands of apps and after moving them all to SD you still need space.
Sent from my R800i using XDA APP and NXT2JB
benben972 said:
Amaraluz script coooooooool
Original don't work
Thanks cosmicDan i'm testing Now !
Edit:i don't see my 1gb EXT partition in storage section...it's normal ? :/
Click to expand...
Click to collapse
Yes. I don't swap partitions because its unreliable.
The script is still experimental though. I hope you did a backup before using it, because it can't be removed if you find trouble.
sewer56lol said:
Increase Internal Memory huh?
Well it's not real internal memory. It's an SD acting as it so it doesn't make a lot of difference.
Unless you have thousands of apps and after moving them all to SD you still need space.
Sent from my R800i using XDA APP and NXT2JB
Click to expand...
Click to collapse
Exactly !! And i don't need "move" apps in SD with 1Gb on my ext4 partition
CosmicDan said:
Yes. I don't swap partitions because its unreliable.
The script is still experimental though. I hope you did a backup before using it, because it can't be removed if you find trouble.
Click to expand...
Click to collapse
Unreliable ? Why ? When you move apps on SD it's the same thing right ?
Nobody ?
benben972 said:
Exactly !! And i don't need "move" apps in SD with 1Gb on my ext4 partition
Unreliable ? Why ? When you move apps on SD it's the same thing right ?
Click to expand...
Click to collapse
It presents a race condition between init.d link script and dalvikVM. Results in random bootloops.
So what needs to be done? I am looking for a script exactly like this I can use on LuPuS and ParanoidAndroid. I use 40ad2sdx on Gingerbread currently.
Sent from my R800x using xda app-developers app
savage24x said:
So what needs to be done? I am looking for a script exactly like this I can use on LuPuS and ParanoidAndroid. I use 40ad2sdx on Gingerbread currently.
Sent from my R800x using xda app-developers app
Click to expand...
Click to collapse
Other scripts crash data connection (unknown baseband). Cosmic i actualy use INT2EXT+ and A2SD+. Data work fine and i haven't bootloop but it's sometimes slow because i have fat32+EXT4+swap partitions on my sd card and INT2EXT+ script always read/write on SD (cache).
D2EXT+ don't moove davlik cache on SD card
benben972 said:
Other scripts crash data connection (unknown baseband). Cosmic i actualy use INT2EXT+ and A2SD+. Data work fine and i haven't bootloop but it's sometimes slow because i have fat32+EXT4+swap partitions on my sd card and INT2EXT+ script always read/write on SD (cache).
D2EXT+ don't moove davlik cache on SD card
Click to expand...
Click to collapse
You should not read and write to a flash card or put cache on it, because of the limited read and write cycles.
Sent from my R800x using xda app-developers app
savage24x said:
You should not read and write to a flash card or put cache on it, because of the limited read and write cycles.
Sent from my R800x using xda app-developers app
Click to expand...
Click to collapse
Yes ! D2EXT mount ext4 partition for app/data app and leaves cache on internal memory BUT data connection doesn't work everything woks except that
I installed A2SD+, but my internal storage did not increase. Is that normal? ext3 I believe.
savage24x said:
I installed A2SD+, but my internal storage did not increase. Is that normal? ext3 I believe.
Click to expand...
Click to collapse
Yes A2SD scrits only MOVES data on ext partition and D2EXT or INT2EXT scripts MOUNTS ext partition in internal storage
Looks like it has potential, I will test this soon
Does this work? I really need more internal storage. My ICS Rom is storage demanding.
D2EXT moded script
I edit D2EXT script and now is fully working. GSM or (if You like) data connection is working on my stock LwW, but should work also on other 2011 Xperia phones. If someone want edited D2EXT or INT2EXT script then please send PM or reply in this thread
PS. Sorry if my English isn't perfect, this is not my native language
Odp: [MOD] Increase internal memory [NEED FIX]
Look at the latest post date dude. It's so old + there is tdsx which does the thing more easily.
Sent from my R800i using xda premium

Bactrack 5 - errors with ext2 and chroot

Hi everyone,
I'm a noob on this forum so i'll try to be as clear as possible.
I have some issues trying to install backtrack 5 ARM version on my Nexus 10.
Config :
Nexus 10
4.3
Kernel : 3.4.39-g446c9cf
Build number : JWR66Y
Terminal emulator
Busybox Free
What I did :
I rooted my Nexus 10 following this tutorial (checking custom recovery) :
http://forum.xda-developers.com/showthread.php?t=2015467
I tried to install Backtrack 5 following this tutorial :
http://forum.xda-developers.com/showthread.php?t=1079898
But it didn't succeed. I tried to figure out my problem but I'm quite lost and not sure what the real problem is :
The script bt :
Code:
perm=$(id|cut -b 5)
if [ "$perm" != "0" ];then echo "This script requires root! Type: su"; exit; fi
mount -o remount,rw /dev/block/mmcblk0p5 /system
export kit=/sdcard/bt5
export bin=/system/bin
export mnt=/data/local/mnt
mkdir $mnt
export PATH=$bin:/usr/bin:/usr/local/bin:/usr/sbin:/bin:/usr/local/sbin:/usr/games:$PATH
export TERM=linux
export HOME=/root
if [ -b /dev/loop7 ]; then
echo "Loop device exists"
else
busybox mknod /dev/loop7 b 7 0
fi
#mount -o loop,noatime -t ext2 $kit/bt5.img $mnt
losetup /dev/block/loop7 $kit/bt5.img
mount -t ext2 /dev/block/loop7 $mnt
mount -t devpts devpts $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sysfs sysfs $mnt/sys
busybox sysctl -w net.ipv4.ip_forward=1
echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf
echo "nameserver 8.8.4.4" >> $mnt/etc/resolv.conf
echo "127.0.0.1 localhost bt5" > $mnt/etc/hosts
echo "Ubuntu is configured with SSH and VNC servers that can be accessed from the IP:"
ifconfig eth0
echo " "
busybox chroot $mnt /bin/bash
echo "Shutting down BackTrack ARM"
umount $mnt/dev/pts
umount $mnt/proc
umount $mnt/sys
umount $mnt
losetup -d /dev/loop7
I have theese errors (by doing sh -x bt)
mount -t ext2 /dev/block/loop7 $mnt
>mount: Operation not supported on transport endpoint.
ifconfig etho
>eth0 : No such device
busybox chroot $mnt /bin/bash
>chroot: can't execute '/bin/bash' no such file or directory
losetup -d /dev/loop7
>losetup: /dev/loop7: No such device or address
I search on the forum but I can't find what is the real problem :
http://forum.xda-developers.com/showthread.php?t=2116059
--> cd /storage/emulated/legacy/bt5/ don't change anything.
I readed that ext2 and chroot not working could come from the 4.3 but I'm not sure about this information.
I readed that most of custom ROM handle this.
/bin/bash doesn't exist, but /system/bin/sh does exists but :
busybox chroot $mnt /system/bin/sh don't changes anything.
I'd be glad if you can help me understanding my problem
Best,
Sanchorizo.

Problem with Busybox and Root

To work properly init.d must have installed busybox , so I copy latest busybox in system/bin and put this command in updater-script
Code:
run_program("/system/xbin/busybox", "--install", "-s", "/system/xbin");
After intallation and first boot everything is OK , init.d support is activated , root is OK.
But after I reboot phone , root is lost - "SU binary is missing"
If I not include command for installing busybox in updater-script , root is OK and isn't lost after I reboot phone , but busybox is not installed properly and init.d support is not active.
I don't know what to do anymore ?
Do you have the init.d script to start the su binary in daemon mode or something like that? Have you double checked that su is still in /system/xbin? Also, under /system/bin there should be a directory called ".ext"
elesbb said:
Do you have the init.d script to start the su binary in daemon mode or something like that? Have you double checked that su is still in /system/xbin? Also, under /system/bin there should be a directory called ".ext"
Click to expand...
Click to collapse
1.Yes I have
Code:
#!/system/bin/sh
/system/xbin/daemonsu --auto-daemon &
2.Yes
Problem appears when I include busybox installation in updater-script.
With 4.3 I don't have this problem.
mom4ence said:
1.Yes I have
Code:
#!/system/bin/sh
/system/xbin/daemonsu --auto-daemon &
2.Yes
Problem appears when I include busybox installation in updater-script.
With 4.3 I don't have this problem.
Click to expand...
Click to collapse
Try to reflash this via recovery http://download.chainfire.eu/376/SuperSU/UPDATE-SuperSU-v1.89.zip?retrieve_file=1
Repulsa said:
Try to reflash this via recovery http://download.chainfire.eu/376/SuperSU/UPDATE-SuperSU-v1.89.zip?retrieve_file=1
Click to expand...
Click to collapse
I know about this , and is working without problem.
But I want to integrate everything in my rom , i don't want user to flash another file after finish installation of rom.
With 4.3 base i don't have any problem.I don't know where is the problem - busybox or Chainfire root
mom4ence said:
I know about this , and is working without problem.
But I want to integrate everything in my rom , i don't want user to flash another file after finish installation of rom.
With 4.3 base i don't have any problem.I don't know where is the problem - busybox or Chainfire root
Click to expand...
Click to collapse
Then just copy chainfire's update zip into yours. Merge the scripts.
Sent from my SGH-M919 using Tapatalk
elesbb said:
Then just copy chainfire's update zip into yours. Merge the scripts.
Sent from my SGH-M919 using Tapatalk
Click to expand...
Click to collapse
This a script
Code:
#!/sbin/sh
OUTFD=$2
ZIP=$3
ui_print() {
echo -n -e "ui_print $1\n" > /proc/self/fd/$OUTFD
echo -n -e "ui_print\n" > /proc/self/fd/$OUTFD
}
set_perm() {
chown $1.$2 $4
chown $1:$2 $4
chmod $3 $4
}
ch_con() {
/system/bin/toolbox chcon u:object_r:system_file:s0 $1
chcon u:object_r:system_file:s0 $1
}
ui_print "*********************"
ui_print "SuperSU installer ZIP"
ui_print "*********************"
ui_print "- Mounting /system, /data and rootfs"
mount /system
mount /data
mount -o rw,remount /system
mount -o rw,remount /system /system
mount -o rw,remount /
mount -o rw,remount / /
ABI=$(cat /default.prop | grep ro.product.cpu.abi= | dd bs=1 skip=19 count=3)
ABI2=$(cat /default.prop | grep ro.product.cpu.abi2= | dd bs=1 skip=20 count=3)
ARCH=arm
if [ "$ABI" = "x86" ]; then ARCH=x86; fi;
if [ "$ABI2" = "x86" ]; then ARCH=x86; fi;
ui_print "- Extracting files"
cd /tmp
mkdir supersu
cd supersu
unzip -o "$ZIP"
BIN=/tmp/supersu/$ARCH
COM=/tmp/supersu/common
ui_print "- Disabling OTA survival"
chmod 0755 /tmp/supersu/$ARCH/chattr
$BIN/chattr -i /system/xbin/su
$BIN/chattr -i /system/bin/.ext/.su
$BIN/chattr -i /system/xbin/daemonsu
$BIN/chattr -i /system/etc/install-recovery.sh
ui_print "- Removing old files"
rm -f /system/bin/su
rm -f /system/xbin/su
rm -f /system/xbin/daemonsu
rm -f /system/bin/.ext/.su
rm -f /system/etc/install-recovery.sh
rm -f /system/etc/init.d/99SuperSUDaemon
rm -f /system/etc/.installed_su_daemon
rm -f /system/app/Superuser.apk
rm -f /system/app/Superuser.odex
rm -f /system/app/SuperUser.apk
rm -f /system/app/SuperUser.odex
rm -f /system/app/superuser.apk
rm -f /system/app/superuser.odex
rm -f /system/app/Supersu.apk
rm -f /system/app/Supersu.odex
rm -f /system/app/SuperSU.apk
rm -f /system/app/SuperSU.odex
rm -f /system/app/supersu.apk
rm -f /system/app/supersu.odex
rm -f /data/dalvik-cache/*com.noshufou.android.su*
rm -f /data/dalvik-cache/*com.koushikdutta.superuser*
rm -f /data/dalvik-cache/*com.mgyun.shua.su*
rm -f /data/dalvik-cache/*Superuser.apk*
rm -f /data/dalvik-cache/*SuperUser.apk*
rm -f /data/dalvik-cache/*superuser.apk*
rm -f /data/dalvik-cache/*eu.chainfire.supersu*
rm -f /data/dalvik-cache/*Supersu.apk*
rm -f /data/dalvik-cache/*SuperSU.apk*
rm -f /data/dalvik-cache/*supersu.apk*
rm -f /data/dalvik-cache/*.oat
rm -f /data/app/com.noshufou.android.su-*
rm -f /data/app/com.koushikdutta.superuser-*
rm -f /data/app/com.mgyun.shua.su-*
rm -f /data/app/eu.chainfire.supersu-*
ui_print "- Creating space"
cp /system/app/Maps.apk /Maps.apk
cp /system/app/GMS_Maps.apk /GMS_Maps.apk
cp /system/app/YouTube.apk /YouTube.apk
rm /system/app/Maps.apk
rm /system/app/GMS_Maps.apk
rm /system/app/YouTube.apk
ui_print "- Placing files"
mkdir /system/bin/.ext
cp $BIN/su /system/xbin/daemonsu
cp $BIN/su /system/xbin/su
cp $BIN/su /system/bin/.ext/.su
cp $COM/Superuser.apk /system/app/Superuser.apk
cp $COM/install-recovery.sh /system/etc/install-recovery.sh
cp $COM/99SuperSUDaemon /system/etc/init.d/99SuperSUDaemon
echo 1 > /system/etc/.installed_su_daemon
ui_print "- Restoring files"
cp /Maps.apk /system/app/Maps.apk
cp /GMS_Maps.apk /system/app/GMS_Maps.apk
cp /YouTube.apk /system/app/YouTube.apk
rm /Maps.apk
rm /GMS_Maps.apk
rm /YouTube.apk
ui_print "- Setting permissions"
set_perm 0 0 0777 /system/bin/.ext
set_perm 0 0 06755 /system/bin/.ext/.su
set_perm 0 0 06755 /system/xbin/su
set_perm 0 0 0755 /system/xbin/daemonsu
set_perm 0 0 0755 /system/etc/install-recovery.sh
set_perm 0 0 0755 /system/etc/init.d/99SuperSUDaemon
set_perm 0 0 0644 /system/etc/.installed_su_daemon
set_perm 0 0 0644 /system/app/Superuser.apk
set_perm 0 0 0644 /system/app/Maps.apk
set_perm 0 0 0644 /system/app/GMS_Maps.apk
set_perm 0 0 0644 /system/app/YouTube.apk
ch_con /system/bin/.ext/.su
ch_con /system/xbin/su
ch_con /system/xbin/daemonsu
ch_con /system/etc/install-recovery.sh
ch_con /system/etc/init.d/99SuperSUDaemon
ch_con /system/etc/.installed_su_daemon
ch_con /system/app/Superuser.apk
ch_con /system/app/Maps.apk
ch_con /system/app/GMS_Maps.apk
ch_con /system/app/YouTube.apk
ui_print "- Post-installation script"
/system/xbin/su --install
ui_print "- Unmounting /system and /data"
umount /system
umount /data
ui_print "- Done !"
exit 0
I try to convert for normal updater-script , because this is in update-binary. Nothings happen , maybe I wrong somewhere
This my version
Code:
package_extract_dir("niko/mod/tools", "/system");
set_perm(0, 0, 0755, "/system/chattr");
run_program("/system/chattr", "-i", "/system/xbin/su");
run_program("/system/chattr", "-i", "/system/bin/.ext/.su");
run_program("/system/chattr", "-i", "/system/xbin/daemonsu");
run_program("/system/chattr", "-i", "/system/etc/install-recovery.sh");
run_program("/sbin/busybox", "cp", "/system/99SuperSUDaemon", "/system/etc/init.d/99SuperSUDaemon");
set_perm(0, 0, 0777, "/system/bin/.ext");
set_perm(0, 0, 06755, "/system/bin/.ext/.su");
set_perm(0, 0, 06755, "/system/xbin/su");
set_perm(0, 0, 06755, "/system/xbin/daemonsu");
set_perm(0, 0, 0755, "/system/etc/install-recovery.sh");
set_perm(0, 0, 0755, "/system/etc/init.d/99SuperSUDaemon");
run_program("/system/chattr", "+i", "/system/etc/install-recovery.sh");
delete("/system/chattr");
delete("/system/99SuperSUDaemon");
I put it after finishing rom installation.

[TESTING NEEDED][MODS]3.0.x - initrd.gz made on the fly. f2fs/ext4 MULTIBOOT

Was working with RobbieP on this (as I can't test on device) - essentially aroma config for 3.0.x kernel with initrd.gz made on the fly.
Initrd mods carried out include applying: data on ext, nativesd, directsd(w/ ext4 or f2fs) to nand initrd.gz.
Decided to come at this from a different direction (after managing to botch together a device to test on) - as I can't get the aroma prop files to play nice.
So lets start with the minor modifications needed by in the ROM
Updater script modifications (based on SlimKat - but should be universal'ish'):
Code:
...
...
...
###############
# Cleaning up #
###############
set_progress(0.95);
delete_recursive("/tmp/*");
if file_getprop("/tmp/aroma/mods.prop", "selected.4") == "2" then
ui_print("@ Cleaning up...");
ui_print(" Unmounting...");
unmount("/boot");
unmount("/boot_dir");
unmount("/system");
unmount("/data");
unmount("/DirectSD");
unmount("/DirectSystem");
unmount("/NativeSD");
ui_print(" Done.");
else
package_extract_file("kernel/initrd.gz[COLOR="red"](NAND initrd)[/COLOR]", "/boot_dir/initrd.gz");
package_extract_file("kernel/zImage", "/boot_dir/zImage");
endif;
set_progress(1.0);
ui_print("@ Installation Complete");
Edit. Going to need: delete_recursive("/tmp/*"); outside of the if;endif;
And also /boot_dir won't be made if using NAND/DataOnExt; will need to rework this and #2 to extract to /tmp after it's wiped.
And change every reference to an initrd.gz other than the NAND one to the NAND one (just to avoid confusion)
Which obviously requires an additional group in mods in aroma-config:
Code:
...
...
...
#-- Group 3
"Wipe","",2,
"Wipe Dalvik-Cache",
"Select it to wipe Dalvik-Cache.", 1,
"Wipe Data/Factory Reset",
"Select it to wipe data/factory reset.", 0,
"No Wipe",
"Select it to keep everything.", 0,
#-- Group 4
"Installing a second zip","",2,
"Installing a second zip",
"Select it if you are installing a second zip - NativeSD/DirectSD or gapps for example", 1,
"Not installing a second zip",
"Select it if installing to NAND only", 0
);
...
...
Additionally the set_build_prop_*.sh's should be replaced (or redirected in updater script) by the following:
Set_Build_Prop.sh
Code:
#!/sbin/sh
# Append " [$install_type] and [$ROM_NAME]" to the ROM name for HD2
# Modify /system/build.prop and append "[] hooks" to the end of the line of ro.build.display.id
# Created by hypoturtle
ROM_NAME=`cat '/tmp/aroma/ROM_NAME.prop' | sed 's/ROM_NAME=//g'`
install_type=` cat '/tmp/aroma/installtype.prop' | sed 's/selected.1=//g' `
type=(NAND DataOnExt NativeSD DirectSD)
install=${type[$install_type-1]}
output=`grep -i "^ro\.build\.display\.id.*\[${install}\]$" /system/build.prop`
if [ -z "$output" ]; then
sed -i '/ro\.build\.display\.id/s/$/ \['${ROM_NAME}'] ['${install}'\]/' /system/build.prop
fi
And modify DirectSD_mounter.sh so that if it doesn't mount p3 as ext4 it tries with f2fs
Code:
#!/sbin/sh
#
# DirectSD SD-EXT Mounter v1.0
# Author: tytung - xda-developers
if [ ! -d "/DirectSystem" ]; then
mkdir "/DirectSystem"
fi
if [ ! -d "/DirectData" ]; then
mkdir "/DirectData"
fi
if [ -f "/tmp/mount.prop" ]; then
rm "/tmp/mount.prop"
fi
# Mount the SD-EXT partition
mounted=`mount | grep '/dev/block/mmcblk0p2 on /DirectSystem'`
if [ "$mounted" = "" ]; then
mount -t ext4 /dev/block/mmcblk0p2 /DirectSystem
fi
# Mount the SD-EXT partition
mounted=`mount | grep '/dev/block/mmcblk0p3 on /DirectData'`
if [ "$mounted" = "" ]; then
mount -t ext4 /dev/block/mmcblk0p3 /DirectData
fi
# Mount F2FS partition
mounted=`mount | grep '/dev/block/mmcblk0p3 on /DirectData'`
if [ "$mounted" = "" ]; then
mount -t f2fs /dev/block/mmcblk0p3 /DirectData
fi
mounted=`mount | grep '/dev/block/mmcblk0p3 on /DirectData'`
# `echo $?` will return 0 if mount is executed successfully
if [ `echo $?` = 0 ]; then
echo 'status=mounted' > "/tmp/mount.prop"
#else
# redirect mount failed messages to aroma-config
fi
And that's it on this side. Now read #2
legacy:
Managed to fix the nativesd.sh - it was riddled with errors:
Code:
#!/sbin/sh
export ROM_NAME=` cat 'ROM_NAME.prop' | sed 's/ROM_NAME=//g' `
export install_type=` cat 'installtype.prop' | sed 's/selected.1=//g' `
export bootloader=` cat 'nfo.prop' | sed 's/bootloader=//g' `
cd /tmp/aroma
mkdir /tmp/aroma/work
cp initrd.gz initrd-test.gz
cd /tmp/aroma/work
# unzipping nand kernel and applying modifications
gzip -d -c ../initrd-test.gz | cpio -i -d
mkdir bin
cd ..
cp busybox work/bin/busybox
cp e2fsck work/bin/e2fsck
chmod 0777 work/bin/busybox
chmod 0777 work/bin/e2fsck
if [ "${install_type}" -gt 2 ]; then
sed -i '/[email protected]/s/^/#/' work/ueventd.htcleo.rc
sed -i '/mount yaffs2/s/^/#/
s/# #/# /g' work/init.rc
sed -i 's/auto/ext4/g' work/mountfs${install_type}.sh
fi
if [ "${install_type}" -gt 1 ]; then
sed -i '/on fs/ a exec /mountfs'${install_type}'.sh' work2/init.rc
cp mountfs${install_type}.sh work/mountfs${install_type}.sh
sed -i "s/rOm/$ROM_NAME/g" work/mountfs${install_type}.sh
chmod 0777 work/mountfs${install_type}.sh
chmod 0750 work/init.rc
chmod 0644 work/ueventd.htcleo.rc
fi
# making new ramdisk and copying to sd card
cd work2
find .| cpio -o -H newc | gzip -9 > ../initrd-done.gz
cd ..
if [ "${bootloader}" != "cLK" ]; then
cat initrd-done.gz >> 6MB
cp 6MB initrd6MB.gz
else
cp done2/initrd-done.gz /tmp/initrd.gz
fi
chmod 0777 initrd.gz
if [ "${install_type}" -lt 3 ]; then
cp initrd6MB.gz tmp/initrd.gz
else
cp initrd6MB.gz boot/initrd.gz
cp initrd6MB.gz boot_dir/initrd.gz
fi
# Copying tmp and open ramdisk folders to sdcard (NativeSD folder)
mkdir -p boot/tmp
Also this way if you want to add another way of booting all you need to do is create a mountfs.sh file and edit aroma-config.
aroma-config
Code:
### LICENSE:
#
# Copyright (C) 2011-2012 Ahmad Amarullah ( http://amarullz.com/ )
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
### FILE INFO:
#
# AROMA Installer from NexusHD2 tytung was modded by
# macs18max to include haret detection (hacked way) and
# clk nativesd sboot2. If using this please credit macs18max
#
###
##
# Forcing Device Pixelate Size
# defaut: floor( min( width, height ) / 160 )
#
ini_set("dp","3"); #-- HDPI ( 480x800 / WVGA )
##
# Initializing Rom Information
##
ini_set("rom_name", "ChauTien Slimroms 4.4.2");
ini_set("rom_version", "Build 4");
ini_set("rom_author", "Chau Truong Thinh");
ini_set("rom_device", "HTC HD2");
ini_set("rom_date", "APR. 01, 2014");
##
# Show Simple Splash
# splash( 2000, "slim");
##
# Set Small Font to Support all fonts
#
fontresload( "0", "ttf/Roboto-Regular.ttf;ttf/DroidSansArabic.ttf;ttf/DroidSansFallback.ttf;", "12" ); #-- Use sets of font (Font Family)
##
# Set Language & Font Family
#
loadlang("langs/en.lang");
fontresload( "0", "ttf/Roboto-Regular.ttf", "12" ); #-- "0" = Small Font
fontresload( "1", "ttf/Roboto-Regular.ttf", "18" ); #-- "1" = Big Font
###################################################################################################################
#
# STEP 1 - SELECT THEME
#
theme("ics");
###################################################################################################################
#
# STEP 2 - SHOW ROM INFORMATION
#
# Extract ROM_NAME.prop to /tmp/aroma/ROM_NAME.prop
ziptotmp("kernel/ROM_NAME.prop", "ROM_NAME.prop");
ziptotmp("kernel/initrd.gz", "initrd.gz");
ziptotmp("kernel/busybox", "busybox");
ziptotmp("kernel/e2fsck", "e2fsck");
ziptotmp("kernel/zImage", "zImage");
ziptotmp("kernel/mkbootimg", "mkbootimg");
ziptotmp("kernel/mkbootimg.sh", "mkbootimg.sh");
ziptotmp("kernel/mountfs2.sh", "mountfs2.sh");
ziptotmp("kernel/mountfs3.sh", "mountfs3.sh");
ziptotmp("kernel/mountfs4.sh", "mountfs4.sh");
ziptotmp("kernel/mountfs5.sh", "mountfs5.sh");
ziptotmp("kernel/6MB", "6MB");
zipexec("kernel/checksys.sh");
setvar("bootloader", file_getprop("/tmp/nfo.prop", "bootloader"));
viewbox(
#-- Title
"Welcome!",
#-- Text
"You are about to install the below ROM for <b>"+ini_get("rom_device")+"</b>.\n\n"+
" ROM Name\t: <b><#selectbg_g>"+ini_get("rom_name")+"</#></b>\n"+
" Version\t: <b><#selectbg_g>"+ini_get("rom_version")+"</#></b>\n"+
" Author\t: <b><#selectbg_g>"+ini_get("rom_author")+"</#></b>\n"+
" Update\t: <b><#selectbg_g>"+ini_get("rom_date")+"</#></b>\n\n\n"+
"Bootloader\t: "+getvar("bootloader")+"\n\n"+
"System NAND\t: "+getdisksize("/system","m")+" MB\n"+
"\t Free\t: "+ getdiskfree("/system","m")+" MB\n\n"+
"Data NAND\t: "+getdisksize("/data","m")+" MB\n"+
"\t Free\t: "+ getdiskfree("/data","m")+" MB\n\n"+
"SD Card Size\t: "+getdisksize("/sdcard","m")+" MB\n"+
"\t Free\t: "+ getdiskfree("/sdcard","m")+" MB\n\n"+
" SD-EXT Size\t: "+getdisksize("/sd-ext","m")+" MB\n"+
"\t Free\t: "+ getdiskfree("/sd-ext","m")+" MB\n\n"+
"SD-EXT2 Size\t: "+getdisksize("/sd-ext2","m")+" MB\n"+
"\t Free\t: "+ getdiskfree("/sd-ext2","m")+" MB\n\n\n"+
"Press Next to Continue the Installation...",
#-- Icon
"icons/welcome"
);
###################################################################################################################
#
# STEP 3 - SHOW SELECTBOX - Install Type
#
selectbox(
#-- Title
"Install Type",
#-- Sub Title
"Please Select the install type:",
#-- Icon
"icons/apps",
#-- Will be saved in /tmp/aroma/installtype.prop
"installtype.prop",
#-- Group 1
"Install Location", "", 2, #-- Group 1. key = "selected.1"
"NAND",
"[email protected], [email protected], [email protected]\nFor T-Mobile USA HD2 (LEO 1024)", 0, #-- selected.1 = 1
"NAND with DataOnEXT",
"[email protected], [email protected], [email protected]\nFor EU/International HD2 (LEO 512)", 0, #-- selected.1 = 2
"NativeSD (Everything on the SD card)",
"[email protected], [email protected], [email protected]\nFor high speed read/write SD Card", 0, #-- selected.1 = 3
"DirectSD (Everything on the SD card)",
"[email protected], [email protected], [email protected]\nFor high speed read/write SD Card", 1, #-- selected.1 = 4
"DirectSD (Everything on the SD card)",
"[email protected], [email protected], [email protected]\nFor high speed read/write SD Card", 0 #-- selected.1 = 5
);
if (prop("installtype.prop", "selected.1") == "1" ||
prop("installtype.prop", "selected.1") == "2") then
writetmpfile("kernel.prop", "NAND=yes");
zipexec("kernel/nativesd.sh");
else
writetmpfile("kernel.prop", "NAND=no");
endif;
##############################
# Mount the SD-EXT partition #
##############################
if (prop("installtype.prop", "selected.1") == "2" ||
prop("installtype.prop", "selected.1") == "3") then
pleasewait("Mounting the SD-EXT Partition...");
zipexec("kernel/SD-EXT_mounter.sh");
setvar("mount_result", getvar("exec_buffer"));
zipexec("kernel/nativesd.sh");
if file_getprop("/tmp/mount.prop", "status") != "mounted" then
#######################
# No SD-EXT Partition #
#######################
# Set Next Text to 'Exit'
ini_set("text_next", "Exit");
textbox(
"Mounting SD-EXT failed!",
"Please create an EXT4 partition (mmcblk0p2) on the SD Card first.",
"icons/alert",
"Error messages:\n\n"+getvar("mount_result")
);
#-- Back to Menu
back("1");
endif;
endif;
if (prop("installtype.prop", "selected.1") == "4" ||
prop("installtype.prop", "selected.1") == "5") then
pleasewait("Mounting the SD-EXT Partition...");
zipexec("kernel/DirectSD_mounter.sh");
setvar("mount_result", getvar("exec_buffer"));
zipexec("kernel/nativesd.sh");
if file_getprop("/tmp/mount.prop", "status") != "mounted" then
#######################
# No SD-EXT Partition #
#######################
# Set Next Text to 'Exit'
ini_set("text_next", "Exit");
textbox(
"Mounting SD-EXT failed!",
"Please create an EXT4 partition (mmcblk0p2) on the SD Card first.",
"icons/alert",
"Error messages:\n\n"+getvar("mount_result")
);
#-- Back to Menu
back("1");
endif;
endif;
# Swap partition activation - run the check for sdcard swap partition
pleasewait("Checking SDCard for Swap Partition.");
zipexec("mods/swap-partition-activator/install/checkforswap.sh");
###################################################################################################################
#
# STEP 4 - SHOW SELECTBOX - ROM Mods
#
selectbox(
#-- Title
"ROM Mods",
#-- Sub Title
"Please Select the ROM Mods:",
#-- Icon
"icons/personalize",
#-- Will be saved in /tmp/aroma/mods.prop
"mods.prop",
#-- Group 1
"Default Connection Type","",2,
"RMNET Connection",
"Please Choose RMNET for MAGLDR bootloader.", iif((file_getprop("/tmp/nfo.prop", "bootloader") == "MAGLDR"), 1, 0),
"PPP Connection",
"All bootloaders support PPP.", iif((file_getprop("/tmp/nfo.prop", "bootloader") == "MAGLDR"), 0, 1),
# Group 2
"Activate RAM Pages Swapping","",2,
"Yes",
"You must have a pre-made swap partition on your SDcard!", iif((file_getprop("/tmp/checkforswap.prop", "swap.present") == "yes"), 1, 0),
"No",
"Swapping will be deactivated.\n\n", iif((file_getprop("/tmp/checkforswap.prop", "swap.present") == "no"), 1, 0),
#-- Group 3
"Wipe","",2,
"Wipe Dalvik-Cache",
"Select it to wipe Dalvik-Cache.", 1,
"Wipe Data/Factory Reset",
"Select it to wipe data/factory reset.", 0,
"No Wipe",
"Select it to keep everything.", 0
);
####################
# Installation Ready
####################
ini_set("text_next", "Install Now");
viewbox(
"Installation Ready",
"The wizard is ready to begin installation.\n\n"+
"Press <b>Install Now</b> to begin the installation.\n\n"+
"If you want to review or change any of your installation settings, press <b>Back</b> or Press Menu Key -> Quit Installation to exit the wizard.",
"@install"
);
#####################
# Start Install
#####################
ini_set("text_next", "Finish");
install(
"Installing",
"<b>"+ini_get("rom_name")+"</b> is being installed.\n\n"+
"Please wait while installation wizard installs <b>"+ini_get("rom_name")+
"</b>. This may take several minutes.",
"@install",
"The installation wizard has successfully installed <b>"+ini_get("rom_name")
);
# Set Next Text fo Exit
ini_set("text_next", "Exit");
viewbox(
"Installation Completed",
"<#080>Congratulation</#>\n\n"+
"Please press Exit and Reboot your HD2",
"icons/info"
);
Detailed rundown of process.
Aroma config copies all pertinent files to /aroma config.
Choices are made by user in aroma installer, specified mount script is run and nativesd.sh is executed as long as an install type is chosen.
Nativesd.sh reads the install type and bootloader and modifies the nand ramdisk accordingly, mkbootimg.sh is run if using clk.
Updater-script then runs - it has been stripped down so all it should do is the copying of all the other ROM stuff from the zip (system, sdcard, etc.), runs a script to copy initrd and zImage to /boot (if using magldr). Should theoretically be able to strip updater-script down further...
Attached is the modification for SlimKat - (all credits to ROM dev.)
kernel folder fully replaces the one in the ROM zip. META-INF and system are merged.
All essentially untested - will post the recovery needed for f2fs install in due course.
Edit. new zip - moved around a few things.
Edit. modified nativesd.sh on the assumption that the aroma folder can only be written to be aroma.
Code:
#!/bin/sh
export ROM_NAME=` cat 'ROM_NAME.prop' | sed 's/ROM_NAME=//g' `
export install_type=` cat 'installtype.prop' | sed 's/selected.1=//g' `
export bootloader=` cat 'nfo.prop' | sed 's/bootloader=//g' `
cp /tmp/aroma/zImage /tmp/zImage
mkdir -p /tmp/work/ing
cp /tmp/aroma/initrd.gz /tmp/initrd-test.gz
cd /tmp/work/ing
# unzipping nand kernel
gzip -d -c ../initrd-test.gz | cpio -i -d
mkdir bin
cd ..
cp /tmp/aroma/busybox ing/bin/busybox
cp /tmp/aroma/e2fsck ing/bin/e2fsck
chmod 0777 ing/bin/busybox
chmod 0777 ing/bin/e2fsck
# Modifying ramdisk to not use yaffs, and use sd partitions instead.
if [ "${install_type}" -gt 2 ]; then
sed -i '/[email protected]/s/^/#/' ing/ueventd.htcleo.rc
sed -i '/mount yaffs2/s/^/#/
s/# #/# /g' ing/init.rc
sed -i "s/rOm/$ROM_NAME/g" ing/mountfs${install_type}.sh
sed -i 's/auto/ext4/g' ing/mountfs${install_type}.sh
fi
# Checking if anything other than nand is to be installed
if [ "${install_type}" -gt 1 ]; then
sed -i '/on fs/ a exec /mountfs'${install_type}'.sh' ing/init.rc
cp /tmp/aroma/mountfs${install_type}.sh ing/mountfs${install_type}.sh
sed -i "s/rOm/$ROM_NAME/g" ing/mountfs${install_type}.sh
chmod 0777 ing/mountfs${install_type}.sh
chmod 0750 ing/init.rc
chmod 0644 ing/ueventd.htcleo.rc
fi
# Building new ramdisk
cd ing
find .| cpio -o -H newc | gzip -9 > ../initrd-done.gz
cd ..
# Checking bootloader
if [ "${bootloader}" != "cLK" ]; then
cp /tmp/aroma/6MB /tmp/work/6MB
cat initrd-done.gz >> 6MB
cp 6MB initrd6MB.gz
else
cp initrd-done.gz /tmp/initrd.gz
cp /tmp/aroma/mkbootimg /tmp/mkbootimg
cp /tmp/aroma/mkbootimg.sh /tmp/mkbootimg.sh
chmod 0755 /tmp/mkbootimg
chmod 0755 /tmp/mkbootimg.sh
exec /tmp/mkbootimg.sh
fi
#Checking if nand install
if [ "${install_type}" -lt 3 ]; then
cp initrd6MB.gz tmp/initrd.gz
else
cp initrd6MB.gz boot/initrd.gz
cp initrd6MB.gz boot_dir/initrd.gz
cp /tmp/zImage boot/zImage
cp /tmp/zImage boot_dir/zImage
fi
# Copying tmp and open ramdisk folders to sdcard (NativeSD folder)
mkdir -p boot/tmp
cp -r /tmp/* /boot/tmp/
Edit - f2fs arm binaries (v.1.2) I build are found here => http://ubuntuone.com/3EuJUW5lV9MMj1WJzhzFYo for those that know what to do with them. New zip added.
Attached is a zip that should do all the rest.
It needs to be flashed directly following a ROM with the modifications in #1
It makes us of /system/build.prop and /boot_dir, as well as /boot (and sboot if clk booting Native/DirectSD).
Contents of nativesd.sh if you're curious (was contemplating whether to make this (or a derivative thereof) into a binary and bundle it with a recovery):
Code:
#!/sbin/sh
## Bootloader check (copy of checksys.sh)
echo "bootloader=MAGLDR" > /tmp/nfo.prop
output=`grep -i "clk" /proc/cmdline`
if [ -n "$output" ]; then
echo "bootloader=cLK" > /tmp/nfo.prop
fi
[COLOR="Red"]###Should remove this haret stuff and treat it as if it's magldr...[/COLOR]
output=`grep -i "haret" /proc/cmdline`
if [ -n "$output" ]; then
echo "bootloader=HaRet" > /tmp/nfo.prop
fi
## Exporting variables
ROM_NAME=` cat /system/build.prop | grep ro.build.display.id | awk '{print $(NF-1)}' | sed 's/\(\[\|\]\)//g' `
type=` cat /system/build.prop | grep ro.build.display.id | awk '{print $(NF)}' | sed 's/\(\[\|\]\)//g' `
bootloader=` cat '/tmp/nfo.prop' | sed 's/bootloader=//g' `
## Ending if bootloader is haret
if $bootloader='HaRet' then
echo 'This does not currently work with HaRet (for now)'
exit 0
fi
## Changing install_type to numbered value
if $type='NAND' then
install_type='1'
fi
if $type='DataOnExt' then
install_type='2'
fi
if $type='NativeSD' then
install_type='3'
fi
if $type='DirectSD' then
install_type='4'
fi
## Copying zImage from /boot_dir if one wasn't added to zip
if [ ! -f "/tmp/zImage" ]; then
cp /boot_dir/zImage/ /tmp/zImage
fi
if [ ! -f "/tmp/zImage" ]; then
cp /boot_dir/initrd.gz/ /tmp/initrd.gz
fi
## Checking if zImage is for 3.0.x
if [ "md5sum /tmp/zImage | cut -d ' ' -f '1'" != "1cb7bcf80845f0178b99f7b9a5f80669" ]
then
rm /tmp/6MB
fi
## Setting up working directory
cp /tmp/initrd.gz /tmp/initrd-$ROM_NAME.gz
mkdir -p /tmp/work
cd /tmp/work
## Unzipping nand kernel
gzip -d -c ../initrd-$ROM_NAME.gz | cpio -i -d
mkdir bin
cp /tmp/busybox bin/busybox
cp /tmp/e2fsck bin/e2fsck
cp /tmp/mountfs-${install}.sh mountfs-${install}.sh
chmod 0777 mountfs${install}.sh
chmod 0777 bin/busybox
chmod 0777 bin/e2fsck
## Modifying ramdisk to not use yaffs, and use sd partitions instead.
if [ "${install_type}" -gt 2 ]; then
sed -i '/[email protected]/s/^/#/' ueventd.htcleo.rc
sed -i '/mount yaffs2/s/^/#/
s/# #/# /g' init.rc
sed -i "s/rOm/$ROM_NAME/g" mountfs-${install}.sh
fi
## Checking if anything other than nand is to be installed
if [ "${install_type}" -gt 1 ]; then
sed -i '/on fs/ a exec /mountfs-'${install}'.sh' init.rc
sed -i "s/rOm/$ROM_NAME/g" mountfs-${install}.sh
chmod 0750 init.rc
chmod 0644 ueventd.htcleo.rc
fi
# Building new ramdisk
find .| cpio -o -H newc | gzip -9 > ../initrd-done.gz
cd ..
# Checking bootloader
if [ "${bootloader}" != "cLK" ]; then
cat initrd-done.gz >> 6MB
cp 6MB /boot/initrd.gz
cp /tmp/zImage /boot/zImage
#Checking if nand install
if [ "${install_type}" -gt 2 ]; then
cp 6MB /boot_dir/initrd.gz
cp /tmp/zImage /boot_dir/zImage
fi
else
cp initrd-done.gz /tmp/initrd.gz
chmod 0755 /tmp/mkbootimg
chmod 0755 /tmp/mkbootimg.sh
exec /tmp/mkbootimg.sh
if [ "${install_type}" -lt 3 ]; then
flash_image boot /tmp/boot.img else
flash_image sboot /tmp/boot.img
fi
fi
cp /tmp/initrd-$ROM_NAME.gz /tmp/initrd.gz
rm -r /tmp/work/*
There are likely some issues. Feel free to report back.
A few things (more of use for devs I suppose): adding an initrd.gz or zImage into the zip will overwrite the one used by the previously installed ROM.
Also the only way I could come up for checking if the kernel is 3.0.x or not (and thus need the 6MB magldr offset) is using md5sum, obviously this means that this md5sum check will need to be changed for every kernel (I suppose unless there's isn't any other option I could make a whitelisted md5sum file for 3.0.x kernels and/or have devs post md5sums with there kernels).
As it is the zip attached should work with all 2.x kernels and the kernel with md5sum of 1cb7bcf80845f0178b99f7b9a5f80669.
(NB. Device died again before testing - could anyone post/PM the outcome of md5sum for any file i.e. 'md5sum /system/build.prop' - as I'm not sure if just the md5sum is outputted of if the filename is as well.)
For the moment this should work as is with cLK/magldr for DirectSD and NativeSD (need to fix for NAND/DataOnExt).
If you want use NAND/DataOnExt then add the NAND initrd.gz from desired ROM into the install folder of the zip.
NB NAND install on magldr will need a boot partion of 7.5MB (8 to be safe) - when the script is fixed that is.
Legacy
Updater-script
Code:
###
#
# AROMA Installer
# (C) 2011-2012 by Ahmad Amarullah
# amarullz - xda-developers
#
###
#
# AROMA Installer Script for
# (C) 2012-2013 by tytung - xda-developers (tytung @ gmail.com)
#
###
ui_print("------------------------------------------------");
ui_print(" ");
ui_print(" ");
ui_print("------------------------------------------------");
################
# NAND Install #
################
if file_getprop("/tmp/aroma/installtype.prop", "selected.1") == "1" then
ui_print("@ Installing to NAND...");
ui_print(" Mounting NAND partitions...");
format("yaffs2", "MTD", "system");
mount("yaffs2", "MTD", "system", "/system");
mount("yaffs2", "MTD", "userdata", "/data");
# Wipe Dalvik-Cache
if file_getprop("/tmp/aroma/mods.prop", "selected.4") == "1" then
delete_recursive("/data/dalvik-cache");
ui_print(" Dalvik-Cache wiped.");
endif;
# Wipe Data/Factory Reset
if file_getprop("/tmp/aroma/mods.prop", "selected.4") == "2" then
unmount("/data");
format("yaffs2", "MTD", "userdata");
mount("yaffs2", "MTD", "userdata", "/data");
delete_recursive("/sdcard/.android_secure");
ui_print(" Data wiped.");
endif;
show_progress(0.9, 1400);
ui_print(" Copying files...");
package_extract_dir("system", "/system");
package_extract_dir("data", "/data");
package_extract_dir("mods/nand", "/sdcard");
show_progress(0.1, 5);
endif;
#####################
# DataOnEXT Install #
#####################
if file_getprop("/tmp/aroma/installtype.prop", "selected.1") == "2" then
ui_print("@ Installing to NAND and SD-EXT...");
ui_print(" Mounting NAND and SD-EXT partitions...");
package_extract_file("kernel/mount_DataOnEXT.sh", "/tmp/mount_DataOnEXT.sh");
set_perm(0, 0, 0777, "/tmp/mount_DataOnEXT.sh");
run_program("/tmp/mount_DataOnEXT.sh");
if file_getprop("/tmp/nfo.prop", "DataOnEXT") == "true" then
format("yaffs2", "MTD", "system");
mount("yaffs2", "MTD", "system", "/system");
# Wipe Dalvik-Cache
if file_getprop("/tmp/aroma/mods.prop", "selected.4") == "1" then
delete_recursive("/data/dalvik-cache");
ui_print(" Dalvik-Cache wiped.");
endif;
# Wipe Data/Factory Reset
if file_getprop("/tmp/aroma/mods.prop", "selected.4") == "2" then
delete_recursive("/data");
delete_recursive("/sdcard/.android_secure");
ui_print(" Data wiped.");
endif;
show_progress(0.9, 1400);
ui_print(" Copying files...");
package_extract_dir("system", "/system");
package_extract_dir("data", "/data");
package_extract_dir("mods/data2ext", "/sdcard");
show_progress(0.1, 5);
# Append " [DataOnEXT]" to the ROM name
package_extract_file("mods/set_build_prop_DataOnEXT.sh", "/tmp/set_build_prop_DataOnEXT.sh");
set_perm(0, 0, 0777, "/tmp/set_build_prop_DataOnEXT.sh");
run_program("/tmp/set_build_prop_DataOnEXT.sh");
endif;
endif;
#####################################
# NAND MAGLDR or cLK Kernel install #
#####################################
if file_getprop("/tmp/aroma/kernel.prop", "NAND") == "yes" then
# check bootloader
package_extract_file("kernel/checksys.sh", "/tmp/checksys.sh");
set_perm(0, 0, 755, "/tmp/checksys.sh");
run_program("/tmp/checksys.sh");
if file_getprop("/tmp/nfo.prop", "bootloader") == "cLK" then
ui_print("@ cLK Bootloader found.");
ui_print(" Flashing cLK kernel...");
# not mounted but just in case :)
unmount("/boot");
assert(
package_extract_file("kernel/zImage", "/tmp/zImage"),
package_extract_file("kernel/mkbootimg", "/tmp/mkbootimg"),
package_extract_file("kernel/mkbootimg.sh", "/tmp/mkbootimg.sh"));
set_perm(0, 0, 0755, "/tmp/mkbootimg");
set_perm(0, 0, 0755, "/tmp/mkbootimg.sh");
assert(
run_program("/tmp/mkbootimg.sh"),
write_raw_image("/tmp/boot.img", "boot"),
delete("/tmp/boot.img"));
else
ui_print("@ MAGLDR Bootloader found.");
ui_print(" Flashing MAGLDR kernel...");
# prepare boot partition
format("yaffs2", "MTD", "boot");
mount("yaffs2", "MTD", "boot", "/boot");
package_extract_file("kernel/zImage", "/boot/zImage");
endif;
endif;
####################
# NativeSD Install #
####################
if file_getprop("/tmp/aroma/installtype.prop", "selected.1") == "3" then
ui_print("@ Installing to SD-EXT (NativeSD)...");
ui_print(" Checking & Mounting SD-EXT Partition...");
package_extract_file("kernel/mount_NativeSD.sh", "/tmp/mount_NativeSD.sh");
set_perm(0, 0, 0777, "/tmp/mount_NativeSD.sh");
run_program("/tmp/mount_NativeSD.sh");
if file_getprop("/tmp/nfo.prop", "NativeSD") == "true" then
# Wipe Dalvik-Cache
if file_getprop("/tmp/aroma/mods.prop", "selected.4") == "1" then
delete_recursive("/data/dalvik-cache");
ui_print(" Dalvik-Cache wiped.");
endif; # Wipe Dalvik-Cache
# Wipe Data/Factory Reset
if file_getprop("/tmp/aroma/mods.prop", "selected.4") == "2" then
delete_recursive("/data");
ui_print(" Data wiped.");
endif; # Wipe Data/Factory Reset
show_progress(0.9, 1400);
ui_print(" Copying files...");
package_extract_file("kernel/zImage", "/boot/zImage");
package_extract_file("kernel/zImage", "/boot_dir/zImage");
package_extract_dir("sdcard", "/sdcard");
package_extract_dir("mods/nativesd", "/sdcard");
package_extract_dir("system", "/system");
package_extract_dir("data", "/data");
package_extract_file("mods/app/NativeSDBoot.apk", "/system/app/NativeSDBoot.apk");
show_progress(0.1, 5);
# Append " [NativeSD]" to the ROM name
package_extract_file("mods/set_build_prop_NativeSD.sh", "/tmp/set_build_prop_NativeSD.sh");
set_perm(0, 0, 0777, "/tmp/set_build_prop_NativeSD.sh");
run_program("/tmp/set_build_prop_NativeSD.sh");
endif;
endif;
####################
# DirectSD Install #
####################
if file_getprop("/tmp/aroma/installtype.prop", "selected.1") == "4" || file_getprop("/tmp/aroma/installtype.prop", "selected.1") == "5" then
ui_print("@ Installing to SD-EXT (DirectSD)...");
ui_print(" Checking & Mounting SD-EXT Partition...");
package_extract_file("kernel/mount_DirectSD.sh", "/tmp/mount_DirectSD.sh");
set_perm(0, 0, 0777, "/tmp/mount_DirectSD.sh");
run_program("/tmp/mount_DirectSD.sh");
if file_getprop("/tmp/nfo.prop", "DirectSD") == "true" then
# Wipe Dalvik-Cache
if file_getprop("/tmp/aroma/mods.prop", "selected.4") == "1" then
delete_recursive("/data/dalvik-cache");
ui_print(" Dalvik-Cache wiped.");
endif; # Wipe Dalvik-Cache
# Wipe Data/Factory Reset
if file_getprop("/tmp/aroma/mods.prop", "selected.4") == "2" then
delete_recursive("/data");
ui_print(" Data wiped.");
endif; # Wipe Data/Factory Reset
show_progress(0.9, 1400);
ui_print(" Copying files...");
package_extract_file("kernel/zImage", "/boot/zImage");
package_extract_file("kernel/zImage", "/boot_dir/zImage");
package_extract_dir("sdcard", "/sdcard");
package_extract_dir("mods/DirectSD", "/sdcard");
package_extract_dir("system", "/system");
package_extract_dir("data", "/data");
package_extract_file("mods/app/DirectSDBoot.apk", "/system/app/DirectSDBoot.apk");
show_progress(0.1, 5);
# Append " [DirectSD]" to the ROM name
package_extract_file("mods/set_build_prop_DirectSD.sh", "/tmp/set_build_prop_DirectSD.sh");
set_perm(0, 0, 0777, "/tmp/set_build_prop_DirectSD.sh");
run_program("/tmp/set_build_prop_DirectSD.sh");
endif;
endif;
########################
# Connection Selection #
########################
set_progress(0.65);
if file_getprop("/tmp/aroma/mods.prop", "selected.1") == "1" then
delete("/system/ppp");
delete("/system/default.prop");
delete("/system/etc/init.d/97ppp");
ui_print("@ RMNET installed.");
endif;
if file_getprop("/tmp/aroma/mods.prop", "selected.1") == "2" then
package_extract_dir("mods/clk-ppp-patch", "/system");
ui_print("@ PPP installed.");
endif;
######################
# Softkeys Selection #
######################
ui_print("@ Setting Softkeys...");
if file_getprop("/tmp/aroma/mods.prop", "selected.2") == "1" then
package_extract_file("mods/enable_softkeys.sh", "/tmp/enable_softkeys.sh");
set_perm(0, 0, 755, "/tmp/enable_softkeys.sh");
run_program("/tmp/enable_softkeys.sh");
ui_print(" Softkeys enabled.");
endif;
if file_getprop("/tmp/aroma/mods.prop", "selected.2") == "2" then
package_extract_file("mods/disable_softkeys.sh", "/tmp/disable_softkeys.sh");
set_perm(0, 0, 755, "/tmp/disable_softkeys.sh");
run_program("/tmp/disable_softkeys.sh");
ui_print(" Softkeys disabled.");
endif;
########################
# SWAPPING Selection #
########################
if file_getprop("/tmp/aroma/mods.prop","selected.3") == "1" then
ui_print("@ Configuring Ram Pages Swapping...");
package_extract_file("mods/swap-partition-activator/install/installswap.sh", "/tmp/installswap.sh");
set_perm(0, 0, 0777, "/tmp/installswap.sh");
run_program("/tmp/installswap.sh");
if ( file_getprop("/tmp/hardswap.prop", "swap.present") == "yes" )
then
if ( file_getprop("/tmp/hardswap.prop", "swap.formatted") == "yes" ) then
ui_print(" Swap partition formatted.");
else
ui_print(" Error: Can't format existing swap partition!");
abort(" Aborting...");
endif;
else
ui_print(" Error: No swap partition found on SDcard!");
abort(" Aborting...");
endif;
# We're ready for the startup script to do ./swapon
package_extract_dir("mods/swap-partition-activator/etc", "/system/etc");
set_perm(0, 0, 0755, "/system/etc/init.d/99swap");
ui_print(" Swap-on script copied to /etc/init.d.");
endif;
if file_getprop("/tmp/aroma/mods.prop", "selected.3") == "2" then
ui_print(" Removing swap...");
delete("/system/etc/init.d/99swap");
ui_print(" Swap startup script deleted.");
endif;
###################
# Data apps check #
###################
set_progress(0.85);
package_extract_file("mods/check_data_apps.sh", "/tmp/check_data_apps.sh");
set_perm(0, 0, 0777, "/tmp/check_data_apps.sh");
run_program("/tmp/check_data_apps.sh");
################################
# ROM Symlinks and Permissions #
################################
ui_print("@ Setting symlinks and permissions...");
ui_print(" Setting symlinks...");
symlink("../xbin/su", "/system/bin/su");
symlink("Roboto-Bold.ttf", "/system/fonts/DroidSans-Bold.ttf");
symlink("Roboto-Regular.ttf", "/system/fonts/DroidSans.ttf");
symlink("busybox", "/system/xbin/[", "/system/xbin/[[",
"/system/xbin/adjtimex", "/system/xbin/arp", "/system/xbin/ash",
"/system/xbin/awk", "/system/xbin/base64", "/system/xbin/basename",
"/system/xbin/bbconfig", "/system/xbin/blkid", "/system/xbin/blockdev",
"/system/xbin/brctl", "/system/xbin/bunzip2", "/system/xbin/bzcat",
"/system/xbin/bzip2", "/system/xbin/cal", "/system/xbin/cat",
"/system/xbin/catv", "/system/xbin/chattr", "/system/xbin/chgrp",
"/system/xbin/chmod", "/system/xbin/chown", "/system/xbin/chroot",
"/system/xbin/clear", "/system/xbin/cmp", "/system/xbin/comm",
"/system/xbin/cp", "/system/xbin/cpio", "/system/xbin/crond",
"/system/xbin/crontab", "/system/xbin/cut", "/system/xbin/date",
"/system/xbin/dc", "/system/xbin/dd", "/system/xbin/depmod",
"/system/xbin/devmem", "/system/xbin/df", "/system/xbin/diff",
"/system/xbin/dirname", "/system/xbin/dmesg", "/system/xbin/dnsd",
"/system/xbin/dos2unix", "/system/xbin/du", "/system/xbin/echo",
"/system/xbin/ed", "/system/xbin/egrep", "/system/xbin/env",
"/system/xbin/expand", "/system/xbin/expr", "/system/xbin/false",
"/system/xbin/fbsplash", "/system/xbin/fdisk", "/system/xbin/fgrep",
"/system/xbin/find", "/system/xbin/flash_lock",
"/system/xbin/flash_unlock", "/system/xbin/flashcp",
"/system/xbin/flock", "/system/xbin/fold", "/system/xbin/free",
"/system/xbin/freeramdisk", "/system/xbin/fstrim", "/system/xbin/fsync",
"/system/xbin/ftpget", "/system/xbin/ftpput", "/system/xbin/fuser",
"/system/xbin/getopt", "/system/xbin/grep", "/system/xbin/groups",
"/system/xbin/gunzip", "/system/xbin/gzip", "/system/xbin/halt",
"/system/xbin/head", "/system/xbin/hexdump", "/system/xbin/id",
"/system/xbin/ifconfig", "/system/xbin/inetd", "/system/xbin/insmod",
"/system/xbin/install", "/system/xbin/ionice", "/system/xbin/iostat",
"/system/xbin/ip", "/system/xbin/kill", "/system/xbin/killall",
"/system/xbin/killall5", "/system/xbin/less", "/system/xbin/ln",
"/system/xbin/losetup", "/system/xbin/ls", "/system/xbin/lsattr",
"/system/xbin/lsmod", "/system/xbin/lsusb", "/system/xbin/lzcat",
"/system/xbin/lzma", "/system/xbin/lzop", "/system/xbin/lzopcat",
"/system/xbin/man", "/system/xbin/md5sum", "/system/xbin/mesg",
"/system/xbin/mkdir", "/system/xbin/mke2fs", "/system/xbin/mkfifo",
"/system/xbin/mkfs.ext2", "/system/xbin/mkfs.vfat",
"/system/xbin/mknod", "/system/xbin/mkswap", "/system/xbin/mktemp",
"/system/xbin/modinfo", "/system/xbin/modprobe", "/system/xbin/more",
"/system/xbin/mount", "/system/xbin/mountpoint", "/system/xbin/mpstat",
"/system/xbin/mv", "/system/xbin/nanddump", "/system/xbin/nandwrite",
"/system/xbin/nbd-client", "/system/xbin/netstat", "/system/xbin/nice",
"/system/xbin/nohup", "/system/xbin/nslookup", "/system/xbin/ntpd",
"/system/xbin/od", "/system/xbin/patch", "/system/xbin/pgrep",
"/system/xbin/pidof", "/system/xbin/ping", "/system/xbin/pipe_progress",
"/system/xbin/pkill", "/system/xbin/pmap", "/system/xbin/poweroff",
"/system/xbin/printenv", "/system/xbin/printf", "/system/xbin/ps",
"/system/xbin/pstree", "/system/xbin/pwd", "/system/xbin/pwdx",
"/system/xbin/rdev", "/system/xbin/readlink", "/system/xbin/realpath",
"/system/xbin/renice", "/system/xbin/reset", "/system/xbin/resize",
"/system/xbin/rev", "/system/xbin/rm", "/system/xbin/rmdir",
"/system/xbin/rmmod", "/system/xbin/route", "/system/xbin/run-parts",
"/system/xbin/rx", "/system/xbin/sed", "/system/xbin/seq",
"/system/xbin/setconsole", "/system/xbin/setserial",
"/system/xbin/setsid", "/system/xbin/sh", "/system/xbin/sha1sum",
"/system/xbin/sha256sum", "/system/xbin/sha3sum",
"/system/xbin/sha512sum", "/system/xbin/sleep", "/system/xbin/sort",
"/system/xbin/split", "/system/xbin/stat", "/system/xbin/strings",
"/system/xbin/stty", "/system/xbin/sum", "/system/xbin/swapoff",
"/system/xbin/swapon", "/system/xbin/sync", "/system/xbin/sysctl",
"/system/xbin/tac", "/system/xbin/tail", "/system/xbin/tar",
"/system/xbin/taskset", "/system/xbin/tee", "/system/xbin/telnet",
"/system/xbin/telnetd", "/system/xbin/test", "/system/xbin/tftp",
"/system/xbin/tftpd", "/system/xbin/time", "/system/xbin/timeout",
"/system/xbin/top", "/system/xbin/touch", "/system/xbin/tr",
"/system/xbin/traceroute", "/system/xbin/true", "/system/xbin/ttysize",
"/system/xbin/tune2fs", "/system/xbin/umount", "/system/xbin/uname",
"/system/xbin/uncompress", "/system/xbin/unexpand", "/system/xbin/uniq",
"/system/xbin/unix2dos", "/system/xbin/unlzma", "/system/xbin/unlzop",
"/system/xbin/unxz", "/system/xbin/unzip", "/system/xbin/uptime",
"/system/xbin/usleep", "/system/xbin/uudecode", "/system/xbin/uuencode",
"/system/xbin/vi", "/system/xbin/watch", "/system/xbin/wc",
"/system/xbin/wget", "/system/xbin/which", "/system/xbin/whoami",
"/system/xbin/xargs", "/system/xbin/xz", "/system/xbin/xzcat",
"/system/xbin/yes",
"/system/xbin/zcat");
symlink("libGLESv2.so", "/system/lib/libGLESv3.so");
symlink("mksh", "/system/bin/sh");
symlink("toolbox", "/system/bin/cat", "/system/bin/chcon",
"/system/bin/chmod", "/system/bin/chown", "/system/bin/clear",
"/system/bin/cmp", "/system/bin/cp", "/system/bin/date",
"/system/bin/dd", "/system/bin/df", "/system/bin/dmesg",
"/system/bin/du", "/system/bin/getenforce", "/system/bin/getevent",
"/system/bin/getprop", "/system/bin/getsebool", "/system/bin/grep",
"/system/bin/hd", "/system/bin/id", "/system/bin/ifconfig",
"/system/bin/iftop", "/system/bin/insmod", "/system/bin/ioctl",
"/system/bin/ionice", "/system/bin/kill", "/system/bin/ln",
"/system/bin/load_policy", "/system/bin/log", "/system/bin/ls",
"/system/bin/lsmod", "/system/bin/lsof", "/system/bin/md5",
"/system/bin/mkdir", "/system/bin/mkswap", "/system/bin/mount",
"/system/bin/mv", "/system/bin/nandread", "/system/bin/netstat",
"/system/bin/newfs_msdos", "/system/bin/notify", "/system/bin/printenv",
"/system/bin/ps", "/system/bin/r", "/system/bin/readlink",
"/system/bin/renice", "/system/bin/restorecon", "/system/bin/rm",
"/system/bin/rmdir", "/system/bin/rmmod", "/system/bin/route",
"/system/bin/runcon", "/system/bin/schedtop", "/system/bin/sendevent",
"/system/bin/setconsole", "/system/bin/setenforce",
"/system/bin/setprop", "/system/bin/setsebool", "/system/bin/sleep",
"/system/bin/smd", "/system/bin/start", "/system/bin/stop",
"/system/bin/swapoff", "/system/bin/swapon", "/system/bin/sync",
"/system/bin/top", "/system/bin/touch", "/system/bin/umount",
"/system/bin/uptime", "/system/bin/vmstat", "/system/bin/watchprops",
"/system/bin/wipe");
ui_print(" Setting permissions...");
set_perm_recursive(0, 0, 0755, 0644, "/system");
set_perm_recursive(0, 0, 0755, 0755, "/system/addon.d");
set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
set_perm(0, 3003, 02750, "/system/bin/netcfg");
set_perm(0, 0, 0755, "/system/bin/ping");
set_perm(0, 2000, 0750, "/system/bin/run-as");
set_perm(1014, 2000, 0550, "/system/etc/dhcpcd/dhcpcd-run-hooks");
set_perm_recursive(0, 2000, 0755, 0755, "/system/etc/init.d");
set_perm(0, 0, 0755, "/system/etc/init.d");
set_perm_recursive(0, 2000, 0755, 0644, "/system/vendor");
set_perm(0, 0, 0644, "/system/vendor/etc/audio_effects.conf");
set_perm_recursive(0, 0, 0755, 0644, "/system/vendor/firmware");
set_perm(0, 2000, 0755, "/system/vendor/firmware");
set_perm(0, 0, 0644, "/system/vendor/lib/libbt-vendor.so");
set_perm_recursive(0, 2000, 0755, 0755, "/system/xbin");
set_perm(0, 0, 06755, "/system/xbin/librank");
set_perm(0, 0, 06755, "/system/xbin/procmem");
set_perm(0, 0, 06755, "/system/xbin/procrank");
set_perm(0, 0, 06755, "/system/xbin/su");
symlink("/system/vendor/firmware/fw_bcm4329.bin", "/system/etc/firmware/fw_bcm4329.bin");
symlink("/system/vendor/firmware/fw_bcm4329_apsta.bin", "/system/etc/firmware/fw_bcm4329_apsta.bin");
set_perm_recursive(0, 1001, 0755, 0775, "/system/etc/ppp");
set_perm(0, 0, 04755, "/system/bin/pppd");
set_perm(0, 3003, 02750, "/system/bin/netcfg");
set_perm(0, 3004, 02755, "/system/bin/ping");
set_perm(0, 2000, 06750, "/system/bin/run-as");
set_perm(1002, 1002, 0440, "/system/etc/dbus.conf");
set_perm(1014, 2000, 0550, "/system/etc/dhcpcd/dhcpcd-run-hooks");
set_perm_recursive(0, 2000, 0755, 0644, "/system/vendor");
set_perm(0, 2000, 0755, "/system/vendor/lib");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
ui_print(" Symlinks and permissions done.");
###############
# Cleaning up #
###############
set_progress(0.95);
ui_print("@ Cleaning up...");
delete("/tmp");
ui_print(" Unmounting...");
unmount("/boot");
unmount("/system");
unmount("/data");
unmount("/DirectSD");
ui_print(" Done.");
set_progress(1.0);
ui_print("@ Installation Complete");[/hide]
mountfs2.sh
Code:
#!/bin/busybox sh
# wait for 2nd partition ready
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
# check the ext4 fs
/bin/e2fsck -p /dev/block/mmcblk0p2 > /e2fsck.log
# mount the 1st (NativeSD) SD-EXT partition
/bin/busybox mkdir -p /NativeSD
/bin/busybox mount -t auto -o ro,noatime,nodiratime,barrier=0 /dev/block/mmcblk0p2 /NativeSD
# mount the system data app dir
/bin/busybox mount --bind /NativeSD/rOm/data /data
# cleanup
# delete /bin to free ram
/bin/busybox rm -rf /bin[/hide]
mountfs5.sh
Code:
#!/bin/busybox sh
# wait for 2nd partition ready
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
# check the ext4 fs
/bin/e2fsck -p /dev/block/mmcblk0p2 > /e2fsck.log
# mount the 1st (NativeSD) SD-EXT partition
/bin/busybox mkdir -p /DirectSystem
/bin/busybox mkdir -p /DirectData
/bin/busybox mount -t auto -o ro,noatime,nodiratime,barrier=0 /dev/block/mmcblk0p2 /DirectSystem
/bin/busybox mount -t f2fs -o noatime,nodiratime,nosuid,nodev,discard /dev/block/mmcblk0p3 /DirectData
# mount the system data app dir
/bin/busybox mount --bind /DirectSystem/rOm/system /system
/bin/busybox mount --bind /DirectData/rOm/data /data
# cleanup
# delete /bin to free ram
/bin/busybox rm -rf /bin
[/hide]
Great ...
HypoTurtle said:
Updater-script
Code:
###
#
# AROMA Installer
# (C) 2011-2012 by Ahmad Amarullah
# amarullz - xda-developers
#
###
#
# AROMA Installer Script for
# (C) 2012-2013 by tytung - xda-developers (tytung @ gmail.com)
#
###
ui_print("------------------------------------------------");
ui_print(" ");
ui_print(" ");
ui_print("------------------------------------------------");
am("/tmp/check_data_apps.sh");
################################
# ROM Symlinks and Permissions #
################################
ui_print("@ Setting symlinks and permissions...");
ui_print(" Setting symlinks...");
symlink("../xbin/su", "/system/bin/su");
symlink("Roboto-Bold.ttf", "/system/fonts/DroidSans-Bold.ttf");
symlink("Roboto-Regular.ttf", "/system/fonts/DroidSans.ttf");
symlink("busybox", "/system/xbin/[", "/system/xbin/[[",
"/system/xbin/adjtimex", "/system/xbin/arp", "/system/xbin/ash",
"/system/xbin/awk", "/system/xbin/base64", "/system/xbin/basename",
"/system/xbin/bbconfig", "/system/xbin/blkid", "/system/xbin/blockdev",
"/system/xbin/brctl", "/system/xbin/bunzip2", "/system/xbin/bzcat",
"/system/xbin/bzip2", "/system/xbin/cal", "/system/xbin/cat",
"/system/xbin/catv", "/system/xbin/chattr", "/system/xbin/chgrp",
"/system/xbin/chmod", "/system/xbin/chown", "/system/xbin/chroot",
"/system/xbin/clear", "/system/xbin/cmp", "/system/xbin/comm",
"/system/xbin/cp", "/system/xbin/cpio", "/system/xbin/crond",
"/system/xbin/crontab", "/system/xbin/cut", "/system/xbin/date",
"/system/xbin/dc", "/system/xbin/dd", "/system/xbin/depmod",
"/system/xbin/devmem", "/system/xbin/df", "/system/xbin/diff",
"/system/xbin/dirname", "/system/xbin/dmesg", "/system/xbin/dnsd",
"/system/xbin/dos2unix", "/system/xbin/du", "/system/xbin/echo",
"/system/xbin/ed", "/system/xbin/egrep", "/system/xbin/env",
"/system/xbin/expand", "/system/xbin/expr", "/system/xbin/false",
"/system/xbin/fbsplash", "/system/xbin/fdisk", "/system/xbin/fgrep",
"/system/xbin/find", "/system/xbin/flash_lock",
"/system/xbin/flash_unlock", "/system/xbin/flashcp",
"/system/xbin/flock", "/system/xbin/fold", "/system/xbin/free",
"/system/xbin/freeramdisk", "/system/xbin/fstrim", "/system/xbin/fsync",
"/system/xbin/ftpget", "/system/xbin/ftpput", "/system/xbin/fuser",
"/system/xbin/getopt", "/system/xbin/grep", "/system/xbin/groups",
"/system/xbin/gunzip", "/system/xbin/gzip", "/system/xbin/halt",
"/system/xbin/head", "/system/xbin/hexdump", "/system/xbin/id",
"/system/xbin/ifconfig", "/system/xbin/inetd", "/system/xbin/insmod",
"/system/xbin/install", "/system/xbin/ionice", "/system/xbin/iostat",
"/system/xbin/ip", "/system/xbin/kill", "/system/xbin/killall",
"/system/xbin/killall5", "/system/xbin/less", "/system/xbin/ln",
"/system/xbin/losetup", "/system/xbin/ls", "/system/xbin/lsattr",
"/system/xbin/lsmod", "/system/xbin/lsusb", "/system/xbin/lzcat",
"/system/xbin/lzma", "/system/xbin/lzop", "/system/xbin/lzopcat",
"/system/xbin/man", "/system/xbin/md5sum", "/system/xbin/mesg",
"/system/xbin/mkdir", "/system/xbin/mke2fs", "/system/xbin/mkfifo",
"/system/xbin/mkfs.ext2", "/system/xbin/mkfs.vfat",
"/system/xbin/mknod", "/system/xbin/mkswap", "/system/xbin/mktemp",
"/system/xbin/modinfo", "/system/xbin/modprobe", "/system/xbin/more",
"/system/xbin/mount", "/system/xbin/mountpoint", "/system/xbin/mpstat",
"/system/xbin/mv", "/system/xbin/nanddump", "/system/xbin/nandwrite",
"/system/xbin/nbd-client", "/system/xbin/netstat", "/system/xbin/nice",
"/system/xbin/nohup", "/system/xbin/nslookup", "/system/xbin/ntpd",
"/system/xbin/od", "/system/xbin/patch", "/system/xbin/pgrep",
"/system/xbin/pidof", "/system/xbin/ping", "/system/xbin/pipe_progress",
"/system/xbin/pkill", "/system/xbin/pmap", "/system/xbin/poweroff",
"/system/xbin/printenv", "/system/xbin/printf", "/system/xbin/ps",
"/system/xbin/pstree", "/system/xbin/pwd", "/system/xbin/pwdx",
"/system/xbin/rdev", "/system/xbin/readlink", "/system/xbin/realpath",
"/system/xbin/renice", "/system/xbin/reset", "/system/xbin/resize",
"/system/xbin/rev", "/system/xbin/rm", "/system/xbin/rmdir",
"/system/xbin/rmmod", "/system/xbin/route", "/system/xbin/run-parts",
"/system/xbin/rx", "/system/xbin/sed", "/system/xbin/seq",
"/system/xbin/setconsole", "/system/xbin/setserial",
"/system/xbin/setsid", "/system/xbin/sh", "/system/xbin/sha1sum",
"/system/xbin/sha256sum", "/system/xbin/sha3sum",
"/system/xbin/sha512sum", "/system/xbin/sleep", "/system/xbin/sort",
"/system/xbin/split", "/system/xbin/stat", "/system/xbin/strings",
"/system/xbin/stty", "/system/xbin/sum", "/system/xbin/swapoff",
"/system/xbin/swapon", "/system/xbin/sync", "/system/xbin/sysctl",
"/system/xbin/tac", "/system/xbin/tail", "/system/xbin/tar",
"/system/xbin/taskset", "/system/xbin/tee", "/system/xbin/telnet",
"/system/xbin/telnetd", "/system/xbin/test", "/system/xbin/tftp",
"/system/xbin/tftpd", "/system/xbin/time", "/system/xbin/timeout",
"/system/xbin/top", "/system/xbin/touch", "/system/xbin/tr",
"/system/xbin/traceroute", "/system/xbin/true", "/system/xbin/ttysize",
"/system/xbin/tune2fs", "/system/xbin/umount", "/system/xbin/uname",
"/system/xbin/uncompress", "/system/xbin/unexpand", "/system/xbin/uniq",
"/system/xbin/unix2dos", "/system/xbin/unlzma", "/system/xbin/unlzop",
"/system/xbin/unxz", "/system/xbin/unzip", "/system/xbin/uptime",
"/system/xbin/usleep", "/system/xbin/uudecode", "/system/xbin/uuencode",
"/system/xbin/vi", "/system/xbin/watch", "/system/xbin/wc",
"/system/xbin/wget", "/system/xbin/which", "/system/xbin/whoami",
"/system/xbin/xargs", "/system/xbin/xz", "/system/xbin/xzcat",
"/system/xbin/yes",
"/system/xbin/zcat");
symlink("libGLESv2.so", "/system/lib/libGLESv3.so");
symlink("mksh", "/system/bin/sh");
symlink("toolbox", "/system/bin/cat", "/system/bin/chcon",
"/system/bin/chmod", "/system/bin/chown", "/system/bin/clear",
"/system/bin/cmp", "/system/bin/cp", "/system/bin/date",
"/system/bin/dd", "/system/bin/df", "/system/bin/dmesg",
"/system/bin/du", "/system/bin/getenforce", "/system/bin/getevent",
"/system/bin/getprop", "/system/bin/getsebool", "/system/bin/grep",
"/system/bin/hd", "/system/bin/id", "/system/bin/ifconfig",
"/system/bin/iftop", "/system/bin/insmod", "/system/bin/ioctl",
"/system/bin/ionice", "/system/bin/kill", "/system/bin/ln",
"/system/bin/load_policy", "/system/bin/log", "/system/bin/ls",
"/system/bin/lsmod", "/system/bin/lsof", "/system/bin/md5",
"/system/bin/mkdir", "/system/bin/mkswap", "/system/bin/mount",
"/system/bin/mv", "/system/bin/nandread", "/system/bin/netstat",
"/system/bin/newfs_msdos", "/system/bin/notify", "/system/bin/printenv",
"/system/bin/ps", "/system/bin/r", "/system/bin/readlink",
"/system/bin/renice", "/system/bin/restorecon", "/system/bin/rm",
"/system/bin/rmdir", "/system/bin/rmmod", "/system/bin/route",
"/system/bin/runcon", "/system/bin/schedtop", "/system/bin/sendevent",
"/system/bin/setconsole", "/system/bin/setenforce",
"/system/bin/setprop", "/system/bin/setsebool", "/system/bin/sleep",
"/system/bin/smd", "/system/bin/start", "/system/bin/stop",
"/system/bin/swapoff", "/system/bin/swapon", "/system/bin/sync",
"/system/bin/top", "/system/bin/touch", "/system/bin/umount",
"/system/bin/uptime", "/system/bin/vmstat", "/system/bin/watchprops",
"/system/bin/wipe");
ui_print(" Setting permissions...");
set_perm_recursive(0, 0, 0755, 0644, "/system");
set_perm_recursive(0, 0, 0755, 0755, "/system/addon.d");
set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
set_perm(0, 3003, 02750, "/system/bin/netcfg");
set_perm(0, 0, 0755, "/system/bin/ping");
set_perm(0, 2000, 0750, "/system/bin/run-as");
set_perm(1014, 2000, 0550, "/system/etc/dhcpcd/dhcpcd-run-hooks");
set_perm_recursive(0, 2000, 0755, 0755, "/system/etc/init.d");
set_perm(0, 0, 0755, "/system/etc/init.d");
set_perm_recursive(0, 2000, 0755, 0644, "/system/vendor");
set_perm(0, 0, 0644, "/system/vendor/etc/audio_effects.conf");
set_perm_recursive(0, 0, 0755, 0644, "/system/vendor/firmware");
set_perm(0, 2000, 0755, "/system/vendor/firmware");
set_perm(0, 0, 0644, "/system/vendor/lib/libbt-vendor.so");
set_perm_recursive(0, 2000, 0755, 0755, "/system/xbin");
set_perm(0, 0, 06755, "/system/xbin/librank");
set_perm(0, 0, 06755, "/system/xbin/procmem");
set_perm(0, 0, 06755, "/system/xbin/procrank");
set_perm(0, 0, 06755, "/system/xbin/su");
symlink("/system/vendor/firmware/fw_bcm4329.bin", "/system/etc/firmware/fw_bcm4329.bin");
symlink("/system/vendor/firmware/fw_bcm4329_apsta.bin", "/system/etc/firmware/fw_bcm4329_apsta.bin");
set_perm_recursive(0, 1001, 0755, 0775, "/system/etc/ppp");
set_perm(0, 0, 04755, "/system/bin/pppd");
set_perm(0, 3003, 02750, "/system/bin/netcfg");
set_perm(0, 3004, 02755, "/system/bin/ping");
set_perm(0, 2000, 06750, "/system/bin/run-as");
set_perm(1002, 1002, 0440, "/system/etc/dbus.conf");
set_perm(1014, 2000, 0550, "/system/etc/dhcpcd/dhcpcd-run-hooks");
set_perm_recursive(0, 2000, 0755, 0644, "/system/vendor");
set_perm(0, 2000, 0755, "/system/vendor/lib");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
ui_print(" Symlinks and permissions done.");
###############
# Cleaning up #
###############
set_progress(0.95);
ui_print("@ Cleaning up...");
delete("/tmp");
ui_print(" Unmounting...");
unmount("/boot");
unmount("/system");
unmount("/data");
unmount("/DirectSD");
ui_print(" Done.");
set_progress(1.0);
ui_print("@ Installation Complete");[/hide]
mountfs2.sh
Code:
#!/bin/busybox sh
# wait for 2nd partition ready
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
# check the ext4 fs
/bin/e2fsck -p /dev/block/mmcblk0p2 > /e2fsck.log
# mount the 1st (NativeSD) SD-EXT partition
/bin/busybox mkdir -p /NativeSD
/bin/busybox mount -t auto -o ro,noatime,nodiratime,barrier=0 /dev/block/mmcblk0p2 /NativeSD
# mount the system data app dir
/bin/busybox mount --bind /NativeSD/rOm/data /data
# cleanup
# delete /bin to free ram
/bin/busybox rm -rf /bin[/hide]
mountfs5.sh
Code:
#!/bin/busybox sh
# wait for 2nd partition ready
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
# check the ext4 fs
/bin/e2fsck -p /dev/block/mmcblk0p2 > /e2fsck.log
# mount the 1st (NativeSD) SD-EXT partition
/bin/busybox mkdir -p /DirectSystem
/bin/busybox mkdir -p /DirectData
/bin/busybox mount -t auto -o ro,noatime,nodiratime,barrier=0 /dev/block/mmcblk0p2 /DirectSystem
/bin/busybox mount -t f2fs -o noatime,nodiratime,nosuid,nodev,discard /dev/block/mmcblk0p3 /DirectData
# mount the system data app dir
/bin/busybox mount --bind /DirectSystem/rOm/system /system
/bin/busybox mount --bind /DirectData/rOm/data /data
# cleanup
# delete /bin to free ram
/bin/busybox rm -rf /bin
[/hide]
Click to expand...
Click to collapse
HypoTurtle said:
Was working with RobbieP on this (as I can't test on device) - essentially aroma config for 3.0.x kernel with initrd.gz made on the fly.
Initrd mods carried out include applying: data on ext, nativesd, directsd(w/ ext4 or f2fs) to nand initrd.gz.
ROM_NAME applied from ROM_NAME.prop
6MB offset applied if bootloader is magldr
Managed to fix the nativesd.sh - it was riddled with errors:
Code:
#!/bin/sh
export ROM_NAME=` cat 'ROM_NAME.prop' | sed 's/ROM_NAME=//g' `
export install_type=` cat 'installtype.prop' | sed 's/selected.1=//g' `
export bootloader=` cat 'nfo.prop' | sed 's/bootloader=//g' `
cd /tmp/aroma
mkdir /tmp/aroma/work
cp initrd.gz initrd-test.gz
cd /tmp/aroma/work
# unzipping nand kernel and applying modifications
gzip -d -c ../initrd-test.gz | cpio -i -d
mkdir bin
cd ..
cp busybox work/bin/busybox
cp e2fsck work/bin/e2fsck
chmod 0777 work/bin/busybox
chmod 0777 work/bin/e2fsck
if [ "${install_type}" -gt 2 ]; then
sed -i '/[email protected]/s/^/#/' work/ueventd.htcleo.rc
sed -i '/mount yaffs2/s/^/#/
s/# #/# /g' work/init.rc
sed -i "s/rOm/$ROM_NAME/g" work/mountfs${install_type}.sh
sed -i 's/auto/ext4/g' work/mountfs${install_type}.sh
fi
if [ "${install_type}" -gt 1 ]; then
sed -i '/on fs/ a exec /mountfs'${install_type}'.sh' work2/init.rc
cp mountfs${install_type}.sh work/mountfs${install_type}.sh
chmod 0777 work/mountfs${install_type}.sh
chmod 0750 work/init.rc
chmod 0644 work/ueventd.htcleo.rc
fi
# making new ramdisk and copying to sd card
cd work2
find .| cpio -o -H newc | gzip -9 > ../initrd-done.gz
cd ..
if [ "${bootloader}" != "cLK" ]; then
cat initrd-done.gz >> 6MB
cp 6MB initrd6MB.gz
else
cp done2/initrd-done.gz /tmp/initrd.gz
fi
chmod 0777 initrd.gz
if [ "${install_type}" -lt 3 ]; then
cp initrd6MB.gz tmp/initrd.gz
else
cp initrd6MB.gz boot/initrd.gz
cp initrd6MB.gz boot_dir/initrd.gz
fi
# Copying tmp and open ramdisk folders to sdcard (NativeSD folder)
mkdir -p boot/tmp
Also this way if you want to add another way of booting all you need to do is create a mountfs.sh file and edit aroma-config.
aroma-config
Code:
### LICENSE:
#
# Copyright (C) 2011-2012 Ahmad Amarullah ( http://amarullz.com/ )
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
### FILE INFO:
#
# AROMA Installer from was modded by
# macs18max to include haret detection (hacked way) and
# clk nativesd sboot2. If using this please credit macs18max
#
###
##
# Forcing Device Pixelate Size
# defaut: floor( min( width, height ) / 160 )
#
ini_set("dp","3"); #-- HDPI ( 480x800 / WVGA )
##
# Initializing Rom Information
##
ini_set("rom_name", "");
ini_set("rom_version", "");
ini_set("rom_author", "");
ini_set("rom_device", "");
ini_set("rom_date", "");
##
# Show Simple Splash
# splash( 2000, "slim");
##
# Set Small Font to Support all fonts
#
fontresload( "0", "ttf/Roboto-Regular.ttf;ttf/DroidSansArabic.ttf;ttf/DroidSansFallback.ttf;", "12" ); #-- Use sets of font (Font Family)
##
# Set Language & Font Family
#
loadlang("langs/en.lang");
fontresload( "0", "ttf/Roboto-Regular.ttf", "12" ); #-- "0" = Small Font
fontresload( "1", "ttf/Roboto-Regular.ttf", "18" ); #-- "1" = Big Font
###################################################################################################################
#
# STEP 1 - SELECT THEME
#
theme("ics");
###################################################################################################################
#
# STEP 2 - SHOW ROM INFORMATION
#
# Extract ROM_NAME.prop to /tmp/aroma/ROM_NAME.prop
ziptotmp("kernel/ROM_NAME.prop", "ROM_NAME.prop");
ziptotmp("kernel/initrd.gz", "initrd.gz");
ziptotmp("kernel/busybox", "busybox");
ziptotmp("kernel/e2fsck", "e2fsck");
ziptotmp("kernel/mountfs2.sh", "mountfs2.sh");
ziptotmp("kernel/mountfs3.sh", "mountfs3.sh");
ziptotmp("kernel/mountfs4.sh", "mountfs4.sh");
ziptotmp("kernel/mountfs5.sh", "mountfs5.sh");
# [B]ADD NEW MOUNTFS HERE[/B]
ziptotmp("kernel/6MB", "6MB");
zipexec("kernel/checksys.sh");
setvar("bootloader", file_getprop("/tmp/nfo.prop", "bootloader"));
viewbox(
#-- Title
"Welcome!",
#-- Text
"You are about to install the below ROM for <b>"+ini_get("rom_device")+"</b>.\n\n"+
" ROM Name\t: <b><#selectbg_g>"+ini_get("rom_name")+"</#></b>\n"+
" Version\t: <b><#selectbg_g>"+ini_get("rom_version")+"</#></b>\n"+
" Author\t: <b><#selectbg_g>"+ini_get("rom_author")+"</#></b>\n"+
" Update\t: <b><#selectbg_g>"+ini_get("rom_date")+"</#></b>\n\n\n"+
"Bootloader\t: "+getvar("bootloader")+"\n\n"+
"System NAND\t: "+getdisksize("/system","m")+" MB\n"+
"\t Free\t: "+ getdiskfree("/system","m")+" MB\n\n"+
"Data NAND\t: "+getdisksize("/data","m")+" MB\n"+
"\t Free\t: "+ getdiskfree("/data","m")+" MB\n\n"+
"SD Card Size\t: "+getdisksize("/sdcard","m")+" MB\n"+
"\t Free\t: "+ getdiskfree("/sdcard","m")+" MB\n\n"+
" SD-EXT Size\t: "+getdisksize("/sd-ext","m")+" MB\n"+
"\t Free\t: "+ getdiskfree("/sd-ext","m")+" MB\n\n"+
"SD-EXT2 Size\t: "+getdisksize("/sd-ext2","m")+" MB\n"+
"\t Free\t: "+ getdiskfree("/sd-ext2","m")+" MB\n\n\n"+
"Press Next to Continue the Installation...",
#-- Icon
"icons/welcome"
);
###################################################################################################################
#
# STEP 3 - SHOW SELECTBOX - Install Type
#
selectbox(
#-- Title
"Install Type",
#-- Sub Title
"Please Select the install type:",
#-- Icon
"icons/apps",
#-- Will be saved in /tmp/aroma/installtype.prop
"installtype.prop",
#-- Group 1
"Install Location", "", 2, #-- Group 1. key = "selected.1"
"NAND",
"[email protected], [email protected], [email protected]\nFor T-Mobile USA HD2 (LEO 1024)", 0, #-- selected.1 = 1
"NAND with DataOnEXT",
"[email protected], [email protected], [email protected]\nFor EU/International HD2 (LEO 512)", 0, #-- selected.1 = 2
"NativeSD (Everything on the SD card)",
"[email protected], [email protected], [email protected]\nFor high speed read/write SD Card", 0, #-- selected.1 = 3
"DirectSD (Everything on the SD card)",
"[email protected], [email protected], [email protected]\nFor high speed read/write SD Card", 1 #-- selected.1 = 4
"DirectSD (Everything on the SD card)",
"[email protected], [email protected], [email protected]\nFor high speed read/write SD Card", 1 #-- selected.1 = 5
# [B]ADD NEW MOUNTFS DETAILS HERE[/B]
);
if (prop("installtype.prop", "selected.1") == "1" || prop("installtype.prop", "selected.1") == "2") then
writetmpfile("kernel.prop", "NAND=yes");
else
writetmpfile("kernel.prop", "NAND=no");
endif;
##############################
# Mount the SD-EXT partition #
##############################
if (prop("installtype.prop", "selected.1") == "2" ||
prop("installtype.prop", "selected.1") == "3") then
pleasewait("Mounting the SD-EXT Partition...");
zipexec("kernel/SD-EXT_mounter.sh");
setvar("mount_result", getvar("exec_buffer"));
if file_getprop("/tmp/mount.prop", "status") != "mounted" then
#######################
# No SD-EXT Partition #
#######################
# Set Next Text to 'Exit'
ini_set("text_next", "Exit");
textbox(
"Mounting SD-EXT failed!",
"Please create an EXT4 partition (mmcblk0p2) on the SD Card first.",
"icons/alert",
"Error messages:\n\n"+getvar("mount_result")
);
#-- Back to Menu
back("1");
endif;
endif;
if prop("installtype.prop", "selected.1") == "4" ||
prop("installtype.prop", "selected.1") == "5" then
pleasewait("Mounting the SD-EXT Partition...");
zipexec("kernel/DirectSD_mounter.sh");
setvar("mount_result", getvar("exec_buffer"));
if file_getprop("/tmp/mount.prop", "status") != "mounted" then
#######################
# No SD-EXT Partition #
#######################
# Set Next Text to 'Exit'
ini_set("text_next", "Exit");
textbox(
"Mounting SD-EXT failed!",
"Please create an EXT4 partition (mmcblk0p2) on the SD Card first.",
"icons/alert",
"Error messages:\n\n"+getvar("mount_result")
);
#-- Back to Menu
back("1");
endif;
endif;
if prop("installtype.prop", "selected.1") != ""
zipexec("kernel/nativesd.sh");
endif;
# Swap partition activation - run the check for sdcard swap partition
pleasewait("Checking SDCard for Swap Partition.");
zipexec("mods/swap-partition-activator/install/checkforswap.sh");
###################################################################################################################
#
# STEP 4 - SHOW SELECTBOX - ROM Mods
#
selectbox(
#-- Title
"ROM Mods",
#-- Sub Title
"Please Select the ROM Mods:",
#-- Icon
"icons/personalize",
#-- Will be saved in /tmp/aroma/mods.prop
"mods.prop",
#-- Group 1
"Default Connection Type","",2,
"RMNET Connection",
"Please Choose RMNET for MAGLDR bootloader.", iif((file_getprop("/tmp/nfo.prop", "bootloader") == "MAGLDR"), 1, 0),
"PPP Connection",
"All bootloaders support PPP.", iif((file_getprop("/tmp/nfo.prop", "bootloader") == "MAGLDR"), 0, 1),
#-- Group 2
"Softkeys (Navbar)","",2,
"Enable softkeys",
"Select it to enable softkeys.", 1,
"Disable softkeys",
"Select it to disable softkeys.", 0,
#-- Group 3
"Activate RAM Pages Swapping","",2,
"Yes",
"You must have a pre-made swap partition on your SDcard!", iif((file_getprop("/tmp/checkforswap.prop", "swap.present") == "yes"), 1, 0),
"No",
"Swapping will be deactivated.\n\n", iif((file_getprop("/tmp/checkforswap.prop", "swap.present") == "no"), 1, 0),
#-- Group 4
"Wipe","",2,
"Wipe Dalvik-Cache",
"Select it to wipe Dalvik-Cache.", 1,
"Wipe Data/Factory Reset",
"Select it to wipe data/factory reset.", 0,
"No Wipe",
"Select it to keep everything.", 0
);
####################
# Installation Ready
####################
ini_set("text_next", "Install Now");
viewbox(
"Installation Ready",
"The wizard is ready to begin installation.\n\n"+
"Press <b>Install Now</b> to begin the installation.\n\n"+
"If you want to review or change any of your installation settings, press <b>Back</b> or Press Menu Key -> Quit Installation to exit the wizard.",
"@install"
);
#####################
# Start Install
#####################
ini_set("text_next", "Finish");
install(
"Installing",
"<b>"+ini_get("rom_name")+"</b> is being installed.\n\n"+
"Please wait while installation wizard installs <b>"+ini_get("rom_name")+
"</b>. This may take several minutes.",
"@install",
"The installation wizard has successfully installed <b>"+ini_get("rom_name")
);
# Set Next Text fo Exit
ini_set("text_next", "Exit");
viewbox(
"Installation Completed",
"<#080>Congratulation</#>\n\n"+
"Please press Exit and Reboot your HD2",
"icons/info"
);
Click to expand...
Click to collapse
Really Great ... Thanks Man ... Just Works Perfect ... Can I use some of your Ideas for M7 development ? ... Thanks In Advance ...
With Best Wishes
Hitman1376​
hitman1376 said:
Really Great ... Thanks Man ... Just Works Perfect ... Can I use some of your Ideas for M7 development ? ... Thanks In Advance ...
With Best Wishes
Hitman1376​
Click to expand...
Click to collapse
Feel free.
What works exactly - all I know is that aroma-config runs without reporting an error and that nativesd.sh runs properly in ubuntu.
I'll post the whole bundle patch that RobbieP has been trying, so anyone can try it an report any errors.
The bundle includes:
TWRP recovery (with f2fs enabled by kokotas)
walter79's 3.0.x-pmem-marc1706 kernel with f2fs patches added
modified updater-script and aroma config
nativesd and mountfs files.
If i choose DirectSDwith/dataonext4 or DirectSDwith/dataonF2FS, i get the screen saying "Mounting SD-EXT failed-please create an EXT4 partition (mmcblk0p2) on the SD Card first"
Also the ROM_NAME.prop wrongly says "ROM_NAME=ChauTien_CM11_V1", it should be "ROM_NAME=ChauTien-Slimroms-Build4", beware if you are testing not to overwrite that ROM if you already have it installed.
F2FS works good on our HD2 from earlier tests. The kernel doesn't seem to like my uhs1 card. Have attached a couple of androbench tests on fat32 and f2fs partitions. Also some speed tests below.
MB/s Write Read
FAT32 6.1 10.18
6.37 10.47
6.26 9.47
EXT4 2.48 9.00
2.39 10.28
2.10 9.32
F2FS 6.01 10.84
4.75 9.30
6.34 7.27
This is on an 8Gb sandisk class4 (i think, the number has worn away)
I hope people can take a look at the scripts HypoTurtle has posted, to see any mistakes. I don't think any or all of the ziptotmps at the start of aroma-config are working since /tmp folder does not show them in recovery terminal after running aroma.
Robbie P said:
If i choose DirectSDwith/dataonext4 or DirectSDwith/dataonF2FS, i get the screen saying "Mounting SD-EXT failed-please create an EXT4 partition (mmcblk0p2) on the SD Card first"
Also the ROM_NAME.prop wrongly says "ROM_NAME=ChauTien_CM11_V1", it should be "ROM_NAME=ChauTien-Slimroms-Build4", beware if you are testing not to overwrite that ROM if you already have it installed.
F2FS works good on our HD2 from earlier tests. The kernel doesn't seem to like my uhs1 card. Have attached a couple of androbench tests on fat32 and f2fs partitions. Also some speed tests below.
MB/s Write Read
FAT32 6.1 10.18
6.37 10.47
6.26 9.47
EXT4 2.48 9.00
2.39 10.28
2.10 9.32
F2FS 6.01 10.84
4.75 9.30
6.34 7.27
This is on an 8Gb sandisk class4 (i think, the number has worn away)
I hope people can take a look at the scripts HypoTurtle has posted, to see any mistakes. I don't think any or all of the ziptotmps at the start of aroma-config are working since /tmp folder does not show them in recovery terminal after running aroma.
Click to expand...
Click to collapse
Thanks, RobbieP that pretty much sums up where we are.
Can you post the f2fs recovery that you are using (just in case I post the wrong one); also can you post the result of 'cat /tmp/mount.prop'
That's my bad with ROM_NAME, was working with CM11 and SlimKK, the wrong ROM_NAME.prop slipped in there. Other than overwritting ChauTien_CM11_V1 (if this thing actually ran), the ROM should still run fine as this ROM_NAME is called everywhere it needs to be i.e during install and with mountfs.sh scripts.
Reupping with a rom_name.prop for slimkat
Okay issue seems to be that the mounter scripts either aren't called properly or simply don't run...
From - aroma-config for DataOnExt and NativeSD
Code:
if (prop("installtype.prop", "selected.1") == "2" ||
prop("installtype.prop", "selected.1") == "3") then
pleasewait("Mounting the SD-EXT Partition...");
zipexec("kernel/SD-EXT_mounter.sh");
setvar("mount_result", getvar("exec_buffer"));
zipexec("kernel/nativesd.sh");
if file_getprop("/tmp/mount.prop", "status") != "mounted" then
#######################
# No SD-EXT Partition #
#######################
# Set Next Text to 'Exit'
ini_set("text_next", "Exit");
textbox(
"Mounting SD-EXT failed!",
"Please create an EXT4 partition (mmcblk0p2) on the SD Card first.",
"icons/alert",
"Error messages:\n\n"+getvar("mount_result")
);
#-- Back to Menu
back("1");
endif;
endif;
SD-EXT_mounter.sh is called
[code#!/sbin/sh
#
# NativeSD SD-EXT Mounter v1.0
# Author: tytung - xda-developers
if [ ! -d "/NativeSD" ]; then
mkdir "/NativeSD"
fi
if [ -f "/tmp/mount.prop" ]; then
rm "/tmp/mount.prop"
fi
# Mount the SD-EXT partition
mounted=`mount | grep '/dev/block/mmcblk0p2 on /NativeSD'`
if [ "$mounted" = "" ]; then
#mount -t ext4 /dev/block/mmcblk0p2 /NativeSD
mount -t auto /dev/block/mmcblk0p2 /NativeSD
fi
# `echo $?` will return 0 if mount is executed successfully
if [ `echo $?` = 0 ]; then
echo 'status=mounted' > "/tmp/mount.prop"
#else
# redirect mount failed messages to aroma-config
fi
exit 0][/code]
If DirectSD is selected DirectSD_mounter.sh is run
Code:
if (prop("installtype.prop", "selected.1") == "4" ||
prop("installtype.prop", "selected.1") == "5") then
pleasewait("Mounting the SD-EXT Partition...");
zipexec("kernel/DirectSD_mounter.sh");
setvar("mount_result", getvar("exec_buffer"));
zipexec("kernel/nativesd.sh");
if file_getprop("/tmp/mount.prop", "status") != "mounted" then
#######################
# No SD-EXT Partition #
#######################
# Set Next Text to 'Exit'
ini_set("text_next", "Exit");
textbox(
"Mounting SD-EXT failed!",
"Please create an EXT4 partition (mmcblk0p2) on the SD Card first.",
"icons/alert",
"Error messages:\n\n"+getvar("mount_result")
);
#-- Back to Menu
back("1");
endif;
endif;
DirectSD_mounter.sh
Code:
#!/sbin/sh
#
# DirectSD SD-EXT Mounter v1.0
# Author: tytung - xda-developers
if [ ! -d "/DirectSystem" ]; then
mkdir "/DirectSystem"
fi
if [ ! -d "/DirectData" ]; then
mkdir "/DirectData"
fi
if [ -f "/tmp/mount.prop" ]; then
rm "/tmp/mount.prop"
fi
# Mount the SD-EXT partition
mounted=`mount | grep '/dev/block/mmcblk0p2 on /DirectSystem'`
if [ "$mounted" = "" ]; then
mount -t auto /dev/block/mmcblk0p2 /DirectSystem
fi
# Mount the SD-EXT partition
mounted=`mount | grep '/dev/block/mmcblk0p3 on /DirectData'`
if [ "$mounted" = "" ]; then
mount -t auto /dev/block/mmcblk0p3 /DirectData
fi
# `echo $?` will return 0 if mount is executed successfully
if [ `echo $?` = 0 ]; then
echo 'status=mounted' > "/tmp/mount.prop"
#else
# redirect mount failed messages to aroma-config
fi
exit 0
Something in the above seems to be acting up.
For reference the exec_buffer variable is blank...
I just tried NativeSD install, no errors were reported, but the files were not installed. it did say that installation was successful, and the "save log" button appeared, so i saved it.
Code:
AROMA INSTALLER version 2.56
(c) 2012 by amarullz xda-developers
ROM Name : ChauTien Slimroms 4.4.2
ROM Version : Build 4
ROM Author : Chau Truong Thinh
Device : HTC HD2
Start at : Mon Jan 27 20:28:18 2014
line 13 col 1: syntax error, unexpected BAD, expecting IF or STRING or '!' or '('
1 parse errors
Installer Error (Status 6)
End at : Mon Jan 27 20:28:18 2014
I can't find which file has BAD in line 13 col 1
Unless it is a notepad++ file extension problem
In updater-script - line 138:
Code:
package_extract_file("kernel/cpboot.sh", "/tmp/cpboot.sh");
set_perm(0, 0, 755, "/tmp/cpboot.sh");
run_program("/tmp/cpboot.sh"[B])[/B]);
seems to be an extra ) , can you also add the tmp folder to see that everything else is working as it should.
did that at 138, still get the no-files-installed "successful" nativeSD installation
https://www.dropbox.com/s/pzlsv4h8a6exwec/tmp (3).zip
have attached install log, looks the same.
Edit; here is /tmp for choosing directSD, 2xEXT4 partitions https://www.dropbox.com/s/cjw6l4a4gwr7fsp/tmp6.zip
Edit2; here is /tmp for choosing directSD, 2xEXT4 partitions after reformatting both ext4 partitions using minitool AND 4ext sd recovery (Xylograph mod) then installing using same recovery. Same result "Mounting SD-EXT failed!....." https://www.dropbox.com/s/w7azkyey8fcape6/tmp7.zip
HypoTurtle said:
Thanks, RobbieP that pretty much sums up where we are.
Can you post the f2fs recovery that you are using..
Click to expand...
Click to collapse
Enormous thanks to @kokotas for compiling SD version of 2.7.0.0 twrp with f2fs support. kokotas does not own a HD2 anymore, but has done this over and above the huge contributions already made for our HD2, very much appreciated:good:
I have been using this for the past couple of weeks. There are some issues with the 3.0 kernel which it uses, such as not powering off fully (need to press reset button), but we need the 3.0 kernel to use f2fs. Please post any other bugs you may find.
To make a f2fs partition, it is necessary to format the third partition to eg FAT32 first. Then using recovery's terminal emulator;
(select the / folder)
type "mkfs.f2fs /dev/block/mmcblk0p3" (without the "", space before first / and it is a zero before p3)
Have attached original from kokotas, and one with 6mb zeros added to initrd.gz for magldr users, HypoTurtle tweaked the initrd.gz in the magldr version iirc.
Note that since it is a 3.0 kernel, it won't boot using HaRET. Untested on cLK.
Huge thanks again to kokotas and HypoTurtle, even though they no longer own HD2s, they are still willing to support it. RESPECT
Thanks also to marc1706, securecrt, walter79, gilbert32, tytung and others i might have missed.
I do hope we can get these scripts working, Devs will be able to release a rom with the nand initrd.gz and aroma will do all the rest, sounds great.:fingers-crossed:
Robbie P said:
Enormous thanks to @kokotas for compiling SD version of 2.7.0.0 twrp with f2fs support. kokotas does not own a HD2 anymore, but has done this over and above the huge contributions already made for our HD2, very much appreciated:good:
I have been using this for the past couple of weeks. There are some issues with the 3.0 kernel which it uses, such as not powering off fully (need to press reset button), but we need the 3.0 kernel to use f2fs. Please post any other bugs you may find.
To make a f2fs partition, it is necessary to format the third partition to eg FAT32 first. Then using recovery's terminal emulator;
(select the / folder)
type "mkfs.f2fs /dev/block/mmcblk0p3" (without the "", space before first / and it is a zero before p3)
Have attached original from kokotas, and one with 6mb zeros added to initrd.gz for magldr users, HypoTurtle tweaked the initrd.gz in the magldr version iirc.
Note that since it is a 3.0 kernel, it won't boot using HaRET. Untested on cLK.
Huge thanks again to kokotas and HypoTurtle, even though they no longer own HD2s, they are still willing to support it. RESPECT
Thanks also to marc1706, securecrt, walter79, gilbert32, tytung and others i might have missed.
I do hope we can get these scripts working, Devs will be able to release a rom with the nand initrd.gz and aroma will do all the rest, sounds great.:fingers-crossed:
Click to expand...
Click to collapse
Not sure that I did anything kernel/initrd wise for the kernel other than apply the f2fs patches and compile. (not sure if I used securecrt or walter79's git for the kernel so credits to them)
I'm actually thinking that with a little tweaking I should be able to reduce the updater-script down to just copying over the system files, which should make the whole system easily adaptable for all devices (unless I'm barking completely up the wrong tree)
HypoTurtle said:
Not sure that I did anything kernel/initrd wise for the kernel other than apply the f2fs patches and compile. (not sure if I used securecrt or walter79's git for the kernel so credits to them)
I'm actually thinking that with a little tweaking I should be able to reduce the updater-script down to just copying over the system files, which should make the whole system easily adaptable for all devices (unless I'm barking completely up the wrong tree)
Click to expand...
Click to collapse
Better that than
New procedure on #1 and #2.
Will post a new zip tomorrow with a 3.0.x kernel that can run f2fs.
HypoTurtle said:
And modify DirectSD_mounter.sh so that if it doesn't mount p3 as ext4 it tries with f2fs
Code:
#!/sbin/sh
#
# DirectSD SD-EXT Mounter v1.0
# Author: tytung - xda-developers
if [ ! -d "/DirectSystem" ]; then
mkdir "/DirectSystem"
fi
if [ ! -d "/DirectData" ]; then
mkdir "/DirectData"
fi
if [ -f "/tmp/mount.prop" ]; then
rm "/tmp/mount.prop"
fi
# Mount the SD-EXT partition
mounted=`mount | grep '/dev/block/mmcblk0p2 on /DirectSystem'`
if [ "$mounted" = "" ]; then
mount -t ext4 /dev/block/mmcblk0p2 /DirectSystem
fi
# Mount the SD-EXT partition
mounted=`mount | grep '/dev/block/mmcblk0p3 on /DirectData'`
if [ "$mounted" = "" ]; then
mount -t ext4 /dev/block/mmcblk0p3 /DirectData
fi
# Mount F2FS partition
mounted=`mount | grep '/dev/block/mmcblk0p3 on /DirectData'`
if [ "$mounted" = "" ]; then
mount -t f2fs /dev/block/mmcblk0p3 /DirectData
fi
# `echo $?` will return 0 if mount is executed successfully
if [ `echo $?` = 0 ]; then
echo 'status=mounted' > "/tmp/mount.prop"
#else
# redirect mount failed messages to aroma-config
fi
exit 0
And that's it on this side. Now read #2
Click to expand...
Click to collapse
looking at that code, if p3 was f2fs, then the first mount attempt would be with type ext4, which would give an "invalid argument" error (since is f2fs), it would then mount to f2fs. But the error should show up with echo $?, so status would not be =mounted.
would it be better to leave as -t auto? I know it works when installing, can't remember if it works from initrd.gz.
Robbie P said:
looking at that code, if p3 was f2fs, then the first mount attempt would be with type ext4, which would give an "invalid argument" error (since is f2fs), it would then mount to f2fs. But the error should show up with echo $?, so status would not be =mounted.
would it be better to leave as -t auto? I know it works when installing, can't remember if it works from initrd.gz.
Click to expand...
Click to collapse
Was compiling a unified script (combining the nativesd stuff along with the mounter scripts etc.) and noticed that - I think that adding another
mounted=`mount | grep '/dev/block/mmcblk0p3 on /DirectData'` just before the $? check would solve it. $? is just the last issued command - I have checked and that would work fine.
I am hazarding a guess that one of the reasons things weren't working earlier was the use of auto (feel free to tell me otherwise - while in aroma installing any rom try and mount p3 as auto and see what it reports (checking with mount and df)), one of the other things I slipped up on (due to testing on linux) was that I was using #!bin/sh in places where I should have been using #sbin/sh.
Also of note I have forgotten a few -'s in the zip on #2 ; will reup with new stuff tomorrow.
In recovery i did;
mkdir /sdcard/f2fs
mount -t auto /dev/block/mmcblk0p3 /sdcard/f2fs
i get
mount
...
/dev/block/mmcblk0p3 on /sdcard/f2fs type f2fs (rw,relatime,background_gc_on,active_logs=6)
df
...
/dev/block/mmcblk0p3 1k-blocks 1670144 used 182804 available 1465836 11% /sdcard/f2fs
Looking at;
## Copying zImage from /boot_dir if one wasn't added to zip
if [ ! -f "/tmp/zImage" ]; then
cp /boot_dir/zImage/ /tmp/zImage
fi
if [ ! -f "/tmp/zImage" ]; then
cp /boot_dir/initrd.gz/ /tmp/initrd.gz
fi
Click to expand...
Click to collapse
The second one should be initrd.gz, and if (NativeSD or) DirectSD install then it won't find either in boot-dir, should look in /sdcard/NativeSD folder (but it won't be nand initrd.gz since is already edited for *SD install), needs to save to same as well.
I tried the patch zip with the s-edits and swapping initrd.gz for zImage as above and including nand ramdisk in zip with directSD install, and it seems to run too quick for unpacking & repacking ramdisk. It is done almost immediately. recovery log not saved for some reason.
Robbie P said:
In recovery i did;
mkdir /sdcard/f2fs
mount -t auto /dev/block/mmcblk0p3 /sdcard/f2fs
i get
mount
...
/dev/block/mmcblk0p3 on /sdcard/f2fs type f2fs (rw,relatime,background_gc_on,active_logs=6)
df
...
/dev/block/mmcblk0p3 1k-blocks 1670144 used 182804 available 1465836 11% /sdcard/f2fs
Looking at;
The second one should be initrd.gz, and if (NativeSD or) DirectSD install then it won't find either in boot-dir, should look in /sdcard/NativeSD folder (but it won't be nand initrd.gz since is already edited for *SD install), needs to save to same as well.
I tried the patch zip with the s-edits and swapping initrd.gz for zImage as above and including nand ramdisk in zip with directSD install, and it seems to run too quick for unpacking & repacking ramdisk. It is done almost immediately. recovery log not saved for some reason.
Click to expand...
Click to collapse
Good catch with the typo... the patch installs will be very fast, it would be unnoticable. Will go back to using auto then (at least with the mounter).
A few things I think you misunderstood - the patch zip (#2) is to be run directly after a modified rom zip that 1 has ROM_NAME and install-type added to build.prop and that things aren't unmounted. /boot_dir is where the /sdcard/NativeSD/$ROM_NAME folder is mounted to. (will need to recheck: /sdcard/NativeSD is /boot and /sdcard/NativeSD/$ROM_NAME is /boot_dir or vice versa)
Thus the second zip needs/uses ROM_NAME and desired install type from /system/build.prop (as described above) and we need /boot and /boot_dir to remain mounted as they were by the ROM_zip itself. (This also sorts some potential issue where the ROM_NAME defined in initrd.gz is different from the name of the folder in NativeSD folder).
Easiest way to check if it's working as it should is having an adb shell running during install ... running mount after running the ROM.zip to check what is still mounted, and after running the patcher zip check the work folder to see if things run properly (busybox added to bin, mountfs-$install_type.sh added etc.)
Here is the combined scripts I was working on (1st draft).
Code:
#!/sbin/sh
## Bootloader check (copy of checksys.sh)
echo "bootloader=MAGLDR" > /tmp/nfo.prop
output=`grep -i "clk" /proc/cmdline`
if [ -n "$output" ]; then
echo "bootloader=cLK" > /tmp/nfo.prop
fi
install_type=` cat '/tmp/aroma/installtype.prop' | sed 's/selected.1=//g' `
type=(NAND DataOnExt NativeSD DirectSD)
install=${type[$install_type-1]}
ROM_NAME=`cat '/tmp/aroma/ROM_NAME.prop' | sed 's/ROM_NAME=//g'`
if [ -f "/tmp/mount.prop" ]; then
rm "/tmp/mount.prop"
fi
if [ ${install} = 'NativeSD' || ${type} = 'DataOnExt' ]; then
if [ ! -d "/NativeSD" ]; then
mkdir "/NativeSD"
fi
# Mount the SD-EXT partition
mounted=`mount | grep '/dev/block/mmcblk0p2 on /NativeSD'`
if [ "$mounted" = "" ]; then
mount -t ext4 /dev/block/mmcblk0p2 /NativeSD
fi
# `echo $?` will return 0 if mount is executed successfully
if [ `echo $?` = 0 ]; then
echo 'status=mounted' > "/tmp/mount.prop"
#else
# redirect mount failed messages to aroma-config
fi
### mount_NativeSD
STATUS=`cat '/tmp/mount.prop' | sed 's/status=//g'`
if [ "$STATUS" = "mounted" ]; then
if [ ${install} = 'NativeSD' ]; then
mkdir -p /NativeSD/$ROM_NAME/system
mkdir -p /NativeSD/$ROM_NAME/data
mount --bind /NativeSD/$ROM_NAME/system /system
mount --bind /NativeSD/$ROM_NAME/data /data
mkdir -p /sdcard/NativeSD/$ROM_NAME
mkdir -p /boot
mkdir -p /boot_dir
mount --bind /sdcard/NativeSD/$ROM_NAME /boot
mount --bind /sdcard/NativeSD /boot_dir
# delete the old system
rm -rf /system/*
echo "NativeSD=true" >> /tmp/nfo.prop
else
mkdir -p /NativeSD/$ROM_NAME/data
mount --bind /NativeSD/$ROM_NAME/data /data
echo "DataOnEXT=true" >> /tmp/nfo.prop
fi
else
# no SD-EXT partition found
echo "NativeSD=false" >> /tmp/nfo.prop
fi
fi
if [ ${install} = 'DirectSD' ]; then
if [ ! -d "/DirectSystem" ]; then
mkdir "/DirectSystem"
fi
if [ ! -d "/DirectData" ]; then
mkdir "/DirectData"
fi
# Mount the SD-EXT partition
mounted=`mount | grep '/dev/block/mmcblk0p2 on /DirectSystem'`
if [ "$mounted" = "" ]; then
mount -t ext4 /dev/block/mmcblk0p2 /DirectSystem
fi
# Mount the second SD-EXT partition
mounted=`mount | grep '/dev/block/mmcblk0p3 on /DirectData'`
if [ "$mounted" = "" ]; then
mount -t ext4 /dev/block/mmcblk0p3 /DirectData
fi
# Mount F2FS partition
mounted=`mount | grep '/dev/block/mmcblk0p3 on /DirectData'`
if [ "$mounted" = "" ]; then
mount -t f2fs /dev/block/mmcblk0p3 /DirectData
fi
# `echo $?` will return 0 if mount is executed successfully
mounted=`mount | grep '/dev/block/mmcblk0p3 on /DirectData'`
if [ `echo $?` = 0 ]; then
echo 'status=mounted' > "/tmp/mount.prop"
#else
# redirect mount failed messages to aroma-config
fi
##mount_DirectSD.sh
STATUS=`cat '/tmp/mount.prop' | sed 's/status=//g'`
if [ "$STATUS" = "mounted" ]; then
mkdir -p /DirectSystem/$ROM_NAME/system
mkdir -p /DirectData/$ROM_NAME/data
mount --bind /DirectSystem/$ROM_NAME/system /system
mount --bind /DirectData/$ROM_NAME/data /data
mkdir -p /sdcard/NativeSD/$ROM_NAME
mkdir -p /boot
mkdir -p /boot_dir
mount --bind /sdcard/NativeSD/$ROM_NAME /boot
mount --bind /sdcard/NativeSD /boot_dir
echo "DirectSD=true" >> /tmp/nfo.prop
else
# no SD-EXT partition found
echo "DirectSD=false" >> /tmp/nfo.prop
fi
fi
# Changing install_type to numbered value
if $install='NAND'; then
install_type='1'
fi
if $install='DataOnExt'; then
install_type='2'
fi
if $install='NativeSD'; then
install_type='3'
fi
if $install='DirectSD'; then
install_type='4'
fi
DataOnExtmount="#!/bin/busybox sh
# wait for 2nd partition ready
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
# check the ext4 fs
/bin/e2fsck -p /dev/block/mmcblk0p2 > /e2fsck.log
# mount the 1st (NativeSD) SD-EXT partition
/bin/busybox mkdir -p /NativeSD
/bin/busybox mount -t auto -o ro,noatime,nodiratime,barrier=0 /dev/block/mmcblk0p2 /NativeSD
# mount the system data app dir
/bin/busybox mount --bind /NativeSD/rOm/data /data
# cleanup
# delete /bin to free ram
/bin/busybox rm -rf /bin
"
NativeSDmount="#!/bin/busybox sh
# wait for 2nd partition ready
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
# check the ext4 fs
/bin/e2fsck -p /dev/block/mmcblk0p2 > /e2fsck.log
# mount the 1st (NativeSD) SD-EXT partition
/bin/busybox mkdir -p /NativeSD
/bin/busybox mount -t auto -o ro,noatime,nodiratime,barrier=0 /dev/block/mmcblk0p2 /NativeSD
# mount the system data app dir
/bin/busybox mount --bind /NativeSD/rOm/system /system
/bin/busybox mount --bind /NativeSD/rOm/data /data
# cleanup
# delete /bin to free ram
/bin/busybox rm -rf /bin
"
direct=`mount | grep mmcblk0p3 | grep ext4`
if [ -n "$direct" ]; then
DirectSDmount="#!/bin/busybox sh
# wait for 2nd partition ready
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
# check the ext4 fs
/bin/e2fsck -p /dev/block/mmcblk0p2 > /e2fsck.log
# mount the 1st (NativeSD) SD-EXT partition
/bin/busybox mkdir -p /DirectSystem
/bin/busybox mkdir -p /DirectData
/bin/busybox mount -t ext4 -o ro,noatime,nodiratime,barrier=0 /dev/block/mmcblk0p2 /DirectSystem
/bin/busybox mount -t ext4 -o noatime,nodiratime,nosuid,nodev,discard /dev/block/mmcblk0p3 /DirectData
# mount the system data app dir
/bin/busybox mount --bind /DirectSystem/rOm/system /system
/bin/busybox mount --bind /DirectData/rOm/data /data
# cleanup
# delete /bin to free ram
/bin/busybox rm -rf /bin
"
else
DirectSDmount="#!/bin/busybox sh
# wait for 2nd partition ready
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
wait /dev/block/mmcblk0p3
# check the ext4 fs
/bin/e2fsck -p /dev/block/mmcblk0p2 > /e2fsck.log
# mount the 1st (NativeSD) SD-EXT partition
/bin/busybox mkdir -p /DirectSystem
/bin/busybox mkdir -p /DirectData
/bin/busybox mount -t ext4 -o ro,noatime,nodiratime,barrier=0 /dev/block/mmcblk0p2 /DirectSystem
/bin/busybox mount -t f2fs -o noatime,nodiratime,nosuid,nodev,discard /dev/block/mmcblk0p3 /DirectData
# mount the system data app dir
/bin/busybox mount --bind /DirectSystem/rOm/system /system
/bin/busybox mount --bind /DirectData/rOm/data /data
# cleanup
# delete /bin to free ram
/bin/busybox rm -rf /bin
"
fi
## Setting up working directory
cp /tmp/initrd.gz /tmp/initrd-$ROM_NAME.gz
mkdir -p /tmp/work
cd /tmp/work
## Unzipping nand kernel
gzip -d -c ../initrd-$ROM_NAME.gz | cpio -i -d
mkdir bin
cp /tmp/busybox bin/busybox
cp /tmp/e2fsck bin/e2fsck
cat ${type}mount > mountfs-${type}.sh
cp /tmp/mountfs-${install}.sh mountfs-${install}.sh
chmod 0777 mountfs-${install}.sh
chmod 0777 bin/busybox
chmod 0777 bin/e2fsck
## Modifying ramdisk to not use yaffs, and use sd partitions instead.
if [ "${install_type}" -gt 2 ]; then
sed -i '/[email protected]/s/^/#/' ueventd.htcleo.rc
sed -i '/mount yaffs2/s/^/#/
s/# #/# /g' init.rc
sed -i "s/rOm/$ROM_NAME/g" mountfs-${install}.sh
fi
## Checking if anything other than nand is to be installed
if [ "${install_type}" -gt 1 ]; then
sed -i '/on fs/ a exec /mountfs-'${install}'.sh' init.rc
sed -i "s/rOm/$ROM_NAME/g" mountfs-${install}.sh
chmod 0750 init.rc
chmod 0644 ueventd.htcleo.rc
fi
# Building new ramdisk
find .| cpio -o -H newc | gzip -9 > ../initrd-done.gz
cd ..
# Checking bootloader
if [ "${bootloader}" != "cLK" ]; then
cat initrd-done.gz >> 6MB
cp 6MB /boot/initrd.gz
cp /tmp/zImage /boot/zImage
#Checking if nand install
if [ "${install_type}" -gt 2 ]; then
cp 6MB /boot_dir/initrd.gz
cp /tmp/zImage /boot_dir/zImage
fi
else
cp initrd-done.gz /tmp/initrd.gz
chmod 0755 /tmp/mkbootimg
chmod 0755 /tmp/mkbootimg.sh
exec /tmp/mkbootimg.sh
if [ "${install_type}" -lt 3 ]; then
flash_image boot /tmp/boot.img else
flash_image sboot /tmp/boot.img
fi
fi
cp /tmp/initrd-$ROM_NAME.gz /tmp/initrd.gz
yeah i misunderstood earlier
i did the edits in post#1 to chautien cyanogen v2 including changing to auto
it seemed to install to f2fs p3 ok
then flashed #2 with edits from earlier. it booted ok but p3 /data did not show up.
So i put f2fs kernel in NativeSD and added 6mb to initrd.gz manually, booted but still no /data.
Will try to put f2fs kernel in #2 and also try putting nand ramdisk in there after.
Would checking the size of the kernel be a good indication of whether it is a 3.0.x kernel? afaik 3.0 ones are >3mb and 2.6.x are <3mb
Robbie P said:
yeah i misunderstood earlier
i did the edits in post#1 to chautien cyanogen v2 including changing to auto
it seemed to install to f2fs p3 ok
then flashed #2 with edits from earlier. it booted ok but p3 /data did not show up.
So i put f2fs kernel in NativeSD and added 6mb to initrd.gz manually, booted but still no /data.
Will try to put f2fs kernel in #2 and also try putting nand ramdisk in there after.
Would checking the size of the kernel be a good indication of whether it is a 3.0.x kernel? afaik 3.0 ones are >3mb and 2.6.x are <3mb
Click to expand...
Click to collapse
Regarding 3.0.x kernel if you see the way I tried to add the check for 3.0.x kernel which wouldn''t work as is (needs cut -d ' ' -f '1'); if the check isn't passed then the 6MB file is removed meaning that later on when initrd-done is cat'ed >> 6MB it makes a new file called 6MB rather than adding on to the end of a preexisting one (that's the theory anyway).
For now I would just remove the md5sum lines from it. For the kernel change using #2 I need to add the lines for copying the modules across (system folder in zip copied to /system).
Are you sure it booted without /data not being mounted at all with direct p3 is mounted to /DirectData and /DirectData/$ROM_NAME/data is mounted as /data. Just to check that it is the ramdisk built by the patcher that is running just check the root directory / and see if there is a mountfs-DirectSD.sh file - there should be. If there is check it and see if rOm has been changed (although if system is mounted I can't see why data's wouldn't have).
Also I noticed a few errors (using $type instead of $install and some -'s for some of the mountfs references) in the last script posted, not sure if I pulled those errors across from the zip posted on 2 will check tomorrow.
Just taking a glance at the long script posted and /boot_dir is /sdcard/NativeSD and /boot is the ROM folder which makes sense. Not sure if using /boot is better or worse as /boot isn't a folder for clk users (afaik); need a workaround for clk anyway (I think) and need to bundle in unmkbootimg stuff.

Categories

Resources