Skip to content

Commit

Permalink
[rpm] Disable recovery img when embed recovery is defined. MER#1987
Browse files Browse the repository at this point in the history
  • Loading branch information
Thaodan committed Nov 22, 2018
1 parent bd122b7 commit b8f9ccb
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions droid-hal-device-img-boot.inc
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ Requires: oneshot
%description
%{summary}

%if 0%{!?embed_recovery:1}
%package -n droid-hal-%{device}-img-recovery

Summary: Recovery boot image for Sailfish OS devices
Expand All @@ -114,6 +115,7 @@ Requires: droid-config-flashing

%description -n droid-hal-%{device}-img-recovery
%{summary}
%endif

%prep
%setup -q -n %{name}-%{version}
Expand Down Expand Up @@ -181,14 +183,15 @@ shpp -Dembed_recovery=%{?embed_recovery}%{!?embed_recovery:0} \

# Create a hybris-boot.img image from the zImage
pushd %{_local_initrd_dir}
./mksfosinitrd.sh
./mksfosinitrd.sh %{embed_recovery}
popd
%{mkbootimg_cmd} hybris-boot.img %{embed_recovery}

%{mkbootimg_cmd} hybris-boot.img
%if 0%{!?embed_recovery:1}
pushd %{_local_initrd_dir}
./mksfosinitrd.sh recovery
popd
%{mkbootimg_cmd} hybris-recovery.img
%endif

rm -rf %{_local_build_dir}

Expand All @@ -197,7 +200,9 @@ rm -rf %{buildroot}

# /boot
install -D -m 644 hybris-boot.img %{buildroot}/boot/hybris-boot.img
%if 0%{!?embed_recovery:1}
install -D -m 644 hybris-recovery.img %{buildroot}/boot/hybris-recovery.img
%endif

# /lib/modules
mkdir -p %{buildroot}/lib/modules
Expand All @@ -211,9 +216,11 @@ touch %{buildroot}/lib/modules/%{kernelver}/{modules.order,modules.builtin}
%defattr(644,root,root,-)
/lib/modules/%{kernelver}

%if 0%{!?embed_recovery:1}
%files -n droid-hal-%{device}-img-recovery
%defattr(-,root,root,-)
/boot/hybris-recovery.img
%endif

%post
# When doing install that is done during the image creation thus we don't add
Expand All @@ -224,7 +231,9 @@ fi

/sbin/depmod %{kernelver} || :

%if 0%{!?embed_recovery:1}
%post -n droid-hal-%{device}-img-recovery
if [ $1 -ne 1 ] ; then
add-preinit-oneshot /var/lib/platform-updates/flash-recoveryimg.sh
fi
%endif

0 comments on commit b8f9ccb

Please sign in to comment.