1. # DisplayName: Jolla pollux/@[email protected] (release) 1
  2. # KickstartType: release
  3. # SuggestedImageType: fs
  4. # SuggestedArchitecture: armv7hl
  5. user --name nemo --groups audio,video --password nemo
  6. timezone --utc UTC
  7. lang en_US.UTF-8
  8. keyboard us
  9. ### Commands from /tmp/sandbox/usr/share/ssu/kickstart/part/default
  10. part / --size 500 --ondisk sda --fstype=ext4
  11. ## No suitable configuration found in /tmp/sandbox/usr/share/ssu/kickstart/bootloader
  12. repo [email protected]@ --baseurl=file:///home/corvinux/mer/android/droid/droid-local-repo/pollux
  13. repo [email protected]@ --baseurl=https://releases.jolla.com/jolla-apps/@[email protected]/@[email protected]/
  14. repo [email protected]@ --baseurl=https://releases.jolla.com/releases/@[email protected]/hotfixes/@[email protected]/
  15. repo [email protected]@ --baseurl=https://releases.jolla.com/releases/@[email protected]/jolla/@[email protected]/
  16. repo [email protected]@ --baseurl=http://repo.merproject.org/obs/home:/mal:/testing2/sailfishos_latest_armv7hl/
  17. repo --name=mal-fixed-package --baseurl=http://repo.merproject.org/obs/home:/mal:/testing/sailfishos_latest_armv7hl/
  18. %packages
  19. @jolla-hw-adaptation-pollux
  20. #droid-config-pollux-policy-settings
  21. %end
  22. %attachment
  23. ### Commands from /tmp/sandbox/usr/share/ssu/kickstart/attachment/pollux
  24. /boot/hybris-boot.img
  25. /boot/hybris-updater-script
  26. /boot/hybris-updater-unpack.sh
  27. /boot/update-binary
  28. %end
  29. %pre
  30. export SSU_RELEASE_TYPE=release
  31. ### begin 01_init
  32. touch $INSTALL_ROOT/.bootstrap
  33. ### end 01_init
  34. %end
  35. %post
  36. export SSU_RELEASE_TYPE=release
  37. ### begin 01_arch-hack
  38. if [ "@[email protected]" == armv7hl ] || [ "@[email protected]" == armv7tnhl ]; then
  39. # Without this line the rpm does not get the architecture right.
  40. echo -n "@[email protected]" > /etc/rpm/platform
  41. # Also libzypp has problems in autodetecting the architecture so we force tha as well.
  42. # https://bugs.meego.com/show_bug.cgi?id=11484
  43. echo "arch = @[email protected]" >> /etc/zypp/zypp.conf
  44. fi
  45. ### end 01_arch-hack
  46. ### begin 01_rpm-rebuilddb
  47. # Rebuild db using target's rpm
  48. echo -n "Rebuilding db using target rpm.."
  49. rm -f /var/lib/rpm/__db*
  50. rpm --rebuilddb
  51. echo "done"
  52. ### end 01_rpm-rebuilddb
  53. ### begin 50_oneshot
  54. # exit boostrap mode
  55. rm -f /.bootstrap
  56. # export some important variables until there's a better solution
  57. export LANG=en_US.UTF-8
  58. export LC_COLLATE=en_US.UTF-8
  59. export GSETTINGS_BACKEND=gconf
  60. # run the oneshot triggers for root and first user uid
  61. UID_MIN=$(grep "^UID_MIN" /etc/login.defs | tr -s " " | cut -d " " -f2)
  62. DEVICEUSER=`getent passwd $UID_MIN | sed 's/:.*//'`
  63. if [ -x /usr/bin/oneshot ]; then
  64. su -c "/usr/bin/oneshot --mic"
  65. su -c "/usr/bin/oneshot --mic" $DEVICEUSER
  66. fi
  67. ### end 50_oneshot
  68. ### begin 60_ssu
  69. if [ "$SSU_RELEASE_TYPE" = "rnd" ]; then
  70. [ -n "@[email protected]" ] && ssu release -r @[email protected]
  71. [ -n "@[email protected]" ] && ssu flavour @[email protected]
  72. # RELEASE is reused in RND setups with parallel release structures
  73. # this makes sure that an image created from such a structure updates from there
  74. [ -n "@[email protected]" ] && ssu set update-version @[email protected]
  75. ssu mode 2
  76. else
  77. [ -n "@[email protected]" ] && ssu release @[email protected]
  78. ssu mode 4
  79. fi
  80. ### end 60_ssu
  81. ### begin 70_sdk-domain
  82. if [ "$SSU_RELEASE_TYPE" = "release" ] && [[ "$SSU_DOMAIN" = "public-sdk" ]];
  83. then
  84. ssu domain sailfish
  85. fi
  86. ### end 70_sdk-domain
  87. %end
  88. %post --nochroot
  89. export SSU_RELEASE_TYPE=release
  90. ### begin 01_release
  91. if [ -n "$IMG_NAME" ]; then
  92. echo "BUILD: $IMG_NAME" >> $INSTALL_ROOT/etc/meego-release
  93. fi
  94. ### end 01_release
  95. ### begin pollux
  96. cp $INSTALL_ROOT/etc/sailfish-release $IMG_OUT_DIR
  97. ### end pollux
  98. %end
  99. %pack
  100. export SSU_RELEASE_TYPE=release
  101. ### begin hybris
  102. pushd $IMG_OUT_DIR
  103. DEVICE=pollux
  104. VERSION_FILE=./sailfish-release
  105. source $VERSION_FILE
  106. # Locate rootfs tar.bz2 archive.
  107. for filename in *.tar.bz2; do
  108. GEN_IMG_BASE=$(basename $filename .tar.bz2)
  109. done
  110. if [ ! -e "$GEN_IMG_BASE.tar.bz2" ]; then
  111. echo "No rootfs archive found, exiting ..."
  112. exit 1
  113. fi
  114. IMG_SIZE=$(du -h $GEN_IMG_BASE.tar.bz2 | cut -f1)
  115. # Output filenames
  116. DST_IMG=$DST_IMG_BASE.tar.bz2
  117. # Copy boot image, updater scripts and updater binary into updater .zip tree.
  118. mkdir -p updater/META-INF/com/google/android
  119. mv update-binary updater/META-INF/com/google/android/update-binary
  120. mv hybris-updater-script updater/META-INF/com/google/android/updater-script
  121. mv hybris-updater-unpack.sh updater/updater-unpack.sh
  122. mv hybris-boot.img updater/hybris-boot.img
  123. # Temporarily move the rootfs into the updater directory
  124. mv $GEN_IMG_BASE.tar.bz2 updater/$DST_IMG
  125. # Update updater-script with image details.
  126. sed -i -e "s %VERSION% $VERSION_ID g" -e "s %IMAGE_FILE% $DST_IMG g" -e "s %IMAGE_SIZE% $IMG_SIZE g" updater/META-INF/com/google/android/updater-script
  127. # pack updater .zip
  128. pushd updater
  129. zip -r ../$DST_IMG_BASE.zip META-INF/com/google/android/update-binary META-INF/com/google/android/updater-script updater-unpack.sh hybris-boot.img $DST_IMG_BASE.ks $DST_IMG
  130. popd # updater
  131. # Move the rootfs back out of the updater directory
  132. mv updater/$DST_IMG $GEN_IMG_BASE.tar.bz2
  133. # Clean up updater .zip working directory.
  134. rm -rf updater
  135. popd # $IMG_OUT_DIR
  136. ### end hybris
  137. %end