roman

@hi@romanzolotarev.com


homehttps://romanzolotarev.com
1 ★ 0 ↺

[?]roman Β» 🔓
@hi@romanzolotarev.com

why writing u-boot in two places on sd2?

# dd if=u-boot.bin.sd.bin of=/dev/rsd2c bs=512 skip=1 seek=1
# dd if=u-boot.bin.sd.bin of=/dev/rsd2c bs=1 count=444

    ...

    [?]π™Ήπš˜πšŽπš• π™²πšŠπš›πš—πšŠπš β™‘ πŸ€ͺ Β» 🔓
    @joel@gts.tumfatig.net

    @hi short answer is "because Mark Kettenis told me to" :)
    From what I understood, it grab two parts from the u-boot image, the boot-loader and the firmware. I'd rather have grabed file and do regular copy/paste on a filesystem but that doesn't seem to work this way.

    ...
    2 ★ 0 ↺

    [?]roman Β» 🔓
    @hi@romanzolotarev.com

    @joel@tumfatig.net thank you for the clarification!

      [?]Andy Alderwick [he / him / Dr] Β» 🔓
      @alderwick@merveilles.town

      @hi @joel Oh, I've seen this pattern before! It writes u-boot to the disk but does not overwrite the partition table that's already there. If you didn't care then a single dd does everything, but the above stops bytes 444–511 being written.

        ...

        [?]π™Ήπš˜πšŽπš• π™²πšŠπš›πš—πšŠπš β™‘ πŸ€ͺ Β» 🔓
        @joel@gts.tumfatig.net

        @alderwick yeah, I once learned the consequences the hard way 🀣

        I guessed as you say, it just overwrites the necessary bits. That’s why this part is only done for installation. And then a full dd is done when the sdcard just needs the u-boot stuff.

        @hi

          History