P1010179 small.jpgP1010178 small.jpg


I have been following the previous posts from agrahambell   and a lot of google searching and reading (PI and BBB stuff is really helpful) I now have a fully working GNOME desktop including browsers, editors, music players etc. Basically the GNOME install is everything including the kitchen sink.. hence the filling of the card.


This is based on agrahambell image linked at the bottom of his 5 post regarding building the base image for the board, you can find that here:The specified item was not found. it is at the bottom of the post. The patch required to expand the file system is attached to this post. This was kindly provided to me by agrahambell


 

So this is not easy for the none native LINUX person, therefor I decided to document everything I did and post it hear for everyone to see and hopefully add to if necessary.

 

NOTE THIS CAN TAKE MANY HOURS TO COMPLETE, ESP THE GNOME INSTALL... you have been warned

 

  this is the contents below...


  1. Mount a USB stick with the patch to allow live resize
  2. install the patch to allow live file system re-sizing
  3. Increase the size file system on the SD card from 4GB to 8GB
  4. Add a bunch of utilities to help with the install and other stuff
  5. Add a none admin user for doing regular computing
  6. Scan and configure WIFI if needed
  7. Now add a bunch of stuff I think may be useful

  

Mount a USB stick with the patch to allow live resize


Verify card size etc. as you will see there is 3111432 blocks left before we start if you’re using an 8 GB card as it is still seen as a 4 GB

Apt-get update-to get the latest updates.

df

Filesystem 1K-blocks   Used Available Use% Mounted on
rootfs 3526688 236108   3111432   8% /
/dev/root 3526688 236108   3111432   8% /
devtmpfs 507568      0    507568 0% /dev
tmpfs 103180    192    102988 1% /run
tmpfs 5120      0      5120 0% /run/lock
tmpfs 206340      0    206340 0% /run/shm








 

Dmesg - to find the name of the usb stick, it will most lightly be sda1 or sdb1 

[    3.746858] random: nonblocking pool is initialized
[    3.860914] sd 0:0:0:0: [sda] 7823296 512-byte logical blocks: (4.00 GB/3.72 GiB)
[    3.921230] sd 0:0:0:0: [sda] Write Protect is off
[    3.926102] sd 0:0:0:0: [sda] Mode Sense: 03 00 00 00
[    3.981979] sd 0:0:0:0: [sda] No Caching mode page found
[    3.987393] sd 0:0:0:0: [sda] Assuming drive cache: write through
[    4.045787] sda: sda1
[    4.065554] sd 0:0:0:0: [sda] Attached SCSI removable disk1)
[    8.122143] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[    8.130089] rtl8192cu: MAC auto ON okay!
[    8.167112] rtl8192cu: Tx queue select: 0x05
[    8.576005] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   12.107517] fec 2188000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[   12.115210] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready







 

So ours is sda1.

mkdir /mnt/usb

mount /dev/sda1 /mnt/usb


Install the patch to allow live file system re-sizing

Copy mod to kernel to allow resize of partition from selsinork, I put it only a USB Memory Stick, hence the above

date -s "2014-06-11T21:33”

tar xf /mnt/usb/linux-kernel-imx-3.15.0-rc7-armv7l-73.txz -C /

reboot

cat /proc/version

You should see

Linux version 3.15.0-rc7-imx (root@sl3) (gcc version 4.8.2 (GCC) ) #5 SMP Wed Jun 11 19:54:00 UTC 2014


Increase the size file system on the SD card from 4GB to 8GB

Expanding the SD card from 4 – 8Gb because what we want to install wont fit

Expanding actions are based on this link for the BBB and adapted for the riot board, they are fully detailed in this text so you don’t need to go there if you don’t want to.

http://elinux.org/Beagleboard:Expanding_File_System_Partition_On_A_microSD

We need to run fdisk and select the partition /dev/mmcblk0 as this is our working partition

fdisk /dev/mmcblk0

If you type p you should see this


Command (m for help): p
Disk /dev/mmcblk0: 8053 MB, 8053063680 bytes
48 heads, 49 sectors/track, 6687 cylinders, total 15728640 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
Disk identifier: 0x00000000
Device Boot      Start         End Blocks   Id  System
/dev/mmcblk0p1            2048     7167999     3582976   83 Linux
Command (m for help):








As you can see my SD card is 8Gb, the actual value will change between manufacturers etc but you should see similar

 

WARNING – We are about to delete this partition and re-create it, do not re-boot part way through and yes it is safe, I have already done this once but am re-doing it for the sake of documenting this all 

While in fdisk, enter these commands

d -to delete a partition

p  -there should be no partitions now shown

n -for new partition

p -for primary

1 -partition id

         

Select the remaining options as they are presented (Default)

First option is start and should show 2048

Next option is end and may vary depending on the size of your card

You should now be back to the command (m for help): prompt

p- verify we now have a new partition with the new size

 

Disk /dev/mmcblk0: 8053 MB, 8053063680 bytes
17 heads, 32 sectors/track, 28912 cylinders, total 15728640 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

Disk identifier: 0x00000000
  Device Boot      Start         End      Blocks Id  System 
/dev/mmcblk0p1            2048    15728639     7863296   83 Linux
Command (m for help):







 

Compare the highlighted text with the previous version above

w <- to save the changes, you will hopefully get this message

The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.







 

reboot

Now we need to actually re-size the file system, if you run df again you will see nothing has yet changed

resize2fs /dev/mmcblk0p1

This may take a few seconds but at the end you should see

 

resize2fs 1.42.5 (29-Jul-2012)
Filesystem at /dev/mmcblk0p1 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
The filesystem on /dev/mmcblk0p1 is now 1965824 blocks long.








Now running df we will see this… Success.

Filesystem 1K-blocks   Used Available Use% Mounted on
rootfs 7742744 350068   7045888   5% /
/dev/root 7742744 350068   7045888   5% /
devtmpfs 507568      0    507568 0% /dev
tmpfs 103180    192    102988 1% /run
tmpfs 5120      0      5120 0% /run/lock
tmpfs 206340      0    206340 0% /run/shm







 

We have now re-sized the SD card, now hopefully we can install a GUI desktop etc


Add a bunch of utilities to help with the install and other stuff


So to add to the base install, the following things where selected (This takes a while)

- other installs use this for pretty selection screens

apt-get install dialog

apt-get install vim        <- VI text editor

apt-get install sudo       <- us none Linux pros seem to like this to run as admin

apt-get install xorg       <- x windows core

apt-get install gnome  <- the desktop environment including the kitchen sink (2GB)

         

as the gnome install is so slow (Hours), you can fire up another ssh and continue in that for the user creation below


Add a none admin user for doing regular computing

For normal use we need a user that is not the root

useradd -d /home/username -s /bin/bash -c "Name FamilyName" username

mkdir /home/username && chown username /home/username && passwd username

So for example:

 

useradd -d /home/peter -s /bin/bash -c "Oakes" peter
mkdir /home/peter && chown peter /home/peter && passwd peter








It will prompt for a password at the last command, you will need to enter it twice

You can do this in a separate window (Terminal Session) to the one installing gnome as you will have plenty of time, you can then also try to log in with your new credentials.


Scan and configure WIFI if needed

iwlist wlan0 scan

if the driver for you wifi is working, you should see a list of wifi access points transmitting in range, including their SIDs, if not then you need to get a driver installed, see agrahambell blogs linked in above


edit and setup etc/wpa_supplicant.conf



network={
             ssid="wifi_name"
             psk="wifi_key"











now bind it all up

wpa_supplicant -B -iwlan0 -c/etc/wpa_supplicant.conf –Dwext

dhclient wlan0 to get IP address


Now add a bunch of stuff I think may be useful

 

apt-get install geany <-- Nice programming UI


mosquito if you want to install MQQT Broker for IOT stuff, instructions here:

 

http://mosquitto.org/

http://mosquitto.org/2013/01/mosquitto-debian-repository/