Jolla-@RELEASE@-t0lte-@ARCH@.ks (6526B)
1 # DisplayName: Jolla t0lte/@ARCH@ (release) 1 2 # KickstartType: release 3 # DeviceModel: t0lte 4 # DeviceVariant: t0lte 5 # Brand: Jolla 6 # SuggestedImageType: fs 7 # SuggestedArchitecture: armv7hl 8 9 keyboard de 10 user --name nemo --groups audio,input,video --password nemo 11 lang en_US.UTF-8 12 timezone --utc UTC 13 14 ### Commands from /tmp/sandbox/usr/share/ssu/kickstart/part/default 15 part / --size 500 --ondisk sda --fstype=ext4 16 17 ## No suitable configuration found in /tmp/sandbox/usr/share/ssu/kickstart/bootloader 18 19 repo --name=adaptation-community-common-t0lte-@RELEASE@ --baseurl=http://repo.merproject.org/obs/nemo:/devel:/hw:/common/sailfish_latest_@ARCH@/ 20 repo --name=apps-@RELEASE@ --baseurl=https://releases.jolla.com/jolla-apps/@RELEASE@/@ARCH@/ 21 repo --name=customer-jolla-@RELEASE@ --baseurl=https://releases.jolla.com/features/@RELEASE@/customers/jolla/@ARCH@/ 22 repo --name=glibc-@RELEASE@ --baseurl=http://repo.merproject.org/obs/home:/elros34:/glibc/sailfishos_@RELEASE@/ 23 repo --name=hotfixes-@RELEASE@ --baseurl=https://releases.jolla.com/releases/@RELEASE@/hotfixes/@ARCH@/ 24 repo --name=jolla-@RELEASE@ --baseurl=https://releases.jolla.com/releases/@RELEASE@/jolla/@ARCH@/ 25 26 %packages 27 @Jolla Configuration t0lte 28 %end 29 30 %attachment 31 ### Commands from /tmp/sandbox/usr/share/ssu/kickstart/attachment/t0lte 32 /boot/hybris-boot.img 33 /boot/hybris-updater-script 34 /boot/hybris-updater-unpack.sh 35 /boot/update-binary 36 37 %end 38 39 %pre --erroronfail 40 export SSU_RELEASE_TYPE=release 41 ### begin 01_init 42 touch $INSTALL_ROOT/.bootstrap 43 ### end 01_init 44 %end 45 46 %post --erroronfail 47 export SSU_RELEASE_TYPE=release 48 ### begin 01_arch-hack 49 if [ "@ARCH@" == armv7hl ] || [ "@ARCH@" == armv7tnhl ] || [ "@ARCH@" == aarch64 ]; then 50 # Without this line the rpm does not get the architecture right. 51 echo -n "@ARCH@-meego-linux" > /etc/rpm/platform 52 53 # Also libzypp has problems in autodetecting the architecture so we force tha as well. 54 # https://bugs.meego.com/show_bug.cgi?id=11484 55 echo "arch = @ARCH@" >> /etc/zypp/zypp.conf 56 fi 57 ### end 01_arch-hack 58 ### begin 01_rpm-rebuilddb 59 # Rebuild db using target's rpm 60 echo -n "Rebuilding db using target rpm.." 61 rm -f /var/lib/rpm/__db* 62 rpm --rebuilddb 63 echo "done" 64 ### end 01_rpm-rebuilddb 65 ### begin 50_oneshot 66 # exit boostrap mode 67 rm -f /.bootstrap 68 69 # export some important variables until there's a better solution 70 export LANG=en_US.UTF-8 71 export LC_COLLATE=en_US.UTF-8 72 export GSETTINGS_BACKEND=gconf 73 74 # run the oneshot triggers for root and first user uid 75 UID_MIN=$(grep "^UID_MIN" /etc/login.defs | tr -s " " | cut -d " " -f2) 76 DEVICEUSER=`getent passwd $UID_MIN | sed 's/:.*//'` 77 78 if [ -x /usr/bin/oneshot ]; then 79 su -c "/usr/bin/oneshot --mic" 80 su -c "/usr/bin/oneshot --mic" $DEVICEUSER 81 fi 82 ### end 50_oneshot 83 ### begin 60_ssu 84 if [ "$SSU_RELEASE_TYPE" = "rnd" ]; then 85 [ -n "@RNDRELEASE@" ] && ssu release -r @RNDRELEASE@ 86 [ -n "@RNDFLAVOUR@" ] && ssu flavour @RNDFLAVOUR@ 87 # RELEASE is reused in RND setups with parallel release structures 88 # this makes sure that an image created from such a structure updates from there 89 [ -n "@RELEASE@" ] && ssu set update-version @RELEASE@ 90 ssu mode 2 91 else 92 [ -n "@RELEASE@" ] && ssu release @RELEASE@ 93 ssu mode 4 94 fi 95 ### end 60_ssu 96 ### begin 70_sdk-domain 97 98 export SSU_DOMAIN=@RNDFLAVOUR@ 99 100 if [ "$SSU_RELEASE_TYPE" = "release" ] && [[ "$SSU_DOMAIN" = "public-sdk" ]]; 101 then 102 ssu domain sailfish 103 fi 104 ### end 70_sdk-domain 105 ### begin 90_accept_unsigned_packages 106 sed -i /etc/zypp/zypp.conf \ 107 -e '/^# pkg_gpgcheck =/ c \ 108 # Modified by kickstart. See sdk-configs sources\ 109 pkg_gpgcheck = off 110 ' 111 ### end 90_accept_unsigned_packages 112 ### begin 90_zypper_skip_check_access_deleted 113 sed -i /etc/zypp/zypper.conf \ 114 -e '/^# *psCheckAccessDeleted =/ c \ 115 # Modified by kickstart. See sdk-configs sources\ 116 psCheckAccessDeleted = no 117 ' 118 ### end 90_zypper_skip_check_access_deleted 119 %end 120 121 %post --nochroot --erroronfail 122 export SSU_RELEASE_TYPE=release 123 ### begin 50_os-release 124 ( 125 CUSTOMERS=$(find $INSTALL_ROOT/usr/share/ssu/features.d -name 'customer-*.ini' \ 126 |xargs --no-run-if-empty sed -n 's/^name[[:space:]]*=[[:space:]]*//p') 127 128 cat $INSTALL_ROOT/etc/os-release 129 echo "SAILFISH_CUSTOMER=\"${CUSTOMERS//$'\n'/ }\"" 130 ) > $IMG_OUT_DIR/os-release 131 ### end 50_os-release 132 ### begin 99_check_shadow 133 IS_BAD=0 134 135 echo "Checking that no user has password set in /etc/shadow." 136 # This grep prints users that have password set, normally nothing 137 if grep -vE '^[^:]+:[*!]{1,2}:' $INSTALL_ROOT/etc/shadow 138 then 139 echo "A USER HAS PASSWORD SET! THE IMAGE IS NOT SAFE!" 140 IS_BAD=1 141 fi 142 143 # Checking that all users use shadow in passwd, 144 # if they weren't the check above would be useless 145 if grep -vE '^[^:]+:x:' $INSTALL_ROOT/etc/passwd 146 then 147 echo "BAD PASSWORD IN /etc/passwd! THE IMAGE IS NOT SAFE!" 148 IS_BAD=1 149 fi 150 151 # Fail image build if checks fail 152 [ $IS_BAD -eq 0 ] && echo "No passwords set, good." || exit 1 153 ### end 99_check_shadow 154 %end 155 156 %pack --erroronfail 157 export SSU_RELEASE_TYPE=release 158 ### begin hybris 159 pushd $IMG_OUT_DIR 160 161 DEVICE=t0lte 162 163 VERSION_FILE=./os-release 164 source $VERSION_FILE 165 166 # Locate rootfs tar.bz2 archive. 167 for filename in *.tar.bz2; do 168 GEN_IMG_BASE=$(basename $filename .tar.bz2) 169 done 170 171 if [ ! -e "$GEN_IMG_BASE.tar.bz2" ]; then 172 echo "No rootfs archive found, exiting ..." 173 exit 1 174 fi 175 176 IMG_SIZE=$(du -h $GEN_IMG_BASE.tar.bz2 | cut -f1) 177 178 # Output filenames 179 DST_IMG_BASE=$ID-$DEVICE-$SAILFISH_FLAVOUR-$VERSION_ID@EXTRA_NAME@ 180 DST_IMG=$DST_IMG_BASE.tar.bz2 181 182 # Copy boot image, updater scripts and updater binary into updater .zip tree. 183 mkdir -p updater/META-INF/com/google/android 184 185 mv update-binary updater/META-INF/com/google/android/update-binary 186 mv hybris-updater-script updater/META-INF/com/google/android/updater-script 187 mv hybris-updater-unpack.sh updater/updater-unpack.sh 188 mv hybris-boot.img updater/hybris-boot.img 189 190 # Temporarily move the rootfs into the updater directory 191 mv $GEN_IMG_BASE.tar.bz2 updater/$DST_IMG 192 193 # Update updater-script with image details. 194 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 195 196 # pack updater .zip 197 pushd updater 198 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 199 popd # updater 200 201 # Move the rootfs back out of the updater directory 202 mv updater/$DST_IMG $GEN_IMG_BASE.tar.bz2 203 204 # Clean up updater .zip working directory. 205 rm -rf updater 206 207 popd # $IMG_OUT_DIR 208 ### end hybris 209 %end 210