https://wiki.postmarketos.org/api.php?action=feedcontributions&user=Frozenintegral&feedformat=atompostmarketOS - User contributions [en]2024-03-29T09:33:54ZUser contributionsMediaWiki 1.39.6https://wiki.postmarketos.org/index.php?title=SHIFT_SHIFT6mq_(shift-axolotl)&diff=30210SHIFT SHIFT6mq (shift-axolotl)2022-08-14T18:51:20Z<p>Frozenintegral: Add additional note about which slot should be active when flashing</p>
<hr />
<div>{{Infobox device<br />
| manufacturer = SHIFT<br />
| name = SHIFT6mq<br />
| codename = shift-axolotl<br />
| image = File:SHIFT_SHIFT6mq_axolotl_front_postmarketOS.png<br />
| imagecaption = SHIFT SHIFT6mq (axolotl)<br />
| releaseyear = 2020<br />
| category = community<br />
| originalsoftware = Android 10.0<br />
| chipset = Qualcomm SDM845 Snapdragon 845<br />
| cpu = Octa-core (4x 2.8 GHz Kryo 385 Gold & 4x 1.7 GHz Kryo 385 Silver)<br />
| gpu = Adreno 630<br />
| storage = 128 GB UFS 2.1<br />
| display = 1080 x 2160 AMOLED<br />
| memory = 8 GB<br />
| architecture = aarch64<br />
| status_usbnet = Y<br />
| status_flashing = Y<br />
| status_touch = Y<br />
| status_screen = Y<br />
| status_wifi = Y<br />
| status_xwayland = Y<br />
| status_fde = Y<br />
| status_mainline = Y<br />
| status_battery = Y<br />
| status_3d = Y<br />
| status_accel = N<br />
| status_audio = N<br />
| status_bluetooth = Y<br />
| status_camera = N<br />
| status_gps = N<br />
| status_mobiledata = Y<br />
| status_sms = Y<br />
| status_calls = N<br />
| status = Work in Progress<br />
| status_otg = N<br />
| status_nfc = N<br />
| status_irtx = -<br />
| booting = yes<br />
| pmoskernel = Mainline<br />
<!--<br />
see Unixbench page on wiki<br />
| whet_dhry = 0.0<br />
--><br />
}}<br />
<br />
== Contributors ==<br />
* [[User:Amartinz|Amartinz]]<br />
* [[User:kalube|kalube]]<br />
<br />
== Users owning this device ==<br />
{{Device owners}}<br />
<br />
== Boot modes ==<br />
<br />
By holding various button combinations while booting the device can be made to boot into different modes.<br />
<br />
Unplug from USB, power off the device and press and hold the below buttons to enter the specific boot mode.<br />
<br />
{| class="wikitable" <br />
|-<br />
! Boot mode<br />
! {{Button|Power}}<br />
! {{Button|Up}}<br />
! {{Button|Down}}<br />
|-<br />
| Fastboot<br />
| Y<br />
| Y<br />
| N<br />
|-<br />
| Recovery<br />
| Y<br />
| N<br />
| Y<br />
|-<br />
| EDL<br />
| Y<br />
| Y<br />
| Y<br />
|}<br />
<br />
== Bootloader ==<br />
<br />
=== Unlock bootloader ===<br />
<br />
To unlock the bootloader, you need to allow unlocking it via enabling <code>OEM unlocking</code> within Android.<br />
<br />
# Go to Settings within Android and select <code>About</code><br />
# Tap on <code>Build number</code> seven times to enable developer options<br />
# Go back and select <code>System</code>, <code>Advanced</code> and scroll down to <code>Developer options</code><br />
# Enable <code>Advanced restart</code> and <code>OEM unlocking</code><br />
# Reboot into bootloader by long pressing the power button, selecting <code>Restart</code> and <code>Bootloader</code><br />
<br />
After it has successfully rebooted into <code>Fastboot mode</code>, initiate unlocking the bootloader using <code>fastboot</code>:<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ fastboot flashing unlock<br />
</syntaxhighlight><br />
<br />
Please follow the prompts on the screen to finish unlocking the bootloader.<br />
<br />
{{Warning|This will erase your data, please back up important data before unlocking the bootloader.}}<br />
<br />
=== Customization ===<br />
<br />
==== Custom AVB key ====<br />
<br />
{{Note|This is not fully relevant for postmarketOS, as AVB is currently unsupported, but documented for the future.}}<br />
<br />
The bootloader has support for setting an user provided AVB key to allow relocking the bootloader if an OS with proper support is flashed.<br />
<br />
This is realized with exposing a virtual partition <code>avb_custom_key</code> where the custom user key can be flashed to:<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ fastboot flash avb_custom_key avb_key.bin<br />
</syntaxhighlight><br />
<br />
For more information please refer to the commit <code>[https://gitlab.com/SHIFTPHONES/android/bootable/bootloader/edk2/-/commit/543b389202d098ac2f6146016627716f8ee6f076 FastbootCmds: oem device-info: check if user public key is set]</code>.<br />
<br />
==== Mainline support ====<br />
<br />
Bootloaders since version <code>202205227</code> support additional <code>fastboot oem</code> commands to enable certain Quality of Life improvements when running mainline.<br />
<br />
For example this will [https://gitlab.com/SHIFTPHONES/android/bootable/bootloader/edk2/-/commit/11937513dcf6015cb0fa7211e79f64f3e897f751 ignore the slot retry count], until we have userspace support for marking bootup attempts as successful.<br />
<br />
To enable mainline support:<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ fastboot oem enable-mainline-support<br />
</syntaxhighlight><br />
<br />
To disable mainline support:<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ fastboot oem disable-mainline-support<br />
</syntaxhighlight><br />
<br />
To check the current status of mainline support:<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ fastboot oem device-info<br />
(bootloader) Mainline support enabled: true/false<br />
</syntaxhighlight><br />
<br />
== Fastbootd ==<br />
[https://source.android.com/devices/bootloader/fastbootd?hl=en Fastbootd] is a userspace implementation of Fastboot.<br />
For axolotl it is located within the recovery.<br />
<br />
To access it, you can boot the recovery and select a menu option to enter fastbootd mode.<br />
Optionally you can also enter it via ADB and Fastboot:<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ # Enter fastbootd via adb<br />
$ adb reboot fastboot<br />
$ # Enter fastbootd via fastboot<br />
$ fastboot reboot fastboot<br />
</syntaxhighlight><br />
<br />
You can only access dynamic partitions within fastbootd.<br />
<br />
{{Note|As fastbootd lives within the recovery, you need a valid recovery image installed in the currently active slot to access it.}}<br />
<br />
== Installation ==<br />
Follow the [[installation guide]]'s "Initialization" section, using <code>shift</code> as the vendor and <code>axolotl</code> as the codename but stop before following flashing instructions, as these are different for axolotl.<br />
<br />
There are currently different ways to install postmarketOS (<b>only select one</b>).<br />
<br />
=== Installation on userdata partition ===<br />
<br />
Installation on userdata is the most generic and universally supported way, however it does not allow for dual boot or utilizing the full flash storage of the device.<br />
<br />
Reboot into <code>Fastboot mode</code> and install postmarketOS:<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ # Flash rootfs to userdata partition<br />
$ pmbootstrap flasher flash_rootfs --partition userdata<br />
$ # Flash kernel to boot<br />
$ pmbootstrap flasher flash_kernel<br />
$ # Erase dtbo partition, as it conflicts with our mainline kernel<br />
$ # Note: this operation takes some time to complete<br />
$ fastboot erase dtbo<br />
$ # Reboot into postmarketOS<br />
$ fastboot reboot<br />
</syntaxhighlight><br />
<br />
{{Note|fastboot can sometimes misbehave, if any of the fastboot commands fail you should run <code>fastboot reboot bootloader</code> (or reboot manually using the interface on the device) and then repeat the failed command.}}<br />
<br />
=== Installation on super partition ===<br />
<br />
{{Warning|This is currently work in progress and actively worked on.}}<br />
<br />
First select a slot (<code>a</code> or <code>b</code>) you want to install postmarketOS on.<br />
<br />
{{Note|This guide assumes you want to install onto the <code>a</code> slot. Replace <code>a</code> with <code>b</code> depending on the slot you want to install on.}}<br />
<br />
To install on <code>super</code> partition, a valid recovery with proper <code>fastbootd</code> implementation needs to be installed into the slot, which you want to install postmarketOS on.<br />
You can download the [https://gitlab.com/SHIFTPHONES/ubports/assets/-/blob/main/axolotl/images/recovery_stock.img stock recovery image], provided by the manufacturer and install it within <code>Fastboot mode</code>:<br />
<br />
{{Note|You can select the slot to install on via appending <code>_SLOT</code> to the partition name (for example <code>boot_a</code>, <code>boot_b</code>, ...).}}<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ # Install recovery in "a" slot<br />
$ fastboot flash recovery_a recovery_stock.img<br />
</syntaxhighlight><br />
<br />
Enter <code>Fastbootd</code> and ensure it is working as expected:<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ # Set "a" as active slot and reboot to fastbootd<br />
$ fastboot --set-active=a<br />
$ fastboot reboot fastboot<br />
$ # Verify current slot is "a"<br />
$ fastboot getvar current-slot<br />
</syntaxhighlight><br />
<br />
After you verified <code>fastbootd</code> works in the slot you have selected, you can install postmarketOS:<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ # Flash rootfs to system_a partition<br />
$ pmbootstrap flasher flash_rootfs --partition system_a<br />
$ # Flash kernel to boot<br />
$ pmbootstrap flasher flash_kernel --partition boot_a<br />
$ # Reboot to bootloader, as erasing dtbo is not working in fastbootd<br />
$ fastboot reboot bootloader<br />
$ # Erase dtbo_a partition, as it conflicts with our mainline kernel<br />
$ # Note: this operation takes some time to complete<br />
$ fastboot erase dtbo_a<br />
$ # Reboot into postmarketOS<br />
$ fastboot reboot<br />
</syntaxhighlight><br />
<br />
The phone will now always boot into postmarketOS until you switch slots with fastboot again:<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ fastboot --set-active=b<br />
</syntaxhighlight><br />
<br />
{{Note|If you are unable to boot into your former OS after installing postmarketOS and then switching back to the previous slot, you may have to re-flash the image (e.g. from [https://downloads.shiftphones.com/axolotl here]) by booting to recovery and sideloading via adb. Keep in mind that you must have slot <code>a</code> active to flash the image to slot <code>b</code>.}}<br />
<br />
== Partition map ==<br />
<br />
<br />
1|axolotl:/ # blkid<br />
/dev/block/zram0: UUID="663a3d49-89cc-4d71-8c4c-9ad121939171" TYPE="swap" <br />
/dev/block/sda2: UUID="e31914f5-d01b-4e08-97bd-d8e0f406764d" TYPE="ext4" <br />
/dev/block/sda8: UUID="91f68f2a-3821-47bf-8d9d-7d705b2d5ab0" TYPE="ext4" <br />
/dev/block/sda9: UUID="d5b3f5fa-dbd4-4cc5-9b9d-8550ad9c74a7" TYPE="f2fs" <br />
/dev/block/sde4: SEC_TYPE="msdos" UUID="00BC-614E" TYPE="vfat" <br />
/dev/block/sde5: SEC_TYPE="msdos" UUID="00BC-614E" TYPE="vfat" <br />
/dev/block/sde9: LABEL="dsp" UUID="af32c008-2a39-7e5b-a5dc-201456d93103" TYPE="ext4" <br />
/dev/block/sde26: SEC_TYPE="msdos" UUID="00BC-614E" TYPE="vfat" <br />
/dev/block/sde27: SEC_TYPE="msdos" UUID="00BC-614E" TYPE="vfat" <br />
/dev/block/sde31: LABEL="dsp" UUID="af32c008-2a39-7e5b-a5dc-201456d93103" TYPE="ext4" <br />
/dev/block/sde54: SEC_TYPE="msdos" LABEL="LOGFS" UUID="D273-55EA" TYPE="vfat" <br />
<br />
<br />
axolotl:/ # df -h <br />
Filesystem Size Used Avail Use% Mounted on<br />
tmpfs 3.7G 1.5M 3.7G 1% /dev<br />
tmpfs 3.7G 0 3.7G 0% /mnt<br />
/dev/block/sda8 11M 160K 11M 2% /metadata<br />
/dev/block/dm-1 1.2G 849M 476M 65% /<br />
/dev/block/dm-2 971M 489M 482M 51% /system_ext<br />
/dev/block/dm-0 1.8G 378M 1.4G 21% /product<br />
/dev/block/dm-3 732M 482M 250M 66% /vendor<br />
tmpfs 3.7G 8.0K 3.7G 1% /apex<br />
tmpfs 3.7G 524K 3.7G 1% /linkerconfig<br />
/dev/block/sda2 27M 0.9M 26M 4% /mnt/vendor/persist<br />
/dev/block/sde5 64M 704K 63M 2% /vendor/bt_firmware<br />
/dev/block/sde4 120M 115M 5.0M 96% /vendor/firmware_mnt<br />
/dev/block/sde9 27M 24M 3.1M 89% /vendor/dsp<br />
/dev/block/dm-8 101G 1.7G 100G 2% /data<br />
tmpfs 3.7G 0 3.7G 0% /data_mirror<br />
/data/media 101G 1.7G 100G 2% /mnt/runtime/default/emulated<br />
/dev/fuse 101G 1.7G 100G 2% /mnt/user/0/emulated<br />
<br />
<br />
<br />
== See also ==<br />
* {{MR|2703|pmaports}} Initial merge request<br />
* {{MR|2738|pmaports}} Mainline bringup<br />
* {{Device package|shift-axolotl|community}}<br />
* {{Kernel package|postmarketos-qcom-sdm845|community}}<br />
* [https://gitlab.com/SHIFTPHONES/android/bootable/bootloader/edk2 OEM bootloader (edk2) sources]</div>Frozenintegralhttps://wiki.postmarketos.org/index.php?title=SHIFT_SHIFT6mq_(shift-axolotl)&diff=30209SHIFT SHIFT6mq (shift-axolotl)2022-08-14T18:47:34Z<p>Frozenintegral: Add note about potential need to re-flash in dual-boot scenario (I needed to do this)</p>
<hr />
<div>{{Infobox device<br />
| manufacturer = SHIFT<br />
| name = SHIFT6mq<br />
| codename = shift-axolotl<br />
| image = File:SHIFT_SHIFT6mq_axolotl_front_postmarketOS.png<br />
| imagecaption = SHIFT SHIFT6mq (axolotl)<br />
| releaseyear = 2020<br />
| category = community<br />
| originalsoftware = Android 10.0<br />
| chipset = Qualcomm SDM845 Snapdragon 845<br />
| cpu = Octa-core (4x 2.8 GHz Kryo 385 Gold & 4x 1.7 GHz Kryo 385 Silver)<br />
| gpu = Adreno 630<br />
| storage = 128 GB UFS 2.1<br />
| display = 1080 x 2160 AMOLED<br />
| memory = 8 GB<br />
| architecture = aarch64<br />
| status_usbnet = Y<br />
| status_flashing = Y<br />
| status_touch = Y<br />
| status_screen = Y<br />
| status_wifi = Y<br />
| status_xwayland = Y<br />
| status_fde = Y<br />
| status_mainline = Y<br />
| status_battery = Y<br />
| status_3d = Y<br />
| status_accel = N<br />
| status_audio = N<br />
| status_bluetooth = Y<br />
| status_camera = N<br />
| status_gps = N<br />
| status_mobiledata = Y<br />
| status_sms = Y<br />
| status_calls = N<br />
| status = Work in Progress<br />
| status_otg = N<br />
| status_nfc = N<br />
| status_irtx = -<br />
| booting = yes<br />
| pmoskernel = Mainline<br />
<!--<br />
see Unixbench page on wiki<br />
| whet_dhry = 0.0<br />
--><br />
}}<br />
<br />
== Contributors ==<br />
* [[User:Amartinz|Amartinz]]<br />
* [[User:kalube|kalube]]<br />
<br />
== Users owning this device ==<br />
{{Device owners}}<br />
<br />
== Boot modes ==<br />
<br />
By holding various button combinations while booting the device can be made to boot into different modes.<br />
<br />
Unplug from USB, power off the device and press and hold the below buttons to enter the specific boot mode.<br />
<br />
{| class="wikitable" <br />
|-<br />
! Boot mode<br />
! {{Button|Power}}<br />
! {{Button|Up}}<br />
! {{Button|Down}}<br />
|-<br />
| Fastboot<br />
| Y<br />
| Y<br />
| N<br />
|-<br />
| Recovery<br />
| Y<br />
| N<br />
| Y<br />
|-<br />
| EDL<br />
| Y<br />
| Y<br />
| Y<br />
|}<br />
<br />
== Bootloader ==<br />
<br />
=== Unlock bootloader ===<br />
<br />
To unlock the bootloader, you need to allow unlocking it via enabling <code>OEM unlocking</code> within Android.<br />
<br />
# Go to Settings within Android and select <code>About</code><br />
# Tap on <code>Build number</code> seven times to enable developer options<br />
# Go back and select <code>System</code>, <code>Advanced</code> and scroll down to <code>Developer options</code><br />
# Enable <code>Advanced restart</code> and <code>OEM unlocking</code><br />
# Reboot into bootloader by long pressing the power button, selecting <code>Restart</code> and <code>Bootloader</code><br />
<br />
After it has successfully rebooted into <code>Fastboot mode</code>, initiate unlocking the bootloader using <code>fastboot</code>:<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ fastboot flashing unlock<br />
</syntaxhighlight><br />
<br />
Please follow the prompts on the screen to finish unlocking the bootloader.<br />
<br />
{{Warning|This will erase your data, please back up important data before unlocking the bootloader.}}<br />
<br />
=== Customization ===<br />
<br />
==== Custom AVB key ====<br />
<br />
{{Note|This is not fully relevant for postmarketOS, as AVB is currently unsupported, but documented for the future.}}<br />
<br />
The bootloader has support for setting an user provided AVB key to allow relocking the bootloader if an OS with proper support is flashed.<br />
<br />
This is realized with exposing a virtual partition <code>avb_custom_key</code> where the custom user key can be flashed to:<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ fastboot flash avb_custom_key avb_key.bin<br />
</syntaxhighlight><br />
<br />
For more information please refer to the commit <code>[https://gitlab.com/SHIFTPHONES/android/bootable/bootloader/edk2/-/commit/543b389202d098ac2f6146016627716f8ee6f076 FastbootCmds: oem device-info: check if user public key is set]</code>.<br />
<br />
==== Mainline support ====<br />
<br />
Bootloaders since version <code>202205227</code> support additional <code>fastboot oem</code> commands to enable certain Quality of Life improvements when running mainline.<br />
<br />
For example this will [https://gitlab.com/SHIFTPHONES/android/bootable/bootloader/edk2/-/commit/11937513dcf6015cb0fa7211e79f64f3e897f751 ignore the slot retry count], until we have userspace support for marking bootup attempts as successful.<br />
<br />
To enable mainline support:<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ fastboot oem enable-mainline-support<br />
</syntaxhighlight><br />
<br />
To disable mainline support:<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ fastboot oem disable-mainline-support<br />
</syntaxhighlight><br />
<br />
To check the current status of mainline support:<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ fastboot oem device-info<br />
(bootloader) Mainline support enabled: true/false<br />
</syntaxhighlight><br />
<br />
== Fastbootd ==<br />
[https://source.android.com/devices/bootloader/fastbootd?hl=en Fastbootd] is a userspace implementation of Fastboot.<br />
For axolotl it is located within the recovery.<br />
<br />
To access it, you can boot the recovery and select a menu option to enter fastbootd mode.<br />
Optionally you can also enter it via ADB and Fastboot:<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ # Enter fastbootd via adb<br />
$ adb reboot fastboot<br />
$ # Enter fastbootd via fastboot<br />
$ fastboot reboot fastboot<br />
</syntaxhighlight><br />
<br />
You can only access dynamic partitions within fastbootd.<br />
<br />
{{Note|As fastbootd lives within the recovery, you need a valid recovery image installed in the currently active slot to access it.}}<br />
<br />
== Installation ==<br />
Follow the [[installation guide]]'s "Initialization" section, using <code>shift</code> as the vendor and <code>axolotl</code> as the codename but stop before following flashing instructions, as these are different for axolotl.<br />
<br />
There are currently different ways to install postmarketOS (<b>only select one</b>).<br />
<br />
=== Installation on userdata partition ===<br />
<br />
Installation on userdata is the most generic and universally supported way, however it does not allow for dual boot or utilizing the full flash storage of the device.<br />
<br />
Reboot into <code>Fastboot mode</code> and install postmarketOS:<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ # Flash rootfs to userdata partition<br />
$ pmbootstrap flasher flash_rootfs --partition userdata<br />
$ # Flash kernel to boot<br />
$ pmbootstrap flasher flash_kernel<br />
$ # Erase dtbo partition, as it conflicts with our mainline kernel<br />
$ # Note: this operation takes some time to complete<br />
$ fastboot erase dtbo<br />
$ # Reboot into postmarketOS<br />
$ fastboot reboot<br />
</syntaxhighlight><br />
<br />
{{Note|fastboot can sometimes misbehave, if any of the fastboot commands fail you should run <code>fastboot reboot bootloader</code> (or reboot manually using the interface on the device) and then repeat the failed command.}}<br />
<br />
=== Installation on super partition ===<br />
<br />
{{Warning|This is currently work in progress and actively worked on.}}<br />
<br />
First select a slot (<code>a</code> or <code>b</code>) you want to install postmarketOS on.<br />
<br />
{{Note|This guide assumes you want to install onto the <code>a</code> slot. Replace <code>a</code> with <code>b</code> depending on the slot you want to install on.}}<br />
<br />
To install on <code>super</code> partition, a valid recovery with proper <code>fastbootd</code> implementation needs to be installed into the slot, which you want to install postmarketOS on.<br />
You can download the [https://gitlab.com/SHIFTPHONES/ubports/assets/-/blob/main/axolotl/images/recovery_stock.img stock recovery image], provided by the manufacturer and install it within <code>Fastboot mode</code>:<br />
<br />
{{Note|You can select the slot to install on via appending <code>_SLOT</code> to the partition name (for example <code>boot_a</code>, <code>boot_b</code>, ...).}}<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ # Install recovery in "a" slot<br />
$ fastboot flash recovery_a recovery_stock.img<br />
</syntaxhighlight><br />
<br />
Enter <code>Fastbootd</code> and ensure it is working as expected:<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ # Set "a" as active slot and reboot to fastbootd<br />
$ fastboot --set-active=a<br />
$ fastboot reboot fastboot<br />
$ # Verify current slot is "a"<br />
$ fastboot getvar current-slot<br />
</syntaxhighlight><br />
<br />
After you verified <code>fastbootd</code> works in the slot you have selected, you can install postmarketOS:<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ # Flash rootfs to system_a partition<br />
$ pmbootstrap flasher flash_rootfs --partition system_a<br />
$ # Flash kernel to boot<br />
$ pmbootstrap flasher flash_kernel --partition boot_a<br />
$ # Reboot to bootloader, as erasing dtbo is not working in fastbootd<br />
$ fastboot reboot bootloader<br />
$ # Erase dtbo_a partition, as it conflicts with our mainline kernel<br />
$ # Note: this operation takes some time to complete<br />
$ fastboot erase dtbo_a<br />
$ # Reboot into postmarketOS<br />
$ fastboot reboot<br />
</syntaxhighlight><br />
<br />
The phone will now always boot into postmarketOS until you switch slots with fastboot again:<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ fastboot --set-active=b<br />
</syntaxhighlight><br />
<br />
{{Note|If you are unable to boot into your former OS after installing postmarketOS and then switching back to the previous slot, you may have to re-flash the image (e.g. from [https://downloads.shiftphones.com/axolotl here]) by booting to recovery and sideloading via adb.}}<br />
<br />
== Partition map ==<br />
<br />
<br />
1|axolotl:/ # blkid<br />
/dev/block/zram0: UUID="663a3d49-89cc-4d71-8c4c-9ad121939171" TYPE="swap" <br />
/dev/block/sda2: UUID="e31914f5-d01b-4e08-97bd-d8e0f406764d" TYPE="ext4" <br />
/dev/block/sda8: UUID="91f68f2a-3821-47bf-8d9d-7d705b2d5ab0" TYPE="ext4" <br />
/dev/block/sda9: UUID="d5b3f5fa-dbd4-4cc5-9b9d-8550ad9c74a7" TYPE="f2fs" <br />
/dev/block/sde4: SEC_TYPE="msdos" UUID="00BC-614E" TYPE="vfat" <br />
/dev/block/sde5: SEC_TYPE="msdos" UUID="00BC-614E" TYPE="vfat" <br />
/dev/block/sde9: LABEL="dsp" UUID="af32c008-2a39-7e5b-a5dc-201456d93103" TYPE="ext4" <br />
/dev/block/sde26: SEC_TYPE="msdos" UUID="00BC-614E" TYPE="vfat" <br />
/dev/block/sde27: SEC_TYPE="msdos" UUID="00BC-614E" TYPE="vfat" <br />
/dev/block/sde31: LABEL="dsp" UUID="af32c008-2a39-7e5b-a5dc-201456d93103" TYPE="ext4" <br />
/dev/block/sde54: SEC_TYPE="msdos" LABEL="LOGFS" UUID="D273-55EA" TYPE="vfat" <br />
<br />
<br />
axolotl:/ # df -h <br />
Filesystem Size Used Avail Use% Mounted on<br />
tmpfs 3.7G 1.5M 3.7G 1% /dev<br />
tmpfs 3.7G 0 3.7G 0% /mnt<br />
/dev/block/sda8 11M 160K 11M 2% /metadata<br />
/dev/block/dm-1 1.2G 849M 476M 65% /<br />
/dev/block/dm-2 971M 489M 482M 51% /system_ext<br />
/dev/block/dm-0 1.8G 378M 1.4G 21% /product<br />
/dev/block/dm-3 732M 482M 250M 66% /vendor<br />
tmpfs 3.7G 8.0K 3.7G 1% /apex<br />
tmpfs 3.7G 524K 3.7G 1% /linkerconfig<br />
/dev/block/sda2 27M 0.9M 26M 4% /mnt/vendor/persist<br />
/dev/block/sde5 64M 704K 63M 2% /vendor/bt_firmware<br />
/dev/block/sde4 120M 115M 5.0M 96% /vendor/firmware_mnt<br />
/dev/block/sde9 27M 24M 3.1M 89% /vendor/dsp<br />
/dev/block/dm-8 101G 1.7G 100G 2% /data<br />
tmpfs 3.7G 0 3.7G 0% /data_mirror<br />
/data/media 101G 1.7G 100G 2% /mnt/runtime/default/emulated<br />
/dev/fuse 101G 1.7G 100G 2% /mnt/user/0/emulated<br />
<br />
<br />
<br />
== See also ==<br />
* {{MR|2703|pmaports}} Initial merge request<br />
* {{MR|2738|pmaports}} Mainline bringup<br />
* {{Device package|shift-axolotl|community}}<br />
* {{Kernel package|postmarketos-qcom-sdm845|community}}<br />
* [https://gitlab.com/SHIFTPHONES/android/bootable/bootloader/edk2 OEM bootloader (edk2) sources]</div>Frozenintegralhttps://wiki.postmarketos.org/index.php?title=SHIFT_SHIFT6mq_(shift-axolotl)&diff=30208SHIFT SHIFT6mq (shift-axolotl)2022-08-14T18:37:35Z<p>Frozenintegral: Add instructions on how to boot other OS in dual-boot setup</p>
<hr />
<div>{{Infobox device<br />
| manufacturer = SHIFT<br />
| name = SHIFT6mq<br />
| codename = shift-axolotl<br />
| image = File:SHIFT_SHIFT6mq_axolotl_front_postmarketOS.png<br />
| imagecaption = SHIFT SHIFT6mq (axolotl)<br />
| releaseyear = 2020<br />
| category = community<br />
| originalsoftware = Android 10.0<br />
| chipset = Qualcomm SDM845 Snapdragon 845<br />
| cpu = Octa-core (4x 2.8 GHz Kryo 385 Gold & 4x 1.7 GHz Kryo 385 Silver)<br />
| gpu = Adreno 630<br />
| storage = 128 GB UFS 2.1<br />
| display = 1080 x 2160 AMOLED<br />
| memory = 8 GB<br />
| architecture = aarch64<br />
| status_usbnet = Y<br />
| status_flashing = Y<br />
| status_touch = Y<br />
| status_screen = Y<br />
| status_wifi = Y<br />
| status_xwayland = Y<br />
| status_fde = Y<br />
| status_mainline = Y<br />
| status_battery = Y<br />
| status_3d = Y<br />
| status_accel = N<br />
| status_audio = N<br />
| status_bluetooth = Y<br />
| status_camera = N<br />
| status_gps = N<br />
| status_mobiledata = Y<br />
| status_sms = Y<br />
| status_calls = N<br />
| status = Work in Progress<br />
| status_otg = N<br />
| status_nfc = N<br />
| status_irtx = -<br />
| booting = yes<br />
| pmoskernel = Mainline<br />
<!--<br />
see Unixbench page on wiki<br />
| whet_dhry = 0.0<br />
--><br />
}}<br />
<br />
== Contributors ==<br />
* [[User:Amartinz|Amartinz]]<br />
* [[User:kalube|kalube]]<br />
<br />
== Users owning this device ==<br />
{{Device owners}}<br />
<br />
== Boot modes ==<br />
<br />
By holding various button combinations while booting the device can be made to boot into different modes.<br />
<br />
Unplug from USB, power off the device and press and hold the below buttons to enter the specific boot mode.<br />
<br />
{| class="wikitable" <br />
|-<br />
! Boot mode<br />
! {{Button|Power}}<br />
! {{Button|Up}}<br />
! {{Button|Down}}<br />
|-<br />
| Fastboot<br />
| Y<br />
| Y<br />
| N<br />
|-<br />
| Recovery<br />
| Y<br />
| N<br />
| Y<br />
|-<br />
| EDL<br />
| Y<br />
| Y<br />
| Y<br />
|}<br />
<br />
== Bootloader ==<br />
<br />
=== Unlock bootloader ===<br />
<br />
To unlock the bootloader, you need to allow unlocking it via enabling <code>OEM unlocking</code> within Android.<br />
<br />
# Go to Settings within Android and select <code>About</code><br />
# Tap on <code>Build number</code> seven times to enable developer options<br />
# Go back and select <code>System</code>, <code>Advanced</code> and scroll down to <code>Developer options</code><br />
# Enable <code>Advanced restart</code> and <code>OEM unlocking</code><br />
# Reboot into bootloader by long pressing the power button, selecting <code>Restart</code> and <code>Bootloader</code><br />
<br />
After it has successfully rebooted into <code>Fastboot mode</code>, initiate unlocking the bootloader using <code>fastboot</code>:<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ fastboot flashing unlock<br />
</syntaxhighlight><br />
<br />
Please follow the prompts on the screen to finish unlocking the bootloader.<br />
<br />
{{Warning|This will erase your data, please back up important data before unlocking the bootloader.}}<br />
<br />
=== Customization ===<br />
<br />
==== Custom AVB key ====<br />
<br />
{{Note|This is not fully relevant for postmarketOS, as AVB is currently unsupported, but documented for the future.}}<br />
<br />
The bootloader has support for setting an user provided AVB key to allow relocking the bootloader if an OS with proper support is flashed.<br />
<br />
This is realized with exposing a virtual partition <code>avb_custom_key</code> where the custom user key can be flashed to:<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ fastboot flash avb_custom_key avb_key.bin<br />
</syntaxhighlight><br />
<br />
For more information please refer to the commit <code>[https://gitlab.com/SHIFTPHONES/android/bootable/bootloader/edk2/-/commit/543b389202d098ac2f6146016627716f8ee6f076 FastbootCmds: oem device-info: check if user public key is set]</code>.<br />
<br />
==== Mainline support ====<br />
<br />
Bootloaders since version <code>202205227</code> support additional <code>fastboot oem</code> commands to enable certain Quality of Life improvements when running mainline.<br />
<br />
For example this will [https://gitlab.com/SHIFTPHONES/android/bootable/bootloader/edk2/-/commit/11937513dcf6015cb0fa7211e79f64f3e897f751 ignore the slot retry count], until we have userspace support for marking bootup attempts as successful.<br />
<br />
To enable mainline support:<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ fastboot oem enable-mainline-support<br />
</syntaxhighlight><br />
<br />
To disable mainline support:<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ fastboot oem disable-mainline-support<br />
</syntaxhighlight><br />
<br />
To check the current status of mainline support:<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ fastboot oem device-info<br />
(bootloader) Mainline support enabled: true/false<br />
</syntaxhighlight><br />
<br />
== Fastbootd ==<br />
[https://source.android.com/devices/bootloader/fastbootd?hl=en Fastbootd] is a userspace implementation of Fastboot.<br />
For axolotl it is located within the recovery.<br />
<br />
To access it, you can boot the recovery and select a menu option to enter fastbootd mode.<br />
Optionally you can also enter it via ADB and Fastboot:<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ # Enter fastbootd via adb<br />
$ adb reboot fastboot<br />
$ # Enter fastbootd via fastboot<br />
$ fastboot reboot fastboot<br />
</syntaxhighlight><br />
<br />
You can only access dynamic partitions within fastbootd.<br />
<br />
{{Note|As fastbootd lives within the recovery, you need a valid recovery image installed in the currently active slot to access it.}}<br />
<br />
== Installation ==<br />
Follow the [[installation guide]]'s "Initialization" section, using <code>shift</code> as the vendor and <code>axolotl</code> as the codename but stop before following flashing instructions, as these are different for axolotl.<br />
<br />
There are currently different ways to install postmarketOS (<b>only select one</b>).<br />
<br />
=== Installation on userdata partition ===<br />
<br />
Installation on userdata is the most generic and universally supported way, however it does not allow for dual boot or utilizing the full flash storage of the device.<br />
<br />
Reboot into <code>Fastboot mode</code> and install postmarketOS:<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ # Flash rootfs to userdata partition<br />
$ pmbootstrap flasher flash_rootfs --partition userdata<br />
$ # Flash kernel to boot<br />
$ pmbootstrap flasher flash_kernel<br />
$ # Erase dtbo partition, as it conflicts with our mainline kernel<br />
$ # Note: this operation takes some time to complete<br />
$ fastboot erase dtbo<br />
$ # Reboot into postmarketOS<br />
$ fastboot reboot<br />
</syntaxhighlight><br />
<br />
{{Note|fastboot can sometimes misbehave, if any of the fastboot commands fail you should run <code>fastboot reboot bootloader</code> (or reboot manually using the interface on the device) and then repeat the failed command.}}<br />
<br />
=== Installation on super partition ===<br />
<br />
{{Warning|This is currently work in progress and actively worked on.}}<br />
<br />
First select a slot (<code>a</code> or <code>b</code>) you want to install postmarketOS on.<br />
<br />
{{Note|This guide assumes you want to install onto the <code>a</code> slot. Replace <code>a</code> with <code>b</code> depending on the slot you want to install on.}}<br />
<br />
To install on <code>super</code> partition, a valid recovery with proper <code>fastbootd</code> implementation needs to be installed into the slot, which you want to install postmarketOS on.<br />
You can download the [https://gitlab.com/SHIFTPHONES/ubports/assets/-/blob/main/axolotl/images/recovery_stock.img stock recovery image], provided by the manufacturer and install it within <code>Fastboot mode</code>:<br />
<br />
{{Note|You can select the slot to install on via appending <code>_SLOT</code> to the partition name (for example <code>boot_a</code>, <code>boot_b</code>, ...).}}<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ # Install recovery in "a" slot<br />
$ fastboot flash recovery_a recovery_stock.img<br />
</syntaxhighlight><br />
<br />
Enter <code>Fastbootd</code> and ensure it is working as expected:<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ # Set "a" as active slot and reboot to fastbootd<br />
$ fastboot --set-active=a<br />
$ fastboot reboot fastboot<br />
$ # Verify current slot is "a"<br />
$ fastboot getvar current-slot<br />
</syntaxhighlight><br />
<br />
After you verified <code>fastbootd</code> works in the slot you have selected, you can install postmarketOS:<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ # Flash rootfs to system_a partition<br />
$ pmbootstrap flasher flash_rootfs --partition system_a<br />
$ # Flash kernel to boot<br />
$ pmbootstrap flasher flash_kernel --partition boot_a<br />
$ # Reboot to bootloader, as erasing dtbo is not working in fastbootd<br />
$ fastboot reboot bootloader<br />
$ # Erase dtbo_a partition, as it conflicts with our mainline kernel<br />
$ # Note: this operation takes some time to complete<br />
$ fastboot erase dtbo_a<br />
$ # Reboot into postmarketOS<br />
$ fastboot reboot<br />
</syntaxhighlight><br />
<br />
The phone will now always boot into postmarketOS until you switch slots with fastboot again:<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ fastboot --set-active=b<br />
</syntaxhighlight><br />
<br />
== Partition map ==<br />
<br />
<br />
1|axolotl:/ # blkid<br />
/dev/block/zram0: UUID="663a3d49-89cc-4d71-8c4c-9ad121939171" TYPE="swap" <br />
/dev/block/sda2: UUID="e31914f5-d01b-4e08-97bd-d8e0f406764d" TYPE="ext4" <br />
/dev/block/sda8: UUID="91f68f2a-3821-47bf-8d9d-7d705b2d5ab0" TYPE="ext4" <br />
/dev/block/sda9: UUID="d5b3f5fa-dbd4-4cc5-9b9d-8550ad9c74a7" TYPE="f2fs" <br />
/dev/block/sde4: SEC_TYPE="msdos" UUID="00BC-614E" TYPE="vfat" <br />
/dev/block/sde5: SEC_TYPE="msdos" UUID="00BC-614E" TYPE="vfat" <br />
/dev/block/sde9: LABEL="dsp" UUID="af32c008-2a39-7e5b-a5dc-201456d93103" TYPE="ext4" <br />
/dev/block/sde26: SEC_TYPE="msdos" UUID="00BC-614E" TYPE="vfat" <br />
/dev/block/sde27: SEC_TYPE="msdos" UUID="00BC-614E" TYPE="vfat" <br />
/dev/block/sde31: LABEL="dsp" UUID="af32c008-2a39-7e5b-a5dc-201456d93103" TYPE="ext4" <br />
/dev/block/sde54: SEC_TYPE="msdos" LABEL="LOGFS" UUID="D273-55EA" TYPE="vfat" <br />
<br />
<br />
axolotl:/ # df -h <br />
Filesystem Size Used Avail Use% Mounted on<br />
tmpfs 3.7G 1.5M 3.7G 1% /dev<br />
tmpfs 3.7G 0 3.7G 0% /mnt<br />
/dev/block/sda8 11M 160K 11M 2% /metadata<br />
/dev/block/dm-1 1.2G 849M 476M 65% /<br />
/dev/block/dm-2 971M 489M 482M 51% /system_ext<br />
/dev/block/dm-0 1.8G 378M 1.4G 21% /product<br />
/dev/block/dm-3 732M 482M 250M 66% /vendor<br />
tmpfs 3.7G 8.0K 3.7G 1% /apex<br />
tmpfs 3.7G 524K 3.7G 1% /linkerconfig<br />
/dev/block/sda2 27M 0.9M 26M 4% /mnt/vendor/persist<br />
/dev/block/sde5 64M 704K 63M 2% /vendor/bt_firmware<br />
/dev/block/sde4 120M 115M 5.0M 96% /vendor/firmware_mnt<br />
/dev/block/sde9 27M 24M 3.1M 89% /vendor/dsp<br />
/dev/block/dm-8 101G 1.7G 100G 2% /data<br />
tmpfs 3.7G 0 3.7G 0% /data_mirror<br />
/data/media 101G 1.7G 100G 2% /mnt/runtime/default/emulated<br />
/dev/fuse 101G 1.7G 100G 2% /mnt/user/0/emulated<br />
<br />
<br />
<br />
== See also ==<br />
* {{MR|2703|pmaports}} Initial merge request<br />
* {{MR|2738|pmaports}} Mainline bringup<br />
* {{Device package|shift-axolotl|community}}<br />
* {{Kernel package|postmarketos-qcom-sdm845|community}}<br />
* [https://gitlab.com/SHIFTPHONES/android/bootable/bootloader/edk2 OEM bootloader (edk2) sources]</div>Frozenintegralhttps://wiki.postmarketos.org/index.php?title=Git_workflow&diff=12065Git workflow2020-05-25T11:19:17Z<p>Frozenintegral: Update broken gitlab fork link</p>
<hr />
<div>This guide explains how to update your local copy of [https://gitlab.com/postmarketOS/pmaports/ pmaports.git], and how to contribute back changes (e.g. after creating a new device port). It is suitable for people who have not used git before.<br />
<br />
== The basics ==<br />
=== pmaports dir ===<br />
During <code>pmbootstrap init</code>, the whole <code>pmaports.git</code> repository was cloned to your computer. You can use <code>pmbootstrap config aports</code> to see the path, and if you chose the default work path, you will get:<br />
<syntaxhighlight lang="shell-session"><br />
$ pmbootstrap config aports<br />
~/.local/var/pmbootstrap/cache_git/pmaports<br />
</syntaxhighlight><br />
<br />
All commands below need to be executed in your pmaports dir.<br />
<br />
It's a good idea to make accessing this directory easy with a short command, so consider setting up a shell alias. For bash this can be done by adding <code>alias pma="cd ~/.local/var/pmbootstrap/cache_git/pmaports"</code> to <code>~/.bashrc</code>.<br />
<br />
=== Updating pmaports (rebasing on master) ===<br />
{{note|If you didn't change your pmaports, just run <code>pmbootstrap pull</code> nowadays.}}<br />
Since we are dealing with a git repository, pmbootstrap leaves the directory alone after the initial clone. It will not automatically update it. The only thing it will do is tell you when your pmaports.git dir is so outdated that you absolutely have to update it, or otherwise it would be incompatible with your pmbootstrap version. But you can always manually update the pmaports.git directory, and it is recommended to do so before you start or continue with making changes to the repository.<br />
<br />
==== Make sure that you are on master ====<br />
If you never ran any git commands in this directory before, you will still be on the master branch. Otherwise, run this command to check the branch name (there is also <code>git branch</code>, but we do have a lot of branches, so the one below is probably easier). Switch back to master if necessary with <code>git checkout master</code>.<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ git rev-parse --abbrev-ref HEAD<br />
master<br />
</syntaxhighlight><br />
<br />
(You may want to extend your shell to automatically display the branch name when you are inside a git directory, e.g. by using <code>grml-zsh-config</code> and ZSH.)<br />
<br />
==== Put your changes into a new branch ====<br />
Check if you made any changes to your pmaports dir. Changes could come from starting a new device port, for example.<br />
<br />
When you have made '''no changes, you can move on to the next step''' ("Running 'git pull'"):<br />
<syntaxhighlight lang="shell-session"><br />
$ git status<br />
On branch master<br />
Your branch is up to date with 'origin/master'.<br />
<br />
nothing to commit, working tree clean<br />
</syntaxhighlight><br />
<br />
When you have made changes, <code>git status</code> will list the files that were changed:<br />
<syntaxhighlight lang="shell-session"><br />
$ git status<br />
On branch master<br />
Your branch is up to date with 'origin/master'.<br />
<br />
Changes not staged for commit:<br />
(use "git add <file>..." to update what will be committed)<br />
(use "git checkout -- <file>..." to discard changes in working directory)<br />
<br />
modified: device/device-lg-mako/APKBUILD<br />
<br />
no changes added to commit (use "git add" and/or "git commit -a")<br />
</syntaxhighlight><br />
<br />
Create a new branch, commit the changes and go back to the master branch:<br />
<syntaxhighlight lang="shell-session"><br />
$ git checkout -b mynewbranch<br />
M device/device-lg-mako/APKBUILD<br />
Switched to a new branch 'mynewbranch'<br />
$ git add -A<br />
$ git commit -m "describe your change here"<br />
[mynewbranch c9c729a5] describe your change here<br />
1 file changed, 1 insertion(+), 1 deletion(-)<br />
$ git checkout master<br />
Switched to branch 'master'<br />
Your branch is up to date with 'origin/master'.<br />
</syntaxhighlight><br />
<br />
Note that there are [https://chris.beams.io/posts/git-commit/ best practices for commit messages], and for commits that actually make it into the master branches of pmaports.git, we try to stick to them. For example: '''when porting a new device put the codename of your device at the start of the commit message''': <code>fairphone-fp2: new device</code> (if the codename is <code>fairphone-fp2</code>).<br />
Type <code>git commit</code> instead of <code>git commit -m "describe your change here"</code> and your editor will show up, where you can type in a pretty commit message. You can change the default editor by changing the <code>EDITOR</code> environment variable.<br />
<br />
==== Running 'git pull' ====<br />
Let's fetch the changes from the official postmarketOS repository and apply them to the current branch. Git will even show a nice overview of the files that have been changed, and how many lines have changed.<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ git pull<br />
Updating e8a7926e..8909e932<br />
Fast-forward<br />
coreapps/coregarage/APKBUILD | 24 ++++++++++++++++++++++++<br />
...<br />
26 files changed, 307 insertions(+), 181 deletions(-)<br />
create mode 100644 coreapps/coregarage/APKBUILD<br />
...<br />
</syntaxhighlight><br />
<br />
If you did not have any local changes, then you are done here.<br />
<br />
==== Updating your branch(es) ====<br />
<br />
Put all new commits from master into your own branch, and then apply the changes you made on top of that:<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ git checkout mynewbranch<br />
Switched to branch 'mynewbranch'<br />
$ git rebase master<br />
First, rewinding head to replay your work on top of it...<br />
Applying: description here<br />
</syntaxhighlight><br />
<br />
If there are any conflicts, pay attention to the git output and run <code>git diff</code> to see where the conflicts are. Edit the files in a text editor, run <code>git add -A</code> and then continue the rebase.<br />
<br />
== Creating a merge request ==<br />
=== Preparation ===<br />
These steps only need to be done the first time.<br />
==== Forking the repository ====<br />
We are currently using GitLab for development. Login to the website, and [https://gitlab.com/postmarketOS/pmaports/-/forks/new click here to fork pmaports.git] to your own user's namespace.<br />
<br />
If you have just registered at GitLab, [https://docs.gitlab.com/ee/gitlab-basics/create-your-ssh-keys.html create a SSH key and store it in the settings].<br />
<br />
==== Add your fork as remote ====<br />
Run this, but replace USERNAME twice with your GitLab username.<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ git remote add USERNAME git@gitlab.com:USERNAME/pmaports.git<br />
</syntaxhighlight><br />
<br />
=== Push changes to your fork ===<br />
The first time you try to push your changes (upload them), git won't know where you want to put them:<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ git push<br />
fatal: The current branch mynewbranch has no upstream branch.<br />
To push the current branch and set the remote as upstream, use<br />
<br />
git push --set-upstream origin mynewbranch<br />
</syntaxhighlight><br />
<br />
So we will tell git the remote we would like to use.<br />
<br />
<syntaxhighlight lang="shell-session"><br />
$ git push --set-upstream USERNAME mynewbranch<br />
Enter passphrase for key '/home/user/.ssh/id_rsa': <br />
Counting objects: 59, done.<br />
Delta compression using up to 2 threads.<br />
Compressing objects: 100% (39/39), done.<br />
Writing objects: 100% (59/59), 13.48 KiB | 1.68 MiB/s, done.<br />
Total 59 (delta 29), reused 0 (delta 0)<br />
remote: <br />
remote: To create a merge request for mynewbranch, visit:<br />
remote: https://gitlab.com/USERNAME/pmaports/merge_requests/new?merge_request%5Bsource_branch%5D=mynewbranch<br />
remote: <br />
To gitlab.com:USERNAME/pmaports.git<br />
* [new branch] mynewbranch -> mynewbranch<br />
Branch 'mynewbranch' set up to track remote branch 'mynewbranch' from 'USERNAME'.<br />
</syntaxhighlight><br />
<br />
When you want to push more changes, you can simply use <code>git push</code> for this branch.<br />
<br />
There is also <code>git push --force</code>, which can be used to override commits without creating new ones. You can use it after rebasing your branch on master (as explained above).<br />
<br />
<code>git rebase -i master</code> is a powerful command to edit previous commits, the <code>-i</code> option stands for interactive. See [https://git-rebase.io/ git-rebase.io] for an in depth tutorial on interactive rebasing.<br />
<br />
=== Create the MR ===<br />
Simply click the link shown in the git output above, to create the new merge request. Pay attention to the text shown there, following it closely will make sure that your merge request gets merged to master as fast as possible.<br />
<br />
=== Check and fix CI / linting issues ===<br />
<br />
Your submitted code will be built automatically by the continuous integration system to check for errors, style issues, etc.<br />
Check the results of the automatic build by going to https://gitlab.com/USERNAME/pmaports/pipelines (replace USERNAME with your username) and clicking on the (chronologically) last item. After the build has finished, you get a list of passed (green check-marks) and/or failed (red X) checks. Click on the failed checks and follow the recommendations in the output shown to fix your code.<br />
<br />
<br />
<br />
== See also ==<br />
* https://git-rebase.io/ in depth interactive git rebase tutorial (explains fixing previous commits, squashing commits, splitting one commit into several, reordering commits, etc.)<br />
* [https://wiki.winehq.org/Git_Wine_Tutorial Wine project has an excellent Git Tutorial]<br />
<br />
[[Category:Guide]]</div>Frozenintegralhttps://wiki.postmarketos.org/index.php?title=Using_prebuilt_kernels&diff=8429Using prebuilt kernels2019-10-03T20:24:44Z<p>Frozenintegral: Add instructions for failing `su` command</p>
<hr />
<div>Some vendors do not release the kernel source code, which is very bad for freedom and goes against the Linux kernel license (see [https://wiki.postmarketos.org/wiki/Troubleshooting#My_device_runs_the_Linux_kernel_.28e.g._Android.29.2C_but_the_vendor_does_not_provide_the_source My device runs the Linux kernel (e.g. Android), but the vendor does not provide the source] in the Troubleshooting page).<br />
<br />
But you can still extract the kernel image from a device that is running Android and use it to run postmarketOS. Of course this is ''totally discouraged'' because we want to make sure that we know the code our devices are running but you might find it useful in order to start hacking on postmarketOS without having the kernel source code.<br />
<br />
{{note|Do please note that a port like this won't be merged.}}<br />
<br />
== Extracting boot.img from an Android device ==<br />
{{note|In this example the boot partition is named <code>msm_sdcc.1</code> but it might have a different name for your device.}}<br />
You can extract the kernel that is running your Android device, it doesn't matter if it's the stock ROM, LineageOS or any custom ROM. For this approach you need the <code>adb</code> tool and root permissions.<br />
<br />
<source lang="bash"># Connect to your Android device<br />
adb shell<br />
<br />
# Find the partition name<br />
ls -l /dev/block/platform/<br />
ls -l /dev/block/platform/msm_sdcc.1/by-name<br />
<br />
# From there we know that the boot partition is /dev/block/mmcblk0p14<br />
# Now we just dump the partition to a file (we need to root permissions)<br />
#<br />
# Note: You may have to exit from adb and start it again with `adb root`<br />
# if the `su` command fails.<br />
su<br />
cat /dev/block/mmcblk0p14 > /sdcard/boot.img<br />
chmod 0666 /sdcard/boot.img<br />
<br />
# Exit from adb and copy boot.img to your computer<br />
adb pull /sdcard/boot.img .</source><br />
<br />
== Running postmarketOS with a pre-built kernel ==<br />
{{note|Generating an initramfs when your device is not ported yet: Pick a similar device in <code>pmbootstrap init</code> and [[Installation_guide#pmbootstrap_install|run install]].}}<br />
You can use <code>unpackbootimg</code> (usage is described in [[How_to_find_device_specific_information#Fastboot_.28boot.img.29_flash_offsets|here]]) to extract the kernel from your recently extracted boot.img or from a LineageOS release and run it together with postmarketOS initramfs.<br />
<br />
If you extracted the kernel from you Stock ROM, it might not have encryption support enabled and in this case you would not be able to boot from an encrypted partition. You might need other modules as well for pmOS to work properly.<br />
<br />
<source lang="bash"># fastboot boot <kernel> [ <ramdisk> ]<br />
fastboot boot \<br />
uncompressed_boot/boot.img-zImage \<br />
~/.local/var/pmboostrap/chroot_rootfs-XXX-XXXX/boot/initramfs-lg-hammerhead</source><br />
<br />
{{Note|For HTC devices you may need to specify the base address, see {{issue|145}}}}<br />
<br />
Note that the '''fastboot boot''' command loads kernel (and eventually the ramdisk) in memory and does not write anything on partitions. <br />
<br />
Immediately after downloading kernel (and eventually the ram disk) in memory, it tries to boot it. If nothing appens, your device is frozen. You just have to remove battery to restart with your original kernel .<br />
<br />
== Maybe we can chainload the pmOS kernel? ==<br />
{{note|User forkbomb successfully booted a [https://postmarketos.org/blog/2017/12/31/219-days-of-postmarketOS/#mainline-linux-kernel bunch of Samsungs] [https://forkwhiletrue.me/posts/kexec-on-galaxy-s3/ with kexec(broken link)] [https://blog.forkwhiletrue.me/posts/kexec-on-galaxy-s3/ new link] into a mainline kernel!}}<br />
Linux kernels can load other kernels via the [https://en.wikipedia.org/wiki/Kexec kexec] syscall. The deal is, that signed bootloaders only allow signed kernels. But what if we repackaged the signed kernel with our own initramfs, that loads our own kernel via kexecboot from the boot subpartition? Not sure if this will work because of SELinux etc, but if it did, it would be a nice way to get around the bootloader's signed kernel enforcement! '''If you have an usecase for this, please open a ticket to discuss this further.'''<br />
<br />
More research showed, that the <code>kexec</code> syscall is usually disabled in such kernels. However, it could be possible to do <code>kexec</code> without it being enabled in the kernel (such as it has been done in the PS4 hack, where a kexec gets done on the PS4's BSD kernel, which does obviously not support this feature, to load a Linux kernel). This is ''a lot'' of work, but it would be an impressive hack!<br />
<br />
kexec is also used by [https://forum.xda-developers.com/showthread.php?t=2011403 MultiROM] in order to allow users to choose which ROM to boot up. For MultiROM support in pmbootstrap, see [https://gitlab.com/postmarketOS/pmbootstrap/issues/421 issue #421].<br />
<br />
== Useful links ==<br />
<br />
* [https://github.com/lygstate/lygstate.github.com/blob/master/_posts/2014-03-10-Extract-boot.img-from-an-android-device.md 2014-03-10-Extract-boot.img-from-an-android-device.md]<br />
* [http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack%2C_Edit%2C_and_Re-Pack_Boot_Images HOWTO: Unpack, Edit, and Re-Pack Boot Images]<br />
<br />
[[Category:Guide]]</div>Frozenintegral