From f28a83cac6fe47309f50b45c79a647c81149db02 Mon Sep 17 00:00:00 2001 From: Michael Shigorin Date: Mon, 31 Mar 2014 22:35:48 +0400 Subject: [PATCH] mediacheck: the former isomd5sum This one is quite different already and utility-based name was pretty clumsy; meet the new feature and retire the old experimental one. Please note that quite aggressive cleanups are implemented within this stage2-based subprofile for the simple reason that it has a single task to do; nothing else is expected to be configured into it for that matter. This functionality asks to be further moved into initrd of course; adding it there will take a few more decisions to be made, mostly regarding user interaction in failure scenarios, and it looks like mkimage will have to be patched in case this doesn't just go into full.cz under some sort of conditional check. --- features.in/isomd5sum/README | 7 ++++--- features.in/isomd5sum/config.mk | 5 ++--- features.in/mediacheck/README | 6 ++++++ features.in/mediacheck/config.mk | 3 +++ .../89-isomd5sum.mk => mediacheck/lib/89-mediacheck.mk} | 2 +- .../mediacheck/image-scripts.d/98-init-mediacheck | 3 +++ .../mediacheck/mediacheck/image-scripts.d/99-cleanup-all | 8 ++++++++ features.in/mediacheck/mediacheck/stage2cfg.mk | 8 ++++++++ 8 files changed, 35 insertions(+), 7 deletions(-) create mode 100644 features.in/mediacheck/README create mode 100644 features.in/mediacheck/config.mk rename features.in/{isomd5sum/lib/89-isomd5sum.mk => mediacheck/lib/89-mediacheck.mk} (74%) create mode 100755 features.in/mediacheck/mediacheck/image-scripts.d/98-init-mediacheck create mode 100755 features.in/mediacheck/mediacheck/image-scripts.d/99-cleanup-all create mode 100644 features.in/mediacheck/mediacheck/stage2cfg.mk diff --git a/features.in/isomd5sum/README b/features.in/isomd5sum/README index ea61a5bd..39420d01 100644 --- a/features.in/isomd5sum/README +++ b/features.in/isomd5sum/README @@ -1,3 +1,4 @@ -Эта фича конфигурирует внедрение контрольной суммы в образ -инсталятора после его сборки с целью проверки целостности -на ранней стадии установки. +Эта фича конфигурировала экспериментальную проверку целостности носителя; +в настоящее время является устаревшей, см. features.in/mediacheck + +# TODO: DROP diff --git a/features.in/isomd5sum/config.mk b/features.in/isomd5sum/config.mk index dc33899c..ecc2e2e8 100644 --- a/features.in/isomd5sum/config.mk +++ b/features.in/isomd5sum/config.mk @@ -1,3 +1,2 @@ -use/isomd5sum: - @$(call add_feature) - @$(call add,POSTPROCESS_TARGETS,90isomd5sum) +use/isomd5sum: use/mediacheck + @$(warning deprecated, see mediacheck feature) diff --git a/features.in/mediacheck/README b/features.in/mediacheck/README new file mode 100644 index 00000000..f4d67136 --- /dev/null +++ b/features.in/mediacheck/README @@ -0,0 +1,6 @@ +Эта фича конфигурирует внедрение контрольной суммы в образ +инсталятора после его сборки с целью проверки целостности +на ранней стадии установки. + +NB: прототип, для реального использования надо сделать +микрообраз на основе stage2. diff --git a/features.in/mediacheck/config.mk b/features.in/mediacheck/config.mk new file mode 100644 index 00000000..50834920 --- /dev/null +++ b/features.in/mediacheck/config.mk @@ -0,0 +1,3 @@ +use/mediacheck: use/stage2 sub/stage2@mediacheck use/syslinux/mediacheck.cfg + @$(call add_feature) + @$(call add,POSTPROCESS_TARGETS,90mediacheck) diff --git a/features.in/isomd5sum/lib/89-isomd5sum.mk b/features.in/mediacheck/lib/89-mediacheck.mk similarity index 74% rename from features.in/isomd5sum/lib/89-isomd5sum.mk rename to features.in/mediacheck/lib/89-mediacheck.mk index 3baecc5a..9bd12547 100644 --- a/features.in/isomd5sum/lib/89-isomd5sum.mk +++ b/features.in/mediacheck/lib/89-mediacheck.mk @@ -1,4 +1,4 @@ CHROOT_PACKAGES += isomd5sum -postprocess-90isomd5sum: +postprocess-90mediacheck: @implantisomd5 "$(IMAGEDIR)/$(IMAGE_OUTFILE)" diff --git a/features.in/mediacheck/mediacheck/image-scripts.d/98-init-mediacheck b/features.in/mediacheck/mediacheck/image-scripts.d/98-init-mediacheck new file mode 100755 index 00000000..06d576ed --- /dev/null +++ b/features.in/mediacheck/mediacheck/image-scripts.d/98-init-mediacheck @@ -0,0 +1,3 @@ +#!/bin/sh +mv -f -- /etc/inittab.mediacheck /etc/inittab +:>/etc/rc.d/rc diff --git a/features.in/mediacheck/mediacheck/image-scripts.d/99-cleanup-all b/features.in/mediacheck/mediacheck/image-scripts.d/99-cleanup-all new file mode 100755 index 00000000..bfaab3b4 --- /dev/null +++ b/features.in/mediacheck/mediacheck/image-scripts.d/99-cleanup-all @@ -0,0 +1,8 @@ +#!/bin/sh +# everything needed should have been done within initrd when this boots + +rpm -e --nodeps apt libapt rpm librpmbuild librpm 2>/dev/null ||: +rm -rf /var/lib/apt /var/cache/apt /var/lib/rpm +rm -rf /lib/modules +rm -rf /usr/share +rm -rf /usr/lib*/{locale,perl*,python*} diff --git a/features.in/mediacheck/mediacheck/stage2cfg.mk b/features.in/mediacheck/mediacheck/stage2cfg.mk new file mode 100644 index 00000000..4a80e90a --- /dev/null +++ b/features.in/mediacheck/mediacheck/stage2cfg.mk @@ -0,0 +1,8 @@ +# stage2 mod: mediacheck single-purpose "live" image + +IMAGE_PACKAGES = startup-mediacheck + +MKI_PACK_RESULTS = squash:mediacheck + +debug:: + @echo "** mediacheck: IMAGE_PACKAGES: $(IMAGE_PACKAGES)"