[General Questions and Answers] Kamuchi:
Hello everyone, first time poster but longer time lurker :)

Last week I treated myself with the new NotePro 12.2 tablet after dreaming what might cn be done with it once it runs a complete desktop :fingers-crossed:

Since last saturday I have been trying to no availe to get ubuntu running and about to go crazy with the amount of failed attempts.

My hopes are on the Complete Linux Installer as it is being actively developed but I ran into a weird issue with permissions when running the boot script.

I would post in the developer thread, but as a new user I will have to do it here (original thread http://xdaforums.com/showthread.php?t=1585009 )

On with the info:

Device: Galaxy NotePro 12.2 (SM-P900)

Android 4.4.2

Kernel: 3.4.39-433754

Rooted

SuperSu Pro: passed root

Busybox Pro: passed root

Complete Linux Installer + key (ofcourse!)

Linux version: Ubuntu 13.10 Large

The issue:

When executing the bootscript.sh the error "operation is not permitted"

Checking loop device... MISSING
Creating loop device... mknod: /dev/block/loop255: Operation not permitted
Command: /system/xbin/busybox mknod /dev/block/loop255 b 7 255
FAILED
Error: Unable to create loop device!

Doing my homework for few hours and seeing more people have had this problem, but after some head scratching I simply tried the command manually to see if I am going crazy or not:

/system/xbin/busybox mknod /dev/block/loop255 b 7 255
v/block/ |grep loop <
brw------- root root 7, 0 2014-04-02 19:20 loop0
brw------- root root 7, 1 2014-04-02 19:20 loop1
brw------- root root 7, 2 2014-04-02 19:20 loop2
brw------- root root 7, 255 2014-04-02 19:59 loop255
brw------- root root 7, 3 2014-04-02 19:24 loop3
brw------- root root 7, 4 2014-04-02 19:20 loop4
brw------- root root 7, 5 2014-04-02 19:20 loop5
brw------- root root 7, 6 2014-04-02 19:20 loop6
brw------- root root 7, 7 2014-04-02 19:20 loop7

Success! :victory:

Launch the app for a retry:

Checking loop device... FOUND
Command: /system/xbin/busybox losetup /dev/block/loop255 /sdcard/ubuntu/ubuntu.img
mount: mounting /dev/block/loop255 on /data/local/mnt failed: Permission denied

So I keep getting permission denied error one after the other, but when I execute the commands directly in the terminal it`s all fine and dandy and the only thing that doesn`t show anything is when I try to chroot.

With a little bit of linux knowledge I dived into the bootscript and started to look where something goes wrong, I even downloaded 2 different scripts but none made a difference.

Checking loop device... FOUND
Command: /system/xbin/busybox losetup /dev/block/loop255 /sdcard/ubuntu/ubuntu.img
mount: mounting /dev/block/loop255 on /data/local/mnt failed: Permission denied
Command: /system/xbin/busybox mount -t ext4 /dev/block/loop255 /data/local/mnt
mount: mounting devpts on /data/local/mnt/dev/pts failed: No such file or directory
Command: /system/xbin/busybox mount -t devpts devpts /data/local/mnt/dev/pts
mount: mounting proc on /data/local/mnt/proc failed: No such file or directory
Command: /system/xbin/busybox mount -t proc proc /data/local/mnt/proc
mount: mounting sysfs on /data/local/mnt/sys failed: No such file or directory
Command: /system/xbin/busybox mount -t sysfs sysfs /data/local/mnt/sys
mount: mounting /sdcard on /data/local/mnt/sdcard failed: No such file or directory
Command: /system/xbin/busybox mount -o bind /sdcard /data/local/mnt/sdcard
mkdir failed for /data/local/mnt/root/cfg, No such file or directory
mount: mounting /sdcard/ubuntu on /data/local/mnt/root/cfg failed: No such file or directory
Command: /system/xbin/busybox mount -o bind /sdcard/ubuntu /data/local/mnt/root/cfg
mount: mounting /sys/fs/selinux on /data/local/mnt/selinux failed: No such file or directory
Command: /system/xbin/busybox mount -o bind /sys/fs/selinux /data/local/mnt/selinux
mount: mounting /storage on /data/local/mnt/external_sd failed: No such file or directory
No user defined mount points
net.ipv4.ip_forward = 1
bootscript.sh[234]: can't create /data/local/mnt/etc/resolv.conf: No such file or directory
Error: Unable to write resolv.conf file!

Having all commands echo`d in the terminal made the manual work abit easier:

/xbin/busybox losetup /dev/block/loop255 /sdcard/ubuntu/ubuntu.img <
xbin/busybox mount -t ext4 /dev/block/loop255 /data/local/mnt <
/xbin/busybox mount -t devpts devpts /data/local/mnt/dev/pts <
xbin/busybox mount -t proc proc /data/local/mnt/proc <
xbin/busybox mount -t sysfs sysfs /data/local/mnt/sys <
xbin/busybox mount -o bind /sdcard /data/local/mnt/sdcard <
xbin/busybox mount -o bind /sdcard/ubuntu /data/local/mnt/root/cfg <
xbin/busybox mount -o bind /sys/fs/selinux /data/local/mnt/selinux <
meserver 8.8.4.4" >> $mnt/etc/resolv.conf <
tmp-mksh: can't create /etc/resolv.conf: Read-only file system
27.0.0.1 localhost" > $mnt/etc/hosts <
tmp-mksh: can't create /etc/hosts: Read-only file system

ls -la /data/local/mnt/

al/mnt/ <
drwxr-xr-x root root 2013-10-09 12:19 android
drwxr-xr-x root root 2013-10-23 04:45 bin
drwxr-xr-x root root 2013-04-25 18:08 boot
drwxr-xr-x root root 2013-10-09 12:01 dev
drwxr-xr-x root root 2013-10-23 04:46 etc
drwxr-xr-x root root 2013-10-10 14:03 external_sd
drwxr-xr-x root root 2013-10-09 12:18 home
drwxr-xr-x root root 2013-10-10 18:35 lib
drwx------ root root 2013-10-09 11:51 lost+found
drwxr-xr-x root root 2013-10-09 11:54 media
drwxr-xr-x root root 2013-04-25 18:08 mnt
drwxr-xr-x root root 2013-10-09 11:54 opt
dr-xr-xr-x root root 1970-01-01 01:00 proc
drwx------ root root 2013-10-23 04:55 root
drwxr-xr-x root root 2013-10-23 04:55 run
drwxr-xr-x root root 2013-10-23 04:45 sbin
drwxrwx--x root sdcard_r 2014-04-01 19:49 sdcard
drwxr-xr-x root root 1970-01-01 01:00 selinux
drwxr-xr-x root root 2013-10-09 11:54 srv
dr-xr-xr-x root root 2014-04-02 19:20 sys
drwxrwxrwt root root 2013-10-23 04:55 tmp
drwxr-xr-x root root 2013-10-09 11:54 usr
drwxr-xr-x root root 2013-10-09 11:54 var

Looks very familiar :fingers-crossed:

Checking loop device... FOUND
Command: /system/xbin/busybox losetup /dev/block/loop255 /sdcard/ubuntu/ubuntu.img
mount: mounting /dev/block/loop255 on /data/local/mnt failed: Permission denied
Command: /system/xbin/busybox mount -t ext4 /dev/block/loop255 /data/local/mnt
mount: mounting devpts on /data/local/mnt/dev/pts failed: Permission denied
Command: /system/xbin/busybox mount -t devpts devpts /data/local/mnt/dev/pts
mount: mounting proc on /data/local/mnt/proc failed: Permission denied
Command: /system/xbin/busybox mount -t proc proc /data/local/mnt/proc
mount: mounting sysfs on /data/local/mnt/sys failed: Permission denied
Command: /system/xbin/busybox mount -t sysfs sysfs /data/local/mnt/sys
mount: mounting /sdcard on /data/local/mnt/sdcard failed: Permission denied
Command: /system/xbin/busybox mount -o bind /sdcard /data/local/mnt/sdcard
mount: mounting /sdcard/ubuntu on /data/local/mnt/root/cfg failed: Permission denied
Command: /system/xbin/busybox mount -o bind /sdcard/ubuntu /data/local/mnt/root/cfg
mount: mounting /sys/fs/selinux on /data/local/mnt/selinux failed: Permission denied
Command: /system/xbin/busybox mount -o bind /sys/fs/selinux /data/local/mnt/selinux
mount: mounting /storage on /data/local/mnt/external_sd failed: Permission denied
No user defined mount points
net.ipv4.ip_forward = 1
bootscript.sh[231]: can't create /data/local/mnt/etc/resolv.conf: Permission denied
bootscript.sh[232]: can't create /data/local/mnt/etc/hosts: Permission denied
chroot: can't change root directory to '/data/local/mnt': Operation not permitted
Command: /system/xbin/busybox chroot /data/local/mnt /root/init.sh ubuntu.img
Shutting down Linux ARM
umount: can't umount /data/local/mnt/root/cfg: Permission denied
umount: can't umount /data/local/mnt/sdcard: Permission denied
umount: can't umount /data/local/mnt/external_sd: Invalid argument
umount: can't umount /data/local/mnt/dev/pts: Permission denied
umount: can't umount /data/local/mnt/dev: Invalid argument
umount: can't umount /data/local/mnt/proc: Permission denied
umount: can't umount /data/local/mnt/sys: Permission denied
umount: can't umount /data/local/mnt/selinux: Permission denied
umount: can't umount /data/local/mnt: Permission denied

Still nothing and now it goes on to the shutdown section :confused:

Doing the chroot command does nothing and to be honest, I wouldn`t even know if it was supposed to do anything as this function is new for me.

/system/xbin/busybox chroot /data/local/mnt /root/init.sh ubuntu.img

All the commands work with just being root (command su) or through busybox.

All the files have root owner/group and they are executable.

Debug so far:

Rename supplied busybox version to busybox.org => removed it entirely with a fixed link to busybox itself.

3 different bootscript.sh

Changed ext2 to ext4, latest was ext4.

Reinstalled, rebooted, kicked it a few times.

Checked perms on everything and it *looks* all good.

All commands the bootscript.sh tries to call do work when doing it manually in the command shell, but even "sh bootscript.sh" fails on all.

Changed "setenforce 0" as some one has suggested.

Here is my butcherd bootscript.sh script that I try to run it with:

###########################################
# Linux boot script V8 for Android v4.3 #
# Built by Zachary Powell (zacthespack) #
# and Martin M..ller (Tuxling) #
# Thanks to: #
# Johan Vromans #
# Marshall Levin #
# Vaykadji #
# and to everyone at XDA! #
# Feel free to edit/use this script as you#
# like but credit Linuxonandroid.org #
###########################################
# $ver: V8 #
###########################################

###########################################
# This is a function we use to stop the #
# script in case of errors #
###########################################
error_exit() {
echo "Error: $1"
exit 1
}

###########################################
# Set up variables #
###########################################
export bbox=/system/xbin/busybox

# echo $bbox

export usermounts=android # Base folder all user mounts are done in, should be moved to app later
export imgfile=/sdcard/ubuntu/ubuntu.img # Default image file, another can be set by using an argument
export bin=/system/xbin9
export mnt=/data/local/mnt
export USER=root
if [[ ! -d $mnt ]]; then mkdir $mnt; fi
export PATH=$bin:/usr/bin:/usr/local/bin:/usr/sbin:/bin:/usr/local/sbin:/usr/games:$PATH
export TERM=linux
export HOME=/root

###########################################
# Handle arguments if present #
###########################################
if [ $# -ne 0 ]; then
if [ -f $1 ]; then # Is full path present?
imgfile=$1

elif [ -f $(dirname $0)/$1 ]; then # Is only a filename present?
imgfile=$(dirname $0)/$1

else
error_exit "Image file not found!($1)"
fi
fi

###########################################
# If a md5 file is found we check it here #
###########################################
#if [ -f $imgfile.md5 ]; then
# echo "MD5 file found, use to check .img file? (y/n)"
# read answer
# if [ $answer == y ]; then
# echo -n "Validating image checksum... "
# $bbox md5sum -c -s $imgfile.md5
# if [ $? -ne 0 ];then
# echo "FAILED!"
# error_exit "Checksum failed! The image is corrupted!"
# else
# echo "OK"
# rm $imgfile.md5
# fi
# fi
#
#fi
################################
# Find and read config file #
# or use defaults if not found #
################################
use_swap=no

cfgfile=$imgfile.config # Default config file if not specified

if [ -f $imgfile.config ]; then
source $imgfile.config
fi

###########################################
# Set Swap up if wanted #
# #
###########################################
if [ $use_swap == yes ]; then
if [ -f $imgfile.swap ]; then
echo "Swap file found, using file"
echo "Turning on swap (if it errors here you do not have swap support"
swapon $imgfile.swap

else
echo "Creating Swap file"
dd if=/dev/zero of=$imgfile.swap bs=1048576 count=1024
mkswap $imgfile.swap
echo "Turning on swap (if it errors here you do not have swap support"
swapon $imgfile.swap

fi
fi

###########################################
# Set up loop device and mount image #
###########################################
echo -n "Checking loop device... "
if [ -b /dev/block/loop255 ]; then
echo "FOUND"
else
echo "MISSING"
# Loop device not found so we create it and verify it was actually created
echo -n "Creating loop device... "
$bbox mknod /dev/block/loop255 b 7 255
echo -n "Command: $bbox mknod /dev/block/loop255 b 7 255 \n"
if [ -b /dev/block/loop255 ]; then
echo "OK"
else
echo "FAILED"
error_exit "Unable to create loop device!"
fi
fi

$bbox losetup /dev/block/loop255 $imgfile
echo -n "Command: $bbox losetup /dev/block/loop255 $imgfile \n"
if [ $? -ne 0 ];then error_exit "Unable to attach image to loop device! (Image = $imgfile)"; fi

$bbox mount -t ext4 /dev/block/loop255 $mnt
echo -n "Command: $bbox mount -t ext4 /dev/block/loop255 $mnt \n"
if [ $? -ne 0 ];then error_exit "Unable to mount the loop device! \n"; fi

###########################################
# Mount all required partitions #
###########################################
$bbox mount -t devpts devpts $mnt/dev/pts
echo -n "Command: $bbox mount -t devpts devpts $mnt/dev/pts \n"
if [ $? -ne 0 ];then $bbox mount -o bind /dev $mnt/dev; $bbox mount -t devpts devpts $mnt/dev/pts; fi
if [ $? -ne 0 ]; then error_exit "Unable to mount $mnt/dev/pts!"; fi

$bbox mount -t proc proc $mnt/proc
echo -n "Command: $bbox mount -t proc proc $mnt/proc \n"
if [ $? -ne 0 ];then error_exit "Unable to mount $mnt/proc!"; fi

$bbox mount -t sysfs sysfs $mnt/sys
echo -n "Command: $bbox mount -t sysfs sysfs $mnt/sys \n"
if [ $? -ne 0 ];then error_exit "Unable to mount $mnt/sys!"; fi

$bbox mount -o bind /sdcard $mnt/sdcard
echo -n "Command: $bbox mount -o bind /sdcard $mnt/sdcard \n"
if [ $? -ne 0 ];then error_exit "Unable to bind $mnt/sdcard!"; fi

if [[ ! -d $mnt/root/cfg ]]; then mkdir $mnt/root/cfg; fi
$bbox mount -o bind $(dirname $imgfile) $mnt/root/cfg
echo -n "Command: $bbox mount -o bind $(dirname $imgfile) $mnt/root/cfg \n"

$bbox mount -o bind /sys/fs/selinux $mnt/selinux
echo -n "Command: $bbox mount -o bind /sys/fs/selinux $mnt/selinux \n"

###########################################
# Checks if you have a external sdcard #
# and mounts it if you do #
###########################################
if [ -d /sdcard/external_sd ]; then
$bbox mount -o bind /sdcard/external_sd $mnt/external_sd
fi
if [ -d /Removable/MicroSD ]; then
$bbox mount -o bind /Removable/MicroSD $mnt/external_sd
fi
# This is for the HD version of the Archos 70 internet tablet, may be the same for the SD card edition but i dont know.
if [ -d /storage ]; then
$bbox mount -o bind /storage $mnt/external_sd
fi

###########################################
# Mount all user defined mounts if any #
###########################################
if [ -f $imgfile.mounts ]; then
olddir=$(pwd)
echo "Mounting user mounts"

cd $mnt
if [[ ! -d $mnt/$usermounts ]]; then $bbox mkdir -p $usermounts; fi

echo "# Script to unmount user defined mounts, do not delete or edit!" > $imgfile.shutdown
echo "cd $mnt/$usermounts" > $imgfile.shutdown

cd $mnt/$usermounts
for entry in $(cat "$imgfile.mounts"); do
ANDROID=${entry%;*}
LINUX=${entry#*;}

if [[ -d $ANDROID ]]; then
echo -n "Mounting $ANDROID to $usermounts/$LINUX... "
if [[ ! -d $mnt/$usermounts/$LINUX ]]; then $bbox mkdir -p $LINUX; fi
$bbox mount -o bind $ANDROID $mnt/$usermounts/$LINUX &> /dev/null
if [ $? -ne 0 ];then
echo FAIL
if [[ -d $mnt/$usermounts/$LINUX ]]; then $bbox rmdir -p $LINUX; fi
else
echo OK
echo "$bbox umount $mnt/$usermounts/$LINUX" >> $imgfile.shutdown
echo "$bbox rmdir -p $LINUX" >> $imgfile.shutdown
fi
else
echo "Android folder not found: $ANDROID"
fi
done
echo "cd $mnt" >> $imgfile.shutdown
echo "$bbox rmdir -p $usermounts" >> $imgfile.shutdown
cd $olddir

else
echo "No user defined mount points"
fi

###########################################
# Sets up network forwarding #
###########################################
$bbox sysctl -w net.ipv4.ip_forward=1
if [ $? -ne 0 ];then error_exit "Unable to forward network!"; fi

# If NOT $mnt/root/DONOTDELETE.txt exists we setup hosts and resolv.conf now
#if [ ! -f $mnt/root/DONOTDELETE.txt ]; then
# echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf
# if [ $? -ne 0 ];then error_exit "Unable to write resolv.conf file!"; fi
echo "nameserver 8.8.4.4" >> $mnt/etc/resolv.conf
echo "127.0.0.1 localhost" > $mnt/etc/hosts
# if [ $? -ne 0 ];then error_exit "Unable to write hosts file!"; fi
#fi

###########################################
# Chroot into ubuntu #
###########################################
$bbox chroot $mnt /root/init.sh $(basename $imgfile)
echo -n "Command: $bbox chroot $mnt /root/init.sh $(basename $imgfile) \n"

###########################################
# Shut down ubuntu #
###########################################
echo "Shutting down Linux ARM"
#for pid in `lsof | grep $mnt | sed -e's/ / /g' | cut -d' ' -f2`; do kill -9 $pid >/dev/null 2>&1; done
for pid in `$bbox lsof | $bbox grep $mnt | $bbox sed -e's/ / /g' | $bbox cut -d' ' -f2`; do $bbox kill -9 $pid >/dev/null 2>&1; done
sleep 5

###########################################
# Unmount all user defined mounts if any #
###########################################
if [ -f $imgfile.shutdown ]; then
echo "Unmounting user defined mounts"
sh $imgfile.shutdown
rm $imgfile.shutdown
fi

$bbox umount $mnt/root/cfg
$bbox umount $mnt/sdcard
$bbox umount $mnt/external_sd
$bbox umount $mnt/dev/pts
$bbox umount $mnt/dev
$bbox umount $mnt/proc
$bbox umount $mnt/sys
$bbox umount $mnt/selinux
$bbox umount $mnt

I am at my whips end, the 12.2 is an awsome device to finally run a desktop on as a tablet, my mom already calls it a "TabTop" tablet+laptop, all I see though is a hole in the wall that is the size of my head :o

Could anyone please assist me with this strange issue? Pretty please? :angel:

With the new beta coming soon™ for CLI and that there won`t be many people like me that buy this toy for fun, I also volunteer to help to make this app idiot proof (point to self) as the work is awsome, even if it didn`t run out of the box :highfive: