====== Differences ====== This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
os:minibian [2016/06/20 00:15] admin [Setup] |
os:minibian [2016/07/19 04:36] admin [MINIBIAN] |
||
---|---|---|---|
Line 3: | Line 3: | ||
The //standard// OS for the Raspberry Pi certainly is [[https://www.raspbian.org/|Raspbian]], since it is the Foundation’s official supported operating system. | The //standard// OS for the Raspberry Pi certainly is [[https://www.raspbian.org/|Raspbian]], since it is the Foundation’s official supported operating system. | ||
- | Although it allows anyone to get their RasPi up and running in no time and without a hassle, one must not forget that it's also a tool that was developed in a defined philosophy. As stated by [[https://minibianpi.wordpress.com/2013/07/04/minibian-minimal-raspbian-image-for-raspberry-pi/|MINIBIAN's creator Luca Soltoggio]], //**the [Raspberry Pi] project was born primarily to provide a low cost computer in education and in the countries in the developing world**//. This is perfectly fine, and following this logic it's perfectly understandable that since the Jessie version of Raspbian, it boots straight into the desktop GUI (version 3 of GTK+ / LXDE), see [[https://www.raspberrypi.org/blog/raspbian-jessie-is-here/|this raspberry.org article]] which clearly states the //philosophy// that lies behind the Raspbian releases. | + | Although it allows anyone to get their RasPi up and running in no time and without a hassle, one must not forget that it's also a tool that was developed in a defined philosophy. As stated by [[https://minibianpi.wordpress.com/2013/07/04/minibian-minimal-raspbian-image-for-raspberry-pi/|MINIBIAN's creator Luca Soltoggio]]: |
- | What the Pi's project founders probably didn't imagine is the fact that their creation would also become **a perfect tool for many makers across the world**, who would be able to use it as a powerful, flexible and low cost **embedded system**. | + | > the [Raspberry Pi] project was born primarily to provide a low cost computer in education and in the countries in the developing world. |
+ | |||
+ | This is perfectly fine, and following this logic it's perfectly understandable that since the Jessie version of Raspbian, it boots straight into the desktop GUI (version 3 of GTK+ / LXDE), see [[https://www.raspberrypi.org/blog/raspbian-jessie-is-here/|this raspberry.org article]] which clearly states the //philosophy// that lies behind the Raspbian releases. | ||
+ | |||
+ | What the Pi's project founders probably didn't imagine is the fact that their creation would also become | ||
+ | > a perfect tool for many makers across the world, who would be able to use it as a powerful, flexible and low cost **embedded system**. | ||
And there lies an enormous difference in expectations! | And there lies an enormous difference in expectations! | ||
Line 71: | Line 76: | ||
</Code> | </Code> | ||
- | In this case our target will be ''/dev/mmcblk0''. Now we make sure all its partitions are unmounted and copy our image file to the SD Card: | + | In this case our target will be ''/dev/mmcblk0''. Now we make sure all its partitions are unmounted and copy our image file to the SD Card (in this case, monitoring the dd progress through ''pv''): |
- | <Code:bash> | + | <Code:bash |Copy the img file to the SD Card> |
> sudo umount /dev/mmcblk0p1 /dev/mmcblk0p2 /dev/mmcblk0p5 /dev/mmcblk0p6 /dev/mmcblk0p7 | > sudo umount /dev/mmcblk0p1 /dev/mmcblk0p2 /dev/mmcblk0p5 /dev/mmcblk0p6 /dev/mmcblk0p7 | ||
- | > dd bs=4M if=yyyy-mm-dd-jessie-minibian.img of=/dev/mmcblk0 | + | > sudo dd bs=4M if=yyyy-mm-dd-jessie-minibian.img | pv | dd of=/dev/mmcblk0 |
+ | 198+1 records in[3.95MiB/s] [ <=> ] | ||
+ | 198+1 records out | ||
+ | 832569344 bytes (833 MB) copied, 356.034 s, 2.3 MB/s | ||
+ | 794MiB 0:05:56 [2.23MiB/s] [ <=> ] | ||
+ | 1626112+0 records in | ||
+ | 1626112+0 records out | ||
+ | 832569344 bytes (833 MB) copied, 359.634 s, 2.3 MB/s | ||
</Code> | </Code> | ||
+ | |||
+ | Note: remove the ''| pv |'' pipe part of the code if you don't wish to monitor the dd progress. | ||
+ | |||
+ | Finally, let's safely eject the card using ''sync'' to ensure the write cache is flushed and that it is safe to unmount the SD card: | ||
+ | <Code:bash |Safely eject the SD Card> | ||
+ | > sudo sync | ||
+ | </Code> | ||
+ | |||
+ | ===== Resize the SD Partition ===== | ||
+ | |||
+ | To use the full space available on the SD card, we'll need to extend the initial Minibian partition size, this operation is detailed on [[https://minibianpi.wordpress.com/how-to/resize-sd/|the following page of the Minibian website]] | ||
+ | |||
+ | <Code:bash |Using fdisk to resize the SD partition size:> | ||
+ | > sudo fdisk /dev/mmcblk0 | ||
+ | Welcome to fdisk (util-linux 2.25.2). | ||
+ | Changes will remain in memory only, until you decide to write them. | ||
+ | Be careful before using the write command. | ||
+ | |||
+ | |||
+ | Command (m for help): p | ||
+ | Disk /dev/mmcblk0: 14.7 GiB, 15716057088 bytes, 30695424 sectors | ||
+ | Units: sectors of 1 * 512 = 512 bytes | ||
+ | Sector size (logical/physical): 512 bytes / 512 bytes | ||
+ | I/O size (minimum/optimal): 512 bytes / 512 bytes | ||
+ | Disklabel type: dos | ||
+ | Disk identifier: 0x00000000 | ||
+ | |||
+ | Device Boot Start End Sectors Size Id Type | ||
+ | /dev/mmcblk0p1 16 125055 125040 61.1M b W95 FAT32 | ||
+ | /dev/mmcblk0p2 125056 1626111 1501056 733M 83 Linux | ||
+ | |||
+ | |||
+ | Command (m for help): d | ||
+ | Partition number (1,2, default 2): 2 | ||
+ | |||
+ | Partition 2 has been deleted. | ||
+ | |||
+ | Command (m for help): n | ||
+ | Partition type | ||
+ | p primary (1 primary, 0 extended, 3 free) | ||
+ | e extended (container for logical partitions) | ||
+ | Select (default p): p | ||
+ | Partition number (2-4, default 2): 2 | ||
+ | First sector (125056-30695423, default 126976): 125056 | ||
+ | Last sector, +sectors or +size{K,M,G,T,P} (125056-30695423, default 30695423): 30695423 | ||
+ | |||
+ | Created a new partition 2 of type 'Linux' and of size 14.6 GiB. | ||
+ | |||
+ | Command (m for help): w | ||
+ | The partition table has been altered. | ||
+ | Calling ioctl() to re-read partition table. | ||
+ | Syncing disks. | ||
+ | </Code> | ||
+ | |||
+ | To complete the operation, we still have to effectively enlarge the file system for it to take up he available complementary partition space: | ||
+ | |||
+ | <Code:bash |Enlarge the File System to the full partition size:> | ||
+ | > sudo e2fsck -f /dev/mmcblk0p2 | ||
+ | e2fsck 1.42.12 (29-Aug-2014) | ||
+ | Pass 1: Checking inodes, blocks, and sizes | ||
+ | Pass 2: Checking directory structure | ||
+ | Pass 3: Checking directory connectivity | ||
+ | Pass 4: Checking reference counts | ||
+ | Pass 5: Checking group summary information | ||
+ | /dev/mmcblk0p2: 15631/46944 files (0.2% non-contiguous), 120088/187512 blocks | ||
+ | |||
+ | > sudo resize2fs /dev/mmcblk0p2 | ||
+ | resize2fs 1.42.12 (29-Aug-2014) | ||
+ | Resizing the filesystem on /dev/mmcblk0p2 to 3821296 (4k) blocks. | ||
+ | The filesystem on /dev/mmcblk0p2 is now 3821296 (4k) blocks long. | ||
+ | </Code> | ||
+ | |||
+ | ===== Startup Your RasPi ===== | ||
+ | Insert the SD Card in the RasPi and power it... | ||
+ | |||
+ | If you're using a model 3 Pi, you might experience an error reported at startup looking like: | ||
+ | <Code:bash |Startup log error:> | ||
+ | cfg80211: Calling CRDA to update world regulatory domain | ||
+ | ... | ||
+ | cfg80211: Exceeded CRDA call max attempts. Not calling CRDA. | ||
+ | </Code> | ||
+ | |||
+ | This seems to be because the CRDA package is not installed by default, installing the following seems to fix this: | ||
+ | <Code:bash |Install crda & wireless packages> | ||
+ | > apt-get install crda iw wireless-regdb | ||
+ | > reboot | ||
+ | </Code> | ||
+ | |||
+ | === Transfer your SSH public key === | ||
+ | |||
+ | Now is a good time to transfer your ''~/.ssh/id_rsa.pub'' key to the RasPi so you'll be able to SSH in without having to enter a password every time, from your workstation type: | ||
+ | <Code:bash |Transfer your SSH public key:> | ||
+ | > ssh-copy-id root@you.mini.bian.ip | ||
+ | </Code> | ||
+ | |||
+ | The IP of your installation is displayed in red during the boot sequence. | ||
+ | |||
+ | ===== WiFi ===== | ||
+ | |||
+ | **NOTE**: the following is based on RasPi 3 model experimentation, you might need to install some specific packages for your hardware. | ||
+ | In order to enable Wifi and Bluetooth on the new Raspberry Pi 3, one need to install some complementary packages as follow: | ||
+ | |||
+ | <Code:bash |Install WiFi & Bluetooth packages:> | ||
+ | > apt-get update | ||
+ | > apt-get install firmware-brcm80211 pi-bluetooth wpasupplicant wireless-tools | ||
+ | </Code> | ||
+ | |||
+ | To configure and use the WiFi network, you can scan for available SSIDs using: | ||
+ | <Code:bash |Scan available WiFi networks> | ||
+ | > iwlist scan | ||
+ | Cell 02 - Address: 30:91:8F:15:C7:F7 | ||
+ | Channel:8 | ||
+ | Frequency:2.447 GHz (Channel 8) | ||
+ | Quality=36/70 Signal level=-74 dBm | ||
+ | Encryption key:on | ||
+ | ESSID:"My-WiFi-SSID" | ||
+ | Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s | ||
+ | 24 Mb/s; 36 Mb/s; 54 Mb/s | ||
+ | Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 48 Mb/s | ||
+ | Mode:Master | ||
+ | Extra:tsf=0000000000000000 | ||
+ | Extra: Last beacon: 70ms ago | ||
+ | IE: Unknown: 0007444D5F62626F78 | ||
+ | IE: Unknown: 010882848B962430486C | ||
+ | IE: Unknown: 030108 | ||
+ | IE: Unknown: 2A0100 | ||
+ | IE: Unknown: 2F0100 | ||
+ | IE: IEEE 802.11i/WPA2 Version 1 | ||
+ | Group Cipher : CCMP | ||
+ | Pairwise Ciphers (1) : CCMP | ||
+ | Authentication Suites (1) : PSK | ||
+ | IE: Unknown: 32040C121860 | ||
+ | IE: Unknown: 2D1A1C1......000000 | ||
+ | IE: Unknown: 3D16080......000000 | ||
+ | IE: Unknown: 7F08040......0000040 | ||
+ | IE: Unknown: DDAB005......000120 | ||
+ | IE: Unknown: DD09001......0C0000 | ||
+ | IE: Unknown: DD18005......322F00 | ||
+ | </Code> | ||
+ | |||
+ | You still need to modify 2 files: | ||
+ | |||
+ | <Code:bash |/etc/network/interfaces> | ||
+ | > nano /etc/network/interfaces | ||
+ | </Code> | ||
+ | <Code:bash |/etc/network/interfaces> | ||
+ | ... | ||
+ | |||
+ | allow-hotplug wlan0 | ||
+ | iface wlan0 inet manual | ||
+ | wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf | ||
+ | </Code> | ||
+ | |||
+ | <Code:bash |/etc/wpa_supplicant/wpa_supplicant.conf> | ||
+ | > nano /etc/wpa_supplicant/wpa_supplicant.conf | ||
+ | </Code> | ||
+ | <Code:bash linenums:1|/etc/wpa_supplicant/wpa_supplicant.conf> | ||
+ | network={ | ||
+ | ssid="YourSSID" | ||
+ | psk="YourPassword" | ||
+ | } | ||
+ | </Code> | ||
+ | |||
+ | Here, we use the ''manual'' setting with ''wpa-roam'', this [[http://raspberrypi.stackexchange.com/questions/9257/whats-the-difference-between-wpa-roam-and-wpa-conf-in-the-etc-network-inte|stackexchange thread]] seems to imply that this configuration should suspend the WiFi when the Ethernet cable is plugged and vice-versa. | ||
+ | On the contrary, using ''manual'' with ''wpa-roam'', (this hasn't been tested by myself). | ||
+ | |||
+ | Nevertheless, using the above settings had **both WiFi and Ethernet** activated at the same time. | ||
+ | There is more to learn in this article about [[http://manual.aptosid.com/en/inet-setup-en.htm|Setting up for WiFi Roaming with wpa]]. | ||
+ | ===== Bluetooth ===== |