树莓派论坛

 找回密码
 立即注册

[系统与软件] berryboot添加你自己定制的操作系统到菜单

kuliko 发表于 2013-4-7 11:50:10 | 显示全部楼层 |阅读模式
Adding your own custom operating systems to the menu
You can add your own extra operating systems to the Berryboot menu. However this requires that you convert your file system image to SquashFS format first.
Most Raspberry Pi operating system images are disk images containing two partitions. A FAT partition with the boot loader and kernel files, and a second ext4 partition with everything else. We are interested in the second partition.
With a regular Linux desktop computer that has kpartx and mksquashfs installed, you can convert the second partition to SquashFS like this:
$ sudo kpartx -av image_you_want_to_convert.img add map loop0p1 (252:5): 0 117187 linear /dev/loop0 1add map loop0p2 (252:6): 0 3493888 linear /dev/loop0 118784$ sudo mount /dev/mapper/loop0p2 /mnt$ sudo sed -i 's/^\/dev\/mmcblk/#\0/g' /mnt/etc/fstab$ sudo mksquashfs /mnt converted_image_for_berryboot.img -comp lzo -e lib/modules$ sudo umount /mnt$ sudo kpartx -d image_you_want_to_convert.img
Notes:
  • If kpartx reports it created a mapping different than loop0p2 (e.g. loop4p2) mount that instead. This can happen if loop0 is already in use by something else on the system.
  • We are excluding /lib/modules from the image, because the kernel modules shipped with Berryboot are used instead, and shared with all distributions.
  • Some older versions of mksquashfs do not support the ”-comp lzo” option. You can leave it out to let it use gzip compression instead. Advantage of LZO is that it is faster to uncompress, which is a big plus on slow ARM devices, and therefore preferred. This does come at a cost of reduced compression ratio (LZO images are larger than gzip ones).

Put your SquashFS formatted image on a USB stick, go to the “Operating system installer”, hold down your mouse button over “Add OS” and select “Install from USB stick” If your image prefers to have a certain memory split use the extension .img128 .img192, .img224 or .img240 instead of .img.

See also

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版 | Archiver | 树莓派论坛 ( 粤ICP备15075382号-1 )