Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.26 KB | None | 0 0
  1. # DisplayName: Jolla f5121/armv7hl (release) 1+master.20170915075713.92d0f79
  2. # KickstartType: release
  3. # SuggestedFeatures: customer-jolla, sailfish-xt9, sailfish-eas, jolla-store-apps, aliendalvik-feature
  4. # SuggestedImageType: loop
  5. # SuggestedArchitecture: armv7hl
  6.  
  7. lang en_US.UTF-8
  8. timezone --utc UTC
  9. user --name nemo --groups audio,video --password nemo
  10. keyboard us
  11.  
  12. ### Commands from /tmp/sandbox/usr/share/ssu/kickstart/part/f5121
  13. part / --fstype="ext4" --size=1800 --label=root
  14. part /home --fstype="ext4" --size=800 --label=home
  15. part /fimage --fstype="ext4" --size=10 --label=fimage
  16.  
  17. ## No suitable configuration found in /tmp/sandbox/usr/share/ssu/kickstart/bootloader
  18.  
  19. repo --name=adaptation0-f5121-2.1.1.26 --baseurl=http://repo.merproject.org/obs/home:/mgrover:/devel:/hw:/sony:/f5121/sailfish_latest_armv7hl/
  20. repo --name=apps-2.1.1.26 --baseurl=https://releases.jolla.com/jolla-apps/2.1.1.26/armv7hl/
  21. repo --name=hotfixes-2.1.1.26 --baseurl=https://releases.jolla.com/releases/2.1.1.26/hotfixes/armv7hl/
  22. repo --name=jolla-2.1.1.26 --baseurl=https://releases.jolla.com/releases/2.1.1.26/jolla/armv7hl/
  23.  
  24. %packages
  25. @Jolla Configuration f5121
  26. %end
  27.  
  28. %attachment
  29. ### Commands from /tmp/sandbox/usr/share/ssu/kickstart/attachment/f5121
  30. /boot/hybris-boot.img
  31. droid-config-f5121-out-of-image-files
  32. /etc/hw-release
  33. %end
  34.  
  35. %pre
  36. export SSU_RELEASE_TYPE=release
  37. ### begin 01_init
  38. touch $INSTALL_ROOT/.bootstrap
  39. ### end 01_init
  40. %end
  41.  
  42. %post
  43. export SSU_RELEASE_TYPE=release
  44. ### begin 01_arch-hack
  45. if [ "armv7hl" == armv7hl ] || [ "armv7hl" == armv7tnhl ]; then
  46. # Without this line the rpm does not get the architecture right.
  47. echo -n "armv7hl-meego-linux" > /etc/rpm/platform
  48.  
  49. # Also libzypp has problems in autodetecting the architecture so we force tha as well.
  50. # https://bugs.meego.com/show_bug.cgi?id=11484
  51. echo "arch = armv7hl" >> /etc/zypp/zypp.conf
  52. fi
  53. ### end 01_arch-hack
  54. ### begin 01_rpm-rebuilddb
  55. # Rebuild db using target's rpm
  56. echo -n "Rebuilding db using target rpm.."
  57. rm -f /var/lib/rpm/__db*
  58. rpm --rebuilddb
  59. echo "done"
  60. ### end 01_rpm-rebuilddb
  61. ### begin 50_oneshot
  62. # exit boostrap mode
  63. rm -f /.bootstrap
  64.  
  65. # export some important variables until there's a better solution
  66. export LANG=en_US.UTF-8
  67. export LC_COLLATE=en_US.UTF-8
  68. export GSETTINGS_BACKEND=gconf
  69.  
  70. # run the oneshot triggers for root and first user uid
  71. UID_MIN=$(grep "^UID_MIN" /etc/login.defs | tr -s " " | cut -d " " -f2)
  72. DEVICEUSER=`getent passwd $UID_MIN | sed 's/:.*//'`
  73.  
  74. if [ -x /usr/bin/oneshot ]; then
  75. su -c "/usr/bin/oneshot --mic"
  76. su -c "/usr/bin/oneshot --mic" $DEVICEUSER
  77. fi
  78. ### end 50_oneshot
  79. ### begin 60_ssu
  80. if [ "$SSU_RELEASE_TYPE" = "rnd" ]; then
  81. [ -n "@RNDRELEASE@" ] && ssu release -r @RNDRELEASE@
  82. [ -n "@RNDFLAVOUR@" ] && ssu flavour @RNDFLAVOUR@
  83. # RELEASE is reused in RND setups with parallel release structures
  84. # this makes sure that an image created from such a structure updates from there
  85. [ -n "2.1.1.26" ] && ssu set update-version 2.1.1.26
  86. ssu mode 2
  87. else
  88. [ -n "2.1.1.26" ] && ssu release 2.1.1.26
  89. ssu mode 4
  90. fi
  91. ### end 60_ssu
  92. ### begin 70_sdk-domain
  93.  
  94. export SSU_DOMAIN=@RNDFLAVOUR@
  95.  
  96. if [ "$SSU_RELEASE_TYPE" = "release" ] && [[ "$SSU_DOMAIN" = "public-sdk" ]];
  97. then
  98. ssu domain sailfish
  99. fi
  100. ### end 70_sdk-domain
  101. %end
  102.  
  103. %post --nochroot
  104. export SSU_RELEASE_TYPE=release
  105. ### begin 01_release
  106. if [ -n "$IMG_NAME" ]; then
  107. echo "BUILD: $IMG_NAME" >> $INSTALL_ROOT/etc/meego-release
  108. fi
  109. ### end 01_release
  110. ### begin f5121
  111. cp $INSTALL_ROOT/etc/sailfish-release $IMG_OUT_DIR
  112. ### end f5121
  113. %end
  114.  
  115. %pack
  116. export SSU_RELEASE_TYPE=release
  117. ### begin hybris
  118. pushd $IMG_OUT_DIR
  119.  
  120. MD5SUMFILE=md5.lst
  121.  
  122. DEVICE_VERSION_FILE=./hw-release
  123.  
  124. EXTRA_NAME=""
  125.  
  126. if [ -n "" ] && [ "" != @"EXTRA_NAME"@ ]; then
  127. EXTRA_NAME="-"
  128. fi
  129.  
  130. DEVICE=""
  131. DEVICE_VERSION=""
  132.  
  133. if [[ -a $DEVICE_VERSION_FILE ]]; then
  134. source $DEVICE_VERSION_FILE
  135. DEVICE=$MER_HA_DEVICE
  136. DEVICE_VERSION=-$VERSION_ID
  137. fi
  138.  
  139. source ./sailfish-release
  140. if [ "$SSU_RELEASE_TYPE" = "rnd" ]; then
  141. RELEASENAME=$NAME-${EXTRA_NAME// /_}$SAILFISH_FLAVOUR-$VERSION_ID-$DEVICE$DEVICE_VERSION
  142. else
  143. RELEASENAME=$NAME-${EXTRA_NAME// /_}$VERSION_ID-$DEVICE$DEVICE_VERSION
  144. fi
  145.  
  146. # Setup LVM image
  147. dd if=/dev/zero bs=1 count=0 of=temp.img seek=3000M
  148. LVM_LOOP=$(/sbin/losetup -f)
  149. /sbin/losetup $LVM_LOOP temp.img
  150. /usr/sbin/pvcreate $LVM_LOOP
  151. /usr/sbin/vgcreate sailfish $LVM_LOOP
  152.  
  153. # Resize root and home to minimum
  154. ROOT_LOOP=$(/sbin/losetup -f)
  155. /sbin/losetup $ROOT_LOOP root.img
  156. /sbin/e2fsck -f -y $ROOT_LOOP
  157. BLOCKS=$(/sbin/resize2fs -M $ROOT_LOOP 2>&1 | tail -n 2 | sed 's/is already/on is al ready/' | /bin/grep "The filesystem on" | /bin/cut -d ' ' -f 7)
  158. echo We got ourselves root blocks _ $BLOCKS _
  159. SIZE=$(/usr/bin/expr $BLOCKS \* 4096)
  160. echo after maths size _ $SIZE _
  161. /usr/sbin/lvcreate -L ${SIZE}B --name root sailfish
  162. /bin/sync
  163. /sbin/losetup -d $ROOT_LOOP
  164. /usr/sbin/vgchange -a y
  165. dd if=root.img bs=4096 count=$BLOCKS of=/dev/sailfish/root
  166.  
  167. HOME_LOOP=$(/sbin/losetup -f)
  168. /sbin/losetup $HOME_LOOP home.img
  169. /sbin/e2fsck -f -y $HOME_LOOP
  170. BLOCKS=$(/sbin/resize2fs -M $ROOT_LOOP 2>&1 | tail -n 2 | sed 's/is already/on is al ready/' | /bin/grep "The filesystem on" | /bin/cut -d ' ' -f 7)
  171. echo We got ourselves home size _ $BLOCKS _
  172. SIZE=$(/usr/bin/expr $BLOCKS \* 4096)
  173.  
  174. /usr/sbin/lvcreate -L ${SIZE}B --name home sailfish
  175. /bin/sync
  176. /sbin/losetup -d $HOME_LOOP
  177. /usr/sbin/vgchange -a y
  178. dd if=home.img bs=4096 count=$BLOCKS of=/dev/sailfish/home
  179.  
  180. /usr/sbin/vgchange -a n sailfish
  181.  
  182. # Temporary dir for making factory image backups.
  183. FIMAGE_TEMP=$(mktemp -d -p $(pwd))
  184.  
  185. # For some reason loop files created by imager don't shrink properly when
  186. # running resize2fs -M on them. Hence manually growing the loop file here
  187. # to make the shrinking work once we have the image populated.
  188. dd if=/dev/zero bs=1 seek=1400000000 count=1 of=fimage.img
  189. /sbin/e2fsck -f -y fimage.img
  190. /sbin/resize2fs -f fimage.img
  191.  
  192. pigz -7 root.img
  193. md5sum -b root.img.gz > root.img.gz.md5
  194.  
  195. pigz -7 home.img
  196. md5sum -b home.img.gz > home.img.gz.md5
  197.  
  198. mount -o loop fimage.img $FIMAGE_TEMP
  199. mkdir -p $FIMAGE_TEMP/${RELEASENAME}
  200. mv root.img.gz* $FIMAGE_TEMP/${RELEASENAME}
  201. mv home.img.gz* $FIMAGE_TEMP/${RELEASENAME}
  202. umount $FIMAGE_TEMP
  203. rmdir $FIMAGE_TEMP
  204.  
  205. /sbin/e2fsck -f -y fimage.img
  206. /sbin/resize2fs -f -M fimage.img
  207.  
  208. # To make the file magic right lets convert to single file sparse image.
  209. # 3456M size is selected so that we always will have only one file as output.
  210. /usr/bin/img2simg -C 3456M fimage.img
  211. rm fimage.img
  212.  
  213. /sbin/losetup -d $LVM_LOOP
  214.  
  215. mv temp.img sailfish.img
  216.  
  217. /usr/bin/atruncate sailfish.img
  218. # To make the file magic right lets convert to single file sparse image.
  219. # 3456M size is selected so that we always will have only one file as output.
  220. /usr/bin/img2simg -C 3456M sailfish.img
  221. rm sailfish.img
  222.  
  223. chmod 755 flash.*
  224.  
  225. FILES="flash* *.img* *.bin"
  226. FILES_TO_COPY="*.urls"
  227.  
  228. mkdir -p ${RELEASENAME}
  229. cp ${FILES_TO_COPY} ${RELEASENAME}/
  230.  
  231. mv ${FILES} ${RELEASENAME}/
  232.  
  233. # Calculate md5sums of files included to the tarball
  234. cd ${RELEASENAME}
  235. md5sum * > $MD5SUMFILE
  236. cd ..
  237.  
  238. # Package stuff back to tarball
  239. tar -cjf ${RELEASENAME}.tar.bz2 $RELEASENAME
  240.  
  241. # Remove the files from the output directory
  242. rm -r ${RELEASENAME}
  243.  
  244. popd
  245. ### end hybris
  246. %end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement