From 0f4ee98fa4360dd1caf48f5d38b1e89925a66f1c Mon Sep 17 00:00:00 2001 From: Michael Shigorin Date: Mon, 25 Mar 2013 13:25:15 +0400 Subject: [PATCH] live: reworked use/live/repo The expected behaviour is to have online repositories enabled when the livecd is running; the trouble with runtime detection relates to the asynchronous nature of network configuration, connection might get probed just before it is brought up (thus failing the test). Systems having been installed-from-live don't misbehave this way so left unmolested. Runtime detection is still available via use/live/repo/online but is definitely not the default mechanism. --- features.in/live/config.mk | 9 +++++++-- features.in/live/live/image-scripts.d/60-apt | 10 ++++++++++ pkg.in/lists/tagged/base+regular | 1 - 3 files changed, 17 insertions(+), 3 deletions(-) create mode 100755 features.in/live/live/image-scripts.d/60-apt diff --git a/features.in/live/config.mk b/features.in/live/config.mk index b14cb8f0..5a192cfc 100644 --- a/features.in/live/config.mk +++ b/features.in/live/config.mk @@ -31,9 +31,14 @@ use/live/desktop: use/live/base use/x11/wacom use/live/sound \ @$(call add,SYSLINUX_CFG,localboot) # preconfigure apt for both live and installed-from-live systems -use/live/repo: - @$(call add,LIVE_PACKAGES,livecd-online-repo) +use/live/repo: use/live @$(call add,LIVE_PACKAGES,installer-feature-online-repo) + @$(call try,LIVE_REPO,http/alt) + @$(call xport,LIVE_REPO) + +# preconfigure apt in runtime (less reliable) +use/live/repo/online: + @$(call add,LIVE_PACKAGES,livecd-online-repo) # alterator-based permanent installation use/live/install: use/metadata use/syslinux/localboot.cfg diff --git a/features.in/live/live/image-scripts.d/60-apt b/features.in/live/live/image-scripts.d/60-apt new file mode 100755 index 00000000..80195423 --- /dev/null +++ b/features.in/live/live/image-scripts.d/60-apt @@ -0,0 +1,10 @@ +#!/bin/sh +# unconditionally enable online repository + +[ -n "$GLOBAL_LIVE_REPO" ] || exit 0 + +PROTO="${GLOBAL_LIVE_REPO%/*}" # http, ftp, rsync +MIRROR="${GLOBAL_LIVE_REPO#*/}" # alt, heanet, kiev, yandex, ... + +sed -i "s,^#\(rpm \[alt\] ${PROTO:-http}.*\),\1," \ + "/etc/apt/sources.list.d/${MIRROR:-alt}.list" diff --git a/pkg.in/lists/tagged/base+regular b/pkg.in/lists/tagged/base+regular index 0d71c093..5b7b9789 100644 --- a/pkg.in/lists/tagged/base+regular +++ b/pkg.in/lists/tagged/base+regular @@ -5,7 +5,6 @@ strace powertop acpi -livecd-online-repo apt-repo update-kernel synaptic-usermode