https://www.thinkwiki.org/w/api.php?action=feedcontributions&user=Newhren&feedformat=atomThinkWiki - User contributions [en]2024-03-29T06:42:48ZUser contributionsMediaWiki 1.31.12https://www.thinkwiki.org/w/index.php?title=Talk:Windows_PE&diff=49268Talk:Windows PE2010-08-04T04:25:01Z<p>Newhren: </p>
<hr />
<div>Does anybody know how to modify these instructions for the current AIK download which does not contain the same MSI and CAB files named in these instructions, according to 7z? I only find netfx.msi and netfx1.cab which do not contain the expected files when they are extracted either. How can I create a WinPE ISO?<br />
<br />
-- 01:25, 4 August 2010 Karlcz<br />
<br />
this is 7z's glitch when it tries treat the file KB3AIK_EN.iso not as image of a UDF filesystem but as a *cab archive. I can reproduce this bug by pressing F3 in Midnight Commander, but simple "7z l KB3AIK_EN.iso" treats it as a UDF and displays all the contents.<br />
<br />
-- 04:23, 4 August 2010 Newhren</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Intel_Active_Management_Technology_(AMT)&diff=48610Intel Active Management Technology (AMT)2010-05-20T20:55:17Z<p>Newhren: /* Firmware update */ switch links :)</p>
<hr />
<div>== Intel Active Management Technology (AMT) ==<br />
Some Lenovo laptop include some of Intel's Management features.<br />
{| border="1" cellspacing="0" cellpadding="2"<br />
|| Version || Models <br />
|-<br />
|| AMT 2.5 || {{T61}}, {{T61p}}<br>{{X61}}, {{X61s}}, {{X61 Tablet}}<br />
|-<br />
|| iAMT ? || {{T400}}, {{T400s}}, {{T410}}, {{T410i}}, {{T410s}}, {{T500}}, {{T510}}, {{T510i}}<br>{{W500}}, {{W510}}, {{W700}}, {{W700ds}}, {{W701}}, {{W701ds}}<br>{{X200}}, {{X200s}}, {{X200 Tablet}}, {{X201}}, {{X201i}}, {{X201s}}, {{X201 Tablet}}, {{X300}}, {{X301}}<br />
|}<br />
<br />
== Features ==<br />
* Management over the Network (LAN and WLAN, using AMT 2.5)<br />
* Remote Asset (Hardware and Software) Inventory<br />
* Remote Diagnostic and repair (even if laptop is off or down)<br />
* Agent Presence Checking (isolate corrupted laptops)<br />
* Encrypted software update (w/ remote power-on).<br />
* System isolation and recovery (Use hardware to filter inbound and outbound traffic, except management traffic)<br />
* Dedicated Flash memory (Firmware + Inventory + ISV Data)<br />
<br />
== Linux support ==<br />
The Linux '''heci''' driver to support iAMT was part of the staging tree as of the 2.6.30 kernel, but [http://driverdev.linuxdriverproject.org/pipermail/devel/2009-September/002458.html removed] in 2.6.32 at the request of Intel as they have indicated having no further interest in it and have abandoned it.<br />
<br />
* [http://www.openamt.org/ Intel OpenAMT project website] (abandoned)<br />
<br />
== Hints how to setup it via Intel ME BIOS Extension (MEBx) based on the T61p (Small business Mode) ==<br />
=== Pre-configuration ===<br />
* Use ThinkVantage System Update so you have the latest BIOS<br />
* Reboot the system<br />
<br />
=== Enabling AMT in BIOS ===<br />
* Hit the ThinkVantage button during the POST screen, then after the menu appears hit 'F1'<br />
** Select 'Config' on the main screen<br />
*** Select 'Intel(R) AMT'<br />
**** Set 'Intel(R) AMT Control' to 'Enabled'<br />
**** Hit 'F10' to Save and Exit<br />
<br />
=== Configuring Intel ME BIOS Extension for the first time ===<br />
* After the POST screen you will see the Intel ME BIOS Extension screen. Hit Ctrl+P to enter the setup.<br />
* The default password is 'admin' (without quotes)<br />
* If you try to change the Intel ME password and get "Error - Intel(R) ME password change rejected" message, then you are using a weak password. This are guidelines for the Intel ME strong password:<br />
** between 8- and 32-characters long<br />
** Contain both upper and lower case Latin characters<br />
** Have at least one numeric character<br />
** Have at least one ASCII non-alphanumeric character (!, @, #, $, %, ^, &, *)<br />
<br />
=== Enabling AMT in Intel Management Engine BIOS Extension ===<br />
* In the main MEBx menu Select Intel(R) ME Configuration<br />
** Select 'Intel(R) ME State Control'<br />
*** Set it ENABLED<br />
*** Select Return to Previous Menu<br />
** Select 'Intel(R) ME Firmware Local Update Qualifier'<br />
*** Set it to ALWAYS OPEN<br />
*** Select Return to Previous Menu<br />
** Select 'Intel(R) ME Features Control'<br />
*** Select 'Manageability Feature Selection'<br />
**** Choose 'Intel(R) AMT'<br />
*** Select Return to Previous menu<br />
** Select 'Intel(R) ME Power Control'<br />
*** Select 'Intel (R) ME ON in Host Sleep States'<br />
**** Set the 'widest' range of Sleep States<br />
**** Hit 'ESC' to Exit. The system will reboot now.<br />
<br />
=== Configuring AMT via Intel ME ===<br />
* Hit Ctrl+P when the Intel ME BIOS messages apear<br />
* Select 'Intel(R) AMT Configuration'<br />
** Select 'Host Name' and enter the same name as for the OS Host name<br />
** Select 'TCP/IP'<br />
*** Hit 'N' to enable the Network Interface<br />
*** Hit 'N' to enable DHCP<br />
*** provide your domain name as set (or to be set) in the OS<br />
** Select 'Provision Model'<br />
*** Hit 'N' to not change to AMT 1.0 Mode<br />
*** Hit 'Y; to change to Small Business<br />
** Select 'SOL/IDE-R'<br />
*** Hit 'Y' to confirm the warning<br />
*** Set Username & Password to ENABLED (if it's set to ENABLED don't hit just 'ENTER' because you disable it)<br />
*** Set Serial Over LAN to ENABLED<br />
*** Set IDE Redirection to ENABLED<br />
** Select 'Secure Firmware Update'<br />
*** Set it to ENABLED<br />
** Hit 'ESC' to Exit. The system will reboot again.<br />
<br />
=== Configuring Windows ===<br />
* Use ThinkVantage System Update to get the AMT Software<br />
* After update reboot<br />
* After Log-in you should see the message 'Intel(R) Active Management Technology (Intel(R) AMT) status on this computer is enabled.'<br />
<br />
=== Firmware update ===<br />
Lenovo provides Intel AMT firmware updates only in the form of Windows executables. Thus, if you don't have Windows installed on your laptop, for the purpose of updating Intel AMT firmware you will have to use [[Windows_PE|Windows PE]]. Once you boot into [[Windows_PE|Windows PE]], before launching the firmware upgrade with <tt>MEUPDATE.CMD</tt> (which you have to extract from [http://www-307.ibm.com/pc/support/site.wss/document.do?sitestyle=lenovo&lndocid=MIGR-71137 ''Intel AMT Management Engine Firmware for Windows''] using <tt>wine</tt>) you need to load HECI driver with "<tt>drvload HECI.inf</tt>" (the HECI driver can be extracted with <tt>wine</tt> from [http://www-307.ibm.com/pc/support/site.wss/document.do?sitestyle=lenovo&lndocid=MIGR-73723 ''Intel AMT Management Engine Interface for Windows'']).<br />
<br />
== Links ==<br />
* See Also [[Centrino Pro]]<br />
* Intel - AMT [http://www.intel.com/technology/manage/iamt/index.htm]<br />
* Intel® Active Management Technology (Intel AMT) Software Development Kit (SDK) Start Here Guide [http://softwarecommunity.intel.com/articles/eng/1027.htm]<br />
* Tips & Tricks for Setting up & Accessing an Intel AMT Client [http://softwareblogs.intel.com/2008/01/28/tips-tricks-for-setting-up-accessing-an-intel-amt-client/]<br />
* Intel-AMT Set And Review Thailand Version [[http://www.thaithinkpad.com/forum/index.php/topic,2226.0.html]]</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Intel_Active_Management_Technology_(AMT)&diff=48602Intel Active Management Technology (AMT)2010-05-20T08:01:49Z<p>Newhren: /* Firmware update */</p>
<hr />
<div>== Intel Active Management Technology (AMT) ==<br />
Some Lenovo laptop include some of Intel's Management features.<br />
{| border="1" cellspacing="0" cellpadding="2"<br />
|| Version || Models <br />
|-<br />
|| AMT 2.5 || {{T61}}, {{T61p}}<br>{{X61}}, {{X61s}}, {{X61 Tablet}}<br />
|-<br />
|| iAMT ? || {{T400}}, {{T400s}}, {{T410}}, {{T410i}}, {{T410s}}, {{T500}}, {{T510}}, {{T510i}}<br>{{W500}}, {{W510}}, {{W700}}, {{W700ds}}, {{W701}}, {{W701ds}}<br>{{X200}}, {{X200s}}, {{X200 Tablet}}, {{X201}}, {{X201i}}, {{X201s}}, {{X201 Tablet}}, {{X300}}, {{X301}}<br />
|}<br />
<br />
== Features ==<br />
* Management over the Network (LAN and WLAN, using AMT 2.5)<br />
* Remote Asset (Hardware and Software) Inventory<br />
* Remote Diagnostic and repair (even if laptop is off or down)<br />
* Agent Presence Checking (isolate corrupted laptops)<br />
* Encrypted software update (w/ remote power-on).<br />
* System isolation and recovery (Use hardware to filter inbound and outbound traffic, except management traffic)<br />
* Dedicated Flash memory (Firmware + Inventory + ISV Data)<br />
<br />
== Linux support ==<br />
The Linux '''heci''' driver to support iAMT was part of the staging tree as of the 2.6.30 kernel, but [http://driverdev.linuxdriverproject.org/pipermail/devel/2009-September/002458.html removed] in 2.6.32 at the request of Intel as they have indicated having no further interest in it and have abandoned it.<br />
<br />
* [http://www.openamt.org/ Intel OpenAMT project website] (abandoned)<br />
<br />
== Hints how to setup it via Intel ME BIOS Extension (MEBx) based on the T61p (Small business Mode) ==<br />
=== Pre-configuration ===<br />
* Use ThinkVantage System Update so you have the latest BIOS<br />
* Reboot the system<br />
<br />
=== Enabling AMT in BIOS ===<br />
* Hit the ThinkVantage button during the POST screen, then after the menu appears hit 'F1'<br />
** Select 'Config' on the main screen<br />
*** Select 'Intel(R) AMT'<br />
**** Set 'Intel(R) AMT Control' to 'Enabled'<br />
**** Hit 'F10' to Save and Exit<br />
<br />
=== Configuring Intel ME BIOS Extension for the first time ===<br />
* After the POST screen you will see the Intel ME BIOS Extension screen. Hit Ctrl+P to enter the setup.<br />
* The default password is 'admin' (without quotes)<br />
* If you try to change the Intel ME password and get "Error - Intel(R) ME password change rejected" message, then you are using a weak password. This are guidelines for the Intel ME strong password:<br />
** between 8- and 32-characters long<br />
** Contain both upper and lower case Latin characters<br />
** Have at least one numeric character<br />
** Have at least one ASCII non-alphanumeric character (!, @, #, $, %, ^, &, *)<br />
<br />
=== Enabling AMT in Intel Management Engine BIOS Extension ===<br />
* In the main MEBx menu Select Intel(R) ME Configuration<br />
** Select 'Intel(R) ME State Control'<br />
*** Set it ENABLED<br />
*** Select Return to Previous Menu<br />
** Select 'Intel(R) ME Firmware Local Update Qualifier'<br />
*** Set it to ALWAYS OPEN<br />
*** Select Return to Previous Menu<br />
** Select 'Intel(R) ME Features Control'<br />
*** Select 'Manageability Feature Selection'<br />
**** Choose 'Intel(R) AMT'<br />
*** Select Return to Previous menu<br />
** Select 'Intel(R) ME Power Control'<br />
*** Select 'Intel (R) ME ON in Host Sleep States'<br />
**** Set the 'widest' range of Sleep States<br />
**** Hit 'ESC' to Exit. The system will reboot now.<br />
<br />
=== Configuring AMT via Intel ME ===<br />
* Hit Ctrl+P when the Intel ME BIOS messages apear<br />
* Select 'Intel(R) AMT Configuration'<br />
** Select 'Host Name' and enter the same name as for the OS Host name<br />
** Select 'TCP/IP'<br />
*** Hit 'N' to enable the Network Interface<br />
*** Hit 'N' to enable DHCP<br />
*** provide your domain name as set (or to be set) in the OS<br />
** Select 'Provision Model'<br />
*** Hit 'N' to not change to AMT 1.0 Mode<br />
*** Hit 'Y; to change to Small Business<br />
** Select 'SOL/IDE-R'<br />
*** Hit 'Y' to confirm the warning<br />
*** Set Username & Password to ENABLED (if it's set to ENABLED don't hit just 'ENTER' because you disable it)<br />
*** Set Serial Over LAN to ENABLED<br />
*** Set IDE Redirection to ENABLED<br />
** Select 'Secure Firmware Update'<br />
*** Set it to ENABLED<br />
** Hit 'ESC' to Exit. The system will reboot again.<br />
<br />
=== Configuring Windows ===<br />
* Use ThinkVantage System Update to get the AMT Software<br />
* After update reboot<br />
* After Log-in you should see the message 'Intel(R) Active Management Technology (Intel(R) AMT) status on this computer is enabled.'<br />
<br />
=== Firmware update ===<br />
Lenovo provides Intel AMT firmware updates only in the form of Windows executables. Thus, if you don't have Windows installed on your laptop, for the purpose of updating Intel AMT firmware you will have to use [[Windows_PE|Windows PE]]. Once you boot into [[Windows_PE|Windows PE]], before launching the firmware upgrade with <tt>MEUPDATE.CMD</tt> (which you have to extract from [http://www-307.ibm.com/pc/support/site.wss/document.do?sitestyle=lenovo&lndocid=MIGR-73723 ''Intel AMT Management Engine Interface for Windows''] using <tt>wine</tt>) you need to load HECI driver with "<tt>drvload HECI.inf</tt>" (the HECI driver can be extracted with <tt>wine</tt> from [http://www-307.ibm.com/pc/support/site.wss/document.do?sitestyle=lenovo&lndocid=MIGR-71137 ''Intel AMT Management Engine Firmware for Windows'']).<br />
<br />
== Links ==<br />
* See Also [[Centrino Pro]]<br />
* Intel - AMT [http://www.intel.com/technology/manage/iamt/index.htm]<br />
* Intel® Active Management Technology (Intel AMT) Software Development Kit (SDK) Start Here Guide [http://softwarecommunity.intel.com/articles/eng/1027.htm]<br />
* Tips & Tricks for Setting up & Accessing an Intel AMT Client [http://softwareblogs.intel.com/2008/01/28/tips-tricks-for-setting-up-accessing-an-intel-amt-client/]<br />
* Intel-AMT Set And Review Thailand Version [[http://www.thaithinkpad.com/forum/index.php/topic,2226.0.html]]</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Ericsson_F3507g_Mobile_Broadband_Module&diff=48568Ericsson F3507g Mobile Broadband Module2010-05-16T19:36:26Z<p>Newhren: </p>
<hr />
<div>{| width="100%"<br />
|style="vertical-align:top" |<br />
<div style="margin: 0; margin-right:10px; border: 1px solid #dfdfdf; padding: 0em 1em 1em 1em; background-color:#F8F8FF; align:right;"><br />
=== Ericsson F3507g Mobile Broadband Module ===<br />
This is a Ericsson WWAN Adapter that is installed in a Mini-PCI Express slot<br />
<br />
{{NOTE|Specific versions of this card may come pre-configured for a certain carrier (AT&T)}}<br />
<br />
=== Features ===<br />
* Chipset: Ericsson F3507g<br />
* USB ID: 0bdb:1900<br />
* USB ID: 0bdb:1902<br />
* WCDMA 2100/1900/850MHz<br />
* GSM/GPRS/EDGE 850/900/1800/1900MHz<br />
* GPS<br />
* Download up to 7.2Mbps<br />
* Upload up to 2.0Mbps<br />
</div><br />
|style="vertical-align:top" |<br />
[[image:EriccsonWWAN.gif|thumb|Ericsson F3507g WWAN Adapter]]<br />
|}<br />
<br />
== Lenovo Partnumbers ==<br />
* Option PN 43R9152 (AT&T)<br />
* FRU 43Y6537 (AT&T)<br />
* FRU 43Y6513 (Other)<br />
__TOC__<br />
<br />
Here are some basics about Ericsson F3507g MiniPCIe WWAN/GPS card (USB ID <tt>0bdb:1900</tt> and <tt>0bdb:1902</tt>):<br />
<br />
* the card will not work without an inserted SIM, even the GPS function. If you want to use just GPS, any SIM would work, even if it is not attached to any active account with any GSM provider.<br />
* the card provides three CDC ACM interfaces (<tt>CONFIG_USB_ACM=m</tt>), two CDC WDM interfaces (<tt>CONFIG_USB_WDM=m</tt>) and one CDC Ethernet interface (<tt>CONFIG_USB_NET_CDCETHER=m</tt>), and identifies them as<br />
for n in `ls /sys/class/*/*{ACM,wdm,usb0}*/device/interface`;do echo $(echo $n|awk -F '/' '{print $5}') : $(cat $n);done<br />
<br />
usb0 : Ericsson F3507g Mobile Broadband Minicard Network Adapter<br />
ttyACM0 : Ericsson F3507g Mobile Broadband Minicard Modem<br />
ttyACM1 : Ericsson F3507g Mobile Broadband Minicard Data Modem<br />
ttyACM2 : Ericsson F3507g Mobile Broadband Minicard GPS Port<br />
cdc-wdm0 : Ericsson F3507g Mobile Broadband Minicard Device Management<br />
cdc-wdm1 : Ericsson F3507g Mobile Broadband Minicard PC SC Port<br />
'''Note''':<br />
*apparently, for a while <tt>option</tt> USB-serial driver had claimed USB ID <tt>0bdb:1900</tt>, but this was wrong, and as of kernel 2.6.28.9 that commit was reversed. If instead of <tt>/dev/ttyACM*</tt> you see <tt>/dev/ttyUSB*</tt>, it means that <tt>option</tt> module is loaded. You may need to blacklist it to make sure it doesn't happen.<br />
*Support for the CDC Ethernet interface appears only in kernel 2.6.28.8. But if your kernel is older, you can still connect to the net using one of the "Modem" interfaces. As of kernel 2.6.33 it is named <tt>wwan0</tt> rather than <tt>usb0</tt>.<br />
<br />
As Ericsson's naming scheme suggests, idealy we would use <tt>/dev/cdc-wdm0</tt> for controlling the card, <tt>usb0</tt> (or <tt>wwan0</tt>) as a network device, <tt>/dev/ttyACM0</tt> or <tt>/dev/ttyACM1</tt> as a modem, and <tt>/dev/ttyACM2</tt> for GPS. This works for manual testing, but unfortunately, due to [http://markmail.org/message/2sd7culbgekugow2 limitations] of <tt>chat</tt>, does not play very well in scripts. So, instead of <tt>/dev/cdc-wdm0</tt>, for controlling the card we will use <tt>/dev/ttyACM1</tt>.<br />
<br />
==Turning the card on==<br />
First, check whenever the SIM is protected by PIN by sending <br />
<br />
AT+CPIN?<br />
<br />
to <tt>/dev/ttyACM1</tt>. You can do it with any terminal terminal program like <tt>cu</tt> or <tt>minicom</tt>. If the answer is<br />
<br />
+CPIN: READY<br />
<br />
then the SIM is unlocked. If the answer is<br />
<br />
+CPIN: SIM PIN<br />
<br />
you need first to unlock it by sending<br />
<br />
AT+CPIN="YOUR-PIN"<br />
<br />
to <tt>/dev/ttyACM1</tt>. Now the card can be turned on by sending <br />
<br />
AT+CFUN=1<br />
<br />
to <tt>/dev/ttyACM1</tt>. The answer should be<br />
<br />
+PACSP0<br />
<br />
Don't try to do anything until you see it. To force GSM-only connection, send<br />
<br />
AT+CFUN=5<br />
<br />
to <tt>/dev/ttyACM1</tt>. To force WCDMA-only connection, send<br />
<br />
AT+CFUN=6<br />
<br />
to <tt>/dev/ttyACM1</tt>.<br />
<br />
==Turning the card off==<br />
To put the card into energy-saving mode (this is the default), you can send<br />
<br />
AT+CFUN=4<br />
<br />
to <tt>/dev/ttyACM1</tt>. To remove all power from the card, send<br />
<br />
AT+CFUN=0<br />
<br />
to <tt>/dev/ttyACM1</tt>. Be carefull with the last command. It turns the card completely off, and it will no longer accept any AT-commands before the hard reset. To physically reset the card flip the wireless switch off, and then on. You can do the same by sending <tt>echo 0 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state</tt> (to turn off) and then <tt>echo 1 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state</tt> (to turn on).<br />
<br />
==Using the card as a wireless modem==<br />
Once the card is turned on, there are two ways to connect to the net. The first one is just to use the card as any "normal" GPRS modem and start <tt>pppd</tt> daemon on one of <tt>/dev/ttyACM*</tt>. The other way is to use CDC Ethernet interface. It is supposed to be more efficient, but it requires a pretty recent (>=2.6.28.8) kernel.<br />
<br />
====Connecting to the net via pppd====<br />
For the first approach, the easiest way to do it is to use <tt>wvdial</tt>. For example, to connect to AT&T Wireless network, your <tt>/etc/wvdial.conf</tt> would have to be something like this<br />
[Dialer 3G]<br />
Modem = /dev/ttyACM0<br />
Init1 = AT+CGDCONT=1,"IP","'''proxy'''"<br />
Stupid mode = 1<br />
phone= *99#<br />
Username = *<br />
Password = *<br />
'''Note''': if you are using a SIM from a different mobile provider, you may need to change the access point name (APN) "'''proxy'''" in <tt>Init1</tt> string and Username/Password to something else. You can find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here].<br />
<br />
====Connecting to the net via CDC Ethernet interface====<br />
The [http://marc.info/?l=linux-usb&m=123334979706403&w=2 second approach] works for kernels >=2.6.28.8. Configure the APN by sending<br />
<br />
AT+CGDCONT=1,"IP","'''proxy'''"<br />
<br />
to <tt>/dev/ttyACM1</tt>. Instead of "'''proxy'''" you may need to use to something else. Find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here]. To initiate the connection, send<br />
<br />
AT*ENAP=1,1<br />
<br />
to <tt>/dev/ttyACM1</tt>. Now, if your wireless provider lets you in, you are connected. Launch <tt>dhclient</tt><br />
<br />
dhclient usb0<br />
<br />
and start surfing the net (or use <tt>wwan0</tt> for kernels >= 2.6.33). To disconnect, send<br />
<br />
AT*ENAP=0<br />
<br />
to <tt>/dev/ttyACM1</tt>.<br />
<br />
==Using the card as a GPS receiver==<br />
Once the card is turned on, we can use it to get GPS info via NMEA protocol. First, you have to configure the a few NMEA options. It is done by sending <br />
<br />
AT*E2GPSCTL=X,Y,Z<br />
<br />
to <tt>/dev/ttyACM1</tt>. Here<br />
<br />
*X can be 0 (NMEA stream turned off) or 1 (NMEA stream turned on)<br />
*Y can be an integer form 1 to 60, and sets the frequency of how often the card emits the NMEA sentences<br />
*Z can be 0 (DGPS is turned off) or 1 (DGPS is turned on)<br />
<br />
so, to configure the GPSr to update every 5 seconds, and turn DGPS on, you would send<br />
<br />
AT*E2GPSCTL=1,5,1<br />
<br />
to <tt>/dev/ttyACM1</tt>. Once the GPSr is configured, we can get the NMEA stream on /dev/ttyACM2 by sending<br />
<br />
AT*E2GPSNPD<br />
<br />
to <tt>/dev/ttyACM2</tt>. Once you do that, <tt>/dev/ttyACM2</tt> will no longer accept any new AT-commands. But you still can change the the behavior of the NMEA stream by sending the appropriate<br />
<br />
AT*E2GPSCTL=X,Y,Z<br />
<br />
to <tt>/dev/ttyACM1</tt>. Now you can read the NMEA stream by saying<br />
<br />
cat /dev/ttyACM2<br />
<br />
or better yet, start <tt>gpsd</tt> interface on <tt>/dev/ttyACM2</tt>.<br />
<br />
Note: There is a now a sourceforge project dedicated to the Ericsson Mobile Broadband modules. Gps control sw that does the above automatically is available and also a graphical user interface. Details are available on the [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=Main_Page#GPS_Control_.28mbm-gpsd.29 MBM Wiki].<br />
<br />
==Scripting everything==<br />
Install the packages<br />
<br />
apt-get install sysfsutils gpsd wvdial<br />
<br />
In order to save the power, let us use '''sysfsutils''' to completely power off the WWAN card on boot. Append the following line to <tt>/etc/sysfs.conf</tt><br />
<br />
devices/platform/thinkpad_acpi/rfkill/rfkill0/state = 0<br />
<br />
It will power down the card on boot, but when the laptop wakes from sleep, in some cases the card is powered up again. To re-apply these settings on wake-up, create a script named <tt>/etc/pm/sleep.d/10sysfsutils</tt>:<br />
<br />
#!/bin/sh<br />
case $1 in<br />
(hibernate|suspend)<br />
;;<br />
(thaw|resume)<br />
/etc/init.d/sysfsutils start<br />
;;<br />
*) echo "somebody is calling me totally wrong."<br />
;;<br />
esac<br />
<br />
Don't forget to <tt>chmod a+x /etc/pm/sleep.d/10sysfsutils</tt>. Create a file called <tt>/usr/local/etc/F3507g</tt> containing the following:<br />
<br />
'''USB_ID="0bdb:1900"'''<br />
'''PIN=""'''<br />
'''APN="proxy"'''<br />
<br />
GPSDPID="/var/run/gpsd.pid"<br />
<br />
RFKILL_DEVICE=$(for n in /sys/devices/platform/thinkpad_acpi/rfkill/rfkill*; do if [ "$(cat $n/name)" = "tpacpi_wwan_sw" ]; then echo $n/state; fi; done)<br />
<br />
CONTROL_DEVICE () {<br />
echo /dev/$(for n in /sys/class/tty/ttyACM*/device/interface;do if [ "$(cat $n)" = "Ericsson F3507g Mobile Broadband Minicard Data Modem" ]; then echo $n|awk -F '/' '{print $5}'; fi; done)<br />
}<br />
<br />
GPS_DEVICE () {<br />
echo /dev/$(for n in /sys/class/tty/ttyACM*/device/interface;do if [ "$(cat $n)" = "Ericsson F3507g Mobile Broadband Minicard GPS Port" ]; then echo $n|awk -F '/' '{print $5}'; fi; done)<br />
}<br />
<br />
powerup_F3507g () {<br />
echo -n "Powering up F3507g card.."<br />
echo 1 > $RFKILL_DEVICE<br />
while [ -z "$(lsusb -d $USB_ID)" ]; do sleep 0.5; echo -n "."; done<br />
echo "done"<br />
echo -n "Turning on F3507g card..."<br />
sleep 3<br />
if [ -n "$PIN" ]; then<br />
/usr/sbin/chat -v "" "AT+CPIN?" "SIM PIN" "AT" "OK" "AT+CPIN=\"$PIN\"" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
fi<br />
/usr/sbin/chat -v "" "AT+CPIN?" "READY" "AT+CFUN=1" "+PACSP" "AT" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
echo "done"<br />
}<br />
<br />
powerdown_F3507g () {<br />
echo -n "Turning off F3507g card..."<br />
/usr/sbin/chat -v "" "AT+CFUN=4" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
echo "done"<br />
echo -n "Powering down F3507g card.."<br />
echo 0 > $RFKILL_DEVICE<br />
while [ -n "$(lsusb -d $USB_ID)" ]; do sleep 0.5; echo -n "."; done<br />
echo "done"<br />
}<br />
<br />
configure_GPS () {<br />
/usr/sbin/chat -v "" "AT*E2GPSCTL=$1,$2,$3" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
}<br />
<br />
turnon_GPS () {<br />
echo -n "Starting NMEA stream on $(GPS_DEVICE)..."<br />
configure_GPS 1 1 1<br />
sleep 1<br />
/usr/sbin/chat -v "" "AT*E2GPSNPD" "GPGGA" > $(GPS_DEVICE) < $(GPS_DEVICE)<br />
start-stop-daemon --start --exec /usr/sbin/gpsd -- -P $GPSDPID $(GPS_DEVICE)<br />
echo "done"<br />
}<br />
<br />
turnoff_GPS () {<br />
echo -n "Stopping NMEA stream on $(GPS_DEVICE)..."<br />
start-stop-daemon --stop --pidfile $GPSDPID<br />
configure_GPS 0 1 0<br />
echo "done"<br />
turnoff_F3507g<br />
}<br />
<br />
turnon_WWAN () {<br />
echo -n "Starting WWAN connection..."<br />
/usr/sbin/chat -v "" "AT+CGDCONT=1,\"IP\",\"$APN\"" "OK" "AT*ENAP=1,1" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
echo "done"<br />
}<br />
<br />
turnoff_WWAN () {<br />
echo -n "Stopping WWAN connection..."<br />
/usr/sbin/chat -v "" "AT*ENAP=0" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
echo "done"<br />
turnoff_F3507g<br />
}<br />
<br />
turnoff_F3507g () {<br />
[ -z $(grep gps /etc/network/run/ifstate) ] && \<br />
[ -z $(grep usb0 /etc/network/run/ifstate) ] && \<br />
[ -z $(grep 3G /etc/network/run/ifstate) ] && \<br />
ifdown F3507g<br />
}<br />
<br />
Give the correct '''USB_ID''' and '''PIN''', and find the '''APN''' for your wireless provider [http://www.pinstack.com/carrier_settings_apn_gateway.html here]. Append the following lines to your <tt>/etc/network/interfaces</tt> file<br />
<br />
iface F3507g inet manual<br />
up . /usr/local/etc/F3507g; powerup_F3507g<br />
down . /usr/local/etc/F3507g; powerdown_F3507g<br />
<br />
iface 3G inet wvdial<br />
pre-up ifup F3507g<br />
post-down . /usr/local/etc/F3507g; turnoff_F3507g<br />
provider 3G<br />
<br />
iface gps inet manual<br />
up . /usr/local/etc/F3507g; ifup F3507g; turnon_GPS<br />
down . /usr/local/etc/F3507g; turnoff_GPS<br />
<br />
iface usb0 inet dhcp<br />
pre-up . /usr/local/etc/F3507g; ifup F3507g; turnon_WWAN<br />
post-down . /usr/local/etc/F3507g; turnoff_WWAN<br />
<br />
Configure <tt>/etc/wvdial.conf</tt> to look like this:<br />
<br />
[Dialer 3G]<br />
Modem = /dev/ttyACM0<br />
Init1 = AT+CGDCONT=1,"IP","'''proxy'''"<br />
Stupid mode = 1<br />
phone= *99#<br />
Username = *<br />
Password = *<br />
<br />
'''Note''': you may need to change the access point name (APN) "'''proxy'''" in <tt>Init1</tt> string and Username/Password to something else. Find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here].<br />
<br />
Now broadband connection could be started in the same way as you start any other network interface, just by saying <tt>ifup usb0</tt> (or <tt>ifup 3G</tt>, if connecting via <tt>pppd</tt>). To shut it down, say <tt>ifdown usb0</tt> (or <tt>ifdown 3G</tt>). Similarly, GPS interface is started by <tt>ifup gps</tt> and turned off by <tt>ifdown gps</tt>. Once you get a fix, you can use your favourite GPS mapping application like [http://www.tangogps.org tangogps]. The "cold start" seems to take quite a bit however, and sometimes it cannot get a fix if indoors.<br />
<br />
==Using F3507g with NetworkManager==<br />
Work is ongoing to add support for Ericsson Mobile Broadband Modules to GNOME NetworkManager / modem-manager. More information is available on the [http://mbm.sourceforge.net/ MBM project website] and the [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=MBM MBM wiki].<br />
<br />
The F3507g card (in a ThinkPad {{T400s}}) works out of the box on Fedora 11. No configuration is needed beyond setting the data plan provider in the nm-applet GUI.<br />
<br />
Using mbm-gpsd gps works flawlessly with the F3507g on Karmic Koala with modemmanager packages from [https://launchpad.net/~modemmanager/+archive/ppa Ubuntu PPA], the mbm-gpsd installed by source using the description from [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=MBM#GPS_Control_.28mbm-gpsd.29 here] and knowing the PIN of your SIM card.<br />
<br />
== SMS with wammu/gammu ==<br />
You can use [http://wammu.eu/ Wammu] to receive and send SMS.<br />
<br />
After installing wammu (with the usual <tt>apt-get install wammu</tt> or whatever), choose to configure it "Manually":<br />
port=/dev/ttyACM0<br />
connection=at<br />
<br />
(credits: [http://www.thinkpad-forum.de/thinkpad-software/linux-und-osx/p633662-sms-mit-der-ericsson-3507g/ linrunner])<br />
<br />
Sony Ericsson F3507g configuration [http://wammu.eu/phones/sony-ericsson/3595/ explained on wammu website]<br />
<br />
==Other thoughts==<br />
While <tt>AT+CFUN=*</tt> and <tt>AT+CPIN=*</tt> are pretty standard commands for wireless modems and are well-documented, it appears that the commands <tt>AT*E2GPSCTL</tt> and <tt>AT*E2GPSNPD</tt> are unique to the Ericsson F3507g card. All credit for discovering them goes to "Nickolai Zeldovich" who left a comment in this [http://redmonk.com/sogrady/2008/09/24/apone/ thread]. I imagine one could find them via a USB sniffer on a working Windows machine (or a Linux machine with Windows running in a virtual machine). Another way to get them is to try to look for "gps" string in Windows drivers. What is interesting, F3507g supports a few other AT-commands with "GPS" substring (you can get all supported AT-commands by sending <tt>AT*</tt> to <tt>/dev/ttyACM1</tt> after activating it with <tt>AT+CFUN=1</tt>). Anyway, there is a [http://www.natisbad.org/E4300/Dell_Wireless_5530_AT_cmd_ref.html project] aiming to document all AT-commands for the Ericsson F3507g card.<br />
<br />
==Related Links==<br />
*[http://www.ericsson.com/solutions/mobile_broadband_modules/docs/mobile_broadband_module_datasheet_print.pdf Ericsson Datasheet]<br />
*[http://www.natisbad.org/E4300/Dell_Wireless_5530_AT_cmd_ref.html F3507g - AT commands reference]<br />
*[http://www.pinstack.com/carrier_settings_apn_gateway.html Carrier internet Settings (Apn, Gateway, etc)]<br />
*[http://mbm.sourceforge.net/ MBM project website (Support for f3507g/f3607gw in NetworkManager, kernel drivers, gps control software etc)]<br />
<br />
==Bugs==<br />
* Ubuntu 8.10 kernel suffers from the "option" regression mentioned above. However both CDC ACM and CDC Ethernet interfaces are treated correctly by Ubuntu 9.04 kernel.<br />
* Playing around with the device under Linux can cause it to disappear under Windows Vista. Issue + Fix described [http://forums.lenovo.com/t5/T400-T500-and-newer-T-series/Ericsson-f3507g-doesn-t-appear-under-Vista32-anymore-but-works/m-p/138874 here]<br />
<br />
==ThinkPads this adapter may be found in==<br />
*{{SL300}}, {{SL400}}, {{SL500}}, {{SL510}}<br />
*{{T400}}, {{T400s}}, {{T500}}<br />
*{{W500}}<br />
*{{X200}}, {{X200 Tablet}}, {{X301}}</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Ericsson_F3507g_Mobile_Broadband_Module&diff=48567Ericsson F3507g Mobile Broadband Module2010-05-16T19:25:50Z<p>Newhren: </p>
<hr />
<div>{| width="100%"<br />
|style="vertical-align:top" |<br />
<div style="margin: 0; margin-right:10px; border: 1px solid #dfdfdf; padding: 0em 1em 1em 1em; background-color:#F8F8FF; align:right;"><br />
=== Ericsson F3507g Mobile Broadband Module ===<br />
This is a Ericsson WWAN Adapter that is installed in a Mini-PCI Express slot<br />
<br />
{{NOTE|Specific versions of this card may come pre-configured for a certain carrier (AT&T)}}<br />
<br />
=== Features ===<br />
* Chipset: Ericsson F3507g<br />
* USB ID: 0bdb:1900<br />
* USB ID: 0bdb:1902<br />
* WCDMA 2100/1900/850MHz<br />
* GSM/GPRS/EDGE 850/900/1800/1900MHz<br />
* GPS<br />
* Download up to 7.2Mbps<br />
* Upload up to 2.0Mbps<br />
</div><br />
|style="vertical-align:top" |<br />
[[image:EriccsonWWAN.gif|thumb|Ericsson F3507g WWAN Adapter]]<br />
|}<br />
<br />
== Lenovo Partnumbers ==<br />
* Option PN 43R9152 (AT&T)<br />
* FRU 43Y6537 (AT&T)<br />
* FRU 43Y6513 (Other)<br />
__TOC__<br />
<br />
Here are some basics about Ericsson F3507g MiniPCIe WWAN/GPS card (USB ID <tt>0bdb:1900</tt> and <tt>0bdb:1902</tt>):<br />
<br />
* the card will not work without an inserted SIM, even the GPS function. If you want to use just GPS, any SIM would work, even if it is not attached to any active account with any GSM provider.<br />
* the card provides three CDC ACM interfaces (<tt>CONFIG_USB_ACM=m</tt>), two CDC WDM interfaces (<tt>CONFIG_USB_WDM=m</tt>) and one CDC Ethernet interface (<tt>CONFIG_USB_NET_CDCETHER=m</tt>), and identifies them as<br />
for n in `ls /sys/class/*/*{ACM,wdm,usb0}*/device/interface`;do echo $(echo $n|awk -F '/' '{print $5}') : $(cat $n);done<br />
<br />
usb0 : Ericsson F3507g Mobile Broadband Minicard Network Adapter<br />
ttyACM0 : Ericsson F3507g Mobile Broadband Minicard Modem<br />
ttyACM1 : Ericsson F3507g Mobile Broadband Minicard Data Modem<br />
ttyACM2 : Ericsson F3507g Mobile Broadband Minicard GPS Port<br />
cdc-wdm0 : Ericsson F3507g Mobile Broadband Minicard Device Management<br />
cdc-wdm1 : Ericsson F3507g Mobile Broadband Minicard PC SC Port<br />
'''Note''':<br />
*apparently, for a while <tt>option</tt> USB-serial driver had claimed USB ID <tt>0bdb:1900</tt>, but this was wrong, and as of kernel 2.6.28.9 that commit was reversed. If instead of <tt>/dev/ttyACM*</tt> you see <tt>/dev/ttyUSB*</tt>, it means that <tt>option</tt> module is loaded. You may need to blacklist it to make sure it doesn't happen.<br />
*Support for the CDC Ethernet interface appears only in kernel 2.6.28.8. But if your kernel is older, you can still connect to the net using one of the "Modem" interfaces. As of kernel 2.6.33 it is named <tt>wwan0</tt> rather than <tt>usb0</tt>.<br />
<br />
As Ericsson's naming scheme suggests, idealy we would use <tt>/dev/cdc-wdm0</tt> for controlling the card, <tt>usb0</tt> (or <tt>wwan0</tt>) as a network device, <tt>/dev/ttyACM0</tt> or <tt>/dev/ttyACM1</tt> as a modem, and <tt>/dev/ttyACM2</tt> for GPS. This works for manual testing, but unfortunately, due to [http://markmail.org/message/2sd7culbgekugow2 limitations] of <tt>chat</tt>, does not play very well in scripts. So, instead of <tt>/dev/cdc-wdm0</tt>, for controlling the card we will use <tt>/dev/ttyACM1</tt>.<br />
<br />
==Turning the card on==<br />
First, check whenever the SIM is protected by PIN by sending <br />
<br />
AT+CPIN?<br />
<br />
to <tt>/dev/ttyACM1</tt>. You can do it with any terminal terminal program like <tt>cu</tt> or <tt>minicom</tt>. If the answer is<br />
<br />
+CPIN: READY<br />
<br />
then the SIM is unlocked. If the answer is<br />
<br />
+CPIN: SIM PIN<br />
<br />
you need first to unlock it by sending<br />
<br />
AT+CPIN="YOUR-PIN"<br />
<br />
to <tt>/dev/ttyACM1</tt>. Now the card can be turned on by sending <br />
<br />
AT+CFUN=1<br />
<br />
to <tt>/dev/ttyACM1</tt>. The answer should be<br />
<br />
+PACSP0<br />
<br />
Don't try to do anything until you see it. To force GSM-only connection, send<br />
<br />
AT+CFUN=5<br />
<br />
to <tt>/dev/ttyACM1</tt>. To force WCDMA-only connection, send<br />
<br />
AT+CFUN=6<br />
<br />
to <tt>/dev/ttyACM1</tt>.<br />
<br />
==Turning the card off==<br />
To put the card into energy-saving mode (this is the default), you can send<br />
<br />
AT+CFUN=4<br />
<br />
to <tt>/dev/ttyACM1</tt>. To remove all power from the card, send<br />
<br />
AT+CFUN=0<br />
<br />
to <tt>/dev/ttyACM1</tt>. Be carefull with the last command. It turns the card completely off, and it will no longer accept any AT-commands before the hard reset. To physically reset the card flip the wireless switch off, and then on. You can do the same by sending <tt>echo 0 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state</tt> (to turn off) and then <tt>echo 1 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state</tt> (to turn on).<br />
<br />
==Using the card as a wireless modem==<br />
Once the card is turned on, there are two ways to connect to the net. The first one is just to use the card as any "normal" GPRS modem and start <tt>pppd</tt> daemon on one of <tt>/dev/ttyACM*</tt>. The other way is to use CDC Ethernet interface. It is supposed to be more efficient, but it requires a pretty recent (>=2.6.28.8) kernel.<br />
<br />
====Connecting to the net via pppd====<br />
For the first approach, the easiest way to do it is to use <tt>wvdial</tt>. For example, to connect to AT&T Wireless network, your <tt>/etc/wvdial.conf</tt> would have to be something like this<br />
[Dialer 3G]<br />
Modem = /dev/ttyACM0<br />
Init1 = AT+CGDCONT=1,"IP","'''proxy'''"<br />
Stupid mode = 1<br />
phone= *99#<br />
Username = *<br />
Password = *<br />
'''Note''': if you are using a SIM from a different mobile provider, you may need to change the access point name (APN) "'''proxy'''" in <tt>Init1</tt> string and Username/Password to something else. You can find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here].<br />
<br />
====Connecting to the net via CDC Ethernet interface====<br />
The [http://marc.info/?l=linux-usb&m=123334979706403&w=2 second approach] works for kernels >=2.6.28.8. Configure the APN by sending<br />
<br />
AT+CGDCONT=1,"IP","'''proxy'''"<br />
<br />
to <tt>/dev/ttyACM1</tt>. Instead of "'''proxy'''" you may need to use to something else. Find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here]. To initiate the connection, send<br />
<br />
AT*ENAP=1,1<br />
<br />
to <tt>/dev/ttyACM1</tt>. Now, if your wireless provider lets you in, you are connected. Launch <tt>dhclient</tt><br />
<br />
dhclient usb0<br />
<br />
and start surfing the net (or use <tt>wwan0</tt> for kernels >= 2.6.33). To disconnect, send<br />
<br />
AT*ENAP=0<br />
<br />
to <tt>/dev/ttyACM1</tt>.<br />
<br />
==Using the card as a GPS receiver==<br />
Once the card is turned on, we can use it to get GPS info via NMEA protocol. First, you have to configure the a few NMEA options. It is done by sending <br />
<br />
AT*E2GPSCTL=X,Y,Z<br />
<br />
to <tt>/dev/ttyACM1</tt>. Here<br />
<br />
*X can be 0 (NMEA stream turned off) or 1 (NMEA stream turned on)<br />
*Y can be an integer form 1 to 60, and sets the frequency of how often the card emits the NMEA sentences<br />
*Z can be 0 (DGPS is turned off) or 1 (DGPS is turned on)<br />
<br />
so, to configure the GPSr to update every 5 seconds, and turn DGPS on, you would send<br />
<br />
AT*E2GPSCTL=1,5,1<br />
<br />
to <tt>/dev/ttyACM1</tt>. Once the GPSr is configured, we can get the NMEA stream on /dev/ttyACM2 by sending<br />
<br />
AT*E2GPSNPD<br />
<br />
to <tt>/dev/ttyACM2</tt>. Once you do that, <tt>/dev/ttyACM2</tt> will no longer accept any new AT-commands. But you still can change the the behavior of the NMEA stream by sending the appropriate<br />
<br />
AT*E2GPSCTL=X,Y,Z<br />
<br />
to <tt>/dev/ttyACM1</tt>. Now you can read the NMEA stream by saying<br />
<br />
cat /dev/ttyACM2<br />
<br />
or better yet, start <tt>gpsd</tt> interface on <tt>/dev/ttyACM2</tt>.<br />
<br />
Note: There is a now a sourceforge project dedicated to the Ericsson Mobile Broadband modules. Gps control sw that does the above automatically is available and also a graphical user interface. Details are available on the [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=Main_Page#GPS_Control_.28mbm-gpsd.29 MBM Wiki].<br />
<br />
==Scripting everything==<br />
Install the packages<br />
<br />
apt-get install sysfsutils gpsd wvdial<br />
<br />
In order to save the power, let us use '''sysfsutils''' to completely power off the WWAN card on boot. Append the following line to <tt>/etc/sysfs.conf</tt><br />
<br />
devices/platform/thinkpad_acpi/rfkill/rfkill0/state = 0<br />
<br />
It will power down the card on boot, but when the laptop wakes from sleep, in some cases the card is powered up again. To re-apply these settings on wake-up, create a script named <tt>/etc/pm/sleep.d/10sysfsutils</tt>:<br />
<br />
#!/bin/sh<br />
case $1 in<br />
(hibernate|suspend)<br />
;;<br />
(thaw|resume)<br />
/etc/init.d/sysfsutils start<br />
;;<br />
*) echo "somebody is calling me totally wrong."<br />
;;<br />
esac<br />
<br />
Don't forget to <tt>chmod a+x /etc/pm/sleep.d/10sysfsutils</tt>. Create a file called <tt>/usr/local/etc/F3507g</tt> containing the following:<br />
<br />
'''USB_ID="0bdb:1900"'''<br />
'''PIN=""'''<br />
'''APN="proxy"'''<br />
<br />
GPSDPID="/var/run/gpsd.pid"<br />
<br />
RFKILL_DEVICE=$(for n in /sys/devices/platform/thinkpad_acpi/rfkill/rfkill*; do if [ "$(cat $n/name)" = "tpacpi_wwan_sw" ]; then echo $n/state; fi; done)<br />
<br />
CONTROL_DEVICE () {<br />
echo /dev/$(for n in /sys/class/tty/ttyACM*/device/interface;do if [ "$(cat $n)" = "Ericsson F3507g Mobile Broadband Minicard Data Modem" ]; then echo $n|awk -F '/' '{print $5}'; fi; done)<br />
}<br />
<br />
GPS_DEVICE () {<br />
echo /dev/$(for n in /sys/class/tty/ttyACM*/device/interface;do if [ "$(cat $n)" = "Ericsson F3507g Mobile Broadband Minicard GPS Port" ]; then echo $n|awk -F '/' '{print $5}'; fi; done)<br />
}<br />
<br />
powerup_F3507g () {<br />
echo -n "Powering up F3507g card.."<br />
echo 1 > $RFKILL_DEVICE<br />
while [ -z "$(lsusb -d $USB_ID)" ]; do sleep 0.5; echo -n "."; done<br />
echo "done"<br />
echo -n "Turning on F3507g card..."<br />
sleep 3<br />
if [ -n "$PIN" ]; then<br />
/usr/sbin/chat -v "" "AT+CPIN?" "SIM PIN" "AT" "OK" "AT+CPIN=\"$PIN\"" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
fi<br />
/usr/sbin/chat -v "" "AT+CPIN?" "READY" "AT+CFUN=1" "+PACSP" "AT" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
echo "done"<br />
}<br />
<br />
powerdown_F3507g () {<br />
echo -n "Turning off F3507g card..."<br />
/usr/sbin/chat -v "" "AT+CFUN=4" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
echo "done"<br />
echo -n "Powering down F3507g card.."<br />
echo 0 > $RFKILL_DEVICE<br />
while [ -n "$(lsusb -d $USB_ID)" ]; do sleep 0.5; echo -n "."; done<br />
echo "done"<br />
}<br />
<br />
configure_GPS () {<br />
/usr/sbin/chat -v "" "AT*E2GPSCTL=$1,$2,$3" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
}<br />
<br />
turnon_GPS () {<br />
echo -n "Starting NMEA stream on $(GPS_DEVICE)..."<br />
configure_GPS 1 1 1<br />
sleep 1<br />
/usr/sbin/chat -v "" "AT*E2GPSNPD" "GPGGA" > $(GPS_DEVICE) < $(GPS_DEVICE)<br />
start-stop-daemon --start --exec /usr/sbin/gpsd -- -P $GPSDPID $(GPS_DEVICE)<br />
echo "done"<br />
}<br />
<br />
turnoff_GPS () {<br />
echo -n "Stopping NMEA stream on $(GPS_DEVICE)..."<br />
start-stop-daemon --stop --pidfile $GPSDPID<br />
configure_GPS 0 1 0<br />
echo "done"<br />
turnoff_F3507g<br />
}<br />
<br />
turnon_wwan () {<br />
echo -n "Starting wwan connection..."<br />
/usr/sbin/chat -v "" "AT+CGDCONT=1,\"IP\",\"$APN\"" "OK" "AT*ENAP=1,1" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
echo "done"<br />
}<br />
<br />
turnoff_wwan () {<br />
echo -n "Stopping wwan connection..."<br />
/usr/sbin/chat -v "" "AT*ENAP=0" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
echo "done"<br />
turnoff_F3507g<br />
}<br />
<br />
turnoff_F3507g () {<br />
[ -z $(grep gps /etc/network/run/ifstate) ] && \<br />
[ -z $(grep usb0 /etc/network/run/ifstate) ] && \<br />
[ -z $(grep 3G /etc/network/run/ifstate) ] && \<br />
ifdown F3507g<br />
}<br />
<br />
Give the correct '''USB_ID''' and '''PIN''', and find the '''APN''' for your wireless provider [http://www.pinstack.com/carrier_settings_apn_gateway.html here]. Append the following lines to your <tt>/etc/network/interfaces</tt> file<br />
<br />
iface F3507g inet manual<br />
up . /usr/local/etc/F3507g; powerup_F3507g<br />
down . /usr/local/etc/F3507g; powerdown_F3507g<br />
<br />
iface 3G inet wvdial<br />
pre-up ifup F3507g<br />
post-down . /usr/local/etc/F3507g; turnoff_F3507g<br />
provider 3G<br />
<br />
iface gps inet manual<br />
up . /usr/local/etc/F3507g; ifup F3507g; turnon_GPS<br />
down . /usr/local/etc/F3507g; turnoff_GPS<br />
<br />
iface usb0 inet dhcp<br />
pre-up . /usr/local/etc/F3507g; ifup F3507g; turnon_wwan<br />
post-down . /usr/local/etc/F3507g; turnoff_wwan<br />
<br />
Configure <tt>/etc/wvdial.conf</tt> to look like this:<br />
<br />
[Dialer 3G]<br />
Modem = /dev/ttyACM0<br />
Init1 = AT+CGDCONT=1,"IP","'''proxy'''"<br />
Stupid mode = 1<br />
phone= *99#<br />
Username = *<br />
Password = *<br />
<br />
'''Note''': you may need to change the access point name (APN) "'''proxy'''" in <tt>Init1</tt> string and Username/Password to something else. Find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here].<br />
<br />
Now broadband connection could be started in the same way as you start any other network interface, just by saying <tt>ifup usb0</tt> (or <tt>ifup 3G</tt>, if connecting via <tt>pppd</tt>). To shut it down, say <tt>ifdown usb0</tt> (or <tt>ifdown 3G</tt>). Similarly, GPS interface is started by <tt>ifup gps</tt> and turned off by <tt>ifdown gps</tt>. Once you get a fix, you can use your favourite GPS mapping application like [http://www.tangogps.org tangogps]. The "cold start" seems to take quite a bit however, and sometimes it cannot get a fix if indoors.<br />
<br />
==Using F3507g with NetworkManager==<br />
Work is ongoing to add support for Ericsson Mobile Broadband Modules to GNOME NetworkManager / modem-manager. More information is available on the [http://mbm.sourceforge.net/ MBM project website] and the [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=MBM MBM wiki].<br />
<br />
The F3507g card (in a ThinkPad {{T400s}}) works out of the box on Fedora 11. No configuration is needed beyond setting the data plan provider in the nm-applet GUI.<br />
<br />
Using mbm-gpsd gps works flawlessly with the F3507g on Karmic Koala with modemmanager packages from [https://launchpad.net/~modemmanager/+archive/ppa Ubuntu PPA], the mbm-gpsd installed by source using the description from [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=MBM#GPS_Control_.28mbm-gpsd.29 here] and knowing the PIN of your SIM card.<br />
<br />
== SMS with wammu/gammu ==<br />
You can use [http://wammu.eu/ Wammu] to receive and send SMS.<br />
<br />
After installing wammu (with the usual <tt>apt-get install wammu</tt> or whatever), choose to configure it "Manually":<br />
port=/dev/ttyACM0<br />
connection=at<br />
<br />
(credits: [http://www.thinkpad-forum.de/thinkpad-software/linux-und-osx/p633662-sms-mit-der-ericsson-3507g/ linrunner])<br />
<br />
Sony Ericsson F3507g configuration [http://wammu.eu/phones/sony-ericsson/3595/ explained on wammu website]<br />
<br />
==Other thoughts==<br />
While <tt>AT+CFUN=*</tt> and <tt>AT+CPIN=*</tt> are pretty standard commands for wireless modems and are well-documented, it appears that the commands <tt>AT*E2GPSCTL</tt> and <tt>AT*E2GPSNPD</tt> are unique to the Ericsson F3507g card. All credit for discovering them goes to "Nickolai Zeldovich" who left a comment in this [http://redmonk.com/sogrady/2008/09/24/apone/ thread]. I imagine one could find them via a USB sniffer on a working Windows machine (or a Linux machine with Windows running in a virtual machine). Another way to get them is to try to look for "gps" string in Windows drivers. What is interesting, F3507g supports a few other AT-commands with "GPS" substring (you can get all supported AT-commands by sending <tt>AT*</tt> to <tt>/dev/ttyACM1</tt> after activating it with <tt>AT+CFUN=1</tt>). Anyway, there is a [http://www.natisbad.org/E4300/Dell_Wireless_5530_AT_cmd_ref.html project] aiming to document all AT-commands for the Ericsson F3507g card.<br />
<br />
==Related Links==<br />
*[http://www.ericsson.com/solutions/mobile_broadband_modules/docs/mobile_broadband_module_datasheet_print.pdf Ericsson Datasheet]<br />
*[http://www.natisbad.org/E4300/Dell_Wireless_5530_AT_cmd_ref.html F3507g - AT commands reference]<br />
*[http://www.pinstack.com/carrier_settings_apn_gateway.html Carrier internet Settings (Apn, Gateway, etc)]<br />
*[http://mbm.sourceforge.net/ MBM project website (Support for f3507g/f3607gw in NetworkManager, kernel drivers, gps control software etc)]<br />
<br />
==Bugs==<br />
* Ubuntu 8.10 kernel suffers from the "option" regression mentioned above. However both CDC ACM and CDC Ethernet interfaces are treated correctly by Ubuntu 9.04 kernel.<br />
* Playing around with the device under Linux can cause it to disappear under Windows Vista. Issue + Fix described [http://forums.lenovo.com/t5/T400-T500-and-newer-T-series/Ericsson-f3507g-doesn-t-appear-under-Vista32-anymore-but-works/m-p/138874 here]<br />
<br />
==ThinkPads this adapter may be found in==<br />
*{{SL300}}, {{SL400}}, {{SL500}}, {{SL510}}<br />
*{{T400}}, {{T400s}}, {{T500}}<br />
*{{W500}}<br />
*{{X200}}, {{X200 Tablet}}, {{X301}}</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Ericsson_F3507g_Mobile_Broadband_Module&diff=48566Ericsson F3507g Mobile Broadband Module2010-05-16T19:19:20Z<p>Newhren: </p>
<hr />
<div>{| width="100%"<br />
|style="vertical-align:top" |<br />
<div style="margin: 0; margin-right:10px; border: 1px solid #dfdfdf; padding: 0em 1em 1em 1em; background-color:#F8F8FF; align:right;"><br />
=== Ericsson F3507g Mobile Broadband Module ===<br />
This is a Ericsson WWAN Adapter that is installed in a Mini-PCI Express slot<br />
<br />
{{NOTE|Specific versions of this card may come pre-configured for a certain carrier (AT&T)}}<br />
<br />
=== Features ===<br />
* Chipset: Ericsson F3507g<br />
* USB ID: 0bdb:1900<br />
* USB ID: 0bdb:1902<br />
* WCDMA 2100/1900/850MHz<br />
* GSM/GPRS/EDGE 850/900/1800/1900MHz<br />
* GPS<br />
* Download up to 7.2Mbps<br />
* Upload up to 2.0Mbps<br />
</div><br />
|style="vertical-align:top" |<br />
[[image:EriccsonWWAN.gif|thumb|Ericsson F3507g WWAN Adapter]]<br />
|}<br />
<br />
== Lenovo Partnumbers ==<br />
* Option PN 43R9152 (AT&T)<br />
* FRU 43Y6537 (AT&T)<br />
* FRU 43Y6513 (Other)<br />
__TOC__<br />
<br />
Here are some basics about Ericsson F3507g MiniPCIe WWAN/GPS card (USB ID <tt>0bdb:1900</tt> and <tt>0bdb:1902</tt>):<br />
<br />
* the card will not work without an inserted SIM, even the GPS function. If you want to use just GPS, any SIM would work, even if it is not attached to any active account with any GSM provider.<br />
* the card provides three CDC ACM interfaces (<tt>CONFIG_USB_ACM=m</tt>), two CDC WDM interfaces (<tt>CONFIG_USB_WDM=m</tt>) and one CDC Ethernet interface (<tt>CONFIG_USB_NET_CDCETHER=m</tt>), and identifies them as<br />
for n in `ls /sys/class/*/*{ACM,wdm,usb0}*/device/interface`;do echo $(echo $n|awk -F '/' '{print $5}') : $(cat $n);done<br />
<br />
usb0 : Ericsson F3507g Mobile Broadband Minicard Network Adapter<br />
ttyACM0 : Ericsson F3507g Mobile Broadband Minicard Modem<br />
ttyACM1 : Ericsson F3507g Mobile Broadband Minicard Data Modem<br />
ttyACM2 : Ericsson F3507g Mobile Broadband Minicard GPS Port<br />
cdc-wdm0 : Ericsson F3507g Mobile Broadband Minicard Device Management<br />
cdc-wdm1 : Ericsson F3507g Mobile Broadband Minicard PC SC Port<br />
'''Note''':<br />
*apparently, for a while <tt>option</tt> USB-serial driver had claimed USB ID <tt>0bdb:1900</tt>, but this was wrong, and as of kernel 2.6.28.9 that commit was reversed. If instead of <tt>/dev/ttyACM*</tt> you see <tt>/dev/ttyUSB*</tt>, it means that <tt>option</tt> module is loaded. You may need to blacklist it to make sure it doesn't happen.<br />
*Support for the CDC Ethernet interface appears only in kernel 2.6.28.8. But if your kernel is older, you can still connect to the net using one of the "Modem" interfaces. As of kernel 2.6.33 it is named <tt>wwan0</tt> rather than <tt>usb0</tt>.<br />
<br />
As Ericsson's naming scheme suggests, idealy we would use <tt>/dev/cdc-wdm0</tt> for controlling the card, <tt>usb0</tt> (or <tt>wwan0</tt>) as a network device, <tt>/dev/ttyACM0</tt> or <tt>/dev/ttyACM1</tt> as a modem, and <tt>/dev/ttyACM2</tt> for GPS. This works for manual testing, but unfortunately, due to [http://markmail.org/message/2sd7culbgekugow2 limitations] of <tt>chat</tt>, does not play very well in scripts. So, instead of <tt>/dev/cdc-wdm0</tt>, for controlling the card we will use <tt>/dev/ttyACM1</tt>.<br />
<br />
==Turning the card on==<br />
First, check whenever the SIM is protected by PIN by sending <br />
<br />
AT+CPIN?<br />
<br />
to <tt>/dev/ttyACM1</tt>. You can do it with any terminal terminal program like <tt>cu</tt> or <tt>minicom</tt>. If the answer is<br />
<br />
+CPIN: READY<br />
<br />
then the SIM is unlocked. If the answer is<br />
<br />
+CPIN: SIM PIN<br />
<br />
you need first to unlock it by sending<br />
<br />
AT+CPIN="YOUR-PIN"<br />
<br />
to <tt>/dev/ttyACM1</tt>. Now the card can be turned on by sending <br />
<br />
AT+CFUN=1<br />
<br />
to <tt>/dev/ttyACM1</tt>. The answer should be<br />
<br />
+PACSP0<br />
<br />
Don't try to do anything until you see it. To force GSM-only connection, send<br />
<br />
AT+CFUN=5<br />
<br />
to <tt>/dev/ttyACM1</tt>. To force WCDMA-only connection, send<br />
<br />
AT+CFUN=6<br />
<br />
to <tt>/dev/ttyACM1</tt>.<br />
<br />
==Turning the card off==<br />
To put the card into energy-saving mode (this is the default), you can send<br />
<br />
AT+CFUN=4<br />
<br />
to <tt>/dev/ttyACM1</tt>. To remove all power from the card, send<br />
<br />
AT+CFUN=0<br />
<br />
to <tt>/dev/ttyACM1</tt>. Be carefull with the last command. It turns the card completely off, and it will no longer accept any AT-commands before the hard reset. To physically reset the card flip the wireless switch off, and then on. You can do the same by sending <tt>echo 0 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state</tt> (to turn off) and then <tt>echo 1 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state</tt> (to turn on).<br />
<br />
==Using the card as a wireless modem==<br />
Once the card is turned on, there are two ways to connect to the net. The first one is just to use the card as any "normal" GPRS modem and start <tt>pppd</tt> daemon on one of <tt>/dev/ttyACM*</tt>. The other way is to use CDC Ethernet interface. It is supposed to be more efficient, but it requires a pretty recent (>=2.6.28.8) kernel.<br />
<br />
====Connecting to the net via pppd====<br />
For the first approach, the easiest way to do it is to use <tt>wvdial</tt>. For example, to connect to AT&T Wireless network, your <tt>/etc/wvdial.conf</tt> would have to be something like this<br />
[Dialer 3G]<br />
Modem = /dev/ttyACM0<br />
Init1 = AT+CGDCONT=1,"IP","'''proxy'''"<br />
Stupid mode = 1<br />
phone= *99#<br />
Username = *<br />
Password = *<br />
'''Note''': if you are using a SIM from a different mobile provider, you may need to change the access point name (APN) "'''proxy'''" in <tt>Init1</tt> string and Username/Password to something else. You can find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here].<br />
<br />
====Connecting to the net via CDC Ethernet interface====<br />
The [http://marc.info/?l=linux-usb&m=123334979706403&w=2 second approach] works for kernels >=2.6.28.8. Configure the APN by sending<br />
<br />
AT+CGDCONT=1,"IP","'''proxy'''"<br />
<br />
to <tt>/dev/ttyACM1</tt>. Instead of "'''proxy'''" you may need to use to something else. Find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here]. To initiate the connection, send<br />
<br />
AT*ENAP=1,1<br />
<br />
to <tt>/dev/ttyACM1</tt>. Now, if your wireless provider lets you in, you are connected. Launch <tt>dhclient</tt><br />
<br />
dhclient usb0<br />
<br />
and start surfing the net (or use <tt>wwan0</tt> for kernels >= 2.6.33). To disconnect, send<br />
<br />
AT*ENAP=0<br />
<br />
to <tt>/dev/ttyACM1</tt>.<br />
<br />
==Using the card as a GPS receiver==<br />
Once the card is turned on, we can use it to get GPS info via NMEA protocol. First, you have to configure the a few NMEA options. It is done by sending <br />
<br />
AT*E2GPSCTL=X,Y,Z<br />
<br />
to <tt>/dev/ttyACM1</tt>. Here<br />
<br />
*X can be 0 (NMEA stream turned off) or 1 (NMEA stream turned on)<br />
*Y can be an integer form 1 to 60, and sets the frequency of how often the card emits the NMEA sentences<br />
*Z can be 0 (DGPS is turned off) or 1 (DGPS is turned on)<br />
<br />
so, to configure the GPSr to update every 5 seconds, and turn DGPS on, you would send<br />
<br />
AT*E2GPSCTL=1,5,1<br />
<br />
to <tt>/dev/ttyACM1</tt>. Once the GPSr is configured, we can get the NMEA stream on /dev/ttyACM2 by sending<br />
<br />
AT*E2GPSNPD<br />
<br />
to <tt>/dev/ttyACM2</tt>. Once you do that, <tt>/dev/ttyACM2</tt> will no longer accept any new AT-commands. But you still can change the the behavior of the NMEA stream by sending the appropriate<br />
<br />
AT*E2GPSCTL=X,Y,Z<br />
<br />
to <tt>/dev/ttyACM1</tt>. Now you can read the NMEA stream by saying<br />
<br />
cat /dev/ttyACM2<br />
<br />
or better yet, start <tt>gpsd</tt> interface on <tt>/dev/ttyACM2</tt>.<br />
<br />
Note: There is a now a sourceforge project dedicated to the Ericsson Mobile Broadband modules. Gps control sw that does the above automatically is available and also a graphical user interface. Details are available on the [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=Main_Page#GPS_Control_.28mbm-gpsd.29 MBM Wiki].<br />
<br />
==Scripting everything==<br />
Install the packages<br />
<br />
apt-get install sysfsutils gpsd wvdial<br />
<br />
In order to save the power, let us use '''sysfsutils''' to completely power off the WWAN card on boot. Append the following line to <tt>/etc/sysfs.conf</tt><br />
<br />
devices/platform/thinkpad_acpi/rfkill/rfkill0/state = 0<br />
<br />
It will power down the card on boot, but when the laptop wakes from sleep, in some cases the card is powered up again. To re-apply these settings on wake-up, create a script named <tt>/etc/pm/sleep.d/10sysfsutils</tt>:<br />
<br />
#!/bin/sh<br />
case $1 in<br />
(hibernate|suspend)<br />
;;<br />
(thaw|resume)<br />
/etc/init.d/sysfsutils start<br />
;;<br />
*) echo "somebody is calling me totally wrong."<br />
;;<br />
esac<br />
<br />
Don't forget to <tt>chmod a+x /etc/pm/sleep.d/10sysfsutils</tt>. Create a file called <tt>/usr/local/etc/F3507g</tt> containing the following:<br />
<br />
'''USB_ID="0bdb:1900"'''<br />
'''PIN=""'''<br />
'''APN="proxy"'''<br />
<br />
GPSDPID="/var/run/gpsd.pid"<br />
<br />
RFKILL_DEVICE=$(for n in /sys/devices/platform/thinkpad_acpi/rfkill/rfkill*; do if [ "$(cat $n/name)" = "tpacpi_wwan_sw" ]; then echo $n/state; fi; done)<br />
<br />
CONTROL_DEVICE () {<br />
echo /dev/$(for n in /sys/class/tty/ttyACM*/device/interface;do if [ "$(cat $n)" = "Ericsson F3507g Mobile Broadband Minicard Data Modem" ]; then echo $n|awk -F '/' '{print $5}'; fi; done)<br />
}<br />
<br />
GPS_DEVICE () {<br />
echo /dev/$(for n in /sys/class/tty/ttyACM*/device/interface;do if [ "$(cat $n)" = "Ericsson F3507g Mobile Broadband Minicard GPS Port" ]; then echo $n|awk -F '/' '{print $5}'; fi; done)<br />
}<br />
<br />
powerup_F3507g () {<br />
echo -n "Powering up F3507g card.."<br />
echo 1 > $RFKILL_DEVICE<br />
while [ -z "$(lsusb -d $USB_ID)" ]; do sleep 0.5; echo -n "."; done<br />
echo "done"<br />
echo -n "Turning on F3507g card..."<br />
sleep 3<br />
if [ -n "$PIN" ]; then<br />
/usr/sbin/chat -v "" "AT+CPIN?" "SIM PIN" "AT" "OK" "AT+CPIN=\"$PIN\"" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
fi<br />
/usr/sbin/chat -v "" "AT+CPIN?" "READY" "AT+CFUN=1" "+PACSP" "AT" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
echo "done"<br />
}<br />
<br />
powerdown_F3507g () {<br />
echo -n "Turning off F3507g card..."<br />
/usr/sbin/chat -v "" "AT+CFUN=4" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
echo "done"<br />
echo -n "Powering down F3507g card.."<br />
echo 0 > $RFKILL_DEVICE<br />
while [ -n "$(lsusb -d $USB_ID)" ]; do sleep 0.5; echo -n "."; done<br />
echo "done"<br />
}<br />
<br />
configure_GPS () {<br />
/usr/sbin/chat -v "" "AT*E2GPSCTL=$1,$2,$3" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
}<br />
<br />
turnon_GPS () {<br />
echo -n "Starting NMEA stream on $(GPS_DEVICE)..."<br />
configure_GPS 1 1 1<br />
sleep 1<br />
/usr/sbin/chat -v "" "AT*E2GPSNPD" "GPGGA" > $(GPS_DEVICE) < $(GPS_DEVICE)<br />
start-stop-daemon --start --exec /usr/sbin/gpsd -- -P $GPSDPID $(GPS_DEVICE)<br />
echo "done"<br />
}<br />
<br />
turnoff_GPS () {<br />
echo -n "Stopping NMEA stream on $(GPS_DEVICE)..."<br />
start-stop-daemon --stop --pidfile $GPSDPID<br />
configure_GPS 0 1 0<br />
echo "done"<br />
turnoff_F3507g<br />
}<br />
<br />
turnon_usbnet () {<br />
echo -n "Starting usbnet connection..."<br />
/usr/sbin/chat -v "" "AT+CGDCONT=1,\"IP\",\"$APN\"" "OK" "AT*ENAP=1,1" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
echo "done"<br />
}<br />
<br />
turnoff_usbnet () {<br />
echo -n "Stopping usbnet connection..."<br />
/usr/sbin/chat -v "" "AT*ENAP=0" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
echo "done"<br />
turnoff_F3507g<br />
}<br />
<br />
turnoff_F3507g () {<br />
[ -z $(grep gps /etc/network/run/ifstate) ] && \<br />
[ -z $(grep usb0 /etc/network/run/ifstate) ] && \<br />
[ -z $(grep 3G /etc/network/run/ifstate) ] && \<br />
ifdown F3507g<br />
}<br />
<br />
Give the correct '''USB_ID''' and '''PIN''', and find the '''APN''' for your wireless provider [http://www.pinstack.com/carrier_settings_apn_gateway.html here]. Append the following lines to your <tt>/etc/network/interfaces</tt> file<br />
<br />
iface F3507g inet manual<br />
up . /usr/local/etc/F3507g; powerup_F3507g<br />
down . /usr/local/etc/F3507g; powerdown_F3507g<br />
<br />
iface 3G inet wvdial<br />
pre-up ifup F3507g<br />
post-down . /usr/local/etc/F3507g; turnoff_F3507g<br />
provider 3G<br />
<br />
iface gps inet manual<br />
up . /usr/local/etc/F3507g; ifup F3507g; turnon_GPS<br />
down . /usr/local/etc/F3507g; turnoff_GPS<br />
<br />
iface usb0 inet dhcp<br />
pre-up . /usr/local/etc/F3507g; ifup F3507g; turnon_usbnet<br />
post-down . /usr/local/etc/F3507g; turnoff_usbnet<br />
<br />
Configure <tt>/etc/wvdial.conf</tt> to look like this:<br />
<br />
[Dialer 3G]<br />
Modem = /dev/ttyACM0<br />
Init1 = AT+CGDCONT=1,"IP","'''proxy'''"<br />
Stupid mode = 1<br />
phone= *99#<br />
Username = *<br />
Password = *<br />
<br />
'''Note''': you may need to change the access point name (APN) "'''proxy'''" in <tt>Init1</tt> string and Username/Password to something else. Find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here].<br />
<br />
Now broadband connection could be started in the same way as you start any other network interface, just by saying <tt>ifup usb0</tt> (or <tt>ifup 3G</tt>, if connecting via <tt>pppd</tt>). To shut it down, say <tt>ifdown usb0</tt> (or <tt>ifdown 3G</tt>). Similarly, GPS interface is started by <tt>ifup gps</tt> and turned off by <tt>ifdown gps</tt>. Once you get a fix, you can use your favourite GPS mapping application like [http://www.tangogps.org tangogps]. The "cold start" seems to take quite a bit however, and sometimes it cannot get a fix if indoors.<br />
<br />
==Using F3507g with NetworkManager==<br />
Work is ongoing to add support for Ericsson Mobile Broadband Modules to GNOME NetworkManager / modem-manager. More information is available on the [http://mbm.sourceforge.net/ MBM project website] and the [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=MBM MBM wiki].<br />
<br />
The F3507g card (in a ThinkPad {{T400s}}) works out of the box on Fedora 11. No configuration is needed beyond setting the data plan provider in the nm-applet GUI.<br />
<br />
Using mbm-gpsd gps works flawlessly with the F3507g on Karmic Koala with modemmanager packages from [https://launchpad.net/~modemmanager/+archive/ppa Ubuntu PPA], the mbm-gpsd installed by source using the description from [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=MBM#GPS_Control_.28mbm-gpsd.29 here] and knowing the PIN of your SIM card.<br />
<br />
== SMS with wammu/gammu ==<br />
You can use [http://wammu.eu/ Wammu] to receive and send SMS.<br />
<br />
After installing wammu (with the usual <tt>apt-get install wammu</tt> or whatever), choose to configure it "Manually":<br />
port=/dev/ttyACM0<br />
connection=at<br />
<br />
(credits: [http://www.thinkpad-forum.de/thinkpad-software/linux-und-osx/p633662-sms-mit-der-ericsson-3507g/ linrunner])<br />
<br />
Sony Ericsson F3507g configuration [http://wammu.eu/phones/sony-ericsson/3595/ explained on wammu website]<br />
<br />
==Other thoughts==<br />
While <tt>AT+CFUN=*</tt> and <tt>AT+CPIN=*</tt> are pretty standard commands for wireless modems and are well-documented, it appears that the commands <tt>AT*E2GPSCTL</tt> and <tt>AT*E2GPSNPD</tt> are unique to the Ericsson F3507g card. All credit for discovering them goes to "Nickolai Zeldovich" who left a comment in this [http://redmonk.com/sogrady/2008/09/24/apone/ thread]. I imagine one could find them via a USB sniffer on a working Windows machine (or a Linux machine with Windows running in a virtual machine). Another way to get them is to try to look for "gps" string in Windows drivers. What is interesting, F3507g supports a few other AT-commands with "GPS" substring (you can get all supported AT-commands by sending <tt>AT*</tt> to <tt>/dev/ttyACM1</tt> after activating it with <tt>AT+CFUN=1</tt>). Anyway, there is a [http://www.natisbad.org/E4300/Dell_Wireless_5530_AT_cmd_ref.html project] aiming to document all AT-commands for the Ericsson F3507g card.<br />
<br />
==Related Links==<br />
*[http://www.ericsson.com/solutions/mobile_broadband_modules/docs/mobile_broadband_module_datasheet_print.pdf Ericsson Datasheet]<br />
*[http://www.natisbad.org/E4300/Dell_Wireless_5530_AT_cmd_ref.html F3507g - AT commands reference]<br />
*[http://www.pinstack.com/carrier_settings_apn_gateway.html Carrier internet Settings (Apn, Gateway, etc)]<br />
*[http://mbm.sourceforge.net/ MBM project website (Support for f3507g/f3607gw in NetworkManager, kernel drivers, gps control software etc)]<br />
<br />
==Bugs==<br />
* Ubuntu 8.10 kernel suffers from the "option" regression mentioned above. However both CDC ACM and CDC Ethernet interfaces are treated correctly by Ubuntu 9.04 kernel.<br />
* Playing around with the device under Linux can cause it to disappear under Windows Vista. Issue + Fix described [http://forums.lenovo.com/t5/T400-T500-and-newer-T-series/Ericsson-f3507g-doesn-t-appear-under-Vista32-anymore-but-works/m-p/138874 here]<br />
<br />
==ThinkPads this adapter may be found in==<br />
*{{SL300}}, {{SL400}}, {{SL500}}, {{SL510}}<br />
*{{T400}}, {{T400s}}, {{T500}}<br />
*{{W500}}<br />
*{{X200}}, {{X200 Tablet}}, {{X301}}</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Ericsson_F3507g_Mobile_Broadband_Module&diff=48552Ericsson F3507g Mobile Broadband Module2010-05-13T20:56:51Z<p>Newhren: info at that link is a derivative of this page. Do your HW before posting</p>
<hr />
<div>{| width="100%"<br />
|style="vertical-align:top" |<br />
<div style="margin: 0; margin-right:10px; border: 1px solid #dfdfdf; padding: 0em 1em 1em 1em; background-color:#F8F8FF; align:right;"><br />
=== Ericsson F3507g Mobile Broadband Module ===<br />
This is a Ericsson WWAN Adapter that is installed in a Mini-PCI Express slot<br />
<br />
{{NOTE|Specific versions of this card may come pre-configured for a certain carrier (AT&T)}}<br />
<br />
=== Features ===<br />
* Chipset: Ericsson F3507g<br />
* USB ID: 0bdb:1900<br />
* USB ID: 0bdb:1902<br />
* WCDMA 2100/1900/850MHz<br />
* GSM/GPRS/EDGE 850/900/1800/1900MHz<br />
* GPS<br />
* Download up to 7.2Mbps<br />
* Upload up to 2.0Mbps<br />
</div><br />
|style="vertical-align:top" |<br />
[[image:EriccsonWWAN.gif|thumb|Ericsson F3507g WWAN Adapter]]<br />
|}<br />
<br />
== Lenovo Partnumbers ==<br />
* Option PN 43R9152 (AT&T)<br />
* FRU 43Y6537 (AT&T)<br />
* FRU 43Y6513 (Other)<br />
__TOC__<br />
<br />
Here are some basics about Ericsson F3507g MiniPCIe WWAN/GPS card (USB ID <tt>0bdb:1900</tt> and <tt>0bdb:1902</tt>):<br />
<br />
* the card will not work without an inserted SIM, even the GPS function. If you want to use just GPS, any SIM would work, even if it is not attached to any active account with any GSM provider.<br />
* the card provides three CDC ACM interfaces (<tt>CONFIG_USB_ACM=m</tt>), two CDC WDM interfaces (<tt>CONFIG_USB_WDM=m</tt>) and one CDC Ethernet interface (<tt>CONFIG_USB_NET_CDCETHER=m</tt>), and identifies them as<br />
for n in `ls /sys/class/*/*{ACM,wdm,usb0}*/device/interface`;do echo $(echo $n|awk -F '/' '{print $5}') : $(cat $n);done<br />
<br />
usb0 : Ericsson F3507g Mobile Broadband Minicard Network Adapter<br />
ttyACM0 : Ericsson F3507g Mobile Broadband Minicard Modem<br />
ttyACM1 : Ericsson F3507g Mobile Broadband Minicard Data Modem<br />
ttyACM2 : Ericsson F3507g Mobile Broadband Minicard GPS Port<br />
cdc-wdm0 : Ericsson F3507g Mobile Broadband Minicard Device Management<br />
cdc-wdm1 : Ericsson F3507g Mobile Broadband Minicard PC SC Port<br />
'''Note''':<br />
*apparently, for a while <tt>option</tt> USB-serial driver had claimed USB ID <tt>0bdb:1900</tt>, but this was wrong, and as of kernel 2.6.28.9 that commit was reversed. If instead of <tt>/dev/ttyACM*</tt> you see <tt>/dev/ttyUSB*</tt>, it means that <tt>option</tt> module is loaded. You may need to blacklist it to make sure it doesn't happen.<br />
*Support for the CDC Ethernet interface appears only in kernel 2.6.28.8. But if your kernel is older, you can still connect to the net using one of the "Modem" interfaces.<br />
<br />
As Ericsson's naming scheme suggests, idealy we would use <tt>/dev/cdc-wdm0</tt> for controlling the card, <tt>usb0</tt> as a network device, <tt>/dev/ttyACM0</tt> or <tt>/dev/ttyACM1</tt> as a modem, and <tt>/dev/ttyACM2</tt> for GPS. This works for manual testing, but unfortunately, due to [http://markmail.org/message/2sd7culbgekugow2 limitations] of <tt>chat</tt>, does not play very well in scripts. So, instead of <tt>/dev/cdc-wdm0</tt>, for controlling the card we will use <tt>/dev/ttyACM1</tt>.<br />
<br />
==Turning the card on==<br />
First, check whenever the SIM is protected by PIN by sending <br />
<br />
AT+CPIN?<br />
<br />
to <tt>/dev/ttyACM1</tt>. You can do it with any terminal terminal program like <tt>cu</tt> or <tt>minicom</tt>. If the answer is<br />
<br />
+CPIN: READY<br />
<br />
then the SIM is unlocked. If the answer is<br />
<br />
+CPIN: SIM PIN<br />
<br />
you need first to unlock it by sending<br />
<br />
AT+CPIN="YOUR-PIN"<br />
<br />
to <tt>/dev/ttyACM1</tt>. Now the card can be turned on by sending <br />
<br />
AT+CFUN=1<br />
<br />
to <tt>/dev/ttyACM1</tt>. The answer should be<br />
<br />
+PACSP0<br />
<br />
Don't try to do anything until you see it. To force GSM-only connection, send<br />
<br />
AT+CFUN=5<br />
<br />
to <tt>/dev/ttyACM1</tt>. To force WCDMA-only connection, send<br />
<br />
AT+CFUN=6<br />
<br />
to <tt>/dev/ttyACM1</tt>.<br />
<br />
==Turning the card off==<br />
To put the card into energy-saving mode (this is the default), you can send<br />
<br />
AT+CFUN=4<br />
<br />
to <tt>/dev/ttyACM1</tt>. To remove all power from the card, send<br />
<br />
AT+CFUN=0<br />
<br />
to <tt>/dev/ttyACM1</tt>. Be carefull with the last command. It turns the card completely off, and it will no longer accept any AT-commands before the hard reset. To physically reset the card flip the wireless switch off, and then on. You can do the same by sending <tt>echo 0 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state</tt> (to turn off) and then <tt>echo 1 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state</tt> (to turn on).<br />
<br />
==Using the card as a wireless modem==<br />
Once the card is turned on, there are two ways to connect to the net. The first one is just to use the card as any "normal" GPRS modem and start <tt>pppd</tt> daemon on one of <tt>/dev/ttyACM*</tt>. The other way is to use CDC Ethernet interface. It is supposed to be more efficient, but it requires a pretty recent (>=2.6.28.8) kernel.<br />
<br />
====Connecting to the net via pppd====<br />
For the first approach, the easiest way to do it is to use <tt>wvdial</tt>. For example, to connect to AT&T Wireless network, your <tt>/etc/wvdial.conf</tt> would have to be something like this<br />
[Dialer 3G]<br />
Modem = /dev/ttyACM0<br />
Init1 = AT+CGDCONT=1,"IP","'''proxy'''"<br />
Stupid mode = 1<br />
phone= *99#<br />
Username = *<br />
Password = *<br />
'''Note''': if you are using a SIM from a different mobile provider, you may need to change the access point name (APN) "'''proxy'''" in <tt>Init1</tt> string and Username/Password to something else. You can find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here].<br />
<br />
====Connecting to the net via CDC Ethernet interface====<br />
The [http://marc.info/?l=linux-usb&m=123334979706403&w=2 second approach] works for kernels >=2.6.28.8. Configure the APN by sending<br />
<br />
AT+CGDCONT=1,"IP","'''proxy'''"<br />
<br />
to <tt>/dev/ttyACM1</tt>. Instead of "'''proxy'''" you may need to use to something else. Find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here]. To initiate the connection, send<br />
<br />
AT*ENAP=1,1<br />
<br />
to <tt>/dev/ttyACM1</tt>. Now, if your wireless provider lets you in, you are connected. Launch <tt>dhclient</tt><br />
<br />
dhclient usb0<br />
<br />
and start surfing the net. To disconnect, send<br />
<br />
AT*ENAP=0<br />
<br />
to <tt>/dev/ttyACM1</tt>.<br />
<br />
==Using the card as a GPS receiver==<br />
Once the card is turned on, we can use it to get GPS info via NMEA protocol. First, you have to configure the a few NMEA options. It is done by sending <br />
<br />
AT*E2GPSCTL=X,Y,Z<br />
<br />
to <tt>/dev/ttyACM1</tt>. Here<br />
<br />
*X can be 0 (NMEA stream turned off) or 1 (NMEA stream turned on)<br />
*Y can be an integer form 1 to 60, and sets the frequency of how often the card emits the NMEA sentences<br />
*Z can be 0 (DGPS is turned off) or 1 (DGPS is turned on)<br />
<br />
so, to configure the GPSr to update every 5 seconds, and turn DGPS on, you would send<br />
<br />
AT*E2GPSCTL=1,5,1<br />
<br />
to <tt>/dev/ttyACM1</tt>. Once the GPSr is configured, we can get the NMEA stream on /dev/ttyACM2 by sending<br />
<br />
AT*E2GPSNPD<br />
<br />
to <tt>/dev/ttyACM2</tt>. Once you do that, <tt>/dev/ttyACM2</tt> will no longer accept any new AT-commands. But you still can change the the behavior of the NMEA stream by sending the appropriate<br />
<br />
AT*E2GPSCTL=X,Y,Z<br />
<br />
to <tt>/dev/ttyACM1</tt>. Now you can read the NMEA stream by saying<br />
<br />
cat /dev/ttyACM2<br />
<br />
or better yet, start <tt>gpsd</tt> interface on <tt>/dev/ttyACM2</tt>.<br />
<br />
Note: There is a now a sourceforge project dedicated to the Ericsson Mobile Broadband modules. Gps control sw that does the above automatically is available and also a graphical user interface. Details are available on the [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=Main_Page#GPS_Control_.28mbm-gpsd.29 MBM Wiki].<br />
<br />
==Scripting everything==<br />
Install the packages<br />
<br />
apt-get install sysfsutils gpsd wvdial<br />
<br />
In order to save the power, let us use '''sysfsutils''' to completely power off the WWAN card on boot. Append the following line to <tt>/etc/sysfs.conf</tt><br />
<br />
devices/platform/thinkpad_acpi/rfkill/rfkill0/state = 0<br />
<br />
It will power down the card on boot, but when the laptop wakes from sleep, in some cases the card is powered up again. To re-apply these settings on wake-up, create a script named <tt>/etc/pm/sleep.d/10sysfsutils</tt>:<br />
<br />
#!/bin/sh<br />
case $1 in<br />
(hibernate|suspend)<br />
;;<br />
(thaw|resume)<br />
/etc/init.d/sysfsutils start<br />
;;<br />
*) echo "somebody is calling me totally wrong."<br />
;;<br />
esac<br />
<br />
Don't forget to <tt>chmod a+x /etc/pm/sleep.d/10sysfsutils</tt>. Create a file called <tt>/usr/local/etc/F3507g</tt> containing the following:<br />
<br />
'''USB_ID="0bdb:1900"'''<br />
'''PIN=""'''<br />
'''APN="proxy"'''<br />
<br />
GPSDPID="/var/run/gpsd.pid"<br />
<br />
RFKILL_DEVICE=$(for n in /sys/devices/platform/thinkpad_acpi/rfkill/rfkill*; do if [ "$(cat $n/name)" = "tpacpi_wwan_sw" ]; then echo $n/state; fi; done)<br />
<br />
CONTROL_DEVICE () {<br />
echo /dev/$(for n in /sys/class/tty/ttyACM*/device/interface;do if [ "$(cat $n)" = "Ericsson F3507g Mobile Broadband Minicard Data Modem" ]; then echo $n|awk -F '/' '{print $5}'; fi; done)<br />
}<br />
<br />
GPS_DEVICE () {<br />
echo /dev/$(for n in /sys/class/tty/ttyACM*/device/interface;do if [ "$(cat $n)" = "Ericsson F3507g Mobile Broadband Minicard GPS Port" ]; then echo $n|awk -F '/' '{print $5}'; fi; done)<br />
}<br />
<br />
powerup_F3507g () {<br />
echo -n "Powering up F3507g card.."<br />
echo 1 > $RFKILL_DEVICE<br />
while [ -z "$(lsusb -d $USB_ID)" ]; do sleep 0.5; echo -n "."; done<br />
echo "done"<br />
echo -n "Turning on F3507g card..."<br />
sleep 3<br />
if [ -n "$PIN" ]; then<br />
/usr/sbin/chat -v "" "AT+CPIN?" "SIM PIN" "AT" "OK" "AT+CPIN=\"$PIN\"" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
fi<br />
/usr/sbin/chat -v "" "AT+CPIN?" "READY" "AT+CFUN=1" "+PACSP" "AT" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
echo "done"<br />
}<br />
<br />
powerdown_F3507g () {<br />
echo -n "Turning off F3507g card..."<br />
/usr/sbin/chat -v "" "AT+CFUN=4" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
echo "done"<br />
echo -n "Powering down F3507g card.."<br />
echo 0 > $RFKILL_DEVICE<br />
while [ -n "$(lsusb -d $USB_ID)" ]; do sleep 0.5; echo -n "."; done<br />
echo "done"<br />
}<br />
<br />
configure_GPS () {<br />
/usr/sbin/chat -v "" "AT*E2GPSCTL=$1,$2,$3" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
}<br />
<br />
turnon_GPS () {<br />
echo -n "Starting NMEA stream on $(GPS_DEVICE)..."<br />
configure_GPS 1 1 1<br />
sleep 1<br />
/usr/sbin/chat -v "" "AT*E2GPSNPD" "GPGGA" > $(GPS_DEVICE) < $(GPS_DEVICE)<br />
start-stop-daemon --start --exec /usr/sbin/gpsd -- -P $GPSDPID $(GPS_DEVICE)<br />
echo "done"<br />
}<br />
<br />
turnoff_GPS () {<br />
echo -n "Stopping NMEA stream on $(GPS_DEVICE)..."<br />
start-stop-daemon --stop --pidfile $GPSDPID<br />
configure_GPS 0 1 0<br />
echo "done"<br />
turnoff_F3507g<br />
}<br />
<br />
turnon_usbnet () {<br />
echo -n "Starting usbnet connection..."<br />
/usr/sbin/chat -v "" "AT+CGDCONT=1,\"IP\",\"$APN\"" "OK" "AT*ENAP=1,1" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
echo "done"<br />
}<br />
<br />
turnoff_usbnet () {<br />
echo -n "Stopping usbnet connection..."<br />
/usr/sbin/chat -v "" "AT*ENAP=0" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
echo "done"<br />
turnoff_F3507g<br />
}<br />
<br />
turnoff_F3507g () {<br />
[ -z $(grep gps /etc/network/run/ifstate) ] && \<br />
[ -z $(grep usb0 /etc/network/run/ifstate) ] && \<br />
[ -z $(grep 3G /etc/network/run/ifstate) ] && \<br />
ifdown F3507g<br />
}<br />
<br />
Give the correct '''USB_ID''' and '''PIN''', and find the '''APN''' for your wireless provider [http://www.pinstack.com/carrier_settings_apn_gateway.html here]. Append the following lines to your <tt>/etc/network/interfaces</tt> file<br />
<br />
iface F3507g inet manual<br />
up . /usr/local/etc/F3507g; powerup_F3507g<br />
down . /usr/local/etc/F3507g; powerdown_F3507g<br />
<br />
iface 3G inet wvdial<br />
pre-up ifup F3507g<br />
post-down . /usr/local/etc/F3507g; turnoff_F3507g<br />
provider 3G<br />
<br />
iface gps inet manual<br />
up . /usr/local/etc/F3507g; ifup F3507g; turnon_GPS<br />
down . /usr/local/etc/F3507g; turnoff_GPS<br />
<br />
iface usb0 inet dhcp<br />
pre-up . /usr/local/etc/F3507g; ifup F3507g; turnon_usbnet<br />
post-down . /usr/local/etc/F3507g; turnoff_usbnet<br />
<br />
Configure <tt>/etc/wvdial.conf</tt> to look like this:<br />
<br />
[Dialer 3G]<br />
Modem = /dev/ttyACM0<br />
Init1 = AT+CGDCONT=1,"IP","'''proxy'''"<br />
Stupid mode = 1<br />
phone= *99#<br />
Username = *<br />
Password = *<br />
<br />
'''Note''': you may need to change the access point name (APN) "'''proxy'''" in <tt>Init1</tt> string and Username/Password to something else. Find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here].<br />
<br />
Now broadband connection could be started in the same way as you start any other network interface, just by saying <tt>ifup usb0</tt> (or <tt>ifup 3G</tt>, if connecting via <tt>pppd</tt>). To shut it down, say <tt>ifdown usb0</tt> (or <tt>ifdown 3G</tt>). Similarly, GPS interface is started by <tt>ifup gps</tt> and turned off by <tt>ifdown gps</tt>. Once you get a fix, you can use your favourite GPS mapping application like [http://www.tangogps.org tangogps]. The "cold start" seems to take quite a bit however, and sometimes it cannot get a fix if indoors.<br />
<br />
==Using F3507g with NetworkManager==<br />
Work is ongoing to add support for Ericsson Mobile Broadband Modules to GNOME NetworkManager / modem-manager. More information is available on the [http://mbm.sourceforge.net/ MBM project website] and the [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=MBM MBM wiki].<br />
<br />
The F3507g card (in a ThinkPad {{T400s}}) works out of the box on Fedora 11. No configuration is needed beyond setting the data plan provider in the nm-applet GUI.<br />
<br />
Using mbm-gpsd gps works flawlessly with the F3507g on Karmic Koala with modemmanager packages from [https://launchpad.net/~modemmanager/+archive/ppa Ubuntu PPA], the mbm-gpsd installed by source using the description from [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=MBM#GPS_Control_.28mbm-gpsd.29 here] and knowing the PIN of your SIM card.<br />
<br />
== SMS with wammu/gammu ==<br />
You can use [http://wammu.eu/ Wammu] to receive and send SMS.<br />
<br />
After installing wammu (with the usual <tt>apt-get install wammu</tt> or whatever), choose to configure it "Manually":<br />
port=/dev/ttyACM0<br />
connection=at<br />
<br />
(credits: [http://www.thinkpad-forum.de/thinkpad-software/linux-und-osx/p633662-sms-mit-der-ericsson-3507g/ linrunner])<br />
<br />
Sony Ericsson F3507g configuration [http://wammu.eu/phones/sony-ericsson/3595/ explained on wammu website]<br />
<br />
==Other thoughts==<br />
While <tt>AT+CFUN=*</tt> and <tt>AT+CPIN=*</tt> are pretty standard commands for wireless modems and are well-documented, it appears that the commands <tt>AT*E2GPSCTL</tt> and <tt>AT*E2GPSNPD</tt> are unique to the Ericsson F3507g card. All credit for discovering them goes to "Nickolai Zeldovich" who left a comment in this [http://redmonk.com/sogrady/2008/09/24/apone/ thread]. I imagine one could find them via a USB sniffer on a working Windows machine (or a Linux machine with Windows running in a virtual machine). Another way to get them is to try to look for "gps" string in Windows drivers. What is interesting, F3507g supports a few other AT-commands with "GPS" substring (you can get all supported AT-commands by sending <tt>AT*</tt> to <tt>/dev/ttyACM1</tt> after activating it with <tt>AT+CFUN=1</tt>). Anyway, there is a [http://www.natisbad.org/E4300/Dell_Wireless_5530_AT_cmd_ref.html project] aiming to document all AT-commands for the Ericsson F3507g card.<br />
<br />
==Related Links==<br />
*[http://www.ericsson.com/solutions/mobile_broadband_modules/docs/mobile_broadband_module_datasheet_print.pdf Ericsson Datasheet]<br />
*[http://www.natisbad.org/E4300/Dell_Wireless_5530_AT_cmd_ref.html F3507g - AT commands reference]<br />
*[http://www.pinstack.com/carrier_settings_apn_gateway.html Carrier internet Settings (Apn, Gateway, etc)]<br />
*[http://mbm.sourceforge.net/ MBM project website (Support for f3507g/f3607gw in NetworkManager, kernel drivers, gps control software etc)]<br />
<br />
==Bugs==<br />
* Ubuntu 8.10 kernel suffers from the "option" regression mentioned above. However both CDC ACM and CDC Ethernet interfaces are treated correctly by Ubuntu 9.04 kernel.<br />
* Playing around with the device under Linux can cause it to disappear under Windows Vista. Issue + Fix described [http://forums.lenovo.com/t5/T400-T500-and-newer-T-series/Ericsson-f3507g-doesn-t-appear-under-Vista32-anymore-but-works/m-p/138874 here]<br />
<br />
==ThinkPads this adapter may be found in==<br />
*{{SL300}}, {{SL400}}, {{SL500}}, {{SL510}}<br />
*{{T400}}, {{T400s}}, {{T500}}<br />
*{{W500}}<br />
*{{X200}}, {{X200 Tablet}}, {{X301}}</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Ericsson_F3507g_Mobile_Broadband_Module&diff=48532Ericsson F3507g Mobile Broadband Module2010-05-12T06:00:59Z<p>Newhren: /* Related Links */</p>
<hr />
<div>{| width="100%"<br />
|style="vertical-align:top" |<br />
<div style="margin: 0; margin-right:10px; border: 1px solid #dfdfdf; padding: 0em 1em 1em 1em; background-color:#F8F8FF; align:right;"><br />
=== Ericsson F3507g Mobile Broadband Module ===<br />
This is a Ericsson WWAN Adapter that is installed in a Mini-PCI Express slot<br />
<br />
{{NOTE|Specific versions of this card may come pre-configured for a certain carrier (AT&T)}}<br />
<br />
=== Features ===<br />
* Chipset: Ericsson F3507g<br />
* USB ID: 0bdb:1900<br />
* USB ID: 0bdb:1902<br />
* WCDMA 2100/1900/850MHz<br />
* GSM/GPRS/EDGE 850/900/1800/1900MHz<br />
* GPS<br />
* Download up to 7.2Mbps<br />
* Upload up to 2.0Mbps<br />
</div><br />
|style="vertical-align:top" |<br />
[[image:EriccsonWWAN.gif|thumb|Ericsson F3507g WWAN Adapter]]<br />
|}<br />
__TOC__<br />
<br />
== Lenovo Partnumbers ==<br />
* Option PN 43R9152 (AT&T)<br />
* FRU 43Y6537 (AT&T)<br />
* FRU 43Y6513 (Other)<br />
<br />
==Configuring the Ericsson F3507g in Ubuntu Intrepid linux (and later)==<br />
Please read this article, as it will show you step by step on how to set up the scripts necessary to make the card work. As of 9.10, the gnome network manager applet will allow you to successfully configure the card, however going into sleep mode will make it unavailable afterwards. These scripts will wake up the card.<br />
<br />
* [http://redmonk.com/sogrady/2008/12/07/how-to-use-an-att-ericsson-f3507g-card-on-ubuntu-intrepid/ How to use an att ericsson f3507g card on ubuntu intrepid]<br />
<br />
==Other options==<br />
<br />
Here are some basics about Ericsson F3507g MiniPCIe WWAN/GPS card (USB ID <tt>0bdb:1900</tt> and <tt>0bdb:1902</tt>):<br />
<br />
* the card will not work without an inserted SIM, even the GPS function. If you want to use just GPS, any SIM would work, even if it is not attached to any active account with any GSM provider.<br />
* the card provides three CDC ACM interfaces (<tt>CONFIG_USB_ACM=m</tt>), two CDC WDM interfaces (<tt>CONFIG_USB_WDM=m</tt>) and one CDC Ethernet interface (<tt>CONFIG_USB_NET_CDCETHER=m</tt>), and identifies them as<br />
for n in `ls /sys/class/*/*{ACM,wdm,usb0}*/device/interface`;do echo $(echo $n|awk -F '/' '{print $5}') : $(cat $n);done<br />
<br />
usb0 : Ericsson F3507g Mobile Broadband Minicard Network Adapter<br />
ttyACM0 : Ericsson F3507g Mobile Broadband Minicard Modem<br />
ttyACM1 : Ericsson F3507g Mobile Broadband Minicard Data Modem<br />
ttyACM2 : Ericsson F3507g Mobile Broadband Minicard GPS Port<br />
cdc-wdm0 : Ericsson F3507g Mobile Broadband Minicard Device Management<br />
cdc-wdm1 : Ericsson F3507g Mobile Broadband Minicard PC SC Port<br />
'''Note''':<br />
*apparently, for a while <tt>option</tt> USB-serial driver had claimed USB ID <tt>0bdb:1900</tt>, but this was wrong, and as of kernel 2.6.28.9 that commit was reversed. If instead of <tt>/dev/ttyACM*</tt> you see <tt>/dev/ttyUSB*</tt>, it means that <tt>option</tt> module is loaded. You may need to blacklist it to make sure it doesn't happen.<br />
*Support for the CDC Ethernet interface appears only in kernel 2.6.28.8. But if your kernel is older, you can still connect to the net using one of the "Modem" interfaces.<br />
<br />
As Ericsson's naming scheme suggests, idealy we would use <tt>/dev/cdc-wdm0</tt> for controlling the card, <tt>usb0</tt> as a network device, <tt>/dev/ttyACM0</tt> or <tt>/dev/ttyACM1</tt> as a modem, and <tt>/dev/ttyACM2</tt> for GPS. This works for manual testing, but unfortunately, due to [http://markmail.org/message/2sd7culbgekugow2 limitations] of <tt>chat</tt>, does not play very well in scripts. So, instead of <tt>/dev/cdc-wdm0</tt>, for controlling the card we will use <tt>/dev/ttyACM1</tt>.<br />
<br />
==Turning the card on==<br />
First, check whenever the SIM is protected by PIN by sending <br />
<br />
AT+CPIN?<br />
<br />
to <tt>/dev/ttyACM1</tt>. You can do it with any terminal terminal program like <tt>cu</tt> or <tt>minicom</tt>. If the answer is<br />
<br />
+CPIN: READY<br />
<br />
then the SIM is unlocked. If the answer is<br />
<br />
+CPIN: SIM PIN<br />
<br />
you need first to unlock it by sending<br />
<br />
AT+CPIN="YOUR-PIN"<br />
<br />
to <tt>/dev/ttyACM1</tt>. Now the card can be turned on by sending <br />
<br />
AT+CFUN=1<br />
<br />
to <tt>/dev/ttyACM1</tt>. The answer should be<br />
<br />
+PACSP0<br />
<br />
Don't try to do anything until you see it. To force GSM-only connection, send<br />
<br />
AT+CFUN=5<br />
<br />
to <tt>/dev/ttyACM1</tt>. To force WCDMA-only connection, send<br />
<br />
AT+CFUN=6<br />
<br />
to <tt>/dev/ttyACM1</tt>.<br />
<br />
==Turning the card off==<br />
To put the card into energy-saving mode (this is the default), you can send<br />
<br />
AT+CFUN=4<br />
<br />
to <tt>/dev/ttyACM1</tt>. To remove all power from the card, send<br />
<br />
AT+CFUN=0<br />
<br />
to <tt>/dev/ttyACM1</tt>. Be carefull with the last command. It turns the card completely off, and it will no longer accept any AT-commands before the hard reset. To physically reset the card flip the wireless switch off, and then on. You can do the same by sending <tt>echo 0 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state</tt> (to turn off) and then <tt>echo 1 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state</tt> (to turn on).<br />
<br />
==Using the card as a wireless modem==<br />
Once the card is turned on, there are two ways to connect to the net. The first one is just to use the card as any "normal" GPRS modem and start <tt>pppd</tt> daemon on one of <tt>/dev/ttyACM*</tt>. The other way is to use CDC Ethernet interface. It is supposed to be more efficient, but it requires a pretty recent (>=2.6.28.8) kernel.<br />
<br />
====Connecting to the net via pppd====<br />
For the first approach, the easiest way to do it is to use <tt>wvdial</tt>. For example, to connect to AT&T Wireless network, your <tt>/etc/wvdial.conf</tt> would have to be something like this<br />
[Dialer 3G]<br />
Modem = /dev/ttyACM0<br />
Init1 = AT+CGDCONT=1,"IP","'''proxy'''"<br />
Stupid mode = 1<br />
phone= *99#<br />
Username = *<br />
Password = *<br />
'''Note''': if you are using a SIM from a different mobile provider, you may need to change the access point name (APN) "'''proxy'''" in <tt>Init1</tt> string and Username/Password to something else. You can find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here].<br />
<br />
====Connecting to the net via CDC Ethernet interface====<br />
The [http://marc.info/?l=linux-usb&m=123334979706403&w=2 second approach] works for kernels >=2.6.28.8. Configure the APN by sending<br />
<br />
AT+CGDCONT=1,"IP","'''proxy'''"<br />
<br />
to <tt>/dev/ttyACM1</tt>. Instead of "'''proxy'''" you may need to use to something else. Find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here]. To initiate the connection, send<br />
<br />
AT*ENAP=1,1<br />
<br />
to <tt>/dev/ttyACM1</tt>. Now, if your wireless provider lets you in, you are connected. Launch <tt>dhclient</tt><br />
<br />
dhclient usb0<br />
<br />
and start surfing the net. To disconnect, send<br />
<br />
AT*ENAP=0<br />
<br />
to <tt>/dev/ttyACM1</tt>.<br />
<br />
==Using the card as a GPS receiver==<br />
Once the card is turned on, we can use it to get GPS info via NMEA protocol. First, you have to configure the a few NMEA options. It is done by sending <br />
<br />
AT*E2GPSCTL=X,Y,Z<br />
<br />
to <tt>/dev/ttyACM1</tt>. Here<br />
<br />
*X can be 0 (NMEA stream turned off) or 1 (NMEA stream turned on)<br />
*Y can be an integer form 1 to 60, and sets the frequency of how often the card emits the NMEA sentences<br />
*Z can be 0 (DGPS is turned off) or 1 (DGPS is turned on)<br />
<br />
so, to configure the GPSr to update every 5 seconds, and turn DGPS on, you would send<br />
<br />
AT*E2GPSCTL=1,5,1<br />
<br />
to <tt>/dev/ttyACM1</tt>. Once the GPSr is configured, we can get the NMEA stream on /dev/ttyACM2 by sending<br />
<br />
AT*E2GPSNPD<br />
<br />
to <tt>/dev/ttyACM2</tt>. Once you do that, <tt>/dev/ttyACM2</tt> will no longer accept any new AT-commands. But you still can change the the behavior of the NMEA stream by sending the appropriate<br />
<br />
AT*E2GPSCTL=X,Y,Z<br />
<br />
to <tt>/dev/ttyACM1</tt>. Now you can read the NMEA stream by saying<br />
<br />
cat /dev/ttyACM2<br />
<br />
or better yet, start <tt>gpsd</tt> interface on <tt>/dev/ttyACM2</tt>.<br />
<br />
Note: There is a now a sourceforge project dedicated to the Ericsson Mobile Broadband modules. Gps control sw that does the above automatically is available and also a graphical user interface. Details are available on the [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=Main_Page#GPS_Control_.28mbm-gpsd.29 MBM Wiki].<br />
<br />
==Scripting everything==<br />
Install the packages<br />
<br />
apt-get install sysfsutils gpsd wvdial<br />
<br />
In order to save the power, let us use '''sysfsutils''' to completely power off the WWAN card on boot. Append the following line to <tt>/etc/sysfs.conf</tt><br />
<br />
devices/platform/thinkpad_acpi/rfkill/rfkill0/state = 0<br />
<br />
It will power down the card on boot, but when the laptop wakes from sleep, in some cases the card is powered up again. To re-apply these settings on wake-up, create a script named <tt>/etc/pm/sleep.d/10sysfsutils</tt>:<br />
<br />
#!/bin/sh<br />
case $1 in<br />
(hibernate|suspend)<br />
;;<br />
(thaw|resume)<br />
/etc/init.d/sysfsutils start<br />
;;<br />
*) echo "somebody is calling me totally wrong."<br />
;;<br />
esac<br />
<br />
Don't forget to <tt>chmod a+x /etc/pm/sleep.d/10sysfsutils</tt>. Create a file called <tt>/usr/local/etc/F3507g</tt> containing the following:<br />
<br />
'''USB_ID="0bdb:1900"'''<br />
'''PIN=""'''<br />
'''APN="proxy"'''<br />
<br />
GPSDPID="/var/run/gpsd.pid"<br />
<br />
RFKILL_DEVICE=$(for n in /sys/devices/platform/thinkpad_acpi/rfkill/rfkill*; do if [ "$(cat $n/name)" = "tpacpi_wwan_sw" ]; then echo $n/state; fi; done)<br />
<br />
CONTROL_DEVICE () {<br />
echo /dev/$(for n in /sys/class/tty/ttyACM*/device/interface;do if [ "$(cat $n)" = "Ericsson F3507g Mobile Broadband Minicard Data Modem" ]; then echo $n|awk -F '/' '{print $5}'; fi; done)<br />
}<br />
<br />
GPS_DEVICE () {<br />
echo /dev/$(for n in /sys/class/tty/ttyACM*/device/interface;do if [ "$(cat $n)" = "Ericsson F3507g Mobile Broadband Minicard GPS Port" ]; then echo $n|awk -F '/' '{print $5}'; fi; done)<br />
}<br />
<br />
powerup_F3507g () {<br />
echo -n "Powering up F3507g card.."<br />
echo 1 > $RFKILL_DEVICE<br />
while [ -z "$(lsusb -d $USB_ID)" ]; do sleep 0.5; echo -n "."; done<br />
echo "done"<br />
echo -n "Turning on F3507g card..."<br />
sleep 3<br />
if [ -n "$PIN" ]; then<br />
/usr/sbin/chat -v "" "AT+CPIN?" "SIM PIN" "AT" "OK" "AT+CPIN=\"$PIN\"" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
fi<br />
/usr/sbin/chat -v "" "AT+CPIN?" "READY" "AT+CFUN=1" "+PACSP" "AT" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
echo "done"<br />
}<br />
<br />
powerdown_F3507g () {<br />
echo -n "Turning off F3507g card..."<br />
/usr/sbin/chat -v "" "AT+CFUN=4" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
echo "done"<br />
echo -n "Powering down F3507g card.."<br />
echo 0 > $RFKILL_DEVICE<br />
while [ -n "$(lsusb -d $USB_ID)" ]; do sleep 0.5; echo -n "."; done<br />
echo "done"<br />
}<br />
<br />
configure_GPS () {<br />
/usr/sbin/chat -v "" "AT*E2GPSCTL=$1,$2,$3" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
}<br />
<br />
turnon_GPS () {<br />
echo -n "Starting NMEA stream on $(GPS_DEVICE)..."<br />
configure_GPS 1 1 1<br />
sleep 1<br />
/usr/sbin/chat -v "" "AT*E2GPSNPD" "GPGGA" > $(GPS_DEVICE) < $(GPS_DEVICE)<br />
start-stop-daemon --start --exec /usr/sbin/gpsd -- -P $GPSDPID $(GPS_DEVICE)<br />
echo "done"<br />
}<br />
<br />
turnoff_GPS () {<br />
echo -n "Stopping NMEA stream on $(GPS_DEVICE)..."<br />
start-stop-daemon --stop --pidfile $GPSDPID<br />
configure_GPS 0 1 0<br />
echo "done"<br />
turnoff_F3507g<br />
}<br />
<br />
turnon_usbnet () {<br />
echo -n "Starting usbnet connection..."<br />
/usr/sbin/chat -v "" "AT+CGDCONT=1,\"IP\",\"$APN\"" "OK" "AT*ENAP=1,1" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
echo "done"<br />
}<br />
<br />
turnoff_usbnet () {<br />
echo -n "Stopping usbnet connection..."<br />
/usr/sbin/chat -v "" "AT*ENAP=0" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
echo "done"<br />
turnoff_F3507g<br />
}<br />
<br />
turnoff_F3507g () {<br />
[ -z $(grep gps /etc/network/run/ifstate) ] && \<br />
[ -z $(grep usb0 /etc/network/run/ifstate) ] && \<br />
[ -z $(grep 3G /etc/network/run/ifstate) ] && \<br />
ifdown F3507g<br />
}<br />
<br />
Give the correct '''USB_ID''' and '''PIN''', and find the '''APN''' for your wireless provider [http://www.pinstack.com/carrier_settings_apn_gateway.html here]. Append the following lines to your <tt>/etc/network/interfaces</tt> file<br />
<br />
iface F3507g inet manual<br />
up . /usr/local/etc/F3507g; powerup_F3507g<br />
down . /usr/local/etc/F3507g; powerdown_F3507g<br />
<br />
iface 3G inet wvdial<br />
pre-up ifup F3507g<br />
post-down . /usr/local/etc/F3507g; turnoff_F3507g<br />
provider 3G<br />
<br />
iface gps inet manual<br />
up . /usr/local/etc/F3507g; ifup F3507g; turnon_GPS<br />
down . /usr/local/etc/F3507g; turnoff_GPS<br />
<br />
iface usb0 inet dhcp<br />
pre-up . /usr/local/etc/F3507g; ifup F3507g; turnon_usbnet<br />
post-down . /usr/local/etc/F3507g; turnoff_usbnet<br />
<br />
Configure <tt>/etc/wvdial.conf</tt> to look like this:<br />
<br />
[Dialer 3G]<br />
Modem = /dev/ttyACM0<br />
Init1 = AT+CGDCONT=1,"IP","'''proxy'''"<br />
Stupid mode = 1<br />
phone= *99#<br />
Username = *<br />
Password = *<br />
<br />
'''Note''': you may need to change the access point name (APN) "'''proxy'''" in <tt>Init1</tt> string and Username/Password to something else. Find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here].<br />
<br />
Now broadband connection could be started in the same way as you start any other network interface, just by saying <tt>ifup usb0</tt> (or <tt>ifup 3G</tt>, if connecting via <tt>pppd</tt>). To shut it down, say <tt>ifdown usb0</tt> (or <tt>ifdown 3G</tt>). Similarly, GPS interface is started by <tt>ifup gps</tt> and turned off by <tt>ifdown gps</tt>. Once you get a fix, you can use your favourite GPS mapping application like [http://www.tangogps.org tangogps]. The "cold start" seems to take quite a bit however, and sometimes it cannot get a fix if indoors.<br />
<br />
==Using F3507g with NetworkManager==<br />
Work is ongoing to add support for Ericsson Mobile Broadband Modules to GNOME NetworkManager / modem-manager. More information is available on the [http://mbm.sourceforge.net/ MBM project website] and the [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=MBM MBM wiki].<br />
<br />
The F3507g card (in a ThinkPad {{T400s}}) works out of the box on Fedora 11. No configuration is needed beyond setting the data plan provider in the nm-applet GUI.<br />
<br />
Using mbm-gpsd gps works flawlessly with the F3507g on Karmic Koala with modemmanager packages from [https://launchpad.net/~modemmanager/+archive/ppa Ubuntu PPA], the mbm-gpsd installed by source using the description from [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=MBM#GPS_Control_.28mbm-gpsd.29 here] and knowing the PIN of your SIM card.<br />
<br />
== SMS with wammu/gammu ==<br />
You can use [http://wammu.eu/ Wammu] to receive and send SMS.<br />
<br />
After installing wammu (with the usual <tt>apt-get install wammu</tt> or whatever), choose to configure it "Manually":<br />
port=/dev/ttyACM0<br />
connection=at<br />
<br />
(credits: [http://www.thinkpad-forum.de/thinkpad-software/linux-und-osx/p633662-sms-mit-der-ericsson-3507g/ linrunner])<br />
<br />
Sony Ericsson F3507g configuration [http://wammu.eu/phones/sony-ericsson/3595/ explained on wammu website]<br />
<br />
==Other thoughts==<br />
While <tt>AT+CFUN=*</tt> and <tt>AT+CPIN=*</tt> are pretty standard commands for wireless modems and are well-documented, it appears that the commands <tt>AT*E2GPSCTL</tt> and <tt>AT*E2GPSNPD</tt> are unique to the Ericsson F3507g card. All credit for discovering them goes to "Nickolai Zeldovich" who left a comment in this [http://redmonk.com/sogrady/2008/09/24/apone/ thread]. I imagine one could find them via a USB sniffer on a working Windows machine (or a Linux machine with Windows running in a virtual machine). Another way to get them is to try to look for "gps" string in Windows drivers. What is interesting, F3507g supports a few other AT-commands with "GPS" substring (you can get all supported AT-commands by sending <tt>AT*</tt> to <tt>/dev/ttyACM1</tt> after activating it with <tt>AT+CFUN=1</tt>). Anyway, there is a [http://www.natisbad.org/E4300/Dell_Wireless_5530_AT_cmd_ref.html project] aiming to document all AT-commands for the Ericsson F3507g card.<br />
<br />
==Related Links==<br />
*[http://www.ericsson.com/solutions/mobile_broadband_modules/docs/mobile_broadband_module_datasheet_print.pdf Ericsson Datasheet]<br />
*[http://www.natisbad.org/E4300/Dell_Wireless_5530_AT_cmd_ref.html F3507g - AT commands reference]<br />
*[http://www.pinstack.com/carrier_settings_apn_gateway.html Carrier internet Settings (Apn, Gateway, etc)]<br />
*[http://mbm.sourceforge.net/ MBM project website (Support for f3507g/f3607gw in NetworkManager, kernel drivers, gps control software etc)]<br />
<br />
==Bugs==<br />
* Ubuntu 8.10 kernel suffers from the "option" regression mentioned above. However both CDC ACM and CDC Ethernet interfaces are treated correctly by Ubuntu 9.04 kernel.<br />
* Playing around with the device under Linux can cause it to disappear under Windows Vista. Issue + Fix described [http://forums.lenovo.com/t5/T400-T500-and-newer-T-series/Ericsson-f3507g-doesn-t-appear-under-Vista32-anymore-but-works/m-p/138874 here]<br />
<br />
==ThinkPads this adapter may be found in==<br />
*{{SL300}}, {{SL400}}, {{SL500}}, {{SL510}}<br />
*{{T400}}, {{T400s}}, {{T500}}<br />
*{{W500}}<br />
*{{X200}}, {{X200 Tablet}}, {{X301}}</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Ericsson_F3507g_Mobile_Broadband_Module&diff=48531Ericsson F3507g Mobile Broadband Module2010-05-12T05:59:49Z<p>Newhren: /* SMS with wammu/gammu */</p>
<hr />
<div>{| width="100%"<br />
|style="vertical-align:top" |<br />
<div style="margin: 0; margin-right:10px; border: 1px solid #dfdfdf; padding: 0em 1em 1em 1em; background-color:#F8F8FF; align:right;"><br />
=== Ericsson F3507g Mobile Broadband Module ===<br />
This is a Ericsson WWAN Adapter that is installed in a Mini-PCI Express slot<br />
<br />
{{NOTE|Specific versions of this card may come pre-configured for a certain carrier (AT&T)}}<br />
<br />
=== Features ===<br />
* Chipset: Ericsson F3507g<br />
* USB ID: 0bdb:1900<br />
* USB ID: 0bdb:1902<br />
* WCDMA 2100/1900/850MHz<br />
* GSM/GPRS/EDGE 850/900/1800/1900MHz<br />
* GPS<br />
* Download up to 7.2Mbps<br />
* Upload up to 2.0Mbps<br />
</div><br />
|style="vertical-align:top" |<br />
[[image:EriccsonWWAN.gif|thumb|Ericsson F3507g WWAN Adapter]]<br />
|}<br />
__TOC__<br />
<br />
== Lenovo Partnumbers ==<br />
* Option PN 43R9152 (AT&T)<br />
* FRU 43Y6537 (AT&T)<br />
* FRU 43Y6513 (Other)<br />
<br />
==Configuring the Ericsson F3507g in Ubuntu Intrepid linux (and later)==<br />
Please read this article, as it will show you step by step on how to set up the scripts necessary to make the card work. As of 9.10, the gnome network manager applet will allow you to successfully configure the card, however going into sleep mode will make it unavailable afterwards. These scripts will wake up the card.<br />
<br />
* [http://redmonk.com/sogrady/2008/12/07/how-to-use-an-att-ericsson-f3507g-card-on-ubuntu-intrepid/ How to use an att ericsson f3507g card on ubuntu intrepid]<br />
<br />
==Other options==<br />
<br />
Here are some basics about Ericsson F3507g MiniPCIe WWAN/GPS card (USB ID <tt>0bdb:1900</tt> and <tt>0bdb:1902</tt>):<br />
<br />
* the card will not work without an inserted SIM, even the GPS function. If you want to use just GPS, any SIM would work, even if it is not attached to any active account with any GSM provider.<br />
* the card provides three CDC ACM interfaces (<tt>CONFIG_USB_ACM=m</tt>), two CDC WDM interfaces (<tt>CONFIG_USB_WDM=m</tt>) and one CDC Ethernet interface (<tt>CONFIG_USB_NET_CDCETHER=m</tt>), and identifies them as<br />
for n in `ls /sys/class/*/*{ACM,wdm,usb0}*/device/interface`;do echo $(echo $n|awk -F '/' '{print $5}') : $(cat $n);done<br />
<br />
usb0 : Ericsson F3507g Mobile Broadband Minicard Network Adapter<br />
ttyACM0 : Ericsson F3507g Mobile Broadband Minicard Modem<br />
ttyACM1 : Ericsson F3507g Mobile Broadband Minicard Data Modem<br />
ttyACM2 : Ericsson F3507g Mobile Broadband Minicard GPS Port<br />
cdc-wdm0 : Ericsson F3507g Mobile Broadband Minicard Device Management<br />
cdc-wdm1 : Ericsson F3507g Mobile Broadband Minicard PC SC Port<br />
'''Note''':<br />
*apparently, for a while <tt>option</tt> USB-serial driver had claimed USB ID <tt>0bdb:1900</tt>, but this was wrong, and as of kernel 2.6.28.9 that commit was reversed. If instead of <tt>/dev/ttyACM*</tt> you see <tt>/dev/ttyUSB*</tt>, it means that <tt>option</tt> module is loaded. You may need to blacklist it to make sure it doesn't happen.<br />
*Support for the CDC Ethernet interface appears only in kernel 2.6.28.8. But if your kernel is older, you can still connect to the net using one of the "Modem" interfaces.<br />
<br />
As Ericsson's naming scheme suggests, idealy we would use <tt>/dev/cdc-wdm0</tt> for controlling the card, <tt>usb0</tt> as a network device, <tt>/dev/ttyACM0</tt> or <tt>/dev/ttyACM1</tt> as a modem, and <tt>/dev/ttyACM2</tt> for GPS. This works for manual testing, but unfortunately, due to [http://markmail.org/message/2sd7culbgekugow2 limitations] of <tt>chat</tt>, does not play very well in scripts. So, instead of <tt>/dev/cdc-wdm0</tt>, for controlling the card we will use <tt>/dev/ttyACM1</tt>.<br />
<br />
==Turning the card on==<br />
First, check whenever the SIM is protected by PIN by sending <br />
<br />
AT+CPIN?<br />
<br />
to <tt>/dev/ttyACM1</tt>. You can do it with any terminal terminal program like <tt>cu</tt> or <tt>minicom</tt>. If the answer is<br />
<br />
+CPIN: READY<br />
<br />
then the SIM is unlocked. If the answer is<br />
<br />
+CPIN: SIM PIN<br />
<br />
you need first to unlock it by sending<br />
<br />
AT+CPIN="YOUR-PIN"<br />
<br />
to <tt>/dev/ttyACM1</tt>. Now the card can be turned on by sending <br />
<br />
AT+CFUN=1<br />
<br />
to <tt>/dev/ttyACM1</tt>. The answer should be<br />
<br />
+PACSP0<br />
<br />
Don't try to do anything until you see it. To force GSM-only connection, send<br />
<br />
AT+CFUN=5<br />
<br />
to <tt>/dev/ttyACM1</tt>. To force WCDMA-only connection, send<br />
<br />
AT+CFUN=6<br />
<br />
to <tt>/dev/ttyACM1</tt>.<br />
<br />
==Turning the card off==<br />
To put the card into energy-saving mode (this is the default), you can send<br />
<br />
AT+CFUN=4<br />
<br />
to <tt>/dev/ttyACM1</tt>. To remove all power from the card, send<br />
<br />
AT+CFUN=0<br />
<br />
to <tt>/dev/ttyACM1</tt>. Be carefull with the last command. It turns the card completely off, and it will no longer accept any AT-commands before the hard reset. To physically reset the card flip the wireless switch off, and then on. You can do the same by sending <tt>echo 0 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state</tt> (to turn off) and then <tt>echo 1 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state</tt> (to turn on).<br />
<br />
==Using the card as a wireless modem==<br />
Once the card is turned on, there are two ways to connect to the net. The first one is just to use the card as any "normal" GPRS modem and start <tt>pppd</tt> daemon on one of <tt>/dev/ttyACM*</tt>. The other way is to use CDC Ethernet interface. It is supposed to be more efficient, but it requires a pretty recent (>=2.6.28.8) kernel.<br />
<br />
====Connecting to the net via pppd====<br />
For the first approach, the easiest way to do it is to use <tt>wvdial</tt>. For example, to connect to AT&T Wireless network, your <tt>/etc/wvdial.conf</tt> would have to be something like this<br />
[Dialer 3G]<br />
Modem = /dev/ttyACM0<br />
Init1 = AT+CGDCONT=1,"IP","'''proxy'''"<br />
Stupid mode = 1<br />
phone= *99#<br />
Username = *<br />
Password = *<br />
'''Note''': if you are using a SIM from a different mobile provider, you may need to change the access point name (APN) "'''proxy'''" in <tt>Init1</tt> string and Username/Password to something else. You can find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here].<br />
<br />
====Connecting to the net via CDC Ethernet interface====<br />
The [http://marc.info/?l=linux-usb&m=123334979706403&w=2 second approach] works for kernels >=2.6.28.8. Configure the APN by sending<br />
<br />
AT+CGDCONT=1,"IP","'''proxy'''"<br />
<br />
to <tt>/dev/ttyACM1</tt>. Instead of "'''proxy'''" you may need to use to something else. Find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here]. To initiate the connection, send<br />
<br />
AT*ENAP=1,1<br />
<br />
to <tt>/dev/ttyACM1</tt>. Now, if your wireless provider lets you in, you are connected. Launch <tt>dhclient</tt><br />
<br />
dhclient usb0<br />
<br />
and start surfing the net. To disconnect, send<br />
<br />
AT*ENAP=0<br />
<br />
to <tt>/dev/ttyACM1</tt>.<br />
<br />
==Using the card as a GPS receiver==<br />
Once the card is turned on, we can use it to get GPS info via NMEA protocol. First, you have to configure the a few NMEA options. It is done by sending <br />
<br />
AT*E2GPSCTL=X,Y,Z<br />
<br />
to <tt>/dev/ttyACM1</tt>. Here<br />
<br />
*X can be 0 (NMEA stream turned off) or 1 (NMEA stream turned on)<br />
*Y can be an integer form 1 to 60, and sets the frequency of how often the card emits the NMEA sentences<br />
*Z can be 0 (DGPS is turned off) or 1 (DGPS is turned on)<br />
<br />
so, to configure the GPSr to update every 5 seconds, and turn DGPS on, you would send<br />
<br />
AT*E2GPSCTL=1,5,1<br />
<br />
to <tt>/dev/ttyACM1</tt>. Once the GPSr is configured, we can get the NMEA stream on /dev/ttyACM2 by sending<br />
<br />
AT*E2GPSNPD<br />
<br />
to <tt>/dev/ttyACM2</tt>. Once you do that, <tt>/dev/ttyACM2</tt> will no longer accept any new AT-commands. But you still can change the the behavior of the NMEA stream by sending the appropriate<br />
<br />
AT*E2GPSCTL=X,Y,Z<br />
<br />
to <tt>/dev/ttyACM1</tt>. Now you can read the NMEA stream by saying<br />
<br />
cat /dev/ttyACM2<br />
<br />
or better yet, start <tt>gpsd</tt> interface on <tt>/dev/ttyACM2</tt>.<br />
<br />
Note: There is a now a sourceforge project dedicated to the Ericsson Mobile Broadband modules. Gps control sw that does the above automatically is available and also a graphical user interface. Details are available on the [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=Main_Page#GPS_Control_.28mbm-gpsd.29 MBM Wiki].<br />
<br />
==Scripting everything==<br />
Install the packages<br />
<br />
apt-get install sysfsutils gpsd wvdial<br />
<br />
In order to save the power, let us use '''sysfsutils''' to completely power off the WWAN card on boot. Append the following line to <tt>/etc/sysfs.conf</tt><br />
<br />
devices/platform/thinkpad_acpi/rfkill/rfkill0/state = 0<br />
<br />
It will power down the card on boot, but when the laptop wakes from sleep, in some cases the card is powered up again. To re-apply these settings on wake-up, create a script named <tt>/etc/pm/sleep.d/10sysfsutils</tt>:<br />
<br />
#!/bin/sh<br />
case $1 in<br />
(hibernate|suspend)<br />
;;<br />
(thaw|resume)<br />
/etc/init.d/sysfsutils start<br />
;;<br />
*) echo "somebody is calling me totally wrong."<br />
;;<br />
esac<br />
<br />
Don't forget to <tt>chmod a+x /etc/pm/sleep.d/10sysfsutils</tt>. Create a file called <tt>/usr/local/etc/F3507g</tt> containing the following:<br />
<br />
'''USB_ID="0bdb:1900"'''<br />
'''PIN=""'''<br />
'''APN="proxy"'''<br />
<br />
GPSDPID="/var/run/gpsd.pid"<br />
<br />
RFKILL_DEVICE=$(for n in /sys/devices/platform/thinkpad_acpi/rfkill/rfkill*; do if [ "$(cat $n/name)" = "tpacpi_wwan_sw" ]; then echo $n/state; fi; done)<br />
<br />
CONTROL_DEVICE () {<br />
echo /dev/$(for n in /sys/class/tty/ttyACM*/device/interface;do if [ "$(cat $n)" = "Ericsson F3507g Mobile Broadband Minicard Data Modem" ]; then echo $n|awk -F '/' '{print $5}'; fi; done)<br />
}<br />
<br />
GPS_DEVICE () {<br />
echo /dev/$(for n in /sys/class/tty/ttyACM*/device/interface;do if [ "$(cat $n)" = "Ericsson F3507g Mobile Broadband Minicard GPS Port" ]; then echo $n|awk -F '/' '{print $5}'; fi; done)<br />
}<br />
<br />
powerup_F3507g () {<br />
echo -n "Powering up F3507g card.."<br />
echo 1 > $RFKILL_DEVICE<br />
while [ -z "$(lsusb -d $USB_ID)" ]; do sleep 0.5; echo -n "."; done<br />
echo "done"<br />
echo -n "Turning on F3507g card..."<br />
sleep 3<br />
if [ -n "$PIN" ]; then<br />
/usr/sbin/chat -v "" "AT+CPIN?" "SIM PIN" "AT" "OK" "AT+CPIN=\"$PIN\"" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
fi<br />
/usr/sbin/chat -v "" "AT+CPIN?" "READY" "AT+CFUN=1" "+PACSP" "AT" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
echo "done"<br />
}<br />
<br />
powerdown_F3507g () {<br />
echo -n "Turning off F3507g card..."<br />
/usr/sbin/chat -v "" "AT+CFUN=4" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
echo "done"<br />
echo -n "Powering down F3507g card.."<br />
echo 0 > $RFKILL_DEVICE<br />
while [ -n "$(lsusb -d $USB_ID)" ]; do sleep 0.5; echo -n "."; done<br />
echo "done"<br />
}<br />
<br />
configure_GPS () {<br />
/usr/sbin/chat -v "" "AT*E2GPSCTL=$1,$2,$3" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
}<br />
<br />
turnon_GPS () {<br />
echo -n "Starting NMEA stream on $(GPS_DEVICE)..."<br />
configure_GPS 1 1 1<br />
sleep 1<br />
/usr/sbin/chat -v "" "AT*E2GPSNPD" "GPGGA" > $(GPS_DEVICE) < $(GPS_DEVICE)<br />
start-stop-daemon --start --exec /usr/sbin/gpsd -- -P $GPSDPID $(GPS_DEVICE)<br />
echo "done"<br />
}<br />
<br />
turnoff_GPS () {<br />
echo -n "Stopping NMEA stream on $(GPS_DEVICE)..."<br />
start-stop-daemon --stop --pidfile $GPSDPID<br />
configure_GPS 0 1 0<br />
echo "done"<br />
turnoff_F3507g<br />
}<br />
<br />
turnon_usbnet () {<br />
echo -n "Starting usbnet connection..."<br />
/usr/sbin/chat -v "" "AT+CGDCONT=1,\"IP\",\"$APN\"" "OK" "AT*ENAP=1,1" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
echo "done"<br />
}<br />
<br />
turnoff_usbnet () {<br />
echo -n "Stopping usbnet connection..."<br />
/usr/sbin/chat -v "" "AT*ENAP=0" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
echo "done"<br />
turnoff_F3507g<br />
}<br />
<br />
turnoff_F3507g () {<br />
[ -z $(grep gps /etc/network/run/ifstate) ] && \<br />
[ -z $(grep usb0 /etc/network/run/ifstate) ] && \<br />
[ -z $(grep 3G /etc/network/run/ifstate) ] && \<br />
ifdown F3507g<br />
}<br />
<br />
Give the correct '''USB_ID''' and '''PIN''', and find the '''APN''' for your wireless provider [http://www.pinstack.com/carrier_settings_apn_gateway.html here]. Append the following lines to your <tt>/etc/network/interfaces</tt> file<br />
<br />
iface F3507g inet manual<br />
up . /usr/local/etc/F3507g; powerup_F3507g<br />
down . /usr/local/etc/F3507g; powerdown_F3507g<br />
<br />
iface 3G inet wvdial<br />
pre-up ifup F3507g<br />
post-down . /usr/local/etc/F3507g; turnoff_F3507g<br />
provider 3G<br />
<br />
iface gps inet manual<br />
up . /usr/local/etc/F3507g; ifup F3507g; turnon_GPS<br />
down . /usr/local/etc/F3507g; turnoff_GPS<br />
<br />
iface usb0 inet dhcp<br />
pre-up . /usr/local/etc/F3507g; ifup F3507g; turnon_usbnet<br />
post-down . /usr/local/etc/F3507g; turnoff_usbnet<br />
<br />
Configure <tt>/etc/wvdial.conf</tt> to look like this:<br />
<br />
[Dialer 3G]<br />
Modem = /dev/ttyACM0<br />
Init1 = AT+CGDCONT=1,"IP","'''proxy'''"<br />
Stupid mode = 1<br />
phone= *99#<br />
Username = *<br />
Password = *<br />
<br />
'''Note''': you may need to change the access point name (APN) "'''proxy'''" in <tt>Init1</tt> string and Username/Password to something else. Find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here].<br />
<br />
Now broadband connection could be started in the same way as you start any other network interface, just by saying <tt>ifup usb0</tt> (or <tt>ifup 3G</tt>, if connecting via <tt>pppd</tt>). To shut it down, say <tt>ifdown usb0</tt> (or <tt>ifdown 3G</tt>). Similarly, GPS interface is started by <tt>ifup gps</tt> and turned off by <tt>ifdown gps</tt>. Once you get a fix, you can use your favourite GPS mapping application like [http://www.tangogps.org tangogps]. The "cold start" seems to take quite a bit however, and sometimes it cannot get a fix if indoors.<br />
<br />
==Using F3507g with NetworkManager==<br />
Work is ongoing to add support for Ericsson Mobile Broadband Modules to GNOME NetworkManager / modem-manager. More information is available on the [http://mbm.sourceforge.net/ MBM project website] and the [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=MBM MBM wiki].<br />
<br />
The F3507g card (in a ThinkPad {{T400s}}) works out of the box on Fedora 11. No configuration is needed beyond setting the data plan provider in the nm-applet GUI.<br />
<br />
Using mbm-gpsd gps works flawlessly with the F3507g on Karmic Koala with modemmanager packages from [https://launchpad.net/~modemmanager/+archive/ppa Ubuntu PPA], the mbm-gpsd installed by source using the description from [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=MBM#GPS_Control_.28mbm-gpsd.29 here] and knowing the PIN of your SIM card.<br />
<br />
== SMS with wammu/gammu ==<br />
You can use [http://wammu.eu/ Wammu] to receive and send SMS.<br />
<br />
After installing wammu (with the usual <tt>apt-get install wammu</tt> or whatever), choose to configure it "Manually":<br />
port=/dev/ttyACM0<br />
connection=at<br />
<br />
(credits: [http://www.thinkpad-forum.de/thinkpad-software/linux-und-osx/p633662-sms-mit-der-ericsson-3507g/ linrunner])<br />
<br />
Sony Ericsson F3507g configuration [http://wammu.eu/phones/sony-ericsson/3595/ explained on wammu website]<br />
<br />
==Other thoughts==<br />
While <tt>AT+CFUN=*</tt> and <tt>AT+CPIN=*</tt> are pretty standard commands for wireless modems and are well-documented, it appears that the commands <tt>AT*E2GPSCTL</tt> and <tt>AT*E2GPSNPD</tt> are unique to the Ericsson F3507g card. All credit for discovering them goes to "Nickolai Zeldovich" who left a comment in this [http://redmonk.com/sogrady/2008/09/24/apone/ thread]. I imagine one could find them via a USB sniffer on a working Windows machine (or a Linux machine with Windows running in a virtual machine). Another way to get them is to try to look for "gps" string in Windows drivers. What is interesting, F3507g supports a few other AT-commands with "GPS" substring (you can get all supported AT-commands by sending <tt>AT*</tt> to <tt>/dev/ttyACM1</tt> after activating it with <tt>AT+CFUN=1</tt>). Anyway, there is a [http://www.natisbad.org/E4300/Dell_Wireless_5530_AT_cmd_ref.html project] aiming to document all AT-commands for the Ericsson F3507g card.<br />
<br />
==Related Links==<br />
*[http://www.ericsson.com/solutions/mobile_broadband_modules/docs/mobile_broadband_module_datasheet_print.pdf Ericsson Datasheet]<br />
*[http://www.natisbad.org/E4300/Dell_Wireless_5530_AT_cmd_ref.html F3705g - AT commands reference]<br />
*[http://www.pinstack.com/carrier_settings_apn_gateway.html Carrier internet Settings (Apn, Gateway, etc)]<br />
*[http://mbm.sourceforge.net/ MBM project website (Support for f3507g/f3607gw in NetworkManager, kernel drivers, gps control software etc)]<br />
<br />
==Bugs==<br />
* Ubuntu 8.10 kernel suffers from the "option" regression mentioned above. However both CDC ACM and CDC Ethernet interfaces are treated correctly by Ubuntu 9.04 kernel.<br />
* Playing around with the device under Linux can cause it to disappear under Windows Vista. Issue + Fix described [http://forums.lenovo.com/t5/T400-T500-and-newer-T-series/Ericsson-f3507g-doesn-t-appear-under-Vista32-anymore-but-works/m-p/138874 here]<br />
<br />
==ThinkPads this adapter may be found in==<br />
*{{SL300}}, {{SL400}}, {{SL500}}, {{SL510}}<br />
*{{T400}}, {{T400s}}, {{T500}}<br />
*{{W500}}<br />
*{{X200}}, {{X200 Tablet}}, {{X301}}</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Ericsson_F3507g_Mobile_Broadband_Module&diff=48530Ericsson F3507g Mobile Broadband Module2010-05-12T04:44:24Z<p>Newhren: /* Scripting everything */</p>
<hr />
<div>{| width="100%"<br />
|style="vertical-align:top" |<br />
<div style="margin: 0; margin-right:10px; border: 1px solid #dfdfdf; padding: 0em 1em 1em 1em; background-color:#F8F8FF; align:right;"><br />
=== Ericsson F3507g Mobile Broadband Module ===<br />
This is a Ericsson WWAN Adapter that is installed in a Mini-PCI Express slot<br />
<br />
{{NOTE|Specific versions of this card may come pre-configured for a certain carrier (AT&T)}}<br />
<br />
=== Features ===<br />
* Chipset: Ericsson F3507g<br />
* USB ID: 0bdb:1900<br />
* USB ID: 0bdb:1902<br />
* WCDMA 2100/1900/850MHz<br />
* GSM/GPRS/EDGE 850/900/1800/1900MHz<br />
* GPS<br />
* Download up to 7.2Mbps<br />
* Upload up to 2.0Mbps<br />
</div><br />
|style="vertical-align:top" |<br />
[[image:EriccsonWWAN.gif|thumb|Ericsson F3507g WWAN Adapter]]<br />
|}<br />
__TOC__<br />
<br />
== Lenovo Partnumbers ==<br />
* Option PN 43R9152 (AT&T)<br />
* FRU 43Y6537 (AT&T)<br />
* FRU 43Y6513 (Other)<br />
<br />
==Configuring the Ericsson F3507g in Ubuntu Intrepid linux (and later)==<br />
Please read this article, as it will show you step by step on how to set up the scripts necessary to make the card work. As of 9.10, the gnome network manager applet will allow you to successfully configure the card, however going into sleep mode will make it unavailable afterwards. These scripts will wake up the card.<br />
<br />
* [http://redmonk.com/sogrady/2008/12/07/how-to-use-an-att-ericsson-f3507g-card-on-ubuntu-intrepid/ How to use an att ericsson f3507g card on ubuntu intrepid]<br />
<br />
==Other options==<br />
<br />
Here are some basics about Ericsson F3507g MiniPCIe WWAN/GPS card (USB ID <tt>0bdb:1900</tt> and <tt>0bdb:1902</tt>):<br />
<br />
* the card will not work without an inserted SIM, even the GPS function. If you want to use just GPS, any SIM would work, even if it is not attached to any active account with any GSM provider.<br />
* the card provides three CDC ACM interfaces (<tt>CONFIG_USB_ACM=m</tt>), two CDC WDM interfaces (<tt>CONFIG_USB_WDM=m</tt>) and one CDC Ethernet interface (<tt>CONFIG_USB_NET_CDCETHER=m</tt>), and identifies them as<br />
for n in `ls /sys/class/*/*{ACM,wdm,usb0}*/device/interface`;do echo $(echo $n|awk -F '/' '{print $5}') : $(cat $n);done<br />
<br />
usb0 : Ericsson F3507g Mobile Broadband Minicard Network Adapter<br />
ttyACM0 : Ericsson F3507g Mobile Broadband Minicard Modem<br />
ttyACM1 : Ericsson F3507g Mobile Broadband Minicard Data Modem<br />
ttyACM2 : Ericsson F3507g Mobile Broadband Minicard GPS Port<br />
cdc-wdm0 : Ericsson F3507g Mobile Broadband Minicard Device Management<br />
cdc-wdm1 : Ericsson F3507g Mobile Broadband Minicard PC SC Port<br />
'''Note''':<br />
*apparently, for a while <tt>option</tt> USB-serial driver had claimed USB ID <tt>0bdb:1900</tt>, but this was wrong, and as of kernel 2.6.28.9 that commit was reversed. If instead of <tt>/dev/ttyACM*</tt> you see <tt>/dev/ttyUSB*</tt>, it means that <tt>option</tt> module is loaded. You may need to blacklist it to make sure it doesn't happen.<br />
*Support for the CDC Ethernet interface appears only in kernel 2.6.28.8. But if your kernel is older, you can still connect to the net using one of the "Modem" interfaces.<br />
<br />
As Ericsson's naming scheme suggests, idealy we would use <tt>/dev/cdc-wdm0</tt> for controlling the card, <tt>usb0</tt> as a network device, <tt>/dev/ttyACM0</tt> or <tt>/dev/ttyACM1</tt> as a modem, and <tt>/dev/ttyACM2</tt> for GPS. This works for manual testing, but unfortunately, due to [http://markmail.org/message/2sd7culbgekugow2 limitations] of <tt>chat</tt>, does not play very well in scripts. So, instead of <tt>/dev/cdc-wdm0</tt>, for controlling the card we will use <tt>/dev/ttyACM1</tt>.<br />
<br />
==Turning the card on==<br />
First, check whenever the SIM is protected by PIN by sending <br />
<br />
AT+CPIN?<br />
<br />
to <tt>/dev/ttyACM1</tt>. You can do it with any terminal terminal program like <tt>cu</tt> or <tt>minicom</tt>. If the answer is<br />
<br />
+CPIN: READY<br />
<br />
then the SIM is unlocked. If the answer is<br />
<br />
+CPIN: SIM PIN<br />
<br />
you need first to unlock it by sending<br />
<br />
AT+CPIN="YOUR-PIN"<br />
<br />
to <tt>/dev/ttyACM1</tt>. Now the card can be turned on by sending <br />
<br />
AT+CFUN=1<br />
<br />
to <tt>/dev/ttyACM1</tt>. The answer should be<br />
<br />
+PACSP0<br />
<br />
Don't try to do anything until you see it. To force GSM-only connection, send<br />
<br />
AT+CFUN=5<br />
<br />
to <tt>/dev/ttyACM1</tt>. To force WCDMA-only connection, send<br />
<br />
AT+CFUN=6<br />
<br />
to <tt>/dev/ttyACM1</tt>.<br />
<br />
==Turning the card off==<br />
To put the card into energy-saving mode (this is the default), you can send<br />
<br />
AT+CFUN=4<br />
<br />
to <tt>/dev/ttyACM1</tt>. To remove all power from the card, send<br />
<br />
AT+CFUN=0<br />
<br />
to <tt>/dev/ttyACM1</tt>. Be carefull with the last command. It turns the card completely off, and it will no longer accept any AT-commands before the hard reset. To physically reset the card flip the wireless switch off, and then on. You can do the same by sending <tt>echo 0 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state</tt> (to turn off) and then <tt>echo 1 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state</tt> (to turn on).<br />
<br />
==Using the card as a wireless modem==<br />
Once the card is turned on, there are two ways to connect to the net. The first one is just to use the card as any "normal" GPRS modem and start <tt>pppd</tt> daemon on one of <tt>/dev/ttyACM*</tt>. The other way is to use CDC Ethernet interface. It is supposed to be more efficient, but it requires a pretty recent (>=2.6.28.8) kernel.<br />
<br />
====Connecting to the net via pppd====<br />
For the first approach, the easiest way to do it is to use <tt>wvdial</tt>. For example, to connect to AT&T Wireless network, your <tt>/etc/wvdial.conf</tt> would have to be something like this<br />
[Dialer 3G]<br />
Modem = /dev/ttyACM0<br />
Init1 = AT+CGDCONT=1,"IP","'''proxy'''"<br />
Stupid mode = 1<br />
phone= *99#<br />
Username = *<br />
Password = *<br />
'''Note''': if you are using a SIM from a different mobile provider, you may need to change the access point name (APN) "'''proxy'''" in <tt>Init1</tt> string and Username/Password to something else. You can find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here].<br />
<br />
====Connecting to the net via CDC Ethernet interface====<br />
The [http://marc.info/?l=linux-usb&m=123334979706403&w=2 second approach] works for kernels >=2.6.28.8. Configure the APN by sending<br />
<br />
AT+CGDCONT=1,"IP","'''proxy'''"<br />
<br />
to <tt>/dev/ttyACM1</tt>. Instead of "'''proxy'''" you may need to use to something else. Find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here]. To initiate the connection, send<br />
<br />
AT*ENAP=1,1<br />
<br />
to <tt>/dev/ttyACM1</tt>. Now, if your wireless provider lets you in, you are connected. Launch <tt>dhclient</tt><br />
<br />
dhclient usb0<br />
<br />
and start surfing the net. To disconnect, send<br />
<br />
AT*ENAP=0<br />
<br />
to <tt>/dev/ttyACM1</tt>.<br />
<br />
==Using the card as a GPS receiver==<br />
Once the card is turned on, we can use it to get GPS info via NMEA protocol. First, you have to configure the a few NMEA options. It is done by sending <br />
<br />
AT*E2GPSCTL=X,Y,Z<br />
<br />
to <tt>/dev/ttyACM1</tt>. Here<br />
<br />
*X can be 0 (NMEA stream turned off) or 1 (NMEA stream turned on)<br />
*Y can be an integer form 1 to 60, and sets the frequency of how often the card emits the NMEA sentences<br />
*Z can be 0 (DGPS is turned off) or 1 (DGPS is turned on)<br />
<br />
so, to configure the GPSr to update every 5 seconds, and turn DGPS on, you would send<br />
<br />
AT*E2GPSCTL=1,5,1<br />
<br />
to <tt>/dev/ttyACM1</tt>. Once the GPSr is configured, we can get the NMEA stream on /dev/ttyACM2 by sending<br />
<br />
AT*E2GPSNPD<br />
<br />
to <tt>/dev/ttyACM2</tt>. Once you do that, <tt>/dev/ttyACM2</tt> will no longer accept any new AT-commands. But you still can change the the behavior of the NMEA stream by sending the appropriate<br />
<br />
AT*E2GPSCTL=X,Y,Z<br />
<br />
to <tt>/dev/ttyACM1</tt>. Now you can read the NMEA stream by saying<br />
<br />
cat /dev/ttyACM2<br />
<br />
or better yet, start <tt>gpsd</tt> interface on <tt>/dev/ttyACM2</tt>.<br />
<br />
Note: There is a now a sourceforge project dedicated to the Ericsson Mobile Broadband modules. Gps control sw that does the above automatically is available and also a graphical user interface. Details are available on the [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=Main_Page#GPS_Control_.28mbm-gpsd.29 MBM Wiki].<br />
<br />
==Scripting everything==<br />
Install the packages<br />
<br />
apt-get install sysfsutils gpsd wvdial<br />
<br />
In order to save the power, let us use '''sysfsutils''' to completely power off the WWAN card on boot. Append the following line to <tt>/etc/sysfs.conf</tt><br />
<br />
devices/platform/thinkpad_acpi/rfkill/rfkill0/state = 0<br />
<br />
It will power down the card on boot, but when the laptop wakes from sleep, in some cases the card is powered up again. To re-apply these settings on wake-up, create a script named <tt>/etc/pm/sleep.d/10sysfsutils</tt>:<br />
<br />
#!/bin/sh<br />
case $1 in<br />
(hibernate|suspend)<br />
;;<br />
(thaw|resume)<br />
/etc/init.d/sysfsutils start<br />
;;<br />
*) echo "somebody is calling me totally wrong."<br />
;;<br />
esac<br />
<br />
Don't forget to <tt>chmod a+x /etc/pm/sleep.d/10sysfsutils</tt>. Create a file called <tt>/usr/local/etc/F3507g</tt> containing the following:<br />
<br />
'''USB_ID="0bdb:1900"'''<br />
'''PIN=""'''<br />
'''APN="proxy"'''<br />
<br />
GPSDPID="/var/run/gpsd.pid"<br />
<br />
RFKILL_DEVICE=$(for n in /sys/devices/platform/thinkpad_acpi/rfkill/rfkill*; do if [ "$(cat $n/name)" = "tpacpi_wwan_sw" ]; then echo $n/state; fi; done)<br />
<br />
CONTROL_DEVICE () {<br />
echo /dev/$(for n in /sys/class/tty/ttyACM*/device/interface;do if [ "$(cat $n)" = "Ericsson F3507g Mobile Broadband Minicard Data Modem" ]; then echo $n|awk -F '/' '{print $5}'; fi; done)<br />
}<br />
<br />
GPS_DEVICE () {<br />
echo /dev/$(for n in /sys/class/tty/ttyACM*/device/interface;do if [ "$(cat $n)" = "Ericsson F3507g Mobile Broadband Minicard GPS Port" ]; then echo $n|awk -F '/' '{print $5}'; fi; done)<br />
}<br />
<br />
powerup_F3507g () {<br />
echo -n "Powering up F3507g card.."<br />
echo 1 > $RFKILL_DEVICE<br />
while [ -z "$(lsusb -d $USB_ID)" ]; do sleep 0.5; echo -n "."; done<br />
echo "done"<br />
echo -n "Turning on F3507g card..."<br />
sleep 3<br />
if [ -n "$PIN" ]; then<br />
/usr/sbin/chat -v "" "AT+CPIN?" "SIM PIN" "AT" "OK" "AT+CPIN=\"$PIN\"" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
fi<br />
/usr/sbin/chat -v "" "AT+CPIN?" "READY" "AT+CFUN=1" "+PACSP" "AT" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
echo "done"<br />
}<br />
<br />
powerdown_F3507g () {<br />
echo -n "Turning off F3507g card..."<br />
/usr/sbin/chat -v "" "AT+CFUN=4" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
echo "done"<br />
echo -n "Powering down F3507g card.."<br />
echo 0 > $RFKILL_DEVICE<br />
while [ -n "$(lsusb -d $USB_ID)" ]; do sleep 0.5; echo -n "."; done<br />
echo "done"<br />
}<br />
<br />
configure_GPS () {<br />
/usr/sbin/chat -v "" "AT*E2GPSCTL=$1,$2,$3" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
}<br />
<br />
turnon_GPS () {<br />
echo -n "Starting NMEA stream on $(GPS_DEVICE)..."<br />
configure_GPS 1 1 1<br />
sleep 1<br />
/usr/sbin/chat -v "" "AT*E2GPSNPD" "GPGGA" > $(GPS_DEVICE) < $(GPS_DEVICE)<br />
start-stop-daemon --start --exec /usr/sbin/gpsd -- -P $GPSDPID $(GPS_DEVICE)<br />
echo "done"<br />
}<br />
<br />
turnoff_GPS () {<br />
echo -n "Stopping NMEA stream on $(GPS_DEVICE)..."<br />
start-stop-daemon --stop --pidfile $GPSDPID<br />
configure_GPS 0 1 0<br />
echo "done"<br />
turnoff_F3507g<br />
}<br />
<br />
turnon_usbnet () {<br />
echo -n "Starting usbnet connection..."<br />
/usr/sbin/chat -v "" "AT+CGDCONT=1,\"IP\",\"$APN\"" "OK" "AT*ENAP=1,1" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
echo "done"<br />
}<br />
<br />
turnoff_usbnet () {<br />
echo -n "Stopping usbnet connection..."<br />
/usr/sbin/chat -v "" "AT*ENAP=0" "OK" > $(CONTROL_DEVICE) < $(CONTROL_DEVICE)<br />
echo "done"<br />
turnoff_F3507g<br />
}<br />
<br />
turnoff_F3507g () {<br />
[ -z $(grep gps /etc/network/run/ifstate) ] && \<br />
[ -z $(grep usb0 /etc/network/run/ifstate) ] && \<br />
[ -z $(grep 3G /etc/network/run/ifstate) ] && \<br />
ifdown F3507g<br />
}<br />
<br />
Give the correct '''USB_ID''' and '''PIN''', and find the '''APN''' for your wireless provider [http://www.pinstack.com/carrier_settings_apn_gateway.html here]. Append the following lines to your <tt>/etc/network/interfaces</tt> file<br />
<br />
iface F3507g inet manual<br />
up . /usr/local/etc/F3507g; powerup_F3507g<br />
down . /usr/local/etc/F3507g; powerdown_F3507g<br />
<br />
iface 3G inet wvdial<br />
pre-up ifup F3507g<br />
post-down . /usr/local/etc/F3507g; turnoff_F3507g<br />
provider 3G<br />
<br />
iface gps inet manual<br />
up . /usr/local/etc/F3507g; ifup F3507g; turnon_GPS<br />
down . /usr/local/etc/F3507g; turnoff_GPS<br />
<br />
iface usb0 inet dhcp<br />
pre-up . /usr/local/etc/F3507g; ifup F3507g; turnon_usbnet<br />
post-down . /usr/local/etc/F3507g; turnoff_usbnet<br />
<br />
Configure <tt>/etc/wvdial.conf</tt> to look like this:<br />
<br />
[Dialer 3G]<br />
Modem = /dev/ttyACM0<br />
Init1 = AT+CGDCONT=1,"IP","'''proxy'''"<br />
Stupid mode = 1<br />
phone= *99#<br />
Username = *<br />
Password = *<br />
<br />
'''Note''': you may need to change the access point name (APN) "'''proxy'''" in <tt>Init1</tt> string and Username/Password to something else. Find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here].<br />
<br />
Now broadband connection could be started in the same way as you start any other network interface, just by saying <tt>ifup usb0</tt> (or <tt>ifup 3G</tt>, if connecting via <tt>pppd</tt>). To shut it down, say <tt>ifdown usb0</tt> (or <tt>ifdown 3G</tt>). Similarly, GPS interface is started by <tt>ifup gps</tt> and turned off by <tt>ifdown gps</tt>. Once you get a fix, you can use your favourite GPS mapping application like [http://www.tangogps.org tangogps]. The "cold start" seems to take quite a bit however, and sometimes it cannot get a fix if indoors.<br />
<br />
==Using F3507g with NetworkManager==<br />
Work is ongoing to add support for Ericsson Mobile Broadband Modules to GNOME NetworkManager / modem-manager. More information is available on the [http://mbm.sourceforge.net/ MBM project website] and the [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=MBM MBM wiki].<br />
<br />
The F3507g card (in a ThinkPad {{T400s}}) works out of the box on Fedora 11. No configuration is needed beyond setting the data plan provider in the nm-applet GUI.<br />
<br />
Using mbm-gpsd gps works flawlessly with the F3507g on Karmic Koala with modemmanager packages from [https://launchpad.net/~modemmanager/+archive/ppa Ubuntu PPA], the mbm-gpsd installed by source using the description from [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=MBM#GPS_Control_.28mbm-gpsd.29 here] and knowing the PIN of your SIM card.<br />
<br />
== SMS with wammu/gammu ==<br />
You can use [http://wammu.eu/ Wammu] to receive SMS (and probably send SMS too).<br />
<br />
After installing wammu (with the usual <tt>aptitude install wammu</tt> or whatever), choose to configure it "Manually":<br />
port=/dev/ttyACM0<br />
connection=at19200<br />
<br />
(credits: [http://www.thinkpad-forum.de/thinkpad-software/linux-und-osx/p633662-sms-mit-der-ericsson-3507g/ linrunner])<br />
<br />
Sony Ericsson F3507g configuration [http://wammu.eu/phones/sony-ericsson/3568/ explained on wammu website]<br />
<br />
==Other thoughts==<br />
While <tt>AT+CFUN=*</tt> and <tt>AT+CPIN=*</tt> are pretty standard commands for wireless modems and are well-documented, it appears that the commands <tt>AT*E2GPSCTL</tt> and <tt>AT*E2GPSNPD</tt> are unique to the Ericsson F3507g card. All credit for discovering them goes to "Nickolai Zeldovich" who left a comment in this [http://redmonk.com/sogrady/2008/09/24/apone/ thread]. I imagine one could find them via a USB sniffer on a working Windows machine (or a Linux machine with Windows running in a virtual machine). Another way to get them is to try to look for "gps" string in Windows drivers. What is interesting, F3507g supports a few other AT-commands with "GPS" substring (you can get all supported AT-commands by sending <tt>AT*</tt> to <tt>/dev/ttyACM1</tt> after activating it with <tt>AT+CFUN=1</tt>). Anyway, there is a [http://www.natisbad.org/E4300/Dell_Wireless_5530_AT_cmd_ref.html project] aiming to document all AT-commands for the Ericsson F3507g card.<br />
<br />
==Related Links==<br />
*[http://www.ericsson.com/solutions/mobile_broadband_modules/docs/mobile_broadband_module_datasheet_print.pdf Ericsson Datasheet]<br />
*[http://www.natisbad.org/E4300/Dell_Wireless_5530_AT_cmd_ref.html F3705g - AT commands reference]<br />
*[http://www.pinstack.com/carrier_settings_apn_gateway.html Carrier internet Settings (Apn, Gateway, etc)]<br />
*[http://mbm.sourceforge.net/ MBM project website (Support for f3507g/f3607gw in NetworkManager, kernel drivers, gps control software etc)]<br />
<br />
==Bugs==<br />
* Ubuntu 8.10 kernel suffers from the "option" regression mentioned above. However both CDC ACM and CDC Ethernet interfaces are treated correctly by Ubuntu 9.04 kernel.<br />
* Playing around with the device under Linux can cause it to disappear under Windows Vista. Issue + Fix described [http://forums.lenovo.com/t5/T400-T500-and-newer-T-series/Ericsson-f3507g-doesn-t-appear-under-Vista32-anymore-but-works/m-p/138874 here]<br />
<br />
==ThinkPads this adapter may be found in==<br />
*{{SL300}}, {{SL400}}, {{SL500}}, {{SL510}}<br />
*{{T400}}, {{T400s}}, {{T500}}<br />
*{{W500}}<br />
*{{X200}}, {{X200 Tablet}}, {{X301}}</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Ericsson_F3507g_Mobile_Broadband_Module&diff=48334Ericsson F3507g Mobile Broadband Module2010-04-24T17:36:08Z<p>Newhren: for some SIM cards the answer is "+PACSP1"</p>
<hr />
<div>{| width="100%"<br />
|style="vertical-align:top" |<br />
<div style="margin: 0; margin-right:10px; border: 1px solid #dfdfdf; padding: 0em 1em 1em 1em; background-color:#F8F8FF; align:right;"><br />
=== Ericsson F3507g Mobile Broadband Module ===<br />
This is a Ericsson WWAN Adapter that is installed in a Mini-PCI Express slot<br />
<br />
{{NOTE|Specific versions of this card may come pre-configured for a certain carrier (AT&T)}}<br />
<br />
=== Features ===<br />
* Chipset: Ericsson F3507g<br />
* USB ID: 0bdb:1900<br />
* USB ID: 0bdb:1902<br />
* WCDMA 2100/1900/850MHz<br />
* GSM/GPRS/EDGE 850/900/1800/1900MHz<br />
* GPS<br />
* Download up to 7.2Mbps<br />
* Upload up to 2.0Mbps<br />
</div><br />
|style="vertical-align:top" |<br />
[[image:EriccsonWWAN.gif|thumb|Ericsson F3507g WWAN Adapter]]<br />
|}<br />
__TOC__<br />
<br />
== Lenovo Partnumbers ==<br />
* Option PN 43R9152 (AT&T)<br />
* FRU 43Y6537 (AT&T)<br />
* FRU 43Y6513 (Other)<br />
<br />
==Configuring the Ericsson F3507g in Ubuntu Intrepid linux (and later)==<br />
Please read this article, as it will show you step by step on how to set up the scripts necessary to make the card work. As of 9.10, the gnome network manager applet will allow you to successfully configure the card, however going into sleep mode will make it unavailable afterwards. These scripts will wake up the card.<br />
<br />
* [http://redmonk.com/sogrady/2008/12/07/how-to-use-an-att-ericsson-f3507g-card-on-ubuntu-intrepid/ How to use an att ericsson f3507g card on ubuntu intrepid]<br />
<br />
==Other options==<br />
<br />
Here are some basics about Ericsson F3507g MiniPCIe WWAN/GPS card (USB ID <tt>0bdb:1900</tt> and <tt>0bdb:1902</tt>):<br />
<br />
* the card will not work without an inserted SIM, even the GPS function. If you want to use just GPS, any SIM would work, even if it is not attached to any active account with any GSM provider.<br />
* the card provides three CDC ACM interfaces (<tt>CONFIG_USB_ACM=m</tt>), two CDC WDM interfaces (<tt>CONFIG_USB_WDM=m</tt>) and one CDC Ethernet interface (<tt>CONFIG_USB_NET_CDCETHER=m</tt>), and identifies them as<br />
for n in `ls /sys/class/*/*{ACM,wdm,usb0}*/device/interface`;do echo $(echo $n|awk -F '/' '{print $5}') : $(cat $n);done<br />
<br />
usb0 : Ericsson F3507g Mobile Broadband Minicard Network Adapter<br />
ttyACM0 : Ericsson F3507g Mobile Broadband Minicard Modem<br />
ttyACM1 : Ericsson F3507g Mobile Broadband Minicard Data Modem<br />
ttyACM2 : Ericsson F3507g Mobile Broadband Minicard GPS Port<br />
cdc-wdm0 : Ericsson F3507g Mobile Broadband Minicard Device Management<br />
cdc-wdm1 : Ericsson F3507g Mobile Broadband Minicard PC SC Port<br />
'''Note''':<br />
*apparently, for a while <tt>option</tt> USB-serial driver had claimed USB ID <tt>0bdb:1900</tt>, but this was wrong, and as of kernel 2.6.28.9 that commit was reversed. If instead of <tt>/dev/ttyACM*</tt> you see <tt>/dev/ttyUSB*</tt>, it means that <tt>option</tt> module is loaded. You may need to blacklist it to make sure it doesn't happen.<br />
*Support for the CDC Ethernet interface appears only in kernel 2.6.28.8. But if your kernel is older, you can still connect to the net using one of the "Modem" interfaces.<br />
<br />
As Ericsson's naming scheme suggests, idealy we would use <tt>/dev/cdc-wdm0</tt> for controlling the card, <tt>usb0</tt> as a network device, <tt>/dev/ttyACM0</tt> or <tt>/dev/ttyACM1</tt> as a modem, and <tt>/dev/ttyACM2</tt> for GPS. This works for manual testing, but unfortunately, due to [http://markmail.org/message/2sd7culbgekugow2 limitations] of <tt>chat</tt>, does not play very well in scripts. So, instead of <tt>/dev/cdc-wdm0</tt>, for controlling the card we will use <tt>/dev/ttyACM1</tt>.<br />
<br />
==Turning the card on==<br />
First, check whenever the SIM is protected by PIN by sending <br />
<br />
AT+CPIN?<br />
<br />
to <tt>/dev/ttyACM1</tt>. You can do it with any terminal terminal program like <tt>cu</tt> or <tt>minicom</tt>. If the answer is<br />
<br />
+CPIN: READY<br />
<br />
then the SIM is unlocked. If the answer is<br />
<br />
+CPIN: SIM PIN<br />
<br />
you need first to unlock it by sending<br />
<br />
AT+CPIN="YOUR-PIN"<br />
<br />
to <tt>/dev/ttyACM1</tt>. Now the card can be turned on by sending <br />
<br />
AT+CFUN=1<br />
<br />
to <tt>/dev/ttyACM1</tt>. The answer should be<br />
<br />
+PACSP0<br />
<br />
Don't try to do anything until you see it. To force GSM-only connection, send<br />
<br />
AT+CFUN=5<br />
<br />
to <tt>/dev/ttyACM1</tt>. To force WCDMA-only connection, send<br />
<br />
AT+CFUN=6<br />
<br />
to <tt>/dev/ttyACM1</tt>.<br />
<br />
==Turning the card off==<br />
To put the card into energy-saving mode (this is the default), you can send<br />
<br />
AT+CFUN=4<br />
<br />
to <tt>/dev/ttyACM1</tt>. To remove all power from the card, send<br />
<br />
AT+CFUN=0<br />
<br />
to <tt>/dev/ttyACM1</tt>. Be carefull with the last command. It turns the card completely off, and it will no longer accept any AT-commands before the hard reset. To physically reset the card flip the wireless switch off, and then on. You can do the same by sending <tt>echo 0 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state</tt> (to turn off) and then <tt>echo 1 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state</tt> (to turn on).<br />
<br />
==Using the card as a wireless modem==<br />
Once the card is turned on, there are two ways to connect to the net. The first one is just to use the card as any "normal" GPRS modem and start <tt>pppd</tt> daemon on one of <tt>/dev/ttyACM*</tt>. The other way is to use CDC Ethernet interface. It is supposed to be more efficient, but it requires a pretty recent (>=2.6.28.8) kernel.<br />
<br />
====Connecting to the net via pppd====<br />
For the first approach, the easiest way to do it is to use <tt>wvdial</tt>. For example, to connect to AT&T Wireless network, your <tt>/etc/wvdial.conf</tt> would have to be something like this<br />
[Dialer 3G]<br />
Modem = /dev/ttyACM0<br />
Init1 = AT+CGDCONT=1,"IP","'''proxy'''"<br />
Stupid mode = 1<br />
phone= *99#<br />
Username = *<br />
Password = *<br />
'''Note''': if you are using a SIM from a different mobile provider, you may need to change the access point name (APN) "'''proxy'''" in <tt>Init1</tt> string and Username/Password to something else. You can find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here].<br />
<br />
====Connecting to the net via CDC Ethernet interface====<br />
The [http://marc.info/?l=linux-usb&m=123334979706403&w=2 second approach] works for kernels >=2.6.28.8. Configure the APN by sending<br />
<br />
AT+CGDCONT=1,"IP","'''proxy'''"<br />
<br />
to <tt>/dev/ttyACM1</tt>. Instead of "'''proxy'''" you may need to use to something else. Find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here]. To initiate the connection, send<br />
<br />
AT*ENAP=1,1<br />
<br />
to <tt>/dev/ttyACM1</tt>. Now, if your wireless provider lets you in, you are connected. Launch <tt>dhclient</tt><br />
<br />
dhclient usb0<br />
<br />
and start surfing the net. To disconnect, send<br />
<br />
AT*ENAP=0<br />
<br />
to <tt>/dev/ttyACM1</tt>.<br />
<br />
==Using the card as a GPS receiver==<br />
Once the card is turned on, we can use it to get GPS info via NMEA protocol. First, you have to configure the a few NMEA options. It is done by sending <br />
<br />
AT*E2GPSCTL=X,Y,Z<br />
<br />
to <tt>/dev/ttyACM1</tt>. Here<br />
<br />
*X can be 0 (NMEA stream turned off) or 1 (NMEA stream turned on)<br />
*Y can be an integer form 1 to 60, and sets the frequency of how often the card emits the NMEA sentences<br />
*Z can be 0 (DGPS is turned off) or 1 (DGPS is turned on)<br />
<br />
so, to configure the GPSr to update every 5 seconds, and turn DGPS on, you would send<br />
<br />
AT*E2GPSCTL=1,5,1<br />
<br />
to <tt>/dev/ttyACM1</tt>. Once the GPSr is configured, we can get the NMEA stream on /dev/ttyACM2 by sending<br />
<br />
AT*E2GPSNPD<br />
<br />
to <tt>/dev/ttyACM2</tt>. Once you do that, <tt>/dev/ttyACM2</tt> will no longer accept any new AT-commands. But you still can change the the behavior of the NMEA stream by sending the appropriate<br />
<br />
AT*E2GPSCTL=X,Y,Z<br />
<br />
to <tt>/dev/ttyACM1</tt>. Now you can read the NMEA stream by saying<br />
<br />
cat /dev/ttyACM2<br />
<br />
or better yet, start <tt>gpsd</tt> interface on <tt>/dev/ttyACM2</tt>.<br />
<br />
Note: There is a now a sourceforge project dedicated to the Ericsson Mobile Broadband modules. Gps control sw that does the above automatically is available and also a graphical user interface. Details are available on the [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=Main_Page#GPS_Control_.28mbm-gpsd.29 MBM Wiki].<br />
<br />
==Scripting everything==<br />
Install the packages<br />
<br />
apt-get install sysfsutils gpsd wvdial<br />
<br />
In order to save the power, let us use '''sysfsutils''' to completely power off the WWAN card on boot. Append the following line to <tt>/etc/sysfs.conf</tt><br />
<br />
devices/platform/thinkpad_acpi/rfkill/rfkill0/state = 0<br />
<br />
It will power down the card on boot, but when the laptop wakes from sleep, in some cases the card is powered up again. To re-apply these settings on wake-up, create a script named <tt>/etc/pm/sleep.d/10sysfsutils</tt>:<br />
<br />
#!/bin/sh<br />
case $1 in<br />
(hibernate|suspend)<br />
;;<br />
(thaw|resume)<br />
/etc/init.d/sysfsutils start<br />
;;<br />
*) echo "somebody is calling me totally wrong."<br />
;;<br />
esac<br />
<br />
Don't forget to <tt>chmod a+x /etc/pm/sleep.d/10sysfsutils</tt>. Create a file called <tt>/usr/local/etc/F3507g</tt> containing the following:<br />
<br />
GPSDPID="/var/run/gpsd.pid"<br />
CONTROL_DEVICE=/dev/ttyACM1<br />
GPS_DEVICE=/dev/ttyACM2<br />
RFKILL_DEVICE=$(for n in /sys/devices/platform/thinkpad_acpi/rfkill/rfkill*; do if [ "`cat $n/name`" = "tpacpi_wwan_sw" ]; then echo $n/state; fi; done)<br />
'''PIN=""'''<br />
'''APN="proxy"'''<br />
<br />
powerup_F3507g () {<br />
echo -n "Powering up F3507g card.."<br />
echo 1 > $RFKILL_DEVICE<br />
while [ ! -c $CONTROL_DEVICE ]; do sleep 0.5; echo -n "."; done<br />
echo "done"<br />
echo -n "Turning on F3507g card..."<br />
sleep 3<br />
if [ -n "$PIN" ]; then<br />
/usr/sbin/chat -v "" "AT+CPIN?" "SIM PIN" "AT" "OK" "AT+CPIN=\"$PIN\"" "OK" > $CONTROL_DEVICE < $CONTROL_DEVICE<br />
fi<br />
/usr/sbin/chat -v "" "AT+CPIN?" "READY" "AT+CFUN=1" "+PACSP" "AT" "OK" > $CONTROL_DEVICE < $CONTROL_DEVICE<br />
echo "done"<br />
}<br />
<br />
powerdown_F3507g () {<br />
echo -n "Turning off F3507g card..."<br />
/usr/sbin/chat -v "" "AT+CFUN=4" "OK" > $CONTROL_DEVICE < $CONTROL_DEVICE<br />
echo "done"<br />
echo -n "Powering down F3507g card.."<br />
echo 0 > $RFKILL_DEVICE<br />
while [ -c $CONTROL_DEVICE ]; do sleep 0.5; echo -n "."; done<br />
echo "done"<br />
}<br />
<br />
configure_GPS () {<br />
/usr/sbin/chat -v "" "AT*E2GPSCTL=$1,$2,$3" "OK" > $CONTROL_DEVICE < $CONTROL_DEVICE<br />
}<br />
<br />
turnon_GPS () {<br />
echo -n "Starting NMEA stream on $GPS_DEVICE..."<br />
configure_GPS 1 1 1<br />
sleep 1<br />
/usr/sbin/chat -v "" "AT*E2GPSNPD" "GPGGA" > $GPS_DEVICE < $GPS_DEVICE<br />
start-stop-daemon --start --exec /usr/sbin/gpsd -- -P $GPSDPID $GPS_DEVICE<br />
echo "done"<br />
}<br />
<br />
turnoff_GPS () {<br />
echo -n "Stopping NMEA stream on $GPS_DEVICE..."<br />
start-stop-daemon --stop --pidfile $GPSDPID<br />
configure_GPS 0 1 0<br />
echo "done"<br />
turnoff_F3507g<br />
}<br />
<br />
turnon_usbnet () {<br />
echo -n "Starting usbnet connection..."<br />
/usr/sbin/chat -v "" "AT+CGDCONT=1,\"IP\",\"$APN\"" "OK" "AT*ENAP=1,1" "OK" > $CONTROL_DEVICE < $CONTROL_DEVICE<br />
echo "done"<br />
}<br />
<br />
turnoff_usbnet () {<br />
echo -n "Stopping usbnet connection..."<br />
/usr/sbin/chat -v "" "AT*ENAP=0" "OK" > $CONTROL_DEVICE < $CONTROL_DEVICE<br />
echo "done"<br />
turnoff_F3507g<br />
}<br />
<br />
turnoff_F3507g () {<br />
[ -z $(grep gps /etc/network/run/ifstate) ] && \<br />
[ -z $(grep usb0 /etc/network/run/ifstate) ] && \<br />
[ -z $(grep 3G /etc/network/run/ifstate) ] && \<br />
ifdown F3507g<br />
}<br />
<br />
Give the correct '''PIN''' and find the '''APN''' for your wireless provider [http://www.pinstack.com/carrier_settings_apn_gateway.html here]. Append the following lines to your <tt>/etc/network/interfaces</tt> file<br />
<br />
iface F3507g inet manual<br />
up . /usr/local/etc/F3507g; powerup_F3507g<br />
down . /usr/local/etc/F3507g; powerdown_F3507g<br />
<br />
iface 3G inet wvdial<br />
pre-up ifup F3507g<br />
post-down . /usr/local/etc/F3507g; turnoff_F3507g<br />
provider 3G<br />
<br />
iface gps inet manual<br />
up . /usr/local/etc/F3507g; ifup F3507g; turnon_GPS<br />
down . /usr/local/etc/F3507g; turnoff_GPS<br />
<br />
iface usb0 inet dhcp<br />
pre-up . /usr/local/etc/F3507g; ifup F3507g; turnon_usbnet<br />
post-down . /usr/local/etc/F3507g; turnoff_usbnet<br />
<br />
Configure <tt>/etc/wvdial.conf</tt> to look like this:<br />
<br />
[Dialer 3G]<br />
Modem = /dev/ttyACM0<br />
Init1 = AT+CGDCONT=1,"IP","'''proxy'''"<br />
Stupid mode = 1<br />
phone= *99#<br />
Username = *<br />
Password = *<br />
<br />
'''Note''': you may need to change the access point name (APN) "'''proxy'''" in <tt>Init1</tt> string and Username/Password to something else. Find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here].<br />
<br />
Now broadband connection could be started in the same way as you start any other network interface, just by saying <tt>ifup usb0</tt> (or <tt>ifup 3G</tt>, if connecting via <tt>pppd</tt>). To shut it down, say <tt>ifdown usb0</tt> (or <tt>ifdown 3G</tt>). Similarly, GPS interface is started by <tt>ifup gps</tt> and turned off by <tt>ifdown gps</tt>. Once you get a fix, you can use your favourite GPS mapping application like [http://www.tangogps.org tangogps]. The "cold start" seems to take quite a bit however, and sometimes it cannot get a fix if indoors.<br />
<br />
==Using F3507g with NetworkManager==<br />
Work is ongoing to add support for Ericsson Mobile Broadband Modules to GNOME NetworkManager / modem-manager. More information is available on the [http://mbm.sourceforge.net/ MBM project website] and the [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=MBM MBM wiki].<br />
<br />
The F3507g card (in a ThinkPad {{T400s}}) works out of the box on Fedora 11. No configuration is needed beyond setting the data plan provider in the nm-applet GUI.<br />
<br />
Using mbm-gpsd gps works flawlessly with the F3507g on Karmic Koala with modemmanager packages from [https://launchpad.net/~modemmanager/+archive/ppa Ubuntu PPA], the mbm-gpsd installed by source using the description from [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=MBM#GPS_Control_.28mbm-gpsd.29 here] and knowing the PIN of your SIM card.<br />
<br />
== SMS with wammu/gammu ==<br />
You can use [http://wammu.eu/ Wammu] to receive SMS (and probably send SMS too).<br />
<br />
After installing wammu (with the usual <tt>aptitude install wammu</tt> or whatever), choose to configure it "Manually":<br />
port=/dev/ttyACM0<br />
connection=at19200<br />
<br />
(credits: [http://www.thinkpad-forum.de/thinkpad-software/linux-und-osx/p633662-sms-mit-der-ericsson-3507g/ linrunner])<br />
<br />
Sony Ericsson F3507g configuration [http://wammu.eu/phones/sony-ericsson/3568/ explained on wammu website]<br />
<br />
==Other thoughts==<br />
While <tt>AT+CFUN=*</tt> and <tt>AT+CPIN=*</tt> are pretty standard commands for wireless modems and are well-documented, it appears that the commands <tt>AT*E2GPSCTL</tt> and <tt>AT*E2GPSNPD</tt> are unique to the Ericsson F3507g card. All credit for discovering them goes to "Nickolai Zeldovich" who left a comment in this [http://redmonk.com/sogrady/2008/09/24/apone/ thread]. I imagine one could find them via a USB sniffer on a working Windows machine (or a Linux machine with Windows running in a virtual machine). Another way to get them is to try to look for "gps" string in Windows drivers. What is interesting, F3507g supports a few other AT-commands with "GPS" substring (you can get all supported AT-commands by sending <tt>AT*</tt> to <tt>/dev/ttyACM1</tt> after activating it with <tt>AT+CFUN=1</tt>). Anyway, there is a [http://www.natisbad.org/E4300/Dell_Wireless_5530_AT_cmd_ref.html project] aiming to document all AT-commands for the Ericsson F3507g card.<br />
<br />
==Related Links==<br />
*[http://www.ericsson.com/solutions/mobile_broadband_modules/docs/mobile_broadband_module_datasheet_print.pdf Ericsson Datasheet]<br />
*[http://www.natisbad.org/E4300/Dell_Wireless_5530_AT_cmd_ref.html F3705g - AT commands reference]<br />
*[http://www.pinstack.com/carrier_settings_apn_gateway.html Carrier internet Settings (Apn, Gateway, etc)]<br />
*[http://mbm.sourceforge.net/ MBM project website (Support for f3507g/f3607gw in NetworkManager, kernel drivers, gps control software etc)]<br />
<br />
==Bugs==<br />
* Ubuntu 8.10 kernel suffers from the "option" regression mentioned above. However both CDC ACM and CDC Ethernet interfaces are treated correctly by Ubuntu 9.04 kernel.<br />
* Playing around with the device under Linux can cause it to disappear under Windows Vista. Issue + Fix described [http://forums.lenovo.com/t5/T400-T500-and-newer-T-series/Ericsson-f3507g-doesn-t-appear-under-Vista32-anymore-but-works/m-p/138874 here]<br />
<br />
==ThinkPads this adapter may be found in==<br />
*{{SL300}}, {{SL400}}, {{SL500}}, {{SL510}}<br />
*{{T400}}, {{T400s}}, {{T500}}<br />
*{{W500}}<br />
*{{X200}}, {{X200 Tablet}}, {{X301}}</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Ericsson_F3507g_Mobile_Broadband_Module&diff=48333Ericsson F3507g Mobile Broadband Module2010-04-24T17:28:53Z<p>Newhren: it would have been nice to have something like that, but ttyACM* devices do not exist before we turn the card on, so I reverse this patch</p>
<hr />
<div>{| width="100%"<br />
|style="vertical-align:top" |<br />
<div style="margin: 0; margin-right:10px; border: 1px solid #dfdfdf; padding: 0em 1em 1em 1em; background-color:#F8F8FF; align:right;"><br />
=== Ericsson F3507g Mobile Broadband Module ===<br />
This is a Ericsson WWAN Adapter that is installed in a Mini-PCI Express slot<br />
<br />
{{NOTE|Specific versions of this card may come pre-configured for a certain carrier (AT&T)}}<br />
<br />
=== Features ===<br />
* Chipset: Ericsson F3507g<br />
* USB ID: 0bdb:1900<br />
* USB ID: 0bdb:1902<br />
* WCDMA 2100/1900/850MHz<br />
* GSM/GPRS/EDGE 850/900/1800/1900MHz<br />
* GPS<br />
* Download up to 7.2Mbps<br />
* Upload up to 2.0Mbps<br />
</div><br />
|style="vertical-align:top" |<br />
[[image:EriccsonWWAN.gif|thumb|Ericsson F3507g WWAN Adapter]]<br />
|}<br />
__TOC__<br />
<br />
== Lenovo Partnumbers ==<br />
* Option PN 43R9152 (AT&T)<br />
* FRU 43Y6537 (AT&T)<br />
* FRU 43Y6513 (Other)<br />
<br />
==Configuring the Ericsson F3507g in Ubuntu Intrepid linux (and later)==<br />
Please read this article, as it will show you step by step on how to set up the scripts necessary to make the card work. As of 9.10, the gnome network manager applet will allow you to successfully configure the card, however going into sleep mode will make it unavailable afterwards. These scripts will wake up the card.<br />
<br />
* [http://redmonk.com/sogrady/2008/12/07/how-to-use-an-att-ericsson-f3507g-card-on-ubuntu-intrepid/ How to use an att ericsson f3507g card on ubuntu intrepid]<br />
<br />
==Other options==<br />
<br />
Here are some basics about Ericsson F3507g MiniPCIe WWAN/GPS card (USB ID <tt>0bdb:1900</tt> and <tt>0bdb:1902</tt>):<br />
<br />
* the card will not work without an inserted SIM, even the GPS function. If you want to use just GPS, any SIM would work, even if it is not attached to any active account with any GSM provider.<br />
* the card provides three CDC ACM interfaces (<tt>CONFIG_USB_ACM=m</tt>), two CDC WDM interfaces (<tt>CONFIG_USB_WDM=m</tt>) and one CDC Ethernet interface (<tt>CONFIG_USB_NET_CDCETHER=m</tt>), and identifies them as<br />
for n in `ls /sys/class/*/*{ACM,wdm,usb0}*/device/interface`;do echo $(echo $n|awk -F '/' '{print $5}') : $(cat $n);done<br />
<br />
usb0 : Ericsson F3507g Mobile Broadband Minicard Network Adapter<br />
ttyACM0 : Ericsson F3507g Mobile Broadband Minicard Modem<br />
ttyACM1 : Ericsson F3507g Mobile Broadband Minicard Data Modem<br />
ttyACM2 : Ericsson F3507g Mobile Broadband Minicard GPS Port<br />
cdc-wdm0 : Ericsson F3507g Mobile Broadband Minicard Device Management<br />
cdc-wdm1 : Ericsson F3507g Mobile Broadband Minicard PC SC Port<br />
'''Note''':<br />
*apparently, for a while <tt>option</tt> USB-serial driver had claimed USB ID <tt>0bdb:1900</tt>, but this was wrong, and as of kernel 2.6.28.9 that commit was reversed. If instead of <tt>/dev/ttyACM*</tt> you see <tt>/dev/ttyUSB*</tt>, it means that <tt>option</tt> module is loaded. You may need to blacklist it to make sure it doesn't happen.<br />
*Support for the CDC Ethernet interface appears only in kernel 2.6.28.8. But if your kernel is older, you can still connect to the net using one of the "Modem" interfaces.<br />
<br />
As Ericsson's naming scheme suggests, idealy we would use <tt>/dev/cdc-wdm0</tt> for controlling the card, <tt>usb0</tt> as a network device, <tt>/dev/ttyACM0</tt> or <tt>/dev/ttyACM1</tt> as a modem, and <tt>/dev/ttyACM2</tt> for GPS. This works for manual testing, but unfortunately, due to [http://markmail.org/message/2sd7culbgekugow2 limitations] of <tt>chat</tt>, does not play very well in scripts. So, instead of <tt>/dev/cdc-wdm0</tt>, for controlling the card we will use <tt>/dev/ttyACM1</tt>.<br />
<br />
==Turning the card on==<br />
First, check whenever the SIM is protected by PIN by sending <br />
<br />
AT+CPIN?<br />
<br />
to <tt>/dev/ttyACM1</tt>. You can do it with any terminal terminal program like <tt>cu</tt> or <tt>minicom</tt>. If the answer is<br />
<br />
+CPIN: READY<br />
<br />
then the SIM is unlocked. If the answer is<br />
<br />
+CPIN: SIM PIN<br />
<br />
you need first to unlock it by sending<br />
<br />
AT+CPIN="YOUR-PIN"<br />
<br />
to <tt>/dev/ttyACM1</tt>. Now the card can be turned on by sending <br />
<br />
AT+CFUN=1<br />
<br />
to <tt>/dev/ttyACM1</tt>. The answer should be<br />
<br />
+PACSP0<br />
<br />
Don't try to do anything until you see it. To force GSM-only connection, send<br />
<br />
AT+CFUN=5<br />
<br />
to <tt>/dev/ttyACM1</tt>. To force WCDMA-only connection, send<br />
<br />
AT+CFUN=6<br />
<br />
to <tt>/dev/ttyACM1</tt>.<br />
<br />
==Turning the card off==<br />
To put the card into energy-saving mode (this is the default), you can send<br />
<br />
AT+CFUN=4<br />
<br />
to <tt>/dev/ttyACM1</tt>. To remove all power from the card, send<br />
<br />
AT+CFUN=0<br />
<br />
to <tt>/dev/ttyACM1</tt>. Be carefull with the last command. It turns the card completely off, and it will no longer accept any AT-commands before the hard reset. To physically reset the card flip the wireless switch off, and then on. You can do the same by sending <tt>echo 0 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state</tt> (to turn off) and then <tt>echo 1 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state</tt> (to turn on).<br />
<br />
==Using the card as a wireless modem==<br />
Once the card is turned on, there are two ways to connect to the net. The first one is just to use the card as any "normal" GPRS modem and start <tt>pppd</tt> daemon on one of <tt>/dev/ttyACM*</tt>. The other way is to use CDC Ethernet interface. It is supposed to be more efficient, but it requires a pretty recent (>=2.6.28.8) kernel.<br />
<br />
====Connecting to the net via pppd====<br />
For the first approach, the easiest way to do it is to use <tt>wvdial</tt>. For example, to connect to AT&T Wireless network, your <tt>/etc/wvdial.conf</tt> would have to be something like this<br />
[Dialer 3G]<br />
Modem = /dev/ttyACM0<br />
Init1 = AT+CGDCONT=1,"IP","'''proxy'''"<br />
Stupid mode = 1<br />
phone= *99#<br />
Username = *<br />
Password = *<br />
'''Note''': if you are using a SIM from a different mobile provider, you may need to change the access point name (APN) "'''proxy'''" in <tt>Init1</tt> string and Username/Password to something else. You can find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here].<br />
<br />
====Connecting to the net via CDC Ethernet interface====<br />
The [http://marc.info/?l=linux-usb&m=123334979706403&w=2 second approach] works for kernels >=2.6.28.8. Configure the APN by sending<br />
<br />
AT+CGDCONT=1,"IP","'''proxy'''"<br />
<br />
to <tt>/dev/ttyACM1</tt>. Instead of "'''proxy'''" you may need to use to something else. Find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here]. To initiate the connection, send<br />
<br />
AT*ENAP=1,1<br />
<br />
to <tt>/dev/ttyACM1</tt>. Now, if your wireless provider lets you in, you are connected. Launch <tt>dhclient</tt><br />
<br />
dhclient usb0<br />
<br />
and start surfing the net. To disconnect, send<br />
<br />
AT*ENAP=0<br />
<br />
to <tt>/dev/ttyACM1</tt>.<br />
<br />
==Using the card as a GPS receiver==<br />
Once the card is turned on, we can use it to get GPS info via NMEA protocol. First, you have to configure the a few NMEA options. It is done by sending <br />
<br />
AT*E2GPSCTL=X,Y,Z<br />
<br />
to <tt>/dev/ttyACM1</tt>. Here<br />
<br />
*X can be 0 (NMEA stream turned off) or 1 (NMEA stream turned on)<br />
*Y can be an integer form 1 to 60, and sets the frequency of how often the card emits the NMEA sentences<br />
*Z can be 0 (DGPS is turned off) or 1 (DGPS is turned on)<br />
<br />
so, to configure the GPSr to update every 5 seconds, and turn DGPS on, you would send<br />
<br />
AT*E2GPSCTL=1,5,1<br />
<br />
to <tt>/dev/ttyACM1</tt>. Once the GPSr is configured, we can get the NMEA stream on /dev/ttyACM2 by sending<br />
<br />
AT*E2GPSNPD<br />
<br />
to <tt>/dev/ttyACM2</tt>. Once you do that, <tt>/dev/ttyACM2</tt> will no longer accept any new AT-commands. But you still can change the the behavior of the NMEA stream by sending the appropriate<br />
<br />
AT*E2GPSCTL=X,Y,Z<br />
<br />
to <tt>/dev/ttyACM1</tt>. Now you can read the NMEA stream by saying<br />
<br />
cat /dev/ttyACM2<br />
<br />
or better yet, start <tt>gpsd</tt> interface on <tt>/dev/ttyACM2</tt>.<br />
<br />
Note: There is a now a sourceforge project dedicated to the Ericsson Mobile Broadband modules. Gps control sw that does the above automatically is available and also a graphical user interface. Details are available on the [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=Main_Page#GPS_Control_.28mbm-gpsd.29 MBM Wiki].<br />
<br />
==Scripting everything==<br />
Install the packages<br />
<br />
apt-get install sysfsutils gpsd wvdial<br />
<br />
In order to save the power, let us use '''sysfsutils''' to completely power off the WWAN card on boot. Append the following line to <tt>/etc/sysfs.conf</tt><br />
<br />
devices/platform/thinkpad_acpi/rfkill/rfkill0/state = 0<br />
<br />
It will power down the card on boot, but when the laptop wakes from sleep, in some cases the card is powered up again. To re-apply these settings on wake-up, create a script named <tt>/etc/pm/sleep.d/10sysfsutils</tt>:<br />
<br />
#!/bin/sh<br />
case $1 in<br />
(hibernate|suspend)<br />
;;<br />
(thaw|resume)<br />
/etc/init.d/sysfsutils start<br />
;;<br />
*) echo "somebody is calling me totally wrong."<br />
;;<br />
esac<br />
<br />
Don't forget to <tt>chmod a+x /etc/pm/sleep.d/10sysfsutils</tt>. Create a file called <tt>/usr/local/etc/F3507g</tt> containing the following:<br />
<br />
GPSDPID="/var/run/gpsd.pid"<br />
CONTROL_DEVICE=/dev/ttyACM1<br />
GPS_DEVICE=/dev/ttyACM2<br />
RFKILL_DEVICE=$(for n in /sys/devices/platform/thinkpad_acpi/rfkill/rfkill*; do if [ "`cat $n/name`" = "tpacpi_wwan_sw" ]; then echo $n/state; fi; done)<br />
'''PIN=""'''<br />
'''APN="proxy"'''<br />
<br />
powerup_F3507g () {<br />
echo -n "Powering up F3507g card.."<br />
echo 1 > $RFKILL_DEVICE<br />
while [ ! -c $CONTROL_DEVICE ]; do sleep 0.5; echo -n "."; done<br />
echo "done"<br />
echo -n "Turning on F3507g card..."<br />
sleep 3<br />
if [ -n "$PIN" ]; then<br />
/usr/sbin/chat -v "" "AT+CPIN?" "SIM PIN" "AT" "OK" "AT+CPIN=\"$PIN\"" "OK" > $CONTROL_DEVICE < $CONTROL_DEVICE<br />
fi<br />
/usr/sbin/chat -v "" "AT+CPIN?" "READY" "AT+CFUN=1" "+PACSP0" "AT" "OK" > $CONTROL_DEVICE < $CONTROL_DEVICE<br />
echo "done"<br />
}<br />
<br />
powerdown_F3507g () {<br />
echo -n "Turning off F3507g card..."<br />
/usr/sbin/chat -v "" "AT+CFUN=4" "OK" > $CONTROL_DEVICE < $CONTROL_DEVICE<br />
echo "done"<br />
echo -n "Powering down F3507g card.."<br />
echo 0 > $RFKILL_DEVICE<br />
while [ -c $CONTROL_DEVICE ]; do sleep 0.5; echo -n "."; done<br />
echo "done"<br />
}<br />
<br />
configure_GPS () {<br />
/usr/sbin/chat -v "" "AT*E2GPSCTL=$1,$2,$3" "OK" > $CONTROL_DEVICE < $CONTROL_DEVICE<br />
}<br />
<br />
turnon_GPS () {<br />
echo -n "Starting NMEA stream on $GPS_DEVICE..."<br />
configure_GPS 1 1 1<br />
sleep 1<br />
/usr/sbin/chat -v "" "AT*E2GPSNPD" "GPGGA" > $GPS_DEVICE < $GPS_DEVICE<br />
start-stop-daemon --start --exec /usr/sbin/gpsd -- -P $GPSDPID $GPS_DEVICE<br />
echo "done"<br />
}<br />
<br />
turnoff_GPS () {<br />
echo -n "Stopping NMEA stream on $GPS_DEVICE..."<br />
start-stop-daemon --stop --pidfile $GPSDPID<br />
configure_GPS 0 1 0<br />
echo "done"<br />
turnoff_F3507g<br />
}<br />
<br />
turnon_usbnet () {<br />
echo -n "Starting usbnet connection..."<br />
/usr/sbin/chat -v "" "AT+CGDCONT=1,\"IP\",\"$APN\"" "OK" "AT*ENAP=1,1" "OK" > $CONTROL_DEVICE < $CONTROL_DEVICE<br />
echo "done"<br />
}<br />
<br />
turnoff_usbnet () {<br />
echo -n "Stopping usbnet connection..."<br />
/usr/sbin/chat -v "" "AT*ENAP=0" "OK" > $CONTROL_DEVICE < $CONTROL_DEVICE<br />
echo "done"<br />
turnoff_F3507g<br />
}<br />
<br />
turnoff_F3507g () {<br />
[ -z $(grep gps /etc/network/run/ifstate) ] && \<br />
[ -z $(grep usb0 /etc/network/run/ifstate) ] && \<br />
[ -z $(grep 3G /etc/network/run/ifstate) ] && \<br />
ifdown F3507g<br />
}<br />
<br />
Give the correct '''PIN''' and find the '''APN''' for your wireless provider [http://www.pinstack.com/carrier_settings_apn_gateway.html here]. Append the following lines to your <tt>/etc/network/interfaces</tt> file<br />
<br />
iface F3507g inet manual<br />
up . /usr/local/etc/F3507g; powerup_F3507g<br />
down . /usr/local/etc/F3507g; powerdown_F3507g<br />
<br />
iface 3G inet wvdial<br />
pre-up ifup F3507g<br />
post-down . /usr/local/etc/F3507g; turnoff_F3507g<br />
provider 3G<br />
<br />
iface gps inet manual<br />
up . /usr/local/etc/F3507g; ifup F3507g; turnon_GPS<br />
down . /usr/local/etc/F3507g; turnoff_GPS<br />
<br />
iface usb0 inet dhcp<br />
pre-up . /usr/local/etc/F3507g; ifup F3507g; turnon_usbnet<br />
post-down . /usr/local/etc/F3507g; turnoff_usbnet<br />
<br />
Configure <tt>/etc/wvdial.conf</tt> to look like this:<br />
<br />
[Dialer 3G]<br />
Modem = /dev/ttyACM0<br />
Init1 = AT+CGDCONT=1,"IP","'''proxy'''"<br />
Stupid mode = 1<br />
phone= *99#<br />
Username = *<br />
Password = *<br />
<br />
'''Note''': you may need to change the access point name (APN) "'''proxy'''" in <tt>Init1</tt> string and Username/Password to something else. Find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here].<br />
<br />
Now broadband connection could be started in the same way as you start any other network interface, just by saying <tt>ifup usb0</tt> (or <tt>ifup 3G</tt>, if connecting via <tt>pppd</tt>). To shut it down, say <tt>ifdown usb0</tt> (or <tt>ifdown 3G</tt>). Similarly, GPS interface is started by <tt>ifup gps</tt> and turned off by <tt>ifdown gps</tt>. Once you get a fix, you can use your favourite GPS mapping application like [http://www.tangogps.org tangogps]. The "cold start" seems to take quite a bit however, and sometimes it cannot get a fix if indoors.<br />
<br />
==Using F3507g with NetworkManager==<br />
Work is ongoing to add support for Ericsson Mobile Broadband Modules to GNOME NetworkManager / modem-manager. More information is available on the [http://mbm.sourceforge.net/ MBM project website] and the [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=MBM MBM wiki].<br />
<br />
The F3507g card (in a ThinkPad {{T400s}}) works out of the box on Fedora 11. No configuration is needed beyond setting the data plan provider in the nm-applet GUI.<br />
<br />
Using mbm-gpsd gps works flawlessly with the F3507g on Karmic Koala with modemmanager packages from [https://launchpad.net/~modemmanager/+archive/ppa Ubuntu PPA], the mbm-gpsd installed by source using the description from [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=MBM#GPS_Control_.28mbm-gpsd.29 here] and knowing the PIN of your SIM card.<br />
<br />
== SMS with wammu/gammu ==<br />
You can use [http://wammu.eu/ Wammu] to receive SMS (and probably send SMS too).<br />
<br />
After installing wammu (with the usual <tt>aptitude install wammu</tt> or whatever), choose to configure it "Manually":<br />
port=/dev/ttyACM0<br />
connection=at19200<br />
<br />
(credits: [http://www.thinkpad-forum.de/thinkpad-software/linux-und-osx/p633662-sms-mit-der-ericsson-3507g/ linrunner])<br />
<br />
Sony Ericsson F3507g configuration [http://wammu.eu/phones/sony-ericsson/3568/ explained on wammu website]<br />
<br />
==Other thoughts==<br />
While <tt>AT+CFUN=*</tt> and <tt>AT+CPIN=*</tt> are pretty standard commands for wireless modems and are well-documented, it appears that the commands <tt>AT*E2GPSCTL</tt> and <tt>AT*E2GPSNPD</tt> are unique to the Ericsson F3507g card. All credit for discovering them goes to "Nickolai Zeldovich" who left a comment in this [http://redmonk.com/sogrady/2008/09/24/apone/ thread]. I imagine one could find them via a USB sniffer on a working Windows machine (or a Linux machine with Windows running in a virtual machine). Another way to get them is to try to look for "gps" string in Windows drivers. What is interesting, F3507g supports a few other AT-commands with "GPS" substring (you can get all supported AT-commands by sending <tt>AT*</tt> to <tt>/dev/ttyACM1</tt> after activating it with <tt>AT+CFUN=1</tt>). Anyway, there is a [http://www.natisbad.org/E4300/Dell_Wireless_5530_AT_cmd_ref.html project] aiming to document all AT-commands for the Ericsson F3507g card.<br />
<br />
==Related Links==<br />
*[http://www.ericsson.com/solutions/mobile_broadband_modules/docs/mobile_broadband_module_datasheet_print.pdf Ericsson Datasheet]<br />
*[http://www.natisbad.org/E4300/Dell_Wireless_5530_AT_cmd_ref.html F3705g - AT commands reference]<br />
*[http://www.pinstack.com/carrier_settings_apn_gateway.html Carrier internet Settings (Apn, Gateway, etc)]<br />
*[http://mbm.sourceforge.net/ MBM project website (Support for f3507g/f3607gw in NetworkManager, kernel drivers, gps control software etc)]<br />
<br />
==Bugs==<br />
* Ubuntu 8.10 kernel suffers from the "option" regression mentioned above. However both CDC ACM and CDC Ethernet interfaces are treated correctly by Ubuntu 9.04 kernel.<br />
* Playing around with the device under Linux can cause it to disappear under Windows Vista. Issue + Fix described [http://forums.lenovo.com/t5/T400-T500-and-newer-T-series/Ericsson-f3507g-doesn-t-appear-under-Vista32-anymore-but-works/m-p/138874 here]<br />
<br />
==ThinkPads this adapter may be found in==<br />
*{{SL300}}, {{SL400}}, {{SL500}}, {{SL510}}<br />
*{{T400}}, {{T400s}}, {{T500}}<br />
*{{W500}}<br />
*{{X200}}, {{X200 Tablet}}, {{X301}}</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Windows_PE&diff=48281Windows PE2010-04-18T05:44:22Z<p>Newhren: /* Building WinPE USB-FDD image with mtools, syslinux and grub4dos */</p>
<hr />
<div>Some utilities/drivers provided by IBM/Lenovo come only in the form of Windows executables (for example, [[Intel_Active_Management_Technology_(AMT)|Intel AMT]] firmware updates). And for people who don't use Windows OS on their computers it becomes impossible to use/apply them. Luckily, Microsoft provides [http://www.microsoft.com/downloads/en/results.aspx?pocId=&freetext=Automated%20Installation%20Kit&DisplayLang=en Automated Installation Kit] (aka AIK) for free to everyone with very few resctictions on usage (basically, they only prohibit using it as a substitute of a "real" OS, and allow to use it for any diagnostic and reapair tasks). The latest version is [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34 The Windows® Automated Installation Kit (AIK) for Windows® 7]. Users of Windows OS can install this AIK and create bootable CD-ROMs and bootable USB-flash drives with Windows PE (or WinPE for short), which is essentially a stripped-down version of Windows. In this article we will explain how to create bootable CD-ROMs and USB-flash drives with WinPE using only free software. Moreover, free software allows to create bootable USB-FDD with WinPE -- the feature not available to users of Microsoft tools :).<br />
<br />
==How to build a bootable WinPE *.iso image==<br />
* From the AIK installation file <tt>KB3AIK_EN.iso</tt>, provided in the form of a UDF disk image, use <tt>7z</tt> (from [http://sourceforge.net/projects/p7zip p7zip]) to extract the files <tt>wAIKX86.msi</tt> and <tt>WinPE.cab</tt><br />
* use <tt>7z</tt> or <tt>cabextract</tt> to unpack these files into <tt>/tmp/wAIKX86.msi/</tt> and <tt>/tmp/WinPE.cab/</tt> respectively<br />
* create a bootable WinPE *.iso image <tt>/tmp/winpe3_x86.iso</tt><br />
cd /tmp<br />
mkdir -p winpe3_x86/boot<br />
mkdir -p winpe3_x86/sources<br />
cp wAIKX86.msi/F_WINPE_X86_etfsboot.com winpe3_x86/etfsboot.com<br />
cp wAIKX86.msi/F1_BOOTMGR winpe3_x86/bootmgr<br />
cp wAIKX86.msi/F_WINPE_X86_bcd winpe3_x86/boot/bcd<br />
cp wAIKX86.msi/F_WINPE_X86_boot.sdi winpe3_x86/boot/boot.sdi<br />
cp WinPE.cab/F1_WINPE.WIM winpe3_x86/sources/boot.wim<br />
genisoimage -sysid "" -A "" -V "Microsoft Windows PE (x86)" -d -N -b etfsboot.com -no-emul-boot \<br />
-c boot.cat -hide etfsboot.com -hide boot.cat -o winpe3_x86.iso winpe3_x86<br />
the file you will get will be about 120M in size. Then you can burn this *.iso and boot it on any x86-machine which supports booting from CD-ROMs (which is pretty much any PC today)<br />
<br />
==How to build a bootable WinPE USB-flash image==<br />
a more convenient option would be to create a bootable USB-flash drive. Unfortunately, Windows loader <tt>bootmgr</tt> does not seem to support booting from USB-FDDs, while for some BIOSes this is the only type of bootable USB-flash devices.<br />
<br />
===Building WinPE USB-HDD image natively in a virtual machine===<br />
Since we already have a bootable WinPE *.iso image, we can use native Windows tools to build a bootable WinPE USB-HDD image in a virtual machine like '''qemu'''.<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86hdd.img count=250000<br />
* boot <tt>winpe3_x86.iso</tt> (which you've created before) in a virtual machine<br />
qemu -cdrom winpe3_x86.iso -boot d -m 300 -hda winpe3_x86hdd.img<br />
* now, in the shell provided by WinPE in the virtual machine<br />
diskpart.exe<br />
diskpart> list disk<br />
diskpart> select disk 0<br />
diskpart> clean<br />
diskpart> create partition primary<br />
diskpart> list partition<br />
diskpart> select partition 1<br />
diskpart> format fs=fat32 quick<br />
diskpart> active<br />
diskpart> assign<br />
diskpart> list volume<br />
diskpart> exit<br />
xcopy /s d:\* c:\<br />
wpeutil shutdown<br />
* when the virtual machine shuts down, the bootable WinPE image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86hdd.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades. If you want, you can create an additional partition for you firmware/diagnostic tools, just don't mess with the partition created by Windows -- you may reder it unbootable.<br />
<br />
===Building WinPE USB-HDD image with mtools and syslinux===<br />
if for some ethical or religious reasons you do not want to run any Windows code even in a virtual machine, or you don't have a virtual machine at all -- you can build a bootable WinPE USB-HDD image using '''syslinux''' and '''mtools'''.<br />
* create and format the partition image<br />
dd if=/dev/zero of=winpe3_x86part.img count='''234000'''<br />
/sbin/mkfs.vfat -F32 winpe3_x86part.img<br />
Note: it looks that '''234000''' is the minimal possible size, but you can choose a bigger number.<br />
* copy the files (you may have to put "mtools_skip_check=1" into <tt>~/.mtoolsrc</tt> if your partition is not aligned like mine)<br />
mmd -i winpe3_x86part.img boot<br />
mmd -i winpe3_x86part.img sources<br />
mcopy -i winpe3_x86part.img /tmp/wAIKX86.msi/F1_BOOTMGR ::/bootmgr<br />
mcopy -i winpe3_x86part.img /tmp/wAIKX86.msi/F_WINPE_X86_bcd ::/boot/bcd<br />
mcopy -i winpe3_x86part.img /tmp/wAIKX86.msi/F_WINPE_X86_boot.sdi ::/boot/boot.sdi<br />
mcopy -i winpe3_x86part.img /tmp/WinPE.cab/F1_WINPE.WIM ::/sources/boot.wim<br />
mcopy -i winpe3_x86part.img /usr/lib/syslinux/chain.c32 ::/chain.c32<br />
* create the config file <tt>/tmp/syslinux.cfg</tt> and copy it<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
COM32 /chain.c32<br />
APPEND boot ntldr=/bootmgr<br />
<br />
mcopy -i winpe3_x86part.img /tmp/syslinux.cfg ::/syslinux.cfg<br />
* install syslinux<br />
syslinux winpe3_x86part.img<br />
* create USB-HDD image of the size at least '''32''' sectors bigger than the size of the partition we've just created<br />
dd if=/dev/zero of=winpe3_x86hdd.img count='''234032'''<br />
* create a bootable partition entry<br />
/sbin/parted winpe3_x86hdd.img<br />
(parted) mklabel msdos<br />
(parted) unit s<br />
(parted) print free<br />
(parted) mkpart primary fat32<br />
(parted) set 1 boot on<br />
(parted) print<br />
(parted) quit<br />
* copy the partition image into the disk image<br />
dd if=winpe3_x86part.img of=winpe3_x86hdd.img seek='''32'''<br />
where '''32''' is the start sector of your partition<br />
* now the image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86hdd.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades.<br />
<br />
===Building WinPE USB-FDD image with mtools, syslinux and grub4dos===<br />
Any BIOS that supports booting from some USB media at all supports booting from USB-FDD. As it was mentioned ealier, the problem with WinPE is that the bootloader <tt>bootmgr</tt> does not seem to like such devices. So, we will have to create a virtual HDD or a virtual CDROM (I prefer virtual HDD). For some mystical reason, <tt>memdisk</tt> (the dirver for virtual disks which comes with syslinux) does not work on Thinkpads if the disk image is on a USB media. Thus we will use a rival technology [http://sourceforge.net/projects/grub4dos/files/ grub4dos].<br />
* create USB-FDD image<br />
dd if=/dev/zero of=winpe3_x86fdd.img count='''238200'''<br />
/sbin/mkfs.vfat -F32 winpe3_x86fdd.img<br />
Note: it looks that '''238200''' is the minimal possible size, but you can choose a bigger number.<br />
* download [http://sourceforge.net/projects/grub4dos/files/ grub4dos] and copy <tt>grub.exe</tt><br />
mcopy -i winpe3_x86fdd.img grub.exe ::/<br />
* copy the payload<br />
mcopy -i winpe3_x86fdd.img winpe3_x86part.img ::/<br />
Note that this is the image of the partition, not of the whole HD. The reason why it works is grub.exe's [http://grub4dos.sourceforge.net/wiki/index.php/Grub4dos_tutorial#Auto_MBR_creation Auto MBR creation] feature, which tricks <tt>bootmgr</tt> into thinking that it boots from a real HD.<br />
* create the config file <tt>/tmp/syslinux.cfg</tt> and copy it<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
KERNEL /grub.exe<br />
APPEND --config-file="map (rd) (fd0); map --hook; chainloader (fd0)+1; rootnoverify (fd0)"<br />
INITRD /winpe3_x86part.img<br />
<br />
mcopy -i winpe3_x86fdd.img /tmp/syslinux.cfg ::/syslinux.cfg<br />
'''Note''': for a virtual CDROM, your <tt>syslinux.cfg</tt> should look like<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
KERNEL /grub.exe<br />
APPEND --config-file="map (rd) (hd32); map --hook; root (hd32); chainloader (hd32)"<br />
INITRD /winpe3_x86.iso<br />
'''Note''': if your computer is low on RAM (less than 350Mb) you may also try the following <tt>syslinux.cfg</tt> with direct mapping and make sure that the payload <tt>winpe3_x86part.img</tt> is in one contiguous disk area.<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
KERNEL /grub.exe<br />
APPEND --config-file="map (hd0)/winpe3_x86part.img (fd0); map --hook; chainloader (fd0)+1; rootnoverify (fd0)"<br />
* install syslinux<br />
syslinux winpe3_x86fdd.img<br />
* now the image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with <br />
# dd if=winpe3_x86fdd.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades.</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Windows_PE&diff=48280Windows PE2010-04-18T05:39:21Z<p>Newhren: </p>
<hr />
<div>Some utilities/drivers provided by IBM/Lenovo come only in the form of Windows executables (for example, [[Intel_Active_Management_Technology_(AMT)|Intel AMT]] firmware updates). And for people who don't use Windows OS on their computers it becomes impossible to use/apply them. Luckily, Microsoft provides [http://www.microsoft.com/downloads/en/results.aspx?pocId=&freetext=Automated%20Installation%20Kit&DisplayLang=en Automated Installation Kit] (aka AIK) for free to everyone with very few resctictions on usage (basically, they only prohibit using it as a substitute of a "real" OS, and allow to use it for any diagnostic and reapair tasks). The latest version is [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34 The Windows® Automated Installation Kit (AIK) for Windows® 7]. Users of Windows OS can install this AIK and create bootable CD-ROMs and bootable USB-flash drives with Windows PE (or WinPE for short), which is essentially a stripped-down version of Windows. In this article we will explain how to create bootable CD-ROMs and USB-flash drives with WinPE using only free software. Moreover, free software allows to create bootable USB-FDD with WinPE -- the feature not available to users of Microsoft tools :).<br />
<br />
==How to build a bootable WinPE *.iso image==<br />
* From the AIK installation file <tt>KB3AIK_EN.iso</tt>, provided in the form of a UDF disk image, use <tt>7z</tt> (from [http://sourceforge.net/projects/p7zip p7zip]) to extract the files <tt>wAIKX86.msi</tt> and <tt>WinPE.cab</tt><br />
* use <tt>7z</tt> or <tt>cabextract</tt> to unpack these files into <tt>/tmp/wAIKX86.msi/</tt> and <tt>/tmp/WinPE.cab/</tt> respectively<br />
* create a bootable WinPE *.iso image <tt>/tmp/winpe3_x86.iso</tt><br />
cd /tmp<br />
mkdir -p winpe3_x86/boot<br />
mkdir -p winpe3_x86/sources<br />
cp wAIKX86.msi/F_WINPE_X86_etfsboot.com winpe3_x86/etfsboot.com<br />
cp wAIKX86.msi/F1_BOOTMGR winpe3_x86/bootmgr<br />
cp wAIKX86.msi/F_WINPE_X86_bcd winpe3_x86/boot/bcd<br />
cp wAIKX86.msi/F_WINPE_X86_boot.sdi winpe3_x86/boot/boot.sdi<br />
cp WinPE.cab/F1_WINPE.WIM winpe3_x86/sources/boot.wim<br />
genisoimage -sysid "" -A "" -V "Microsoft Windows PE (x86)" -d -N -b etfsboot.com -no-emul-boot \<br />
-c boot.cat -hide etfsboot.com -hide boot.cat -o winpe3_x86.iso winpe3_x86<br />
the file you will get will be about 120M in size. Then you can burn this *.iso and boot it on any x86-machine which supports booting from CD-ROMs (which is pretty much any PC today)<br />
<br />
==How to build a bootable WinPE USB-flash image==<br />
a more convenient option would be to create a bootable USB-flash drive. Unfortunately, Windows loader <tt>bootmgr</tt> does not seem to support booting from USB-FDDs, while for some BIOSes this is the only type of bootable USB-flash devices.<br />
<br />
===Building WinPE USB-HDD image natively in a virtual machine===<br />
Since we already have a bootable WinPE *.iso image, we can use native Windows tools to build a bootable WinPE USB-HDD image in a virtual machine like '''qemu'''.<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86hdd.img count=250000<br />
* boot <tt>winpe3_x86.iso</tt> (which you've created before) in a virtual machine<br />
qemu -cdrom winpe3_x86.iso -boot d -m 300 -hda winpe3_x86hdd.img<br />
* now, in the shell provided by WinPE in the virtual machine<br />
diskpart.exe<br />
diskpart> list disk<br />
diskpart> select disk 0<br />
diskpart> clean<br />
diskpart> create partition primary<br />
diskpart> list partition<br />
diskpart> select partition 1<br />
diskpart> format fs=fat32 quick<br />
diskpart> active<br />
diskpart> assign<br />
diskpart> list volume<br />
diskpart> exit<br />
xcopy /s d:\* c:\<br />
wpeutil shutdown<br />
* when the virtual machine shuts down, the bootable WinPE image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86hdd.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades. If you want, you can create an additional partition for you firmware/diagnostic tools, just don't mess with the partition created by Windows -- you may reder it unbootable.<br />
<br />
===Building WinPE USB-HDD image with mtools and syslinux===<br />
if for some ethical or religious reasons you do not want to run any Windows code even in a virtual machine, or you don't have a virtual machine at all -- you can build a bootable WinPE USB-HDD image using '''syslinux''' and '''mtools'''.<br />
* create and format the partition image<br />
dd if=/dev/zero of=winpe3_x86part.img count='''234000'''<br />
/sbin/mkfs.vfat -F32 winpe3_x86part.img<br />
Note: it looks that '''234000''' is the minimal possible size, but you can choose a bigger number.<br />
* copy the files (you may have to put "mtools_skip_check=1" into <tt>~/.mtoolsrc</tt> if your partition is not aligned like mine)<br />
mmd -i winpe3_x86part.img boot<br />
mmd -i winpe3_x86part.img sources<br />
mcopy -i winpe3_x86part.img /tmp/wAIKX86.msi/F1_BOOTMGR ::/bootmgr<br />
mcopy -i winpe3_x86part.img /tmp/wAIKX86.msi/F_WINPE_X86_bcd ::/boot/bcd<br />
mcopy -i winpe3_x86part.img /tmp/wAIKX86.msi/F_WINPE_X86_boot.sdi ::/boot/boot.sdi<br />
mcopy -i winpe3_x86part.img /tmp/WinPE.cab/F1_WINPE.WIM ::/sources/boot.wim<br />
mcopy -i winpe3_x86part.img /usr/lib/syslinux/chain.c32 ::/chain.c32<br />
* create the config file <tt>/tmp/syslinux.cfg</tt> and copy it<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
COM32 /chain.c32<br />
APPEND boot ntldr=/bootmgr<br />
<br />
mcopy -i winpe3_x86part.img /tmp/syslinux.cfg ::/syslinux.cfg<br />
* install syslinux<br />
syslinux winpe3_x86part.img<br />
* create USB-HDD image of the size at least '''32''' sectors bigger than the size of the partition we've just created<br />
dd if=/dev/zero of=winpe3_x86hdd.img count='''234032'''<br />
* create a bootable partition entry<br />
/sbin/parted winpe3_x86hdd.img<br />
(parted) mklabel msdos<br />
(parted) unit s<br />
(parted) print free<br />
(parted) mkpart primary fat32<br />
(parted) set 1 boot on<br />
(parted) print<br />
(parted) quit<br />
* copy the partition image into the disk image<br />
dd if=winpe3_x86part.img of=winpe3_x86hdd.img seek='''32'''<br />
where '''32''' is the start sector of your partition<br />
* now the image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86hdd.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades.<br />
<br />
===Building WinPE USB-FDD image with mtools, syslinux and grub4dos===<br />
Any BIOS that supports booting from some USB media at all supports booting from USB-FDD. As it was mentioned ealier, the problem with WinPE is that the bootloader <tt>bootmgr</tt> does not seem to like such devices. So, we will have to create a virtual HDD or a virtual CDROM (I prefer virtual HDD). For some mystical reason, <tt>memdisk</tt> (the dirver for virtual disks which comes with syslinux) does not work on Thinkpads if the disk image is on a USB media. Thus we will use a rival technology [http://sourceforge.net/projects/grub4dos/files/ grub4dos].<br />
* create USB-FDD image<br />
dd if=/dev/zero of=winpe3_x86fdd.img count='''238200'''<br />
/sbin/mkfs.vfat -F32 winpe3_x86fdd.img<br />
Note: it looks that '''238200''' is the minimal possible size, but you can choose a bigger number.<br />
* download [http://sourceforge.net/projects/grub4dos/files/ grub4dos] and copy <tt>grub.exe</tt><br />
mcopy -i winpe3_x86fdd.img grub.exe ::/<br />
* copy the payload<br />
mcopy -i winpe3_x86fdd.img winpe3_x86part.img ::/<br />
Note that this is the image of the partition, not of the whole HD. The reason why it works is grub.exe's [http://grub4dos.sourceforge.net/wiki/index.php/Grub4dos_tutorial#Auto_MBR_creation Auto MBR creation] feature, which tricks <tt>bootmgr</tt> into thinking that it boots from a real HD.<br />
* create the config file <tt>/tmp/syslinux.cfg</tt> and copy it<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
KERNEL /grub.exe<br />
APPEND --config-file="map (rd) (fd0); map --hook; chainloader (fd0)+1; rootnoverify (fd0)"<br />
INITRD /winpe3_x86part.img<br />
<br />
mcopy -i winpe3_x86fdd.img /tmp/syslinux.cfg ::/syslinux.cfg<br />
'''Note''': for a virtual CDROM, your <tt>syslinux.cfg</tt> should look like<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
KERNEL /grub.exe<br />
APPEND --config-file="map (rd) (hd32); map --hook; root (hd32); chainloader (hd32)"<br />
INITRD /winpe3_x86.iso<br />
'''Note''': if your computer is low on RAM (less than 350Mb) you may also try the following <tt>syslinux.cfg</tt> with direct mapping and make sure that the payload <tt>winpe3_x86part.img</tt> is in one contiguous disk area.<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
KERNEL /grub.exe<br />
APPEND --config-file="find --set-root /winpe3_x86part.img; map /winpe3_x86part.img (fd0); map --hook; chainloader (fd0)+1; rootnoverify (fd0)"<br />
* install syslinux<br />
syslinux winpe3_x86fdd.img<br />
* now the image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with <br />
# dd if=winpe3_x86fdd.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades.</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Windows_PE&diff=48279Windows PE2010-04-18T05:33:25Z<p>Newhren: </p>
<hr />
<div>Some utilities/drivers provided by IBM/Lenovo come only in the form of Windows executables (for example, [[Intel_Active_Management_Technology_(AMT)|Intel AMT]] firmware updates). And for people who don't use Windows OS on their computers it becomes impossible to use/apply them. Luckily, Microsoft provides [http://www.microsoft.com/downloads/en/results.aspx?pocId=&freetext=Automated%20Installation%20Kit&DisplayLang=en Automated Installation Kit] (aka AIK) for free to everyone with very few resctictions on usage (basically, they only prohibit using it as a substitute of a "real" OS, and allow to use it for any diagnostic and reapair tasks). The latest version is [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34 The Windows® Automated Installation Kit (AIK) for Windows® 7]. Users of Windows OS can install this AIK and create bootable CD-ROMs and bootable USB-flash drives with Windows PE (or WinPE for short), which is essentially a stripped-down version of Windows. In this article we will explain how to create bootable CD-ROMs and USB-flash drives with WinPE using only free software. Moreover, free software allows to create bootable USB-FDD with WinPE -- the feature not available to users of Microsoft tools :).<br />
<br />
==How to build a bootable WinPE *.iso image==<br />
* From the AIK installation file <tt>KB3AIK_EN.iso</tt>, provided in the form of a UDF disk image, use <tt>7z</tt> (from [http://sourceforge.net/projects/p7zip p7zip]) to extract the files <tt>wAIKX86.msi</tt> and <tt>WinPE.cab</tt><br />
* use <tt>7z</tt> or <tt>cabextract</tt> to unpack these files into <tt>/tmp/wAIKX86.msi/</tt> and <tt>/tmp/WinPE.cab/</tt> respectively<br />
* create a bootable WinPE *.iso image <tt>/tmp/winpe3_x86.iso</tt><br />
cd /tmp<br />
mkdir -p winpe3_x86/boot<br />
mkdir -p winpe3_x86/sources<br />
cp wAIKX86.msi/F_WINPE_X86_etfsboot.com winpe3_x86/etfsboot.com<br />
cp wAIKX86.msi/F1_BOOTMGR winpe3_x86/bootmgr<br />
cp wAIKX86.msi/F_WINPE_X86_bcd winpe3_x86/boot/bcd<br />
cp wAIKX86.msi/F_WINPE_X86_boot.sdi winpe3_x86/boot/boot.sdi<br />
cp WinPE.cab/F1_WINPE.WIM winpe3_x86/sources/boot.wim<br />
genisoimage -sysid "" -A "" -V "Microsoft Windows PE (x86)" -d -N -b etfsboot.com -no-emul-boot \<br />
-c boot.cat -hide etfsboot.com -hide boot.cat -o winpe3_x86.iso winpe3_x86<br />
the file you will get will be about 120M in size. Then you can burn this *.iso and boot it on any x86-machine which supports booting from CD-ROMs (which is pretty much any PC today)<br />
<br />
==How to build a bootable WinPE USB-flash image==<br />
a more convenient option would be to create a bootable USB-flash drive. Unfortunately, Windows loader <tt>bootmgr</tt> does not seem to support booting from USB-FDDs, while for some BIOSes this is the only type of bootable USB-flash devices.<br />
<br />
===Building WinPE USB-HDD image natively in a virtual machine===<br />
Since we already have a bootable WinPE *.iso image, we can use native Windows tools to build a bootable WinPE USB-HDD image in a virtual machine like '''qemu'''.<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86hdd.img count=250000<br />
* boot <tt>winpe3_x86.iso</tt> (which you've created before) in a virtual machine<br />
qemu -cdrom winpe3_x86.iso -boot d -m 300 -hda winpe3_x86hdd.img<br />
* now, in the shell provided by WinPE in the virtual machine<br />
diskpart.exe<br />
diskpart> list disk<br />
diskpart> select disk 0<br />
diskpart> clean<br />
diskpart> create partition primary<br />
diskpart> list partition<br />
diskpart> select partition 1<br />
diskpart> format fs=fat32 quick<br />
diskpart> active<br />
diskpart> assign<br />
diskpart> list volume<br />
diskpart> exit<br />
xcopy /s d:\* c:\<br />
wpeutil shutdown<br />
* when the virtual machine shuts down, the bootable WinPE image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86hdd.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades. If you want, you can create an additional partition for you firmware/diagnostic tools, just don't mess with the partition created by Windows -- you may reder it unbootable.<br />
<br />
===Building WinPE USB-HDD image with mtools and syslinux===<br />
if for some ethical or religious reasons you do not want to run any Windows code even in a virtual machine, or you don't have a virtual machine at all -- you can build a bootable WinPE USB-HDD image using '''syslinux''' and '''mtools'''.<br />
* create and format the partition image<br />
dd if=/dev/zero of=winpe3_x86part.img count='''234000'''<br />
/sbin/mkfs.vfat -F32 winpe3_x86part.img<br />
Note: it looks that '''234000''' is the minimal possible size, but you can choose a bigger number.<br />
* copy the files (you may have to put "mtools_skip_check=1" into <tt>~/.mtoolsrc</tt> if your partition is not aligned like mine)<br />
mmd -i winpe3_x86part.img boot<br />
mmd -i winpe3_x86part.img sources<br />
mcopy -i winpe3_x86part.img /tmp/wAIKX86.msi/F1_BOOTMGR ::/bootmgr<br />
mcopy -i winpe3_x86part.img /tmp/wAIKX86.msi/F_WINPE_X86_bcd ::/boot/bcd<br />
mcopy -i winpe3_x86part.img /tmp/wAIKX86.msi/F_WINPE_X86_boot.sdi ::/boot/boot.sdi<br />
mcopy -i winpe3_x86part.img /tmp/WinPE.cab/F1_WINPE.WIM ::/sources/boot.wim<br />
mcopy -i winpe3_x86part.img /usr/lib/syslinux/chain.c32 ::/chain.c32<br />
* create the config file <tt>/tmp/syslinux.cfg</tt> and copy it<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
COM32 /chain.c32<br />
APPEND boot ntldr=/bootmgr<br />
<br />
mcopy -i winpe3_x86part.img /tmp/syslinux.cfg ::/syslinux.cfg<br />
* install syslinux<br />
syslinux winpe3_x86part.img<br />
* create USB-HDD image of the size at least '''32''' sectors bigger than the size of the partition we've just created<br />
dd if=/dev/zero of=winpe3_x86hdd.img count='''234032'''<br />
* create a bootable partition entry<br />
/sbin/parted winpe3_x86hdd.img<br />
(parted) mklabel msdos<br />
(parted) unit s<br />
(parted) print free<br />
(parted) mkpart primary fat32<br />
(parted) set 1 boot on<br />
(parted) print<br />
(parted) quit<br />
* copy the partition image into the disk image<br />
dd if=winpe3_x86part.img of=winpe3_x86hdd.img seek='''32'''<br />
where '''32''' is the start sector of your partition<br />
* now the image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86hdd.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades.<br />
<br />
===Building WinPE USB-FDD image with mtools, syslinux and grub4dos===<br />
Any BIOS that supports booting from some USB media at all supports booting from USB-FDD. As it was mentioned ealier, the problem with WinPE is that the bootloader <tt>bootmgr</tt> does not seem to like such devices. So, we will have to create a virtual HDD or a virtual CDROM (I prefer virtual HDD). For some mystical reason, <tt>memdisk</tt> (the dirver for virtual disks which comes with syslinux) does not work on Thinkpads if the disk image is on a USB media. Thus we will use a rival technology [http://sourceforge.net/projects/grub4dos/files/ grub4dos].<br />
* create USB-FDD image<br />
dd if=/dev/zero of=winpe3_x86fdd.img count='''238200'''<br />
/sbin/mkfs.vfat -F32 winpe3_x86fdd.img<br />
Note: it looks that '''238200''' is the minimal possible size, but you can choose a bigger number.<br />
* download [http://sourceforge.net/projects/grub4dos/files/ grub4dos] and copy <tt>grub.exe</tt><br />
mcopy -i winpe3_x86fdd.img grub.exe ::/<br />
* copy the payload<br />
mcopy -i winpe3_x86fdd.img winpe3_x86part.img ::/<br />
Note that this is the image of the partition, not of the whole HD. The reason why it works is grub.exe's [http://grub4dos.sourceforge.net/wiki/index.php/Grub4dos_tutorial#Auto_MBR_creation Auto MBR creation] feature, which tricks <tt>bootmgr</tt> into thinking that it boots from a real HD.<br />
* create the config file <tt>/tmp/syslinux.cfg</tt> and copy it<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
KERNEL /grub.exe<br />
APPEND --config-file="map (rd) (fd0); map --hook; chainloader (fd0)+1; rootnoverify (fd0)"<br />
INITRD /winpe3_x86part.img<br />
<br />
mcopy -i winpe3_x86fdd.img /tmp/syslinux.cfg ::/syslinux.cfg<br />
'''Note''': for a virtual CDROM, your <tt>syslinux.cfg</tt> should look like<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
KERNEL /grub.exe<br />
APPEND --config-file="map (rd) (hd32); map --hook; root (hd32); chainloader (hd32)"<br />
INITRD /winpe3_x86.iso<br />
'''Note''': if your computer is low on RAM (less than 350Mb) you may also try the following <tt>syslinux.cfg</tt> with direct mapping and make sure that the payload <tt>winpe3_x86part.img</tt> is in one contiguous disk area.<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
KERNEL /grub.exe<br />
APPEND --config-file="map (hd0)/winpe3_x86part.img (fd0); map --hook; chainloader (fd0)+1; rootnoverify (fd0)"<br />
* install syslinux<br />
syslinux winpe3_x86fdd.img<br />
* now the image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with <br />
# dd if=winpe3_x86fdd.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades.</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Windows_PE&diff=48278Windows PE2010-04-18T03:26:23Z<p>Newhren: added virtual CDROM option</p>
<hr />
<div>Some utilities/drivers provided by IBM/Lenovo come only in the form of Windows executables (for example, [[Intel_Active_Management_Technology_(AMT)|Intel AMT]] firmware updates). And for people who don't use Windows OS on their computers it becomes impossible to use/apply them. Luckily, Microsoft provides [http://www.microsoft.com/downloads/en/results.aspx?pocId=&freetext=Automated%20Installation%20Kit&DisplayLang=en Automated Installation Kit] (aka AIK) for free to everyone with very few resctictions on usage (basically, they only prohibit using it as a substitute of a "real" OS, and allow to use it for any diagnostic and reapair tasks). The latest version is [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34 The Windows® Automated Installation Kit (AIK) for Windows® 7]. Users of Windows OS can install this AIK and create bootable CD-ROMs and bootable USB-flash drives with Windows PE (or WinPE for short), which is essentially a stripped-down version of Windows. In this article we will explain how to create bootable CD-ROMs and USB-flash drives with WinPE using only free software. Moreover, free software allows to create bootable USB-FDD with WinPE -- the feature not available to users of Microsoft tools :).<br />
<br />
==How to build a bootable WinPE *.iso image==<br />
* From the AIK installation file <tt>KB3AIK_EN.iso</tt>, provided in the form of a UDF disk image, use <tt>7z</tt> (from [http://sourceforge.net/projects/p7zip p7zip]) to extract the files <tt>wAIKX86.msi</tt> and <tt>WinPE.cab</tt><br />
* use <tt>7z</tt> or <tt>cabextract</tt> to unpack these files into <tt>/tmp/wAIKX86.msi/</tt> and <tt>/tmp/WinPE.cab/</tt> respectively<br />
* create a bootable WinPE *.iso image <tt>/tmp/winpe3_x86.iso</tt><br />
cd /tmp<br />
mkdir -p winpe3_x86/boot<br />
mkdir -p winpe3_x86/sources<br />
cp wAIKX86.msi/F_WINPE_X86_etfsboot.com winpe3_x86/etfsboot.com<br />
cp wAIKX86.msi/F1_BOOTMGR winpe3_x86/bootmgr<br />
cp wAIKX86.msi/F_WINPE_X86_bcd winpe3_x86/boot/bcd<br />
cp wAIKX86.msi/F_WINPE_X86_boot.sdi winpe3_x86/boot/boot.sdi<br />
cp WinPE.cab/F1_WINPE.WIM winpe3_x86/sources/boot.wim<br />
genisoimage -sysid "" -A "" -V "Microsoft Windows PE (x86)" -d -N -b etfsboot.com -no-emul-boot \<br />
-c boot.cat -hide etfsboot.com -hide boot.cat -o winpe3_x86.iso winpe3_x86<br />
the file you will get will be about 120M in size. Then you can burn this *.iso and boot it on any x86-machine which supports booting from CD-ROMs (which is pretty much any PC today)<br />
<br />
==How to build a bootable WinPE USB-flash image==<br />
a more convenient option would be to create a bootable USB-flash drive. Unfortunately, Windows loader <tt>bootmgr</tt> does not seem to support booting from USB-FDDs, while for some BIOSes this is the only type of bootable USB-flash devices.<br />
<br />
===Building WinPE USB-HDD image natively in a virtual machine===<br />
Since we already have a bootable WinPE *.iso image, we can use native Windows tools to build a bootable WinPE USB-HDD image in a virtual machine like '''qemu'''.<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86hdd.img count=250000<br />
* boot <tt>winpe3_x86.iso</tt> (which you've created before) in a virtual machine<br />
qemu -cdrom winpe3_x86.iso -boot d -m 300 -hda winpe3_x86hdd.img<br />
* now, in the shell provided by WinPE in the virtual machine<br />
diskpart.exe<br />
diskpart> list disk<br />
diskpart> select disk 0<br />
diskpart> clean<br />
diskpart> create partition primary<br />
diskpart> list partition<br />
diskpart> select partition 1<br />
diskpart> format fs=fat32 quick<br />
diskpart> active<br />
diskpart> assign<br />
diskpart> list volume<br />
diskpart> exit<br />
xcopy /s d:\* c:\<br />
wpeutil shutdown<br />
* when the virtual machine shuts down, the bootable WinPE image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86hdd.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades. If you want, you can create an additional partition for you firmware/diagnostic tools, just don't mess with the partition created by Windows -- you may reder it unbootable.<br />
<br />
===Building WinPE USB-HDD image with mtools and syslinux===<br />
if for some ethical or religious reasons you do not want to run any Windows code even in a virtual machine, or you don't have a virtual machine at all -- you can build a bootable WinPE USB-HDD image using '''syslinux''' and '''mtools'''.<br />
* create and format the partition image<br />
dd if=/dev/zero of=winpe3_x86part.img count='''234000'''<br />
/sbin/mkfs.vfat -F32 winpe3_x86part.img<br />
Note: it looks that '''234000''' is the minimal possible size, but you can choose a bigger number.<br />
* copy the files (you may have to put "mtools_skip_check=1" into <tt>~/.mtoolsrc</tt> if your partition is not aligned like mine)<br />
mmd -i winpe3_x86part.img boot<br />
mmd -i winpe3_x86part.img sources<br />
mcopy -i winpe3_x86part.img /tmp/wAIKX86.msi/F1_BOOTMGR ::/bootmgr<br />
mcopy -i winpe3_x86part.img /tmp/wAIKX86.msi/F_WINPE_X86_bcd ::/boot/bcd<br />
mcopy -i winpe3_x86part.img /tmp/wAIKX86.msi/F_WINPE_X86_boot.sdi ::/boot/boot.sdi<br />
mcopy -i winpe3_x86part.img /tmp/WinPE.cab/F1_WINPE.WIM ::/sources/boot.wim<br />
mcopy -i winpe3_x86part.img /usr/lib/syslinux/chain.c32 ::/chain.c32<br />
* create the config file <tt>/tmp/syslinux.cfg</tt> and copy it<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
COM32 /chain.c32<br />
APPEND boot ntldr=/bootmgr<br />
<br />
mcopy -i winpe3_x86part.img /tmp/syslinux.cfg ::/syslinux.cfg<br />
* install syslinux<br />
syslinux winpe3_x86part.img<br />
* create USB-HDD image of the size at least '''32''' sectors bigger than the size of the partition we've just created<br />
dd if=/dev/zero of=winpe3_x86hdd.img count='''234032'''<br />
* create a bootable partition entry<br />
/sbin/parted winpe3_x86hdd.img<br />
(parted) mklabel msdos<br />
(parted) unit s<br />
(parted) print free<br />
(parted) mkpart primary fat32<br />
(parted) set 1 boot on<br />
(parted) print<br />
(parted) quit<br />
* copy the partition image into the disk image<br />
dd if=winpe3_x86part.img of=winpe3_x86hdd.img seek='''32'''<br />
where '''32''' is the start sector of your partition<br />
* now the image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86hdd.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades.<br />
<br />
===Building WinPE USB-FDD image with mtools, syslinux and grub4dos===<br />
Any BIOS that supports booting from some USB media at all supports booting from USB-FDD. As it was mentioned ealier, the problem with WinPE is that the bootloader <tt>bootmgr</tt> does not seem to like such devices. So, we will have to create a virtual HDD or a virtual CDROM (I prefer virtual HDD). For some mystical reason, <tt>memdisk</tt> (the dirver for virtual disks which comes with syslinux) does not work on Thinkpads if the disk image is on a USB media. Thus we will use a rival technology [http://sourceforge.net/projects/grub4dos/files/ grub4dos].<br />
* create USB-FDD image<br />
dd if=/dev/zero of=winpe3_x86fdd.img count='''238200'''<br />
/sbin/mkfs.vfat -F32 winpe3_x86fdd.img<br />
Note: it looks that '''238200''' is the minimal possible size, but you can choose a bigger number.<br />
* download [http://sourceforge.net/projects/grub4dos/files/ grub4dos] and copy <tt>grub.exe</tt><br />
mcopy -i winpe3_x86fdd.img grub.exe ::/<br />
* copy the payload<br />
mcopy -i winpe3_x86fdd.img winpe3_x86part.img ::/<br />
Note that this is the image of the partition, not of the whole HD. The reason why it works is grub.exe's [http://grub4dos.sourceforge.net/wiki/index.php/Grub4dos_tutorial#Auto_MBR_creation Auto MBR creation] feature, which tricks <tt>bootmgr</tt> into thinking that it boots from a real HD.<br />
* create the config file <tt>/tmp/syslinux.cfg</tt> and copy it<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
KERNEL /grub.exe<br />
APPEND --config-file="map (rd) (fd0); map --hook; chainloader (fd0)+1; rootnoverify (fd0)"<br />
INITRD /winpe3_x86part.img<br />
<br />
mcopy -i winpe3_x86fdd.img /tmp/syslinux.cfg ::/syslinux.cfg<br />
Note: for a virtual CDROM, your <tt>syslinux.cfg</tt> should look like<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
KERNEL /grub.exe<br />
APPEND --config-file="map (rd) (hd32); map --hook; chainloader (hd32); rootnoverify (hd32)"<br />
INITRD /winpe3_x86.iso<br />
* install syslinux<br />
syslinux winpe3_x86fdd.img<br />
Note: if your computer is low on RAM (less than 350Mb) you may also try the following <tt>syslinux.cfg</tt> with direct mapping and make sure that the payload <tt>winpe3_x86part.img</tt> is in one contiguous disk area.<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
KERNEL /grub.exe<br />
APPEND --config-file="map (hd0)/winpe3_x86part.img (fd0); map --hook; chainloader (fd0)+1; rootnoverify (fd0)"<br />
* now the image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with <br />
# dd if=winpe3_x86fdd.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades.</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Windows_PE&diff=48209Windows PE2010-04-13T19:49:11Z<p>Newhren: </p>
<hr />
<div>Some utilities/drivers provided by IBM/Lenovo come only in the form of Windows executables (for example, [[Intel_Active_Management_Technology_(AMT)|Intel AMT]] firmware updates). And for people who don't use Windows OS on their computers it becomes impossible to use/apply them. Luckily, Microsoft provides [http://www.microsoft.com/downloads/en/results.aspx?pocId=&freetext=Automated%20Installation%20Kit&DisplayLang=en Automated Installation Kit] (aka AIK) for free to everyone with very few resctictions on usage (basically, they only prohibit using it as a substitute of a "real" OS, and allow to use it for any diagnostic and reapair tasks). The latest version is [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34 The Windows® Automated Installation Kit (AIK) for Windows® 7]. Users of Windows OS can install this AIK and create bootable CD-ROMs and bootable USB-flash drives with Windows PE (or WinPE for short), which is essentially a stripped-down version of Windows. In this article we will explain how to create bootable CD-ROMs and USB-flash drives with WinPE using only free software. Moreover, free software allows to create bootable USB-FDD with WinPE -- the feature not available to users of Microsoft tools :).<br />
<br />
==How to build a bootable WinPE *.iso image==<br />
* From the AIK installation file <tt>KB3AIK_EN.iso</tt>, provided in the form of a UDF disk image, use <tt>7z</tt> (from [http://sourceforge.net/projects/p7zip p7zip]) to extract the files <tt>wAIKX86.msi</tt> and <tt>WinPE.cab</tt><br />
* use <tt>7z</tt> or <tt>cabextract</tt> to unpack these files into <tt>/tmp/wAIKX86.msi/</tt> and <tt>/tmp/WinPE.cab/</tt> respectively<br />
* create a bootable WinPE *.iso image <tt>/tmp/winpe3_x86.iso</tt><br />
cd /tmp<br />
mkdir -p winpe3_x86/boot<br />
mkdir -p winpe3_x86/sources<br />
cp wAIKX86.msi/F_WINPE_X86_etfsboot.com winpe3_x86/etfsboot.com<br />
cp wAIKX86.msi/F1_BOOTMGR winpe3_x86/bootmgr<br />
cp wAIKX86.msi/F_WINPE_X86_bcd winpe3_x86/boot/bcd<br />
cp wAIKX86.msi/F_WINPE_X86_boot.sdi winpe3_x86/boot/boot.sdi<br />
cp WinPE.cab/F1_WINPE.WIM winpe3_x86/sources/boot.wim<br />
genisoimage -sysid "" -A "" -V "Microsoft Windows PE (x86)" -d -N -b etfsboot.com -no-emul-boot \<br />
-c boot.cat -hide etfsboot.com -hide boot.cat -o winpe3_x86.iso winpe3_x86<br />
the file you will get will be about 120M in size. Then you can burn this *.iso and boot it on any x86-machine which supports booting from CD-ROMs (which is pretty much any PC today)<br />
<br />
==How to build a bootable WinPE USB-flash image==<br />
a more convenient option would be to create a bootable USB-flash drive. Unfortunately, Windows loader <tt>bootmgr</tt> does not seem to support booting from USB-FDDs, while for some BIOSes this is the only type of bootable USB-flash devices.<br />
<br />
===Building WinPE USB-HDD image natively in a virtual machine===<br />
Since we already have a bootable WinPE *.iso image, we can use native Windows tools to build a bootable WinPE USB-HDD image in a virtual machine like '''qemu'''.<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86hdd.img count=250000<br />
* boot <tt>winpe3_x86.iso</tt> (which you've created before) in a virtual machine<br />
qemu -cdrom winpe3_x86.iso -boot d -m 300 -hda winpe3_x86hdd.img<br />
* now, in the shell provided by WinPE in the virtual machine<br />
diskpart.exe<br />
diskpart> list disk<br />
diskpart> select disk 0<br />
diskpart> clean<br />
diskpart> create partition primary<br />
diskpart> list partition<br />
diskpart> select partition 1<br />
diskpart> format fs=fat32 quick<br />
diskpart> active<br />
diskpart> assign<br />
diskpart> list volume<br />
diskpart> exit<br />
xcopy /s d:\* c:\<br />
wpeutil shutdown<br />
* when the virtual machine shuts down, the bootable WinPE image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86hdd.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades. If you want, you can create an additional partition for you firmware/diagnostic tools, just don't mess with the partition created by Windows -- you may reder it unbootable.<br />
<br />
===Building WinPE USB-HDD image with mtools and syslinux===<br />
if for some ethical or religious reasons you do not want to run any Windows code even in a virtual machine, or you don't have a virtual machine at all -- you can build a bootable WinPE USB-HDD image using '''syslinux''' and '''mtools'''.<br />
* create and format the partition image<br />
dd if=/dev/zero of=winpe3_x86part.img count='''234000'''<br />
/sbin/mkfs.vfat -F32 winpe3_x86part.img<br />
Note: it looks that '''234000''' is the minimal possible size, but you can choose a bigger number.<br />
* copy the files (you may have to put "mtools_skip_check=1" into <tt>~/.mtoolsrc</tt> if your partition is not aligned like mine)<br />
mmd -i winpe3_x86part.img boot<br />
mmd -i winpe3_x86part.img sources<br />
mcopy -i winpe3_x86part.img /tmp/wAIKX86.msi/F1_BOOTMGR ::/bootmgr<br />
mcopy -i winpe3_x86part.img /tmp/wAIKX86.msi/F_WINPE_X86_bcd ::/boot/bcd<br />
mcopy -i winpe3_x86part.img /tmp/wAIKX86.msi/F_WINPE_X86_boot.sdi ::/boot/boot.sdi<br />
mcopy -i winpe3_x86part.img /tmp/WinPE.cab/F1_WINPE.WIM ::/sources/boot.wim<br />
mcopy -i winpe3_x86part.img /usr/lib/syslinux/chain.c32 ::/chain.c32<br />
* create the config file <tt>/tmp/syslinux.cfg</tt> and copy it<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
COM32 /chain.c32<br />
APPEND boot ntldr=/bootmgr<br />
<br />
mcopy -i winpe3_x86part.img /tmp/syslinux.cfg ::/syslinux.cfg<br />
* install syslinux<br />
syslinux winpe3_x86part.img<br />
* create USB-HDD image of the size at least '''32''' sectors bigger than the size of the partition we've just created<br />
dd if=/dev/zero of=winpe3_x86hdd.img count='''234032'''<br />
* create a bootable partition entry<br />
/sbin/parted winpe3_x86hdd.img<br />
(parted) mklabel msdos<br />
(parted) unit s<br />
(parted) print free<br />
(parted) mkpart primary fat32<br />
(parted) set 1 boot on<br />
(parted) print<br />
(parted) quit<br />
* copy the partition image into the disk image<br />
dd if=winpe3_x86part.img of=winpe3_x86hdd.img seek='''32'''<br />
where '''32''' is the start sector of your partition<br />
* now the image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86hdd.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades.<br />
<br />
===Building WinPE USB-FDD image with mtools, syslinux and grub4dos===<br />
Any BIOS that supports booting from some USB media at all supports booting from USB-FDD. As it was mentioned ealier, the problem with WinPE is that the bootloader <tt>bootmgr</tt> does not seem to like such devices. So, we will have to create a virtual HDD. For some mystical reason, <tt>memdisk</tt> (the dirver for virtual disks which comes with syslinux) does not work on Thinkpads if the disk image is on a USB media. Thus we will use a rival technology [http://sourceforge.net/projects/grub4dos/files/ grub4dos].<br />
* create USB-FDD image<br />
dd if=/dev/zero of=winpe3_x86fdd.img count='''238200'''<br />
/sbin/mkfs.vfat -F32 winpe3_x86fdd.img<br />
Note: it looks that '''238200''' is the minimal possible size, but you can choose a bigger number.<br />
* download [http://sourceforge.net/projects/grub4dos/files/ grub4dos] and copy <tt>grub.exe</tt><br />
mcopy -i winpe3_x86fdd.img grub.exe ::/<br />
* copy the payload<br />
mcopy -i winpe3_x86fdd.img winpe3_x86part.img ::/<br />
Note that this is the image of the partition, not of the whole HD. The reason why it works is grub.exe's [http://grub4dos.sourceforge.net/wiki/index.php/Grub4dos_tutorial#Auto_MBR_creation Auto MBR creation] feature, which tricks <tt>bootmgr</tt> into thinking that it boots from a real HD.<br />
* create the config file <tt>/tmp/syslinux.cfg</tt> and copy it<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
KERNEL /grub.exe<br />
APPEND --config-file="map (rd) (fd0); map --hook; chainloader (fd0)+1; rootnoverify (fd0)"<br />
INITRD /winpe3_x86part.img<br />
<br />
mcopy -i winpe3_x86fdd.img /tmp/syslinux.cfg ::/syslinux.cfg<br />
* install syslinux<br />
syslinux winpe3_x86fdd.img<br />
Note: if you computer is low on RAM (less than 350Mb) you may also try the following <tt>syslinux.cfg</tt> with direct mapping and make sure that the payload<br />
is in one contiguous disk area.<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
KERNEL /grub.exe<br />
APPEND --config-file="map (hd0)/winpe3_x86part.img (fd0); map --hook; chainloader (fd0)+1; rootnoverify (fd0)"<br />
* now the image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with <br />
# dd if=winpe3_x86fdd.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades.</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Windows_PE&diff=48208Windows PE2010-04-13T19:47:42Z<p>Newhren: </p>
<hr />
<div>Some utilities/drivers provided by IBM/Lenovo come only in the form of Windows executables (for example, [[Intel_Active_Management_Technology_(AMT)|Intel AMT]] firmware updates). And for people who don't use Windows OS on their computers it becomes impossible to use/apply them. Luckily, Microsoft provides [http://www.microsoft.com/downloads/en/results.aspx?pocId=&freetext=Automated%20Installation%20Kit&DisplayLang=en Automated Installation Kit] (aka AIK) for free to everyone with very few resctictions on usage (basically, they only prohibit using it as a substitute of a "real" OS, and allow to use it for any diagnostic and reapair tasks). The latest version is [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34 The Windows® Automated Installation Kit (AIK) for Windows® 7]. Users of Windows OS can install this AIK and create bootable CD-ROMs and bootable USB-flash drives with Windows PE (or WinPE for short), which is essentially a stripped-down version of Windows. In this article we will explain how to create bootable CD-ROMs and USB-flash drives with WinPE using only free software. Moreover, free software allows to create bootable USB-FDD with WinPE -- the feature not available to users of Microsoft tools :).<br />
<br />
==How to build a bootable WinPE *.iso image==<br />
* From the AIK installation file <tt>KB3AIK_EN.iso</tt>, provided in the form of a UDF disk image, use <tt>7z</tt> (from [http://sourceforge.net/projects/p7zip p7zip]) to extract the files <tt>wAIKX86.msi</tt> and <tt>WinPE.cab</tt><br />
* use <tt>7z</tt> or <tt>cabextract</tt> to unpack these files into <tt>/tmp/wAIKX86.msi/</tt> and <tt>/tmp/WinPE.cab/</tt> respectively<br />
* create a bootable WinPE *.iso image <tt>/tmp/winpe3_x86.iso</tt><br />
cd /tmp<br />
mkdir -p winpe3_x86/boot<br />
mkdir -p winpe3_x86/sources<br />
cp wAIKX86.msi/F_WINPE_X86_etfsboot.com winpe3_x86/etfsboot.com<br />
cp wAIKX86.msi/F1_BOOTMGR winpe3_x86/bootmgr<br />
cp wAIKX86.msi/F_WINPE_X86_bcd winpe3_x86/boot/bcd<br />
cp wAIKX86.msi/F_WINPE_X86_boot.sdi winpe3_x86/boot/boot.sdi<br />
cp WinPE.cab/F1_WINPE.WIM winpe3_x86/sources/boot.wim<br />
genisoimage -sysid "" -A "" -V "Microsoft Windows PE (x86)" -d -N -b etfsboot.com -no-emul-boot \<br />
-c boot.cat -hide etfsboot.com -hide boot.cat -o winpe3_x86.iso winpe3_x86<br />
the file you will get will be about 120M in size. Then you can burn this *.iso and boot it on any x86-machine which supports booting from CD-ROMs (which is pretty much any PC today)<br />
<br />
==How to build a bootable WinPE USB-flash image==<br />
a more convenient option would be to create a bootable USB-flash drive. Unfortunately, Windows loader <tt>bootmgr</tt> does not seem to support booting from USB-FDDs, while for some BIOSes this is the only type of bootable USB-flash devices.<br />
<br />
===Building WinPE USB-HDD image natively in a virtual machine===<br />
Since we already have a bootable WinPE *.iso image, we can use native Windows tools to build a bootable WinPE USB-HDD image in a virtual machine like '''qemu'''.<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86hdd.img count=250000<br />
* boot <tt>winpe3_x86.iso</tt> (which you've created before) in a virtual machine<br />
qemu -cdrom winpe3_x86.iso -boot d -m 300 -hda winpe3_x86hdd.img<br />
* now, in the shell provided by WinPE in the virtual machine<br />
diskpart.exe<br />
diskpart> list disk<br />
diskpart> select disk 0<br />
diskpart> clean<br />
diskpart> create partition primary<br />
diskpart> list partition<br />
diskpart> select partition 1<br />
diskpart> format fs=fat32 quick<br />
diskpart> active<br />
diskpart> assign<br />
diskpart> list volume<br />
diskpart> exit<br />
xcopy /s d:\* c:\<br />
wpeutil shutdown<br />
* when the virtual machine shuts down, the bootable WinPE image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86hdd.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades. If you want, you can create an additional partition for you firmware/diagnostic tools, just don't mess with the partition created by Windows -- you may reder it unbootable.<br />
<br />
===Building WinPE USB-HDD image with mtools and syslinux===<br />
if for some ethical or religious reasons you do not want to run any Windows code even in a virtual machine, or you don't have a virtual machine at all -- you can build a bootable WinPE USB-HDD image using '''syslinux''' and '''mtools'''.<br />
* create and format the partition image<br />
dd if=/dev/zero of=winpe3_x86part.img count='''234000'''<br />
/sbin/mkfs.vfat -F32 winpe3_x86part.img<br />
Note: it looks that '''234000''' is the minimal possible size, but you can choose a bigger number.<br />
* copy the files (you may have to put "mtools_skip_check=1" into <tt>~/.mtoolsrc</tt> if your partition is not aligned like mine)<br />
mmd -i winpe3_x86part.img boot<br />
mmd -i winpe3_x86part.img sources<br />
mcopy -i winpe3_x86part.img /tmp/wAIKX86.msi/F1_BOOTMGR ::/bootmgr<br />
mcopy -i winpe3_x86part.img /tmp/wAIKX86.msi/F_WINPE_X86_bcd ::/boot/bcd<br />
mcopy -i winpe3_x86part.img /tmp/wAIKX86.msi/F_WINPE_X86_boot.sdi ::/boot/boot.sdi<br />
mcopy -i winpe3_x86part.img /tmp/WinPE.cab/F1_WINPE.WIM ::/sources/boot.wim<br />
mcopy -i winpe3_x86part.img /usr/lib/syslinux/chain.c32 ::/chain.c32<br />
* create the config file <tt>/tmp/syslinux.cfg</tt> and copy it<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
COM32 /chain.c32<br />
APPEND boot ntldr=/bootmgr<br />
<br />
mcopy -i winpe3_x86part.img /tmp/syslinux.cfg ::/syslinux.cfg<br />
* install syslinux<br />
syslinux winpe3_x86part.img<br />
* create USB-HDD image of the size at least '''32''' sectors bigger than the size of the partition we've just created<br />
dd if=/dev/zero of=winpe3_x86hdd.img count='''234032'''<br />
* create a bootable partition entry<br />
/sbin/parted winpe3_x86hdd.img<br />
(parted) mklabel msdos<br />
(parted) unit s<br />
(parted) print free<br />
(parted) mkpart primary fat32<br />
(parted) set 1 boot on<br />
(parted) print<br />
(parted) quit<br />
* copy the partition image into the disk image<br />
dd if=winpe3_x86part.img of=winpe3_x86hdd.img seek='''32'''<br />
where '''32''' is the start sector of your partition<br />
* now the image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86hdd.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades.<br />
<br />
===Building WinPE USB-FDD image with mtools, syslinux and grub4dos===<br />
Any BIOS that supports booting from some USB media at all supports booting from USB-FDD. As it was mentioned ealier, the problem with WinPE is that the bootloader <tt>bootmgr</tt> does not seem to like such devices. So, we will have to create a virtual HDD. For some mystical reason, <tt>memdisk</tt> (the dirver for virtual disks which comes with syslinux) does not work on Thinkpads if the disk image is on a USB media. Thus we will use a rival technology [http://sourceforge.net/projects/grub4dos/files/ grub4dos].<br />
* create USB-FDD image<br />
dd if=/dev/zero of=winpe3_x86fdd.img count='''238200'''<br />
/sbin/mkfs.vfat -F32 winpe3_x86fdd.img<br />
Note: it looks that '''238200''' is the minimal possible size, but you can choose a bigger number.<br />
* download [http://sourceforge.net/projects/grub4dos/files/ grub4dos] and copy <tt>grub.exe</tt><br />
mcopy -i winpe3_x86fdd.img grub.exe ::/<br />
* copy the payload<br />
mcopy -i winpe3_x86fdd.img winpe3_x86part.img ::/<br />
Note that this is the image of the partition, not of the whole HD. The reason why it works is grub.exe's [http://grub4dos.sourceforge.net/wiki/index.php/Grub4dos_tutorial#Auto_MBR_creation Auto MBR creation] feature, which tricks <tt>bootmgr</tt> into thinking that it boots from a real HD.<br />
* create the config file <tt>/tmp/syslinux.cfg</tt> and copy it<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
KERNEL /grub.exe<br />
APPEND --config-file="map (rd) (fd0); map --hook; chainloader (fd0)+1; rootnoverify (fd0)"<br />
INITRD /winpe3_x86part.img<br />
<br />
mcopy -i winpe3_x86fdd.img /tmp/syslinux.cfg ::/syslinux.cfg<br />
* install syslinux<br />
syslinux winpe3_x86fdd.img<br />
Note: if you computer is low on RAM (less than 350Mb) you may also try the following <tt>syslinux.cfg</tt> with direct mapping and make sure that the payload<br />
is in one contugous disk area.<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
KERNEL /grub.exe<br />
APPEND --config-file="map (hd0)/winpe3_x86part.img (fd0); map --hook; chainloader (fd0)+1; rootnoverify (fd0)"<br />
* now the image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with <br />
# dd if=winpe3_x86fdd.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades.</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Windows_PE&diff=48207Windows PE2010-04-13T18:07:45Z<p>Newhren: switch to direct mapping -- saves RAM</p>
<hr />
<div>Some utilities/drivers provided by IBM/Lenovo come only in the form of Windows executables (for example, [[Intel_Active_Management_Technology_(AMT)|Intel AMT]] firmware updates). And for people who don't use Windows OS on their computers it becomes impossible to use/apply them. Luckily, Microsoft provides [http://www.microsoft.com/downloads/en/results.aspx?pocId=&freetext=Automated%20Installation%20Kit&DisplayLang=en Automated Installation Kit] (aka AIK) for free to everyone with very few resctictions on usage (basically, they only prohibit using it as a substitute of a "real" OS, and allow to use it for any diagnostic and reapair tasks). The latest version is [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34 The Windows® Automated Installation Kit (AIK) for Windows® 7]. Users of Windows OS can install this AIK and create bootable CD-ROMs and bootable USB-flash drives with Windows PE (or WinPE for short), which is essentially a stripped-down version of Windows. In this article we will explain how to create bootable CD-ROMs and USB-flash drives with WinPE using only free software. Moreover, free software allows to create bootable USB-FDD with WinPE -- the feature not available to users of Microsoft tools :).<br />
<br />
==How to build a bootable WinPE *.iso image==<br />
* From the AIK installation file <tt>KB3AIK_EN.iso</tt>, provided in the form of a UDF disk image, use <tt>7z</tt> (from [http://sourceforge.net/projects/p7zip p7zip]) to extract the files <tt>wAIKX86.msi</tt> and <tt>WinPE.cab</tt><br />
* use <tt>7z</tt> or <tt>cabextract</tt> to unpack these files into <tt>/tmp/wAIKX86.msi/</tt> and <tt>/tmp/WinPE.cab/</tt> respectively<br />
* create a bootable WinPE *.iso image <tt>/tmp/winpe3_x86.iso</tt><br />
cd /tmp<br />
mkdir -p winpe3_x86/boot<br />
mkdir -p winpe3_x86/sources<br />
cp wAIKX86.msi/F_WINPE_X86_etfsboot.com winpe3_x86/etfsboot.com<br />
cp wAIKX86.msi/F1_BOOTMGR winpe3_x86/bootmgr<br />
cp wAIKX86.msi/F_WINPE_X86_bcd winpe3_x86/boot/bcd<br />
cp wAIKX86.msi/F_WINPE_X86_boot.sdi winpe3_x86/boot/boot.sdi<br />
cp WinPE.cab/F1_WINPE.WIM winpe3_x86/sources/boot.wim<br />
genisoimage -sysid "" -A "" -V "Microsoft Windows PE (x86)" -d -N -b etfsboot.com -no-emul-boot \<br />
-c boot.cat -hide etfsboot.com -hide boot.cat -o winpe3_x86.iso winpe3_x86<br />
the file you will get will be about 120M in size. Then you can burn this *.iso and boot it on any x86-machine which supports booting from CD-ROMs (which is pretty much any PC today)<br />
<br />
==How to build a bootable WinPE USB-flash image==<br />
a more convenient option would be to create a bootable USB-flash drive. Unfortunately, Windows loader <tt>bootmgr</tt> does not seem to support booting from USB-FDDs, while for some BIOSes this is the only type of bootable USB-flash devices.<br />
<br />
===Building WinPE USB-HDD image natively in a virtual machine===<br />
Since we already have a bootable WinPE *.iso image, we can use native Windows tools to build a bootable WinPE USB-HDD image in a virtual machine like '''qemu'''.<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86hdd.img count=250000<br />
* boot <tt>winpe3_x86.iso</tt> (which you've created before) in a virtual machine<br />
qemu -cdrom winpe3_x86.iso -boot d -m 300 -hda winpe3_x86hdd.img<br />
* now, in the shell provided by WinPE in the virtual machine<br />
diskpart.exe<br />
diskpart> list disk<br />
diskpart> select disk 0<br />
diskpart> clean<br />
diskpart> create partition primary<br />
diskpart> list partition<br />
diskpart> select partition 1<br />
diskpart> format fs=fat32 quick<br />
diskpart> active<br />
diskpart> assign<br />
diskpart> list volume<br />
diskpart> exit<br />
xcopy /s d:\* c:\<br />
wpeutil shutdown<br />
* when the virtual machine shuts down, the bootable WinPE image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86hdd.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades. If you want, you can create an additional partition for you firmware/diagnostic tools, just don't mess with the partition created by Windows -- you may reder it unbootable.<br />
<br />
===Building WinPE USB-HDD image with mtools and syslinux===<br />
if for some ethical or religious reasons you do not want to run any Windows code even in a virtual machine, or you don't have a virtual machine at all -- you can build a bootable WinPE USB-HDD image using '''syslinux''' and '''mtools'''.<br />
* create and format the partition image<br />
dd if=/dev/zero of=winpe3_x86part.img count='''234000'''<br />
/sbin/mkfs.vfat -F32 winpe3_x86part.img<br />
Note: it looks that '''234000''' is the minimal possible size, but you can choose a bigger number.<br />
* copy the files (you may have to put "mtools_skip_check=1" into <tt>~/.mtoolsrc</tt> if your partition is not aligned like mine)<br />
mmd -i winpe3_x86part.img boot<br />
mmd -i winpe3_x86part.img sources<br />
mcopy -i winpe3_x86part.img /tmp/wAIKX86.msi/F1_BOOTMGR ::/bootmgr<br />
mcopy -i winpe3_x86part.img /tmp/wAIKX86.msi/F_WINPE_X86_bcd ::/boot/bcd<br />
mcopy -i winpe3_x86part.img /tmp/wAIKX86.msi/F_WINPE_X86_boot.sdi ::/boot/boot.sdi<br />
mcopy -i winpe3_x86part.img /tmp/WinPE.cab/F1_WINPE.WIM ::/sources/boot.wim<br />
mcopy -i winpe3_x86part.img /usr/lib/syslinux/chain.c32 ::/chain.c32<br />
* create the config file <tt>/tmp/syslinux.cfg</tt> and copy it<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
COM32 /chain.c32<br />
APPEND boot ntldr=/bootmgr<br />
<br />
mcopy -i winpe3_x86part.img /tmp/syslinux.cfg ::/syslinux.cfg<br />
* install syslinux<br />
syslinux winpe3_x86part.img<br />
* create USB-HDD image of the size at least '''32''' sectors bigger than the size of the partition we've just created<br />
dd if=/dev/zero of=winpe3_x86hdd.img count='''234032'''<br />
* create a bootable partition entry<br />
/sbin/parted winpe3_x86hdd.img<br />
(parted) mklabel msdos<br />
(parted) unit s<br />
(parted) print free<br />
(parted) mkpart primary fat32<br />
(parted) set 1 boot on<br />
(parted) print<br />
(parted) quit<br />
* copy the partition image into the disk image<br />
dd if=winpe3_x86part.img of=winpe3_x86hdd.img seek='''32'''<br />
where '''32''' is the start sector of your partition<br />
* now the image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86hdd.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades.<br />
<br />
===Building WinPE USB-FDD image with mtools, syslinux and grub4dos===<br />
Any BIOS that supports booting from some USB media at all supports booting from USB-FDD. As it was mentioned ealier, the problem with WinPE is that the bootloader <tt>bootmgr</tt> does not seem to like such devices. So, we will have to create a virtual HDD. For some mystical reason, <tt>memdisk</tt> (the dirver for virtual disks which comes with syslinux) does not work on Thinkpads if the disk image is on a USB media. Thus we will use a rival technology [http://sourceforge.net/projects/grub4dos/files/ grub4dos].<br />
* create USB-FDD image<br />
dd if=/dev/zero of=winpe3_x86fdd.img count='''238200'''<br />
/sbin/mkfs.vfat -F32 winpe3_x86fdd.img<br />
Note: it looks that '''238200''' is the minimal possible size, but you can choose a bigger number.<br />
* download [http://sourceforge.net/projects/grub4dos/files/ grub4dos] and copy <tt>grub.exe</tt><br />
mcopy -i winpe3_x86fdd.img grub.exe ::/<br />
* copy the payload<br />
mcopy -i winpe3_x86fdd.img winpe3_x86part.img ::/<br />
Note that this is the image of the partition, not of the whole HD. The reason why it works is grub.exe's [http://grub4dos.sourceforge.net/wiki/index.php/Grub4dos_tutorial#Auto_MBR_creation Auto MBR creation] feature, which tricks <tt>bootmgr</tt> into thinking that it boots from a real HD.<br />
* create the config file <tt>/tmp/syslinux.cfg</tt> and copy it<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
KERNEL /grub.exe<br />
APPEND --config-file="map (hd0)/winpe3_x86part.img (fd0); map --hook; chainloader (fd0)+1; rootnoverify (fd0)"<br />
<br />
mcopy -i winpe3_x86fdd.img /tmp/syslinux.cfg ::/syslinux.cfg<br />
* install syslinux<br />
syslinux winpe3_x86fdd.img<br />
* now the image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with <br />
# dd if=winpe3_x86fdd.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades.</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Windows_PE&diff=48119Windows PE2010-04-10T18:05:46Z<p>Newhren: </p>
<hr />
<div>Some utilities/drivers provided by IBM/Lenovo come only in the form of Windows executables (for example, [[Intel_Active_Management_Technology_(AMT)|Intel AMT]] firmware updates). And for people who don't use Windows OS on their computers it becomes impossible to use/apply them. Luckily, Microsoft provides [http://www.microsoft.com/downloads/en/results.aspx?pocId=&freetext=Automated%20Installation%20Kit&DisplayLang=en Automated Installation Kit] (aka AIK) for free to everyone with very few resctictions on usage (basically, they only prohibit using it as a substitute of a "real" OS, and allow to use it for any diagnostic and reapair tasks). The latest version is [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34 The Windows® Automated Installation Kit (AIK) for Windows® 7]. Users of Windows OS can install this AIK and create bootable CD-ROMs and bootable USB-flash drives with Windows PE (or WinPE for short), which is essentially a stripped-down version of Windows. In this article we will explain how to create bootable CD-ROMs and USB-flash drives with WinPE using only free software. Moreover, free software allows to create bootable USB-FDD with WinPE -- the feature not available to users of Microsoft tools :).<br />
<br />
==How to build a bootable WinPE *.iso image==<br />
* From the AIK installation file <tt>KB3AIK_EN.iso</tt>, provided in the form of a UDF disk image, use <tt>7z</tt> (from [http://sourceforge.net/projects/p7zip p7zip]) to extract the files <tt>wAIKX86.msi</tt> and <tt>WinPE.cab</tt><br />
* use <tt>7z</tt> or <tt>cabextract</tt> to unpack these files into <tt>/tmp/wAIKX86.msi/</tt> and <tt>/tmp/WinPE.cab/</tt> respectively<br />
* create a bootable WinPE *.iso image <tt>/tmp/winpe3_x86.iso</tt><br />
cd /tmp<br />
mkdir -p winpe3_x86/boot<br />
mkdir -p winpe3_x86/sources<br />
cp wAIKX86.msi/F_WINPE_X86_etfsboot.com winpe3_x86/etfsboot.com<br />
cp wAIKX86.msi/F1_BOOTMGR winpe3_x86/bootmgr<br />
cp wAIKX86.msi/F_WINPE_X86_bcd winpe3_x86/boot/bcd<br />
cp wAIKX86.msi/F_WINPE_X86_boot.sdi winpe3_x86/boot/boot.sdi<br />
cp WinPE.cab/F1_WINPE.WIM winpe3_x86/sources/boot.wim<br />
genisoimage -sysid "" -A "" -V "Microsoft Windows PE (x86)" -d -N -b etfsboot.com -no-emul-boot \<br />
-c boot.cat -hide etfsboot.com -hide boot.cat -o winpe3_x86.iso winpe3_x86<br />
the file you will get will be about 120M in size. Then you can burn this *.iso and boot it on any x86-machine which supports booting from CD-ROMs (which is pretty much any PC today)<br />
<br />
==How to build a bootable WinPE USB-flash image==<br />
a more convenient option would be to create a bootable USB-flash drive. Unfortunately, Windows loader <tt>bootmgr</tt> does not seem to support booting from USB-FDDs, while for some BIOSes this is the only type of bootable USB-flash devices.<br />
<br />
===Building WinPE USB-HDD image natively in a virtual machine===<br />
Since we already have a bootable WinPE *.iso image, we can use native Windows tools to build a bootable WinPE USB-HDD image in a virtual machine like '''qemu'''.<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86hdd.img count=250000<br />
* boot <tt>winpe3_x86.iso</tt> (which you've created before) in a virtual machine<br />
qemu -cdrom winpe3_x86.iso -boot d -m 300 -hda winpe3_x86hdd.img<br />
* now, in the shell provided by WinPE in the virtual machine<br />
diskpart.exe<br />
diskpart> list disk<br />
diskpart> select disk 0<br />
diskpart> clean<br />
diskpart> create partition primary<br />
diskpart> list partition<br />
diskpart> select partition 1<br />
diskpart> format fs=fat32 quick<br />
diskpart> active<br />
diskpart> assign<br />
diskpart> list volume<br />
diskpart> exit<br />
xcopy /s d:\* c:\<br />
wpeutil shutdown<br />
* when the virtual machine shuts down, the bootable WinPE image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86hdd.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades. If you want, you can create an additional partition for you firmware/diagnostic tools, just don't mess with the partition created by Windows -- you may reder it unbootable.<br />
<br />
===Building WinPE USB-HDD image with mtools and syslinux===<br />
if for some ethical or religious reasons you do not want to run any Windows code even in a virtual machine, or you don't have a virtual machine at all -- you can build a bootable WinPE USB-HDD image using '''syslinux''' and '''mtools'''.<br />
* create and format the partition image<br />
dd if=/dev/zero of=winpe3_x86part.img count='''234000'''<br />
/sbin/mkfs.vfat -F32 winpe3_x86part.img<br />
Note: it looks that '''234000''' is the minimal possible size, but you can choose a bigger number.<br />
* copy the files (you may have to put "mtools_skip_check=1" into <tt>~/.mtoolsrc</tt> if your partition is not aligned like mine)<br />
mmd -i winpe3_x86part.img boot<br />
mmd -i winpe3_x86part.img sources<br />
mcopy -i winpe3_x86part.img /tmp/wAIKX86.msi/F1_BOOTMGR ::/bootmgr<br />
mcopy -i winpe3_x86part.img /tmp/wAIKX86.msi/F_WINPE_X86_bcd ::/boot/bcd<br />
mcopy -i winpe3_x86part.img /tmp/wAIKX86.msi/F_WINPE_X86_boot.sdi ::/boot/boot.sdi<br />
mcopy -i winpe3_x86part.img /tmp/WinPE.cab/F1_WINPE.WIM ::/sources/boot.wim<br />
mcopy -i winpe3_x86part.img /usr/lib/syslinux/chain.c32 ::/chain.c32<br />
* create the config file <tt>/tmp/syslinux.cfg</tt> and copy it<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
COM32 /chain.c32<br />
APPEND boot ntldr=/bootmgr<br />
<br />
mcopy -i winpe3_x86part.img /tmp/syslinux.cfg ::/syslinux.cfg<br />
* install syslinux<br />
syslinux winpe3_x86part.img<br />
* create USB-HDD image of the size at least '''32''' sectors bigger than the size of the partition we've just created<br />
dd if=/dev/zero of=winpe3_x86hdd.img count='''234032'''<br />
* create a bootable partition entry<br />
/sbin/parted winpe3_x86hdd.img<br />
(parted) mklabel msdos<br />
(parted) unit s<br />
(parted) print free<br />
(parted) mkpart primary fat32<br />
(parted) set 1 boot on<br />
(parted) print<br />
(parted) quit<br />
* copy the partition image into the disk image<br />
dd if=winpe3_x86part.img of=winpe3_x86hdd.img seek='''32'''<br />
where '''32''' is the start sector of your partition<br />
* now the image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86hdd.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades.<br />
<br />
===Building WinPE USB-FDD image with mtools, syslinux and grub4dos===<br />
Any BIOS that supports booting from some USB media at all supports booting from USB-FDD. As it was mentioned ealier, the problem with WinPE is that the bootloader <tt>bootmgr</tt> does not seem to like such devices. So, we will have to create a virtual HDD. For some mystical reason, <tt>memdisk</tt> (the dirver for virtual disks which comes with syslinux) does not work on Thinkpads if the disk image is on a USB media. Thus we will use a rival technology [http://sourceforge.net/projects/grub4dos/files/ grub4dos].<br />
* create USB-FDD image<br />
dd if=/dev/zero of=winpe3_x86fdd.img count='''238200'''<br />
/sbin/mkfs.vfat -F32 winpe3_x86fdd.img<br />
Note: it looks that '''238200''' is the minimal possible size, but you can choose a bigger number.<br />
* download [http://sourceforge.net/projects/grub4dos/files/ grub4dos] and copy <tt>grub.exe</tt><br />
mcopy -i winpe3_x86fdd.img grub.exe ::/<br />
* copy the payload<br />
mcopy -i winpe3_x86fdd.img winpe3_x86part.img ::/<br />
Note that this is the image of the partition, not of the whole HD. The reason why it works is grub.exe's [http://grub4dos.sourceforge.net/wiki/index.php/Grub4dos_tutorial#Auto_MBR_creation Auto MBR creation] feature, which tricks <tt>bootmgr</tt> into thinking that it boots from a real HD.<br />
* create the config file <tt>/tmp/syslinux.cfg</tt> and copy it<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
KERNEL /grub.exe<br />
APPEND --config-file="map (rd) (fd0); map --hook; chainloader (fd0)+1; rootnoverify (fd0)"<br />
INITRD /winpe3_x86part.img<br />
<br />
mcopy -i winpe3_x86fdd.img /tmp/syslinux.cfg ::/syslinux.cfg<br />
* install syslinux<br />
syslinux winpe3_x86fdd.img<br />
* now the image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with <br />
# dd if=winpe3_x86fdd.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades.</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Windows_PE&diff=48118Windows PE2010-04-10T17:58:47Z<p>Newhren: </p>
<hr />
<div>Some utilities/drivers provided by IBM/Lenovo come only in the form of Windows executables (for example, [[Intel_Active_Management_Technology_(AMT)|Intel AMT]] firmware updates). And for people who don't use Windows OS on their computers it becomes impossible to use/apply them. Luckily, Microsoft provides [http://www.microsoft.com/downloads/en/results.aspx?pocId=&freetext=Automated%20Installation%20Kit&DisplayLang=en Automated Installation Kit] (aka AIK) for free to everyone with very few resctictions on usage (basically, they only prohibit using it as a substitute of a "real" OS, and allow to use it for any diagnostic and reapair tasks). The latest version is [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34 The Windows® Automated Installation Kit (AIK) for Windows® 7]. Users of Windows OS can install this AIK and create bootable CD-ROMs and bootable USB-flash drives with Windows PE (or WinPE for short), which is essentially a stripped-down version of Windows. In this article we will explain how to create bootable CD-ROMs and USB-flash drives with WinPE using only free software. Moreover, free software allows to create bootable USB-FDD with WinPE -- the feature not available to users of Microsoft tools :).<br />
<br />
==How to build a bootable WinPE *.iso image==<br />
* From the AIK installation file <tt>KB3AIK_EN.iso</tt>, provided in the form of a UDF disk image, use <tt>7z</tt> (from [http://sourceforge.net/projects/p7zip p7zip]) to extract the files <tt>wAIKX86.msi</tt> and <tt>WinPE.cab</tt><br />
* use <tt>7z</tt> or <tt>cabextract</tt> to unpack these files into <tt>/tmp/wAIKX86.msi/</tt> and <tt>/tmp/WinPE.cab/</tt> respectively<br />
* create a bootable WinPE *.iso image <tt>/tmp/winpe3_x86.iso</tt><br />
cd /tmp<br />
mkdir -p winpe3_x86/boot<br />
mkdir -p winpe3_x86/sources<br />
cp wAIKX86.msi/F_WINPE_X86_etfsboot.com winpe3_x86/etfsboot.com<br />
cp wAIKX86.msi/F1_BOOTMGR winpe3_x86/bootmgr<br />
cp wAIKX86.msi/F_WINPE_X86_bcd winpe3_x86/boot/bcd<br />
cp wAIKX86.msi/F_WINPE_X86_boot.sdi winpe3_x86/boot/boot.sdi<br />
cp WinPE.cab/F1_WINPE.WIM winpe3_x86/sources/boot.wim<br />
genisoimage -sysid "" -A "" -V "Microsoft Windows PE (x86)" -d -N -b etfsboot.com -no-emul-boot \<br />
-c boot.cat -hide etfsboot.com -hide boot.cat -o winpe3_x86.iso winpe3_x86<br />
the file you will get will be about 120M in size. Then you can burn this *.iso and boot it on any x86-machine which supports booting from CD-ROMs (which is pretty much any PC today)<br />
<br />
==How to build a bootable WinPE USB-flash image==<br />
a more convenient option would be to create a bootable USB-flash drive. Unfortunately, Windows loader <tt>bootmgr</tt> does not seem to support booting from USB-FDDs, while for some BIOSes this is the only type of bootable USB-flash devices.<br />
<br />
===Building WinPE USB-HDD image natively in a virtual machine===<br />
Since we already have a bootable WinPE *.iso image, we can use native Windows tools to build a bootable WinPE USB-HDD image in a virtual machine like '''qemu'''.<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86hdd.img count=250000<br />
* boot <tt>winpe3_x86.iso</tt> (which you've created before) in a virtual machine<br />
qemu -cdrom winpe3_x86.iso -boot d -m 300 -hda winpe3_x86hdd.img<br />
* now, in the shell provided by WinPE in the virtual machine<br />
diskpart.exe<br />
diskpart> list disk<br />
diskpart> select disk 0<br />
diskpart> clean<br />
diskpart> create partition primary<br />
diskpart> list partition<br />
diskpart> select partition 1<br />
diskpart> format fs=fat32 quick<br />
diskpart> active<br />
diskpart> assign<br />
diskpart> list volume<br />
diskpart> exit<br />
xcopy /s d:\* c:\<br />
wpeutil shutdown<br />
* when the virtual machine shuts down, the bootable WinPE image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86hdd.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades. If you want, you can create an additional partition for you firmware/diagnostic tools, just don't mess with the partition created by Windows -- you may reder it unbootable.<br />
<br />
===Building WinPE USB-HDD image with mtools and syslinux===<br />
if for some ethical or religious reasons you do not want to run any Windows code even in a virtual machine, or you don't have a virtual machine at all -- you can build a bootable WinPE USB-HDD image using '''syslinux''' and '''mtools'''.<br />
* create and format the partition image<br />
dd if=/dev/zero of=winpe3_x86part.img count='''234000'''<br />
/sbin/mkfs.vfat -F32 winpe3_x86part.img<br />
Note: it looks that '''234000''' is the minimal possible size, but you can choose a bigger number.<br />
* copy the files (you may have to put "mtools_skip_check=1" into <tt>~/.mtoolsrc</tt> if your partition is not aligned like mine)<br />
mmd -i winpe3_x86part.img boot<br />
mmd -i winpe3_x86part.img sources<br />
mcopy -i winpe3_x86part.img /tmp/wAIKX86.msi/F1_BOOTMGR ::/bootmgr<br />
mcopy -i winpe3_x86part.img /tmp/wAIKX86.msi/F_WINPE_X86_bcd ::/boot/bcd<br />
mcopy -i winpe3_x86part.img /tmp/wAIKX86.msi/F_WINPE_X86_boot.sdi ::/boot/boot.sdi<br />
mcopy -i winpe3_x86part.img /tmp/WinPE.cab/F1_WINPE.WIM ::/sources/boot.wim<br />
mcopy -i winpe3_x86part.img /usr/lib/syslinux/chain.c32 ::/chain.c32<br />
* create the config file <tt>/tmp/syslinux.cfg</tt> and copy it<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
COM32 /chain.c32<br />
APPEND boot ntldr=/bootmgr<br />
<br />
mcopy -i winpe3_x86part.img /tmp/syslinux.cfg ::/syslinux.cfg<br />
* install syslinux<br />
syslinux winpe3_x86part.img<br />
* create USB-HDD image of the size at least '''32''' sectors bigger than the size of the partition we've just created<br />
dd if=/dev/zero of=winpe3_x86hdd.img count='''234032'''<br />
* create a bootable partition entry<br />
/sbin/parted winpe3_x86hdd.img<br />
(parted) mklabel msdos<br />
(parted) unit s<br />
(parted) print free<br />
(parted) mkpart primary fat32<br />
(parted) set 1 boot on<br />
(parted) print<br />
(parted) quit<br />
* copy the partition image into the disk image<br />
dd if=winpe3_x86part.img of=winpe3_x86hdd.img seek='''32'''<br />
where '''32''' is the start sector of your partition<br />
* now the image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86hdd.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades.<br />
<br />
===Building WinPE USB-FDD image with mtools, syslinux and grub4dos===<br />
Any BIOS that supports booting from some USB media at all supports booting from USB-FDD. As it was mentioned ealier, the problem with WinPE is that the bootloader <tt>bootmgr</tt> does not seem to like such devices. So, we will have to create a virtual HDD. For some mystical reason, <tt>memdisk</tt> (the dirver for virtual disks which comes with syslinux) does not work on Thinkpads if the disk image is on a USB media. Thus we will use a rival technology [http://sourceforge.net/projects/grub4dos/files/ grub4dos].<br />
* create USB-FDD image<br />
dd if=/dev/zero of=winpe3_x86fdd.img count='''238200'''<br />
/sbin/mkfs.vfat -F32 winpe3_x86fdd.img<br />
Note: it looks that '''238200''' is the minimal possible size, but you can choose a bigger number.<br />
* download [http://sourceforge.net/projects/grub4dos/files/ grub4dos] and copy <tt>grub.exe</tt><br />
mcopy -i winpe3_x86fdd.img grub.exe ::/<br />
* copy the payload<br />
mcopy -i winpe3_x86fdd.img winpe3_x86part.img ::/winpe.img<br />
Note that this is the image of the partition, not of the whole HD. The reason why it works is grub.exe's [http://grub4dos.sourceforge.net/wiki/index.php/Grub4dos_tutorial#Auto_MBR_creation Auto MBR creation] feature, which tricks <tt>bootmgr</tt> into thinking that it boots from a real HD.<br />
* create the config file <tt>/tmp/syslinux.cfg</tt> and copy it<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
KERNEL /grub.exe<br />
APPEND --config-file="map (rd) (fd0); map --hook; chainloader (fd0)+1; rootnoverify (fd0)"<br />
INITRD /winpe.img<br />
<br />
mcopy -i winpe3_x86fdd.img /tmp/syslinux.cfg ::/syslinux.cfg<br />
* install syslinux<br />
syslinux winpe3_x86fdd.img<br />
* now the image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with <br />
# dd if=winpe3_x86fdd.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades.</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=BIOS_update_without_optical_disk&diff=48107BIOS update without optical disk2010-04-08T05:35:36Z<p>Newhren: </p>
<hr />
<div>For recent models, such as Thinkpad {{X200}}, Lenovo provides both win32 ''"BIOS update utility"'' and iso-image of ''"BIOS Update (Bootable CD)"''. If you don't have Windows installed, the first option is obviously unavailable for you. If you have an optical drive of some kind (internal, or built into the docking station, or an external USB drive) you can burn the iso-image and proceed with the BIOS update. In case if you don't have any optical drive things get a little tricky.<br />
<br />
A quick look at the ''BIOS Update (Bootable CD)'' iso-image shows that its <tt>iso9660</tt> filesystem is empty and its bootimage is of <tt>BootMediaType=4</tt>, i.e. it is a [http://www.phoenix.com/NR/rdonlyres/98D3219C-9CC9-4DF5-B496-A286D893E36A/0/specscdrom.pdf harddisk emulation]. Therefore non of the methods discussed in [[BIOS_Upgrade/X_Series]] would work. There are many Linux tools which extract bootimages from iso-images, but after a search over the net, I didn't find any which works correctly with <tt>BootMediaType=4</tt> (e.g. <tt>geteltorito</tt> form '''genisoimage''' package messes things up). I found, however, a free open-source DOS utility '''isobar''' from [http://shsucdx.adoxa.cjb.net/ shsucd] package. So, I just [http://colimit.googlepages.com/isobar.c ported] it to linux.<br />
<br />
UPDATE: the [http://www.uni-koblenz.de/~krienke/ftp/noarch/geteltorito/geteltorito latest] version of geteltorito now includes my patch and works with <tt>BootMediaType=4</tt>.<br />
<br />
'''Note:''' I used the method, described below to update the BIOS on my {{X200}}. It may or may not work for you, even if the ''BIOS Update (Bootable CD)'' iso-image has the same structure. It is not clear what is the root of the problem, but in some cases PC-DOS, used by Lenovo, hangs when booted via <tt>memdisk</tt>. The location from which <tt>memdisk</tt> is loaded (harddrive, USB-stick, or cdrom) also matters (for {{X200}}, harddrive works but USB-stick hangs).<br />
<br />
* make sure that you have '''syslinux''' installed (we will need <tt>memdisk</tt> from this package)<br />
<br />
apt-get install syslinux<br />
<br />
* compile the [http://colimit.googlepages.com/isobar.c isobar] utility<br />
<br />
gcc isobar.c -o isobar<br />
<br />
* extract the bootimage from the ''BIOS Update (Bootable CD)'' iso-image and copy it to the boot partition<br />
<br />
./isobar 6duj08uc.iso -o bios.img<br />
cp bios.img /boot/bios.img<br />
<br />
* copy <tt>memdisk</tt> loader to the boot partition<br />
<br />
cp /usr/lib/syslinux/memdisk /boot/memdisk<br />
<br />
* If you are using grub1 / grub-legacy append the following lines to /boot/grub/menu.lst<br />
<br />
title BIOS update<br />
root (hd0,0)<br />
kernel /memdisk<br />
initrd /bios.img<br />
<br />
* If you are using grub2 (Debian squeeze/sid), append the following to /etc/grub.d/40_custom<br />
<br />
menuentry "BIOS Update" {<br />
linux16 /boot/memdisk<br />
initrd16 /boot/bios.img<br />
}<br />
<br />
* Run update-grub to regenerate /boot/grub/grub.cfg<br />
<br />
* reboot, and in the grub menu choose the <tt>BIOS update</tt> option<br />
<br />
==Hard drive firmware update utility==<br />
<br />
Besides BIOS updates, Lenovo also provides [[Hard drive firmware update]] utility in the form of a bootable iso-image. Quick check shows that in some cases it has the same structure as above, i.e. empty <tt>iso9660</tt> filesystem and bootimage of <tt>BootMediaType=4</tt>. So, naturally, one would think that we can boot it in the same way as above, via <tt>grub</tt> & <tt>memdisk</tt>. However, common sense tells that it is not a good idea to read the firmware from the same very harddrive whose firmware we are updating. But looking further into the structure of the bootimage we see that first it creates a <tt>RAMDRIVE</tt>, copies the update utility there, and launches it from the <tt>RAMDRIVE</tt>. So, it is actually OK to use <tt>grub</tt>. Tested on my {{X200}}.<br />
<br />
==Related links==<br />
Here is a [http://colimit.googlepages.com/geteltorito.diff patch] to <tt>geteltorito</tt> script to make it work correctly with <tt>BootMediaType=4</tt>.<br />
<br />
==Should work with==<br />
{{T400}}, {{R400}}, {{T500}}, {{R500}}, {{X200}}, {{x200s}}, {{X200_Tablet}}, {{X301}}, {{W500}}, {{W700}}, [[Hard drive firmware update]]</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Windows_PE&diff=48106Windows PE2010-04-08T04:28:25Z<p>Newhren: remove kexec-loader</p>
<hr />
<div>Some utilities/drivers provided by IBM/Lenovo come only in the form of Windows executables (for example, [[Intel_Active_Management_Technology_(AMT)|Intel AMT]] firmware updates). And for people who don't use Windows OS on their computers it becomes impossible to use/apply them. Luckily, Microsoft provides [http://www.microsoft.com/downloads/en/results.aspx?pocId=&freetext=Automated%20Installation%20Kit&DisplayLang=en Automated Installation Kit] (aka AIK) for free to everyone with very few resctictions on usage (basically, they only prohibit using it as a substitute of a "real" OS, and allow to use it for any diagnostic and reapair tasks). The latest version is [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34 The Windows® Automated Installation Kit (AIK) for Windows® 7]. Users of Windows OS can install this AIK and create bootable CD-ROMs and bootable USB-flash drives with Windows PE (or WinPE for short), which is essentially a stripped-down version of Windows. In this article we will explain how to create bootable CD-ROMs and USB-flash drives with WinPE using only free software. Moreover, free software allows to create bootable USB-FDD with WinPE -- the feature not available to users of Microsoft tools :).<br />
<br />
==How to build a bootable WinPE *.iso image==<br />
* From the AIK installation file <tt>KB3AIK_EN.iso</tt>, provided in the form of a UDF disk image, use <tt>7z</tt> (from [http://sourceforge.net/projects/p7zip p7zip]) to extract the files <tt>wAIKX86.msi</tt> and <tt>WinPE.cab</tt><br />
* use <tt>7z</tt> or <tt>cabextract</tt> to unpack these files into <tt>/tmp/wAIKX86.msi/</tt> and <tt>/tmp/WinPE.cab/</tt> respectively<br />
* create a bootable WinPE *.iso image <tt>/tmp/winpe3_x86.iso</tt><br />
cd /tmp<br />
mkdir -p winpe3_x86/boot<br />
mkdir -p winpe3_x86/sources<br />
cp wAIKX86.msi/F_WINPE_X86_etfsboot.com winpe3_x86/etfsboot.com<br />
cp wAIKX86.msi/F1_BOOTMGR winpe3_x86/bootmgr<br />
cp wAIKX86.msi/F_WINPE_X86_bcd winpe3_x86/boot/bcd<br />
cp wAIKX86.msi/F_WINPE_X86_boot.sdi winpe3_x86/boot/boot.sdi<br />
cp WinPE.cab/F1_WINPE.WIM winpe3_x86/sources/boot.wim<br />
genisoimage -sysid "" -A "" -V "Microsoft Windows PE (x86)" -d -N -b etfsboot.com -no-emul-boot \<br />
-c boot.cat -hide etfsboot.com -hide boot.cat -o winpe3_x86.iso winpe3_x86<br />
the file you will get will be about 120M in size. Then you can burn this *.iso and boot it on any x86-machine which supports booting from CD-ROMs (which is pretty much any PC today)<br />
<br />
==How to build a bootable WinPE USB-flash image==<br />
a more convenient option would be to create a bootable USB-flash drive. Unfortunately, Windows loader <tt>bootmgr</tt> does not seem to support booting from USB-FDDs, while for some BIOSes this is the only type of bootable USB-flash devices.<br />
<br />
===Building WinPE USB-HDD image natively in a virtual machine===<br />
Since we already have a bootable WinPE *.iso image, we can use native Windows tools to build a bootable WinPE USB-HDD image in a virtual machine like '''qemu'''.<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86hdd.img count=250000<br />
* boot <tt>winpe3_x86.iso</tt> (which you've created before) in a virtual machine<br />
qemu -cdrom winpe3_x86.iso -boot d -m 300 -hda winpe3_x86hdd.img<br />
* now, in the shell provided by WinPE in the virtual machine<br />
diskpart.exe<br />
diskpart> list disk<br />
diskpart> select disk 0<br />
diskpart> clean<br />
diskpart> create partition primary<br />
diskpart> list partition<br />
diskpart> select partition 1<br />
diskpart> format fs=fat32 quick<br />
diskpart> active<br />
diskpart> assign<br />
diskpart> list volume<br />
diskpart> exit<br />
xcopy /s d:\* c:\<br />
wpeutil shutdown<br />
* when the virtual machine shuts down, the bootable WinPE image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86hdd.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades. If you want, you can create an additional partition for you firmware/diagnostic tools, just don't mess with the partition created by Windows -- you may reder it unbootable.<br />
<br />
===Building WinPE USB-HDD image with mtools and syslinux===<br />
if for some ethical or religious reasons you do not want to run any Windows code even in a virtual machine, or you don't have a virtual machine at all -- you can build a bootable WinPE USB-HDD image using '''syslinux''' and '''mtools'''.<br />
* create and format the partition image<br />
dd if=/dev/zero of=winpe3_x86part.img count='''234000'''<br />
/sbin/mkfs.vfat -F32 winpe3_x86part.img<br />
Note: it looks that '''234000''' is the minimal possible size, but you can choose a bigger number.<br />
* copy the files (you may have to put "mtools_skip_check=1" into <tt>~/.mtoolsrc</tt> if your partition is not aligned like mine)<br />
mmd -i winpe3_x86part.img boot<br />
mmd -i winpe3_x86part.img sources<br />
mcopy -i winpe3_x86part.img /tmp/wAIKX86.msi/F1_BOOTMGR ::/bootmgr<br />
mcopy -i winpe3_x86part.img /tmp/wAIKX86.msi/F_WINPE_X86_bcd ::/boot/bcd<br />
mcopy -i winpe3_x86part.img /tmp/wAIKX86.msi/F_WINPE_X86_boot.sdi ::/boot/boot.sdi<br />
mcopy -i winpe3_x86part.img /tmp/WinPE.cab/F1_WINPE.WIM ::/sources/boot.wim<br />
mcopy -i winpe3_x86part.img /usr/lib/syslinux/chain.c32 ::/chain.c32<br />
* create the config file <tt>/tmp/syslinux.cfg</tt> and copy it<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
COM32 /chain.c32<br />
APPEND boot ntldr=/bootmgr<br />
<br />
mcopy -i winpe3_x86part.img /tmp/syslinux.cfg ::/syslinux.cfg<br />
* install syslinux<br />
syslinux winpe3_x86part.img<br />
* create USB-HDD image of the size at least '''32''' sectors bigger than the size of the partition we've just created<br />
dd if=/dev/zero of=winpe3_x86hdd.img count='''234032'''<br />
* create a bootable partition entry<br />
/sbin/parted winpe3_x86hdd.img<br />
(parted) mklabel msdos<br />
(parted) unit s<br />
(parted) print free<br />
(parted) mkpart primary fat32<br />
(parted) set 1 boot on<br />
(parted) print<br />
(parted) quit<br />
* copy the partition image into the disk image<br />
dd if=winpe3_x86part.img of=winpe3_x86hdd.img seek='''32'''<br />
where '''32''' is the start sector of your partition<br />
* now the image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86hdd.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades.<br />
<br />
===Building WinPE USB-FDD image with mtools, syslinux and grub4dos===<br />
Any BIOS that supports booting from some USB media at all supports booting from USB-FDD. As it was mentioned ealier, the problem with WinPE is that the bootloader <tt>bootmgr</tt> does not seem to like such devices.<br />
* create USB-FDD image<br />
dd if=/dev/zero of=winpe3_x86fdd.img count='''238200'''<br />
/sbin/mkfs.vfat -F32 winpe3_x86fdd.img<br />
Note: it looks that '''238200''' is the minimal possible size, but you can choose a bigger number.<br />
* download [http://sourceforge.net/projects/grub4dos/files/ grub4dos] and copy <tt>grub.exe</tt><br />
mcopy -i winpe3_x86fdd.img grub.exe ::/<br />
* copy the payload<br />
mcopy -i winpe3_x86fdd.img winpe3_x86part.img ::/winpe.img<br />
Note that this is the image of the partition, not of the whole HD. The reason why it works is grub.exe's [http://grub4dos.sourceforge.net/wiki/index.php/Grub4dos_tutorial#Auto_MBR_creation Auto MBR creation] feature, which tricks <tt>bootmgr</tt> into thinking that it boots from a real HD.<br />
* create the config file <tt>/tmp/syslinux.cfg</tt> and copy it<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
KERNEL /grub.exe<br />
APPEND --config-file="map (rd) (fd0); map --hook; chainloader (fd0)+1; rootnoverify (fd0)"<br />
INITRD /winpe.img<br />
<br />
mcopy -i winpe3_x86fdd.img /tmp/syslinux.cfg ::/syslinux.cfg<br />
* install syslinux<br />
syslinux winpe3_x86fdd.img<br />
* now the image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with <br />
# dd if=winpe3_x86fdd.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades.</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Windows_PE&diff=48105Windows PE2010-04-08T03:04:36Z<p>Newhren: </p>
<hr />
<div>Some utilities/drivers provided by IBM/Lenovo come only in the form of Windows executables (for example, [[Intel_Active_Management_Technology_(AMT)|Intel AMT]] firmware updates). And for people who don't use Windows OS on their computers it becomes impossible to use/apply them. Luckily, Microsoft provides [http://www.microsoft.com/downloads/en/results.aspx?pocId=&freetext=Automated%20Installation%20Kit&DisplayLang=en Automated Installation Kit] (aka AIK) for free to everyone with very few resctictions on usage (basically, they only prohibit using it as a substitute of a "real" OS, and allow to use it for any diagnostic and reapair tasks). The latest version is [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34 The Windows® Automated Installation Kit (AIK) for Windows® 7]. Users of Windows OS can install this AIK and create bootable CD-ROMs and bootable USB-flash drives with Windows PE (or WinPE for short), which is essentially a stripped-down version of Windows. In this article we will explain how to create bootable CD-ROMs and USB-flash drives with WinPE using only free software. Moreover, free software allows to create bootable USB-FDD with WinPE -- the feature not available to Windows users :).<br />
<br />
==How to build a bootable WinPE *.iso image==<br />
* From the AIK installation file <tt>KB3AIK_EN.iso</tt>, provided in the form of a UDF disk image, use <tt>7z</tt> (from [http://sourceforge.net/projects/p7zip p7zip]) to extract the files <tt>wAIKX86.msi</tt> and <tt>WinPE.cab</tt><br />
* use <tt>7z</tt> or <tt>cabextract</tt> to unpack these files into <tt>/tmp/wAIKX86.msi/</tt> and <tt>/tmp/WinPE.cab/</tt> respectively<br />
* create a bootable WinPE *.iso image <tt>/tmp/winpe3_x86.iso</tt><br />
cd /tmp<br />
mkdir -p winpe3_x86/boot<br />
mkdir -p winpe3_x86/sources<br />
cp wAIKX86.msi/F_WINPE_X86_etfsboot.com winpe3_x86/etfsboot.com<br />
cp wAIKX86.msi/F1_BOOTMGR winpe3_x86/bootmgr<br />
cp wAIKX86.msi/F_WINPE_X86_bcd winpe3_x86/boot/bcd<br />
cp wAIKX86.msi/F_WINPE_X86_boot.sdi winpe3_x86/boot/boot.sdi<br />
cp WinPE.cab/F1_WINPE.WIM winpe3_x86/sources/boot.wim<br />
genisoimage -sysid "" -A "" -V "Microsoft Windows PE (x86)" -d -N -b etfsboot.com -no-emul-boot \<br />
-c boot.cat -hide etfsboot.com -hide boot.cat -o winpe3_x86.iso winpe3_x86<br />
the file you will get will be about 120M in size. Then you can burn this *.iso and boot it on any x86-machine which supports booting from CD-ROMs (which is pretty much any PC today)<br />
<br />
==How to build a bootable WinPE USB-HDD image==<br />
a more convenient option would be to create a bootable USB-flash drive. Unfortunately, Windows loader does not seem to support booting from USB-FDDs, while for some BIOSes this is the only type of bootable USB-flash devices.<br />
<br />
===Building WinPE USB-HDD image in a virtual machine===<br />
Since we already have a bootable WinPE *.iso image, we can use it to build a bootable WinPE USB-HDD image in a virtual machine like '''qemu'''.<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86.img count=250000<br />
* boot <tt>winpe3_x86.iso</tt> (which you've created before) in a virtual machine<br />
qemu -cdrom winpe3_x86.iso -boot d -m 640 -hda winpe3_x86.img<br />
* now, in the shell provided by WinPE in the virtual machine<br />
diskpart.exe<br />
diskpart> list disk<br />
diskpart> select disk 0<br />
diskpart> clean<br />
diskpart> create partition primary<br />
diskpart> list partition<br />
diskpart> select partition 1<br />
diskpart> format fs=fat32 quick<br />
diskpart> active<br />
diskpart> assign<br />
diskpart> list volume<br />
diskpart> exit<br />
xcopy /s d:\* c:\<br />
wpeutil shutdown<br />
* when the virtual machine shuts down, the bootable WinPE image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades. If you want, you can create an additional partition for you firmware/diagnostic tools, just don't mess with the partition created by Windows -- you may reder it unbootable.<br />
<br />
===Building WinPE USB-HDD image with syslinux===<br />
if for some ethical or religious reasons you do not want to run any Windows code even in a virtual machine, or you don't have a virtual machine at all -- you can build a bootable WinPE USB-HDD image using '''syslinux''' and '''mtools'''.<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86.img count=250000<br />
* create a bootable partition entry<br />
/sbin/parted winpe3_x86.img<br />
(parted) mklabel msdos<br />
(parted) unit s<br />
(parted) print free<br />
(parted) mkpart primary fat32<br />
(parted) set 1 boot on<br />
(parted) print<br />
in my case the output looks like this. Note the numbers corresponding to "Start" and "Size" of your partition, we will use them in the next command<br />
Model: (file)<br />
Disk /tmp/winpe3_x86.img: 250000s<br />
Sector size (logical/physical): 512B/512B<br />
Partition Table: msdos<br />
<br />
Number Start End Size Type File system Flags<br />
1 '''32'''s 249999s '''249968'''s primary boot, lba<br />
* create and format the partition image<br />
dd if=/dev/zero of=winpe3_x86p1.img count='''249968'''<br />
/sbin/mkfs.vfat -F32 winpe3_x86p1.img<br />
* copy the files (you may have to put "mtools_skip_check=1" into <tt>~/.mtoolsrc</tt> if your partition is not aligned like mine)<br />
mmd -i winpe3_x86p1.img boot<br />
mmd -i winpe3_x86p1.img sources<br />
mcopy -i winpe3_x86p1.img /tmp/wAIKX86.msi/F1_BOOTMGR ::/bootmgr<br />
mcopy -i winpe3_x86p1.img /tmp/wAIKX86.msi/F_WINPE_X86_bcd ::/boot/bcd<br />
mcopy -i winpe3_x86p1.img /tmp/wAIKX86.msi/F_WINPE_X86_boot.sdi ::/boot/boot.sdi<br />
mcopy -i winpe3_x86p1.img /tmp/WinPE.cab/F1_WINPE.WIM ::/sources/boot.wim<br />
mcopy -i winpe3_x86p1.img /usr/lib/syslinux/chain.c32 ::/chain.c32<br />
* create the config file <tt>/tmp/syslinux.cfg</tt> and copy it<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
COM32 /chain.c32<br />
APPEND boot ntldr=/bootmgr<br />
<br />
mcopy -i winpe3_x86p1.img /tmp/syslinux.cfg ::/syslinux.cfg<br />
* install syslinux and copy the partition image into the disk image<br />
syslinux winpe3_x86p1.img<br />
dd if=winpe3_x86p1.img of=winpe3_x86.img seek='''32'''<br />
* now the image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades.<br />
<br />
==How to build a bootable WinPE USB-FDD image==<br />
Any BIOS that supports booting from some USB media at all supports booting from USB-FDD. As it was mentioned ealier, the problem with WinPE is that the bootloader <tt>bootmgr</tt> does not seem to like such devices. A natural thing to do would be to create a virtual HDD, e.g. with <tt>memdisk</tt>, and boot from there. But here we face a deficiency of <tt>memdisk</tt>: for some BIOSes (including Thinkpads!) it will boot if the disk-image physically resides on a real HDD, but will hang if the image is on a USB media.<br />
<br />
The only workaround I've found for making a bootable WinPE USB-FDD looks awkward, but it works! Ironically, to boot Windows we will have first to boot Linux, and then use '''kexec''' feature of the Linux kernel. The bootloader [http://www.solemnwarning.net/kexec-loader kexec-loader] does exactly that: it is a stripped down Linux distro which can detect block devices, mount them and execute <tt>kexec</tt>.<br />
<br />
* get a copy of [http://www.solemnwarning.net/kexec-loader/downloads/kexec-loader-2.2.1-floppy.img.gz kexec-loader-floppy]<br />
* prepare a blank<br />
dd if=/dev/zero of=win.img count=260000<br />
/sbin/mkfs.vfat -F32 win.img -n kexecloader<br />
* copy the contents of the kexec-loader floppy into <tt>/tmp/kexec-loader</tt><br />
mkdir /tmp/kexec-loader<br />
mcopy -i kexec-loader-2.2.1-floppy.img -s ::/* kexec-loader<br />
rm kexec-loader/syslinux/ldlinux.sys<br />
Note: since kexec-loader is a micro Linux distro, it is extremely configurable. For example, you may find it useful downloading [http://www.solemnwarning.net/kexec-loader/downloads/modules-2.6.30.5-1.tar.gz modules] and the [http://www.solemnwarning.net/kexec-loader/downloads/kexec-loader-2.2.1.tar.gz sources], and adding some modules into <tt>initrd.img</tt> with "<tt>./addmod.sh initrd.img memstick.tlz mmc-sd.tlz</tt>", where <tt>addmod.sh</tt> is a script from the source package and <tt>*.tlz</tt> are modules from the modules package. But make sure that you DO NOT include any SATA-drivers, or <tt>grub.exe</tt> will refuse to boot (or you will have to tweak BIOS and switch harddrive controller from "AHCI mode" into "Compatibility mode"). <br />
* download [http://sourceforge.net/projects/grub4dos/files/ grub4dos] and copy <tt>grub.exe</tt><br />
cp grub.exe kexec-loader/<br />
* copy WinPE image<br />
cp /tmp/winpe3_x86p1.img kexec-loader/winpe.img<br />
Note that this is the image of the partition, not of the whole HD. The reason why it works is grub.exe's [http://grub4dos.sourceforge.net/wiki/index.php/Grub4dos_tutorial#Auto_MBR_creation Auto MBR creation] feature, which tricks <tt>bootmgr</tt> into thinking that it boots from a real HD.<br />
* figure out UUID of your USB-FDD image<br />
/sbin/blkid win.img<br />
<br />
win.img: LABEL="kexecloader" UUID="'''8166-E075'''" TYPE="vfat" <br />
* configure kexec-loader by replacing <tt>kexec-loader/kexec-loader.conf</tt> with<br />
<br />
timeout 1<br />
<br />
title WinPE<br />
root UUID='''8166-E075'''<br />
kernel /grub.exe<br />
cmdline --config-file="map (rd) (fd0); map --hook; chainloader (fd0)+1; rootnoverify (fd0)"<br />
initrd /winpe.img<br />
* make bootable USB-FDD image (you may have to put "mtools_skip_check=1" into <tt>~/.mtoolsrc</tt> if your partition is not aligned)<br />
mcopy -i win.img -s kexec-loader/* ::<br />
syslinux win.img -d syslinux<br />
* now the image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with <br />
# dd if=win.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades. When booting -- be patient, don't interrupt kexec-loader. Reading speed of USB media is slow.</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Windows_PE&diff=48101Windows PE2010-04-07T19:44:55Z<p>Newhren: </p>
<hr />
<div>Some utilities/drivers provided by IBM/Lenovo come only in the form of Windows executables (for example, [[Intel_Active_Management_Technology_(AMT)|Intel AMT]] firmware updates). And for people who don't use Windows OS on their computers it becomes impossible to use/apply them. Luckily, Microsoft provides [http://www.microsoft.com/downloads/en/results.aspx?pocId=&freetext=Automated%20Installation%20Kit&DisplayLang=en Automated Installation Kit] (aka AIK) for free to everyone with very few resctictions on usage (basically, they only prohibit using it as a substitute of a "real" OS, and allow to use it for any diagnostic and reapair tasks). The latest version is [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34 The Windows® Automated Installation Kit (AIK) for Windows® 7]. Users of Windows OS can install this AIK and create bootable CD-ROMs and bootable USB-flash drives with Windows PE (or WinPE for short), which is essentially a stripped-down version of Windows. In this article we will explain how to create bootable CD-ROMs and USB-flash drives with WinPE using only free software. Moreover, free software allows to create bootable USB-FDD with WinPE -- the feature not available to Windows users :).<br />
<br />
==How to build a bootable WinPE *.iso image==<br />
* From the AIK installation file <tt>KB3AIK_EN.iso</tt>, provided in the form of a UDF disk image, use <tt>7z</tt> (from [http://sourceforge.net/projects/p7zip p7zip]) to extract the files <tt>wAIKX86.msi</tt> and <tt>WinPE.cab</tt><br />
* use <tt>7z</tt> or <tt>cabextract</tt> to unpack these files into <tt>/tmp/wAIKX86.msi/</tt> and <tt>/tmp/WinPE.cab/</tt> respectively<br />
* create a bootable WinPE *.iso image <tt>/tmp/winpe3_x86.iso</tt><br />
cd /tmp<br />
mkdir -p winpe3_x86/boot<br />
mkdir -p winpe3_x86/sources<br />
cp wAIKX86.msi/F_WINPE_X86_etfsboot.com winpe3_x86/etfsboot.com<br />
cp wAIKX86.msi/F1_BOOTMGR winpe3_x86/bootmgr<br />
cp wAIKX86.msi/F_WINPE_X86_bcd winpe3_x86/boot/bcd<br />
cp wAIKX86.msi/F_WINPE_X86_boot.sdi winpe3_x86/boot/boot.sdi<br />
cp WinPE.cab/F1_WINPE.WIM winpe3_x86/sources/boot.wim<br />
genisoimage -sysid "" -A "" -V "Microsoft Windows PE (x86)" -d -N -b etfsboot.com -no-emul-boot \<br />
-c boot.cat -hide etfsboot.com -hide boot.cat -o winpe3_x86.iso winpe3_x86<br />
the file you will get will be about 120M in size. Then you can burn this *.iso and boot it on any x86-machine which supports booting from CD-ROMs (which is pretty much any PC today)<br />
<br />
==How to build a bootable WinPE USB-HDD image==<br />
a more convenient option would be to create a bootable USB-flash drive. Unfortunately, Windows loader does not seem to support booting from USB-FDDs, while for some BIOSes this is the only type of bootable USB-flash devices.<br />
<br />
===Building WinPE USB-HDD image in a virtual machine===<br />
Since we already have a bootable WinPE *.iso image, we can use it to build a bootable WinPE USB-HDD image in a virtual machine like '''qemu'''.<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86.img count=250000<br />
* boot <tt>winpe3_x86.iso</tt> (which you've created before) in a virtual machine<br />
qemu -cdrom winpe3_x86.iso -boot d -m 640 -hda winpe3_x86.img<br />
* now, in the shell provided by WinPE in the virtual machine<br />
diskpart.exe<br />
diskpart> list disk<br />
diskpart> select disk 0<br />
diskpart> clean<br />
diskpart> create partition primary<br />
diskpart> list partition<br />
diskpart> select partition 1<br />
diskpart> format fs=fat32 quick<br />
diskpart> active<br />
diskpart> assign<br />
diskpart> list volume<br />
diskpart> exit<br />
xcopy /s d:\* c:\<br />
wpeutil shutdown<br />
* when the virtual machine shuts down, the bootable WinPE image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades. If you want, you can create an additional partition for you firmware/diagnostic tools, just don't mess with the partition created by Windows -- you may reder it unbootable.<br />
<br />
===Building WinPE USB-HDD image with syslinux===<br />
if for some ethical or religious reasons you do not want to run any Windows code even in a virtual machine, or you don't have a virtual machine at all -- you can build a bootable WinPE USB-HDD image using '''syslinux''' and '''mtools'''.<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86.img count=250000<br />
* create a bootable partition entry<br />
/sbin/parted winpe3_x86.img<br />
(parted) mklabel msdos<br />
(parted) unit s<br />
(parted) print free<br />
(parted) mkpart primary fat32<br />
(parted) set 1 boot on<br />
(parted) print<br />
in my case the output looks like this. Note the numbers corresponding to "Start" and "Size" of your partition, we will use them in the next command<br />
Model: (file)<br />
Disk /tmp/winpe3_x86.img: 250000s<br />
Sector size (logical/physical): 512B/512B<br />
Partition Table: msdos<br />
<br />
Number Start End Size Type File system Flags<br />
1 '''32'''s 249999s '''249968'''s primary boot, lba<br />
* create and format the partition image<br />
dd if=/dev/zero of=winpe3_x86p1.img count='''249968'''<br />
/sbin/mkfs.vfat -F32 winpe3_x86p1.img<br />
* copy the files (you may have to put "mtools_skip_check=1" into <tt>~/.mtoolsrc</tt> if your partition is not aligned like mine)<br />
mmd -i winpe3_x86p1.img boot<br />
mmd -i winpe3_x86p1.img sources<br />
mcopy -i winpe3_x86p1.img /tmp/wAIKX86.msi/F1_BOOTMGR ::/bootmgr<br />
mcopy -i winpe3_x86p1.img /tmp/wAIKX86.msi/F_WINPE_X86_bcd ::/boot/bcd<br />
mcopy -i winpe3_x86p1.img /tmp/wAIKX86.msi/F_WINPE_X86_boot.sdi ::/boot/boot.sdi<br />
mcopy -i winpe3_x86p1.img /tmp/WinPE.cab/F1_WINPE.WIM ::/sources/boot.wim<br />
mcopy -i winpe3_x86p1.img /usr/lib/syslinux/chain.c32 ::/chain.c32<br />
* create the config file <tt>/tmp/syslinux.cfg</tt> and copy it<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
COM32 /chain.c32<br />
APPEND boot ntldr=/bootmgr<br />
<br />
mcopy -i winpe3_x86p1.img /tmp/syslinux.cfg ::/syslinux.cfg<br />
* install syslinux and copy the partition image into the disk image<br />
syslinux winpe3_x86p1.img<br />
dd if=winpe3_x86p1.img of=winpe3_x86.img seek='''32'''<br />
* now the image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades.<br />
<br />
==How to build a bootable WinPE USB-FDD image==<br />
Any BIOS that supports booting from some USB media at all supports booting from USB-FDD. As it was mentioned ealier, the problem with WinPE is that the bootloader <tt>bootmgr</tt> does not seem to like such devices. A natural thing to do would be to create a virtual HDD, e.g. with <tt>memdisk</tt>, and boot from there. But here we face a deficiency of <tt>memdisk</tt>: for some BIOSes (including Thinkpads!) it will boot if the disk-image physically resides on a real HDD, but will hang if the image is on a USB media.<br />
<br />
The only workaround I've found for making a bootable WinPE USB-FDD looks awkward, but it works! Ironically, to boot Windows we will have first to boot Linux, and then use '''kexec''' feature of the Linux kernel. The bootloader [http://www.solemnwarning.net/kexec-loader kexec-loader] does exactly that: it is a stripped down Linux distro which can detect block devices, mount them and execute <tt>kexec</tt>.<br />
<br />
* get a copy of [http://www.solemnwarning.net/kexec-loader/downloads/kexec-loader-2.2.1-floppy.img.gz kexec-loader-floppy]<br />
* prepare a blank<br />
dd if=/dev/zero of=win.img count=260000<br />
/sbin/mkfs.vfat -F32 win.img -n kexecloader<br />
* copy the contents of the kexec-loader floppy into <tt>/tmp/kexec-loader</tt><br />
mkdir /tmp/kexec-loader<br />
mcopy -i kexec-loader-2.2.1-floppy.img -s ::/* kexec-loader<br />
rm kexec-loader/syslinux/ldlinux.sys<br />
Note: since kexec-loader is a micro Linux distro, it is extremely configurable. For example, you may find it useful downloading [http://www.solemnwarning.net/kexec-loader/downloads/modules-2.6.30.5-1.tar.gz modules] and the [http://www.solemnwarning.net/kexec-loader/downloads/kexec-loader-2.2.1.tar.gz sources], and adding some modules into <tt>initrd.img</tt> with "<tt>./addmod.sh initrd.img memstick.tlz mmc-sd.tlz</tt>", where <tt>addmod.sh</tt> is a script from the source package and <tt>*.tlz</tt> are modules from the modules package. But make sure that you DO NOT include any SATA-drivers, or <tt>grub.exe</tt> will refuse to boot (or you will have to tweak BIOS and switch harddrive controller from "AHCI mode" into "Compatibility mode"). <br />
* download [http://sourceforge.net/projects/grub4dos/files/ grub4dos] and copy <tt>grub.exe</tt><br />
cp grub.exe kexec-loader/<br />
* copy WinPE image<br />
cp /tmp/winpe3_x86p1.img kexec-loader/winpe.img<br />
Note that this is the image of the partition, not of the whole HD.<br />
* figure out UUID of your USB-FDD image<br />
/sbin/blkid win.img<br />
<br />
win.img: LABEL="kexecloader" UUID="'''8166-E075'''" TYPE="vfat" <br />
* configure kexec-loader by replacing <tt>kexec-loader/kexec-loader.conf</tt> with<br />
<br />
timeout 1<br />
<br />
title WinPE<br />
root UUID='''8166-E075'''<br />
kernel /grub.exe<br />
cmdline --config-file="map (rd) (fd0); map --hook; chainloader (fd0)+1; rootnoverify (fd0)"<br />
initrd /winpe.img<br />
* make bootable USB-FDD image (you may have to put "mtools_skip_check=1" into <tt>~/.mtoolsrc</tt> if your partition is not aligned)<br />
mcopy -i win.img -s kexec-loader/* ::<br />
syslinux win.img -d syslinux<br />
* now the image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with <br />
# dd if=win.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades. When booting -- be patient, don't interrupt kexec-loader. Reading speed of USB media is slow.</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Windows_PE&diff=48100Windows PE2010-04-07T19:27:46Z<p>Newhren: mipsrints</p>
<hr />
<div>Some utilities/drivers provided by IBM/Lenovo come only in the form of Windows executables (for example, [[Intel_Active_Management_Technology_(AMT)|Intel AMT]] firmware updates). And for people who don't use Windows OS on their computers it becomes impossible to use/apply them. Luckily, Microsoft provides [http://www.microsoft.com/downloads/en/results.aspx?pocId=&freetext=Automated%20Installation%20Kit&DisplayLang=en Automated Installation Kit] (aka AIK) for free to everyone with very few resctictions on usage (basically, they only prohibit using it as a substitute of a "real" OS, and allow to use it for any diagnostic and reapair tasks). The latest version is [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34 The Windows® Automated Installation Kit (AIK) for Windows® 7]. Users of Windows OS can install this AIK and create bootable CD-ROMs and bootable USB-flash drives with Windows PE (or WinPE for short), which is essentially a stripped-down version of Windows. In this article we will explain how to create bootable CD-ROMs and USB-flash drives with WinPE using only free software.<br />
<br />
==How to build a bootable WinPE *.iso image==<br />
* From the AIK installation file <tt>KB3AIK_EN.iso</tt>, provided in the form of a UDF disk image, use <tt>7z</tt> (from [http://sourceforge.net/projects/p7zip p7zip]) to extract the files <tt>wAIKX86.msi</tt> and <tt>WinPE.cab</tt><br />
* use <tt>7z</tt> or <tt>cabextract</tt> to unpack these files into <tt>/tmp/wAIKX86.msi/</tt> and <tt>/tmp/WinPE.cab/</tt> respectively<br />
* create a bootable WinPE *.iso image <tt>/tmp/winpe3_x86.iso</tt><br />
cd /tmp<br />
mkdir -p winpe3_x86/boot<br />
mkdir -p winpe3_x86/sources<br />
cp wAIKX86.msi/F_WINPE_X86_etfsboot.com winpe3_x86/etfsboot.com<br />
cp wAIKX86.msi/F1_BOOTMGR winpe3_x86/bootmgr<br />
cp wAIKX86.msi/F_WINPE_X86_bcd winpe3_x86/boot/bcd<br />
cp wAIKX86.msi/F_WINPE_X86_boot.sdi winpe3_x86/boot/boot.sdi<br />
cp WinPE.cab/F1_WINPE.WIM winpe3_x86/sources/boot.wim<br />
genisoimage -sysid "" -A "" -V "Microsoft Windows PE (x86)" -d -N -b etfsboot.com -no-emul-boot \<br />
-c boot.cat -hide etfsboot.com -hide boot.cat -o winpe3_x86.iso winpe3_x86<br />
the file you will get will be about 120M in size. Then you can burn this *.iso and boot it on any x86-machine which supports booting from CD-ROMs (which is pretty much any PC today)<br />
<br />
==How to build a bootable WinPE USB-HDD image==<br />
a more convenient option would be to create a bootable USB-flash drive. Unfortunately, Windows loader does not seem to support booting from USB-FDDs, while for some BIOSes this is the only type of bootable USB-flash devices.<br />
<br />
===Building WinPE USB-HDD image in a virtual machine===<br />
Since we already have a bootable WinPE *.iso image, we can use it to build a bootable WinPE USB-HDD image in a virtual machine like '''qemu'''.<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86.img count=250000<br />
* boot <tt>winpe3_x86.iso</tt> (which you've created before) in a virtual machine<br />
qemu -cdrom winpe3_x86.iso -boot d -m 640 -hda winpe3_x86.img<br />
* now, in the shell provided by WinPE in the virtual machine<br />
diskpart.exe<br />
diskpart> list disk<br />
diskpart> select disk 0<br />
diskpart> clean<br />
diskpart> create partition primary<br />
diskpart> list partition<br />
diskpart> select partition 1<br />
diskpart> format fs=fat32 quick<br />
diskpart> active<br />
diskpart> assign<br />
diskpart> list volume<br />
diskpart> exit<br />
xcopy /s d:\* c:\<br />
wpeutil shutdown<br />
* when the virtual machine shuts down, the bootable WinPE image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades. If you want, you can create an additional partition for you firmware/diagnostic tools, just don't mess with the partition created by Windows -- you may reder it unbootable.<br />
<br />
===Building WinPE USB-HDD image with syslinux===<br />
if for some ethical or religious reasons you do not want to run any Windows code even in a virtual machine, or you don't have a virtual machine at all -- you can build a bootable WinPE USB-HDD image using '''syslinux''' and '''mtools'''.<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86.img count=250000<br />
* create a bootable partition entry<br />
/sbin/parted winpe3_x86.img<br />
(parted) mklabel msdos<br />
(parted) unit s<br />
(parted) print free<br />
(parted) mkpart primary fat32<br />
(parted) set 1 boot on<br />
(parted) print<br />
in my case the output looks like this. Note the numbers corresponding to "Start" and "Size" of your partition, we will use them in the next command<br />
Model: (file)<br />
Disk /tmp/winpe3_x86.img: 250000s<br />
Sector size (logical/physical): 512B/512B<br />
Partition Table: msdos<br />
<br />
Number Start End Size Type File system Flags<br />
1 '''32'''s 249999s '''249968'''s primary boot, lba<br />
* create and format the partition image<br />
dd if=/dev/zero of=winpe3_x86p1.img count='''249968'''<br />
/sbin/mkfs.vfat -F32 winpe3_x86p1.img<br />
* copy the files (you may have to put "mtools_skip_check=1" into <tt>~/.mtoolsrc</tt> if your partition is not aligned like mine)<br />
mmd -i winpe3_x86p1.img boot<br />
mmd -i winpe3_x86p1.img sources<br />
mcopy -i winpe3_x86p1.img /tmp/wAIKX86.msi/F1_BOOTMGR ::/bootmgr<br />
mcopy -i winpe3_x86p1.img /tmp/wAIKX86.msi/F_WINPE_X86_bcd ::/boot/bcd<br />
mcopy -i winpe3_x86p1.img /tmp/wAIKX86.msi/F_WINPE_X86_boot.sdi ::/boot/boot.sdi<br />
mcopy -i winpe3_x86p1.img /tmp/WinPE.cab/F1_WINPE.WIM ::/sources/boot.wim<br />
mcopy -i winpe3_x86p1.img /usr/lib/syslinux/chain.c32 ::/chain.c32<br />
* create the config file <tt>/tmp/syslinux.cfg</tt> and copy it<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
COM32 /chain.c32<br />
APPEND boot ntldr=/bootmgr<br />
<br />
mcopy -i winpe3_x86p1.img /tmp/syslinux.cfg ::/syslinux.cfg<br />
* install syslinux and copy the partition image into the disk image<br />
syslinux winpe3_x86p1.img<br />
dd if=winpe3_x86p1.img of=winpe3_x86.img seek='''32'''<br />
* now the image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades.<br />
<br />
==How to build a bootable WinPE USB-FDD image==<br />
Any BIOS that supports booting from some USB media at all supports booting from USB-FDD. As it was mentioned ealier, the problem with WinPE is that the bootloader <tt>bootmgr</tt> does not seem to like such devices. A natural thing to do would be to create a virtual HDD, e.g. with <tt>memdisk</tt>, and boot from there. But here we face a deficiency of <tt>memdisk</tt>: for some BIOSes (including Thinkpads!) it will boot if the disk-image physically resides on a real HDD, but will hang if the image is on a USB media.<br />
<br />
The only workaround I've found for making a bootable WinPE USB-FDD looks awkward, but it works! Ironically, to boot Windows we will have first to boot Linux, and then use '''kexec''' feature of the Linux kernel. The bootloader [http://www.solemnwarning.net/kexec-loader kexec-loader] does exactly that: it is a stripped down Linux distro which can detect block devices, mount them and execute <tt>kexec</tt>.<br />
<br />
* get a copy of [http://www.solemnwarning.net/kexec-loader/downloads/kexec-loader-2.2.1-floppy.img.gz kexec-loader-floppy]<br />
* prepare a blank<br />
dd if=/dev/zero of=win.img count=260000<br />
/sbin/mkfs.vfat -F32 win.img -n kexecloader<br />
* copy the contents of the kexec-loader floppy into <tt>/tmp/kexec-loader</tt><br />
mkdir /tmp/kexec-loader<br />
mcopy -i kexec-loader-2.2.1-floppy.img -s ::/* kexec-loader<br />
rm kexec-loader/syslinux/ldlinux.sys<br />
Note: since kexec-loader is a micro Linux distro, it is extremely configurable. For example, you may find it useful downloading [http://www.solemnwarning.net/kexec-loader/downloads/modules-2.6.30.5-1.tar.gz modules] and the [http://www.solemnwarning.net/kexec-loader/downloads/kexec-loader-2.2.1.tar.gz sources], and adding some modules into <tt>initrd.img</tt> with "<tt>./addmod.sh initrd.img memstick.tlz mmc-sd.tlz</tt>", where <tt>addmod.sh</tt> is a script from the source package and <tt>*.tlz</tt> are modules from the modules package. But make sure that you DO NOT include any SATA-drivers, or <tt>grub.exe</tt> will refuse to boot (or you will have to tweak BIOS and switch harddrive controller from "AHCI mode" into "Compatibility mode"). <br />
* download [http://sourceforge.net/projects/grub4dos/files/ grub4dos] and copy <tt>grub.exe</tt><br />
cp grub.exe kexec-loader/<br />
* copy WinPE image<br />
cp /tmp/winpe3_x86p1.img kexec-loader/winpe.img<br />
Note that this is the image of the partition, not of the whole HD.<br />
* figure out UUID of your USB-FDD image<br />
/sbin/blkid win.img<br />
<br />
win.img: LABEL="kexecloader" UUID="'''8166-E075'''" TYPE="vfat" <br />
* configure kexec-loader by replacing <tt>kexec-loader/kexec-loader.conf</tt> with<br />
<br />
timeout 1<br />
<br />
title WinPE<br />
root UUID='''8166-E075'''<br />
kernel /grub.exe<br />
cmdline --config-file="map (rd) (fd0); map --hook; chainloader (fd0)+1; rootnoverify (fd0)"<br />
initrd /winpe.img<br />
* make bootable USB-FDD image<br />
mcopy -i win.img -s kexec-loader/* ::<br />
syslinux win.img -d syslinux<br />
* now the image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with <br />
# dd if=win.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades. When booting -- be patient, don't interrupt kexec-loader. Reading speed of USB media is slow.</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Windows_PE&diff=48099Windows PE2010-04-07T19:21:55Z<p>Newhren: repalce extlinux with syslinux</p>
<hr />
<div>Some utilities/drivers provided by IBM/Lenovo come only in the form of Windows executables (for example, [[Intel_Active_Management_Technology_(AMT)|Intel AMT]] firmware updates). And for people who don't use Windows OS on their computers it becomes impossible to use/apply them. Luckily, Microsoft provides [http://www.microsoft.com/downloads/en/results.aspx?pocId=&freetext=Automated%20Installation%20Kit&DisplayLang=en Automated Installation Kit] (aka AIK) for free to everyone with very few resctictions on usage (basically, they only prohibit using it as a substitute of a "real" OS, and allow to use it for any diagnostic and reapair tasks). The latest version is [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34 The Windows® Automated Installation Kit (AIK) for Windows® 7]. Users of Windows OS can install this AIK and create bootable CD-ROMs and bootable USB-flash drives with Windows PE (or WinPE for short), which is essentially a stripped-down version of Windows. In this article we will explain how to create bootable CD-ROMs and USB-flash drives with WinPE using only free software.<br />
<br />
==How to build a bootable WinPE *.iso image==<br />
* From the AIK installation file <tt>KB3AIK_EN.iso</tt>, provided in the form of a UDF disk image, use <tt>7z</tt> (from [http://sourceforge.net/projects/p7zip p7zip]) to extract the files <tt>wAIKX86.msi</tt> and <tt>WinPE.cab</tt><br />
* use <tt>7z</tt> or <tt>cabextract</tt> to unpack these files into <tt>/tmp/wAIKX86.msi/</tt> and <tt>/tmp/WinPE.cab/</tt> respectively<br />
* create a bootable WinPE *.iso image <tt>/tmp/winpe3_x86.iso</tt><br />
cd /tmp<br />
mkdir -p winpe3_x86/boot<br />
mkdir -p winpe3_x86/sources<br />
cp wAIKX86.msi/F_WINPE_X86_etfsboot.com winpe3_x86/etfsboot.com<br />
cp wAIKX86.msi/F1_BOOTMGR winpe3_x86/bootmgr<br />
cp wAIKX86.msi/F_WINPE_X86_bcd winpe3_x86/boot/bcd<br />
cp wAIKX86.msi/F_WINPE_X86_boot.sdi winpe3_x86/boot/boot.sdi<br />
cp WinPE.cab/F1_WINPE.WIM winpe3_x86/sources/boot.wim<br />
genisoimage -sysid "" -A "" -V "Microsoft Windows PE (x86)" -d -N -b etfsboot.com -no-emul-boot \<br />
-c boot.cat -hide etfsboot.com -hide boot.cat -o winpe3_x86.iso winpe3_x86<br />
the file you will get will be about 120M in size. Then you can burn this *.iso and boot it on any x86-machine which supports booting from CD-ROMs (which is pretty much any PC today)<br />
<br />
==How to build a bootable WinPE USB-HDD image==<br />
a more convenient option would be to create a bootable USB-flash drive. Unfortunately, Windows loader does not seem to support booting from USB-FDDs, while for some BIOSes this is the only type of bootable USB-flash devices.<br />
<br />
===Building WinPE USB-HDD image in a virtual machine===<br />
Since we already have a bootable WinPE *.iso image, we can use it to build a bootable WinPE USB-HDD image in a virtual machine like '''qemu'''.<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86.img count=250000<br />
* boot <tt>winpe3_x86.iso</tt> (which you've created before) in a virtual machine<br />
qemu -cdrom winpe3_x86.iso -boot d -m 640 -hda winpe3_x86.img<br />
* now, in the shell provided by WinPE in the virtual machine<br />
diskpart.exe<br />
diskpart> list disk<br />
diskpart> select disk 0<br />
diskpart> clean<br />
diskpart> create partition primary<br />
diskpart> list partition<br />
diskpart> select partition 1<br />
diskpart> format fs=fat32 quick<br />
diskpart> active<br />
diskpart> assign<br />
diskpart> list volume<br />
diskpart> exit<br />
xcopy /s d:\* c:\<br />
wpeutil shutdown<br />
* when the virtual machine shuts down, the bootable WinPE image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades. If you want, you can create an additional partition for you firmware/diagnostic tools, just don't mess with the partition created by Windows -- you may reder it unbootable.<br />
<br />
===Building WinPE USB-HDD image with syslinux===<br />
if for some ethical or religious reasons you do not want to run any Windows code even in a virtual machine, or you don't have a virtual machine at all -- you can build a bootable WinPE USB-HDD image using '''syslinux''' and '''mtools'''.<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86.img count=250000<br />
* create a bootable partition entry<br />
/sbin/parted winpe3_x86.img<br />
(parted) mklabel msdos<br />
(parted) unit s<br />
(parted) print free<br />
(parted) mkpart primary fat32<br />
(parted) set 1 boot on<br />
(parted) print<br />
in my case the output looks like this. Note the numbers corresponding to "Start" and "Size" of your partition, we will use them in the next command<br />
Model: (file)<br />
Disk /tmp/winpe3_x86.img: 250000s<br />
Sector size (logical/physical): 512B/512B<br />
Partition Table: msdos<br />
<br />
Number Start End Size Type File system Flags<br />
1 '''32'''s 249999s '''249968'''s primary boot, lba<br />
* create and format the partition image<br />
dd if=/dev/zero of=winpe3_x86p1.img count='''249968'''<br />
/sbin/mkfs.vfat -F32 winpe3_x86p1.img<br />
* copy the files (you may have to put "mtools_skip_check=1" into <tt>~/.mtoolsrc</tt> if your partition is not aligned like mine)<br />
mmd -i winpe3_x86p1.img boot<br />
mmd -i winpe3_x86p1.img sources<br />
mcopy -i winpe3_x86p1.img /tmp/wAIKX86.msi/F1_BOOTMGR ::/bootmgr<br />
mcopy -i winpe3_x86p1.img /tmp/wAIKX86.msi/F_WINPE_X86_bcd ::/boot/bcd<br />
mcopy -i winpe3_x86p1.img /tmp/wAIKX86.msi/F_WINPE_X86_boot.sdi ::/boot/boot.sdi<br />
mcopy -i winpe3_x86p1.img /tmp/WinPE.cab/F1_WINPE.WIM ::/sources/boot.wim<br />
mcopy -i winpe3_x86p1.img /usr/lib/syslinux/chain.c32 ::/chain.c32<br />
* create the config file <tt>/tmp/syslinux.cfg</tt> and copy it<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
COM32 /chain.c32<br />
APPEND boot ntldr=/bootmgr<br />
<br />
mcopy -i winpe3_x86p1.img /tmp/syslinux.cfg ::/syslinux.cfg<br />
* install syslinux and copy the partition image into the disk image<br />
syslinux winpe3_x86p1.img<br />
dd if=winpe3_x86p1.img of=winpe3_x86.img seek='''32'''<br />
* now the image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades.<br />
<br />
==How to build a bootable WinPE USB-FDD image==<br />
Any BIOS that supports booting from some USB media at all supports booting from USB-FDD. As it was mentioned ealier, the problem with WinPE is that the bootloader <tt>bootmgr</tt> does not seem to like such devices. A natural thing to do would be to create a virtual HDD, e.g. with <tt>memdisk</tt>, and boot from there. But here we face a deficiency of <tt>memdisk</tt>: for some BIOSes (including Thinkpads!) it will boot if the disk-image physically resides on a real HDD, but will hang if the image is on a USB media.<br />
<br />
The only workaround I've found for making a bootable WinPE USB-FDD looks awkward, but it works! Ironically, to boot Windows we will have first to boot Linux, and then use '''kexec''' feature of the Linux kernel. The bootloader [http://www.solemnwarning.net/kexec-loader kexec-loader] does exactly that: it is a stripped down Linux kernel which can detect block devices, mount them and execute <tt>kexec</tt>.<br />
<br />
* get a copy of [http://www.solemnwarning.net/kexec-loader/downloads/kexec-loader-2.2.1-floppy.img.gz kexec-loader-floppy]<br />
* prepare a blank<br />
dd if=/dev/zero of=win.img count=260000<br />
/sbin/mkfs.vfat -F32 win.img -n kexecloader<br />
* copy the contents of the kexec-loader floppy into /tmp<br />
mkdir /tmp/kexec-loader<br />
mcopy -i kexec-loader-2.2.1-floppy.img -s ::/* kexec-loader<br />
rm kexec-loader/syslinux/ldlinux.sys<br />
Note: since kexec-loader is a micro Linux-distro, it is extremely configurable. For example, you may find it useful downloading [http://www.solemnwarning.net/kexec-loader/downloads/modules-2.6.30.5-1.tar.gz modules] and the [http://www.solemnwarning.net/kexec-loader/downloads/kexec-loader-2.2.1.tar.gz sources], and adding some modules into <tt>initrd.img</tt> with "<tt>./addmod.sh initrd.img memstick.tlz mmc-sd.tlz</tt>", where <tt>addmod.sh</tt> is a script from the source package and <tt>*.tlz</tt> are modules from the modules package. But make sure that you DO NOT include any SATA-drivers, or <tt>grub.exe</tt> will refuse to boot (or you will have to tweak BIOS and switch harddrive controller from "AHCI mode" into "Compatibility mode"). <br />
* download [http://sourceforge.net/projects/grub4dos/files/ grub4dos] and copy <tt>grub.exe</tt><br />
cp grub.exe kexec-loader/<br />
* copy WinPE image<br />
cp /tmp/winpe3_x86p1.img kexec-loader/winpe.img<br />
Note that this is the image of the partition, not of the whole HD.<br />
* figure out UUID of your USB-FDD image<br />
/sbin/blkid win.img<br />
<br />
win.img: LABEL="kexecloader" UUID="'''8166-E075'''" TYPE="vfat" <br />
* configure kexec-loader by replacing <tt>kexec-loader/kexec-loader.conf</tt> with<br />
<br />
timeout 1<br />
<br />
title WinPE<br />
root UUID='''8166-E075'''<br />
kernel /grub.exe<br />
cmdline --config-file="map (rd) (fd0); map --hook; chainloader (fd0)+1; rootnoverify (fd0)"<br />
initrd /winpe.img<br />
* make bootable USB-FDD image<br />
mcopy -i win.img -s kexec-loader/* ::<br />
syslinux win.img -d syslinux<br />
* now the image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with <br />
# dd if=win.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades. When booting -- be patient, don't interrupt kexec-loader. Reading speed of USB media is slow.</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Windows_PE&diff=48097Windows PE2010-04-07T08:32:43Z<p>Newhren: rewrite using kexec-loader</p>
<hr />
<div>Some utilities/drivers provided by IBM/Lenovo come only in the form of Windows executables (for example, [[Intel_Active_Management_Technology_(AMT)|Intel AMT]] firmware updates). And for people who don't use Windows OS on their computers it becomes impossible to use/apply them. Luckily, Microsoft provides [http://www.microsoft.com/downloads/en/results.aspx?pocId=&freetext=Automated%20Installation%20Kit&DisplayLang=en Automated Installation Kit] (aka AIK) for free to everyone with very few resctictions on usage (basically, they only prohibit using it as a substitute of a "real" OS, and allow to use it for any diagnostic and reapair tasks). The latest version is [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34 The Windows® Automated Installation Kit (AIK) for Windows® 7]. Users of Windows OS can install this AIK and create bootable CD-ROMs and bootable USB-flash drives with Windows PE (or WinPE for short), which is essentially a stripped-down version of Windows. In this article we will explain how to create bootable CD-ROMs and USB-flash drives with WinPE using only free software.<br />
<br />
==How to build a bootable WinPE *.iso image==<br />
* From the AIK installation file <tt>KB3AIK_EN.iso</tt>, provided in the form of a UDF disk image, use <tt>7z</tt> (from [http://sourceforge.net/projects/p7zip p7zip]) to extract the files <tt>wAIKX86.msi</tt> and <tt>WinPE.cab</tt><br />
* use <tt>7z</tt> or <tt>cabextract</tt> to unpack these files into <tt>/tmp/wAIKX86.msi/</tt> and <tt>/tmp/WinPE.cab/</tt> respectively<br />
* create a bootable WinPE *.iso image <tt>/tmp/winpe3_x86.iso</tt><br />
cd /tmp<br />
mkdir -p winpe3_x86/boot<br />
mkdir -p winpe3_x86/sources<br />
cp wAIKX86.msi/F_WINPE_X86_etfsboot.com winpe3_x86/etfsboot.com<br />
cp wAIKX86.msi/F1_BOOTMGR winpe3_x86/bootmgr<br />
cp wAIKX86.msi/F_WINPE_X86_bcd winpe3_x86/boot/bcd<br />
cp wAIKX86.msi/F_WINPE_X86_boot.sdi winpe3_x86/boot/boot.sdi<br />
cp WinPE.cab/F1_WINPE.WIM winpe3_x86/sources/boot.wim<br />
genisoimage -sysid "" -A "" -V "Microsoft Windows PE (x86)" -d -N -b etfsboot.com -no-emul-boot \<br />
-c boot.cat -hide etfsboot.com -hide boot.cat -o winpe3_x86.iso winpe3_x86<br />
the file you will get will be about 120M in size. Then you can burn this *.iso and boot it on any x86-machine which supports booting from CD-ROMs (which is pretty much any PC today)<br />
<br />
==How to build a bootable WinPE USB-HDD image==<br />
a more convenient option would be to create a bootable USB-flash drive. Unfortunately, Windows loader does not seem to support booting from USB-FDDs, while for some BIOSes this is the only type of bootable USB-flash devices.<br />
<br />
===Building WinPE USB-HDD image in a virtual machine===<br />
Since we already have a bootable WinPE *.iso image, we can use it to build a bootable WinPE USB-HDD image in a virtual machine like '''qemu'''.<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86.img count=250000<br />
* boot <tt>winpe3_x86.iso</tt> (which you've created before) in a virtual machine<br />
qemu -cdrom winpe3_x86.iso -boot d -m 640 -hda winpe3_x86.img<br />
* now, in the shell provided by WinPE in the virtual machine<br />
diskpart.exe<br />
diskpart> list disk<br />
diskpart> select disk 0<br />
diskpart> clean<br />
diskpart> create partition primary<br />
diskpart> list partition<br />
diskpart> select partition 1<br />
diskpart> format fs=fat32 quick<br />
diskpart> active<br />
diskpart> assign<br />
diskpart> list volume<br />
diskpart> exit<br />
xcopy /s d:\* c:\<br />
wpeutil shutdown<br />
* when the virtual machine shuts down, the bootable WinPE image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades. If you want, you can create an additional partition for you firmware/diagnostic tools, just don't mess with the partition created by Windows -- you may reder it unbootable.<br />
<br />
===Building WinPE USB-HDD image with syslinux===<br />
if for some ethical or religious reasons you do not want to run any Windows code even in a virtual machine, or you don't have a virtual machine at all -- you can build a bootable WinPE USB-HDD image using '''syslinux''' and '''mtools'''.<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86.img count=250000<br />
* create a bootable partition entry<br />
/sbin/parted winpe3_x86.img<br />
(parted) mklabel msdos<br />
(parted) unit s<br />
(parted) print free<br />
(parted) mkpart primary fat32<br />
(parted) set 1 boot on<br />
(parted) print<br />
in my case the output looks like this. Note the numbers corresponding to "Start" and "Size" of your partition, we will use them in the next command<br />
Model: (file)<br />
Disk /tmp/winpe3_x86.img: 250000s<br />
Sector size (logical/physical): 512B/512B<br />
Partition Table: msdos<br />
<br />
Number Start End Size Type File system Flags<br />
1 '''32'''s 249999s '''249968'''s primary boot, lba<br />
* create and format the partition image<br />
dd if=/dev/zero of=winpe3_x86p1.img count='''249968'''<br />
/sbin/mkfs.vfat -F32 winpe3_x86p1.img<br />
* copy the files (you may have to put "mtools_skip_check=1" into <tt>~/.mtoolsrc</tt> if your partition is not aligned like mine)<br />
mmd -i winpe3_x86p1.img boot<br />
mmd -i winpe3_x86p1.img sources<br />
mcopy -i winpe3_x86p1.img /tmp/wAIKX86.msi/F1_BOOTMGR ::/bootmgr<br />
mcopy -i winpe3_x86p1.img /tmp/wAIKX86.msi/F_WINPE_X86_bcd ::/boot/bcd<br />
mcopy -i winpe3_x86p1.img /tmp/wAIKX86.msi/F_WINPE_X86_boot.sdi ::/boot/boot.sdi<br />
mcopy -i winpe3_x86p1.img /tmp/WinPE.cab/F1_WINPE.WIM ::/sources/boot.wim<br />
mcopy -i winpe3_x86p1.img /usr/lib/syslinux/chain.c32 ::/chain.c32<br />
* create the config file <tt>/tmp/syslinux.cfg</tt> and copy it<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
COM32 /chain.c32<br />
APPEND boot ntldr=/bootmgr<br />
<br />
mcopy -i winpe3_x86p1.img /tmp/syslinux.cfg ::/syslinux.cfg<br />
* install syslinux and copy the partition image into the disk image<br />
syslinux winpe3_x86p1.img<br />
dd if=winpe3_x86p1.img of=winpe3_x86.img seek='''32'''<br />
* now the image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades.<br />
<br />
==How to build a bootable WinPE USB-FDD image==<br />
Any BIOS that supports booting from some USB media at all supports booting from USB-FDD. As it was mentioned ealier, the problem with WinPE is that the bootloader <tt>bootmgr</tt> does not seem to like such devices. A natural thing to do would be to create a virtual HDD, e.g. with <tt>memdisk</tt>, and boot from there. But here we face a deficiency of <tt>memdisk</tt>: for some BIOSes (including Thinkpads!) it will boot if the disk-image physically resides on a real HDD, but will hang if the image is on a USB media.<br />
<br />
The only workaround I've found for making a bootable WinPE USB-FDD looks awkward, but it works! Ironically, to boot Windows we will have to use Linux, namely the '''kexec''' feature of the Linux kernel. The bootloader [http://www.solemnwarning.net/kexec-loader kexec-loader] does exactly that: it is a stripped down Linux kernel which can detect block devices, mount them and execute <tt>kexec</tt>.<br />
<br />
* get [http://www.solemnwarning.net/kexec-loader/downloads/kexec-loader-2.2.1-floppy.img.gz kexec-loader-floppy], [http://www.solemnwarning.net/kexec-loader/downloads/modules-2.6.30.5-1.tar.gz modules] and the [http://www.solemnwarning.net/kexec-loader/downloads/kexec-loader-2.2.1.tar.gz sources].<br />
* insert your flash media into USB (I will assume it is detected as <tt>/dev/sdb</tt>) and format it<br />
mke2fs -t ext2 -L kexecloader /dev/sdb<br />
* mount it to <tt>/mnt/flash</tt> and install '''extlinux'''<br />
mount /dev/sdb /mnt/flash<br />
mkdir /mnt/flash/extlinux<br />
extlinux -i /mnt/flash/extlinux<br />
* mount <tt>kexec-loader-floppy.img</tt> to <tt>/mnt/floppy</tt> and copy its contents into /mnt/flash<br />
mount -o loop kexec-loader-floppy.img /mnt/floppy<br />
cp -r /mnt/floppy/* /mnt/flash<br />
* configure extlinux<br />
mv /mnt/flash/syslinux/syslinux.cfg /mnt/flash/extlinux/extlinux.conf<br />
rm -fr /mnt/flash/syslinux<br />
* download [http://sourceforge.net/projects/grub4dos/files/ grub4dos] and copy <tt>grub.exe</tt><br />
cp grub.exe /mnt/flash/<br />
* copy WinPE image<br />
cp /tmp/winpe3_x86p1.img /mnt/flash/winpe.img<br />
Note that this is the image of the partition, not of the whole HD.<br />
* figure out UUID of your USB-flash<br />
blkid /dev/sdb<br />
<br />
/dev/sdb: LABEL="kexecloader" UUID="'''c09fadee-4262-4b48-bf33-cf059b53467d'''" TYPE="ext2" <br />
* configure kexec-loader by replacing <tt>/mnt/flash/kexec-loader.conf</tt> with<br />
<br />
timeout 1<br />
<br />
title WinPE<br />
root UUID='''c09fadee-4262-4b48-bf33-cf059b53467d'''<br />
kernel /grub.exe<br />
cmdline --config-file="map (rd) (fd0); map --hook; chainloader (fd0)+1; rootnoverify (fd0)"<br />
initrd /winpe.img<br />
* unpack kexec-loader modules into <tt>/tmp/modules</tt> and sources into <tt>/tmp/kexec-loader</tt><br />
* copy initrd.img into <tt>/tmp/modules</tt>, add necessary drivers and copy it back <br />
cp /mnt/flash/initrd.img /tmp/modules<br />
cd /tmp/modules<br />
/tmp/kexec-loader/addmod.sh initrd.img memstick.tlz mmc-sd.tlz fs/ext2.tlz<br />
cp initrd.img /mnt/flash/initrd.img<br />
Make sure that you DO NOT include any SATA-drivers, or <tt>grub.exe</tt> will refuse to boot (or you will have to tweak BIOS and switch harddrive controller from AHCI mode into "Compatibility mode").<br />
* now you can unmount <tt>/mnt/flash</tt>, the image is ready. When booting -- be patient. Reading speed of USB media is slow.</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Windows_PE&diff=48096Windows PE2010-04-07T04:54:16Z<p>Newhren: /* How to build a bootable WinPE USB-FDD image */</p>
<hr />
<div>Some utilities/drivers provided by IBM/Lenovo come only in the form of Windows executables (for example, [[Intel_Active_Management_Technology_(AMT)|Intel AMT]] firmware updates). And for people who don't use Windows OS on their computers it becomes impossible to use/apply them. Luckily, Microsoft provides [http://www.microsoft.com/downloads/en/results.aspx?pocId=&freetext=Automated%20Installation%20Kit&DisplayLang=en Automated Installation Kit] (aka AIK) for free to everyone with very few resctictions on usage (basically, they only prohibit using it as a substitute of a "real" OS, and allow to use it for any diagnostic and reapair tasks). The latest version is [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34 The Windows® Automated Installation Kit (AIK) for Windows® 7]. Users of Windows OS can install this AIK and create bootable CD-ROMs and bootable USB-flash drives with Windows PE (or WinPE for short), which is essentially a stripped-down version of Windows. In this article we will explain how to create bootable CD-ROMs and USB-flash drives with WinPE using only free software.<br />
<br />
==How to build a bootable WinPE *.iso image==<br />
* From the AIK installation file <tt>KB3AIK_EN.iso</tt>, provided in the form of a UDF disk image, use <tt>7z</tt> (from [http://sourceforge.net/projects/p7zip p7zip]) to extract the files <tt>wAIKX86.msi</tt> and <tt>WinPE.cab</tt><br />
* use <tt>7z</tt> or <tt>cabextract</tt> to unpack these files into <tt>/tmp/wAIKX86.msi/</tt> and <tt>/tmp/WinPE.cab/</tt> respectively<br />
* create a bootable WinPE *.iso image <tt>/tmp/winpe3_x86.iso</tt><br />
cd /tmp<br />
mkdir -p winpe3_x86/boot<br />
mkdir -p winpe3_x86/sources<br />
cp wAIKX86.msi/F_WINPE_X86_etfsboot.com winpe3_x86/etfsboot.com<br />
cp wAIKX86.msi/F1_BOOTMGR winpe3_x86/bootmgr<br />
cp wAIKX86.msi/F_WINPE_X86_bcd winpe3_x86/boot/bcd<br />
cp wAIKX86.msi/F_WINPE_X86_boot.sdi winpe3_x86/boot/boot.sdi<br />
cp WinPE.cab/F1_WINPE.WIM winpe3_x86/sources/boot.wim<br />
genisoimage -sysid "" -A "" -V "Microsoft Windows PE (x86)" -d -N -b etfsboot.com -no-emul-boot \<br />
-c boot.cat -hide etfsboot.com -hide boot.cat -o winpe3_x86.iso winpe3_x86<br />
the file you will get will be about 120M in size. Then you can burn this *.iso and boot it on any x86-machine which supports booting from CD-ROMs (which is pretty much any PC today)<br />
<br />
==How to build a bootable WinPE USB-HDD image==<br />
a more convenient option would be to create a bootable USB-flash drive. Unfortunately, Windows loader does not seem to support booting from USB-FDDs, while for some BIOSes this is the only type of bootable USB-flash devices.<br />
<br />
===Building WinPE USB-HDD image in a virtual machine===<br />
Since we already have a bootable WinPE *.iso image, we can use it to build a bootable WinPE USB-HDD image in a virtual machine like '''qemu'''.<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86.img count=250000<br />
* boot <tt>winpe3_x86.iso</tt> (which you've created before) in a virtual machine<br />
qemu -cdrom winpe3_x86.iso -boot d -m 640 -hda winpe3_x86.img<br />
* now, in the shell provided by WinPE in the virtual machine<br />
diskpart.exe<br />
diskpart> list disk<br />
diskpart> select disk 0<br />
diskpart> clean<br />
diskpart> create partition primary<br />
diskpart> list partition<br />
diskpart> select partition 1<br />
diskpart> format fs=fat32 quick<br />
diskpart> active<br />
diskpart> assign<br />
diskpart> list volume<br />
diskpart> exit<br />
xcopy /s d:\* c:\<br />
wpeutil shutdown<br />
* when the virtual machine shuts down, the bootable WinPE image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades. If you want, you can create an additional partition for you firmware/diagnostic tools, just don't mess with the partition created by Windows -- you may reder it unbootable.<br />
<br />
===Building WinPE USB-HDD image with syslinux===<br />
if for some ethical or religious reasons you do not want to run any Windows code even in a virtual machine, or you don't have a virtual machine at all -- you can build a bootable WinPE USB-HDD image using '''syslinux''' and '''mtools'''.<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86.img count=250000<br />
* create a bootable partition entry<br />
/sbin/parted winpe3_x86.img<br />
(parted) mklabel msdos<br />
(parted) unit s<br />
(parted) print free<br />
(parted) mkpart primary fat32<br />
(parted) set 1 boot on<br />
(parted) print<br />
in my case the output looks like this. Note the numbers corresponding to "Start" and "Size" of your partition, we will use them in the next command<br />
Model: (file)<br />
Disk /tmp/winpe3_x86.img: 250000s<br />
Sector size (logical/physical): 512B/512B<br />
Partition Table: msdos<br />
<br />
Number Start End Size Type File system Flags<br />
1 '''32'''s 249999s '''249968'''s primary boot, lba<br />
* create and format the partition image<br />
dd if=/dev/zero of=winpe3_x86p1.img count='''249968'''<br />
/sbin/mkfs.vfat -F32 winpe3_x86p1.img<br />
* copy the files (you may have to put "mtools_skip_check=1" into <tt>~/.mtoolsrc</tt> if your partition is not aligned like mine)<br />
mmd -i winpe3_x86p1.img boot<br />
mmd -i winpe3_x86p1.img sources<br />
mcopy -i winpe3_x86p1.img /tmp/wAIKX86.msi/F1_BOOTMGR ::/bootmgr<br />
mcopy -i winpe3_x86p1.img /tmp/wAIKX86.msi/F_WINPE_X86_bcd ::/boot/bcd<br />
mcopy -i winpe3_x86p1.img /tmp/wAIKX86.msi/F_WINPE_X86_boot.sdi ::/boot/boot.sdi<br />
mcopy -i winpe3_x86p1.img /tmp/WinPE.cab/F1_WINPE.WIM ::/sources/boot.wim<br />
mcopy -i winpe3_x86p1.img /usr/lib/syslinux/chain.c32 ::/chain.c32<br />
* create the config file <tt>/tmp/syslinux.cfg</tt> and copy it<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
COM32 /chain.c32<br />
APPEND boot ntldr=/bootmgr<br />
<br />
mcopy -i winpe3_x86p1.img /tmp/syslinux.cfg ::/syslinux.cfg<br />
* install syslinux and copy the partition image into the disk image<br />
syslinux winpe3_x86p1.img<br />
dd if=winpe3_x86p1.img of=winpe3_x86.img seek='''32'''<br />
* now the image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades.<br />
<br />
==How to build a bootable WinPE USB-FDD image==<br />
Any BIOS that supports booting from some USB media at all supports booting from USB-FDD. As it was mentioned ealier, the problem with WinPE is that the bootloader <tt>bootmgr</tt> does not seem to like such devices. A natural thing to do would be to create a virtual HDD, e.g. with <tt>memdisk</tt>, and boot from there. But here we face a deficiency of <tt>memdisk</tt>: for some BIOSes (including Thinkpads!) it will boot if the disk-image physically resides on a real HDD, but will hang if the image is on a USB media.<br />
<br />
The only workaround I've found for making a bootable WinPE USB-FDD looks awkward, but it works! Ironically, to boot Windows we will have to use Linux, namely the '''kexec''' feature of the Linux kernel.<br />
<br />
* get <tt>kexec</tt> binary compiled for i386 (for example, you can extract it from the Debian package [http://packages.debian.org/testing/i386/kexec-tools/download kexec-tools])<br />
* get <tt>grub.exe</tt> from [http://sourceforge.net/projects/grub4dos/files/ grub4dos]<br />
* download some Linux "liveCD" capable of booting from USB-FDD (I personally like [http://www.sysresccd.org/Download SystemRescueCd]) and make a bootable USB-FDD<br />
* mount your Linux USB-FDD to <tt>/mnt/flash</tt> and create the directory <tt>/mnt/flash/winpe</tt><br />
* copy the files<br />
cp grub.exe /mnt/flash/winpe/<br />
cp kexec /mnt/flash/winpe/<br />
cp /tmp/winpe3_x86p1.img /mnt/flash/winpe/winpe.img<br />
the last file you've created when building the bootable USB-HDD image. Note that this is the image of the partition, not of the whole HD.<br />
* create the script <tt>/mnt/flash/winpe/winpe.sh</tt><br />
#!/bin/sh<br />
./kexec -l grub.exe --initrd=winpe.img --command-line="--config-file=map (rd) (fd0); map --hook; chainloader (fd0)+1; rootnoverify (fd0)"<br />
./kexec -e<br />
* unmount <tt>/mnt/flash</tt>, the image is ready<br />
* now, you may first need to change some of your BIOS settings. For me, <tt>grub.exe</tt> refuses to boot if the harddrive controller is in AHCI mode, so I have to put it into "Compatibility mode". Boot Linux from your USB-FDD as usual, but make sure you don't use any KMS video capabilities of modern kernels -- <tt>grub.exe</tt> doesn't seem to like them as well. Once you are in the root shell, you can start WinPE<br />
# cp /mnt/flash/winpe/* /tmp/<br />
# cd /tmp<br />
# chmod 755 kexec winpe.sh<br />
# ./winpe.sh</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Windows_PE&diff=48095Windows PE2010-04-07T02:46:38Z<p>Newhren: fixed mipsrints</p>
<hr />
<div>Some utilities/drivers provided by IBM/Lenovo come only in the form of Windows executables (for example, [[Intel_Active_Management_Technology_(AMT)|Intel AMT]] firmware updates). And for people who don't use Windows OS on their computers it becomes impossible to use/apply them. Luckily, Microsoft provides [http://www.microsoft.com/downloads/en/results.aspx?pocId=&freetext=Automated%20Installation%20Kit&DisplayLang=en Automated Installation Kit] (aka AIK) for free to everyone with very few resctictions on usage (basically, they only prohibit using it as a substitute of a "real" OS, and allow to use it for any diagnostic and reapair tasks). The latest version is [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34 The Windows® Automated Installation Kit (AIK) for Windows® 7]. Users of Windows OS can install this AIK and create bootable CD-ROMs and bootable USB-flash drives with Windows PE (or WinPE for short), which is essentially a stripped-down version of Windows. In this article we will explain how to create bootable CD-ROMs and USB-flash drives with WinPE using only free software.<br />
<br />
==How to build a bootable WinPE *.iso image==<br />
* From the AIK installation file <tt>KB3AIK_EN.iso</tt>, provided in the form of a UDF disk image, use <tt>7z</tt> (from [http://sourceforge.net/projects/p7zip p7zip]) to extract the files <tt>wAIKX86.msi</tt> and <tt>WinPE.cab</tt><br />
* use <tt>7z</tt> or <tt>cabextract</tt> to unpack these files into <tt>/tmp/wAIKX86.msi/</tt> and <tt>/tmp/WinPE.cab/</tt> respectively<br />
* create a bootable WinPE *.iso image <tt>/tmp/winpe3_x86.iso</tt><br />
cd /tmp<br />
mkdir -p winpe3_x86/boot<br />
mkdir -p winpe3_x86/sources<br />
cp wAIKX86.msi/F_WINPE_X86_etfsboot.com winpe3_x86/etfsboot.com<br />
cp wAIKX86.msi/F1_BOOTMGR winpe3_x86/bootmgr<br />
cp wAIKX86.msi/F_WINPE_X86_bcd winpe3_x86/boot/bcd<br />
cp wAIKX86.msi/F_WINPE_X86_boot.sdi winpe3_x86/boot/boot.sdi<br />
cp WinPE.cab/F1_WINPE.WIM winpe3_x86/sources/boot.wim<br />
genisoimage -sysid "" -A "" -V "Microsoft Windows PE (x86)" -d -N -b etfsboot.com -no-emul-boot \<br />
-c boot.cat -hide etfsboot.com -hide boot.cat -o winpe3_x86.iso winpe3_x86<br />
the file you will get will be about 120M in size. Then you can burn this *.iso and boot it on any x86-machine which supports booting from CD-ROMs (which is pretty much any PC today)<br />
<br />
==How to build a bootable WinPE USB-HDD image==<br />
a more convenient option would be to create a bootable USB-flash drive. Unfortunately, Windows loader does not seem to support booting from USB-FDDs, while for some BIOSes this is the only type of bootable USB-flash devices.<br />
<br />
===Building WinPE USB-HDD image in a virtual machine===<br />
Since we already have a bootable WinPE *.iso image, we can use it to build a bootable WinPE USB-HDD image in a virtual machine like '''qemu'''.<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86.img count=250000<br />
* boot <tt>winpe3_x86.iso</tt> (which you've created before) in a virtual machine<br />
qemu -cdrom winpe3_x86.iso -boot d -m 640 -hda winpe3_x86.img<br />
* now, in the shell provided by WinPE in the virtual machine<br />
diskpart.exe<br />
diskpart> list disk<br />
diskpart> select disk 0<br />
diskpart> clean<br />
diskpart> create partition primary<br />
diskpart> list partition<br />
diskpart> select partition 1<br />
diskpart> format fs=fat32 quick<br />
diskpart> active<br />
diskpart> assign<br />
diskpart> list volume<br />
diskpart> exit<br />
xcopy /s d:\* c:\<br />
wpeutil shutdown<br />
* when the virtual machine shuts down, the bootable WinPE image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades. If you want, you can create an additional partition for you firmware/diagnostic tools, just don't mess with the partition created by Windows -- you may reder it unbootable.<br />
<br />
===Building WinPE USB-HDD image with syslinux===<br />
if for some ethical or religious reasons you do not want to run any Windows code even in a virtual machine, or you don't have a virtual machine at all -- you can build a bootable WinPE USB-HDD image using '''syslinux''' and '''mtools'''.<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86.img count=250000<br />
* create a bootable partition entry<br />
/sbin/parted winpe3_x86.img<br />
(parted) mklabel msdos<br />
(parted) unit s<br />
(parted) print free<br />
(parted) mkpart primary fat32<br />
(parted) set 1 boot on<br />
(parted) print<br />
in my case the output looks like this. Note the numbers corresponding to "Start" and "Size" of your partition, we will use them in the next command<br />
Model: (file)<br />
Disk /tmp/winpe3_x86.img: 250000s<br />
Sector size (logical/physical): 512B/512B<br />
Partition Table: msdos<br />
<br />
Number Start End Size Type File system Flags<br />
1 '''32'''s 249999s '''249968'''s primary boot, lba<br />
* create and format the partition image<br />
dd if=/dev/zero of=winpe3_x86p1.img count='''249968'''<br />
/sbin/mkfs.vfat -F32 winpe3_x86p1.img<br />
* copy the files (you may have to put "mtools_skip_check=1" into <tt>~/.mtoolsrc</tt> if your partition is not aligned like mine)<br />
mmd -i winpe3_x86p1.img boot<br />
mmd -i winpe3_x86p1.img sources<br />
mcopy -i winpe3_x86p1.img /tmp/wAIKX86.msi/F1_BOOTMGR ::/bootmgr<br />
mcopy -i winpe3_x86p1.img /tmp/wAIKX86.msi/F_WINPE_X86_bcd ::/boot/bcd<br />
mcopy -i winpe3_x86p1.img /tmp/wAIKX86.msi/F_WINPE_X86_boot.sdi ::/boot/boot.sdi<br />
mcopy -i winpe3_x86p1.img /tmp/WinPE.cab/F1_WINPE.WIM ::/sources/boot.wim<br />
mcopy -i winpe3_x86p1.img /usr/lib/syslinux/chain.c32 ::/chain.c32<br />
* create the config file <tt>/tmp/syslinux.cfg</tt> and copy it<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
COM32 /chain.c32<br />
APPEND boot ntldr=/bootmgr<br />
<br />
mcopy -i winpe3_x86p1.img /tmp/syslinux.cfg ::/syslinux.cfg<br />
* install syslinux and copy the partition image into the disk image<br />
syslinux winpe3_x86p1.img<br />
dd if=winpe3_x86p1.img of=winpe3_x86.img seek='''32'''<br />
* now the image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades.<br />
<br />
==How to build a bootable WinPE USB-FDD image==<br />
Any BIOS that supports booting from some USB media at all supports booting from USB-FDD. As it was mentioned ealier, the problem with WinPE is that the bootloader <tt>bootmgr</tt> does not seem to like such devices. A natural thing to do would be to create a virtual HDD, e.g. with <tt>memdisk</tt>, and boot from there. But here we face a deficiency of <tt>memdisk</tt>: for some BIOSes (including Thinkpads!) it will boot if the disk-image physically resides on a real HDD, but will hang if the image is on a USB media.<br />
<br />
The only workaround I've found for making a bootable WinPE USB-FDD looks awkward, but it works! Ironically, to boot Windows we will have to use Linux, namely the '''kexec''' feature of the Linux kernel.<br />
<br />
* get <tt>kexec</tt> binary compiled for i386 (for example, you can extract it from the Debian package [http://packages.debian.org/testing/i386/kexec-tools/download kexec-tools])<br />
* get <tt>grub.exe</tt> from [http://sourceforge.net/projects/grub4dos/files/ grub4dos]<br />
* download some Linux "liveCD" capable of booting from USB-FDD (I personally like [http://www.sysresccd.org/Download SystemRescueCd]) and make a bootable USB-FDD<br />
* mount your Linux USB-FDD to <tt>/mnt/flash</tt> and create the directory <tt>/mnt/flash/winpe</tt><br />
* copy the files<br />
cp grub.exe /mnt/flash/winpe/<br />
cp kexec /mnt/flash/winpe/<br />
cp /tmp/winpe3_x86p1.img /mnt/flash/winpe/winpe.img<br />
the last file you've created when building the bootable USB-HDD image. Note that this is the image of the partition, not of the whole HD.<br />
* create the script <tt>/mnt/flash/winpe/winpe.sh</tt><br />
#!/bin/sh<br />
./kexec -l grub.exe --initrd=winpe.img --command-line="--config-file=map (rd) (fd0); map --hook; chainloader (fd0)+1; rootnoverify (fd0)"<br />
./kexec -e<br />
* unmount <tt>/mnt/flash</tt>, the image is ready<br />
* now, you may first need to change some of your BIOS settings. For me, WinPE refuses to boot if the harddrive controller is in AHCI mode, so I have to put it into "Compatibility mode". Boot Linux from your USB-FDD as usual. Once you are in the root shell, you can start WinPE<br />
# cp /mnt/flash/winpe/* /tmp/<br />
# cd /tmp<br />
# chmod 755 kexec winpe.sh<br />
# ./winpe.sh</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Windows_PE&diff=48094Windows PE2010-04-07T00:06:52Z<p>Newhren: add USB-FDD</p>
<hr />
<div>Some utilities/drivers provided by IBM/Lenovo come only in the form of Windows executables (for example, [[Intel_Active_Management_Technology_(AMT)|Intel AMT]] firmware updates). And for people who don't use Windows OS on their computers it becomes impossible to use/apply them. Luckily, Microsoft provides [http://www.microsoft.com/downloads/en/results.aspx?pocId=&freetext=Automated%20Installation%20Kit&DisplayLang=en Automated Installation Kit] (aka AIK) for free to everyone with very few resctictions on usage (basically, they only prohibit using it as a substitute of a "real" OS, and allow to use it for any diagnostic and reapair tasks). The latest version is [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34 The Windows® Automated Installation Kit (AIK) for Windows® 7]. Users of Windows OS can install this AIK and create bootable CD-ROMs and bootable USB-flash drives with Windows PE (or WinPE for short), which is essentially a stripped-down version of Windows. In this article we will explain how to create bootable CD-ROMs and USB-flash drives with WinPE using only free software.<br />
<br />
==How to build a bootable WinPE *.iso image==<br />
* From the AIK installation file <tt>KB3AIK_EN.iso</tt>, provided in the form of a UDF disk image, use <tt>7z</tt> (from [http://sourceforge.net/projects/p7zip p7zip]) to extract the files <tt>wAIKX86.msi</tt> and <tt>WinPE.cab</tt><br />
* use <tt>7z</tt> or <tt>cabextract</tt> to unpack these files into <tt>/tmp/wAIKX86.msi/</tt> and <tt>/tmp/WinPE.cab/</tt> respectively<br />
* create a bootable WinPE *.iso image <tt>/tmp/winpe3_x86.iso</tt><br />
cd /tmp<br />
mkdir -p winpe3_x86/boot<br />
mkdir -p winpe3_x86/sources<br />
cp wAIKX86.msi/F_WINPE_X86_etfsboot.com winpe3_x86/etfsboot.com<br />
cp wAIKX86.msi/F1_BOOTMGR winpe3_x86/bootmgr<br />
cp wAIKX86.msi/F_WINPE_X86_bcd winpe3_x86/boot/bcd<br />
cp wAIKX86.msi/F_WINPE_X86_boot.sdi winpe3_x86/boot/boot.sdi<br />
cp WinPE.cab/F1_WINPE.WIM winpe3_x86/sources/boot.wim<br />
genisoimage -sysid "" -A "" -V "Microsoft Windows PE (x86)" -d -N -b etfsboot.com -no-emul-boot \<br />
-c boot.cat -hide etfsboot.com -hide boot.cat -o winpe3_x86.iso winpe3_x86<br />
the file you will get will be about 120M in size. Then you can burn this *.iso and boot it on any x86-machine which supports booting from CD-ROMs (which is pretty much any PC today)<br />
<br />
==How to build a bootable WinPE USB-HDD image==<br />
a more convenient option would be to create a bootable USB-flash drive. Unfortunately, Windows loader does not seem to support booting from USB-FDDs, while for some BIOSes this is the only type of bootable USB-flash devices.<br />
<br />
===Building WinPE USB-HDD image in a virtual machine===<br />
Since we already have a bootable WinPE *.iso image, we can use it to build a bootable WinPE USB-HDD image in a virtual machine like '''qemu'''.<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86.img count=250000<br />
* boot <tt>winpe3_x86.iso</tt> (which you've created before) in a virtual machine<br />
qemu -cdrom winpe3_x86.iso -boot d -m 640 -hda winpe3_x86.img<br />
* now, in the shell provided by WinPE in the virtual machine<br />
diskpart.exe<br />
diskpart> list disk<br />
diskpart> select disk 0<br />
diskpart> clean<br />
diskpart> create partition primary<br />
diskpart> list partition<br />
diskpart> select partition 1<br />
diskpart> format fs=fat32 quick<br />
diskpart> active<br />
diskpart> assign<br />
diskpart> list volume<br />
diskpart> exit<br />
xcopy /s d:\* c:\<br />
wpeutil shutdown<br />
* when the virtual machine shuts down, the bootable WinPE image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades. If you want, you can create an additional partition for you firmware/diagnostic tools, just don't mess with the partition created by Windows -- you may reder it unbootable.<br />
<br />
===Building WinPE USB-HDD image with syslinux===<br />
if for some ethical or religious reasons you do not want to run any Windows code even in a virtual machine, or you don't have a virtual machine at all -- you can build a bootable WinPE USB-HDD image using '''syslinux''' and '''mtools'''.<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86.img count=250000<br />
* create a bootable partition entry<br />
/sbin/parted winpe3_x86.img<br />
(parted) mklabel msdos<br />
(parted) unit s<br />
(parted) print free<br />
(parted) mkpart primary fat32<br />
(parted) set 1 boot on<br />
(parted) print<br />
in my case the output looks like this. Note the numbers corresponding to "Start" and "Size" of your partition, we will use them in the next command<br />
Model: (file)<br />
Disk /tmp/winpe3_x86.img: 250000s<br />
Sector size (logical/physical): 512B/512B<br />
Partition Table: msdos<br />
<br />
Number Start End Size Type File system Flags<br />
1 '''32'''s 249999s '''249968'''s primary boot, lba<br />
* create and format the partition image<br />
dd if=/dev/zero of=winpe3_x86p1.img count='''249968'''<br />
/sbin/mkfs.vfat -F32 winpe3_x86p1.img<br />
* copy the files (you may have to put "mtools_skip_check=1" into <tt>~/.mtoolsrc</tt> if your partition is not aligned like mine)<br />
mmd -i winpe3_x86p1.img boot<br />
mmd -i winpe3_x86p1.img sources<br />
mcopy -i winpe3_x86p1.img /tmp/wAIKX86.msi/F1_BOOTMGR ::/bootmgr<br />
mcopy -i winpe3_x86p1.img /tmp/wAIKX86.msi/F_WINPE_X86_bcd ::/boot/bcd<br />
mcopy -i winpe3_x86p1.img /tmp/wAIKX86.msi/F_WINPE_X86_boot.sdi ::/boot/boot.sdi<br />
mcopy -i winpe3_x86p1.img /tmp/WinPE.cab/F1_WINPE.WIM ::/sources/boot.wim<br />
mcopy -i winpe3_x86p1.img /usr/lib/syslinux/chain.c32 ::/chain.c32<br />
* create the config file <tt>/tmp/syslinux.cfg</tt> and copy it<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
COM32 /chain.c32<br />
APPEND boot ntldr=/bootmgr<br />
<br />
mcopy -i winpe3_x86p1.img /tmp/syslinux.cfg ::/syslinux.cfg<br />
* install syslinux and copy the partition image into the disk image<br />
syslinux winpe3_x86p1.img<br />
dd if=winpe3_x86p1.img of=winpe3_x86.img seek='''32'''<br />
* now the image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades.<br />
<br />
==How to build a bootable WinPE USB-FDD image==<br />
Any BIOS that supports booting from some USB media at all supports booting from USB-FDD. As it was mentioned ealier, the problem with WinPE is that the bootloader <tt>bootmgr</tt> does not seem to like such devices. A natural thing to do would be to create a virtual HDD, e.g. with <tt>memdisk</tt>, and boot from there. But here we face a deficiency of <tt>memdisk</tt>: for some BIOSes (including Thinkpads!) it will boot if the disk-image physically resides on a real HDD, but will hang if the image is on a USB media.<br />
<br />
The only only way I found to boot WinPE from USB-FDD looks awkward, but it works! To do the trick we will use '''kexec''' feature of the Linux kernel.<br />
<br />
* get <tt>kexec</tt> binary compiled for i386 (for example, you can extract it from the Debian package [http://packages.debian.org/testing/i386/kexec-tools/download kexec-tools])<br />
* get <tt>grub.exe</tt> from [http://sourceforge.net/projects/grub4dos/files/ grub4dos]<br />
* download some liveCD linux capable of booting from USB-FDD (I personally like [http://www.sysresccd.org/Download SystemRescueCd]) and make a bootable USB-FDD<br />
* mount you Linux USB-FDD to <tt>/mnt/flash</tt> and create directory <tt>/mnt/flash/winpe</tt><br />
* copy the files<br />
cp grub.exe /mnt/flash/winpe/<br />
cp kexec /mnt/flash/winpe/<br />
cp /tmp/winpe3_x86p1.img /mnt/flash/winpe/winpe.img<br />
the last file you've created when building the bootable USB-HDD image<br />
* create the script <tt>/mnt/flash/winpe/winpe.sh</tt><br />
#!/bin/sh<br />
./kexec -l grub.exe --initrd=winpe.img --command-line="--config-file=map (rd) (fd0); map --hook; chainloader (fd0)+1; rootnoverify (fd0)"<br />
./kexec -e<br />
* unmount <tt>/mnt/flash</tt>, the image is ready<br />
* now, you may first need to change some of your BIOS settings. For me, WinPE refuses to boot if the harddrive controller is in AHCI mode, so I have to put it into "Compatibility mode". Boot Linux from your USB-FDD as usual. Once you are in the root shell, you can kexec into WinPE<br />
cp /mnt/flash/winpe/* /tmp/<br />
cd /tmp<br />
chmod 755 kexec winpe.sh<br />
./winpe.sh</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Windows_PE&diff=48093Windows PE2010-04-06T20:22:06Z<p>Newhren: don't need to have access to root account</p>
<hr />
<div>Some utilities/drivers provided by IBM/Lenovo come only in the form of Windows executables (for example, [[Intel_Active_Management_Technology_(AMT)|Intel AMT]] firmware updates). And for people who don't use Windows OS on their computers it becomes impossible to use/apply them. Luckily, Microsoft provides [http://www.microsoft.com/downloads/en/results.aspx?pocId=&freetext=Automated%20Installation%20Kit&DisplayLang=en Automated Installation Kit] (aka AIK) for free to everyone with very few resctictions on usage (basically, they only prohibit using it as a substitute of a "real" OS, and allow to use it for any diagnostic and reapair tasks). The latest version is [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34 The Windows® Automated Installation Kit (AIK) for Windows® 7]. Users of Windows OS can install this AIK and create bootable CD-ROMs and bootable USB-flash drives with Windows PE (or WinPE for short), which is essentially a stripped-down version of Windows. In this article we will explain how to create bootable CD-ROMs and USB-flash drives with WinPE using only free software.<br />
<br />
==How to build a bootable WinPE *.iso image==<br />
* From the AIK installation file <tt>KB3AIK_EN.iso</tt>, provided in the form of a UDF disk image, use <tt>7z</tt> (from [http://sourceforge.net/projects/p7zip p7zip]) to extract the files <tt>wAIKX86.msi</tt> and <tt>WinPE.cab</tt><br />
* use <tt>7z</tt> or <tt>cabextract</tt> to unpack these files into <tt>/tmp/wAIKX86.msi/</tt> and <tt>/tmp/WinPE.cab/</tt> respectively<br />
* create a bootable WinPE *.iso image <tt>/tmp/winpe3_x86.iso</tt><br />
cd /tmp<br />
mkdir -p winpe3_x86/boot<br />
mkdir -p winpe3_x86/sources<br />
cp wAIKX86.msi/F_WINPE_X86_etfsboot.com winpe3_x86/etfsboot.com<br />
cp wAIKX86.msi/F1_BOOTMGR winpe3_x86/bootmgr<br />
cp wAIKX86.msi/F_WINPE_X86_bcd winpe3_x86/boot/bcd<br />
cp wAIKX86.msi/F_WINPE_X86_boot.sdi winpe3_x86/boot/boot.sdi<br />
cp WinPE.cab/F1_WINPE.WIM winpe3_x86/sources/boot.wim<br />
genisoimage -sysid "" -A "" -V "Microsoft Windows PE (x86)" -d -N -b etfsboot.com -no-emul-boot \<br />
-c boot.cat -hide etfsboot.com -hide boot.cat -o winpe3_x86.iso winpe3_x86<br />
the file you will get will be about 120M in size. Then you can burn this *.iso and boot it on any x86-machine which supports booting from CD-ROMs (which is pretty much any PC today)<br />
<br />
==How to build a bootable WinPE USB-HDD image==<br />
a more convenient option would be to create a bootable USB-flash drive. Unfortunately, Windows loader does not seem to support booting from USB-FDDs, while for some BIOSes this is the only type of bootable USB-flash devices.<br />
<br />
===Building WinPE USB-HDD image in a virtual machine===<br />
Since we already have a bootable WinPE *.iso image, we can use it to build a bootable WinPE USB-HDD image in a virtual machine like '''qemu'''.<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86.img count=250000<br />
* boot <tt>winpe3_x86.iso</tt> (which you've created before) in a virtual machine<br />
qemu -cdrom winpe3_x86.iso -boot d -m 640 -hda winpe3_x86.img<br />
* now, in the shell provided by WinPE in the virtual machine<br />
diskpart.exe<br />
diskpart> list disk<br />
diskpart> select disk 0<br />
diskpart> clean<br />
diskpart> create partition primary<br />
diskpart> list partition<br />
diskpart> select partition 1<br />
diskpart> format fs=fat32 quick<br />
diskpart> active<br />
diskpart> assign<br />
diskpart> list volume<br />
diskpart> exit<br />
xcopy /s d:\* c:\<br />
wpeutil shutdown<br />
* when the virtual machine shuts down, the bootable WinPE image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades. If you want, you can create an additional partition for you firmware/diagnostic tools, just don't mess with the partition created by Windows -- you may reder it unbootable.<br />
<br />
===Building WinPE USB-HDD image with syslinux===<br />
if for some ethical or religious reasons you do not want to run any Windows code even in a virtual machine, or you don't have a virtual machine at all -- you can build a bootable WinPE USB-HDD image using '''syslinux''' and '''mtools'''.<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86.img count=250000<br />
* create a bootable partition entry<br />
/sbin/parted winpe3_x86.img<br />
(parted) mklabel msdos<br />
(parted) unit s<br />
(parted) print free<br />
(parted) mkpart primary fat32<br />
(parted) set 1 boot on<br />
(parted) print<br />
in my case the output looks like this. Note the numbers corresponding to "Start" and "Size" of your partition, we will use them in the next command<br />
Model: (file)<br />
Disk /tmp/winpe3_x86.img: 250000s<br />
Sector size (logical/physical): 512B/512B<br />
Partition Table: msdos<br />
<br />
Number Start End Size Type File system Flags<br />
1 '''32'''s 249999s '''249968'''s primary boot, lba<br />
* create and format the partition image<br />
dd if=/dev/zero of=winpe3_x86p1.img count='''249968'''<br />
/sbin/mkfs.vfat -F32 winpe3_x86p1.img<br />
* copy the files (you may have to put "mtools_skip_check=1" into <tt>~/.mtoolsrc</tt> if your partition is not aligned like mine)<br />
mmd -i winpe3_x86p1.img boot<br />
mmd -i winpe3_x86p1.img sources<br />
mcopy -i winpe3_x86p1.img /tmp/wAIKX86.msi/F1_BOOTMGR ::/bootmgr<br />
mcopy -i winpe3_x86p1.img /tmp/wAIKX86.msi/F_WINPE_X86_bcd ::/boot/bcd<br />
mcopy -i winpe3_x86p1.img /tmp/wAIKX86.msi/F_WINPE_X86_boot.sdi ::/boot/boot.sdi<br />
mcopy -i winpe3_x86p1.img /tmp/WinPE.cab/F1_WINPE.WIM ::/sources/boot.wim<br />
mcopy -i winpe3_x86p1.img /usr/lib/syslinux/chain.c32 ::/chain.c32<br />
* create the config file <tt>/tmp/syslinux.cfg</tt> and copy it<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
COM32 /chain.c32<br />
APPEND boot ntldr=/bootmgr<br />
<br />
mcopy -i winpe3_x86p1.img /tmp/syslinux.cfg ::/syslinux.cfg<br />
* install syslinux and copy the partition image into the disk image<br />
syslinux winpe3_x86p1.img<br />
dd if=winpe3_x86p1.img of=winpe3_x86.img seek='''32'''<br />
* now the image is ready. If you have write permissions for some flash media device (e.g. <tt>/dev/sdb</tt>), you can copy it with<br />
# dd if=winpe3_x86.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades.</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Ericsson_F3507g_Mobile_Broadband_Module&diff=48082Ericsson F3507g Mobile Broadband Module2010-04-05T21:49:19Z<p>Newhren: the poster did not read other sections before posting and just copied already existing info. this section is for showing how to use already powered up card, complete working scripts are below.</p>
<hr />
<div>{| width="100%"<br />
|style="vertical-align:top" |<br />
<div style="margin: 0; margin-right:10px; border: 1px solid #dfdfdf; padding: 0em 1em 1em 1em; background-color:#F8F8FF; align:right;"><br />
=== Ericsson F3507g Mobile Broadband Module ===<br />
This is a Ericsson WWAN Adapter that is installed in a Mini-PCI Express slot<br />
<br />
{{NOTE|Specific versions of this card may come pre-configured for a certain carrier (AT&T)}}<br />
<br />
=== Features ===<br />
* Chipset: Ericsson F3507g<br />
* USB ID: 0bdb:1900<br />
* USB ID: 0bdb:1902<br />
* WCDMA 2100/1900/850MHz<br />
* GSM/GPRS/EDGE 850/900/1800/1900MHz<br />
* GPS<br />
* Download up to 7.2Mbps<br />
* Upload up to 2.0Mbps<br />
</div><br />
|style="vertical-align:top" |<br />
[[image:EriccsonWWAN.gif|thumb|Ericsson F3507g WWAN Adapter]]<br />
|}<br />
__TOC__<br />
<br />
== Lenovo Partnumbers ==<br />
* Option PN 43R9152 (AT&T)<br />
* FRU 43Y6537 (AT&T)<br />
* FRU 43Y6513 (Other)<br />
<br />
==Configuring the Ericsson F3507g in Ubuntu Intrepid linux (and later)==<br />
Please read this article, as it will show you step by step on how to set up the scripts necessary to make the card work. As of 9.10, the gnome network manager applet will allow you to successfully configure the card, however going into sleep mode will make it unavailable afterwards. These scripts will wake up the card.<br />
<br />
* [http://redmonk.com/sogrady/2008/12/07/how-to-use-an-att-ericsson-f3507g-card-on-ubuntu-intrepid/ How to use an att ericsson f3507g card on ubuntu intrepid]<br />
<br />
==Other options==<br />
<br />
Here are some basics about Ericsson F3507g MiniPCIe WWAN/GPS card (USB ID <tt>0bdb:1900</tt> and <tt>0bdb:1902</tt>):<br />
<br />
* the card will not work without an inserted SIM, even the GPS function. If you want to use just GPS, any SIM would work, even if it is not attached to any active account with any GSM provider.<br />
* the card provides three CDC ACM interfaces (<tt>CONFIG_USB_ACM=m</tt>), two CDC WDM interfaces (<tt>CONFIG_USB_WDM=m</tt>) and one CDC Ethernet interface (<tt>CONFIG_USB_NET_CDCETHER=m</tt>), and identifies them as<br />
for n in `ls /sys/class/*/*{ACM,wdm,usb0}*/device/interface`;do echo $(echo $n|awk -F '/' '{print $5}') : $(cat $n);done<br />
<br />
usb0 : Ericsson F3507g Mobile Broadband Minicard Network Adapter<br />
ttyACM0 : Ericsson F3507g Mobile Broadband Minicard Modem<br />
ttyACM1 : Ericsson F3507g Mobile Broadband Minicard Data Modem<br />
ttyACM2 : Ericsson F3507g Mobile Broadband Minicard GPS Port<br />
cdc-wdm0 : Ericsson F3507g Mobile Broadband Minicard Device Management<br />
cdc-wdm1 : Ericsson F3507g Mobile Broadband Minicard PC SC Port<br />
'''Note''':<br />
*apparently, for a while <tt>option</tt> USB-serial driver had claimed USB ID <tt>0bdb:1900</tt>, but this was wrong, and as of kernel 2.6.28.9 that commit was reversed. If instead of <tt>/dev/ttyACM*</tt> you see <tt>/dev/ttyUSB*</tt>, it means that <tt>option</tt> module is loaded. You may need to blacklist it to make sure it doesn't happen.<br />
*Support for the CDC Ethernet interface appears only in kernel 2.6.28.8. But if your kernel is older, you can still connect to the net using one of the "Modem" interfaces.<br />
<br />
As Ericsson's naming scheme suggests, idealy we would use <tt>/dev/cdc-wdm0</tt> for controlling the card, <tt>usb0</tt> as a network device, <tt>/dev/ttyACM0</tt> or <tt>/dev/ttyACM1</tt> as a modem, and <tt>/dev/ttyACM2</tt> for GPS. This works for manual testing, but unfortunately, due to [http://markmail.org/message/2sd7culbgekugow2 limitations] of <tt>chat</tt>, does not play very well in scripts. So, instead of <tt>/dev/cdc-wdm0</tt>, for controlling the card we will use <tt>/dev/ttyACM1</tt>.<br />
<br />
==Turning the card on==<br />
First, check whenever the SIM is protected by PIN by sending <br />
<br />
AT+CPIN?<br />
<br />
to <tt>/dev/ttyACM1</tt>. You can do it with any terminal terminal program like <tt>cu</tt> or <tt>minicom</tt>. If the answer is<br />
<br />
+CPIN: READY<br />
<br />
then the SIM is unlocked. If the answer is<br />
<br />
+CPIN: SIM PIN<br />
<br />
you need first to unlock it by sending<br />
<br />
AT+CPIN="YOUR-PIN"<br />
<br />
to <tt>/dev/ttyACM1</tt>. Now the card can be turned on by sending <br />
<br />
AT+CFUN=1<br />
<br />
to <tt>/dev/ttyACM1</tt>. The answer should be<br />
<br />
+PACSP0<br />
<br />
Don't try to do anything until you see it. To force GSM-only connection, send<br />
<br />
AT+CFUN=5<br />
<br />
to <tt>/dev/ttyACM1</tt>. To force WCDMA-only connection, send<br />
<br />
AT+CFUN=6<br />
<br />
to <tt>/dev/ttyACM1</tt>.<br />
<br />
==Turning the card off==<br />
To put the card into energy-saving mode (this is the default), you can send<br />
<br />
AT+CFUN=4<br />
<br />
to <tt>/dev/ttyACM1</tt>. To remove all power from the card, send<br />
<br />
AT+CFUN=0<br />
<br />
to <tt>/dev/ttyACM1</tt>. Be carefull with the last command. It turns the card completely off, and it will no longer accept any AT-commands before the hard reset. To physically reset the card flip the wireless switch off, and then on. You can do the same by sending <tt>echo 0 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state</tt> (to turn off) and then <tt>echo 1 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state</tt> (to turn on).<br />
<br />
==Using the card as a wireless modem==<br />
Once the card is turned on, there are two ways to connect to the net. The first one is just to use the card as any "normal" GPRS modem and start <tt>pppd</tt> daemon on one of <tt>/dev/ttyACM*</tt>. The other way is to use CDC Ethernet interface. It is supposed to be more efficient, but it requires a pretty recent (>=2.6.28.8) kernel.<br />
<br />
====Connecting to the net via pppd====<br />
For the first approach, the easiest way to do it is to use <tt>wvdial</tt>. For example, to connect to AT&T Wireless network, your <tt>/etc/wvdial.conf</tt> would have to be something like this<br />
[Dialer 3G]<br />
Modem = /dev/ttyACM0<br />
Init1 = AT+CGDCONT=1,"IP","'''proxy'''"<br />
Stupid mode = 1<br />
phone= *99#<br />
Username = *<br />
Password = *<br />
'''Note''': if you are using a SIM from a different mobile provider, you may need to change the access point name (APN) "'''proxy'''" in <tt>Init1</tt> string and Username/Password to something else. You can find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here].<br />
<br />
====Connecting to the net via CDC Ethernet interface====<br />
The [http://marc.info/?l=linux-usb&m=123334979706403&w=2 second approach] works for kernels >=2.6.28.8. Configure the APN by sending<br />
<br />
AT+CGDCONT=1,"IP","'''proxy'''"<br />
<br />
to <tt>/dev/ttyACM1</tt>. Instead of "'''proxy'''" you may need to use to something else. Find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here]. To initiate the connection, send<br />
<br />
AT*ENAP=1,1<br />
<br />
to <tt>/dev/ttyACM1</tt>. Now, if your wireless provider lets you in, you are connected. Launch <tt>dhclient</tt><br />
<br />
dhclient usb0<br />
<br />
and start surfing the net. To disconnect, send<br />
<br />
AT*ENAP=0<br />
<br />
to <tt>/dev/ttyACM1</tt>.<br />
<br />
==Using the card as a GPS receiver==<br />
Once the card is turned on, we can use it to get GPS info via NMEA protocol. First, you have to configure the a few NMEA options. It is done by sending <br />
<br />
AT*E2GPSCTL=X,Y,Z<br />
<br />
to <tt>/dev/ttyACM1</tt>. Here<br />
<br />
*X can be 0 (NMEA stream turned off) or 1 (NMEA stream turned on)<br />
*Y can be an integer form 1 to 60, and sets the frequency of how often the card emits the NMEA sentences<br />
*Z can be 0 (DGPS is turned off) or 1 (DGPS is turned on)<br />
<br />
so, to configure the GPSr to update every 5 seconds, and turn DGPS on, you would send<br />
<br />
AT*E2GPSCTL=1,5,1<br />
<br />
to <tt>/dev/ttyACM1</tt>. Once the GPSr is configured, we can get the NMEA stream on /dev/ttyACM2 by sending<br />
<br />
AT*E2GPSNPD<br />
<br />
to <tt>/dev/ttyACM2</tt>. Once you do that, <tt>/dev/ttyACM2</tt> will no longer accept any new AT-commands. But you still can change the the behavior of the NMEA stream by sending the appropriate<br />
<br />
AT*E2GPSCTL=X,Y,Z<br />
<br />
to <tt>/dev/ttyACM1</tt>. Now you can read the NMEA stream by saying<br />
<br />
cat /dev/ttyACM2<br />
<br />
or better yet, start <tt>gpsd</tt> interface on <tt>/dev/ttyACM2</tt>.<br />
<br />
Note: There is a now a sourceforge project dedicated to the Ericsson Mobile Broadband modules. Gps control sw that does the above automatically is available and also a graphical user interface. Details are available on the [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=Main_Page#GPS_Control_.28mbm-gpsd.29 MBM Wiki].<br />
<br />
==Scripting everything==<br />
Install the packages<br />
<br />
apt-get install sysfsutils gpsd wvdial<br />
<br />
In order to save the power, lets use '''sysfsutils''' to completely power off the WWAN card on boot. Append the following line to <tt>/etc/sysfs.conf</tt><br />
<br />
devices/platform/thinkpad_acpi/rfkill/rfkill0/state = 0<br />
<br />
It will power down the card on boot, but when the laptop wakes from sleep, in some cases the card is powered up agian. To re-apply these settings on wake-up, create a script named <tt>/etc/pm/sleep.d/10sysfsutils</tt>:<br />
<br />
#!/bin/sh<br />
case $1 in<br />
(hibernate|suspend)<br />
;;<br />
(thaw|resume)<br />
/etc/init.d/sysfsutils start<br />
;;<br />
*) echo "somebody is calling me totally wrong."<br />
;;<br />
esac<br />
<br />
Don't forget to <tt>chmod a+x /etc/pm/sleep.d/10sysfsutils</tt>. Create a file called <tt>/usr/local/etc/F3507g</tt> containing the following:<br />
<br />
GPSDPID="/var/run/gpsd.pid"<br />
CONTROL_DEVICE=/dev/$(for n in /sys/class/tty/ttyACM*/device/interface;do if [ "`cat $n`" = "Ericsson F3507g Mobile Broadband Minicard Data Modem" ]; then echo $n|awk -F '/' '{print $5}'; fi; done)<br />
GPS_DEVICE=/dev/$(for n in /sys/class/tty/ttyACM*/device/interface;do if [ "`cat $n`" = "Ericsson F3507g Mobile Broadband Minicard GPS Port" ]; then echo $n|awk -F '/' '{print $5}'; fi; done)<br />
RFKILL_DEVICE=$(for n in /sys/devices/platform/thinkpad_acpi/rfkill/rfkill*; do if [ "`cat $n/name`" = "tpacpi_wwan_sw" ]; then echo $n/state; fi; done)<br />
'''PIN=""'''<br />
'''APN="proxy"'''<br />
<br />
powerup_F3507g () {<br />
echo -n "Powering up F3507g card.."<br />
echo 1 > $RFKILL_DEVICE<br />
while [ ! -c $CONTROL_DEVICE ]; do sleep 0.5; echo -n "."; done<br />
echo "done"<br />
echo -n "Turning on F3507g card..."<br />
sleep 3<br />
if [ -n "$PIN" ]; then<br />
/usr/sbin/chat -v "" "AT+CPIN?" "SIM PIN" "AT" "OK" "AT+CPIN=\"$PIN\"" "OK" > $CONTROL_DEVICE < $CONTROL_DEVICE<br />
fi<br />
/usr/sbin/chat -v "" "AT+CPIN?" "READY" "AT+CFUN=1" "+PACSP0" "AT" "OK" > $CONTROL_DEVICE < $CONTROL_DEVICE<br />
echo "done"<br />
}<br />
<br />
powerdown_F3507g () {<br />
echo -n "Turning off F3507g card..."<br />
/usr/sbin/chat -v "" "AT+CFUN=4" "OK" > $CONTROL_DEVICE < $CONTROL_DEVICE<br />
echo "done"<br />
echo -n "Powering down F3507g card.."<br />
echo 0 > $RFKILL_DEVICE<br />
while [ -c $CONTROL_DEVICE ]; do sleep 0.5; echo -n "."; done<br />
echo "done"<br />
}<br />
<br />
configure_GPS () {<br />
/usr/sbin/chat -v "" "AT*E2GPSCTL=$1,$2,$3" "OK" > $CONTROL_DEVICE < $CONTROL_DEVICE<br />
}<br />
<br />
turnon_GPS () {<br />
echo -n "Starting NMEA stream on $GPS_DEVICE..."<br />
configure_GPS 1 1 1<br />
sleep 1<br />
/usr/sbin/chat -v "" "AT*E2GPSNPD" "GPGGA" > $GPS_DEVICE < $GPS_DEVICE<br />
start-stop-daemon --start --exec /usr/sbin/gpsd -- -P $GPSDPID $GPS_DEVICE<br />
echo "done"<br />
}<br />
<br />
turnoff_GPS () {<br />
echo -n "Stopping NMEA stream on $GPS_DEVICE..."<br />
start-stop-daemon --stop --pidfile $GPSDPID<br />
configure_GPS 0 1 0<br />
echo "done"<br />
turnoff_F3507g<br />
}<br />
<br />
turnon_usbnet () {<br />
echo -n "Starting usbnet connection..."<br />
/usr/sbin/chat -v "" "AT+CGDCONT=1,\"IP\",\"$APN\"" "OK" "AT*ENAP=1,1" "OK" > $CONTROL_DEVICE < $CONTROL_DEVICE<br />
echo "done"<br />
}<br />
<br />
turnoff_usbnet () {<br />
echo -n "Stopping usbnet connection..."<br />
/usr/sbin/chat -v "" "AT*ENAP=0" "OK" > $CONTROL_DEVICE < $CONTROL_DEVICE<br />
echo "done"<br />
turnoff_F3507g<br />
}<br />
<br />
turnoff_F3507g () {<br />
[ -z $(grep gps /etc/network/run/ifstate) ] && \<br />
[ -z $(grep usb0 /etc/network/run/ifstate) ] && \<br />
[ -z $(grep 3G /etc/network/run/ifstate) ] && \<br />
ifdown F3507g<br />
}<br />
<br />
Give the correct '''PIN''' and find the '''APN''' for your wireless provider [http://www.pinstack.com/carrier_settings_apn_gateway.html here]. Append the following lines to your <tt>/etc/network/interfaces</tt> file<br />
<br />
iface F3507g inet manual<br />
up . /usr/local/etc/F3507g; powerup_F3507g<br />
down . /usr/local/etc/F3507g; powerdown_F3507g<br />
<br />
iface 3G inet wvdial<br />
pre-up ifup F3507g<br />
post-down . /usr/local/etc/F3507g; turnoff_F3507g<br />
provider 3G<br />
<br />
iface gps inet manual<br />
up . /usr/local/etc/F3507g; ifup F3507g; turnon_GPS<br />
down . /usr/local/etc/F3507g; turnoff_GPS<br />
<br />
iface usb0 inet dhcp<br />
pre-up . /usr/local/etc/F3507g; ifup F3507g; turnon_usbnet<br />
post-down . /usr/local/etc/F3507g; turnoff_usbnet<br />
<br />
Configure <tt>/etc/wvdial.conf</tt> to look like this:<br />
<br />
[Dialer 3G]<br />
Modem = /dev/ttyACM0<br />
Init1 = AT+CGDCONT=1,"IP","'''proxy'''"<br />
Stupid mode = 1<br />
phone= *99#<br />
Username = *<br />
Password = *<br />
<br />
'''Note''': you may need to change the access point name (APN) "'''proxy'''" in <tt>Init1</tt> string and Username/Password to something else. Find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here].<br />
<br />
Now broadband connection could be started in the same way as you start any other network interface, just by saying <tt>ifup usb0</tt> (or <tt>ifup 3G</tt>, if connecting via <tt>pppd</tt>). To shut it down, say <tt>ifdown usb0</tt> (or <tt>ifdown 3G</tt>). Similarly, GPS interface is started by <tt>ifup gps</tt> and turned off by <tt>ifdown gps</tt>. Once you get a fix, you can use your favourite GPS mapping application like [http://www.tangogps.org tangogps]. The "cold start" seems to take quite a bit however, and sometimes it cannot get a fix if indoors.<br />
<br />
==Using F3507g with NetworkManager==<br />
Work is ongoing to add support for Ericsson Mobile Broadband Modules to GNOME NetworkManager / modem-manager. More information is available on the [http://mbm.sourceforge.net/ MBM project website] and the [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=MBM MBM wiki].<br />
<br />
The F3507g card (in a ThinkPad {{T400s}}) works out of the box on Fedora 11. No configuration is needed beyond setting the data plan provider in the nm-applet GUI.<br />
<br />
Using mbm-gpsd gps works flawlessly with the F3507g on Karmic Koala with modemmanager packages from [https://launchpad.net/~modemmanager/+archive/ppa Ubuntu PPA], the mbm-gpsd installed by source using the description from [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=MBM#GPS_Control_.28mbm-gpsd.29 here] and knowing the PIN of your SIM card.<br />
<br />
== SMS with wammu/gammu ==<br />
You can use [http://wammu.eu/ Wammu] to receive SMS (and probably send SMS too).<br />
<br />
After installing wammu (with the usual <tt>aptitude install wammu</tt> or whatever), choose to configure it "Manually":<br />
port=/dev/ttyACM0<br />
connection=at19200<br />
<br />
(credits: [http://www.thinkpad-forum.de/thinkpad-software/linux-und-osx/p633662-sms-mit-der-ericsson-3507g/ linrunner])<br />
<br />
Sony Ericsson F3507g configuration [http://wammu.eu/phones/sony-ericsson/3568/ explained on wammu website]<br />
<br />
==Other thoughts==<br />
While <tt>AT+CFUN=*</tt> and <tt>AT+CPIN=*</tt> are pretty standard commands for wireless modems and are well-documented (e.g. [http://developer.sonyericsson.com/getDocument.do?docId=65054 here] and [http://www.sierrawireless.com/resources/documents/support/2130617_Supported_AT_Command_Reference_Rev_2.1.pdf here]), it appears that the commands <tt>AT*E2GPSCTL</tt> and <tt>AT*E2GPSNPD</tt> are unique to the Ericsson F3507g card. All credit for discovering them goes to "Nickolai Zeldovich" who left a comment in this [http://redmonk.com/sogrady/2008/09/24/apone/ thread]. I imagine one could find them via a USB sniffer on a working Windows machine (or a Linux machine with Windows running in a virtual machine). Another way to get them is to try to look for "gps" string in Windows drivers. What is interesting, F3507g supports a few other AT-commands with "GPS" substring (you can get all supported AT-commands by sending <tt>AT*</tt> to <tt>/dev/ttyACM1</tt> after activating it with <tt>AT+CFUN=1</tt>). Anyway, there is a [http://www.natisbad.org/E4300/Dell_Wireless_5530_AT_cmd_ref.html project] aiming to document all AT-commands for the Ericsson F3507g card.<br />
<br />
==Related Links==<br />
*[http://www.ericsson.com/solutions/mobile_broadband_modules/docs/mobile_broadband_module_datasheet_print.pdf Ericsson Datasheet]<br />
*[http://www.natisbad.org/E4300/Dell_Wireless_5530_AT_cmd_ref.html F3705g - AT commands reference]<br />
*[http://www.pinstack.com/carrier_settings_apn_gateway.html Carrier internet Settings (Apn, Gateway, etc)]<br />
*[http://mbm.sourceforge.net/ MBM project website (Support for f3507g/f3607gw in NetworkManager, kernel drivers, gps control software etc)]<br />
<br />
==Bugs==<br />
* Ubuntu 8.10 kernel suffers from the "option" regression mentioned above. However both CDC ACM and CDC Ethernet interfaces are treated correctly by Ubuntu 9.04 kernel.<br />
* Playing around with the device under Linux can cause it to disappear under Windows Vista. Issue + Fix described [http://forums.lenovo.com/t5/T400-T500-and-newer-T-series/Ericsson-f3507g-doesn-t-appear-under-Vista32-anymore-but-works/m-p/138874 here]<br />
<br />
==ThinkPads this adapter may be found in==<br />
*{{SL300}}, {{SL400}}, {{SL500}}, {{SL510}}<br />
*{{T400}}, {{T400s}}, {{T500}}<br />
*{{W500}}<br />
*{{X200}}, {{X200 Tablet}}, {{X301}}</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Windows_PE&diff=48074Windows PE2010-04-04T12:33:17Z<p>Newhren: remove USB-HDD</p>
<hr />
<div>Some utilities/drivers provided by IBM/Lenovo come only in the form of Windows executables (for example, [[Intel_Active_Management_Technology_(AMT)|Intel AMT]] firmware updates). And for people who don't use Windows OS on their computers it becomes impossible to use/apply them. Luckily, Microsoft provides [http://www.microsoft.com/downloads/en/results.aspx?pocId=&freetext=Automated%20Installation%20Kit&DisplayLang=en Automated Installation Kit] (aka AIK) for free to everyone with very few resctictions on usage (basically, they only prohibit using it as a substitute of a "real" OS, and allow to use it for any diagnostic and reapair tasks). The latest version is [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34 The Windows® Automated Installation Kit (AIK) for Windows® 7]. Users of Windows OS can install this AIK and create bootable CD-ROMs and bootable USB-flash drives with Windows PE (or WinPE for short), which is essentially a stripped-down version of Windows. In this article we will explain how to create bootable CD-ROMs and USB-flash drives with WinPE using only free software.<br />
<br />
==How to build a bootable WinPE *.iso image==<br />
* From the AIK installation file <tt>KB3AIK_EN.iso</tt>, provided in the form of a UDF disk image, use <tt>7z</tt> (from [http://sourceforge.net/projects/p7zip p7zip]) to extract the files <tt>wAIKX86.msi</tt> and <tt>WinPE.cab</tt><br />
* use <tt>7z</tt> or <tt>cabextract</tt> to unpack these files into <tt>/tmp/wAIKX86.msi/</tt> and <tt>/tmp/WinPE.cab/</tt> respectively<br />
* create a bootable WinPE *.iso image <tt>/tmp/winpe3_x86.iso</tt><br />
cd /tmp<br />
mkdir -p winpe3_x86/boot<br />
mkdir -p winpe3_x86/sources<br />
cp wAIKX86.msi/F_WINPE_X86_etfsboot.com winpe3_x86/etfsboot.com<br />
cp wAIKX86.msi/F1_BOOTMGR winpe3_x86/bootmgr<br />
cp wAIKX86.msi/F_WINPE_X86_bcd winpe3_x86/boot/bcd<br />
cp wAIKX86.msi/F_WINPE_X86_boot.sdi winpe3_x86/boot/boot.sdi<br />
cp WinPE.cab/F1_WINPE.WIM winpe3_x86/sources/boot.wim<br />
genisoimage -sysid "" -A "" -V "Microsoft Windows PE (x86)" -d -N -b etfsboot.com -no-emul-boot \<br />
-c boot.cat -hide etfsboot.com -hide boot.cat -o winpe3_x86.iso winpe3_x86<br />
the file you will get will be about 120M in size. Then you can burn this *.iso and boot it on any x86-machine which supports booting from CD-ROMs (which is pretty much any PC today)<br />
<br />
==How to build a bootable WinPE USB-HDD image==<br />
a more convenient option would be to create a bootable USB-flash drive. Unfortunately, Windows loader does not seem to support booting from USB-FDDs, while for some BIOSes this is the only type of bootable USB-flash devices.<br />
<br />
===Building WinPE USB-HDD image in a virtual machine===<br />
Since we already have a bootable WinPE *.iso image, we can use it to build a bootable WinPE USB-HDD image in a virtual machine like '''qemu'''.<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86.img count=250000<br />
* boot <tt>winpe3_x86.iso</tt> (which you've created before) in a virtual machine<br />
qemu -cdrom winpe3_x86.iso -boot d -m 640 -hda winpe3_x86.img<br />
* now, in the shell provided by WinPE in the virtual machine<br />
diskpart.exe<br />
diskpart> list disk<br />
diskpart> select disk 0<br />
diskpart> clean<br />
diskpart> create partition primary<br />
diskpart> list partition<br />
diskpart> select partition 1<br />
diskpart> format fs=fat32 quick<br />
diskpart> active<br />
diskpart> assign<br />
diskpart> list volume<br />
diskpart> exit<br />
xcopy /s d:\* c:\<br />
wpeutil shutdown<br />
* when the virtual machine shuts down, you can copy WinPE image on a flash media. It will fit on any media > 125M in size.<br />
dd if=winpe3_x86.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades. If you want, you can create an additional partition for you firmware/diagnostic tools, just don't mess with the partition created by Windows -- you may reder it unbootable.<br />
<br />
===Building WinPE USB-HDD image with syslinux===<br />
if for some ethical or religious reasons you do not want to run any Windows code even in a virtual machine -- you can build a bootable WinPE USB-HDD image using '''syslinux'''.<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86.img count=250000<br />
* create a bootable partition<br />
parted winpe3_x86.img<br />
(parted) mklabel msdos<br />
(parted) unit s<br />
(parted) print free<br />
(parted) mkpart primary fat32<br />
(parted) set 1 boot on<br />
(parted) print<br />
in my case the output looks like this. Note the numbers corresponding to "Start" and "Size" of your partition, we will use them in the next command<br />
Model: (file)<br />
Disk /tmp/winpe3_x86.img: 250000s<br />
Sector size (logical/physical): 512B/512B<br />
Partition Table: msdos<br />
<br />
Number Start End Size Type File system Flags<br />
1 32s 249999s 249968s primary boot, lba<br />
* format and mount the partition<br />
losetup -o $((32*512)) --sizelimit $((249968*512)) /dev/loop0 winpe3_x86.img<br />
mkfs.vfat -F32 /dev/loop0<br />
mount /dev/loop0 /media/sdb1<br />
* copy the files<br />
mkdir -p /media/sdb1/boot<br />
mkdir -p /media/sdb1/sources<br />
cp /tmp/wAIKX86.msi/F1_BOOTMGR /media/sdb1/bootmgr<br />
cp /tmp/wAIKX86.msi/F_WINPE_X86_bcd /media/sdb1/boot/bcd<br />
cp /tmp/wAIKX86.msi/F_WINPE_X86_boot.sdi /media/sdb1/boot/boot.sdi<br />
cp /tmp/WinPE.cab/F1_WINPE.WIM /media/sdb1/sources/boot.wim<br />
cp /usr/lib/syslinux/chain.c32 /media/sdb1/chain.c32<br />
* create the config file /media/sdb1/syslinux.cfg<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
COM32 /chain.c32<br />
APPEND boot ntldr=/bootmgr<br />
* install syslinux<br />
syslinux /dev/loop0<br />
umount -d /media/sdb1<br />
* now you can copy this WinPE image on a flash media.<br />
dd if=winpe3_x86.img of=/dev/sdb<br />
<br />
and use it for test/diagnostic tasks such as firmware upgrades.</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Windows_PE&diff=48072Windows PE2010-04-04T00:34:09Z<p>Newhren: add USB-FDD boot option</p>
<hr />
<div>Some utilities/drivers provided by IBM/Lenovo come only in the form of Windows executables (for example, [[Intel_Active_Management_Technology_(AMT)|Intel AMT]] firmware updates). And for people who don't use Windows OS on their computers it becomes impossible to use/apply them. Luckily, Microsoft provides [http://www.microsoft.com/downloads/en/results.aspx?pocId=&freetext=Automated%20Installation%20Kit&DisplayLang=en Automated Installation Kit] (aka AIK) for free to everyone with very few resctictions on usage (basically, they only prohibit using it as a substitute of a "real" OS, and allow to use it for any diagnostic and reapair tasks). The latest version is [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34 The Windows® Automated Installation Kit (AIK) for Windows® 7]. Users of Windows OS can use this AIK to create bootable CD-ROMs and bootable USB-flash drives with Windows PE (or WinPE for short), which is essentially a stripped-down version of Windows. In this article we will explain how to create bootable CD-ROMs and USB-flash drives with WinPE using only FOSS software.<br />
<br />
==How to build a bootable WinPE *.iso image==<br />
* From the AIK installation file <tt>KB3AIK_EN.iso</tt>, provided in the form of a UDF disk image, use <tt>7z</tt> (from [http://sourceforge.net/projects/p7zip p7zip]) to extract the files <tt>wAIKX86.msi</tt> and <tt>WinPE.cab</tt><br />
* use <tt>7z</tt> or <tt>cabextract</tt> to unpack these files into <tt>/tmp/wAIKX86.msi/</tt> and <tt>/tmp/WinPE.cab/</tt> respectively<br />
* create a bootable WinPE *.iso image <tt>/tmp/winpe3_x86.iso</tt><br />
cd /tmp<br />
mkdir -p winpe3_x86/boot<br />
mkdir -p winpe3_x86/sources<br />
cp wAIKX86.msi/F_WINPE_X86_etfsboot.com winpe3_x86/etfsboot.com<br />
cp wAIKX86.msi/F1_BOOTMGR winpe3_x86/bootmgr<br />
cp wAIKX86.msi/F_WINPE_X86_bcd winpe3_x86/boot/bcd<br />
cp wAIKX86.msi/F_WINPE_X86_boot.sdi winpe3_x86/boot/boot.sdi<br />
cp WinPE.cab/F1_WINPE.WIM winpe3_x86/sources/boot.wim<br />
genisoimage -sysid "" -A "" -V "Microsoft Windows PE (x86)" -d -N -b etfsboot.com -no-emul-boot \<br />
-c boot.cat -hide etfsboot.com -hide boot.cat -o winpe3_x86.iso winpe3_x86<br />
the file you will get will be about 120M in size. Then you can burn this *.iso and boot it on any x86-machine which supports booting from CD-ROMs (which is pretty much any PC today)<br />
<br />
==How to build a bootable WinPE USB-flash image==<br />
a more convenient option would be to create a bootable USB-flash drive. Unfortunately, Windows loader does not support booting from USB-FDD, while for some BIOSes this is the only type of bootable USB devices. If this is your case, you will have to create a virtual CDROM with <tt>memdisk</tt> from '''syslinux''' and boot the *.iso image you've created in the previous step. The drawback is that you will have to sacrifice 120Mb or so of RAM for the virtual CDROM, but the advantage is that this USB-image will be bootable on any PC.<br />
<br />
===Building WinPE USB-HDD image in a virtual machine===<br />
Since we already have a bootable WinPE *.iso image, we can use it to build a bootable WinPE USB-HDD image in a virtual machine like '''qemu'''.<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86.img count=250000<br />
* boot <tt>winpe3_x86.iso</tt> (which you've created before) in a virtual machine<br />
qemu -cdrom winpe3_x86.iso -boot d -m 640 -hda winpe3_x86.img<br />
* now, in the shell provided by WinPE in the virtual machine<br />
diskpart.exe<br />
diskpart> list disk<br />
diskpart> select disk 0<br />
diskpart> clean<br />
diskpart> create partition primary<br />
diskpart> list partition<br />
diskpart> select partition 1<br />
diskpart> format fs=fat32 quick<br />
diskpart> active<br />
diskpart> assign<br />
diskpart> list volume<br />
diskpart> exit<br />
xcopy /s d:\* c:\<br />
wpeutil shutdown<br />
* when the virtual machine shuts down, you can copy WinPE image on a flash media. It will fit on any media > 125M in size.<br />
dd if=winpe3_x86.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades. If you want, you can create an additional partition for you firmware/diagnostic tools, just don't mess with the partition created by Windows -- you may reder it unbootable.<br />
<br />
===Building WinPE USB-HDD image with syslinux===<br />
if for some ethical or religious reasons you do not want to run any Windows code even in a virtual machine -- you can build a bootable WinPE USB-HDD image using '''syslinux'''.<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86.img count=250000<br />
* create a bootable partition<br />
parted winpe3_x86.img<br />
(parted) mklabel msdos<br />
(parted) unit s<br />
(parted) print free<br />
(parted) mkpart primary fat32<br />
(parted) set 1 boot on<br />
(parted) print<br />
in my case the output looks like this. Note the numbers corresponding to "Start" and "Size" of your partition, we will use them in the next command<br />
Model: (file)<br />
Disk /tmp/winpe3_x86.img: 250000s<br />
Sector size (logical/physical): 512B/512B<br />
Partition Table: msdos<br />
<br />
Number Start End Size Type File system Flags<br />
1 32s 249999s 249968s primary boot, lba<br />
* format and mount the partition<br />
losetup -o $((32*512)) --sizelimit $((249968*512)) /dev/loop0 winpe3_x86.img<br />
mkfs.vfat -F32 /dev/loop0<br />
mount /dev/loop0 /media/sdb1<br />
* copy the files<br />
mkdir -p /media/sdb1/boot<br />
mkdir -p /media/sdb1/sources<br />
cp /tmp/wAIKX86.msi/F1_BOOTMGR /media/sdb1/bootmgr<br />
cp /tmp/wAIKX86.msi/F_WINPE_X86_bcd /media/sdb1/boot/bcd<br />
cp /tmp/wAIKX86.msi/F_WINPE_X86_boot.sdi /media/sdb1/boot/boot.sdi<br />
cp /tmp/WinPE.cab/F1_WINPE.WIM /media/sdb1/sources/boot.wim<br />
cp /usr/lib/syslinux/chain.c32 /media/sdb1/chain.c32<br />
* create the config file /media/sdb1/syslinux.cfg<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
COM32 /chain.c32<br />
APPEND boot ntldr=/bootmgr<br />
* install syslinux<br />
syslinux /dev/loop0<br />
umount -d /media/sdb1<br />
* now you can copy this WinPE image on a flash media.<br />
dd if=winpe3_x86.img of=/dev/sdb<br />
<br />
and use it for test/diagnostic tasks such as firmware upgrades.<br />
<br />
===Building WinPE USB-FDD image with syslinux===<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86.img count=250000<br />
* format and mount the image<br />
losetup /dev/loop0 winpe3_x86.img<br />
mkfs.vfat -F32 /dev/loop0<br />
mount /dev/loop0 /media/sdb<br />
* copy the files<br />
cp /tmp/winpe3_x86.iso /media/sdb/<br />
cp /usr/lib/syslinux/memdisk /media/sdb/<br />
* create the config file /media/sdb/syslinux.cfg<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
KERNEL /memdisk<br />
INITRD /winpe3_x86.iso<br />
APPEND iso<br />
* install syslinux<br />
syslinux /dev/loop0<br />
umount -d /media/sdb<br />
* now you can copy this WinPE image on a flash media.<br />
dd if=winpe3_x86.img of=/dev/sdb<br />
<br />
and use it for test/diagnostic tasks such as firmware upgrades.</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Windows_PE&diff=48068Windows PE2010-04-03T21:07:37Z<p>Newhren: </p>
<hr />
<div>Some utilities/drivers provided by IBM/Lenovo come only in the form of Windows executables (for example, [[Intel_Active_Management_Technology_(AMT)|Intel AMT]] firmware updates). And for people who don't use Windows OS on their computers it becomes impossible to use/apply them. Luckily, Microsoft provides [http://www.microsoft.com/downloads/en/results.aspx?pocId=&freetext=Automated%20Installation%20Kit&DisplayLang=en Automated Installation Kit] (aka AIK) for free to everyone with very few resctictions on usage (basically, they only prohibit using it as a substitute of a "real" OS, and allow to use it for any diagnostic and reapair tasks). The latest version is [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34 The Windows® Automated Installation Kit (AIK) for Windows® 7]. Users of Windows OS can use this AIK to create bootable CD-ROMs and bootable USB-flash drives with Windows PE (or WinPE for short), which is essentially a stripped-down version of Windows. In this article we will explain how to create bootable CD-ROMs and USB-flash drives with WinPE using only FOSS software.<br />
<br />
==How to build a bootable WinPE *.iso image==<br />
* From the AIK installation file <tt>KB3AIK_EN.iso</tt>, provided in the form of a UDF disk image, use <tt>7z</tt> (from [http://sourceforge.net/projects/p7zip p7zip]) to extract the files <tt>wAIKX86.msi</tt> and <tt>WinPE.cab</tt><br />
* use <tt>7z</tt> or <tt>cabextract</tt> to unpack these files into <tt>/tmp/wAIKX86.msi/</tt> and <tt>/tmp/WinPE.cab/</tt> respectively<br />
* create a bootable WinPE *.iso image <tt>/tmp/winpe3_x86.iso</tt><br />
cd /tmp<br />
mkdir -p winpe3_x86/boot<br />
mkdir -p winpe3_x86/sources<br />
cp wAIKX86.msi/F_WINPE_X86_etfsboot.com winpe3_x86/etfsboot.com<br />
cp wAIKX86.msi/F1_BOOTMGR winpe3_x86/bootmgr<br />
cp wAIKX86.msi/F_WINPE_X86_bcd winpe3_x86/boot/bcd<br />
cp wAIKX86.msi/F_WINPE_X86_boot.sdi winpe3_x86/boot/boot.sdi<br />
cp WinPE.cab/F1_WINPE.WIM winpe3_x86/sources/boot.wim<br />
genisoimage -sysid "" -A "" -V "Microsoft Windows PE (x86)" -d -N -b etfsboot.com -no-emul-boot \<br />
-c boot.cat -hide etfsboot.com -hide boot.cat -o winpe3_x86.iso winpe3_x86<br />
the file you will get will be about 120M in size. Then you can burn this *.iso and boot it on any x86-machine which supports booting from CD-ROMs (which is pretty much any PC today)<br />
<br />
==How to build a bootable WinPE USB-flash image==<br />
a more convenient option would be to create a bootable USB-flash drive. Unfortunately, you will only be able to use it on PCs which support booting from USB-HDDs (this seems to be a limitation of the Windows bootloader). Some BIOSes only support booting from USB-FDDs.<br />
<br />
Since we already have a bootable WinPE *.iso image, we can use it to build a bootable WinPE USB-flash image in a virtual machine like '''qemu'''. Or, if for some ethical or religious reasons you do not want to run any Windows code even in a virtual machine -- you can build a bootable WinPE USB-flash image using '''syslinux'''.<br />
<br />
===Building WinPE USB-flash image in a virtual machine===<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86.img count=250000<br />
* boot <tt>winpe3_x86.iso</tt> (which you've created before) in a virtual machine<br />
qemu -cdrom winpe3_x86.iso -boot d -m 640 -hda winpe3_x86.img<br />
* now, in the shell provided by WinPE in the virtual machine<br />
diskpart.exe<br />
diskpart> list disk<br />
diskpart> select disk 0<br />
diskpart> clean<br />
diskpart> create partition primary<br />
diskpart> list partition<br />
diskpart> select partition 1<br />
diskpart> format fs=fat32 quick<br />
diskpart> active<br />
diskpart> assign<br />
diskpart> list volume<br />
diskpart> exit<br />
xcopy /s d:\* c:\<br />
wpeutil shutdown<br />
* when the virtual machine shuts down, you can copy WinPE image on a flash media. It will fit on any media > 125M in size.<br />
dd if=winpe3_x86.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades. If you want, you can create an additional partition for you firmware/diagnostic tools, just don't mess with the partition created by Windows -- you may reder it unbootable.<br />
<br />
===Building WinPE USB-flash image with syslinux===<br />
<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86.img count=250000<br />
* create a bootable partition<br />
/sbin/parted winpe3_x86.img<br />
(parted) mklabel msdos<br />
(parted) unit s<br />
(parted) print free<br />
<br />
Model: (file)<br />
Disk /tmp/winpe3_x86.img: 250000s<br />
Sector size (logical/physical): 512B/512B<br />
Partition Table: msdos<br />
<br />
Number Start End Size Type File system Flags<br />
32s 249999s 249968s Free Space<br />
<br />
create a partition which takes all the available free space, ignore the warnings about the partition being non-aligned<br />
<br />
(parted) mkpart primary fat32<br />
(parted) set 1 boot on<br />
(parted) print<br />
<br />
Model: (file)<br />
Disk /tmp/winpe3_x86.img: 250000s<br />
Sector size (logical/physical): 512B/512B<br />
Partition Table: msdos<br />
<br />
Number Start End Size Type File system Flags<br />
1 32s 249999s 249968s primary boot, lba<br />
* format and mount the partition<br />
losetup -o $((32*512)) --sizelimit $((249968*512)) /dev/loop0 winpe3_x86.img<br />
mkfs.vfat -F32 /dev/loop0<br />
mount /dev/loop0 /media/sdb1<br />
* copy the files<br />
mkdir -p /media/sdb1/boot<br />
mkdir -p /media/sdb1/sources<br />
cp /tmp/wAIKX86.msi/F1_BOOTMGR /media/sdb1/bootmgr<br />
cp /tmp/wAIKX86.msi/F_WINPE_X86_bcd /media/sdb1/boot/bcd<br />
cp /tmp/wAIKX86.msi/F_WINPE_X86_boot.sdi /media/sdb1/boot/boot.sdi<br />
cp /tmp/WinPE.cab/F1_WINPE.WIM /media/sdb1/sources/boot.wim<br />
cp /usr/lib/syslinux/chain.c32 /media/sdb1/chain.c32<br />
* create the config file /media/sdb1/syslinux.cfg<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
COM32 /chain.c32<br />
APPEND boot ntldr=/bootmgr<br />
* install syslinux<br />
syslinux /dev/loop0<br />
umount -d /media/sdb1<br />
<br />
* now you can copy this WinPE image on a flash media.<br />
dd if=winpe3_x86.img of=/dev/sdb<br />
<br />
and use it for test/diagnostic tasks such as firmware upgrades.</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Windows_PE&diff=48067Windows PE2010-04-03T19:43:04Z<p>Newhren: added syslinux boot option</p>
<hr />
<div>Some utilities/drivers provided by IBM/Lenovo come only in the form of Windows executables (for example, [[Intel_Active_Management_Technology_(AMT)|Intel AMT]] firmware updates). And for people who don't use Windows OS on their computers it becomes impossible to use/apply them. Luckily, Microsoft provides [http://www.microsoft.com/downloads/en/results.aspx?pocId=&freetext=Automated%20Installation%20Kit&DisplayLang=en Automated Installation Kit] (aka AIK) for free to everyone with very few resctictions on usage (basically, they only prohibit using it as a substitute of a "real" OS, and allow to use it for any diagnostic and reapair tasks). The latest version is [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34 The Windows® Automated Installation Kit (AIK) for Windows® 7]. Users of Windows OS can use this AIK to create bootable CD-ROMs and bootable USB-flash drives with Windows PE (or WinPE for short), which is essentially a stripped-down version of Windows. In this article we will explain how to create bootable CD-ROMs and USB-flash drives with WinPE using only FOSS software.<br />
<br />
==How to build a bootable WinPE *.iso image==<br />
* From the AIK installation file <tt>KB3AIK_EN.iso</tt>, provided in the form of a UDF disk image, use <tt>7z</tt> (from [http://sourceforge.net/projects/p7zip p7zip]) to extract the files <tt>wAIKX86.msi</tt> and <tt>WinPE.cab</tt><br />
* use <tt>7z</tt> or <tt>cabextract</tt> to unpack these files into <tt>/tmp/wAIKX86.msi/</tt> and <tt>/tmp/WinPE.cab/</tt> respectively<br />
* create a bootable WinPE *.iso image <tt>/tmp/winpe3_x86.iso</tt><br />
cd /tmp<br />
mkdir -p winpe3_x86/boot<br />
mkdir -p winpe3_x86/sources<br />
cp wAIKX86.msi/F_WINPE_X86_etfsboot.com winpe3_x86/etfsboot.com<br />
cp wAIKX86.msi/F1_BOOTMGR winpe3_x86/bootmgr<br />
cp wAIKX86.msi/F_WINPE_X86_bcd winpe3_x86/boot/bcd<br />
cp wAIKX86.msi/F_WINPE_X86_boot.sdi winpe3_x86/boot/boot.sdi<br />
cp WinPE.cab/F1_WINPE.WIM winpe3_x86/sources/boot.wim<br />
genisoimage -sysid "" -A "" -V "Microsoft Windows PE (x86)" -d -N -b etfsboot.com -no-emul-boot \<br />
-c boot.cat -hide etfsboot.com -hide boot.cat -o winpe3_x86.iso winpe3_x86<br />
the file you will get will be about 120M in size. Then you can burn this *.iso and boot it on any x86-machine which supports booting from CD-ROMs (which is pretty much any PC today)<br />
<br />
==How to build a bootable WinPE USB-flash image==<br />
a more convenient option would be to create a bootable USB-flash drive. Unfortunately, you will only be able to use it on PCs which support booting from USB-HDDs (this seems to be a limitation of the Windows bootloader). Some BIOSes only support booting from USB-FDDs.<br />
<br />
Since we already have a bootable WinPE *.iso image, we can use it to build a bootable WinPE USB-flash image in a virtual machine like '''qemu'''. Or, if for some ethical or religious reasons you do not want to run any Windows code even in a virtual machine -- you can build a bootable WinPE USB-flash image using '''syslinux'''.<br />
<br />
===Building WinPE USB-flash image in a virtual machine===<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86.img count=250000<br />
* boot <tt>winpe3_x86.iso</tt> (which you've created before) in a virtual machine<br />
qemu -cdrom winpe3_x86.iso -boot d -m 640 -hda winpe3_x86.img<br />
* now, in the shell provided by WinPE in the virtual machine<br />
diskpart.exe<br />
diskpart> list disk<br />
diskpart> select disk 0<br />
diskpart> clean<br />
diskpart> create partition primary<br />
diskpart> list partition<br />
diskpart> select partition 1<br />
diskpart> format fs=fat32 quick<br />
diskpart> active<br />
diskpart> assign<br />
diskpart> list volume<br />
diskpart> exit<br />
xcopy /s d:\* c:\<br />
wpeutil shutdown<br />
* when the virtual machine shuts down, you can copy WinPE image on a flash media. It will fit on any media > 125M in size.<br />
dd if=winpe3_x86.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades. If you want, you can create an additional partition for you firmware/diagnostic tools, just don't mess with the partition created by Windows -- you may reder it unbootable.<br />
<br />
===Building WinPE USB-flash image with syslinux===<br />
<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86.img count=250000<br />
* create a bootable partition<br />
/sbin/parted winpe3_x86.img<br />
(parted) mklabel msdos<br />
(parted) unit s<br />
(parted) print free<br />
<br />
Model: (file)<br />
Disk /tmp/winpe3_x86.img: 250000s<br />
Sector size (logical/physical): 512B/512B<br />
Partition Table: msdos<br />
<br />
Number Start End Size Type File system Flags<br />
32s 249999s 249968s Free Space<br />
<br />
create a partition which takes all the available free space, ignore the warnings about the partition being non-aligned<br />
<br />
(parted) mkpart primary fat32<br />
(parted) set 1 boot on<br />
(parted) print<br />
<br />
Model: (file)<br />
Disk /tmp/winpe3_x86.img: 250000s<br />
Sector size (logical/physical): 512B/512B<br />
Partition Table: msdos<br />
<br />
Number Start End Size Type File system Flags<br />
1 32s 249999s 249968s primary boot, lba<br />
* format and mount the partition<br />
# losetup -o $((32*512)) --sizelimit $((249968*512)) /dev/loop0 winpe3_x86.img<br />
# mkfs.vfat -F32 /dev/loop0<br />
# mount /dev/loop0 /media/sdb1<br />
* copy the files<br />
mkdir -p /media/sdb1/boot<br />
mkdir -p /media/sdb1/sources<br />
cp /tmp/wAIKX86.msi/F1_BOOTMGR /media/sdb1/bootmgr<br />
cp /tmp/wAIKX86.msi/F_WINPE_X86_bcd /media/sdb1/boot/bcd<br />
cp /tmp/wAIKX86.msi/F_WINPE_X86_boot.sdi /media/sdb1/boot/boot.sdi<br />
cp /tmp/WinPE.cab/F1_WINPE.WIM /media/sdb1/sources/boot.wim<br />
cp /usr/lib/syslinux/chain.c32 /media/sdb1/chain.c32<br />
* create the config file for /media/sdb1/syslinux.cfg<br />
DEFAULT WinPE<br />
LABEL WinPE<br />
COM32 /chain.c32<br />
APPEND boot ntldr=/BOOTMGR<br />
* install syslinux<br />
syslinux /dev/loop0<br />
umount -d /media/sdb1<br />
<br />
* now you can copy this WinPE image on a flash media.<br />
dd if=winpe3_x86.img of=/dev/sdb<br />
<br />
and use it for test/diagnostic tasks such as firmware upgrades.</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Windows_PE&diff=47929Windows PE2010-03-23T20:50:39Z<p>Newhren: add a link to p7zip</p>
<hr />
<div>Some utilities/drivers provided by IBM/Lenovo come only in the form of Windows executables (for example, [[Intel_Active_Management_Technology_(AMT)|Intel AMT]] firmware updates). And for people who don't use Windows OS on their computers it becomes impossible to use/apply them. Luckily, Microsoft provides [http://www.microsoft.com/downloads/en/results.aspx?pocId=&freetext=Automated%20Installation%20Kit&DisplayLang=en Automated Installation Kit] (aka AIK) for free to everyone with very few resctictions on usage (basically, they only prohibit using it as a substitute of a "real" OS, and allow to use it for any diagnostic and reapair tasks). Users of Windows OS can use this AIK to create bootable CD-ROMs and bootable USB-flash drives with Windows PE (or WinPE for short), which is essentially a stripped-down version of Windows. In this article we will explain how to create bootable CD-ROMs and USB-flash drives with WinPE using only FOSS software.<br />
<br />
==Tools we will need==<br />
<br />
* '''7z''' from [http://sourceforge.net/projects/p7zip p7zip]<br />
* '''genisoimage''' (or '''mkisofs''')<br />
* '''qemu''' (or '''qemu-kvm''') virtual machine<br />
<br />
and of course the ''Automated Installation Kit'' kit itself. The latest version is [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34 The Windows® Automated Installation Kit (AIK) for Windows® 7]<br />
<br />
==How to build a bootable WinPE *.iso image==<br />
<br />
* From the AIK installation file <tt>KB3AIK_EN.iso</tt>, provided in the form of a UDF disk image, use <tt>7z</tt> to extract the files <tt>wAIKX86.msi</tt> and <tt>WinPE.cab</tt><br />
* use <tt>7z</tt> again to unpack these files into <tt>/tmp/wAIKX86.msi/</tt> and <tt>/tmp/WinPE.cab/</tt> respectively<br />
* create a bootable WinPE *.iso image <tt>/tmp/winpe3_x86.iso</tt><br />
cd /tmp<br />
mkdir -p winpe3_x86/boot<br />
mkdir -p winpe3_x86/sources<br />
cp wAIKX86.msi/F1_BOOTMGR winpe3_x86/bootmgr<br />
cp wAIKX86.msi/F_WINPE_X86_bcd winpe3_x86/boot/bcd<br />
cp wAIKX86.msi/F_WINPE_X86_boot.sdi winpe3_x86/boot/boot.sdi<br />
cp WinPE.cab/F1_WINPE.WIM winpe3_x86/sources/boot.wim<br />
cp wAIKX86.msi/F_WINPE_X86_etfsboot.com winpe3_x86/etfsboot.com<br />
genisoimage -sysid "" -A "" -V "Microsoft Windows PE (x86)" -d -N -b etfsboot.com -no-emul-boot \<br />
-c boot.cat -hide etfsboot.com -hide boot.cat -o winpe3_x86.iso winpe3_x86<br />
the file you will get will be about 120M in size. Then you can burn this *.iso and boot it on any x86-machine which supports booting from CD-ROMs (which is pretty much any PC today)<br />
<br />
==How to build a bootable WinPE USB-flash image==<br />
a more convenient option would be to create a bootable USB-flash drive. Unfortunately, you will only be able to use it on PCs which support booting from USB-HDDs. Some BIOSes only support booting from USB-FDDs.<br />
<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86.img count=250000<br />
* boot <tt>winpe3_x86.iso</tt> (which you've created before) in a virtual machine<br />
qemu -cdrom winpe3_x86.iso -boot d -m 640 -hda winpe3_x86.img<br />
* now, in the shell provided by WinPE in the virtual machine<br />
diskpart.exe<br />
diskpart> list disk<br />
diskpart> select disk 0<br />
diskpart> clean<br />
diskpart> create partition primary<br />
diskpart> list partition<br />
diskpart> select partition 1<br />
diskpart> format fs=fat32 quick<br />
diskpart> active<br />
diskpart> assign<br />
diskpart> list volume<br />
diskpart> exit<br />
xcopy /s d:\* c:\<br />
wpeutil shutdown<br />
* then the virtual machine shuts down, you can copy WinPE image on a flash media. It will fit on any media > 125M in size.<br />
dd if=winpe3_x86.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades. If you want, you can create an additional partition for you firmware/diagnostic tools, just don't mess with the partition created by Windows -- you may reder it unbootable.</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Intel_GM45_TPM_device_iTPM_INTC0102&diff=47928Intel GM45 TPM device iTPM INTC01022010-03-23T20:26:32Z<p>Newhren: </p>
<hr />
<div>INTC0102 Intel TPM device found in GM45 chipset is supposed to comply with TCG TPM 1.2 specifications, and thus be taken care of by '''tpm_tis''' kernel module. Unfortunately, it does not. After loading this module<br />
<br />
modprobe tpm_tis interrupts=0 force=1<br />
<br />
and mounting securityfs<br />
<br />
mount -t securityfs none /sys/kernel/security<br />
<br />
it is possible to read the files<br />
<br />
/sys/kernel/security/tpm0/ascii_bios_measurements<br />
/sys/kernel/security/tpm0/binary_bios_measurements<br />
<br />
but no further communication with the TPM device seems to be possible.<br />
<br />
In recent [http://sourceforge.net/mailarchive/forum.php?thread_name=200811280943427180885&forum_name=tpmdd-devel discussion] on tpmdd-devel mailing list Seiji Munetoh [http://sourceforge.net/mailarchive/message.php?msg_name=f02dbbe70812012308n32dc9fd6hd1f04d3ef6e002b7%40mail.gmail.com suggested] a quick fix, and Colin Didier [https://www.grounation.org/index.php?post/2008/07/04/8-how-to-use-a-tpm-with-linux made] a [http://cybione.org/~cdidier/log/data/200812020841/itpm.diff patch] out of it.<br />
<br />
Note, however, that '''tpm_tis''' has to be compiled as a module and unloaded before suspend-to-disk, or it would freeze on wake-up. Suspend-to-ram seems to be OK, moreover if you unload '''tpm_tis''' before suspend-to-ram and modprobe in after resume -- then [http://sourceforge.net/projects/trousers trousers] daemon will refuse to restart. To get trousers run again, you have to either reboot or suspend-to-disk/wake-up.<br />
<br />
==Notes==<br />
The above-mentioned patch was merged into the kernel 2.6.33, and INTC0102 Intel TPM device works out of the box with the vanilla kernel. The only caveat is that the module '''tpm_tis''' has to be loaded with options <br />
<br />
modprobe tpm_tis interrupts=0 force=1 itpm=1<br />
<br />
To make it happen automatically, you can create a file <tt>/etc/modprobe.d/tpm.conf</tt> containing<br />
<br />
options tpm_tis interrupts=0 force=1 itpm=1<br />
<br />
==Models==<br />
*{{X200}}<br />
*{{X301}}</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Intel_GM45_TPM_device_iTPM_INTC0102&diff=47922Intel GM45 TPM device iTPM INTC01022010-03-23T03:34:23Z<p>Newhren: </p>
<hr />
<div>INTC0102 Intel TPM device found in GM45 chipset is supposed to comply with TCG TPM 1.2 specifications, and thus be taken care of by '''tpm_tis''' kernel module. Unfortunately, it does not. After loading this module<br />
<br />
modprobe tpm_tis interrupts=0 force=1<br />
<br />
and mounting securityfs<br />
<br />
mount -t securityfs none /sys/kernel/security<br />
<br />
it is possible to read the files<br />
<br />
/sys/kernel/security/tpm0/ascii_bios_measurements<br />
/sys/kernel/security/tpm0/binary_bios_measurements<br />
<br />
but no further communication with the TPM device seems to be possible.<br />
<br />
In recent [http://sourceforge.net/mailarchive/forum.php?thread_name=200811280943427180885&forum_name=tpmdd-devel discussion] on tpmdd-devel mailing list Seiji Munetoh [http://sourceforge.net/mailarchive/message.php?msg_name=f02dbbe70812012308n32dc9fd6hd1f04d3ef6e002b7%40mail.gmail.com suggested] a quick fix, and Colin Didier [https://www.grounation.org/index.php?post/2008/07/04/8-how-to-use-a-tpm-with-linux made] a [http://cybione.org/~cdidier/log/data/200812020841/itpm.diff patch] out of it.<br />
<br />
Note, however, that '''tpm_tis''' has to be compiled as a module and unloaded before suspend-to-disk, or it would freeze on wake-up. Suspend-to-ram seems to be OK, moreover if you unload '''tpm_tis''' before suspend-to-ram and modprobe in after resume -- then [http://sourceforge.net/projects/trousers trousers] daemon will refuse to restart. To get trousers run again, you have to either reboot or suspend-to-disk/wake-up.<br />
<br />
==Notes==<br />
As of kernel 2.6.33.1, INTC0102 Intel TPM device is supported by the vanilla kernel. The only caveat is that the module '''tpm_tis''' has to be loaded with options <br />
<br />
modprobe tpm_tis interrupts=0 force=1 itpm=1<br />
<br />
To make it happen automatically, you can create a file <tt>/etc/modprobe.d/tpm.conf</tt> containing<br />
<br />
options tpm_tis interrupts=0 force=1 itpm=1<br />
<br />
==Models==<br />
*{{X200}}<br />
*{{X301}}</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Windows_PE&diff=47870Windows PE2010-03-22T04:04:58Z<p>Newhren: </p>
<hr />
<div>Some utilities/drivers provided by IBM/Lenovo come only in the form of Windows executables (for example, [[Intel_Active_Management_Technology_(AMT)|Intel AMT]] firmware updates). And for people who don't use Windows OS on their computers it becomes impossible to use/apply them. Luckily, Microsoft provides [http://www.microsoft.com/downloads/en/results.aspx?pocId=&freetext=Automated%20Installation%20Kit&DisplayLang=en Automated Installation Kit] (aka AIK) for free to everyone with very few resctictions on usage (basically, they only prohibit using it as a substitute of a "real" OS, and allow to use it for any diagnostic and reapair tasks). Users of Windows OS can use this AIK to create bootable CD-ROMs and bootable USB-flash drives with Windows PE (or WinPE for short), which is essentially a stripped-down version of Windows. In this article we will explain how to create bootable CD-ROMs and USB-flash drives with WinPE using only FOSS software.<br />
<br />
==Tools we will need==<br />
<br />
* '''cabextract'''<br />
* '''genisoimage''' (or '''mkisofs''')<br />
* '''qemu''' (or '''qemu-kvm''') virtual machine<br />
<br />
and of course the ''Automated Installation Kit'' kit itself. The latest version is [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34 The Windows® Automated Installation Kit (AIK) for Windows® 7]<br />
<br />
==How to build a bootable WinPE *.iso image==<br />
<br />
* From the AIK installation file <tt>KB3AIK_EN.iso</tt>, provided in the form of a UDF disk image, extract the files <tt>wAIKX86.msi</tt> and <tt>WinPE.cab</tt><br />
* using <tt>cabextract</tt>, unpack these files into <tt>/tmp/wAIKX86.msi/</tt> and <tt>/tmp/WinPE.cab/</tt> respectively<br />
* create a bootable WinPE *.iso image <tt>/tmp/winpe3_x86.iso</tt><br />
cd /tmp<br />
mkdir -p winpe3_x86/boot<br />
mkdir -p winpe3_x86/sources<br />
cp wAIKX86.msi/F1_BOOTMGR winpe3_x86/bootmgr<br />
cp wAIKX86.msi/F_WINPE_X86_bcd winpe3_x86/boot/bcd<br />
cp wAIKX86.msi/F_WINPE_X86_boot.sdi winpe3_x86/boot/boot.sdi<br />
cp WinPE.cab/F1_WINPE.WIM winpe3_x86/sources/boot.wim<br />
cp wAIKX86.msi/F_WINPE_X86_etfsboot.com winpe3_x86/etfsboot.com<br />
genisoimage -sysid "" -A "" -V "Microsoft Windows PE (x86)" -d -N -b etfsboot.com -no-emul-boot \<br />
-c boot.cat -hide etfsboot.com -hide boot.cat -o winpe3_x86.iso winpe3_x86<br />
the file you will get will be about 120M in size. Then you can burn this *.iso and boot it on any x86-machine which supports booting from CD-ROMs (which is pretty much any PC today)<br />
<br />
==How to build a bootable WinPE USB-flash image==<br />
a more convenient option would be to create a bootable USB-flash drive. Unfortunately, you will only be able to use it on PCs which support booting from USB-HDDs. Some BIOSes only support booting from USB-FDDs.<br />
<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86.img count=250000<br />
* boot <tt>winpe3_x86.iso</tt> (which you've created before) in a virtual machine<br />
qemu -cdrom winpe3_x86.iso -boot d -m 640 -hda winpe3_x86.img<br />
* now, in the shell provided by WinPE in the virtual machine<br />
diskpart.exe<br />
diskpart> list disk<br />
diskpart> select disk 0<br />
diskpart> clean<br />
diskpart> create partition primary<br />
diskpart> list partition<br />
diskpart> select partition 1<br />
diskpart> format fs=fat32 quick<br />
diskpart> active<br />
diskpart> assign<br />
diskpart> list volume<br />
diskpart> exit<br />
xcopy /s d:\* c:\<br />
wpeutil shutdown<br />
* then the virtual machine shuts down, you can copy WinPE image on a flash media. It will fit on any media > 125M in size.<br />
dd if=winpe3_x86.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades. If you want, you can create an additional partition for you firmware/diagnostic tools, just don't mess with the partition created by Windows -- you may reder it unbootable.</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Intel_Active_Management_Technology_(AMT)&diff=47869Intel Active Management Technology (AMT)2010-03-22T04:02:53Z<p>Newhren: </p>
<hr />
<div>== Intel Active Management Technology (AMT) ==<br />
Some Lenovo laptop include some of Intel's Management features.<br />
{| border="1" cellspacing="0" cellpadding="2"<br />
|| Version || Models <br />
|-<br />
|| AMT 2.5 || {{T61}}, {{T61p}}<br>{{X61}}, {{X61s}}, {{X61 Tablet}}<br />
|-<br />
|| iAMT ? || {{T400}}, {{T400s}}, {{T410}}, {{T410i}}, {{T410s}}, {{T500}}, {{T510}}, {{T510i}}<br>{{W500}}, {{W510}}, {{W700}}, {{W700ds}}, {{W701}}, {{W701ds}}<br>{{X200}}, {{X200s}}, {{X200 Tablet}}, {{X201}}, {{X201i}}, {{X201s}}, {{X201 Tablet}}, {{X300}}, {{X301}}<br />
|}<br />
<br />
== Features ==<br />
* Management over the Network (LAN and WLAN, using AMT 2.5)<br />
* Remote Asset (Hardware and Software) Inventory<br />
* Remote Diagnostic and repair (even if laptop is off or down)<br />
* Agent Presence Checking (isolate corrupted laptops)<br />
* Encrypted software update (w/ remote power-on).<br />
* System isolation and recovery (Use hardware to filter inbound and outbound traffic, except management traffic)<br />
* Dedicated Flash memory (Firmware + Inventory + ISV Data)<br />
<br />
== Linux support ==<br />
The Linux '''heci''' driver to support iAMT was part of the staging tree as of the 2.6.30 kernel, but [http://driverdev.linuxdriverproject.org/pipermail/devel/2009-September/002458.html removed] in 2.6.32 at the request of Intel as they have indicated having no further interest in it and have abandoned it.<br />
<br />
* [http://www.openamt.org/ Intel OpenAMT project website] (abandoned)<br />
<br />
== Hints how to setup it via Intel ME BIOS Extension (MEBx) based on the T61p (Small business Mode) ==<br />
=== Pre-configuration ===<br />
* Use ThinkVantage System Update so you have the latest BIOS<br />
* Reboot the system<br />
<br />
=== Enabling AMT in BIOS ===<br />
* Hit the ThinkVantage button during the POST screen, then after the menu appears hit 'F1'<br />
** Select 'Config' on the main screen<br />
*** Select 'Intel(R) AMT'<br />
**** Set 'Intel(R) AMT Control' to 'Enabled'<br />
**** Hit 'F10' to Save and Exit<br />
<br />
=== Configuring Intel ME BIOS Extension for the first time ===<br />
* After the POST screen you will see the Intel ME BIOS Extension screen. Hit Ctrl+P to enter the setup.<br />
* The default password is 'admin' (without quotes)<br />
* If you try to change the Intel ME password and get "Error - Intel(R) ME password change rejected" message, then you are using a weak password. This are guidelines for the Intel ME strong password:<br />
** between 8- and 32-characters long<br />
** Contain both upper and lower case Latin characters<br />
** Have at least one numeric character<br />
** Have at least one ASCII non-alphanumeric character (!, @, #, $, %, ^, &, *)<br />
<br />
=== Enabling AMT in Intel Management Engine BIOS Extension ===<br />
* In the main MEBx menu Select Intel(R) ME Configuration<br />
** Select 'Intel(R) ME State Control'<br />
*** Set it ENABLED<br />
*** Select Return to Previous Menu<br />
** Select 'Intel(R) ME Firmware Local Update Qualifier'<br />
*** Set it to ALWAYS OPEN<br />
*** Select Return to Previous Menu<br />
** Select 'Intel(R) ME Features Control'<br />
*** Select 'Manageability Feature Selection'<br />
**** Choose 'Intel(R) AMT'<br />
*** Select Return to Previous menu<br />
** Select 'Intel(R) ME Power Control'<br />
*** Select 'Intel (R) ME ON in Host Sleep States'<br />
**** Set the 'widest' range of Sleep States<br />
**** Hit 'ESC' to Exit. The system will reboot now.<br />
<br />
=== Configuring AMT via Intel ME ===<br />
* Hit Ctrl+P when the Intel ME BIOS messages apear<br />
* Select 'Intel(R) AMT Configuration'<br />
** Select 'Host Name' and enter the same name as for the OS Host name<br />
** Select 'TCP/IP'<br />
*** Hit 'N' to enable the Network Interface<br />
*** Hit 'N' to enable DHCP<br />
*** provide your domain name as set (or to be set) in the OS<br />
** Select 'Provision Model'<br />
*** Hit 'N' to not change to AMT 1.0 Mode<br />
*** Hit 'Y; to change to Small Business<br />
** Select 'SOL/IDE-R'<br />
*** Hit 'Y' to confirm the warning<br />
*** Set Username & Password to ENABLED (if it's set to ENABLED don't hit just 'ENTER' because you disable it)<br />
*** Set Serial Over LAN to ENABLED<br />
*** Set IDE Redirection to ENABLED<br />
** Select 'Secure Firmware Update'<br />
*** Set it to ENABLED<br />
** Hit 'ESC' to Exit. The system will reboot again.<br />
<br />
=== Configuring Windows ===<br />
* Use ThinkVantage System Update to get the AMT Software<br />
* After update reboot<br />
* After Log-in you should see the message 'Intel(R) Active Management Technology (Intel(R) AMT) status on this computer is enabled.'<br />
<br />
=== Firmware update ===<br />
Lenovo provides Intel AMT firmware updates only in the form of Windows executables. Thus, if you don't have Windows installed on your laptop, for the purpose of updating Intel AMT firmware you will have to use [[Windows_PE|Windows PE]].<br />
== Links ==<br />
* See Also [[Centrino Pro]]<br />
* Intel - AMT [http://www.intel.com/technology/manage/iamt/index.htm]<br />
* Intel® Active Management Technology (Intel AMT) Software Development Kit (SDK) Start Here Guide [http://softwarecommunity.intel.com/articles/eng/1027.htm]<br />
* Tips & Tricks for Setting up & Accessing an Intel AMT Client [http://softwareblogs.intel.com/2008/01/28/tips-tricks-for-setting-up-accessing-an-intel-amt-client/]<br />
* Intel-AMT Set And Review Thailand Version [[http://www.thaithinkpad.com/forum/index.php/topic,2226.0.html]]</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Windows_PE&diff=47832Windows PE2010-03-20T06:40:37Z<p>Newhren: </p>
<hr />
<div>Some utilities/drivers provided by IBM/Lenovo come only in the form of Windows executables. And for people who don't use Windows OS on their computers it becomes impossible to use/apply them. Luckily, Microsoft provides [http://www.microsoft.com/downloads/en/results.aspx?pocId=&freetext=Automated%20Installation%20Kit&DisplayLang=en Automated Installation Kit] (aka AIK) for free to everyone with very few resctictions on usage (basically, they only prohibit using it as a substitute of a "real" OS, and allow to use it for any diagnostic and reapair tasks). Users of Windows OS can use this AIK to create bootable CD-ROMs and bootable USB-flash drives with Windows PE (or WinPE for short), which is essentially a stripped-down version of Windows. In this article we will explain how to create bootable CD-ROMs and USB-flash drives with WinPE using only FOSS software.<br />
<br />
==Tools we will need==<br />
<br />
* '''cabextract'''<br />
* '''genisoimage''' (or '''mkisofs''')<br />
* '''qemu''' (or '''qemu-kvm''') virtual machine<br />
<br />
and of course the ''Automated Installation Kit'' kit itself. The latest version is [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34 The Windows® Automated Installation Kit (AIK) for Windows® 7]<br />
<br />
==How to build a bootable WinPE *.iso image==<br />
<br />
* From the AIK installation file <tt>KB3AIK_EN.iso</tt>, provided in the form of a UDF disk image, extract the files <tt>wAIKX86.msi</tt> and <tt>WinPE.cab</tt><br />
* using <tt>cabextract</tt>, unpack these files into <tt>/tmp/wAIKX86.msi/</tt> and <tt>/tmp/WinPE.cab/</tt> respectively<br />
* create a bootable WinPE *.iso image <tt>/tmp/winpe3_x86.iso</tt><br />
cd /tmp<br />
mkdir -p winpe3_x86/boot<br />
mkdir -p winpe3_x86/sources<br />
cp wAIKX86.msi/F1_BOOTMGR winpe3_x86/bootmgr<br />
cp wAIKX86.msi/F_WINPE_X86_bcd winpe3_x86/boot/bcd<br />
cp wAIKX86.msi/F_WINPE_X86_boot.sdi winpe3_x86/boot/boot.sdi<br />
cp WinPE.cab/F1_WINPE.WIM winpe3_x86/sources/boot.wim<br />
cp wAIKX86.msi/F_WINPE_X86_etfsboot.com winpe3_x86/etfsboot.com<br />
genisoimage -sysid "" -A "" -V "Microsoft Windows PE (x86)" -d -N -b etfsboot.com -no-emul-boot \<br />
-c boot.cat -hide etfsboot.com -hide boot.cat -o winpe3_x86.iso winpe3_x86<br />
the file you will get will be about 120M in size. Then you can burn this *.iso and boot it on any x86-machine which supports booting from CD-ROMs (which is pretty much any PC today)<br />
<br />
==How to build a bootable WinPE USB-flash image==<br />
a more convenient option would be to create a bootable USB-flash drive. Unfortunately, you will only be able to use it on PCs which support booting from USB-HDDs. Some BIOSes only support booting from USB-FDDs.<br />
<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86.img count=250000<br />
* boot <tt>winpe3_x86.iso</tt> (which you've created before) in a virtual machine<br />
qemu -cdrom winpe3_x86.iso -boot d -m 640 -hda winpe3_x86.img<br />
* now, in the shell provided by WinPE in the virtual machine<br />
diskpart.exe<br />
diskpart> list disk<br />
diskpart> select disk 0<br />
diskpart> clean<br />
diskpart> create partition primary<br />
diskpart> list partition<br />
diskpart> select partition 1<br />
diskpart> format fs=fat32 quick<br />
diskpart> active<br />
diskpart> assign<br />
diskpart> list volume<br />
diskpart> exit<br />
xcopy /s d:\* c:\<br />
wpeutil shutdown<br />
* then the virtual machine shuts down, you can copy WinPE image on a flash media. It will fit on any media > 125M in size.<br />
dd if=winpe3_x86.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades. If you want, you can create an additional partition for you firmware/diagnostic tools, just don't mess with the partition created by Windows -- you may reder it unbootable.</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Windows_PE&diff=47831Windows PE2010-03-20T06:36:31Z<p>Newhren: </p>
<hr />
<div>Some utilities/drivers provided by IBM/Lenovo come only in the form of Windows executables. And for people who don't use Windows OS on their computers it becomes impossible to use/apply them. Luckily, Microsoft provides [http://www.microsoft.com/downloads/en/results.aspx?pocId=&freetext=Automated%20Installation%20Kit&DisplayLang=en Automated Installation Kit] (aka AIK) for free to everyone with very few resctictions on usage (basically, they only prohibit using it as a substitute of a "real" OS, and allow to use it for any diagnostic and reapair tasks). Users of Windows OS can use this AIK to create bootable CD-ROMs and bootable USB-flash drives with Windows PE (or WinPE for short), which is essentially a stripped-down version of Windows. In this article we will explain how to create bootable CD-ROMs and USB-flash drives with WinPE using only FOSS software.<br />
<br />
==Tools we will need==<br />
<br />
* '''cabextract'''<br />
* '''genisoimage''' (or '''mkisofs''')<br />
* '''qemu''' (or '''qemu-kvm''') virtual machine<br />
<br />
and of course the ''Automated Installation Kit'' kit itself. The latest version is [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34 The Windows® Automated Installation Kit (AIK) for Windows® 7]<br />
<br />
==How to build a bootable WinPE *.iso image==<br />
<br />
* From the AIK installation file <tt>KB3AIK_EN.iso</tt>, provided in the form of a UDF disk image, extract the files <tt>wAIKX86.msi</tt> and <tt>WinPE.cab</tt><br />
* using <tt>cabextract</tt>, unpack these files into <tt>/tmp/wAIKX86.msi/</tt> and <tt>/tmp/WinPE.cab/</tt> respectively<br />
* create a bootable WinPE *.iso image <tt>/tmp/winpe3_x86.iso</tt><br />
cd /tmp<br />
mkdir -p winpe3_x86/boot<br />
mkdir -p winpe3_x86/sources<br />
cp wAIKX86.msi/F_WINPE_X86_bcd winpe3_x86/boot/bcd<br />
cp wAIKX86.msi/F_WINPE_X86_boot.sdi winpe3_x86/boot/boot.sdi<br />
cp WinPE.cab/F1_WINPE.WIM winpe3_x86/sources/boot.wim<br />
cp wAIKX86.msi/F_WINPE_X86_etfsboot.com winpe3_x86/etfsboot.com<br />
genisoimage -sysid "" -A "" -V "Microsoft Windows PE (x86)" -d -N -b etfsboot.com -no-emul-boot \<br />
-c boot.cat -hide etfsboot.com -hide boot.cat -o winpe3_x86.iso winpe3_x86<br />
the file you will get will be about 120M in size. Then you can burn this *.iso and boot it on any x86-machine which supports booting from CD-ROMs (which is pretty much any PC today)<br />
<br />
==How to build a bootable WinPE USB-flash image==<br />
a more convenient option would be to create a bootable USB-flash drive. Unfortunately, you will only be able to use it on PCs which support booting from USB-HDDs. Some BIOSes only support booting from USB-FDDs.<br />
<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86.img count=250000<br />
* boot <tt>winpe3_x86.iso</tt> (which you've created before) in a virtual machine<br />
qemu -cdrom winpe3_x86.iso -boot d -m 640 -hda winpe3_x86.img<br />
* now, in the shell provided by WinPE in the virtual machine<br />
diskpart.exe<br />
diskpart> list disk<br />
diskpart> select disk 0<br />
diskpart> clean<br />
diskpart> create partition primary<br />
diskpart> list partition<br />
diskpart> select partition 1<br />
diskpart> format fs=fat32 quick<br />
diskpart> active<br />
diskpart> assign<br />
diskpart> list volume<br />
diskpart> exit<br />
xcopy /s d:\* c:\<br />
wpeutil shutdown<br />
* then the virtual machine shuts down, you can copy WinPE image on a flash media. It will fit on any media > 125M in size.<br />
dd if=winpe3_x86.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades. If you want, you can create an additional partition for you firmware/diagnostic tools, just don't mess with the partition created by Windows -- you may reder it unbootable.</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Windows_PE&diff=47830Windows PE2010-03-20T06:29:31Z<p>Newhren: a few script optimizations</p>
<hr />
<div>Some utilities/drivers provided by IBM/Lenovo come only in the form of Windows executables. And for people who don't use Windows OS on their computers it becomes impossible to use/apply them. Luckily, Microsoft provides [http://www.microsoft.com/downloads/en/results.aspx?pocId=&freetext=Automated%20Installation%20Kit&DisplayLang=en Automated Installation Kit] (aka AIK) for free to everyone with very few resctictions on usage (basically, they only prohibit using it as a substitute of a "real" OS, and allow to use it for any diagnostic and reapair tasks). Users of Windows OS can use this AIK to create bootable CD-ROMs and bootable USB-flash drives with Windows PE, which is essentially a stripped-down version of Windows. In this article we will explain how to create bootable CD-ROMs and USB-flash drives with Windows PE using only FOSS software.<br />
<br />
==Tools we will need==<br />
<br />
* '''cabextract'''<br />
* '''genisoimage''' (or '''mkisofs''')<br />
* '''qemu''' (or '''qemu-kvm''') virtual machine<br />
<br />
and of course the ''Automated Installation Kit'' kit itself. The latest version is [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34 The Windows® Automated Installation Kit (AIK) for Windows® 7]<br />
<br />
==How to build a bootable WinPE *.iso image==<br />
<br />
* From the AIK installation file <tt>KB3AIK_EN.iso</tt>, provided in the form of a UDF disk image, extract the files <tt>wAIKX86.msi</tt> and <tt>WinPE.cab</tt><br />
* using <tt>cabextract</tt>, unpack these files into <tt>/tmp/wAIKX86.msi/</tt> and <tt>/tmp/WinPE.cab/</tt> respectively<br />
* create a bootable Windows PE *.iso image <tt>/tmp/winpe3_x86.iso</tt><br />
cd /tmp<br />
mkdir -p winpe3_x86/boot<br />
mkdir -p winpe3_x86/sources<br />
cp wAIKX86.msi/F_WINPE_X86_bcd winpe3_x86/boot/bcd<br />
cp wAIKX86.msi/F_WINPE_X86_boot.sdi winpe3_x86/boot/boot.sdi<br />
cp WinPE.cab/F1_WINPE.WIM winpe3_x86/sources/boot.wim<br />
cp wAIKX86.msi/F_WINPE_X86_etfsboot.com winpe3_x86/etfsboot.com<br />
genisoimage -sysid "" -A "" -V "Microsoft Windows PE (x86)" -d -N -b etfsboot.com -no-emul-boot \<br />
-c boot.cat -hide etfsboot.com -hide boot.cat -o winpe3_x86.iso winpe3_x86<br />
the file you will get will be about 120M in size. Then you can burn this *.iso and boot it on any x86-machine which supports booting from CD-ROMs (which is pretty much any PC today)<br />
<br />
==How to build a bootable WinPE USB-flash image==<br />
a more convenient option would be to create a bootable USB-flash drive. Unfortunately, you will only be able to use it on PCs which support booting from USB-HDDs. Some BIOSes only support booting from USB-FDDs.<br />
<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86.img count=250000<br />
* boot <tt>winpe3_x86.iso</tt> (which you've created before) in a virtual machine<br />
qemu -cdrom winpe3_x86.iso -boot d -m 640 -hda winpe3_x86.img<br />
* now, in the shell provided by Windows PE in the virtual machine<br />
diskpart.exe<br />
diskpart> list disk<br />
diskpart> select disk 0<br />
diskpart> clean<br />
diskpart> create partition primary<br />
diskpart> list partition<br />
diskpart> select partition 1<br />
diskpart> format fs=fat32 quick<br />
diskpart> active<br />
diskpart> assign<br />
diskpart> list volume<br />
diskpart> exit<br />
xcopy /s d:\* c:\<br />
wpeutil shutdown<br />
* then the virtual machine shuts down, you can copy Windows PE image on a flash media. It will fit on any media > 125M in size.<br />
dd if=winpe3_x86.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades. If you want, you can create an additional partition for you firmware/diagnostic tools, just don't mess with the partition created by Windows -- you may reder it unbootable.</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Windows_PE&diff=47829Windows PE2010-03-20T06:17:33Z<p>Newhren: </p>
<hr />
<div>Some utilities/drivers provided by IBM/Lenovo come only in the form of Windows executables. And for people who don't use Windows OS on their computers it becomes impossible to use/apply them. Luckily, Microsoft provides [http://www.microsoft.com/downloads/en/results.aspx?pocId=&freetext=Automated%20Installation%20Kit&DisplayLang=en Automated Installation Kit] (aka AIK) for free to everyone with very few resctictions on usage (basically, they only prohibit using it as a substitute of a "real" OS, and allow to use it for any diagnostic and reapair tasks). Users of Windows OS can use this AIK to create bootable CD-ROMs and bootable USB-flash drives with Windows PE, which is essentially a stripped-down version of Windows. In this article we will explain how to create bootable CD-ROMs and USB-flash drives with Windows PE using only FOSS software.<br />
<br />
==Tools we will need==<br />
<br />
* '''cabextract'''<br />
* '''genisoimage''' (or '''mkisofs''')<br />
* '''qemu''' (or '''qemu-kvm''') virtual machine<br />
<br />
and of course the ''Automated Installation Kit'' kit itself. The latest version is [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34 The Windows® Automated Installation Kit (AIK) for Windows® 7]<br />
<br />
==How to build a bootable WinPE *.iso image==<br />
<br />
* From the AIK installation file <tt>KB3AIK_EN.iso</tt>, provided in the form of a UDF disk image, extract the files <tt>wAIKX86.msi</tt> and <tt>WinPE.cab</tt><br />
* using <tt>cabextract</tt>, unpack these files into <tt>/tmp/wAIKX86.msi/</tt> and <tt>/tmp/WinPE.cab/</tt> respectively<br />
* create a bootable Windows PE *.iso image <tt>/tmp/winpe3_x86.iso</tt><br />
cd /tmp<br />
mkdir -p winpe3_x86/iso/boot<br />
mkdir -p winpe3_x86/iso/sources<br />
cp wAIKX86.msi/F_WINPE_X86_bcd winpe3_x86/iso/boot/bcd<br />
cp wAIKX86.msi/F_WINPE_X86_boot.sdi winpe3_x86/iso/boot/boot.sdi<br />
cp WinPE.cab/F1_WINPE.WIM winpe3_x86/iso/sources/boot.wim<br />
cp wAIKX86.msi/F_WINPE_X86_etfsboot.com winpe3_x86/iso/etfsboot.com<br />
genisoimage -sysid "" -A "" -V "Microsoft Windows PE (x86)" -d -N -b etfsboot.com -no-emul-boot \<br />
-c boot.cat -hide etfsboot.com -hide boot.cat -o winpe3_x86.iso winpe3_x86/iso<br />
the file you will get will be about 120M in size. Then you can burn this *.iso and boot it on any x86-machine which supports booting from CD-ROMs (which is pretty much any PC today)<br />
<br />
==How to build a bootable WinPE USB-flash image==<br />
a more convenient option would be to create a bootable USB-flash drive. Unfortunately, you will only be able to use it on PCs which support booting from USB-HDDs. Some BIOSes only support booting from USB-FDDs.<br />
<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86.img count=250000<br />
* boot <tt>winpe3_x86.iso</tt> (which you've created before) in a virtual machine<br />
qemu -cdrom winpe3_x86.iso -boot d -m 640 -hda winpe3_x86.img<br />
* now, in the shell provided by Windows PE in the virtual machine<br />
diskpart.exe<br />
diskpart> list disk<br />
diskpart> select disk 0<br />
diskpart> clean<br />
diskpart> create partition primary<br />
diskpart> list partition<br />
diskpart> select partition 1<br />
diskpart> format fs=fat32 quick<br />
diskpart> active<br />
diskpart> assign<br />
diskpart> list volume<br />
diskpart> exit<br />
xcopy /s d:\* c:\<br />
wpeutil shutdown<br />
* then the virtual machine shuts down, you can copy Windows PE image on a flash media. It will fit on any media > 125M in size.<br />
dd if=winpe3_x86.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades. If you want, you can create an additional partition for you firmware/diagnostic tools, just don't mess with the partition created by Windows -- you may reder it unbootable.</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Windows_PE&diff=47828Windows PE2010-03-20T05:21:34Z<p>Newhren: â†Created page with 'Some utilities/drivers provided by IBM/Lenovo come only in the form of Windows executables. And for people who don't use Windows OS on their computers it becomes impossibl...'</p>
<hr />
<div>Some utilities/drivers provided by IBM/Lenovo come only in the form of Windows executables. And for people who don't use Windows OS on their computers it becomes impossible to use/apply them. Luckily, Microsoft provides [http://www.microsoft.com/downloads/en/results.aspx?pocId=&freetext=Automated%20Installation%20Kit&DisplayLang=en Automated Installation Kit] (aka AIK) for free to everyone with very few resctictions on usage (basically, they only prohibit using it as a substitute of a "real" OS, and allow to use it for any diagnostic and reapair tasks). Users of Windows OS can use this AIK to create bootable CD-ROMs and bootable USB-flash drives with Windows PE, which is essentially a stripped-down version of Windows. In this article we will explain how to create bootable CD-ROMs and USB-flash drives with Windows PE using only FOSS software.<br />
<br />
==Tools we will need==<br />
<br />
* '''cabextract'''<br />
* '''genisoimage''' (or '''mkisofs''')<br />
* '''qemu''' (or '''qemu-kvm''') virtual machine<br />
<br />
and of course the ''Automated Installation Kit'' kit itself. The latest version is [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=696dd665-9f76-4177-a811-39c26d3b3b34 The Windows® Automated Installation Kit (AIK) for Windows® 7]<br />
<br />
==How to build a bootable WinPE *.iso image==<br />
<br />
* From the AIK installation file <tt>KB3AIK_EN.iso</tt>, provided in the form of a UDF disk image, extract the files <tt>wAIKX86.msi</tt> and <tt>WinPE.cab</tt><br />
* using <tt>cabextract</tt>, unpack these files into <tt>/tmp/wAIKX86.msi/</tt> and <tt>/tmp/WinPE.cab/</tt> respectively<br />
* create bootable Windows PE *.iso image <tt>/tmp/winpe3_x86.iso</tt><br />
cd /tmp<br />
mkdir -p winpe3_x86/iso/boot<br />
mkdir -p winpe3_x86/iso/sources<br />
cp wAIKX86.msi/F_WINPE_X86_bcd winpe3_x86/iso/boot/bcd<br />
cp wAIKX86.msi/F_WINPE_X86_boot.sdi winpe3_x86/iso/boot/boot.sdi<br />
cp WinPE.cab/F1_WINPE.WIM winpe3_x86/iso/sources/boot.wim<br />
cp wAIKX86.msi/F_WINPE_X86_etfsboot.com winpe3_x86/iso/etfsboot.com<br />
genisoimage -sysid "" -A "" -V "Microsoft Windows PE (x86)" -d -N -b etfsboot.com -no-emul-boot \<br />
-c boot.cat -hide etfsboot.com -hide boot.cat -o winpe3_x86.iso winpe3_x86/iso<br />
the file you will get will be about 120M in size. Then you can burn this *.iso and boot it on any x86-machine which supports booting from CD-ROMs (which is pretty much any PC today)<br />
<br />
==How to build a bootable WinPE USB-flash image==<br />
a more convenient option would be to create a bootable USB-flash drive. Unfortunately, you will only be able to use it on PCs which support booting from USB-HDDs. Some BIOSes only support booting from USB-FDDs.<br />
<br />
* prepare a blank<br />
dd if=/dev/zero of=winpe3_x86.img count=250000<br />
* boot <tt>winpe3_x86.iso</tt> (which you've created before) in a virtual machine<br />
qemu -cdrom winpe3_x86/winpe3_x86.iso -boot d -m 640 -hda winpe3_x86.img<br />
* now, in the shell provided by Windows PE in the virtual machine<br />
diskpart.exe<br />
diskpart> list disk<br />
diskpart> select disk 0<br />
diskpart> clean<br />
diskpart> create partition primary<br />
diskpart> list partition<br />
diskpart> select partition 1<br />
diskpart> format fs=fat32 quick<br />
diskpart> active<br />
diskpart> assign<br />
diskpart> list volume<br />
diskpart> exit<br />
xcopy /s d:\* c:\<br />
wpeutil shutdown<br />
* then the virtual machine shuts down, you can copy Windows PE image on a flash media. It will fit on any media > 125M in size.<br />
dd if=winpe3_x86.img of=/dev/sdb<br />
and use it for test/diagnostic tasks such as firmware upgrades. If you want, you can create an additional partition for you firmware/diagnostic tools, just don't mess with the partition created by Windows -- you may reder it unbootable.</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Ericsson_F3507g_Mobile_Broadband_Module&diff=44498Ericsson F3507g Mobile Broadband Module2009-10-14T01:54:14Z<p>Newhren: Undo revision 44412 by Newhren (Talk)</p>
<hr />
<div>__TOC__<br />
<br />
Here are some basics about Ericsson F3507g MiniPCIe WWAN/GPS card (USB ID <tt>0bdb:1900</tt> and <tt>0bdb:1902</tt>):<br />
<br />
* the card will not work without an inserted SIM, even the GPS function. If you want to use just GPS, any SIM would work, even if it is not attached to any active account with any GSM provider.<br />
* the card provides three CDC ACM interfaces (<tt>CONFIG_USB_ACM=m</tt>), two CDC WDM interfaces (<tt>CONFIG_USB_WDM=m</tt>) and one CDC Ethernet interface (<tt>CONFIG_USB_NET_CDCETHER=m</tt>), and identifies them as<br />
for n in `ls /sys/class/*/*{ACM,wdm,usb0}*/device/interface`;do echo $(echo $n|awk -F '/' '{print $5}') : $(cat $n);done<br />
<br />
usb0 : Ericsson F3507g Mobile Broadband Minicard Network Adapter<br />
ttyACM0 : Ericsson F3507g Mobile Broadband Minicard Modem<br />
ttyACM1 : Ericsson F3507g Mobile Broadband Minicard Data Modem<br />
ttyACM2 : Ericsson F3507g Mobile Broadband Minicard GPS Port<br />
cdc-wdm0 : Ericsson F3507g Mobile Broadband Minicard Device Management<br />
cdc-wdm1 : Ericsson F3507g Mobile Broadband Minicard PC SC Port<br />
'''Note''':<br />
*apparently, for a while <tt>option</tt> USB-serial driver had claimed USB ID <tt>0bdb:1900</tt>, but this was wrong, and as of kernel 2.6.28.9 that commit was reversed. If instead of <tt>/dev/ttyACM*</tt> you see <tt>/dev/ttyUSB*</tt>, it means that <tt>option</tt> module is loaded. You may need to blacklist it to make sure it doesn't happen.<br />
*Support for the CDC Ethernet interface appears only in kernel 2.6.28.8. But if your kernel is older, you can still connect to the net using one of the "Modem" interfaces.<br />
<br />
As Ericsson's naming scheme suggests, idealy we would use <tt>/dev/cdc-wdm0</tt> for controlling the card, <tt>usb0</tt> as a network device, <tt>/dev/ttyACM0</tt> or <tt>/dev/ttyACM1</tt> as a modem, and <tt>/dev/ttyACM2</tt> for GPS. This works for manual testing, but unfortunately, due to [http://markmail.org/message/2sd7culbgekugow2 limitations] of <tt>chat</tt>, does not play very well in scripts. So, instead of <tt>/dev/cdc-wdm0</tt>, for controlling the card we will use <tt>/dev/ttyACM1</tt>.<br />
<br />
==Turning the card on==<br />
First, check whenever the SIM is protected by PIN by sending <br />
<br />
AT+CPIN?<br />
<br />
to <tt>/dev/ttyACM1</tt>. You can do it with any terminal terminal program like <tt>cu</tt> or <tt>minicom</tt>. If the answer is<br />
<br />
+CPIN: READY<br />
<br />
then the SIM is unlocked. If the answer is<br />
<br />
+CPIN: SIM PIN<br />
<br />
you need first to unlock it by sending<br />
<br />
AT+CPIN="YOUR-PIN"<br />
<br />
to <tt>/dev/ttyACM1</tt>. Now the card can be turned on by sending <br />
<br />
AT+CFUN=1<br />
<br />
to <tt>/dev/ttyACM1</tt>. The answer should be<br />
<br />
+PACSP0<br />
<br />
Don't try to do anything until you see it. To force GSM-only connection, send<br />
<br />
AT+CFUN=5<br />
<br />
to <tt>/dev/ttyACM1</tt>. To force WCDMA-only connection, send<br />
<br />
AT+CFUN=6<br />
<br />
to <tt>/dev/ttyACM1</tt>.<br />
<br />
==Turning the card off==<br />
To put the card into energy-saving mode (this is the default), you can send<br />
<br />
AT+CFUN=4<br />
<br />
to <tt>/dev/ttyACM1</tt>. To remove all power from the card, send<br />
<br />
AT+CFUN=0<br />
<br />
to <tt>/dev/ttyACM1</tt>. Be carefull with the last command. It turns the card completely off, and it will no longer accept any AT-commands before the hard reset. To physically reset the card flip the wireless switch off, and then on. You can do the same by sending <tt>echo 0 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state</tt> (to turn off) and then <tt>echo 1 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state</tt> (to turn on).<br />
<br />
==Using the card as a wireless modem==<br />
Once the card is turned on, there are two ways to connect to the net. The first one is just to use the card as any "normal" GPRS modem and start <tt>pppd</tt> daemon on one of <tt>/dev/ttyACM*</tt>. The other way is to use CDC Ethernet interface. It is supposed to be more efficient, but it requires a pretty recent (>=2.6.28.8) kernel.<br />
<br />
====Connecting to the net via pppd====<br />
For the first approach, the easiest way to do it is to use <tt>wvdial</tt>. For example, to connect to AT&T Wireless network, your <tt>/etc/wvdial.conf</tt> would have to be something like this<br />
[Dialer 3G]<br />
Modem = /dev/ttyACM0<br />
Init1 = AT+CGDCONT=1,"IP","'''proxy'''"<br />
Stupid mode = 1<br />
phone= *99#<br />
Username = *<br />
Password = *<br />
'''Note''': if you are using a SIM from a different mobile provider, you may need to change the access point name (APN) "'''proxy'''" in <tt>Init1</tt> string and Username/Password to something else. You can find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here].<br />
<br />
====Connecting to the net via CDC Ethernet interface====<br />
The [http://marc.info/?l=linux-usb&m=123334979706403&w=2 second approach] works for kernels >=2.6.28.8. Configure the APN by sending<br />
<br />
AT+CGDCONT=1,"IP","'''proxy'''"<br />
<br />
to <tt>/dev/ttyACM1</tt>. Instead of "'''proxy'''" you may need to use to something else. Find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here]. To initiate the connection, send<br />
<br />
AT*ENAP=1,1<br />
<br />
to <tt>/dev/ttyACM1</tt>. Now, if your wireless provider lets you in, you are connected. Launch <tt>dhclient</tt><br />
<br />
dhclient usb0<br />
<br />
and start surfing the net. To disconnect, send<br />
<br />
AT*ENAP=0<br />
<br />
to <tt>/dev/ttyACM1</tt>.<br />
<br />
==Using the card as a GPS receiver==<br />
Once the card is turned on, we can use it to get GPS info via NMEA protocol. First, you have to configure the a few NMEA options. It is done by sending <br />
<br />
AT*E2GPSCTL=X,Y,Z<br />
<br />
to <tt>/dev/ttyACM1</tt>. Here<br />
<br />
*X can be 0 (NMEA stream turned off) or 1 (NMEA stream turned on)<br />
*Y can be an integer form 1 to 60, and sets the frequency of how often the card emits the NMEA sentences<br />
*Z can be 0 (DGPS is turned off) or 1 (DGPS is turned on)<br />
<br />
so, to configure the GPSr to update every 5 seconds, and turn DGPS on, you would send<br />
<br />
AT*E2GPSCTL=1,5,1<br />
<br />
to <tt>/dev/ttyACM1</tt>. Once the GPSr is configured, we can get the NMEA stream on /dev/ttyACM2 by sending<br />
<br />
AT*E2GPSNPD<br />
<br />
to <tt>/dev/ttyACM2</tt>. Once you do that, <tt>/dev/ttyACM2</tt> will no longer accept any new AT-commands. But you still can change the the behavior of the NMEA stream by sending the appropriate<br />
<br />
AT*E2GPSCTL=X,Y,Z<br />
<br />
to <tt>/dev/ttyACM1</tt>. Now you can read the NMEA stream by saying<br />
<br />
cat /dev/ttyACM2<br />
<br />
or better yet, start <tt>gpsd</tt> interface on <tt>/dev/ttyACM2</tt>.<br />
<br />
Note: There is a now a sourceforge project dedicated to the Ericsson Mobile Broadband modules. Gps control sw that does the above automatically is available and also a graphical user interface. Details are available on the [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=Main_Page#GPS_Control_.28mbm-gpsd.29 MBM Wiki].<br />
<br />
==Scripting everything==<br />
Install the packages<br />
<br />
apt-get install sysfsutils gpsd wvdial<br />
<br />
In order to save the power, lets use '''sysfsutils''' to completely power off the WWAN card on boot. Append the following line to <tt>/etc/sysfs.conf</tt><br />
<br />
devices/platform/thinkpad_acpi/rfkill/rfkill0/state = 0<br />
<br />
It will power down the card on boot, but when the laptop wakes from sleep, in some cases the card is powered up agian. To re-apply these settings on wake-up, create a script named <tt>/etc/pm/sleep.d/10sysfsutils</tt>:<br />
<br />
#!/bin/sh<br />
case $1 in<br />
(hibernate|suspend)<br />
;;<br />
(thaw|resume)<br />
/etc/init.d/sysfsutils start<br />
;;<br />
*) echo "somebody is calling me totally wrong."<br />
;;<br />
esac<br />
<br />
Don't forget to <tt>chmod a+x /etc/pm/sleep.d/10sysfsutils</tt>. Create a file called <tt>/usr/local/etc/F3507g</tt> containing the following:<br />
<br />
GPSDPID="/var/run/gpsd.pid"<br />
CONTROL_DEVICE="/dev/ttyACM1"<br />
GPS_DEVICE="/dev/ttyACM2"<br />
'''PIN=""'''<br />
'''APN="proxy"'''<br />
<br />
powerup_F3507g () {<br />
echo -n "Powering up F3507g card.."<br />
echo 1 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state<br />
while [ ! -c $CONTROL_DEVICE ]; do sleep 0.5; echo -n "."; done<br />
echo "done"<br />
echo -n "Turning on F3507g card..."<br />
sleep 3<br />
if [ -n "$PIN" ]; then<br />
/usr/sbin/chat -v "" "AT+CPIN?" "SIM PIN" "AT" "OK" "AT+CPIN=\"$PIN\"" "OK" > $CONTROL_DEVICE < $CONTROL_DEVICE<br />
fi<br />
/usr/sbin/chat -v "" "AT+CPIN?" "READY" "AT+CFUN=1" "+PACSP0" "AT" "OK" > $CONTROL_DEVICE < $CONTROL_DEVICE<br />
echo "done"<br />
}<br />
<br />
powerdown_F3507g () {<br />
echo -n "Turning off F3507g card..."<br />
/usr/sbin/chat -v "" "AT+CFUN=4" "OK" > $CONTROL_DEVICE < $CONTROL_DEVICE<br />
echo "done"<br />
echo -n "Powering down F3507g card.."<br />
echo 0 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state<br />
while [ -c $CONTROL_DEVICE ]; do sleep 0.5; echo -n "."; done<br />
echo "done"<br />
}<br />
<br />
configure_GPS () {<br />
/usr/sbin/chat -v "" "AT*E2GPSCTL=$1,$2,$3" "OK" > $CONTROL_DEVICE < $CONTROL_DEVICE<br />
}<br />
<br />
turnon_GPS () {<br />
echo -n "Starting NMEA stream on $GPS_DEVICE..."<br />
configure_GPS 1 1 1<br />
sleep 1<br />
/usr/sbin/chat -v "" "AT*E2GPSNPD" "GPGGA" > $GPS_DEVICE < $GPS_DEVICE<br />
start-stop-daemon --start --exec /usr/sbin/gpsd -- -P $GPSDPID $GPS_DEVICE<br />
echo "done"<br />
}<br />
<br />
turnoff_GPS () {<br />
echo -n "Stopping NMEA stream on $GPS_DEVICE..."<br />
start-stop-daemon --stop --pidfile $GPSDPID<br />
configure_GPS 0 1 0<br />
echo "done"<br />
turnoff_F3507g<br />
}<br />
<br />
turnon_usbnet () {<br />
echo -n "Starting usbnet connection..."<br />
/usr/sbin/chat -v "" "AT+CGDCONT=1,\"IP\",\"$APN\"" "OK" "AT*ENAP=1,1" "OK" > $CONTROL_DEVICE < $CONTROL_DEVICE<br />
echo "done"<br />
}<br />
<br />
turnoff_usbnet () {<br />
echo -n "Stopping usbnet connection..."<br />
/usr/sbin/chat -v "" "AT*ENAP=0" "OK" > $CONTROL_DEVICE < $CONTROL_DEVICE<br />
echo "done"<br />
turnoff_F3507g<br />
}<br />
<br />
turnoff_F3507g () {<br />
[ -z $(grep gps /etc/network/run/ifstate) ] && \<br />
[ -z $(grep usb0 /etc/network/run/ifstate) ] && \<br />
[ -z $(grep 3G /etc/network/run/ifstate) ] && \<br />
ifdown F3507g<br />
}<br />
<br />
Give the correct '''PIN''' and find the '''APN''' for your wireless provider [http://www.pinstack.com/carrier_settings_apn_gateway.html here]. Append the following lines to your <tt>/etc/network/interfaces</tt> file<br />
<br />
iface F3507g inet manual<br />
up . /usr/local/etc/F3507g; powerup_F3507g<br />
down . /usr/local/etc/F3507g; powerdown_F3507g<br />
<br />
iface 3G inet wvdial<br />
pre-up ifup F3507g<br />
post-down . /usr/local/etc/F3507g; turnoff_F3507g<br />
provider 3G<br />
<br />
iface gps inet manual<br />
up . /usr/local/etc/F3507g; ifup F3507g; turnon_GPS<br />
down . /usr/local/etc/F3507g; turnoff_GPS<br />
<br />
iface usb0 inet dhcp<br />
pre-up . /usr/local/etc/F3507g; ifup F3507g; turnon_usbnet<br />
post-down . /usr/local/etc/F3507g; turnoff_usbnet<br />
<br />
Configure <tt>/etc/wvdial.conf</tt> to look like this:<br />
<br />
[Dialer 3G]<br />
Modem = /dev/ttyACM0<br />
Init1 = AT+CGDCONT=1,"IP","'''proxy'''"<br />
Stupid mode = 1<br />
phone= *99#<br />
Username = *<br />
Password = *<br />
<br />
'''Note''': you may need to change the access point name (APN) "'''proxy'''" in <tt>Init1</tt> string and Username/Password to something else. Find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here].<br />
<br />
Now broadband connection could be started in the same way as you start any other network interface, just by saying <tt>ifup usb0</tt> (or <tt>ifup 3G</tt>, if connecting via <tt>pppd</tt>). To shut it down, say <tt>ifdown usb0</tt> (or <tt>ifdown 3G</tt>). Similarly, GPS interface is started by <tt>ifup gps</tt> and turned off by <tt>ifdown gps</tt>. Once you get a fix, you can use your favourite GPS mapping application like [http://www.tangogps.org tangogps]. The "cold start" seems to take quite a bit however, and sometimes it cannot get a fix if indoors.<br />
<br />
==Using F3507g with NetworkManager==<br />
Work is ongoing to add support for Ericsson Mobile Broadband Modules to GNOME NetworkManager / modem-manager. More information is available on the [http://mbm.sourceforge.net/ MBM project website] and the [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=MBM MBM wiki].<br />
<br />
The F3507g card (in a ThinkPad {{T400s}}) works out of the box on Fedora 11. No configuration is needed beyond setting the data plan provider in the nm-applet GUI.<br />
<br />
Using mbm-gpsd gps works flawlessly with the F3507g on Karmic Koala with modemmanager packages from [https://launchpad.net/~modemmanager/+archive/ppa Ubuntu PPA], the mbm-gpsd installed by source using the description from [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=MBM#GPS_Control_.28mbm-gpsd.29 here] and knowing the PIN of your SIM card.<br />
<br />
==Other thoughts==<br />
While <tt>AT+CFUN=*</tt> and <tt>AT+CPIN=*</tt> are pretty standard commands for wireless modems and are well-documented (e.g. [http://developer.sonyericsson.com/getDocument.do?docId=65054 here] and [http://www.sierrawireless.com/resources/documents/support/2130617_Supported_AT_Command_Reference_Rev_2.1.pdf here]), it appears that the commands <tt>AT*E2GPSCTL</tt> and <tt>AT*E2GPSNPD</tt> are unique to the Ericsson F3507g card. All credit for discovering them goes to "Nickolai Zeldovich" who left a comment in this [http://redmonk.com/sogrady/2008/09/24/apone/ thread]. I imagine one could find them via a USB sniffer on a working Windows machine (or a Linux machine with Windows running in a virtual machine). Another way to get them is to try to look for "gps" string in Windows drivers. What is interesting, F3507g supports a few other AT-commands with "GPS" substring (you can get all supported AT-commands by sending <tt>AT*</tt> to <tt>/dev/ttyACM1</tt> after activating it with <tt>AT+CFUN=1</tt>). Anyway, there is a [http://www.natisbad.org/E4300/Dell_Wireless_5530_AT_cmd_ref.html project] aiming to document all AT-commands for the Ericsson F3507g card.<br />
<br />
==Related Links==<br />
*[http://www.natisbad.org/E4300/Dell_Wireless_5530_AT_cmd_ref.html F3705g - AT commands reference]<br />
*[http://www.pinstack.com/carrier_settings_apn_gateway.html Carrier internet Settings (Apn, Gateway, etc)]<br />
*[http://mbm.sourceforge.net/ MBM project website (Support for f3507g/f3607gw in NetworkManager, kernel drivers, gps control software etc)]<br />
<br />
==Bugs==<br />
* Ubuntu 8.10 kernel suffers from the "option" regression mentioned above. However both CDC ACM and CDC Ethernet interfaces are treated correctly by Ubuntu 9.04 kernel.<br />
* Playing around with the device under Linux can cause it to disappear under Windows Vista. Issue + Fix described [http://forums.lenovo.com/t5/T400-T500-and-newer-T-series/Ericsson-f3507g-doesn-t-appear-under-Vista32-anymore-but-works/m-p/138874 here]<br />
<br />
==Models==<br />
*{{X200}}<br />
*{{X200 Tablet}}<br />
*{{X301}}<br />
*{{T400}}<br />
*{{T400s}}<br />
*{{T500}}</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Ericsson_F3507g_Mobile_Broadband_Module&diff=44412Ericsson F3507g Mobile Broadband Module2009-09-25T01:35:12Z<p>Newhren: </p>
<hr />
<div>__TOC__<br />
<br />
Here are some basics about Ericsson F3507g MiniPCIe WWAN/GPS card (USB ID <tt>0bdb:1900</tt> and <tt>0bdb:1902</tt>):<br />
<br />
* the card will not work without an inserted SIM, even the GPS function. If you want to use just GPS, any SIM would work, even if it is not attached to any active account with any GSM provider.<br />
* the card provides three CDC ACM interfaces (<tt>CONFIG_USB_ACM=m</tt>), two CDC WDM interfaces (<tt>CONFIG_USB_WDM=m</tt>) and one CDC Ethernet interface (<tt>CONFIG_USB_NET_CDCETHER=m</tt>), and identifies them as<br />
for n in `ls /sys/class/*/*{ACM,wdm,usb0}*/device/interface`;do echo $(echo $n|awk -F '/' '{print $5}') : $(cat $n);done<br />
<br />
usb0 : Ericsson F3507g Mobile Broadband Minicard Network Adapter<br />
ttyACM0 : Ericsson F3507g Mobile Broadband Minicard Modem<br />
ttyACM1 : Ericsson F3507g Mobile Broadband Minicard Data Modem<br />
ttyACM2 : Ericsson F3507g Mobile Broadband Minicard GPS Port<br />
cdc-wdm0 : Ericsson F3507g Mobile Broadband Minicard Device Management<br />
cdc-wdm1 : Ericsson F3507g Mobile Broadband Minicard PC SC Port<br />
'''Note''':<br />
*apparently, for a while <tt>option</tt> USB-serial driver had claimed USB ID <tt>0bdb:1900</tt>, but this was wrong, and as of kernel 2.6.28.9 that commit was reversed. If instead of <tt>/dev/ttyACM*</tt> you see <tt>/dev/ttyUSB*</tt>, it means that <tt>option</tt> module is loaded. You may need to blacklist it to make sure it doesn't happen.<br />
*Support for the CDC Ethernet interface appears only in kernel 2.6.28.8. But if your kernel is older, you can still connect to the net using one of the "Modem" interfaces.<br />
<br />
As Ericsson's naming scheme suggests, we would use <tt>/dev/cdc-wdm0</tt> for controlling the card, <tt>usb0</tt> as a network device, <tt>/dev/ttyACM0</tt> as a modem, and <tt>/dev/ttyACM2</tt> for GPS.<br />
<br />
==Turning the card on==<br />
First, check whenever the SIM is protected by PIN by sending <br />
<br />
AT+CPIN?<br />
<br />
to <tt>/dev/cdc-wdm0</tt>. You can do it with any terminal terminal program like <tt>cu</tt> or <tt>minicom</tt>. If the answer is<br />
<br />
+CPIN: READY<br />
<br />
then the SIM is unlocked. If the answer is<br />
<br />
+CPIN: SIM PIN<br />
<br />
you need first to unlock it by sending<br />
<br />
AT+CPIN="YOUR-PIN"<br />
<br />
to <tt>/dev/cdc-wdm0</tt>. Now the card can be turned on by sending <br />
<br />
AT+CFUN=1<br />
<br />
to <tt>/dev/cdc-wdm0</tt>. The answer should be<br />
<br />
+PACSP0<br />
<br />
Don't try to do anything until you see it. To force GSM-only connection, send<br />
<br />
AT+CFUN=5<br />
<br />
to <tt>/dev/cdc-wdm0</tt>. To force WCDMA-only connection, send<br />
<br />
AT+CFUN=6<br />
<br />
to <tt>/dev/cdc-wdm0</tt>.<br />
<br />
==Turning the card off==<br />
To put the card into energy-saving mode (this is the default), you can send<br />
<br />
AT+CFUN=4<br />
<br />
to <tt>/dev/cdc-wdm0</tt>. To remove all power from the card, send<br />
<br />
AT+CFUN=0<br />
<br />
to <tt>/dev/cdc-wdm0</tt>. Be carefull with the last command. It turns the card completely off, and it will no longer accept any AT-commands before the hard reset. To physically reset the card flip the wireless switch off, and then on. You can do the same by sending <tt>echo 0 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state</tt> (to turn off) and then <tt>echo 1 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state</tt> (to turn on).<br />
<br />
==Using the card as a wireless modem==<br />
Once the card is turned on, there are two ways to connect to the net. The first one is just to use the card as any "normal" GPRS modem and start <tt>pppd</tt> daemon on one of <tt>/dev/ttyACM*</tt>. The other way is to use CDC Ethernet interface. It is supposed to be more efficient, but it requires a pretty recent (>=2.6.28.8) kernel.<br />
<br />
====Connecting to the net via pppd====<br />
For the first approach, the easiest way to do it is to use <tt>wvdial</tt>. For example, to connect to AT&T Wireless network, your <tt>/etc/wvdial.conf</tt> would have to be something like this<br />
[Dialer 3G]<br />
Modem = /dev/ttyACM0<br />
Init1 = AT+CGDCONT=1,"IP","'''proxy'''"<br />
Stupid mode = 1<br />
phone= *99#<br />
Username = *<br />
Password = *<br />
'''Note''': if you are using a SIM from a different mobile provider, you may need to change the access point name (APN) "'''proxy'''" in <tt>Init1</tt> string and Username/Password to something else. You can find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here].<br />
<br />
====Connecting to the net via CDC Ethernet interface====<br />
The [http://marc.info/?l=linux-usb&m=123334979706403&w=2 second approach] works for kernels >=2.6.28.8. Configure the APN by sending<br />
<br />
AT+CGDCONT=1,"IP","'''proxy'''"<br />
<br />
to <tt>/dev/cdc-wdm0</tt>. Instead of "'''proxy'''" you may need to use to something else. Find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here]. To initiate the connection, send<br />
<br />
AT*ENAP=1,1<br />
<br />
to <tt>/dev/cdc-wdm0</tt>. Now, if your wireless provider lets you in, you are connected. Launch <tt>dhclient</tt><br />
<br />
dhclient usb0<br />
<br />
and start surfing the net. To disconnect, send<br />
<br />
AT*ENAP=0<br />
<br />
to <tt>/dev/cdc-wdm0</tt>.<br />
<br />
==Using the card as a GPS receiver==<br />
Once the card is turned on, we can use it to get GPS info via NMEA protocol. First, you have to configure the a few NMEA options. It is done by sending <br />
<br />
AT*E2GPSCTL=X,Y,Z<br />
<br />
to <tt>/dev/cdc-wdm0</tt>. Here<br />
<br />
*X can be 0 (NMEA stream turned off) or 1 (NMEA stream turned on)<br />
*Y can be an integer form 1 to 60, and sets the frequency of how often the card emits the NMEA sentences<br />
*Z can be 0 (DGPS is turned off) or 1 (DGPS is turned on)<br />
<br />
so, to configure the GPSr to update every 5 seconds, and turn DGPS on, you would send<br />
<br />
AT*E2GPSCTL=1,5,1<br />
<br />
to <tt>/dev/cdc-wdm0</tt>. Once the GPSr is configured, we can get the NMEA stream on /dev/ttyACM2 by sending<br />
<br />
AT*E2GPSNPD<br />
<br />
to <tt>/dev/ttyACM2</tt>. Once you do that, <tt>/dev/ttyACM2</tt> will no longer accept any new AT-commands. But you still can change the the behavior of the NMEA stream by sending the appropriate<br />
<br />
AT*E2GPSCTL=X,Y,Z<br />
<br />
to <tt>/dev/cdc-wdm0</tt>. Now you can read the NMEA stream by saying<br />
<br />
cat /dev/ttyACM2<br />
<br />
or better yet, start <tt>gpsd</tt> interface on <tt>/dev/ttyACM2</tt>.<br />
<br />
Note: There is a now a sourceforge project dedicated to the Ericsson Mobile Broadband modules. Gps control sw that does the above automatically is available and also a graphical user interface. Details are available on the [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=Main_Page#GPS_Control_.28mbm-gpsd.29 MBM Wiki].<br />
<br />
==Scripting everything==<br />
Install the packages<br />
<br />
apt-get install sysfsutils gpsd wvdial<br />
<br />
In order to save the power, lets use '''sysfsutils''' to completely power off the WWAN card on boot. Append the following line to <tt>/etc/sysfs.conf</tt><br />
<br />
devices/platform/thinkpad_acpi/rfkill/rfkill0/state = 0<br />
<br />
It will power down the card on boot, but when the laptop wakes from sleep, in some cases the card is powered up agian. To re-apply these settings on wake-up, create a script named <tt>/etc/pm/sleep.d/10sysfsutils</tt>:<br />
<br />
#!/bin/sh<br />
case $1 in<br />
(hibernate|suspend)<br />
;;<br />
(thaw|resume)<br />
/etc/init.d/sysfsutils start<br />
;;<br />
*) echo "somebody is calling me totally wrong."<br />
;;<br />
esac<br />
<br />
Don't forget to <tt>chmod a+x /etc/pm/sleep.d/10sysfsutils</tt>. Create a file called <tt>/usr/local/etc/F3507g</tt> containing the following:<br />
<br />
GPSDPID="/var/run/gpsd.pid"<br />
CONTROL_DEVICE="/dev/cdc-wdm0"<br />
GPS_DEVICE="/dev/ttyACM2"<br />
'''PIN=""'''<br />
'''APN="proxy"'''<br />
<br />
powerup_F3507g () {<br />
echo -n "Powering up F3507g card.."<br />
echo 1 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state<br />
while [ ! -c $CONTROL_DEVICE ]; do sleep 0.5; echo -n "."; done<br />
echo "done"<br />
echo "Turning on F3507g card..."<br />
sleep 3<br />
if [ -n "$PIN" ]; then<br />
expect -c 'spawn cu -l '$CONTROL_DEVICE'; expect "Connected.";<br />
send "AT+CPIN?\r";<br />
expect "SIM PIN";<br />
send "AT\r";<br />
expect "OK";<br />
send "AT+CPIN=\"'$PIN'\"\r";<br />
expect "OK";'<br />
sleep 1<br />
fi<br />
expect -c 'spawn cu -l '$CONTROL_DEVICE'; expect "Connected.";<br />
send "AT+CPIN?\r";<br />
expect "READY";<br />
send "AT+CFUN=1\r";<br />
expect "PACSP0";'<br />
sleep 1<br />
echo "done"<br />
}<br />
<br />
powerdown_F3507g () {<br />
echo "Turning off F3507g card..."<br />
expect -c 'spawn cu -l '$CONTROL_DEVICE'; expect "Connected.";<br />
send "AT+CFUN=4\r";<br />
expect "OK";'<br />
echo "done"<br />
echo -n "Powering down F3507g card.."<br />
echo 0 > /sys/devices/platform/thinkpad_acpi/rfkill/rfkill0/state<br />
while [ -c $CONTROL_DEVICE ]; do sleep 0.5; echo -n "."; done<br />
echo "done"<br />
}<br />
<br />
configure_GPS () {<br />
expect -c 'spawn cu -l '$CONTROL_DEVICE'; expect "Connected.";<br />
send "AT*E2GPSCTL='$1,$2,$3'\r";<br />
expect "OK";'<br />
sleep 1<br />
}<br />
<br />
turnon_GPS () {<br />
echo "Starting NMEA stream on $GPS_DEVICE ..."<br />
configure_GPS 1 1 1<br />
su -c 'expect -c "spawn cu -l \"'$GPS_DEVICE'\"; expect \"Connected.\"; \<br />
send \"AT*E2GPSNPD\r\"; \<br />
expect \"GPGGA\"";' uucp<br />
sleep 1<br />
start-stop-daemon --start --exec /usr/sbin/gpsd -- -P $GPSDPID $GPS_DEVICE<br />
echo "done"<br />
}<br />
<br />
turnoff_GPS () {<br />
echo "Stopping NMEA stream on $GPS_DEVICE ..."<br />
start-stop-daemon --stop --pidfile $GPSDPID<br />
configure_GPS 0 1 0<br />
echo "done"<br />
turnoff_F3507g<br />
}<br />
<br />
turnon_usbnet () {<br />
echo "Starting usbnet connection..."<br />
expect -c 'spawn cu -l '$CONTROL_DEVICE'; expect "Connected.";<br />
send "AT+CGDCONT=1,\"IP\",\"'$APN'\"\r";<br />
expect "OK";<br />
send "AT*ENAP=1,1\r";<br />
expect "OK";'<br />
sleep 1<br />
echo "done"<br />
}<br />
<br />
turnoff_usbnet () {<br />
echo "Stopping usbnet connection..."<br />
expect -c 'spawn cu -l '$CONTROL_DEVICE'; expect "Connected.";<br />
send "AT*ENAP=0\r";<br />
expect "OK";'<br />
sleep 1<br />
echo "done"<br />
turnoff_F3507g<br />
}<br />
<br />
turnoff_F3507g () {<br />
[ -z $(grep gps /etc/network/run/ifstate) ] && \<br />
[ -z $(grep usb0 /etc/network/run/ifstate) ] && \<br />
[ -z $(grep 3G /etc/network/run/ifstate) ] && \<br />
ifdown F3507g<br />
}<br />
<br />
Give the correct '''PIN''' and find the '''APN''' for your wireless provider [http://www.pinstack.com/carrier_settings_apn_gateway.html here]. Append the following lines to your <tt>/etc/network/interfaces</tt> file<br />
<br />
iface F3507g inet manual<br />
up . /usr/local/etc/F3507g; powerup_F3507g<br />
down . /usr/local/etc/F3507g; powerdown_F3507g<br />
<br />
iface 3G inet wvdial<br />
pre-up ifup F3507g<br />
post-down . /usr/local/etc/F3507g; turnoff_F3507g<br />
provider 3G<br />
<br />
iface gps inet manual<br />
up . /usr/local/etc/F3507g; ifup F3507g; turnon_GPS<br />
down . /usr/local/etc/F3507g; turnoff_GPS<br />
<br />
iface usb0 inet dhcp<br />
pre-up . /usr/local/etc/F3507g; ifup F3507g; turnon_usbnet<br />
post-down . /usr/local/etc/F3507g; turnoff_usbnet<br />
<br />
Configure <tt>/etc/wvdial.conf</tt> to look like this:<br />
<br />
[Dialer 3G]<br />
Modem = /dev/ttyACM0<br />
Init1 = AT+CGDCONT=1,"IP","'''proxy'''"<br />
Stupid mode = 1<br />
phone= *99#<br />
Username = *<br />
Password = *<br />
<br />
'''Note''': you may need to change the access point name (APN) "'''proxy'''" in <tt>Init1</tt> string and Username/Password to something else. Find the appropriate APN [http://www.pinstack.com/carrier_settings_apn_gateway.html here].<br />
<br />
Now broadband connection could be started in the same way as you start any other network interface, just by saying <tt>ifup usb0</tt> (or <tt>ifup 3G</tt>, if connecting via <tt>pppd</tt>). To shut it down, say <tt>ifdown usb0</tt> (or <tt>ifdown 3G</tt>). Similarly, GPS interface is started by <tt>ifup gps</tt> and turned off by <tt>ifdown gps</tt>. Once you get a fix, you can use your favourite GPS mapping application like [http://www.tangogps.org tangogps]. The "cold start" seems to take quite a bit however, and sometimes it cannot get a fix if indoors.<br />
<br />
==Using F3507g with NetworkManager==<br />
Work is ongoing to add support for Ericsson Mobile Broadband Modules to GNOME NetworkManager / modem-manager. More information is available on the [http://mbm.sourceforge.net/ MBM project website] and the [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=MBM MBM wiki].<br />
<br />
The F3507g card (in a ThinkPad {{T400s}}) works out of the box on Fedora 11. No configuration is needed beyond setting the data plan provider in the nm-applet GUI.<br />
<br />
Using mbm-gpsd gps works flawlessly with the F3507g on Karmic Koala with modemmanager packages from [https://launchpad.net/~modemmanager/+archive/ppa Ubuntu PPA], the mbm-gpsd installed by source using the description from [http://sourceforge.net/apps/mediawiki/mbm/index.php?title=MBM#GPS_Control_.28mbm-gpsd.29 here] and knowing the PIN of your SIM card.<br />
<br />
==Other thoughts==<br />
While <tt>AT+CFUN=*</tt> and <tt>AT+CPIN=*</tt> are pretty standard commands for wireless modems and are well-documented (e.g. [http://developer.sonyericsson.com/getDocument.do?docId=65054 here] and [http://www.sierrawireless.com/resources/documents/support/2130617_Supported_AT_Command_Reference_Rev_2.1.pdf here]), it appears that the commands <tt>AT*E2GPSCTL</tt> and <tt>AT*E2GPSNPD</tt> are unique to the Ericsson F3507g card. All credit for discovering them goes to "Nickolai Zeldovich" who left a comment in this [http://redmonk.com/sogrady/2008/09/24/apone/ thread]. I imagine one could find them via a USB sniffer on a working Windows machine (or a Linux machine with Windows running in a virtual machine). Another way to get them is to try to look for "gps" string in Windows drivers. What is interesting, F3507g supports a few other AT-commands with "GPS" substring (you can get all supported AT-commands by sending <tt>AT*</tt> to <tt>/dev/cdc-wdm0</tt> after activating it with <tt>AT+CFUN=1</tt>). Anyway, there is a [http://www.natisbad.org/E4300/Dell_Wireless_5530_AT_cmd_ref.html project] aiming to document all AT-commands for the Ericsson F3507g card.<br />
<br />
==Related Links==<br />
*[http://www.natisbad.org/E4300/Dell_Wireless_5530_AT_cmd_ref.html F3705g - AT commands reference]<br />
*[http://www.pinstack.com/carrier_settings_apn_gateway.html Carrier internet Settings (Apn, Gateway, etc)]<br />
*[http://mbm.sourceforge.net/ MBM project website (Support for f3507g/f3607gw in NetworkManager, kernel drivers, gps control software etc)]<br />
<br />
==Bugs==<br />
* Ubuntu 8.10 kernel suffers from the "option" regression mentioned above. However both CDC ACM and CDC Ethernet interfaces are treated correctly by Ubuntu 9.04 kernel.<br />
* Playing around with the device under Linux can cause it to disappear under Windows Vista. Issue + Fix described [http://forums.lenovo.com/t5/T400-T500-and-newer-T-series/Ericsson-f3507g-doesn-t-appear-under-Vista32-anymore-but-works/m-p/138874 here]<br />
<br />
==Models==<br />
*{{X200}}<br />
*{{X200 Tablet}}<br />
*{{X301}}<br />
*{{T400}}<br />
*{{T500}}</div>Newhrenhttps://www.thinkwiki.org/w/index.php?title=Mute_button&diff=43461Mute button2009-06-11T18:23:04Z<p>Newhren: â†Created page with 'Starting from Linux version 2.6.23, kernel passes OSI string "<tt>!Linux</tt>" to ACPI (instead of "<tt>Linux</tt>"). There is a number of reasons for that (see details in...'</p>
<hr />
<div>Starting from Linux version 2.6.23, kernel passes OSI string "<tt>!Linux</tt>" to ACPI (instead of "<tt>Linux</tt>"). There is a number of reasons for that (see details in <tt>drivers/acpi/osl.c</tt> in the kernel source). But IBM/Lenovo has a consistently good record of supporting Linux, so this trick is not necessary for Thinkpads. Moreover, OSI string "<tt>Linux</tt>" is [http://linux.derkeiler.com/Mailing-Lists/Kernel/2008-01/msg04543.html needed] to make the '''Mute''' button work. For Thinkpads R61, T61 and X61, there are already hooks for that in <tt>drivers/acpi/blacklist.c</tt>. For most other models, you need to pass the string <tt>acpi_osi="Linux"</tt> to the kernel as a boot parameter.<br />
<br />
==Needed for models==<br />
{{T400}}, {{X200}}, {{X301}}</div>Newhren