xbianonpi / xbian

XBMC on Raspberry Pi, Bleeding Edge
https://xbian.org
GNU General Public License v3.0
294 stars 46 forks source link

How to build the custom Xbian Image #857

Closed amanharitsh123 closed 6 years ago

amanharitsh123 commented 6 years ago

I have made some changes to the kodi fork https://github.com/amanharitsh123/xbmc . I want to make a custom xbian image using this fork and want to test my changes. How can i do this ? Please Help

mkreisl commented 6 years ago

@amanharitsh123

Do you have already built Kodi from your source? If you did it, you do not need to build an XBian image, it's just enough to install your custum kodi deb package (xbian-package-xbmc) via dpkg -i

If you still have to build your own kodi package, please read an follow these instructions: https://github.com/xbianonpi/xbian/wiki/Building-XBian-packages

But, it's not trivial building Kodi v18 from source, because you need some patches to build Kodi from source but I did not have published them right now

amanharitsh123 commented 6 years ago

@mkreisl Thanks for the reply I want to build kodi isengard from source https://github.com/amanharitsh123/xbmc How can i make deb package using my repo(https://github.com/amanharitsh123/xbmc) Can you please help?

amanharitsh123 commented 6 years ago

and after building a deb package , can i directly install that on my rpi running xbian ? Should i have to remove the kodi that my xbian image already had ? @mkreis

mkreisl commented 6 years ago

Ah, ok.

Step 1: Please read an follow these instructions: https://github.com/xbianonpi/xbian/wiki/Building-XBian-packages. This installs XBian development environment

Step 2: You have to clone this repository: https://github.com/xbianonpi/xbian-package-xbmc This is the repository to build Kodi

Step 3: You need our treeIsengard tree from here https://github.com/xbianonpi/xbian-sources-xbmc, because there are many patches to make it work under XBian. So you have to fork it and make your own changes in `treeIsengard' branch

Step 4 Assuming you want to build package for Pi 2/3, you have to modify the config_source_addr setting in this file https://github.com/xbianonpi/xbian-package-xbmc/blob/master/build/rpi2-cross-isengard/config (has to point to your forked and modified repo)

Step 5: To build package, you have to run $xbiangit --arch rpi2-cross-isengard

Please note that Kodi Isengard is very very out of date, so I can not guarantee that building of this version still works

mkreisl commented 6 years ago

and after building a deb package , can i directly install that on my rpi running xbian ?

Yes

Should i have to remove the kodi that my xbian image already had ?

No

amanharitsh123 commented 6 years ago

@mkreisl Thanks a lot Its really a great help to me

amanharitsh123 commented 6 years ago

With the development setup guide , https://github.com/xbianonpi/xbian/wiki/Building-XBian-packages It doesnt found any command "xbiangit"

mkreisl commented 6 years ago

You have to log out and log in again

The command is $xbiangit

amanharitsh123 commented 6 years ago

Tried that , looks like i have to add the path to $PATH

mkreisl commented 6 years ago

$xbiangit is not a command, it's a environment variable and points to run.me

manfred@kmnote5:/usr/src/xbian/xbian-package-kernel> env | grep xbiangit
xbiangit=/usr/src/xbian/run.me
amanharitsh123 commented 6 years ago

it means that echo $xbiangit must return some path then?

amanharitsh123 commented 6 years ago

i did a chmod 777 /etc/profile.d/xbiangit.sh , it solved the issue

mkreisl commented 6 years ago

it means that echo $xbiangit must return some path then?

Exactly

mkreisl commented 6 years ago

i did a chmod 777 /etc/profile.d/xbiangit.sh , it solved the issue

Hmm, thats weird:

manfred@kmnote5:/usr/src/xbian/xbian-package-kernel> ll /etc/profile.d/xbiangit.sh 
-rw-r--r-- 1 root root 273  1. Mai 2017  /etc/profile.d/xbiangit.sh
amanharitsh123 commented 6 years ago

No , there is something wrong . Let me check

amanharitsh123 commented 6 years ago

I have found the issue , we cant run $xbiangit with the root user. After loggin in again , we have to continue the build process through as a user , not root

mkreisl commented 6 years ago

Ehm, working under root is usually never a good idea :smile:

amanharitsh123 commented 6 years ago

i think there is a typo here "cd ../xbian-prep-root; $xbiangit --arch [platform] --action build" , shouldnt it be the "cd . " rather than "cd .."

https://github.com/xbianonpi/xbian/wiki/Building-XBian-packages Step 4

mkreisl commented 6 years ago

No, that command installs your schroot build environment. You need this for building binary packages. Btw, XBian usually does not use a cross compiler (expect building kernel packages)

Current Debian is Stretch, so you have to install amd64stretch root environment if you want to build Kodi package for Pi 2/3

amanharitsh123 commented 6 years ago

and i there is this error now after running $xbiangit --arch [platform] --action build /create.buildroot no such file or directory

mkreisl commented 6 years ago
$xbiangit --arch amd64stretch --action build
amanharitsh123 commented 6 years ago

same error , I am using ubuntu 16.04

mkreisl commented 6 years ago

Hmmm, I have run that command many many times, never had issues. I'm running Debian Stretch for doing that

amanharitsh123 commented 6 years ago

then let me try that on my debian vm

mkreisl commented 6 years ago

But make sure that you are root when running that command

amanharitsh123 commented 6 years ago

"cd ../xbian-prep-root; $xbiangit --arch [platform] --action build in this command , we are in the this directory https://github.com/xbianonpi/xbian/tree/master/xbian-prep-root right ?

mkreisl commented 6 years ago

we are in xbian-prep-root folder, right

root@kmnote5-debian9:/usr/src/xbian/xbian-prep-root# $xbiangit --arch amd64stretch 
I: Retrieving InRelease 
I: Retrieving Release 
I: Retrieving Packages 
I: Validating Packages 
I: Resolving dependencies of required packages...
I: Resolving dependencies of base packages...
I: Found additional required dependencies: libaudit-common libaudit1 libbz2-1.0 libcap-ng0 libdb5.3 libdebconfclient0 libgcrypt20 libgpg-error0 liblz4-1 libncursesw5 libsemanage-common libsemanage1 libsystemd0 libudev1 libustr-1.0-1 
amanharitsh123 commented 6 years ago

@mkreisl the same error on debian jessie

mkreisl commented 6 years ago

Hmmm, looks like your XBIANROOT variable has not been set properly

root@kmnote5-debian9:/usr/src/xbian/xbian-prep-root/extra-files# env | grep XBIAN
XBIANROOT=/usr/src/xbian
amanharitsh123 commented 6 years ago

should i clone this in /usr/src/

amanharitsh123 commented 6 years ago

XBIANROOT is set correctly , i have checked

mkreisl commented 6 years ago

should i clone this in /usr/src/

No, you can do this in your home directory

mkreisl commented 6 years ago

Hmmm, at the moment I'm a bit confused. I think you're making an error but do not know what the error is

amanharitsh123 commented 6 years ago

Can you guess some possible error ? Looks like the script is referring to a wrong directory for create.buildroot which is present in the parent of current working directory

mkreisl commented 6 years ago

Haven't set up this enviromnent for a long time.

Please give me some time to install it on a fresh environment

mkreisl commented 6 years ago

... and the build root procedure is broken at the moment due to some deb packages could not be found.

Have to fix this first

amanharitsh123 commented 6 years ago

oh alright , Thank you please let me know if you find any fix :)

amanharitsh123 commented 6 years ago

Fix : sudo -E $xbiangit --arch [platform] --action build

mkreisl commented 6 years ago

Fix : sudo -E $xbiangit --arch [platform] --action build

Yeah, that fixes it if you are running command with sudo.

I was using su - always instead of sudo

mkreisl commented 6 years ago

@amanharitsh123 I have commited some fixes, https://github.com/xbianonpi/xbian/commit/80feea4a37416346c2b2300c4ac612a65bf58e90, https://github.com/xbianonpi/xbian/commit/4d3b20ff21771bdfe045fd76c2a340c8e289d9c7, https://github.com/xbianonpi/xbian-package-repo/commit/b2b64de561aeacae67078ffbd79e9cb4d47ce67a

and updated wiki article https://github.com/xbianonpi/xbian/wiki/Building-XBian-packages

Now it should work without issues

Please note, the user has to be member of group users. If you don't want this, you have to edit config files in /etc/schroot/chroot.d folder manually

amanharitsh123 commented 6 years ago

@mkreisl Thanks a lot for the help :)

amanharitsh123 commented 6 years ago

I am gettting some error https://paste.fedoraproject.org/paste/8ir9TzMrLwM94OmgJEGo~A after sudo -E $xbiangit --action build

@mkreisl Please help

mkreisl commented 6 years ago

Hmmm, never get this issue, looks like that another process is accessing this folder.

Probably not good idea to use /home/osboxes/Desktop/XFS/xbian as path, isn't Desktop your current desktop?

I think better path is /home/osboxes/Desktop

amanharitsh123 commented 6 years ago

and on ubuntu system is , Method gave invalid 103 redirect message after 20 mins

I dont have the above issue on Ubuntu Bionic

mkreisl commented 6 years ago

Sorry, at this point I have no idea how to help. I'm using openSUSE 13.1 (my local devel system), Debian Jessie (this is our main build system), Debian Stretch (VM for testing and my ARM powered home server), never had this issue

Are any FS mounted by autofs?

amanharitsh123 commented 6 years ago

Probably not , I think this erro Method gave invalid 103 redirect messageis due to some broken ppa this happens while apt update checking for ftps

mkreisl commented 6 years ago

Do you really run sudo -E $xbiangit --action build? Why do you omit parameter --arch paramater

amanharitsh123 commented 6 years ago

Because i was not sure which one to choose for rpi3

mkreisl commented 6 years ago

In your case amd64stretch is the best choice

I already mentioned this:

Current Debian is Stretch, so you have to install amd64stretch root environment if you want to build Kodi package for Pi 2/3

amanharitsh123 commented 6 years ago

Well , i think emdebian.org doesnt contain armhf packages for debian jessie we can add this as a mirror http://ftp.debian.org/debian/dists/jessie/main/binary-armhf/ But i dont know where to make changes