Meego Wiki
Views
From MeeGo wiki
(Difference between revisions)
Jump to: navigation, search
m (How to patch a kernel armv8 for MeeGo with obslight?)
Line 1: Line 1:
= OBS Light Deliverable =
= OBS Light Deliverable =
== How to patch an i586 kernel for MeeGo with obslight? ==
== How to patch an i586 kernel for MeeGo with obslight? ==
-
Create a connection with the OBS server.  
+
Create a connection to an OBS server.  
*You can execute commands where you want.
*You can execute commands where you want.
-
*If you don't have a connection to a OBS server you can use a OBS appliance http://susegallery.com/a/e0uuBG/meego-obs.
+
*If you don't have a connection to a OBS server you can use [http://susegallery.com/a/e0uuBG/meego-obs an OBS appliance].
-
*If you don't have any package in your project, you can use [[Obstag]]
+
*If you don't have any package in your project, you can use [[Obstag | obstag and obs2obscopy]]
  obslight addObsServer --serverApi https://api.meego.com --serverRepo http://download.meego.com/live --user obsuser --password opensuse
  obslight addObsServer --serverApi https://api.meego.com --serverRepo http://download.meego.com/live --user obsuser --password opensuse
Create a local project.  
Create a local project.  
Line 43: Line 43:
  obslight addAndCommitChanges --projectLocalName $ProjectName --package $Package -m "Patch kernel"
  obslight addAndCommitChanges --projectLocalName $ProjectName --package $Package -m "Patch kernel"
