Untar & Mount disks (and WIFI ?) - Heaven4All/RPI2JAMMA_JUST4FUN GitHub Wiki

Follow me, we are going inside

  • 1/ Unrar the rar

  • 2/ we get the .img . Take a look at the disk structure > fdisk -lu RPI2XXXXX_aje_fr_B13.img

Disk RPI2XXXXX_aje_fr_B13.img: 3.7 GiB, 3965190144 bytes, 7744512 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: 0xa8fe70f4

Device Boot Start End Sectors Size Id Type RPI2XXXXX_aje_fr_B13.img1 8192 93802 85611 41.8M c W95 FAT32 (LBA) RPI2XXXXX_aje_fr_B13.img2 98304 7744511 7646208 3.7G 83 Linux

There is two partitions inside.

  • 3/ What kind of filesystems ? > parted -m RPI2XXXXX_aje_fr_B13.img print

RPI2XXXXX_aje_fr_B13.img:3965MB:file:512:512:msdos::; 1:4194kB:48.0MB:43.8MB:fat32::lba; 2:50.3MB:3965MB:3915MB:ext4::;

The linux file system is an EXT4 one. The other one is a FAT32.

  • 4/ Ok, so mount that to see contents > partx -v -a RPI2XXXXX_aje_fr_B13.img (you must be root for this part :) )

both drives mounted :

/dev/loop0p1 on /media/heaven4all/RPI2XXXXX type vfat (ro,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2

/dev/loop0p2 on /media/heaven4all/rootfs type ext4 (rw,nosuid,nodev,relatime,data=ordered,uhelper=udisks2)

vfat partition

To simplify, you can reckon this partition as the boot one. It contains the Linux Kernel, which is able to launch all the steps to end up with a ready linux system.

There are some interesting files here .

With some options/configuration in this file, you can talk with physical items of Rasp and, very interesting in our case, you can ask GPIO to behave in a particular way.

We will study this file beyond, but first strange thing, wifi and bluetooth are disabled. Raspberry team adds Wifi support since Raspberry 3 (3, 3+, pi Zero W have wifi capabilities), and that's very useful to transfer files (as rom games for example ^^).

So, if you want to enable WIFI (and BT), just comment these two lines :

dtoverlay=pi3-disable-wifi

dtoverlay=pi3-disable-bt

  • The second one is cmdline.txt . As described here : https://www.raspberrypi.org/documentation/configuration/cmdline-txt.md , cmdline.txt is able to send command lines during boot to the kernel ^^ . Thanks to Raspberry team, this operation allows to set the "boot behaviour", including required information to mount the real filesystem partition (the second partition, EXT4 format)

dwc_otg.lpm_enable=0 logo.nologo console= loglevel=2 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait vt.global_cursor_default=0 quiet **fbcon=map:01** splash quiet plymouth.ignore-serial-consoles

This option needs to be studied : fbcon=map:01 ^^ . If you take a look here : https://www.kernel.org/doc/Documentation/fb/fbcon.txt , you will find more information about the "framebuffer console", especially about the capability of this "console" to use a graphical mode to display everything you want with resolution under the classic 640x480 of VGA standard (perhaps a 320×224 , Neo Geo-Neo Geo !)

  • And ... we will take a look on "overlays" directory which is containing dot dtbo , what is a dtbo ?

Ext4 partition

This is the main linux partition with the classics "/root" , "/var/" , "/etc" and ... "/opt" .

/opt/ contains two sub directories :

  • vc : aka VideoCore , includes tvservice and some useful tools to change video display . vcgencmd and tvservice are used by RPI2JAMMA_Change_hdmi_timings.sh to change resolution "on the fly"

  • RPI2JAMMA : contains RetroArch (a frontend for emulators), dot sh with required commands to launch emulators, pictures with an ugly panda (confirm once again that developers are not designers ^^, myself included xD ), emulators