Kodi Community Forum

Full Version: [HOW TO] KODI Linux on Amlogic TV Boxes
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
i have add a small USB-HD at XBMC, and the USBHD was insert in der Filelist !
And my 3TB USB NTFS was not mounted Huh??

Dater
(2014-02-08, 07:43)tinker Wrote: [ -> ]Folks:

Still tinkering around with the Geniatech Linux/XBMC. It really is working quite well.

Did anyone figure out how to write to the usr.sqsh 'read only' file system? This would be very helpful for modding the finer points of this distribution (and I'll take my chances not breaking it!).

tinker
on your main linux pc
Code:
sudo apt-get squashfs-tools
man unsquashfs
man mksquashfs
Nickr:

The My Gica box has unsquashfs and mksquashfs built in. Any way I can use those to work on a copy of usr.sqsh on USB drive? As in, unsquashfs a usr.sqsh copy on the USB, alter it, then mksquashfs back to the USB and rezip the .img file?

tinker
I am thinking you would be better to copy the usr.sqsh file to another computer, unsquash it, make your changes and squash it again. Then copy it back and restart.

Although I am not entirely clear on a couple of things.

1. Whether you can copy over a mounted squashfs when copying the new usr.sqsh

2. whether there is any security mechanism that in the boot procedure that checks that the sqsh file matches a checksum.
nickr:

I tried to unsquash the usr.sqsh on my USB stick and got a number of errors:

Code:
[===========-                                                  ] 1168/6469  18%
create_inode: failed to create symlink root//lib/libyajl.so, because Operation not permitted
[===========-                                                  ] 1170/6469  18%
create_inode: failed to create symlink root//lib/libyajl.so.2, because Operation not permitted
[... long list of similar errors]
create_inode: failed to create hardlink, because Operation not permitted
[========================================================|     ] 6040/6469  93%
create_inode: failed to create hardlink, because Operation not permitted
[=========================================================|    ] 6063/6469  93%
created 4964 files
created 1626 directories
created 0 symlinks
created 0 devices
created 0 fifos
[[email protected] system]#

I also tried to change my 'fstab' file in the 'etc' directory to make the 'user.sqsh' file system read/write in situ. Although I was able to assign read/write ('rw' instead of 'ro'), I still can't alter, delete or edit any files. I used to use Puppy Linux and never had trouble altering any files.

Any ideas? Maybe asking Geniatech to make an unsquashed variant for us tinkers.

tinker
squashfs is a READ ONLY FILESYSTEM.
nickr:

OK, got it. I'll have to find a way to unsquash it with another Linux box like you said, alter the fstab file to reflect that and then try install the image as an update.

tinker
I can unsquash file, then resquash it but when recovering with the image it fails at the verifying package stage. s there a way for it to bypass verification ?
Don't forget guys that systems with squashfs root filesystems often have an area is writable (rw) disk that allows customisation.

openelec is a case in point, the root file system is squashfs, so you can't change anything in /etc, but /storage is a separate rw partition that is the root user's home directory. It has a directory named .config. It is a hidden directory (that is what the . means in the name .config). Inside that hidden directory you can change a number of setup files and those changes survive a reboot.

I am wondering if the geniatech system has a similar facility.

What is the output of
Code:
mount
grep root /etc/passwd
i cant see anything there that will allow you to make a custom boot image logo.
nickr:

Here's my fstab file:

Code:
[[email protected] /root]# vi etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount pt>      <type>  <options>         <dump>  <pass>
/dev/root       /               ext2    rw,noauto         0       1
proc            /proc           proc    defaults          0       0
devpts          /dev/pts        devpts  defaults,gid=5,mode=620 0 0
tmpfs           /dev/shm        tmpfs   mode=0777         0       0
tmpfs           /tmp            tmpfs   defaults,noatime  0       0
sysfs           /sys            sysfs   defaults          0       0
tmpfs           /var/log        tmpfs   defaults,noatime  0       0
tmpfs           /var/run        tmpfs   defaults,noatime  0       0
tmpfs           /var/tmp        tmpfs   defaults,noatime  0       0
tmpfs           /var/lock       tmpfs   defaults,noatime  0       0
tmpfs           /var/cache      tmpfs   defaults,noatime  0       0
/usr.sqsh       /usr            squashfs rw,defaults,noatime      0       0
/dev/mtdblock3  /recovery       yaffs2  defaults          0       0
- etc/fstab 1/16 6%

This is from 'mount':

Code:
[[email protected] /]# mount
rootfs on / type rootfs (rw)
/dev/root on / type ext4 (rw,relatime,user_xattr,acl,barrier=1,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=403592k,nr_inodes=70724,mode=755)
none on /proc type proc (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /dev/shm type tmpfs (rw,relatime,mode=777)
tmpfs on /tmp type tmpfs (rw,noatime)
sysfs on /sys type sysfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,noatime)
tmpfs on /tmp type tmpfs (rw,noatime)
tmpfs on /tmp type tmpfs (rw,noatime)
tmpfs on /tmp type tmpfs (rw,noatime)
tmpfs on /tmp type tmpfs (rw,noatime)
/dev/loop0 on /usr type squashfs (ro,noatime)
/dev/data on /root type ext4 (rw,relatime,user_xattr,acl,barrier=1,data=ordered)
/dev/cardblksd1 on /media/usb0 type vfat (rw,dirsync,nodev,noexec,noatime,nodiratime,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)

...and from grep:

Code:
[[email protected] /]# grep root /etc/passwd
root:x:0:0:root:/root:/bin/sh

Does this tell you enough?

tinker
It tells me that root's home directory is /root (as in a normal linux distro)

It tells me that /root is separately mounted as a rw partition, /dev/data

I would look around in /root for what config files you can find.

Code:
ls -a
lists hidden files and folders as well as unhidden ones.

Alternatively you could ask geniatech for support?

or you could write a boot script to make the changes you want (the details of which have now been left many pages back! What is it we are trying to do again?)
nickr:

Here's my /root folder:

Code:
[[email protected] /root]# ls -alt
-rw-------    1 root     root          2161 Feb 11 03:11 .ash_history
drwxr-xr-x    5 root     root          4096 Feb  7 00:22 ./
drwxr-xr-x    2 root     root          4096 Feb  7 00:22 .smb/
drwxr-xr-x    8 root     root          4096 Jan  1  1970 .xbmc/
drwxr-xr-x   18 root     root          4096 Jan  1  1970 ../
drwx------    2 root     root          4096 Jan  1  1970 lost+found/

the .smb folder:

Code:
[[email protected] .smb]# ls -alt
-rw-r--r--    1 root     root         36864 Feb  8 18:32 gencache.tdb
-rw-r--r--    1 root     root         20480 Feb  8 18:32 gencache_notrans.tdb
drwxr-xr-x    2 root     root          4096 Feb  7 00:22 ./
drwxr-xr-x    5 root     root          4096 Feb  7 00:22 ../
-rw-r--r--    1 root     root           279 Feb  7 00:22 smb.conf

I've been able to change smb.conf as mentioned earlier in this thread.

and the .xbmc folder:

Code:
[[email protected] .xbmc]# ls -alt
drwxr-xr-x    4 root     root          4096 Feb 11 00:36 temp/
drwxr-xr-x  121 root     root          4096 Feb  8 18:33 addons/
drwxr-xr-x    5 root     root          4096 Feb  7 00:22 ../
drwxr-xr-x    8 root     root          4096 Jan  1  1970 ./
drwxr-xr-x    2 root     root          4096 Jan  1  1970 media/
drwxr-xr-x    2 root     root          4096 Jan  1  1970 sounds/
drwxr-xr-x    2 root     root          4096 Jan  1  1970 system/
drwxr-xr-x    9 root     root          4096 Jan  1  1970 userdata/

So, there is a lot the can be modified on the XBMC side, but very little on the Linux side. Some of the XBMC files are part of the squashfs usr.sqsh file and can't be altered.

tinker
What are you trying to change?
nickr:

Actually, the changes I've already made are pretty much what I need. I altered smb.conf so I could easily scan the Linux file system from a Windows PC. It would be nice to be able to add, delete and edit files remotely on the SD card and USB sticks plugged into the My Gica though. I was also able to edit the remote.conf file so that more buttons would work on the remote. I can't seem to figure out why key repeat works on the remote but not on the keyboard.

Other than that, I keep plugging away at things so that whatever I learn, I can pass on to others.

tinker