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.
This commit is contained in:
Michael Shigorin 2013-03-25 13:25:15 +04:00
parent 1a7656b977
commit 0f4ee98fa4
3 changed files with 17 additions and 3 deletions

View File

@ -31,9 +31,14 @@ use/live/desktop: use/live/base use/x11/wacom use/live/sound \
@$(call add,SYSLINUX_CFG,localboot) @$(call add,SYSLINUX_CFG,localboot)
# preconfigure apt for both live and installed-from-live systems # preconfigure apt for both live and installed-from-live systems
use/live/repo: use/live/repo: use/live
@$(call add,LIVE_PACKAGES,livecd-online-repo)
@$(call add,LIVE_PACKAGES,installer-feature-online-repo) @$(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 # alterator-based permanent installation
use/live/install: use/metadata use/syslinux/localboot.cfg use/live/install: use/metadata use/syslinux/localboot.cfg

View File

@ -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"

View File

@ -5,7 +5,6 @@ strace
powertop powertop
acpi acpi
livecd-online-repo
apt-repo apt-repo
update-kernel update-kernel
synaptic-usermode synaptic-usermode