-
== How to patch a kernel armv8 for MeeGo with obslight? ==
+
== How to patch an ARM kernel for MeeGo with obslight? ==
-
It's the same approach than the arch i586.  
+
It's the same approach than with i586 architecture.
-
*You can't use the '''kernel''' package for armv8.
+
* You can't use the '''kernel''' package, because it has flags to prevent builds on ARM. Use for example the '''kernel-adaptation-n900''' package.
  obslight addObsServer --serverAPI https://api.meego.com --serverRepos http://download.meego.com/live --user obsuser --passw opensuse
  obslight addObsServer --serverAPI https://api.meego.com --serverRepos http://download.meego.com/live --user obsuser --passw opensuse
  obslight addProject --projectLocalName MeeGo_1.2_oss --projectObsName MeeGo:1.2:oss --obsServer https://api.meego.com --projectArchitecture armv8el --projectTarget standard  
  obslight addProject --projectLocalName MeeGo_1.2_oss --projectObsName MeeGo:1.2:oss --obsServer https://api.meego.com --projectArchitecture armv8el --projectTarget standard  
-
  obslight addPackage --projectLocalName MeeGo_1.2_oss --package kernel
+
  obslight addPackage --projectLocalName MeeGo_1.2_oss --package kernel-adaptation-n900
  obslight createChRoot --projectLocalName MeeGo_1.2_oss
  obslight createChRoot --projectLocalName MeeGo_1.2_oss
-
  obslight addPackageSourceInChRoot --projectLocalName MeeGo_1.2_oss --package kernel  
+
  obslight addPackageSourceInChRoot --projectLocalName MeeGo_1.2_oss --package kernel-adaptation-n900
-
'''Here You may have trouble with zypper'''.[[http://wiki.meego.com/ObsLightDeliverable#Troubleshooting Problem: nothing provides X needed by Y]]
+
 
-
+
Some errors you may encounter:
-
'''Here You may have trouble with the architecture'''.[[http://wiki.meego.com/ObsLightDeliverable#Troubleshooting error: Architecture is not included: armv8el]]
+
* [[ObsLightDeliverable#.22Problem:_nothing_provides_X_needed_by_Y.22 | Problem: nothing provides X needed by Y]]
-
obslight goToChRoot --projectLocalName MeeGo_1.2_oss --package kernel
+
* [[ObsLightDeliverable#.22error:_Architecture_is_not_included:_armv8el.22 | error: Architecture is not included: armv8el]]
-
'''Here You may have trouble with the sh'''.[[http://wiki.meego.com/ObsLightDeliverable#Troubleshooting chroot: failed to run command `sh': No such file or directory]]
+
* [[ObsLightDeliverable#.22chroot:_failed_to_run_command_.60sh.27:_No_such_file_or_directory.22 | chroot: failed to run command `sh': No such file or directory]]
-
  #cp configs/kernel-adaptation-n900.config .config
+
 
-
  #make menuconfig
+
obslight goToChRoot --projectLocalName MeeGo_1.2_oss --package kernel-adaptation-n900
-
  #cp .config config-adaptation-n900
+
  # cp configs/kernel-adaptation-n900.config .config
-
  #exit
+
  # make menuconfig
 +
  # cp .config config-adaptation-n900
 +
  # exit
  vi ~/OBSLight/MeeGo_1.2_oss/MeeGo:1.2:oss/kernel-adaptation-n900/kernel-adaptation-n900.spec
  vi ~/OBSLight/MeeGo_1.2_oss/MeeGo:1.2:oss/kernel-adaptation-n900/kernel-adaptation-n900.spec
-
you must move your patch command '''%patchXXX -p1''' after the command line '''cp $RPM_SOURCE_DIR/config-* .'''
+
You must move your patch command <tt>'''%patchXXX -p1'''</tt> after the command line <tt>'''cp $RPM_SOURCE_DIR/config-* .'''</tt>
-
  obslight makePatch --projectLocalName  MeeGo_1.2_oss  --package $Package --patch myKernelPatch.patch
+
  obslight makePatch --projectLocalName  MeeGo_1.2_oss  --package kernel-adaptation-n900 --patch myKernelPatch.patch
-
  obslight addAndCommitChange --projectLocalName  MeeGo_1.2_oss  --package $Package -m "Patch kernel"
+
  obslight addAndCommitChange --projectLocalName  MeeGo_1.2_oss  --package kernel-adaptation-n900 -m "Patch kernel"
== How install the dependency of a package into the chroot? ==
== How install the dependency of a package into the chroot? ==
-
If the project on your OBS doesn’t provide the dependency you must add a repository to zypper, you have two choice.
+
If the project on your OBS doesn’t provide some dependencies and you must add a repository to your chroot's zypper configuration, you have two choices:
 +
* First one, use an URL and an alias:
  obslight addRepoInChRoot --projectLocalName MeeGo_1.2_oss --url http://download.meego.com/live/MeeGo:/1.2:/non-oss/MeeGo_1.2/ --alias "MeeGo_non-oss"
  obslight addRepoInChRoot --projectLocalName MeeGo_1.2_oss --url http://download.meego.com/live/MeeGo:/1.2:/non-oss/MeeGo_1.2/ --alias "MeeGo_non-oss"
-
Or
+
* Second one, add the repository of another local project:
  obslight addRepoInChRoot --projectLocalName MeeGo_1.2_oss --fromProject $ProjectName
  obslight addRepoInChRoot --projectLocalName MeeGo_1.2_oss --fromProject $ProjectName

Revision as of 14:16, 26 October 2011

Contents

OBS Light Deliverable

How to patch an i586 kernel for MeeGo with obslight?

Create a connection to an OBS server.

  • You can execute commands where you want.
  • If you don't have a connection to a OBS server you can use an OBS appliance.
  • If you don't have any package in your project, you can use obstag and obs2obscopy
obslight addObsServer --serverApi https://api.meego.com --serverRepo http://download.meego.com/live --user obsuser --password opensuse

Create a local project.

  • The projects are created in ~/OBSLight/MeeGo_1.2_oss/
obslight addProject --projectLocalName MeeGo_1.2_oss --projectObsName MeeGo:1.2:oss --obsServer https://api.meego.com --projectArch i586 --projectTarget standard

Add a package to your local project.

  • The packages are created in ~/OBSLight/MeeGo_1.2_oss/MeeGo:1.2:oss/kernel/
obslight addPackage --projectLocalName MeeGo_1.2_oss --package kernel

Create your chroot.

  • The chroot directory is ~/OBSLight/MeeGo_1.2_oss/aChroot/.
  • The chroot is created with zypper and your repositorie is automatically added.
obslight createChRoot --projectLocalName MeeGo_1.2_oss

Add a package into your chroot.

  • The packages are installed at directory /root/rpmbuild/BUILD/kernel-X.X.X/linux-X.X.X.
  • After the installation, a git repository is created at the packages's directory.
obslight addPackageSourceInChRoot --projectLocalName MeeGo_1.2_oss --package kernel

Now you can work into your chroot.

  • The directory ~/OBSLight/MeeGo_1.2_oss/chrootTransfert/ is mounted into the chroot in /chrootTransfert/.
  • Every scripts execute in aChroot, are stored in /chrootTransfert/ as runMe_YYYY-MM-DD_HHhMMmSS.sh.
obslight goToChRoot --projectLocalName MeeGo_1.2_oss --package kernel 
# cp configs/kernel-x86.config .config 
# make menuconfig
# cp .config config-x86

You have two solutions to upstream your work to the OBS server.

  • By making a patch
# exit
obslight makePatch --projectLocalName  $ProjectName  --package $Package --patch myKernelPatch.patch
vi ~/OBSLight/MeeGo_1.2_oss/MeeGo:1.2:oss/kernel/kernel.spec 

You must move your patch command %patchXXX -p1 after the command line cp $RPM_SOURCE_DIR/config-* .

  • By copying the new configuration file
# cp config-x86 /chrootTransfert/config-x86
# exit
cp /chrootTransfert/config-x86 ~/OBSLight/MeeGo_1.2_oss/MeeGo:1.2:oss/kernel/

Now you can commit.

  • The command addAndCommitChanges ckeck the add and the delete files, before commit the package.
obslight addAndCommitChanges --projectLocalName $ProjectName --package $Package -m "Patch kernel"

How to patch an ARM kernel for MeeGo with obslight?

It's the same approach than with i586 architecture.

  • You can't use the kernel package, because it has flags to prevent builds on ARM. Use for example the kernel-adaptation-n900 package.
obslight addObsServer --serverAPI https://api.meego.com --serverRepos http://download.meego.com/live --user obsuser --passw opensuse
obslight addProject --projectLocalName MeeGo_1.2_oss --projectObsName MeeGo:1.2:oss --obsServer https://api.meego.com --projectArchitecture armv8el --projectTarget standard 
obslight addPackage --projectLocalName MeeGo_1.2_oss --package kernel-adaptation-n900
obslight createChRoot --projectLocalName MeeGo_1.2_oss
obslight addPackageSourceInChRoot --projectLocalName MeeGo_1.2_oss --package kernel-adaptation-n900

Some errors you may encounter:

obslight goToChRoot --projectLocalName MeeGo_1.2_oss --package kernel-adaptation-n900
# cp configs/kernel-adaptation-n900.config .config
# make menuconfig
# cp .config config-adaptation-n900
# exit
vi ~/OBSLight/MeeGo_1.2_oss/MeeGo:1.2:oss/kernel-adaptation-n900/kernel-adaptation-n900.spec

You must move your patch command %patchXXX -p1 after the command line cp $RPM_SOURCE_DIR/config-* .

obslight makePatch --projectLocalName  MeeGo_1.2_oss  --package kernel-adaptation-n900 --patch myKernelPatch.patch
obslight addAndCommitChange --projectLocalName  MeeGo_1.2_oss  --package kernel-adaptation-n900 -m "Patch kernel"

How install the dependency of a package into the chroot?

If the project on your OBS doesn’t provide some dependencies and you must add a repository to your chroot's zypper configuration, you have two choices:

  • First one, use an URL and an alias:
obslight addRepoInChRoot --projectLocalName MeeGo_1.2_oss --url http://download.meego.com/live/MeeGo:/1.2:/non-oss/MeeGo_1.2/ --alias "MeeGo_non-oss"
  • Second one, add the repository of another local project:
obslight addRepoInChRoot --projectLocalName MeeGo_1.2_oss --fromProject $ProjectName
Personal tools