Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # DisplayName: Jolla f5121/armv7hl (release) 1+master.20170915075713.92d0f79
- # KickstartType: release
- # SuggestedFeatures: customer-jolla, sailfish-xt9, sailfish-eas, jolla-store-apps, aliendalvik-feature
- # SuggestedImageType: loop
- # SuggestedArchitecture: armv7hl
- lang en_US.UTF-8
- timezone --utc UTC
- user --name nemo --groups audio,video --password nemo
- keyboard us
- ### Commands from /tmp/sandbox/usr/share/ssu/kickstart/part/f5121
- part / --fstype="ext4" --size=1800 --label=root
- part /home --fstype="ext4" --size=800 --label=home
- part /fimage --fstype="ext4" --size=10 --label=fimage
- ## No suitable configuration found in /tmp/sandbox/usr/share/ssu/kickstart/bootloader
- repo --name=adaptation0-f5121-2.1.1.26 --baseurl=http://repo.merproject.org/obs/home:/mgrover:/devel:/hw:/sony:/f5121/sailfish_latest_armv7hl/
- repo --name=apps-2.1.1.26 --baseurl=https://releases.jolla.com/jolla-apps/2.1.1.26/armv7hl/
- repo --name=hotfixes-2.1.1.26 --baseurl=https://releases.jolla.com/releases/2.1.1.26/hotfixes/armv7hl/
- repo --name=jolla-2.1.1.26 --baseurl=https://releases.jolla.com/releases/2.1.1.26/jolla/armv7hl/
- %packages
- @Jolla Configuration f5121
- %end
- %attachment
- ### Commands from /tmp/sandbox/usr/share/ssu/kickstart/attachment/f5121
- /boot/hybris-boot.img
- droid-config-f5121-out-of-image-files
- /etc/hw-release
- %end
- %pre
- export SSU_RELEASE_TYPE=release
- ### begin 01_init
- touch $INSTALL_ROOT/.bootstrap
- ### end 01_init
- %end
- %post
- export SSU_RELEASE_TYPE=release
- ### begin 01_arch-hack
- if [ "armv7hl" == armv7hl ] || [ "armv7hl" == armv7tnhl ]; then
- # Without this line the rpm does not get the architecture right.
- echo -n "armv7hl-meego-linux" > /etc/rpm/platform
- # Also libzypp has problems in autodetecting the architecture so we force tha as well.
- # https://bugs.meego.com/show_bug.cgi?id=11484
- echo "arch = armv7hl" >> /etc/zypp/zypp.conf
- fi
- ### end 01_arch-hack
- ### begin 01_rpm-rebuilddb
- # Rebuild db using target's rpm
- echo -n "Rebuilding db using target rpm.."
- rm -f /var/lib/rpm/__db*
- rpm --rebuilddb
- echo "done"
- ### end 01_rpm-rebuilddb
- ### begin 50_oneshot
- # exit boostrap mode
- rm -f /.bootstrap
- # export some important variables until there's a better solution
- export LANG=en_US.UTF-8
- export LC_COLLATE=en_US.UTF-8
- export GSETTINGS_BACKEND=gconf
- # run the oneshot triggers for root and first user uid
- UID_MIN=$(grep "^UID_MIN" /etc/login.defs | tr -s " " | cut -d " " -f2)
- DEVICEUSER=`getent passwd $UID_MIN | sed 's/:.*//'`
- if [ -x /usr/bin/oneshot ]; then
- su -c "/usr/bin/oneshot --mic"
- su -c "/usr/bin/oneshot --mic" $DEVICEUSER
- fi
- ### end 50_oneshot
- ### begin 60_ssu
- if [ "$SSU_RELEASE_TYPE" = "rnd" ]; then
- [ -n "@RNDRELEASE@" ] && ssu release -r @RNDRELEASE@
- [ -n "@RNDFLAVOUR@" ] && ssu flavour @RNDFLAVOUR@
- # RELEASE is reused in RND setups with parallel release structures
- # this makes sure that an image created from such a structure updates from there
- [ -n "2.1.1.26" ] && ssu set update-version 2.1.1.26
- ssu mode 2
- else
- [ -n "2.1.1.26" ] && ssu release 2.1.1.26
- ssu mode 4
- fi
- ### end 60_ssu
- ### begin 70_sdk-domain
- export SSU_DOMAIN=@RNDFLAVOUR@
- if [ "$SSU_RELEASE_TYPE" = "release" ] && [[ "$SSU_DOMAIN" = "public-sdk" ]];
- then
- ssu domain sailfish
- fi
- ### end 70_sdk-domain
- %end
- %post --nochroot
- export SSU_RELEASE_TYPE=release
- ### begin 01_release
- if [ -n "$IMG_NAME" ]; then
- echo "BUILD: $IMG_NAME" >> $INSTALL_ROOT/etc/meego-release
- fi
- ### end 01_release
- ### begin f5121
- cp $INSTALL_ROOT/etc/sailfish-release $IMG_OUT_DIR
- ### end f5121
- %end
- %pack
- export SSU_RELEASE_TYPE=release
- ### begin hybris
- pushd $IMG_OUT_DIR
- MD5SUMFILE=md5.lst
- DEVICE_VERSION_FILE=./hw-release
- EXTRA_NAME=""
- if [ -n "" ] && [ "" != @"EXTRA_NAME"@ ]; then
- EXTRA_NAME="-"
- fi
- DEVICE=""
- DEVICE_VERSION=""
- if [[ -a $DEVICE_VERSION_FILE ]]; then
- source $DEVICE_VERSION_FILE
- DEVICE=$MER_HA_DEVICE
- DEVICE_VERSION=-$VERSION_ID
- fi
- source ./sailfish-release
- if [ "$SSU_RELEASE_TYPE" = "rnd" ]; then
- RELEASENAME=$NAME-${EXTRA_NAME// /_}$SAILFISH_FLAVOUR-$VERSION_ID-$DEVICE$DEVICE_VERSION
- else
- RELEASENAME=$NAME-${EXTRA_NAME// /_}$VERSION_ID-$DEVICE$DEVICE_VERSION
- fi
- # Setup LVM image
- dd if=/dev/zero bs=1 count=0 of=temp.img seek=3000M
- LVM_LOOP=$(/sbin/losetup -f)
- /sbin/losetup $LVM_LOOP temp.img
- /usr/sbin/pvcreate $LVM_LOOP
- /usr/sbin/vgcreate sailfish $LVM_LOOP
- # Resize root and home to minimum
- ROOT_LOOP=$(/sbin/losetup -f)
- /sbin/losetup $ROOT_LOOP root.img
- /sbin/e2fsck -f -y $ROOT_LOOP
- 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)
- echo We got ourselves root blocks _ $BLOCKS _
- SIZE=$(/usr/bin/expr $BLOCKS \* 4096)
- echo after maths size _ $SIZE _
- /usr/sbin/lvcreate -L ${SIZE}B --name root sailfish
- /bin/sync
- /sbin/losetup -d $ROOT_LOOP
- /usr/sbin/vgchange -a y
- dd if=root.img bs=4096 count=$BLOCKS of=/dev/sailfish/root
- HOME_LOOP=$(/sbin/losetup -f)
- /sbin/losetup $HOME_LOOP home.img
- /sbin/e2fsck -f -y $HOME_LOOP
- 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)
- echo We got ourselves home size _ $BLOCKS _
- SIZE=$(/usr/bin/expr $BLOCKS \* 4096)
- /usr/sbin/lvcreate -L ${SIZE}B --name home sailfish
- /bin/sync
- /sbin/losetup -d $HOME_LOOP
- /usr/sbin/vgchange -a y
- dd if=home.img bs=4096 count=$BLOCKS of=/dev/sailfish/home
- /usr/sbin/vgchange -a n sailfish
- # Temporary dir for making factory image backups.
- FIMAGE_TEMP=$(mktemp -d -p $(pwd))
- # For some reason loop files created by imager don't shrink properly when
- # running resize2fs -M on them. Hence manually growing the loop file here
- # to make the shrinking work once we have the image populated.
- dd if=/dev/zero bs=1 seek=1400000000 count=1 of=fimage.img
- /sbin/e2fsck -f -y fimage.img
- /sbin/resize2fs -f fimage.img
- pigz -7 root.img
- md5sum -b root.img.gz > root.img.gz.md5
- pigz -7 home.img
- md5sum -b home.img.gz > home.img.gz.md5
- mount -o loop fimage.img $FIMAGE_TEMP
- mkdir -p $FIMAGE_TEMP/${RELEASENAME}
- mv root.img.gz* $FIMAGE_TEMP/${RELEASENAME}
- mv home.img.gz* $FIMAGE_TEMP/${RELEASENAME}
- umount $FIMAGE_TEMP
- rmdir $FIMAGE_TEMP
- /sbin/e2fsck -f -y fimage.img
- /sbin/resize2fs -f -M fimage.img
- # To make the file magic right lets convert to single file sparse image.
- # 3456M size is selected so that we always will have only one file as output.
- /usr/bin/img2simg -C 3456M fimage.img
- rm fimage.img
- /sbin/losetup -d $LVM_LOOP
- mv temp.img sailfish.img
- /usr/bin/atruncate sailfish.img
- # To make the file magic right lets convert to single file sparse image.
- # 3456M size is selected so that we always will have only one file as output.
- /usr/bin/img2simg -C 3456M sailfish.img
- rm sailfish.img
- chmod 755 flash.*
- FILES="flash* *.img* *.bin"
- FILES_TO_COPY="*.urls"
- mkdir -p ${RELEASENAME}
- cp ${FILES_TO_COPY} ${RELEASENAME}/
- mv ${FILES} ${RELEASENAME}/
- # Calculate md5sums of files included to the tarball
- cd ${RELEASENAME}
- md5sum * > $MD5SUMFILE
- cd ..
- # Package stuff back to tarball
- tar -cjf ${RELEASENAME}.tar.bz2 $RELEASENAME
- # Remove the files from the output directory
- rm -r ${RELEASENAME}
- popd
- ### end hybris
- %end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement