Jump to content

Samsung Galaxy S Advance (samsung-janice): Difference between revisions

From postmarketOS Wiki
Onny (talk | contribs)
Add mainlne installation instructions
Onny (talk | contribs)
Remove downstream installation instructions
Line 44: Line 44:


Finally, just follow the [[Installation guide]].
Finally, just follow the [[Installation guide]].
=== Boot process ===
Unlike most other Android devices, the samsung-janice can not boot a <code>boot.img</code> (which consists of <code>kernel</code> + <code>initramfs</code>). Instead, the <code>boot.img</code> file is just a regular kernel.
However, it is possible to directly integrate a <code>initramfs</code> into the kernel at kernel compile time (this is totally different from the boot.img approach, if this is unclear to you, please ask in the channel), and this is what the Android ROMs do on the samsung-janice. While it is not a big deal in the Android compilation process, it is a problem for postmarketOS, because we want to be able to build the <code>initramfs</code> independently from the kernel.
The following workaround is currently implemented:
* We flash the ''real'' initramfs to the kernel2 partition (this partition usually contains a backup of the stock kernel)
* The initramfs [https://github.com/postmarketOS/pmbootstrap/blob/master/aports/device/linux-samsung-janice/init init script built into the kernel] checks if the kernel2 partition contains a compressed initramfs, and if it does, it extracts it and passes execution to the real initramfs init script.
* This idea is based on something called [https://forum.xda-developers.com/galaxy-s2/orig-development/isorec-isolated-recovery-galaxy-s2-t3291176 &quot;isorec&quot;].
=== Device partitions ===
The following partitions are used for the postmarketOS:
* Kernel =&gt; /dev/mmcblk0p15 (16MB)
* Kernel2 =&gt; /dev/mmcblk0p17 (16MB)
Possible partitions for the postmarketOS system image:
* SYSTEM =&gt; /dev/mmcblk0p3 (600MB)
* DATAFS =&gt; /dev/mmcblk0p5 (2GB)
=== Flashing with heimdall ===
In order to flash the kernel and the initramfs using <code>heimdall</code> you simply have to call <code>pmbootstrap flasher flash_kernel</code>
This will write in the partitions specified in the [https://github.com/postmarketOS/pmbootstrap/blob/master/aports/device/device-samsung-janice/deviceinfo#L18-L19 deviceinfo] file.
At the moment is not possible to write the system image file (samsung-janice.img) using heimdall. A temporary solution is to use the TWRP shell to perform a command like this:<br />
<code>dd if=samsung-janice.img of=/dev/mmcblk0p5</code>


=== How drebrez made wifi work ===
=== How drebrez made wifi work ===

Revision as of 13:53, 29 January 2022

Samsung Galaxy S Advance
Samsung Galaxy S Advance running Weston demos
Samsung Galaxy S Advance running Weston demos
Manufacturer Samsung
Name Galaxy S Advance
Codename samsung-janice
Released 2012
Hardware
Chipset [[ST-Ericsson NovaThor U8500]]
CPU Dual-core 1.0 GHz Cortex-A9
GPU Mali-400
Display 480x800 AMOLED
Storage 8/16 GB
Memory 768 MB
Architecture armv7
Software
Original software Android 2.3.6 on Linux 2.6.35
postmarketOS
Category testing
Pre-built images no
Mainline yes
Features
Flashing
Works
USB Networking
No data
Internal storage
No data
SD card
No data
Battery
No data
Screen
Works
Touchscreen
Works
Multimedia
3D Acceleration
No data
Audio
No data
Camera
No data
Camera Flash
No data
Connectivity
WiFi
No data
Bluetooth
No data
GPS
No data
NFC
No data
Modem
Calls
No data
SMS
No data
Mobile data
No data
Miscellaneous
FDE
No data
USB OTG
No data
HDMI/DP
No data
Sensors
Accelerometer
No data
Magnetometer
No data
Ambient Light
No data
Proximity
No data
Hall Effect
No data
Haptics
No data
Barometer
No data


Contributors

  • drebrez

Installation

The mainline kernel can only be booted through U-Boot, not directly with the Samsung bootloader. U-Boot is installed as intermediate bootloader on the boot partition, so it does not replace the Samsung bootloader entirely. pmbootstrap can only support one bootloader configuration at the moment, which is why U-Boot is also recommended when installing the downstream kernel.

Boot into Download Mode using Power + Volume Down + Home and follow follow the the NovaThor U8500 U-Boot installation instructions to install U-Boot.

Finally, just follow the Installation guide.

How drebrez made wifi work

  • build the kernel module (dhd.ko for samsung-janice)
  • get the vendor files for the Samsung U8500 devices
  • load the module using insmod with the firmware_path and nvram_path parameters

insmod dhd.ko firmware_path=/etc/wifi/bcmdhd_sta.bin nvram_path=/etc/wifi/nvram_net.txt

  • set a mac address

ifconfig wlan0 hw ether 01:02:03:04:05:06

  • bring the interface up

ifconfig wlan0 up

  • scan to find out what WiFi networks are detected

iw dev wlan0 scan

  • connect to WPA/WPA2 WiFi network

wpa_passphrase wifi_ssid wifi_key >> /etc/wpa_supplicant.conf

  • start wpa_supplicant to connect to the network

wpa_supplicant -B -D wext -i wlan0 -c /etc/wpa_supplicant.conf

  • verify that you are indeed connected to the SSID

iw wlan0 link

  • start udhcpc to get an ip address

udhcpc -b -i wlan0

Links

Photos

Videos