answered
2014-02-10 22:15:05 +0200
as root:
pkcon install zypper
mkdir /chroot
btrfs subvolume create /chroot/base
mkdir /chroot/base/dev
cp -a /dev/zero /chroot/base/dev/zero
mkdir /chroot/base/etc
cp -ar /etc/zypp /chroot/base/etc/
cp -a /etc/boardname /chroot/base/etc/
zypper --root /chroot/base refresh
zypper --root /chroot/base install basesystem rpm rpm-build curl vim-enhanced PackageKit tar make gcc gcc-c++ meego-rpm-config libstdc++-devel
cp /etc/rpm/platform /chroot/base/etc/rpm/
After this, you can chroot and install other stuff... though i usually leave this and snapshot from the base for each package independantly: btrfs subvolume snapshot /chroot/base /chroot/packages/package
NOTE: for some reason, the ssu commands in the chroot are only partly working... the authenticated ones seem not there... mount --bind the store OTP key doesn't help... for now i'm installing packages from outside chroot
apparently using --target armv7hl-meego-linux
(in the rpmbuild --rebuild
) works, but you can't install in the chroot itself... this leads me to believe, i'm missing one part... there's a /etc/rpm/platform file in regular setups, maybe it's related to that...
building packages:
- it seems the best way is to use
rpmbuild --target armv7hl-meego-linux --rebuild file.src.rpm
to avoid building for the wrong target (it seems odd that the default build target isn't for it's own device though) - start by installing src.rpm or putting source in
~/rpmbuild/SOURCES/
and writing a ~/rpmbuild/SPECS/package.spec
- then, build the source rpm thusly:
rpmbuild -bs ~/rpmbuild/SPECS/file.spec
- finally, rebuild the resulting
~/rpmbuild/SRPMS/package-version.src.rpm
with rpmbuild --target armv7hl-meego-linux --rebuild ~/rpmbuild/SRPMS/package-version.src.rpm
- resulting files will be in
~/rpmbuild/RPMS/noarch/
or ~/rpmbuild/RPMS/armv7hl/
- profit!!!
(too bad there is no find-file-in-package option in zypper or pkcon ... fedora & opensuse handle this by adding all files to the provides section... talk about dirty stuff... i guess this could be a reason why the resolver does some odd things...)
So maybe a stupid question, but why would building apps in the main filesystem destroy the phone? I know some devel packages have broken dependencies (due to opengl conflicts between libhybris and mesa), but is that really a problem? I currently build in the main fs on the phone...
mornfall ( 2014-03-15 13:02:19 +0200 )editdepending on conflicts, packages could be removed, or sometimes replaced (by something that might not work). otoh, i would keep the phone system as clean as possible so that later upgrades and stuff don't fail, or well, just to minimize deviation from the well-tested basic system.
but the main advantages of chroot building, is to be able to snapshot for each package, so that you can accurately find the buildrequires (if you want to upstream your work). and remove snapshots that you don't need etc...
AL13N ( 2014-03-15 19:18:52 +0200 )edit