3

I'd like to know if it's possible to add more partitions in the partition table, and how. I've tested to change the genimage.cfg but it seems that support/scripts/genimage.sh doesn't create it.

Thank you in advance.

Warren HYPOLITE
  • 385
  • 1
  • 3
  • 8
  • Changing the genimage.cfg is indeed the way to go. If that didn't work, you probably did something wrong there. – Arnout Nov 17 '19 at 13:16

1 Answers1

4

Using the genimage.cfg script is the right way to go.

If it does not work, you might be modifying the wrong config file; genimage is usually invoked by a script specified as Make sure to modify the right config file however, the one used by the script defined in the BR2_ROOTFS_POST_IMAGE_SCRIPT option, under System configuration-> Custom scripts to run after creating filesystem images in menuconfig.

For example, I modified mine (specifically boards/raspberrypi3-64/genimage-raspberrypi3-64.cfg to accomodate for an extra ext4 partition.

image boot.vfat {                                                                                                                                                                                                                                      
  vfat {                                                                                                                                                                                                                                               
    files = {                                                                                                                                                                                                                                          
      "bcm2710-rpi-3-b.dtb",                                                                                                                                                                                                                           
      "bcm2710-rpi-3-b-plus.dtb",                                                                                                                                                                                                                      
      "bcm2837-rpi-3-b.dtb",                                                                                                                                                                                                                           
      "rpi-firmware/bootcode.bin",                                                                                                                                                                                                                     
      "rpi-firmware/cmdline.txt",                                                                                                                                                                                                                      
      "rpi-firmware/config.txt",                                                                                                                                                                                                                       
      "rpi-firmware/fixup.dat",                                                                                                                                                                                                                        
      "rpi-firmware/start.elf",                                                                                                                                                                                                                        
      "rpi-firmware/overlays",                                                                                                                                                                                                                         
      "Image"                                                                                                                                                                                                                                          
    }                                                                                                                                                                                                                                                  
  }                                                                                                                                                                                                                                                    
  size = 32M                                                                                                                                                                                                                                           
}                                                                                                                                                                                                                                                      

image sdcard.img {                                                                                                                                                                                                                                     
  hdimage {                                                                                                                                                                                                                                            
  }                                                                                                                                                                                                                                                    

  partition boot {                                                                                                                                                                                                                                     
    partition-type = 0xC                                                                                                                                                                                                                               
    bootable = "true"                                                                                                                                                                                                                                  
    image = "boot.vfat"                                                                                                                                                                                                                                
  }                                                                                                                                                                                                                                                    

  partition rootfs {                                                                                                                                                                                                                                   
    partition-type = 0x83                                                                                                                                                                                                                              
    image = "rootfs.ext4"                                                                                                                                                                                                                              
  }                                                                                                                                                                                                                                                    

  partition log {                                                                                                                                                                                                                                      
    partition-type = 0x83                                                                                                                                                                                                                              
    image = "log.ext4"                                                                                                                                                                                                                                 
  }                                                                                                                                                                                                                                                    
}
Maldus
  • 10,548
  • 4
  • 24
  • 36