Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chroot bind script #2

Open
itdaniher opened this issue Oct 2, 2014 · 2 comments
Open

chroot bind script #2

itdaniher opened this issue Oct 2, 2014 · 2 comments

Comments

@itdaniher
Copy link
Member

Currently:

/system/xbin/mount -o rw,remount /dev/block/mmcblk0p34 /system
echo 'performance' > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
losetup /dev/block/loop0 /data/media/0/debian.img 
/system/xbin/mount -t ext4 -o loop /dev/block/loop0 $rfs
mkdir -f $rfs
/system/xbin/mount --bind /dev $rfs/dev
/system/xbin/mount --bind /proc $rfs/proc
/system/xbin/mount --bind /system $rfs/system
/system/xbin/mount --bind /sys $rfs/sys
curl itdaniher.com/ip
export TERM=linux
export HOSTNAME=debian
export HOME=/root
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/system/xbin:/system/bin
chroot $rfs /bin/bash --login -i

May require additional TLC.

@itdaniher
Copy link
Member Author

rfs=/system/debian
/system/xbin/mount -o rw,remount /dev/block/platform/msm_sdcc.1/by-name/system /system
/system/bin/mkdir -f $rfs
echo 'performance' > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
losetup /dev/block/loop1 /sdcard/debian.img 
/system/xbin/mount -t ext4 -o loop /dev/block/loop1 $rfs
/system/xbin/mount --bind /dev/ $rfs/dev
/system/xbin/mount --bind /proc $rfs/proc
/system/xbin/mount --bind /system $rfs/system
/system/xbin/mount --bind /sys $rfs/sys
curl itdaniher.com/ip
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/system/xbin:/system/bin
export TERM=linux
export HOSTNAME=debian
export HOME=/root
chroot $rfs /bin/bash --login -i

@itdaniher
Copy link
Member Author

add /system/xbin/mount --bind /dev/pts $rfs/dev/pts to resolve virtual terminal error (recently appeared?) when when remoting to chroot or using tmux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant