Fork me on GitHub

9. Создание Sailfish OS root filesystem

Создание и настройка Kickstart файл

The kickstart file is already generated by the build_packages.sh script, during droid-configs build, using ssuks, which is part of the SSU utility:

MER_SDK $
hadk
cd $ANDROID_ROOT
mkdir -p tmp
HA_REPO="repo --name=adaptation0-$DEVICE-@RELEASE@"
KS="Jolla-@RELEASE@-$DEVICE-@ARCH@.ks"
sed -e \
"s|^$HA_REPO.*$|$HA_REPO --baseurl=file://$ANDROID_ROOT/droid-local-repo/$DEVICE|" \
$ANDROID_ROOT/hybris/droid-configs/installroot/usr/share/kickstarts/$KS \
> tmp/$KS

Создание локальный репозиторий шаблонов

Add/update metadata about patterns using this script (NB: it will fail with a non-critical Exception AttributeError: "’NoneType... error):

MER_SDK $
hadk
cd $ANDROID_ROOT
hybris/droid-configs/droid-configs-device/helpers/process_patterns.sh

Building the Image with MIC

Вот тут можно посмотреть доступные версии Sailfish OS

MER_SDK $
# Set the version of your choosing, latest is strongly preferred
# (check with "Sailfish OS version" link above)
RELEASE=2.0.5.6
# EXTRA_NAME adds your custom tag. It doesn't support '.' dots in it!
EXTRA_NAME=-my1
sudo mic create fs --arch $PORT_ARCH --debug --tokenmap=ARCH:$PORT_ARCH,RELEASE:$RELEASE,EXTRA_NAME:$EXTRA_NAME --record-pkgs=name,url --outdir=sfe-$DEVICE-$RELEASE$EXTRA_NAME --pack-to=sfe-$DEVICE-$RELEASE$EXTRA_NAME.tar.bz2 $ANDROID_ROOT/tmp/Jolla-@RELEASE@-$DEVICE-@ARCH@.ks

в итоге получим файл прошивки через recovery.

Важно! параметра --runtime=native здесь нет, который указан в главе 8.5 в офиц документации по портированию (версии 1.1.2 от 16.06.2016) так как с этим параметром выдает ошибку.

Примечания:

MER_SDK $
sb2 -t $VENDOR-$DEVICE-$PORT_ARCH -R -m sdk-install ssu ar common http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_armv7hl/
Also add the same repo to .ks file before building the installation package with mic
Run the following commands before chapter 8.3 of HADK pdf
MER_SDK $
cd $ANDROID_ROOT
MOBS_URI="http://repo.merproject.org/obs"
HA_REPO="repo --name=adaptation0-$DEVICE-@RELEASE@"
HA_REPO1="repo --name=common \
--baseurl=$MOBS_URI/nemo:/devel:/hw:/common/sailfish_latest_@ARCH@/"
hybris/droid-configs/droid-configs-device/helpers/process_patterns.sh

If MIC fails with 
RuntimeError: Invalid runmode: native 
remove `--runtime=native` from mic command args
  • Verbose: running command: "/bin/umount -l /var/tmp/mic/imgcreate-uN75dq/install_root//sys"

Error: Traceback (most recent call last): File "/usr/bin/mic", line 217, in <module> sys.exit(mic.main()) File "/usr/lib/python2.7/site-packages/mic/utils/cmdln.py", line 257, in main return self.cmd(args) File "/usr/lib/python2.7/site-packages/mic/utils/cmdln.py", line 280, in cmd retval = self.onecmd(argv) File "/usr/lib/python2.7/site-packages/mic/utils/cmdln.py", line 412, in onecmd return self._dispatch_cmd(handler, argv) File "/usr/lib/python2.7/site-packages/mic/utils/cmdln.py", line 1084, in _dispatch_cmd return handler(argv) File "/usr/bin/mic", line 86, in do_create cr.main(argv[1:]) File "/usr/lib/python2.7/site-packages/mic/creator.py", line 266, in main return self.cmd(args) File "/usr/lib/python2.7/site-packages/mic/utils/cmdln.py", line 280, in cmd retval = self.onecmd(argv) File "/usr/lib/python2.7/site-packages/mic/utils/cmdln.py", line 412, in onecmd return self._dispatch_cmd(handler, argv) File "/usr/lib/python2.7/site-packages/mic/utils/cmdln.py", line 1100, in _dispatch_cmd return handler(argv[0], opts, *args) File "/usr/lib/mic/plugins/imager/fs_plugin.py", line 62, in do_create creator.install() File "/usr/lib/python2.7/site-packages/mic/imager/baseimager.py", line 978, in install self.__deref_groups(pkg_manager) File "/usr/lib/python2.7/site-packages/mic/imager/baseimager.py", line 849, in __deref_groups deref = pkg_manager.derefGroups() File "/usr/lib/mic/plugins/backend/zypppkgmgr.py", line 284, in derefGroups self.buildTransaction() File "/usr/lib/mic/plugins/backend/zypppkgmgr.py", line 624, in buildTransaction % len(probs)) RepoError: <repo>found 1 resolver problem, abort!

Решение

  • For devices with /dev/block/platform/msm_sdcc.1/by-name/ paths (msm_sdcc.1 can be different) add to $ANDROID_ROOT/rpm/ these paths and files with contents, and it most probably will help (but still paste your diff to the IRC channel):

  • https://github.com/mer-hybris-kis3/droid-config-kis3/blob/master/sparse/lib/udev/platform-device

  • https://github.com/mer-hybris-kis3/droid-config-kis3/blob/master/sparse/lib/udev/rules.d/998-droid-system.rules

Изменить файлы в папке $ANDROID_ROOT/hybris/droid-configs/droid-configs-device/sparse/lib/udev согласно ссылков выше.

```bash cat 998-droid-system.rules SUBSYSTEM=="graphics", SYMLINK+="$env{SUBSYSTEM}/%k" SUBSYSTEM=="block", SYMLINK+="$env{SUBSYSTEM}/%k" SUBSYSTEM=="drm", SYMLINK+="dri/%k" SUBSYSTEM=="oncrpc", SYMLINK+="$env{SUBSYSTEM}/%k" SUBSYSTEM=="adsp", SYMLINK+="$env{SUBSYSTEM}/%k" SUBSYSTEM=="msm_camera", SYMLINK+="$env{SUBSYSTEM}/%k" SUBSYSTEM=="mtd", SYMLINK+="$env{SUBSYSTEM}/%k" SUBSYSTEM=="block", SYMLINK+="$env{SUBSYSTEM}/%k" SUBSYSTEM=="misc", KERNEL=="log_events", SYMLINK+="alog/events" SUBSYSTEM=="misc", KERNEL=="log_radio", SYMLINK+="alog/radio" SUBSYSTEM=="misc", KERNEL=="log_system", SYMLINK+="alog/system" SUBSYSTEM=="misc", KERNEL=="log_main", SYMLINK+="alog/main"

ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_ENTRY_NAME}=="?*", IMPORT{program}="/bin/sh /lib/udev/platform-device $env{DEVPATH}", SYMLINK+="block/bootdevice/by-name/$env{ID_PART_ENTRY_NAME}"ilnur@ubuntu:~/to/mer/android/droid/hybris/droid-configs/droid-configs-device/sparse/lib/udev/rules.d$ ```

  • Warning: repo problem: pattern:jolla-configuration-Z00L-1-1.noarch requires pattern:jolla-hw-adaptation-Z00L, but this requirement cannot be provided, uninstallable providers: pattern:jolla-hw-adaptation-Z00L-1-1.noarch[adaptation0-Z00L-2.0.5.6]
MER_SDK $
cd $ANDROID_ROOT
MOBS_URI="http://repo.merproject.org/obs"
HA_REPO="repo --name=adaptation0-$DEVICE-@RELEASE@"
HA_REPO1="repo --name=common --baseurl=$MOBS_URI/nemo:/devel:/hw:/common/sailfish_latest_@ARCH@/"
sed -i -e "/^$HA_REPO.*$/a$HA_REPO1" tmp/Jolla-@RELEASE@-$DEVICE-@ARCH@.ks

social