Difference between revisions of "Porting Raspbian"

From LinuxMCE
Jump to: navigation, search
m
Line 1: Line 1:
 
[[Category: Development]]
 
[[Category: Development]]
 
This will attempt to highlight some of the requirements/process intended/followed for porting lmce to raspbian for use on the raspberry pi.
 
This will attempt to highlight some of the requirements/process intended/followed for porting lmce to raspbian for use on the raspberry pi.
 +
== Test Booting an RPi ==
 +
*on the core
 +
**edit /usr/pluto/bin/Diskless_CreateTBZ.sh to enable "raspbian_armhf" as a TARGET_TYPE (this requires updated script not yet accepted in svn)
 +
**run /usr/pluto/bin/Diskless_CreateTBZ.sh to create a raspbian tarball
 +
**sqlCVS update to get device template (if you don't have it)
 +
**add "Raspberry Pi as MD" (#2216) device to the root of your tree
 +
**choose "Rebuild Image" on your RPi device in the Wizard->Devices->Media Directors section of the webadmin
 +
*on any system
 +
**dd an existing raspbian sd image from raspberrypi.org onto an sd card and edit the cmdline.txt file in the fat32 partition
 +
**replace XX with the moon# of the MD you created when manually adding the DT to your system
 +
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/nfs nfsroot=192.168.80.1:/usr/pluto/diskless/XX ip=dhcp rootfstype=nfs
 +
*on RPi
 +
**plug in sdcard, hdmi, ethernet, turn on... mmmm, pi...
 +
**ssh is installed, typical md filesystem mounts are in place (some may go away due to arch differences in future)
 
= TODO =
 
= TODO =
 
== Builder ==
 
== Builder ==
Line 19: Line 33:
 
***build-maindebs.sh - need to disable building some packages on RPi, namely game stuff and pre-built binary stuff (uirt, etc) - done
 
***build-maindebs.sh - need to disable building some packages on RPi, namely game stuff and pre-built binary stuff (uirt, etc) - done
 
*attempt a build - working... fixing... working... qemu building is stretching my patience and failing in strange ways, may need to go back to cross-compiling, scratchbox2 was working well.
 
*attempt a build - working... fixing... working... qemu building is stretching my patience and failing in strange ways, may need to go back to cross-compiling, scratchbox2 was working well.
 +
**this takes a long, long time.  Right now build time on 4 cores (@ 3.4Ghz) under qemu is ~4.5hrs between start of build and package failures, havn't reached the end yet...
 +
**it has come to my attention that qmake (which is required to build qOrbiter) may not fuction under qemu, need to setup a build-env for qOrbiter and work the lmce build into that environment... http://qt-project.org/wiki/RaspberryPi ???
 
== Creating Pi MD ==
 
== Creating Pi MD ==
=== Device Template ===
+
=== Booting - Goal ===
*a device template for the Pi so it's specific MD needs are recognized and implemented automatically, proper devices started. (submitted to sqlCVS, currently testing)
+
*mac lookup: B8:27:EB:00:00:00 - B8:27:EB:FF:FF:FF Raspberry Pi Foundation
+
** /usr/pluto/bin/convert_mac B8:27:EB:00:00:00 = 202481585881088
+
** /usr/pluto/bin/convert_mac B8:27:EB:FF:FF:FF = 202481602658303
+
=== Install ===
+
*initially user will add a DT to their system manually - (in testing)
+
*build a complete diskless image from the initial debootstrapped image to untar similar to current i386 - (in testing)
+
*alter the diskless setup scripts to create raspbian /usr/pluto/diskless/XX folders from debootstrapped image or from scratch (similar to current i386) - (in testing)
+
*later it will autodetect on first boot similar to current i386
+
=== Booting - goal ===
+
 
*SD fat32 formatted with RPi boot files and MD initial config installed (can be done easily from a Windows PC or ...)
 
*SD fat32 formatted with RPi boot files and MD initial config installed (can be done easily from a Windows PC or ...)
 
*diskless boot (nfs rootfs actually) - u-boot & netboot? may permit easier integration?
 
*diskless boot (nfs rootfs actually) - u-boot & netboot? may permit easier integration?
**using nfs for rootfs with kernel on an SD card IS possible: kernel is loaded by gpu prior to boot, video config and kernel are both on the SD card.
+
**NewMDInteractor ??
**need raspbian diskless image, disklesscreatetbz?, etc.
+
**NewMDInteractor/CreateDiskless likely need changes to support multi arch/multi distro, in conjunction with RaspberryPi as MD device template - needs investigation
+
***maybe not, as it isn't pxe the pnp system could detect the MAC and setup the DT and extract an debootstrapped image, could be all that is required? user would have to edit files on sd card so not ideal
+
 
*boot scripts
 
*boot scripts
 
*avwizard
 
*avwizard
Line 43: Line 46:
 
**graphics setup is performed by gpu prior to the kernel boot.
 
**graphics setup is performed by gpu prior to the kernel boot.
 
**method of setting/determining graphics mode - config.txt - changing resolution, anything really, requires reboot for gpu init
 
**method of setting/determining graphics mode - config.txt - changing resolution, anything really, requires reboot for gpu init
 +
*setup wizard
 +
**same as avwiz
 
=== UI/Media ===
 
=== UI/Media ===
 
*qOrbiter on Pi
 
*qOrbiter on Pi
*qMediaPlayer on Pi?
+
*qMediaPlayer on Pi
*omxplayer player & streamer pair?
+
**as mpeg2 is now available on the RPi it is possible a streamer may not be required, at least initially
+
 
== Other ==
 
== Other ==
 
*arm libs required for pre-compiled libraries (usb-uirt, external media identifier?/id-my-disc?, more?)
 
*arm libs required for pre-compiled libraries (usb-uirt, external media identifier?/id-my-disc?, more?)
*mythtv frontend is too heavy for RPi, recordings will need to be natively played by omxplayer
+
*mythtv frontend is too heavy for RPi
 
= DONE =
 
= DONE =
 
== New database data ==
 
== New database data ==
Line 71: Line 74:
 
  insert into Package_Source_Compat (FK_Package_Source, FK_OperatingSystem, FK_Distro) select PK_Package_Source, "1", "19" from Package_Source where FK_RepositorySource in (22,23)
 
  insert into Package_Source_Compat (FK_Package_Source, FK_OperatingSystem, FK_Distro) select PK_Package_Source, "1", "19" from Package_Source where FK_RepositorySource in (22,23)
 
*fix package names that are inconsistent between raspbian and ubuntu: (then sqlCVS diff/approval/update) - Initially Done, likely find more inconsistencies
 
*fix package names that are inconsistent between raspbian and ubuntu: (then sqlCVS diff/approval/update) - Initially Done, likely find more inconsistencies
 +
== Creating Pi MD ==
 +
=== Device Template ===
 +
*Device Template #2216, sqlCVS update if you want it
 +
*a device template for the Pi so it's specific MD needs are recognized and implemented automatically, proper devices started. - done
 +
*mac lookup: B8:27:EB:00:00:00 - B8:27:EB:FF:FF:FF Raspberry Pi Foundation
 +
** /usr/pluto/bin/convert_mac B8:27:EB:00:00:00 = 202481585881088
 +
** /usr/pluto/bin/convert_mac B8:27:EB:FF:FF:FF = 202481602658303
 +
=== Install ===
 +
*initially user will add a DT to their system manually - works
 +
*build a complete diskless image from the initial debootstrapped image to untar similar to current i386 - works
 +
*alter the diskless setup scripts to create raspbian /usr/pluto/diskless/XX folders from debootstrapped image or from scratch (similar to current i386) - works
 +
**Diskless_CreateTBZ.sh needs to be edited to enable building a raspbian tarball as well as the standard ubuntu tarball, uncomment appropriate line at top of file - works

Revision as of 00:55, 7 September 2012

This will attempt to highlight some of the requirements/process intended/followed for porting lmce to raspbian for use on the raspberry pi.

Test Booting an RPi

  • on the core
    • edit /usr/pluto/bin/Diskless_CreateTBZ.sh to enable "raspbian_armhf" as a TARGET_TYPE (this requires updated script not yet accepted in svn)
    • run /usr/pluto/bin/Diskless_CreateTBZ.sh to create a raspbian tarball
    • sqlCVS update to get device template (if you don't have it)
    • add "Raspberry Pi as MD" (#2216) device to the root of your tree
    • choose "Rebuild Image" on your RPi device in the Wizard->Devices->Media Directors section of the webadmin
  • on any system
    • dd an existing raspbian sd image from raspberrypi.org onto an sd card and edit the cmdline.txt file in the fat32 partition
    • replace XX with the moon# of the MD you created when manually adding the DT to your system
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/nfs nfsroot=192.168.80.1:/usr/pluto/diskless/XX ip=dhcp rootfstype=nfs
  • on RPi
    • plug in sdcard, hdmi, ethernet, turn on... mmmm, pi...
    • ssh is installed, typical md filesystem mounts are in place (some may go away due to arch differences in future)

TODO

Builder

Many scripts are used to create a builder and perform a build.

  • build a builder - based on an old create_builder.sh script - done
    • creates raspbian build environment AND lucid i386 build environments (one script to build them all :P)
    • source is shared between multiple chroot build environments
    • database is shared between multiple chroot build environments (mysqld runs on host system)
      • mysqld seg faults when run under static qemu in the armhf chroot, solution above
  • Conf files need update - most of this is done, needs a little re-work
    • builder.conf, raspbian.conf? (from ubuntu.conf/debian.conf)
    • Build dependencies list needs updating. - ongoing, lots to remove probably, needs testing (laborious)
  • build scripts need update - mostly done
    • alter prepare-scripts to accomodate new distro, new flavor and new arch, where required - done
      • create initial debootstrapped image - done
      • import-databases.sh - MakeRelease_PrepFiles fails prepping databases, I think this is a console command line length issue, import under lucid chroot to shared database for raspbian chroot build.
    • alter build-scripts to accomodate new distro, new flavor and new arch, where required - done
      • build-maindebs.sh - need to disable building some packages on RPi, namely game stuff and pre-built binary stuff (uirt, etc) - done
  • attempt a build - working... fixing... working... qemu building is stretching my patience and failing in strange ways, may need to go back to cross-compiling, scratchbox2 was working well.
    • this takes a long, long time. Right now build time on 4 cores (@ 3.4Ghz) under qemu is ~4.5hrs between start of build and package failures, havn't reached the end yet...
    • it has come to my attention that qmake (which is required to build qOrbiter) may not fuction under qemu, need to setup a build-env for qOrbiter and work the lmce build into that environment... http://qt-project.org/wiki/RaspberryPi ???

Creating Pi MD

Booting - Goal

  • SD fat32 formatted with RPi boot files and MD initial config installed (can be done easily from a Windows PC or ...)
  • diskless boot (nfs rootfs actually) - u-boot & netboot? may permit easier integration?
    • NewMDInteractor ??
  • boot scripts
  • avwizard
    • current avwizard uses X, raspi will not be, need alternate method
    • initially simple and functional - whiptail initially
    • graphics setup is performed by gpu prior to the kernel boot.
    • method of setting/determining graphics mode - config.txt - changing resolution, anything really, requires reboot for gpu init
  • setup wizard
    • same as avwiz

UI/Media

  • qOrbiter on Pi
  • qMediaPlayer on Pi

Other

  • arm libs required for pre-compiled libraries (usb-uirt, external media identifier?/id-my-disc?, more?)
  • mythtv frontend is too heavy for RPi

DONE

New database data

Linuxmce uses the database at build time when creating deb packages for dependencies and later at install time to install those dependencies, add repositories to /etc/sources.list and so on. Since on every release some packages tend to change names or split/merge into others, updating the packages tables is time consuming and you need to do some install/fix cycles before figuring them all out.

Add Distro and Repositories

  • update the 'Distro' table, add Raspbian: (then sqlCVS diff/get batch approved/sqlCVS udpate) - Done.
insert into Distro (Description, FK_OperatingSystem, Installer, SourceCode, Confirmed, InstallerURL ) values ('Raspbian Wheezy', 1, 'ConfirmDependencies_Debian.sh', 'src', 1, 'installDebian.php')
  • update the 'RepositorySource' table, add the main raspbian repo and an lmce raspbian repo [2 entries]: (then sqlCVS diff/get batch approved/sqlCVS update) - Done.
insert into RepositorySource (FK_OperatingSystem, FK_Distro, FK_RepositoryType, Description, Define, Instructions) values ( 1, 19, 1, 'Raspbian', 'Raspbian', 'This package is part of Raspbian')
insert into RepositorySource (FK_OperatingSystem, FK_Distro, FK_RepositoryType, Description, Instructions) values (1, 19, 1, 'Raspbian LinuxMCE addons', 'LinuxMCE packages for Raspbian')
  • update the 'RepositorySource_URL' table, add the URLs for the 2 repositories above [2 entries]: (then sqlCVS diff/get batch approved/sqlCVS update) - Done.
insert into RepositorySource_URL (FK_RepositorySource, URL) values ( 22, 'deb http://archive.raspbian.org/raspbian')
insert into RepositorySource_URL (FK_RepositorySource, URL) values ( 23, 'deb http://deb.linuxmce.org/raspbian')

Add Packages

For packages we are going to copy the entire bank of ubuntu and lmce packages for 1004 to raspbian wheezy entries, then we'll fix up individual package names afterwards.

  • update the 'Package_Source' table, add all Packages from ubuntu lucid as a base, copy ubuntu repo packages and lmce repo packages: (then sqlCVS diff/approval/update) - Done.
insert into Package_Source (FK_Package, Name, FK_RepositorySource, Repository)select FK_Package, Name, "22", "wheezy main" from Package_Source join Package_Source_Compat on Package_Source.PK_Package_Source=Package_Source_Compat.FK_Package_Source where FK_Distro=18 and FK_RepositorySource IN ( 1, 2, 20) 
insert into Package_Source (FK_Package, Name, FK_RepositorySource, Repository)select FK_Package, Name, "23", "wheezy main" from Package_Source join Package_Source_Compat on Package_Source.PK_Package_Source=Package_Source_Compat.FK_Package_Source where FK_Distro=18 and FK_RepositorySource=21
  • update the 'Package_Source_Compat' table, add OS and Distro for all Raspbian packages added in previous inserts: (then sqlCVS diff/approval/update) - Done
insert into Package_Source_Compat (FK_Package_Source, FK_OperatingSystem, FK_Distro) select PK_Package_Source, "1", "19" from Package_Source where FK_RepositorySource in (22,23)
  • fix package names that are inconsistent between raspbian and ubuntu: (then sqlCVS diff/approval/update) - Initially Done, likely find more inconsistencies

Creating Pi MD

Device Template

  • Device Template #2216, sqlCVS update if you want it
  • a device template for the Pi so it's specific MD needs are recognized and implemented automatically, proper devices started. - done
  • mac lookup: B8:27:EB:00:00:00 - B8:27:EB:FF:FF:FF Raspberry Pi Foundation
    • /usr/pluto/bin/convert_mac B8:27:EB:00:00:00 = 202481585881088
    • /usr/pluto/bin/convert_mac B8:27:EB:FF:FF:FF = 202481602658303

Install

  • initially user will add a DT to their system manually - works
  • build a complete diskless image from the initial debootstrapped image to untar similar to current i386 - works
  • alter the diskless setup scripts to create raspbian /usr/pluto/diskless/XX folders from debootstrapped image or from scratch (similar to current i386) - works
    • Diskless_CreateTBZ.sh needs to be edited to enable building a raspbian tarball as well as the standard ubuntu tarball, uncomment appropriate line at top of file - works