checktime \
xinitrc \
Xdefaults \
+ country.dat \
proxinstall
HTML_SOURCES=$(wildcard html/*.htm)
HTML_COMMON_SOURCES=$(wildcard html-common/*.htm) $(wildcard html-common/*.css) $(wildcard html-common/*.png)
-all:
+all: ${INSTALLER_SOURCES} ${HTML_COMMON_SOURCES} ${HTML_SOURCES}
+
+country.dat: country.pl
+ ./country.pl > country.dat
deb: ${DEB}
${DEB}: ${INSTALLER_SOURCES} ${HTML_COMMON_SOURCES} ${HTML_SOURCES} Makefile html/Makefile
ln -s /tmp/resolv.conf.dhclient-new ${DESTDIR}/etc/resolv.conf.dhclient-new
install -D -m 755 fake-start-stop-daemon ${DESTDIR}/var/lib/pve-installer/fake-start-stop-daemon
install -D -m 755 policy-disable-rc.d ${DESTDIR}/var/lib/pve-installer/policy-disable-rc.d
+ install -D -m 755 country.dat ${DESTDIR}/var/lib/pve-installer/country.dat
install -D -m 755 unconfigured.sh ${DESTDIR}/sbin/unconfigured.sh
install -D -m 755 proxinstall ${DESTDIR}/usr/bin/proxinstall
install -D -m 755 checktime ${DESTDIR}/usr/bin/checktime
.phony: clean
clean:
make -C html-common clean
- rm -rf *~ *.deb target build packages packages.tmp test.img pve-final.pkglist *.buildinfo *.changes
+ rm -rf *~ *.deb target build packages packages.tmp test.img pve-final.pkglist *.buildinfo *.changes country.dat
find . -name '*~' -exec rm {} ';'
--- /dev/null
+#!/usr/bin/perl -w
+
+use strict;
+use PVE::Tools;
+
+# see also: http://en.wikipedia.org/wiki/Keyboard_layout
+#
+# country codes from: /usr/share/zoneinfo/iso3166.tab
+# timezones from: /usr/share/zoneinfo/zone.tab
+# keymaps: find /usr/share/keymaps/i386/ -type f -name '*.kmap.gz'
+# x11 layouts: /usr/share/X11/xkb/rules/xorg.lst
+
+my $country = {};
+
+my $line;
+open (TMP, "</usr/share/zoneinfo/iso3166.tab");
+while (defined ($line = <TMP>)) {
+ if ($line =~ m/^([A-Z][A-Z])\s+(.*\S)\s*$/) {
+ $country->{lc($1)} = $2;
+ }
+}
+close (TMP);
+
+# we need mappings for X11, console, and kvm vnc
+
+# LC(-LC)? => [DESC, kvm, console, X11, X11variant]
+my $keymaps = PVE::Tools::kvmkeymaps();
+
+foreach my $km (sort keys %$keymaps) {
+ my ($desc, $kvm, $console, $x11, $x11var) = @{$keymaps->{$km}};
+
+ if ($km =~m/^([a-z][a-z])-([a-z][a-z])$/i) {
+ defined ($country->{$2}) || die "undefined country code '$2'";
+ } else {
+ defined ($country->{$km}) || die "undefined country code '$km'";
+ }
+
+ $x11var = '' if !defined ($x11var);
+ print "map:$km:$desc:$kvm:$console:$x11:$x11var:\n";
+}
+
+my $defmap = {
+ 'us' => 'en-us',
+ 'be' => 'fr-be',
+ 'br' => 'pt-br',
+ 'ca' => 'en-us',
+ 'dk' => 'dk',
+ 'nl' => 'en-us', # most Dutch people us US layout
+ 'fi' => 'fi',
+ 'fr' => 'fr',
+ 'de' => 'de',
+ 'at' => 'de',
+ 'hu' => 'hu',
+ 'is' => 'is',
+ 'it' => 'it',
+ 'va' => 'it',
+ 'jp' => 'jp',
+ 'lt' => 'lt',
+ 'mk' => 'mk',
+ 'no' => 'no',
+ 'pl' => 'pl',
+ 'pt' => 'pt',
+ 'si' => 'si',
+ 'es' => 'es',
+ 'gi' => 'es',
+ 'ch' => 'de-ch',
+ 'gb' => 'en-gb',
+ 'lu' => 'fr-ch',
+ 'li' => 'de-ch',
+};
+
+
+my $mirrors = PVE::Tools::debmirrors();
+foreach my $cc (keys %$mirrors) {
+ die "undefined country code '$cc'" if !defined ($country->{$cc});
+}
+
+foreach my $cc (sort keys %$country) {
+ my $map = $defmap->{$cc} || '';
+ my $mir = $mirrors->{$cc} || '';
+ print "$cc:$country->{$cc}:$map:$mir:\n";
+}
}
sub read_cmap {
- my $countryfn = $opt_testmode ? "/usr/share/pve-manager/country.dat" :
- "/cdrom/proxmox/country.dat";
+ my $countryfn = $opt_testmode ? "country.dat" :
+ "/var/lib/pve-installer/country.dat";
open (TMP, "<$countryfn") || die "unable to open '$countryfn' - $!\n";
my $line;
my $country = {};