<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>DISM &#8211; Sibeesh Passion</title>
	<atom:link href="https://sibeeshpassion.com/tag/dism/feed/" rel="self" type="application/rss+xml" />
	<link>https://sibeeshpassion.com</link>
	<description>My passion towards life</description>
	<lastBuildDate>Sat, 19 Jan 2019 10:54:11 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>/wp-content/uploads/2017/04/Sibeesh_Passion_Logo_Small.png</url>
	<title>DISM &#8211; Sibeesh Passion</title>
	<link>https://sibeeshpassion.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Raspberry PI SD Card Provisioning with Windows 10 IoT Core &#8211; Create FFU Image and Flash</title>
		<link>https://sibeeshpassion.com/raspberry-pi-sd-card-provisioning-with-windows-10-iot-core-create-ffu-image-and-flash/</link>
					<comments>https://sibeeshpassion.com/raspberry-pi-sd-card-provisioning-with-windows-10-iot-core-create-ffu-image-and-flash/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Thu, 22 Nov 2018 08:41:04 +0000</pubDate>
				<category><![CDATA[IoT]]></category>
		<category><![CDATA[Raspberry PI]]></category>
		<category><![CDATA[diskpart]]></category>
		<category><![CDATA[DISM]]></category>
		<category><![CDATA[IoT Core]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[Raspberry PI SD Card Provisioning]]></category>
		<category><![CDATA[Windows 10 IoT Core]]></category>
		<category><![CDATA[Windows IoT core by DISM]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=13388</guid>

					<description><![CDATA[[toc] Introduction In my previous article, we have seen how to Set Up Your Raspberry PI with Microsoft Windows 10 IoT Core. Yes, we were successful in flashing the Microsoft Windows 10 IoT Core OS to our Raspberry PI, but let&#8217;s try something very handy this time. The main topic we are going to discuss here in this article is SD Card Provisioning. I understand that you have one Raspberry PI with a working OS in it, whether it is a Microsoft IoT  OS or Raspbian. And you might also have an application which runs in your Raspberry Pi. That&#8217;s good. But [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>[toc]</p>
<h2>Introduction</h2>
<p>In my previous article, we have seen how to <a href="https://sibeeshpassion.com/setting-up-your-raspberry-pi-with-microsoft-windows-10-iot-core/">Set Up Your Raspberry PI with Microsoft Windows 10 IoT Core</a>. Yes, we were successful in flashing the Microsoft Windows 10 IoT Core OS to our <a href="https://sibeeshpassion.com/category/raspberry-pi/">Raspberry PI</a>, but let&#8217;s try something very handy this time. The main topic we are going to discuss here in this article is <em>SD Card Provisioning.</em> I understand that you have one Raspberry PI with a working OS in it, whether it is a Microsoft IoT  OS or Raspbian. And you might also have an application which runs in your Raspberry Pi. That&#8217;s good. But what if you have 100 Raspberry PI and you need to set up your Raspberry PIs for a production environment? Did you get the difficulties in your mind? In this article, we are going to start a series of articles on SD Card Provisioning. For now, let&#8217;s just start doing some amazing things. Let&#8217;s just start then.</p>
<h2>Background</h2>
<p>Yeah, I am glad that you have a Raspberry PI with Windows 10 IoT core OS. While setting up your OS, you might have downloaded the IoT Dashboard and flashed the IoT OS to your SD card manually. As I mentioned in the Introduction, this is not a normal scenario when you want to connect multiple (let&#8217;s say 100) Raspberry PIs. Flashing the OS by using the Dashboard application might not be a good idea in this case. What should we do then? That&#8217;s where PowerShell come into the play. Yes, we are going to try out some PowerShell commands to do all those mentioned jobs for us.</p>
<h2>Prerequisites</h2>
<p>To do the wonderful things, we always need some prerequisites.  You can always see all the prerequisites from <a href="https://docs.microsoft.com/en-us/windows-hardware/manufacture/iot/set-up-your-pc-to-customize-iot-core">here</a>. But, in this part, we are going to be needed only the preceding tools.</p>
<ol>
<li>Windows Assessment and Deployment Kit (Windows ADK)</li>
<li>Windows Driver Kit (WDK) 10</li>
<li>IoT Core ADK Add-Ons</li>
<li>Windows 10 IoT Core Packages</li>
<li>The Raspberry Pi BSP</li>
</ol>
<h2>Creating the Base Windows IoT FFU Image</h2>
<p>I assume that you had already gone through the Prerequisites and followed the instructions. If not, please check again.</p>
<h3>Create a Workspace</h3>
<p>To get started here, please go to the cloned location of the repository iot-adk-addonkit, where you will find a Windows Command Script IoTCorePShell.cmd. Double click on the same file will open a PowerShell with administrative privilege. Now, this is where the game starts. Once it opens it will do some initial process for us.</p>
<div id="attachment_13389" style="width: 661px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/Running-IoTCorePShell.cmd_.png"><img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-13389" class="size-full wp-image-13389" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/Running-IoTCorePShell.cmd_.png" alt="Running IoTCorePShell.cmd" width="651" height="230" srcset="/wp-content/uploads/2018/11/Running-IoTCorePShell.cmd_.png 651w, /wp-content/uploads/2018/11/Running-IoTCorePShell.cmd_-300x106.png 300w, /wp-content/uploads/2018/11/Running-IoTCorePShell.cmd_-400x141.png 400w" sizes="(max-width: 651px) 100vw, 651px" /></a><p id="caption-attachment-13389" class="wp-caption-text">Running IoTCorePShell.cmd</p></div>
<p>Now let&#8217;s create a workspace now.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">New-IoTWorkspace C:\Workspacefolder oemname arm
(or) new-ws C:\workspacefolder oemname arm</pre>
<div id="attachment_13390" style="width: 661px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/new-ws-command.png"><img decoding="async" aria-describedby="caption-attachment-13390" class="size-full wp-image-13390" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/new-ws-command.png" alt="new-ws command" width="651" height="340" srcset="/wp-content/uploads/2018/11/new-ws-command.png 651w, /wp-content/uploads/2018/11/new-ws-command-300x157.png 300w, /wp-content/uploads/2018/11/new-ws-command-400x209.png 400w" sizes="(max-width: 651px) 100vw, 651px" /></a><p id="caption-attachment-13390" class="wp-caption-text">new-ws command</p></div>
<p>Now we have created a workspace successfully. Please be noted that the BSPPKG_DIR is &#8220;C:\Program Files (x86)\Windows Kits\10\MSPackages\retail\arm\fre&#8221;. I strongly recommend you to check that folder whether you have contents in it or not if there is no content you might haven&#8217;t installed the packages mentioned in the prerequisites.</p>
<h3>Build BSP</h3>
<p>Now it is time to think about the BSP aka Board Support Package. As we already know that we are using Raspberry PI, we can directly download the RPi_BSP.zip file from the <a href="https://github.com/ms-iot/iot-adk-addonkit/releases">GitHub release page</a>. Then you can perform the below commands.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">Import-IoTBSP RPi2 C:\Downloads\RPi_BSP.zip
(or) importbsp RPi2 C:\Downloads\RPi_BSP.zip
buildpkg RPi2</pre>
<p>If everything is right, you should see an output as below.</p>
<div id="attachment_13391" style="width: 663px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/Import-Raspberry-BSP.png"><img decoding="async" aria-describedby="caption-attachment-13391" class="size-full wp-image-13391" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/Import-Raspberry-BSP.png" alt="Import Raspberry BSP" width="653" height="92" srcset="/wp-content/uploads/2018/11/Import-Raspberry-BSP.png 653w, /wp-content/uploads/2018/11/Import-Raspberry-BSP-300x42.png 300w, /wp-content/uploads/2018/11/Import-Raspberry-BSP-400x56.png 400w" sizes="(max-width: 653px) 100vw, 653px" /></a><p id="caption-attachment-13391" class="wp-caption-text">Import Raspberry BSP</p></div>
<h3>Build Packages</h3>
<p>Once you have created the workspace and extracted the BSP, it is time to build all of our packages.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">New-IoTCabPackage All
(or) buildpkg all</pre>
<p>If you miss this step before you go to the next step, you will get an error as follows when you build your image.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">info: Trying to load file 'C:\OEEWorkspace\Build\arm\InputFMs\OEMFMFileList.xml' as a FM file list ... fatal error : Error: Missing package: C:\OEEWorkspace\Build\arm\pkgs\test.OEM.Sample.cab
info: Trying to load file 'C:\OEEWorkspace\Build\arm\InputFMs\RPi2FMFileList.xml' as a FM file list ... fatal error : Error: Missing package: 
</pre>
<p>You will also end up in the similar <a href="https://github.com/ms-iot/iot-adk-addonkit/issues/139">GitHub issue</a>. Trust me, finding the root cause of this issue took me some hours and at the end, I answered my findings here in <a href="https://stackoverflow.com/questions/53414482/info-trying-to-load-file-oemfmfilelist-xml-as-a-fm-file-list-fatal-error/53414483#53414483">StackOverflow</a>.</p>
<div id="attachment_13392" style="width: 436px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/Building-all-the-packages.png"><img decoding="async" aria-describedby="caption-attachment-13392" class="size-full wp-image-13392" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/Building-all-the-packages.png" alt="Building all the packages" width="426" height="385" srcset="/wp-content/uploads/2018/11/Building-all-the-packages.png 426w, /wp-content/uploads/2018/11/Building-all-the-packages-300x271.png 300w, /wp-content/uploads/2018/11/Building-all-the-packages-400x362.png 400w" sizes="(max-width: 426px) 100vw, 426px" /></a><p id="caption-attachment-13392" class="wp-caption-text">Building all the packages</p></div>
<p>Once the build is successful, you should be able to see the cab files in your workspace location, in my case, it is C:\OEE\Build\arm\pkgs.</p>
<h3>Create a Product</h3>
<p>Now let&#8217;s create a new Product, consider this as the device for which we are building an image for. We will be using the BSP we have extracted for this step.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">Add-IoTProduct ProductA RPi2
(or) newproduct MyProductA RPi2</pre>
<p>You will be asked the Manufacturer Name (OEM Name), Family, SKU, BaseboardManufacturer, and BaseboardProduct. You can get the BaseProductName from your Workspace location, in my case C:\OEE\Source-arm\BSP. You can see the sample command here in the preceding image.</p>
<div id="attachment_13393" style="width: 659px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/Creating-a-new-Product.png"><img decoding="async" aria-describedby="caption-attachment-13393" class="size-full wp-image-13393" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/Creating-a-new-Product.png" alt="Creating a new Product" width="649" height="210" srcset="/wp-content/uploads/2018/11/Creating-a-new-Product.png 649w, /wp-content/uploads/2018/11/Creating-a-new-Product-300x97.png 300w, /wp-content/uploads/2018/11/Creating-a-new-Product-400x129.png 400w" sizes="(max-width: 649px) 100vw, 649px" /></a><p id="caption-attachment-13393" class="wp-caption-text">Creating a new Product</p></div>
<p>The command shown in the image will generate a new Product in the Workspace location C:\OEE\Source-arm\Products\OEEIoTCore.</p>
<div id="attachment_13394" style="width: 564px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/Add-IoTProduct-Output.png"><img decoding="async" aria-describedby="caption-attachment-13394" class="size-full wp-image-13394" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/Add-IoTProduct-Output.png" alt="" width="554" height="412" srcset="/wp-content/uploads/2018/11/Add-IoTProduct-Output.png 554w, /wp-content/uploads/2018/11/Add-IoTProduct-Output-300x223.png 300w, /wp-content/uploads/2018/11/Add-IoTProduct-Output-400x297.png 400w" sizes="(max-width: 554px) 100vw, 554px" /></a><p id="caption-attachment-13394" class="wp-caption-text">Add-IoTProduct Output</p></div>
<h3>Build the Image</h3>
<p>We are almost done, let&#8217;s eject all the removable devices from the system and then run the below command.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">New-IoTFFUImage &lt;product name&gt; Test
(or)buildimage &lt;product name&gt; Test</pre>
<p>This command will give you the FFU image with your base image.</p>
<div id="attachment_13396" style="width: 660px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/Building-Image-and-Generate-FFU-File.png"><img decoding="async" aria-describedby="caption-attachment-13396" class="size-full wp-image-13396" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/Building-Image-and-Generate-FFU-File.png" alt="Building Image and Generate FFU File" width="650" height="432" srcset="/wp-content/uploads/2018/11/Building-Image-and-Generate-FFU-File.png 650w, /wp-content/uploads/2018/11/Building-Image-and-Generate-FFU-File-300x199.png 300w, /wp-content/uploads/2018/11/Building-Image-and-Generate-FFU-File-400x266.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-13396" class="wp-caption-text">Building Image and Generate FFU File</p></div>
<p>You can also see the logs in your workspace location in the build folder. The generated FFU image(Flash.ffu) will be available at C:\OEE\Build\arm\OEEIoTCore\Test folder.</p>
<h2>Writing/Flashing the FFU Image to SD Card</h2>
<p>Wow!, now we have a fully functional FFU image and the only thing pending is to write some bat commands to flash it to SD card, you can use the <a href="https://docs.microsoft.com/en-us/windows/iot-core/connect-your-device/dism">DISM</a>. Let&#8217;s create a text file called format.txt and write some commands as preceding.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">select disk 1
clean
create partition primary
select partition 1
active
format fs=fat32 quick
assign
exit
</pre>
<p>As you can see that we are selecting the disk 1, considering the fact that only one removable disk is been connected to your machine.  Then we format the disk. This format.txt file will be used in our bat file write.bat.</p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">echo off
REM Start formatting
diskpart /s format.txt &gt;log.txt

REM Start flashing
dism.exe /Apply-Image /ImageFile:Flash.ffu /ApplyDrive:\\.\PhysicalDrive1 /SkipPlatformCheck /Quiet

ECHO Finish
</pre>
<p>The logs will be added to the file called log.txt. The command ImageFile:Flash.ffu is the place where we assign our FFU image. Now let&#8217;s just go to the folder where these three files are been placed and open a command prompt in administrative power.</p>
<ul>
<li>write.bat</li>
<li>format.txt</li>
<li>flash.ffu</li>
</ul>
<div id="attachment_13399" style="width: 659px" class="wp-caption aligncenter"><a href="https://sibeeshpassion.com/wp-content/uploads/2018/11/Flash-IoT-Core-by-Commands.png"><img decoding="async" aria-describedby="caption-attachment-13399" class="size-full wp-image-13399" src="https://sibeeshpassion.com/wp-content/uploads/2018/11/Flash-IoT-Core-by-Commands.png" alt="Flash IoT Core by Commands" width="649" height="250" srcset="/wp-content/uploads/2018/11/Flash-IoT-Core-by-Commands.png 649w, /wp-content/uploads/2018/11/Flash-IoT-Core-by-Commands-300x116.png 300w, /wp-content/uploads/2018/11/Flash-IoT-Core-by-Commands-400x154.png 400w" sizes="(max-width: 649px) 100vw, 649px" /></a><p id="caption-attachment-13399" class="wp-caption-text">Flash IoT Core by Commands</p></div>
<h2>Connect SD Card to Raspberry PI and then Raspberry PI to the Network</h2>
<p>Now that our OS is flashed and it is time to connect the SD card to the Raspberry PI and connect a monitor, mouse, keyboard, ethernet to the Raspberry PI. You will see the default IoT core application running. You can also check in the device portal using the IoT Dashboard application, if you are not sure how, please read my previous post.</p>
<h2>Conclusion</h2>
<p>Wow!. Now we have learned,</p>
<ul>
<li>how we can generate the IoT core FFU image using PowerShell</li>
<li>how to write the same to an SD card.</li>
</ul>
<p>Is that all? No, in the next article we will learn</p>
<ul>
<li>how we can add our app package to this FFU image which can be used in many Raspberry PI</li>
<li>how to generate the FFU image on demand with some chained PowerShell commands.</li>
<li>how to use other mechanisms to write the FFU image to the disk</li>
</ul>
<h2><span id="your-turn-what-do-you-think">Your turn. What do you think?</span></h2>
<p>Thanks a lot for reading. Did I miss anything that you may think which is needed in this article? Could you find this post as useful? Kindly do not forget to share me your feedback.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/raspberry-pi-sd-card-provisioning-with-windows-10-iot-core-create-ffu-image-and-flash/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
