Jump to content

Recommended Posts

Posted (edited)

So, looking to create a CLI version of armbian-install. Only has to work with the rockpi-s and from the SD card to the eMMC.

Looking at this script:

 

If it works to clone the SD to eMMC (with some changes?) then I need to tell armbian to boot from the eMMC when the SD card isn't inserted, same way that armbian-install does.

Do I simply change the UUID line in /boot/armbianEnv.txt to the UUID of the eMMC, or do I need to edit /etc/fstab or ??

Edited by Meestor_X
Posted

Thank you for your reply.
Do you know what the command is for installing the bootloader? I want to automate the process and armbian-install doesn't seem to have a way to be run via command line. Reading and following the operation of armbian-install is next to impossible.

 

 

 

Posted

Would these be the correct commands?

dd if=/usr/lib/linux-u-boot-current-rockpi-s/idbloader.bin of=/dev/mmcblk0 seek=64 conv=notrunc status=none
dd if=/usr/lib/linux-u-boot-current-rockpi-s/uboot.img of=/dev/mmcblk0 seek=16384 conv=notrunc status=none
dd if=/usr/lib/linux-u-boot-current-rockpi-s/trust.bin of=/dev/mmcblk0 seek=24576 conv=notrunc status=none

 

Are the "seek" numbers always the same or do they need to be calculated?

Posted

You can take a look at the postinstall script from the u-boot package. It should be called sth like "/var/lib/dpkg/info/linux-u-boot-current-rockpi-s.postinst" and should be quite small, so easier to understand. You can extract the required commands from there.

Assuming it is similar to my u-boot installer, this could result in a script like this:

#!/bin/bash
source /usr/lib/u-boot/platform_install.sh
write_uboot_platform "$DIR" /dev/mmcblk0
sync

That way you don't have to handle the hardcoded sector offsets yourself (not sure, if these offsets would ever change - but if they do, then that will probably be reflected in the platform_install script).

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines