Advertisement
Guest User

Untitled

a guest
Mar 1st, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.44 KB | None | 0 0
  1. # DisplayName: Jolla grouper/@ARCH@ (release) 1
  2. # KickstartType: release
  3. # DeviceModel: grouper
  4. # DeviceVariant: grouper
  5. # SuggestedImageType: fs
  6. # SuggestedArchitecture: armv7hl
  7.  
  8. user --name nemo --groups audio,input,video --password nemo
  9. keyboard us
  10. lang en_US.UTF-8
  11. timezone --utc UTC
  12.  
  13. ### Commands from /tmp/sandbox/usr/share/ssu/kickstart/part/default
  14. part / --size 500 --ondisk sda --fstype=ext4
  15.  
  16. ## No suitable configuration found in /tmp/sandbox/usr/share/ssu/kickstart/bootloader
  17.  
  18. repo --name=adaptation0-grouper-@RELEASE@ --baseurl=https://store-repository.jolla.com/releases/@RELEASE@/jolla-hw/adaptation-asus-grouper/@ARCH@/
  19. repo --name=apps-@RELEASE@ --baseurl=https://releases.jolla.com/jolla-apps/@RELEASE@/@ARCH@/
  20. repo --name=hotfixes-@RELEASE@ --baseurl=https://releases.jolla.com/releases/@RELEASE@/hotfixes/@ARCH@/
  21. repo --name=jolla-@RELEASE@ --baseurl=https://releases.jolla.com/releases/@RELEASE@/jolla/@ARCH@/
  22.  
  23. %packages
  24. @Jolla Configuration grouper
  25. %end
  26.  
  27. %attachment
  28. ### Commands from /tmp/sandbox/usr/share/ssu/kickstart/attachment/grouper
  29. /boot/hybris-boot.img
  30. /boot/hybris-updater-script
  31. /boot/hybris-updater-unpack.sh
  32. /boot/update-binary
  33.  
  34. %end
  35.  
  36. %pre
  37. export SSU_RELEASE_TYPE=release
  38. ### begin 01_init
  39. touch $INSTALL_ROOT/.bootstrap
  40. ### end 01_init
  41. %end
  42.  
  43. %post
  44. export SSU_RELEASE_TYPE=release
  45. ### begin 01_arch-hack
  46. if [ "@ARCH@" == armv7hl ] || [ "@ARCH@" == armv7tnhl ]; then
  47. # Without this line the rpm does not get the architecture right.
  48. echo -n "@ARCH@-meego-linux" > /etc/rpm/platform
  49.  
  50. # Also libzypp has problems in autodetecting the architecture so we force tha as well.
  51. # https://bugs.meego.com/show_bug.cgi?id=11484
  52. echo "arch = @ARCH@" >> /etc/zypp/zypp.conf
  53. fi
  54. ### end 01_arch-hack
  55. ### begin 01_rpm-rebuilddb
  56. # Rebuild db using target's rpm
  57. echo -n "Rebuilding db using target rpm.."
  58. rm -f /var/lib/rpm/__db*
  59. rpm --rebuilddb
  60. echo "done"
  61. ### end 01_rpm-rebuilddb
  62. ### begin 50_oneshot
  63. # exit boostrap mode
  64. rm -f /.bootstrap
  65.  
  66. # export some important variables until there's a better solution
  67. export LANG=en_US.UTF-8
  68. export LC_COLLATE=en_US.UTF-8
  69. export GSETTINGS_BACKEND=gconf
  70.  
  71. # run the oneshot triggers for root and first user uid
  72. UID_MIN=$(grep "^UID_MIN" /etc/login.defs | tr -s " " | cut -d " " -f2)
  73. DEVICEUSER=`getent passwd $UID_MIN | sed 's/:.*//'`
  74.  
  75. if [ -x /usr/bin/oneshot ]; then
  76. su -c "/usr/bin/oneshot --mic"
  77. su -c "/usr/bin/oneshot --mic" $DEVICEUSER
  78. fi
  79. ### end 50_oneshot
  80. ### begin 60_ssu
  81. if [ "$SSU_RELEASE_TYPE" = "rnd" ]; then
  82. [ -n "@RNDRELEASE@" ] && ssu release -r @RNDRELEASE@
  83. [ -n "@RNDFLAVOUR@" ] && ssu flavour @RNDFLAVOUR@
  84. # RELEASE is reused in RND setups with parallel release structures
  85. # this makes sure that an image created from such a structure updates from there
  86. [ -n "@RELEASE@" ] && ssu set update-version @RELEASE@
  87. ssu mode 2
  88. else
  89. [ -n "@RELEASE@" ] && ssu release @RELEASE@
  90. ssu mode 4
  91. fi
  92. ### end 60_ssu
  93. ### begin 70_sdk-domain
  94.  
  95. export SSU_DOMAIN=@RNDFLAVOUR@
  96.  
  97. if [ "$SSU_RELEASE_TYPE" = "release" ] && [[ "$SSU_DOMAIN" = "public-sdk" ]];
  98. then
  99. ssu domain sailfish
  100. fi
  101. ### end 70_sdk-domain
  102. %end
  103.  
  104. %post --nochroot
  105. export SSU_RELEASE_TYPE=release
  106. ### begin 01_release
  107. if [ -n "$IMG_NAME" ]; then
  108. echo "BUILD: $IMG_NAME" >> $INSTALL_ROOT/etc/meego-release
  109. fi
  110. ### end 01_release
  111. ### begin grouper
  112. cp $INSTALL_ROOT/etc/os-release $IMG_OUT_DIR
  113. ls -l $INSTALL_ROOT/usr/share/ssu/features.d/customer-*.ini &> /dev/null
  114. if [ "$?" == "0" ]; then
  115. for CFILE in $(ls -1 $INSTALL_ROOT/usr/share/ssu/features.d/customer-*.ini); do
  116. CUSTOMER_TMP+=${CUSTOMER_TMP:+ }$(grep -i "^name[ ]*=" $CFILE | sed 's/^.*=[ \t]*//')
  117. done
  118. echo "SAILFISH_CUSTOMER=\""$(echo ${CUSTOMER_TMP} | sed 's![/ ()]\+!_!g')"\"" >> $IMG_OUT_DIR/os-release
  119. fi
  120. ### end grouper
  121. %end
  122.  
  123. %pack
  124. export SSU_RELEASE_TYPE=release
  125. ### begin hybris
  126. pushd $IMG_OUT_DIR
  127.  
  128. DEVICE=grouper
  129.  
  130. VERSION_FILE=./os-release
  131. source $VERSION_FILE
  132.  
  133. # Locate rootfs tar.bz2 archive.
  134. for filename in *.tar.bz2; do
  135. GEN_IMG_BASE=$(basename $filename .tar.bz2)
  136. done
  137.  
  138. if [ ! -e "$GEN_IMG_BASE.tar.bz2" ]; then
  139. echo "No rootfs archive found, exiting ..."
  140. exit 1
  141. fi
  142.  
  143. IMG_SIZE=$(du -h $GEN_IMG_BASE.tar.bz2 | cut -f1)
  144.  
  145. # Output filenames
  146. DST_IMG_BASE=$ID-$DEVICE-$SAILFISH_FLAVOUR-$VERSION_ID@EXTRA_NAME@
  147. DST_IMG=$DST_IMG_BASE.tar.bz2
  148.  
  149. # Copy boot image, updater scripts and updater binary into updater .zip tree.
  150. mkdir -p updater/META-INF/com/google/android
  151.  
  152. mv update-binary updater/META-INF/com/google/android/update-binary
  153. mv hybris-updater-script updater/META-INF/com/google/android/updater-script
  154. mv hybris-updater-unpack.sh updater/updater-unpack.sh
  155. mv hybris-boot.img updater/hybris-boot.img
  156.  
  157. # Temporarily move the rootfs into the updater directory
  158. mv $GEN_IMG_BASE.tar.bz2 updater/$DST_IMG
  159.  
  160. # Update updater-script with image details.
  161. 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
  162.  
  163. # pack updater .zip
  164. pushd updater
  165. 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
  166. popd # updater
  167.  
  168. # Move the rootfs back out of the updater directory
  169. mv updater/$DST_IMG $GEN_IMG_BASE.tar.bz2
  170.  
  171. # Clean up updater .zip working directory.
  172. rm -rf updater
  173.  
  174. popd # $IMG_OUT_DIR
  175. ### end hybris
  176. %end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement