logo

blog

My cute blog can’t be this disorganised!

Open-Source Software and Hardware Laptop.shtml (7300B)


      1 <!DOCTYPE html>
      2 <html>
      3 	<head>
      4 <!--#include file="/templates/head.shtml" -->
      5 		<title>Open-Source Software and Hardware Laptop — lanodan’s cyber-home</title>
      6 	</head>
      7 	<body>
      8 <!--#include file="/templates/en/nav.shtml" -->
      9 	<main>
     10 		<h1>Open-Source Software and Hardware Laptop</h1>
     11 		<p>I was looking at the <a href="http://www.kosagi.com/w/index.php?title=Novena_Main_Page">novena</a> (OSHW too), little bit too powerful for me now (maybe nice later). Also kind of too much exotic looking(I want to use my laptop everywhere). Some people have come with olimex stuff at the hackerspace(a LIME/LIME2 I think). And when my recycled laptop from 2003/2005 became really slow(469 MB of RAM, nearly no 3D video at least FullHD strangely worked). I started making plans on doing my own laptop with parts from Olimex(I can’t thanks them enough ;3). I ordered some parts. Seen a laptop project on olimex’s blog</p>
     12 		<h2 id="parts">Parts</h2>
     13 		<p>Here is the parts I’ve used :</p>
     14 		<ul>
     15 			<li>Laptop case(used another one’s case)</li>
     16 			<li>OLIMEX</ul>
     17 				<li>A20-OLinuXino-LIME2-4G</li>
     18 				<li>A20-OLinuXino-LIME2-UEXT</li>
     19 				<li>SATA-CABLE-SET (data is too short of few cm for me, used spare one)</li>
     20 				<li>MOD-RTC</li>
     21 				<li>MOD-SDMMC (provides a CA-IDC-10-15CM)</li>
     22 				<li>PWR-CABLE(used it for making a USB power cable)</li>
     23 				<li>CABLE-40-40-10CM [×2](A20-OLinuXino-LIME2-UEXT &amp; LCD-OLinuXino-15.6FHD)</li>
     24 				<li>CA-IDC-10-15CM (used for MOD-RTC)</li>
     25 				<li>BA-LIPO-3.7V/6600mAh-W-CA [×2] one last about ~5h with everything at full (mainly compilation stuff) and my power-hungry HDD</li>
     26 				<li>USB-SERIAL-F (very usefull for u-boot and having a shell)</li>
     27 				<li>UEXTx5 (not in use for now)</li>
     28 			</ul></li>
     29 			<li>old VGA connector(desoldered one from bulkeps, H_SYNC and V_SYNC have to be taken from LCD_CON or hacked)</li>
     30 		</ul>
     31 		<h2 id="building">Building</h2>
     32 		<p><span class="warn">⚠ This doesn’t works ⚠</span> I take a working one from <a href="http://www.armbian.com/olimex-lime-2/">armbian images</a>, anyway, you need:</p>
     33 		<ul>
     34 			<li>Brain, with linux knowledge (Your machine probably doesn’t have one, use your own)</li>
     35 			<li>An A20-OLinuXino (or other board with an allwinner CPU, I use LIME2-4G)</li>
     36 			<li>(recommended) Serial/UART adapter</li>
     37 		</ul>
     38 		<h3>sunxi u-boot & kernel</h3>
     39 		<p>I use gentoo so I only have to make u-boot, kernel, put armv7a /armhf stage3. I mainly follow olimex A20-build(found upper).</p>
     40 		<pre><code>$ export ARCH=arm
     41 $ export CROSS_COMPILE=arm-linux-gnueabihf-</code></pre>
     42 		<h4>u-boot</h4>
     43 		<code>$ git clone -b sunxi https://github.com/linux-sunxi/u-boot-sunxi.git ; cd u-boot-sunxi</code>
     44 		<p>If you have a LIME2 board : <code>$ make A20-OLinuXino_Lime2_config</code> otherwise type <code>$ make help</code> and hope to find your board in a _config target.</p>
     45 		<code>$ make</code> Tip: add <code>-j6</code> if you have 4 cores, <code>-j3</code> if dual. Note: u-boot.bin for flash is u-boot-sunxi-with-spl.bin
     46 		<h4>Kernel</h4>
     47 		<pre><code>$ export INSTALL_MOD_PATH=out
     48 $ git clone https://github.com/linux-sunxi/linux-sunxi ; cd linux-sunxi
     49 $ wget https://raw.githubusercontent.com/OLIMEX/OLINUXINO/master/SOFTWARE/A20/A20-build/spi-sun7i.c -O drivers/spi/spi-sun7i.c
     50 $ wget https://raw.githubusercontent.com/OLIMEX/OLINUXINO/master/SOFTWARE/A20/A20-build/SPI.patch
     51 $ patch -p0 < SPI.patch
     52 $ wget https://raw.githubusercontent.com/OLIMEX/OLINUXINO/master/SOFTWARE/A20/A20-build/a20_olimex_defconfig -O arch/arm/configs/a20_olimex_defconfig
     53 $ make a20_olimex_defconfig
     54 </code></pre>
     55 		<p>If you want to configure it more: <code>$ make menuconfig</code></p>
     56 		<pre><code>$ make uImage modules
     57 $ make modules_install</code></pre>
     58 		<quote>“The uImage file is located in arch/arm/boot/<br\>
     59 		The kernel modules are located in out/lib/modules/$kernel_version”</quote> — <cite>Olimex</cite>
     60 		<h3>Mainline u-boot & kernel</h3>
     61 		<quote>“(this needs to be written)”</quote> — <cite>netstat(8)</cite>
     62 		<h3>Gentoo rootfs</h3>
     63 		<h4>Partitions</h4>
     64 		<p>Insert your storage device and use <code>dmesg</code> or <code>lsblk</code> to have the <code>/dev/sd*</code> or <code>/dev/mmcblk*</code> it will be noted as <code>/dev/sd×</code> and enter as ⮠(you may need to fix your font) for one-liners</p>
     65 		<code># fdisk /dev/sd×</code></pre>
     66 		<ol>
     67 			<li>If you have partitions on it, you can delete them with <code>d</code> and then partition number</li>
     68 			<li>Create the /boot (I recommend using 16M or greater): <code>n⮠p⮠1⮠⮠+16M⮠</code></li>
     69 			<li>Put the bootable flag(apparently not mandatory): <code>a</code></li>
     70 			<li>Create the / (I generaly use everything or about 4~&gt;16G if I got a big device): <code>n⮠p⮠2⮠⮠⮠</code></li>
     71 			<li>Verify everything is okay with <code>p</code></li>
     72 			<li><code>w</code> to write.</li>
     73 		</ol>
     74 		<code># mkfs.vfat /dev/sd×1</code> Gentoo package for it <code>dosfstools</code>
     75 		<code># mkfs.ext4 /dev/sd×2</code>
     76 		<h4>Time to flash !</h4>
     77 		<code>dd if=u-boot.bin of=/dev/sd× bs=1024 seek=8</code><p>Note: use sd× not sd×1 or sd×2 as it’s before then (which is probably why there is a 2048 space before them)</p>
     78 		<pre><code># mkdir /mnt/sd
     79 # mount /dev/sd×2 /mnt/sd</code></pre>
     80 		<p>Put basic rootfs(/mnt/sd/boot is needed) I take gentoo’s stage3 for armv7hf</p>
     81 		<pre><code># mount /dev/sdX1 /mnt/sd/boot
     82 # cd /mnt/sd/boot
     83 # cp linux-sunxi/arch/arm/boot/uImage .
     84 # wget https://github.com/OLIMEX/OLINUXINO/raw/master/SOFTWARE/A20/A20-build/scripts_a20_Lime2_34_90_camera_rel_2/script.bin
     85 # cd ~/linux-sunxi
     86 # rm -fr /mnt/sd/lib/modules
     87 # cp -rfv out/lib/modules /mnt/sd/lib/
     88 # cp -rfv out/lib/firmware /mnt/sd/lib/
     89 # sync
     90 # umount /mnt/sd/boot
     91 # umount /mnt/sd</code></pre>
     92 		<section id="External_links">
     93 			<h2>External links</h2>
     94 			<ul>
     95 				<li><a href="https://mensuel.framapad.org/p/MakingAnOSHWLaptop">Etherpad</a> (<a href="/p-MakingAnOSHWLaptop">backup</a>)</li>
     96 				<li>GnuSocial :<a href="https://loadaverage.org/tag/MakingAnOSHWLaptop">#MakingAnOSHWLaptop</a></li>
     97 				<li>Sources<ul>
     98 					<li>U-boot<ul>
     99 						<li><a href="//git.denx.de/u-boot.git">Mainline</li>
    100 						<li><a href="https://github.com/linux-sunxi/u-boot-sunxi.git">Sunxi</a></li>
    101 					</ul></li>
    102 					<li>Kernel<ul>
    103 						<li><a href="https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git">Mainline</a></li>
    104 						<li><a href="https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/log/?h=linux-4.1.y">4.1 stable</a></li>
    105 						<li><a href="https://github.com/linux-sunxi/linux-sunxi.git">Sunxi</a></li>
    106 					</ul></li>
    107 				</ul></li>
    108 				<li>Documentation<ul>
    109 					<li><a href="https://linux-sunxi.org/SATA">https://linux-sunxi.org/SATA</a> (to get more performance)</li>
    110 					<li>Olimex<ul>
    111 						<li><a href="https://github.com/OLIMEX/OLINUXINO/tree/master/SOFTWARE/A20/A20-build">Build instruction, scripts and more</a></li>
    112 						<li><a href="https://github.com/OLIMEX/OLINUXINO/tree/master/SOFTWARE/A20/A20-OLinuXino-Micro%20with%20MOD-RTC">C program for MOD-RTC</a></li>
    113 					</ul></li>
    114 					<li><a href="https://wiki.tizen.org/wiki/Sunxi">Tizen</a></li>
    115 				</ul></li>
    116 			</ul>
    117 		</section>
    118 	</main>
    119 <!--#include file="/templates/en/footer.html" -->
    120 	</body>
    121 </html>