{"id":86,"date":"2011-05-10T13:38:37","date_gmt":"2011-05-10T17:38:37","guid":{"rendered":"http:\/\/ahdesign.us\/blog\/?p=86"},"modified":"2011-05-10T21:22:01","modified_gmt":"2011-05-11T01:22:01","slug":"installing-debian-squeeze-on-the-dockstar","status":"publish","type":"post","link":"https:\/\/ahdesign.us\/blog\/installing-debian-squeeze-on-the-dockstar\/","title":{"rendered":"Installing Debian Squeeze on the Dockstar"},"content":{"rendered":"<p>One of the neatest things about the Dockstar (besides that it&#8217;s a really cheap, embedded Linux box), is that you can install a build of Linux onto a USB stick or MicroSD card and have the Dockstar boot from that.\u00a0 With this full-blown Linux distro, you can essentially make the Dockstar do whatever you want!\u00a0 Plus, installing Debian Squeeze onto the Dockstar is incredibly easy.\u00a0 It does have two prerequisites though, you need to have a new U-Boot installed (see <a href=\"https:\/\/ahdesign.us\/blog\/?p=74\">Dockstar U-Boot Replacement<\/a>) and you need to have a serial header added to the Dockstar (see <a href=\"https:\/\/ahdesign.us\/blog\/?p=76\">Adding a Serial Header to the Dockstar<\/a>) as the whole Debian Squeeze installation is performed via the console (ttyS0).\u00a0 Oh yeah, you also need an ethernet connection that has access to the internet.<!--more--><\/p>\n<p>Grab a 2GB or larger USB stick (or microSD card if the microSD slot mod has been performed) and insert it into the Dockstar.\u00a0 You can get away with a 1GB card, but it&#8217;s barely big enough to fit the base system. Attach the SuperDroid serial cable and set up your terminal for 115200, 8-N-1.<\/p>\n<p>We&#8217;ll be using TFTP for grabbing the boot image (<a href=\"http:\/\/ahdesign.us\/dockstar\/linux\/uImage\">uImage<\/a>) and the ram  disk image (<a href=\"http:\/\/ahdesign.us\/dockstar\/linux\/uInitrd\">uInitrd<\/a>), so you&#8217;ll need to have a TFTP server up and  running.\u00a0 I use Tftpd32 for Windows.\u00a0 Download those images by clinking the links above and save those to the Tftfp32 directory it&#8217;s serving up.\u00a0 Alternatively, you can download newer installer images from a Debian Squeeze mirror in a directory similar to this one: <a href=\"http:\/\/ftp.nl.debian.org\/debian\/dists\/squeeze\/main\/installer-armel\/current\/images\/kirkwood\/netboot\/marvell\/sheevaplug\/\">Debian Squeeze Netboot Images for Marvell Kirkwood SheevaPlug<\/a>.<\/p>\n<p>Now, plug the Dockstar in.\u00a0 U-Boot will display a message on the serial console saying to press a key to interrupt booting, so press a key to stop the normal boot.\u00a0 We just need to set up some environment variables and then start the install.<\/p>\n<p>At the &#8220;Dockstar &gt;&#8221; prompt, type in the following:<\/p>\n<p><code>setenv bootargs 'console=ttyS0,115200n8 base-installer\/initramfs-tools\/driver-policy=most'<br \/>\n<\/code><br \/>\nThat needs to be all on a single line.<\/p>\n<p>Now, type in the following:<br \/>\n<code>setenv mainlineLinux yes<\/code><\/p>\n<p>and<\/p>\n<p><code>setenv arcNumber 2097<\/code><\/p>\n<p>Save everything by typing in<\/p>\n<p><code>saveenv<\/code><\/p>\n<p>Now it&#8217;s time to start the installer.  Setup TFTP booting with the following commands:<br \/>\n<code>setenv ipaddr x.x.x.x<br \/>\nsetenv serverip x.x.x.x<br \/>\ntftpboot 0x800000 uImage<br \/>\ntftpboot 0x1100000 uInitrd<\/code><\/p>\n<p>where the argument for ipaddr is the ipaddress you want to assign to the Dockstar (make sure no other device has the IP address you assign to the Dockstar), serverip is the IP address of the computer tftpd32 is running on, and the other two commands load the linux installer images into RAM.<\/p>\n<p>Once the images are loaded via TFTP, start the installer by typing in<br \/>\n<code>bootm 0x800000 0x1100000<\/code><\/p>\n<p>The installer will detect the USB stick or microSD card and then you can partition it however you like, however, I&#8217;d suggest choosing the &#8220;all files in one place&#8221; option unless you have a much larger card\/stick.  Choosing the default option will create an ext2 boot partition (since U-Boot doesn&#8217;t deal w\/ ext3), an ext3 root partition, and a swap partition.  Most of the installer is automated, but at some point you&#8217;ll need to interact with it.  Depending on the speed of your internet connection and USB stick\/microSD card, the install could take an hour or more.<\/p>\n<p>When the installer is finished, it will ask to reboot.  Allow it to reboot, and then stop U-Boot from booting as the boot command needs to be modified in U-Boot.  U-Boot&#8217;s default boot command is expecting a \/boot folder on the first partition.  However, this is not how the default partitioning sets up the boot image.  The boot image and the ram disk image are both located in the root directory on the 1st partition in the filesystem.<\/p>\n<p>For the USB stick, type in the following to fix the usb_scan variable:<\/p>\n<p><code>setenv usb_scan 'usb_scan_done=0;for scan in $usb_scan_list; do run usb_scan_$scan; if test $usb_scan_done -eq 0 &amp;&amp; ext2load usb $usb 0x800000 \/uImage 1; then usb_scan_done=1; echo \"Found bootable drive on usb $usb\"; setenv usb_device $usb; fi; done'<\/code><\/p>\n<p>That should all be a &#8220;single line&#8221; when pasted into the Dockstar terminal.  Copy\/paste that block of stuff into a text editor to make sure it is all in one, single line.<\/p>\n<p>The next variable we need to fix is the usb_boot variable.  Fix that by typing in the following (again all in one line):<br \/>\n<code>setenv usb_boot 'mw 0x800000 0 1; ext2load usb $usb_device 0x800000 \/uImage; if ext2load usb $usb_device 0x1100000 \/uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi'<\/code><\/p>\n<p>The usb_root variable needs to be modified with the following so that the correct partition is mounted as the root partition:<\/p>\n<p><code>setenv usb_root '\/dev\/sda2'<\/code><\/p>\n<p>And finally, modify the root_fs variable and then save the environment:<\/p>\n<p><code>setenv usb_rootfstype 'ext3'<br \/>\nsaveenv<\/code><\/p>\n<p>Reboot the Dockstar and it should boot into your new Debian Squeeze system!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the neatest things about the Dockstar (besides that it&#8217;s a really cheap, embedded Linux box), is that you can install a build of Linux onto a USB stick or MicroSD card and have the Dockstar boot from that.\u00a0 &hellip; <a href=\"https:\/\/ahdesign.us\/blog\/installing-debian-squeeze-on-the-dockstar\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-86","post","type-post","status-publish","format-standard","hentry","category-wifi-webcam"],"_links":{"self":[{"href":"https:\/\/ahdesign.us\/blog\/wp-json\/wp\/v2\/posts\/86","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ahdesign.us\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ahdesign.us\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ahdesign.us\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ahdesign.us\/blog\/wp-json\/wp\/v2\/comments?post=86"}],"version-history":[{"count":9,"href":"https:\/\/ahdesign.us\/blog\/wp-json\/wp\/v2\/posts\/86\/revisions"}],"predecessor-version":[{"id":96,"href":"https:\/\/ahdesign.us\/blog\/wp-json\/wp\/v2\/posts\/86\/revisions\/96"}],"wp:attachment":[{"href":"https:\/\/ahdesign.us\/blog\/wp-json\/wp\/v2\/media?parent=86"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ahdesign.us\/blog\/wp-json\/wp\/v2\/categories?post=86"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ahdesign.us\/blog\/wp-json\/wp\/v2\/tags?post=86"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}