1. # DisplayName: Jolla pollux/@ARCH@ (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 --name=adaptation0-pollux-@RELEASE@ --baseurl=file:///home/corvinux/mer/android/droid/droid-local-repo/pollux
  13. repo --name=apps-@RELEASE@ --baseurl=https://releases.jolla.com/jolla-apps/@RELEASE@/@ARCH@/
  14. repo --name=hotfixes-@RELEASE@ --baseurl=https://releases.jolla.com/releases/@RELEASE@/hotfixes/@ARCH@/
  15. repo --name=jolla-@RELEASE@ --baseurl=https://releases.jolla.com/releases/@RELEASE@/jolla/@ARCH@/
  16. repo --name=testing-2@RELEASE@ --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 [ "@ARCH@" == armv7hl ] || [ "@ARCH@" == armv7tnhl ]; then
  39. # Without this line the rpm does not get the architecture right.
  40. echo -n "@ARCH@-meego-linux" > /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 = @ARCH@" >> /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 "@RNDRELEASE@" ] && ssu release -r @RNDRELEASE@
  71. [ -n "@RNDFLAVOUR@" ] && ssu flavour @RNDFLAVOUR@
  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 "@RELEASE@" ] && ssu set update-version @RELEASE@
  75. ssu mode 2
  76. else
  77. [ -n "@RELEASE@" ] && ssu release @RELEASE@
  78. ssu mode 4
  79. fi
  80. ### end 60_ssu
  81. ### begin 70_sdk-domain
  82. export SSU_DOMAIN=@RNDFLAVOUR@
  83. if [ "$SSU_RELEASE_TYPE" = "release" ] && [[ "$SSU_DOMAIN" = "public-sdk" ]];
  84. then
  85. ssu domain sailfish
  86. fi
  87. ### end 70_sdk-domain
  88. %end
  89. %post --nochroot
  90. export SSU_RELEASE_TYPE=release
  91. ### begin 01_release
  92. if [ -n "$IMG_NAME" ]; then
  93. echo "BUILD: $IMG_NAME" >> $INSTALL_ROOT/etc/meego-release
  94. fi
  95. ### end 01_release
  96. ### begin pollux
  97. cp $INSTALL_ROOT/etc/sailfish-release $IMG_OUT_DIR
  98. ### end pollux
  99. %end
  100. %pack
  101. export SSU_RELEASE_TYPE=release
  102. ### begin hybris
  103. pushd $IMG_OUT_DIR
  104. DEVICE=pollux
  105. VERSION_FILE=./sailfish-release
  106. source $VERSION_FILE
  107. # Locate rootfs tar.bz2 archive.
  108. for filename in *.tar.bz2; do
  109. GEN_IMG_BASE=$(basename $filename .tar.bz2)
  110. done
  111. if [ ! -e "$GEN_IMG_BASE.tar.bz2" ]; then
  112. echo "No rootfs archive found, exiting ..."
  113. exit 1
  114. fi
  115. IMG_SIZE=$(du -h $GEN_IMG_BASE.tar.bz2 | cut -f1)
  116. # Output filenames
  117. DST_IMG_BASE=$ID-$DEVICE-$SAILFISH_FLAVOUR-$VERSION_ID@EXTRA_NAME@
  118. DST_IMG=$DST_IMG_BASE.tar.bz2
  119. # Copy boot image, updater scripts and updater binary into updater .zip tree.
  120. mkdir -p updater/META-INF/com/google/android
  121. mv update-binary updater/META-INF/com/google/android/update-binary
  122. mv hybris-updater-script updater/META-INF/com/google/android/updater-script
  123. mv hybris-updater-unpack.sh updater/updater-unpack.sh
  124. mv hybris-boot.img updater/hybris-boot.img
  125. # Temporarily move the rootfs into the updater directory
  126. mv $GEN_IMG_BASE.tar.bz2 updater/$DST_IMG
  127. # Update updater-script with image details.
  128. 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
  129. # pack updater .zip
  130. pushd updater
  131. 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
  132. popd # updater
  133. # Move the rootfs back out of the updater directory
  134. mv updater/$DST_IMG $GEN_IMG_BASE.tar.bz2
  135. # Clean up updater .zip working directory.
  136. rm -rf updater
  137. popd # $IMG_OUT_DIR
  138. ### end hybris
  139. %end