Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'master' of github.com:pcbsd/pcbsd

  • Loading branch information...
commit dca28eb07dd8199638c3a433e2794adc23978d92 2 parents c69425e + 5a1d1a0
Ken Moore beanpole135 authored
14 src-qt4/pc-firstbootgui/backend.cpp
@@ -96,6 +96,20 @@ QStringList Backend::timezones()
96 96 return _zones;
97 97 }
98 98
  99 +QString Backend::guessTimezone()
  100 +{
  101 + QString code;
  102 +
  103 + Process p(QStringList() << "detect-country");
  104 +
  105 + if (p.waitForFinished()) {
  106 + code = p.readLine().simplified();
  107 + }
  108 + code = code.section(" ", 1, 1);
  109 + qDebug() << "Found timezone:" << code;
  110 + return code;
  111 +}
  112 +
99 113 QStringList Backend::languages()
100 114 {
101 115 QStringList _languages;
5 src-qt4/pc-firstbootgui/backend.h
@@ -10,8 +10,8 @@
10 10 #include <QByteArray>
11 11 #include <QWidget>
12 12
13   -#define PCSYSINSTALL QString("/usr/sbin/pc-sysinstall")
14   -#define PCSYSINSTALLDIR QString("/usr/share/pc-sysinstall")
  13 +#define PCSYSINSTALL QString("/usr/local/sbin/pc-sysinstall")
  14 +#define PCSYSINSTALLDIR QString("/usr/local/share/pc-sysinstall")
15 15 #define PCSYSINSTALLCFG QString("/tmp/sys-install.cfg")
16 16 #define TMPLANGFILE QString("/tmp/.SysInstallLang")
17 17
@@ -50,6 +50,7 @@ class Backend {
50 50 static QStringList bootableMedia();
51 51 static QStringList networkDevices();
52 52 static QStringList timezones();
  53 + static QString guessTimezone();
53 54 static void changeKbMap(QString model, QString layout, QString variant);
54 55 static QList<QStringList> hardDrives();
55 56 static QList<QStringList> availComponents();
15 src-qt4/pc-firstbootgui/firstboot.cpp
@@ -48,11 +48,18 @@ Installer::Installer(QWidget *parent) : QMainWindow(parent)
48 48
49 49 // Load the timezones
50 50 comboBoxTimezone->clear();
  51 + QString curZone = Scripts::Backend::guessTimezone();
51 52 comboBoxTimezone->addItems(Scripts::Backend::timezones());
52   - // Set America/New_York to default
53   - int index = comboBoxTimezone->findText("America/New_York", Qt::MatchStartsWith);
54   - if (index != -1)
55   - comboBoxTimezone->setCurrentIndex(index);
  53 + if ( ! curZone.isEmpty() ) {
  54 + int index = comboBoxTimezone->findText(curZone, Qt::MatchStartsWith);
  55 + if (index != -1)
  56 + comboBoxTimezone->setCurrentIndex(index);
  57 + } else {
  58 + // Set America/New_York to default
  59 + int index = comboBoxTimezone->findText("America/New_York", Qt::MatchStartsWith);
  60 + if (index != -1)
  61 + comboBoxTimezone->setCurrentIndex(index);
  62 + }
56 63
57 64 // Load the hostname
58 65 lineHostname->setText(pcbsd::Utils::getConfFileValue("/etc/rc.conf", "hostname=", 1));
15 src-qt4/pc-installgui/backend.cpp
@@ -234,6 +234,21 @@ int Backend::systemMemory()
234 234 return -1;
235 235 }
236 236
  237 +QString Backend::detectCountryCode()
  238 +{
  239 + QString code;
  240 +
  241 + Process p(QStringList() << "detect-country");
  242 +
  243 + if (p.waitForFinished()) {
  244 + code = p.readLine().simplified();
  245 + }
  246 + code = code.section(" ", 0, 0);
  247 + qDebug() << "Found Country Code:" << code;
  248 + return code;
  249 +}
  250 +
  251 +
237 252 QStringList Backend::networkDevices()
238 253 {
239 254 QStringList nics;
1  src-qt4/pc-installgui/backend.h
@@ -56,6 +56,7 @@ class Backend {
56 56 static QStringList bootableMedia();
57 57 static QStringList networkDevices();
58 58 static QStringList timezones();
  59 + static QString detectCountryCode();
59 60 static void changeKbMap(QString model, QString layout, QString variant);
60 61 static QList<QStringList> hardDrives();
61 62 static QList<QStringList> availComponents();
38 src-qt4/pc-installgui/installer.cpp
@@ -100,14 +100,30 @@ void Installer::slotPushKeyLayout()
100 100 void Installer::initInstall()
101 101 {
102 102 // load languages
  103 + QString langCode;
  104 + bool foundLang = false;
103 105 comboLanguage->clear();
104 106 languages = Scripts::Backend::languages();
  107 + QString curLang = Scripts::Backend::detectCountryCode();
105 108 for (int i=0; i < languages.count(); ++i) {
106 109 QString languageStr = languages.at(i);
107 110 QString language = languageStr.split("-").at(0);
108 111 comboLanguage->addItem(language.trimmed());
  112 +
  113 + // Grab the language code
  114 + langCode = languageStr;
  115 + langCode.truncate(langCode.lastIndexOf(")"));
  116 + langCode.remove(0, langCode.lastIndexOf("(") + 1);
  117 + if ( curLang == langCode ) {
  118 + comboLanguage->setCurrentIndex(i);
  119 + foundLang = true;
  120 + }
109 121 }
110 122 connect(comboLanguage, SIGNAL(currentIndexChanged(QString)), this, SLOT(slotChangeLanguage()));
  123 + // If we found a language from geo-loication, change UI now
  124 + if ( foundLang )
  125 + slotChangeLanguage();
  126 +
111 127
112 128 // Load any package scheme data
113 129 listDeskPkgs = Scripts::Backend::getPackageData(availDesktopPackageData, QString());
@@ -775,20 +791,16 @@ void Installer::slotChangeLanguage()
775 791 QCoreApplication::installTranslator(translator);
776 792 this->retranslateUi(this);
777 793 }
778   -}
779   -
780   -void Installer::changeLang(QString code)
781   -{
782   - // Change the language in the combobox with the current running one
783   - comboLanguage->disconnect();
784 794
785   - for (int i=0; i < languages.count(); ++i) {
786   - if ( languages.at(i).indexOf("(" + code + ")" ) != -1 ) {
787   - comboLanguage->setCurrentIndex(i);
788   - }
789   - }
790   -
791   - connect(comboLanguage, SIGNAL(currentIndexChanged(QString)), this, SLOT(slotChangeLanguage()));
  795 + // Change the default keyboard layout
  796 + if ( langCode == "en" ) {
  797 + Scripts::Backend::changeKbMap("pc104", "us", "");
  798 + } else {
  799 + // TODO - At some point, add additional tests here and set more specific layouts
  800 + // based upon the language selected
  801 + Scripts::Backend::changeKbMap("pc105", langCode, "" );
  802 + }
  803 +
792 804 }
793 805
794 806 QStringList Installer::getGlobalCfgSettings()
1  src-qt4/pc-installgui/installer.h
@@ -34,7 +34,6 @@ class Installer : public QMainWindow, private Ui::Installer
34 34 public:
35 35 Installer(QWidget *parent = 0);
36 36 ~Installer();
37   - void changeLang(QString code);
38 37 void initInstall();
39 38
40 39 private slots:
27 src-qt4/pc-installgui/wizardDisk.cpp
@@ -152,6 +152,11 @@ int wizardDisk::nextId() const
152 152 }
153 153 break;
154 154 case Page_BasicDisk:
  155 + if (checkSSD->isChecked())
  156 + pushSwapSize->setVisible(false);
  157 + else
  158 + pushSwapSize->setVisible(true);
  159 +
155 160 if (radioBasic->isChecked())
156 161 return Page_Confirmation;
157 162 if (comboPartition->currentIndex() != 0 ) {
@@ -413,15 +418,21 @@ void wizardDisk::generateDiskLayout()
413 418 {
414 419 fsType= "ZFS";
415 420
  421 + QString rootOpts="";
  422 + if ( checkSSD->isChecked() )
  423 + rootOpts="(atime=off)";
  424 +
416 425 // This lets the user do nifty stuff like a mirror/raid post-install with a single zpool command
417   - fileSystem << targetDisk << targetSlice << "/,/tmp(compress=lz4),/usr(canmount=off),/usr/home,/usr/jails,/usr/obj(compress=lz4),/usr/pbi,/usr/ports(compress=lz4),/usr/ports/distfiles(compress=lz4),/usr/src(compress=lz4),/var(canmount=off),/var/audit(compress=lz4),/var/log(compress=lz4),/var/tmp(compress=lz4)" << fsType << tmp.setNum(totalSize) << "" << tmpPass;
  426 + fileSystem << targetDisk << targetSlice << "/" + rootOpts + ",/tmp(compress=lz4),/usr(canmount=off),/usr/home,/usr/jails,/usr/obj(compress=lz4),/usr/pbi,/usr/ports(compress=lz4),/usr/ports/distfiles(compress=lz4),/usr/src(compress=lz4),/var(canmount=off),/var/audit(compress=lz4),/var/log(compress=lz4),/var/tmp(compress=lz4)" << fsType << tmp.setNum(totalSize) << "" << tmpPass;
418 427 sysFinalDiskLayout << fileSystem;
419 428 fileSystem.clear();
420 429
421   - // Now add swap space
422   - fileSystem << targetDisk << targetSlice << "SWAP" << "SWAP" << tmp.setNum(swapsize) << "" << "";
423   - sysFinalDiskLayout << fileSystem;
424   - fileSystem.clear();
  430 + // Now add swap space if NOT on a SSD
  431 + if ( ! checkSSD->isChecked() ) {
  432 + fileSystem << targetDisk << targetSlice << "SWAP" << "SWAP" << tmp.setNum(swapsize) << "" << "";
  433 + sysFinalDiskLayout << fileSystem;
  434 + fileSystem.clear();
  435 + }
425 436
426 437 //qDebug() << "Auto-Gen FS:" << fileSystem;
427 438 }
@@ -899,8 +910,10 @@ void wizardDisk::generateCustomDiskLayout()
899 910 sysFinalDiskLayout << fileSystem;
900 911
901 912 fileSystem.clear();
902   - fileSystem << targetDisk << targetSlice << "SWAP" << "SWAP" << tmp.setNum(swapsize) << "" << "";
903   - sysFinalDiskLayout << fileSystem;
  913 + if ( ! checkSSD->isChecked() ) {
  914 + fileSystem << targetDisk << targetSlice << "SWAP" << "SWAP" << tmp.setNum(swapsize) << "" << "";
  915 + sysFinalDiskLayout << fileSystem;
  916 + }
904 917
905 918 qDebug() <<"AutoLayout:" << sysFinalDiskLayout;
906 919 }
253 src-qt4/pc-installgui/wizardDisk.ui
@@ -7,7 +7,7 @@
7 7 <x>0</x>
8 8 <y>0</y>
9 9 <width>641</width>
10   - <height>386</height>
  10 + <height>407</height>
11 11 </rect>
12 12 </property>
13 13 <property name="windowTitle">
@@ -190,88 +190,78 @@
190 190 </widget>
191 191 <widget class="QWizardPage" name="Page_BasicDisk">
192 192 <layout class="QGridLayout" name="gridLayout_11">
193   - <item row="3" column="1">
194   - <layout class="QGridLayout" name="gridLayout_3">
195   - <item row="0" column="0">
196   - <widget class="QComboBox" name="comboDisk">
197   - <property name="sizePolicy">
198   - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
199   - <horstretch>0</horstretch>
200   - <verstretch>0</verstretch>
201   - </sizepolicy>
202   - </property>
203   - </widget>
204   - </item>
205   - <item row="0" column="1">
206   - <widget class="QLabel" name="label_5">
207   - <property name="sizePolicy">
208   - <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
209   - <horstretch>0</horstretch>
210   - <verstretch>0</verstretch>
211   - </sizepolicy>
212   - </property>
213   - <property name="text">
214   - <string>Selected Disk</string>
215   - </property>
216   - </widget>
217   - </item>
218   - <item row="1" column="0">
219   - <widget class="QComboBox" name="comboPartition">
220   - <property name="sizePolicy">
221   - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
222   - <horstretch>0</horstretch>
223   - <verstretch>0</verstretch>
224   - </sizepolicy>
225   - </property>
226   - </widget>
227   - </item>
228   - <item row="1" column="1">
229   - <widget class="QLabel" name="label_6">
230   - <property name="sizePolicy">
231   - <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
232   - <horstretch>0</horstretch>
233   - <verstretch>0</verstretch>
234   - </sizepolicy>
235   - </property>
236   - <property name="text">
237   - <string>Selected Partition</string>
238   - </property>
239   - </widget>
240   - </item>
241   - </layout>
  193 + <item row="9" column="1">
  194 + <widget class="QGroupBox" name="groupZFSPool">
  195 + <property name="font">
  196 + <font>
  197 + <weight>50</weight>
  198 + <bold>false</bold>
  199 + </font>
  200 + </property>
  201 + <property name="title">
  202 + <string>ZFS pool name</string>
  203 + </property>
  204 + <property name="checkable">
  205 + <bool>true</bool>
  206 + </property>
  207 + <property name="checked">
  208 + <bool>false</bool>
  209 + </property>
  210 + <layout class="QGridLayout" name="gridLayout_4">
  211 + <item row="0" column="0">
  212 + <widget class="QLineEdit" name="lineZpoolName">
  213 + <property name="inputMask">
  214 + <string/>
  215 + </property>
  216 + <property name="maxLength">
  217 + <number>32767</number>
  218 + </property>
  219 + <property name="placeholderText">
  220 + <string notr="true">tank</string>
  221 + </property>
  222 + </widget>
  223 + </item>
  224 + </layout>
  225 + </widget>
242 226 </item>
243   - <item row="10" column="1">
244   - <spacer name="verticalSpacer_6">
  227 + <item row="2" column="1">
  228 + <spacer name="verticalSpacer_4">
245 229 <property name="orientation">
246 230 <enum>Qt::Vertical</enum>
247 231 </property>
  232 + <property name="sizeType">
  233 + <enum>QSizePolicy::Fixed</enum>
  234 + </property>
248 235 <property name="sizeHint" stdset="0">
249 236 <size>
250 237 <width>387</width>
251   - <height>43</height>
  238 + <height>18</height>
252 239 </size>
253 240 </property>
254 241 </spacer>
255 242 </item>
256   - <item row="6" column="1">
257   - <widget class="QCheckBox" name="checkForce4K">
258   - <property name="text">
259   - <string>Force ZFS 4K block size</string>
  243 + <item row="1" column="2" rowspan="11">
  244 + <spacer name="horizontalSpacer_3">
  245 + <property name="orientation">
  246 + <enum>Qt::Horizontal</enum>
260 247 </property>
261   - </widget>
262   - </item>
263   - <item row="1" column="1">
264   - <widget class="QLabel" name="label_4">
265   - <property name="sizePolicy">
266   - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
267   - <horstretch>0</horstretch>
268   - <verstretch>0</verstretch>
269   - </sizepolicy>
  248 + <property name="sizeType">
  249 + <enum>QSizePolicy::Fixed</enum>
  250 + </property>
  251 + <property name="sizeHint" stdset="0">
  252 + <size>
  253 + <width>17</width>
  254 + <height>256</height>
  255 + </size>
270 256 </property>
  257 + </spacer>
  258 + </item>
  259 + <item row="7" column="1">
  260 + <widget class="QCheckBox" name="checkGRUB">
271 261 <property name="text">
272   - <string>Please select the disk or partition you wish to install onto. Please note that you must select either an entire disk or a primary partition that is at least 20GB for a server install or 50GB for a desktop install. </string>
  262 + <string>Install GRUB (Required for Boot-Environment support)</string>
273 263 </property>
274   - <property name="wordWrap">
  264 + <property name="checked">
275 265 <bool>true</bool>
276 266 </property>
277 267 </widget>
@@ -305,7 +295,7 @@
305 295 </property>
306 296 </spacer>
307 297 </item>
308   - <item row="0" column="0" rowspan="11">
  298 + <item row="0" column="0" rowspan="12">
309 299 <layout class="QVBoxLayout" name="verticalLayout_4">
310 300 <item>
311 301 <widget class="QLabel" name="label_3">
@@ -357,79 +347,96 @@
357 347 </property>
358 348 </widget>
359 349 </item>
360   - <item row="8" column="1">
361   - <widget class="QGroupBox" name="groupZFSPool">
362   - <property name="font">
363   - <font>
364   - <weight>50</weight>
365   - <bold>false</bold>
366   - </font>
  350 + <item row="1" column="1">
  351 + <widget class="QLabel" name="label_4">
  352 + <property name="sizePolicy">
  353 + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
  354 + <horstretch>0</horstretch>
  355 + <verstretch>0</verstretch>
  356 + </sizepolicy>
367 357 </property>
368   - <property name="title">
369   - <string>ZFS pool name</string>
  358 + <property name="text">
  359 + <string>Please select the disk or partition you wish to install onto. Please note that you must select either an entire disk or a primary partition that is at least 20GB for a server install or 50GB for a desktop install. </string>
370 360 </property>
371   - <property name="checkable">
  361 + <property name="wordWrap">
372 362 <bool>true</bool>
373 363 </property>
374   - <property name="checked">
375   - <bool>false</bool>
376   - </property>
377   - <layout class="QGridLayout" name="gridLayout_4">
378   - <item row="0" column="0">
379   - <widget class="QLineEdit" name="lineZpoolName">
380   - <property name="inputMask">
381   - <string/>
382   - </property>
383   - <property name="maxLength">
384   - <number>32767</number>
385   - </property>
386   - <property name="placeholderText">
387   - <string notr="true">tank</string>
388   - </property>
389   - </widget>
390   - </item>
391   - </layout>
392 364 </widget>
393 365 </item>
394   - <item row="2" column="1">
395   - <spacer name="verticalSpacer_4">
  366 + <item row="11" column="1">
  367 + <spacer name="verticalSpacer_6">
396 368 <property name="orientation">
397 369 <enum>Qt::Vertical</enum>
398 370 </property>
399   - <property name="sizeType">
400   - <enum>QSizePolicy::Fixed</enum>
401   - </property>
402 371 <property name="sizeHint" stdset="0">
403 372 <size>
404 373 <width>387</width>
405   - <height>18</height>
  374 + <height>43</height>
406 375 </size>
407 376 </property>
408 377 </spacer>
409 378 </item>
410   - <item row="1" column="2" rowspan="10">
411   - <spacer name="horizontalSpacer_3">
412   - <property name="orientation">
413   - <enum>Qt::Horizontal</enum>
414   - </property>
415   - <property name="sizeType">
416   - <enum>QSizePolicy::Fixed</enum>
417   - </property>
418   - <property name="sizeHint" stdset="0">
419   - <size>
420   - <width>17</width>
421   - <height>256</height>
422   - </size>
  379 + <item row="6" column="1">
  380 + <widget class="QCheckBox" name="checkForce4K">
  381 + <property name="text">
  382 + <string>Force ZFS 4K block size</string>
423 383 </property>
424   - </spacer>
  384 + </widget>
425 385 </item>
426   - <item row="7" column="1">
427   - <widget class="QCheckBox" name="checkGRUB">
  386 + <item row="3" column="1">
  387 + <layout class="QGridLayout" name="gridLayout_3">
  388 + <item row="0" column="0">
  389 + <widget class="QComboBox" name="comboDisk">
  390 + <property name="sizePolicy">
  391 + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
  392 + <horstretch>0</horstretch>
  393 + <verstretch>0</verstretch>
  394 + </sizepolicy>
  395 + </property>
  396 + </widget>
  397 + </item>
  398 + <item row="0" column="1">
  399 + <widget class="QLabel" name="label_5">
  400 + <property name="sizePolicy">
  401 + <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
  402 + <horstretch>0</horstretch>
  403 + <verstretch>0</verstretch>
  404 + </sizepolicy>
  405 + </property>
  406 + <property name="text">
  407 + <string>Selected Disk</string>
  408 + </property>
  409 + </widget>
  410 + </item>
  411 + <item row="1" column="0">
  412 + <widget class="QComboBox" name="comboPartition">
  413 + <property name="sizePolicy">
  414 + <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
  415 + <horstretch>0</horstretch>
  416 + <verstretch>0</verstretch>
  417 + </sizepolicy>
  418 + </property>
  419 + </widget>
  420 + </item>
  421 + <item row="1" column="1">
  422 + <widget class="QLabel" name="label_6">
  423 + <property name="sizePolicy">
  424 + <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
  425 + <horstretch>0</horstretch>
  426 + <verstretch>0</verstretch>
  427 + </sizepolicy>
  428 + </property>
  429 + <property name="text">
  430 + <string>Selected Partition</string>
  431 + </property>
  432 + </widget>
  433 + </item>
  434 + </layout>
  435 + </item>
  436 + <item row="8" column="1">
  437 + <widget class="QCheckBox" name="checkSSD">
428 438 <property name="text">
429   - <string>Install GRUB (Required for Boot-Environment support)</string>
430   - </property>
431   - <property name="checked">
432   - <bool>true</bool>
  439 + <string>Installing to SSD (Disables SWAP / atime)</string>
433 440 </property>
434 441 </widget>
435 442 </item>
38 src-sh/pc-sysinstall/backend-query/detect-country.sh
... ... @@ -0,0 +1,38 @@
  1 +#!/bin/sh
  2 +#
  3 +# Copyright (c) 2013 iXsystems, Inc. All rights reserved.
  4 +#
  5 +# Redistribution and use in source and binary forms, with or without
  6 +# modification, are permitted provided that the following conditions
  7 +# are met:
  8 +# 1. Redistributions of source code must retain the above copyright
  9 +# notice, this list of conditions and the following disclaimer.
  10 +# 2. Redistributions in binary form must reproduce the above copyright
  11 +# notice, this list of conditions and the following disclaimer in the
  12 +# documentation and/or other materials provided with the distribution.
  13 +#
  14 +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  15 +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  16 +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  17 +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  18 +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  19 +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  20 +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  21 +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  22 +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  23 +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  24 +# SUCH DAMAGE.
  25 +#
  26 +
  27 +# We use geo-location to detect the country of this machine, and can set the default language this way
  28 +fetch -o "/tmp/.dR.$$" "http://web.pcbsd.org/getlocale.php" >/dev/null 2>/dev/null
  29 +COUNTRY="`grep CountryCode: /tmp/.dR.$$ | awk '{print $2}' | tr '[:upper:]' '[:lower:]' | sed 's| ||g'`"
  30 +TZ="`grep TimeZone: /tmp/.dR.$$ | awk '{print $2}'`"
  31 +rm /tmp/.dR.$$
  32 +if [ -z "$COUNTRY" ] ; then
  33 + echo "UNKNOWN"
  34 + exit 1
  35 +fi
  36 +
  37 +echo "$COUNTRY $TZ"
  38 +exit 0
3  src-sh/pc-sysinstall/doc/help-index
@@ -20,6 +20,9 @@ System Query Commands
20 20
21 21 disk-info <disk>
22 22 Returns information about the disks size, cyls, heads, and sectors
  23 +
  24 + detect-country
  25 + Returns the country-code based upon IP address of the system, or UNKNOWN
23 26
24 27 detect-laptop
25 28 Tests to see if this system is a laptop or desktop
5 src-sh/pc-sysinstall/pc-sysinstall
@@ -7,6 +7,7 @@
7 7 # to retrive information about the system
8 8 #####################################################################
9 9 # Copyright 2010 iXsystems
  10 +# Copyright 2013 iXsystems
10 11 # All rights reserved
11 12 #
12 13 # Redistribution and use in source and binary forms, with or without
@@ -136,6 +137,10 @@ case $1 in
136 137 detect-laptop) ${QUERYDIR}/detect-laptop.sh
137 138 ;;
138 139
  140 + # Get geo-location data for this system
  141 + detect-country) ${QUERYDIR}/detect-country.sh
  142 + ;;
  143 +
139 144 # The user is wanting to see what nics are available on the system
140 145 detect-nics) ${QUERYDIR}/detect-nics.sh
141 146 ;;
1  src-sh/port-files/pkg-plist
@@ -84,6 +84,7 @@ share/pc-sysinstall/backend-query/xkeyboard-variants.sh
84 84 share/pc-sysinstall/backend-query/setup-ssh-keys.sh
85 85 share/pc-sysinstall/backend-query/xkeyboard-layouts.sh
86 86 share/pc-sysinstall/backend-query/enable-net.sh
  87 +share/pc-sysinstall/backend-query/detect-country.sh
87 88 share/pc-sysinstall/backend-query/detect-laptop.sh
88 89 share/pc-sysinstall/backend-query/list-packages.sh
89 90 share/pc-sysinstall/backend-query/disk-info.sh

0 comments on commit dca28eb

Please sign in to comment.
Something went wrong with that request. Please try again.