source: live-build/trunk/fuentes/debian/patches/ubuntu-chroot-fs-opts.patch @ 900

Last change on this file since 900 was 900, checked in by kbut, 3 years ago

add original source

File size: 3.8 KB
  • scripts/build/lb_binary_rootfs

    Description: Add options to tune the EXT FS produced in lb_binary_rootfs
     Adds --ext-block-size, --ext-resize-blocks and --ext-fudge-factor to
     enable building filesystem images with 4K blocks that can be
     online-resized to a configurable length.
    Author: Daniel Watkins <daniel.watkins@canonical.com>
    
    a b  
    129129                                        FAKE_MTAB="true"
    130130                                fi
    131131
    132                                 Chroot chroot "mkfs.${LB_CHROOT_FILESYSTEM} -F -b 1024 -i 8192 -m 0 -L ${LB_HDD_LABEL} filesystem.${LB_CHROOT_FILESYSTEM}"
     132                                Chroot chroot "mkfs.${LB_CHROOT_FILESYSTEM} -F -b ${LB_EXT_BLOCKSIZE:-1024} -i 8192 -m 0 -L ${LB_HDD_LABEL} ${LB_EXT_RESIZEBLOCKS:+-E resize=${LB_EXT_RESIZEBLOCKS}} filesystem.${LB_CHROOT_FILESYSTEM}"
    133133
    134134                                mkdir -p filesystem.tmp
    135135                                ${LB_ROOT_COMMAND} mount -o loop chroot/filesystem.${LB_CHROOT_FILESYSTEM} filesystem.tmp
     
    199199
    200200                        false)
    201201                                dd if=/dev/zero of=binary/${INITFS}/filesystem.${LB_CHROOT_FILESYSTEM} bs=1024k count=0 seek=${REAL_DIM}
    202                                 mkfs.${LB_CHROOT_FILESYSTEM} -F -b 1024 -i 8192 -m 0 -L ${LB_HDD_LABEL} binary/${INITFS}/filesystem.${LB_CHROOT_FILESYSTEM}
     202                                mkfs.${LB_CHROOT_FILESYSTEM} -F -b ${LB_EXT_BLOCKSIZE:-1024} -i 8192 -m 0 -L ${LB_HDD_LABEL} ${LB_EXT_RESIZEBLOCKS:+-E resize=${LB_EXT_RESIZEBLOCKS}} binary/${INITFS}/filesystem.${LB_CHROOT_FILESYSTEM}
    203203
    204204                                mkdir -p filesystem.tmp
    205205                                ${LB_ROOT_COMMAND} mount -o loop binary/${INITFS}/filesystem.${LB_CHROOT_FILESYSTEM} filesystem.tmp
  • scripts/build/lb_config

    a b  
    5757\t    [--debian-installer-gui true|false]\n\
    5858\t    [--debug]\n\
    5959\t    [-d|--distribution CODENAME]\n\
     60\t    [--ext-block-size 1024|2048|4096]\n\
     61\t    [--ext-resize-blocks N]\n\
     62\t    [--ext-fudge-factor PERCENTAGE]\n\
    6063\t    [--parent-distribution CODENAME]\n\
    6164\t    [--parent-debian-installer-distribution CODENAME]\n\
    6265\t    [--dump]\n\
     
    157160                apt-indices:,bootappend-install:,bootappend-live:,bootappend-failsafe:,bootloader:,checksums:,compression:,config:,zsync:,build-with-chroot:,
    158161                debian-installer:,debian-installer-distribution:,debian-installer-preseedfile:,debian-installer-gui:,
    159162                grub-splash:,isohybrid-options:,hdd-label:,hdd-size:,iso-application:,iso-preparer:,iso-publisher:,
    160                 iso-volume:,jffs2-eraseblock:,memtest:,net-root-filesystem:,net-root-mountoptions:,
     163                iso-volume:,jffs2-eraseblock:,ext-block-size:,ext-resize-blocks:,ext-fudge-factor:,memtest:,net-root-filesystem:,net-root-mountoptions:,
    161164                net-root-path:,net-root-server:,net-cow-filesystem:,net-cow-mountoptions:,net-cow-path:,
    162165                net-cow-server:,net-tarball:,firmware-binary:,firmware-chroot:,swap-file-path:,swap-file-size:,syslinux-theme:,
    163166                win32-loader:,source:,source-images:,breakpoints,conffile:,debug,force,
     
    683686                                shift 2
    684687                                ;;
    685688
     689                        --ext-block-size)
     690                                LB_EXT_BLOCKSIZE="${2}"
     691                                shift 2
     692                                ;;
     693
     694                        --ext-resize-blocks)
     695                                LB_EXT_RESIZEBLOCKS="${2}"
     696                                shift 2
     697                                ;;
     698
     699                        --ext-fudge-factor)
     700                                LB_EXT_FUDGEFACTOR="${2}"
     701                                shift 2
     702                                ;;
     703
    686704                        --jffs2-eraseblock)
    687705                                LB_JFFS2_ERASEBLOCK="${2}"
    688706                                shift 2
     
    13921410# (Default: ${LB_ISO_VOLUME})
    13931411LB_ISO_VOLUME="${LB_ISO_VOLUME}"
    13941412
     1413# \$LB_EXT_BLOCKSIZE: set EXT block size
     1414# (Default: unset)
     1415LB_EXT_BLOCKSIZE="${LB_EXT_BLOCKSIZE}"
     1416
     1417# \$LB_EXT_RESIZEBLOCKS: set EXT resize parameter
     1418# (Default: unset)
     1419LB_EXT_RESIZEBLOCKS="${LB_EXT_RESIZEBLOCKS}"
     1420
     1421# \$LB_EXT_FUDGEFACTOR: set extra size of EXT images (in %)
     1422# (Default: unset)
     1423LB_EXT_FUDGEFACTOR="${LB_EXT_FUDGEFACTOR}"
     1424
    13951425# \$LB_JFFS2_ERASEBLOCK: set jffs2 eraseblock size
    13961426# (Default: unset)
    13971427LB_JFFS2_ERASEBLOCK=""
  • functions/losetup.sh

    a b  
    6868
    6969        case "${FILESYSTEM}" in
    7070                ext2|ext3|ext4)
    71                         PERCENT="5"
     71                        PERCENT="${LB_EXT_FUDGEFACTOR:-5}"
    7272                        ;;
    7373                *)
    7474                        PERCENT="3"
Note: See TracBrowser for help on using the repository browser.