mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-11-24 01:01:52 +02:00
fix image preconfiguration
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@8921 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
1346f7147a
commit
f08be3e501
@ -20,6 +20,7 @@ $(curdir)/cleanup: $(TMP_DIR)/.build
|
|||||||
rm -rf $(TARGET_DIR)
|
rm -rf $(TARGET_DIR)
|
||||||
|
|
||||||
$(curdir)/rootfs-prepare: $(TMP_DIR)/.build
|
$(curdir)/rootfs-prepare: $(TMP_DIR)/.build
|
||||||
|
@-$(MAKE) package/preconfig
|
||||||
@if [ -d $(TOPDIR)/files ]; then \
|
@if [ -d $(TOPDIR)/files ]; then \
|
||||||
$(CP) $(TOPDIR)/files/. $(TARGET_DIR); \
|
$(CP) $(TOPDIR)/files/. $(TARGET_DIR); \
|
||||||
fi
|
fi
|
||||||
|
@ -132,11 +132,15 @@ sub parse_package_metadata() {
|
|||||||
/^Prereq-Check:/ and $pkg->{prereq} = 1;
|
/^Prereq-Check:/ and $pkg->{prereq} = 1;
|
||||||
/^Preconfig:\s*(.+)\s*$/ and do {
|
/^Preconfig:\s*(.+)\s*$/ and do {
|
||||||
my $pkgname = $pkg->{name};
|
my $pkgname = $pkg->{name};
|
||||||
$preconfig{$pkgname} or $preconfig{$pkgname} = [];
|
$preconfig{$pkgname} or $preconfig{$pkgname} = {};
|
||||||
$preconfig = {
|
if (exists $preconfig{$pkgname}->{$1}) {
|
||||||
id => $1
|
$preconfig = $preconfig{$pkgname}->{$1};
|
||||||
};
|
} else {
|
||||||
push @{$preconfig{$pkgname}}, $preconfig;
|
$preconfig = {
|
||||||
|
id => $1
|
||||||
|
};
|
||||||
|
$preconfig{$pkgname}->{$1} = $preconfig;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
/^Preconfig-Type:\s*(.*?)\s*$/ and $preconfig->{type} = $1;
|
/^Preconfig-Type:\s*(.*?)\s*$/ and $preconfig->{type} = $1;
|
||||||
/^Preconfig-Label:\s*(.*?)\s*$/ and $preconfig->{label} = $1;
|
/^Preconfig-Label:\s*(.*?)\s*$/ and $preconfig->{label} = $1;
|
||||||
@ -451,14 +455,14 @@ sub gen_package_config() {
|
|||||||
parse_package_metadata();
|
parse_package_metadata();
|
||||||
print "menuconfig UCI_PRECONFIG\n\tbool \"Image configuration\"\n";
|
print "menuconfig UCI_PRECONFIG\n\tbool \"Image configuration\"\n";
|
||||||
foreach my $preconfig (keys %preconfig) {
|
foreach my $preconfig (keys %preconfig) {
|
||||||
foreach my $cfg (@{$preconfig{$preconfig}}) {
|
foreach my $cfg (keys %{$preconfig{$preconfig}}) {
|
||||||
my $conf = $cfg->{id};
|
my $conf = $preconfig{$preconfig}->{$cfg}->{id};
|
||||||
$conf =~ tr/\.-/__/;
|
$conf =~ tr/\.-/__/;
|
||||||
print <<EOF
|
print <<EOF
|
||||||
config UCI_PRECONFIG_$conf
|
config UCI_PRECONFIG_$conf
|
||||||
string "$cfg->{label}" if UCI_PRECONFIG
|
string "$preconfig{$preconfig}->{$cfg}->{label}" if UCI_PRECONFIG
|
||||||
depends PACKAGE_$preconfig
|
depends PACKAGE_$preconfig
|
||||||
default "$cfg->{default}"
|
default "$preconfig{$preconfig}->{$cfg}->{default}"
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
@ -524,10 +528,10 @@ sub gen_package_mk() {
|
|||||||
}
|
}
|
||||||
foreach my $preconfig (keys %preconfig) {
|
foreach my $preconfig (keys %preconfig) {
|
||||||
my $cmds;
|
my $cmds;
|
||||||
foreach my $cfg (@{$preconfig{$preconfig}}) {
|
foreach my $cfg (keys %{$preconfig{$preconfig}}) {
|
||||||
my $conf = $cfg->{id};
|
my $conf = $preconfig{$preconfig}->{$cfg}->{id};
|
||||||
$conf =~ tr/\.-/__/;
|
$conf =~ tr/\.-/__/;
|
||||||
$cmds .= "\techo \"uci set '$cfg->{id}=\$(subst \",,\$(CONFIG_UCI_PRECONFIG_$conf))'\"; \\\n";
|
$cmds .= "\techo \"uci set '$preconfig{$preconfig}->{$cfg}->{id}=\$(subst \",,\$(CONFIG_UCI_PRECONFIG_$conf))'\"; \\\n";
|
||||||
}
|
}
|
||||||
next unless $cmds;
|
next unless $cmds;
|
||||||
print <<EOF
|
print <<EOF
|
||||||
|
Loading…
Reference in New Issue
Block a user