Adding --jffs2-eraseblock parameter.

Marco sais, that flash devices often need a different erase size than mkfs.jffs2
defaults to. Hence, this parameter passes the blocksize to the mkfs.jffs2 call
through --eraseblock option.
This commit is contained in:
Daniel Baumann 2008-03-01 13:19:54 +01:00
parent ccb76dc4a4
commit 2e50db26fd
2 changed files with 19 additions and 4 deletions

View File

@ -150,15 +150,20 @@ case "${LH_CHROOT_FILESYSTEM}" in
# Installing depends
Install_package
# Remove old ext2 image
# Remove old jffs2 image
if [ -f binary/${INITFS}/filesystem.jffs2 ]
then
rm -f binary/${INITFS}/filesystem.jffs2
fi
if [ -n "${LH_JFFS2_ERASEBLOCK}" ]
then
JFFS2_OPTIONS="--eraseblock=${LH_JFFS2_ERASEBLOCK}"
fi
case "${LH_CHROOT_BUILD}" in
enabled)
Chroot "mkfs.jffs2 --root=chroot --output filesystem.jffs2"
Chroot "mkfs.jffs2 ${JFFS2_OPTIONS} --root=chroot --output filesystem.jffs2"
# Move image
mv chroot/filesystem.jffs2 binary/${INITFS}
@ -166,7 +171,7 @@ case "${LH_CHROOT_FILESYSTEM}" in
;;
disabled)
mkfs.jffs2 --root=chroot --output binary/${INITFS}/filesystem.jffs2
mkfs.jffs2 ${JFFS2_OPTIONS} --root=chroot --output binary/${INITFS}/filesystem.jffs2
;;
esac

View File

@ -70,6 +70,7 @@ USAGE="${PROGRAM} [--apt apt|aptitude]\n\
\t [--iso-preparer NAME]\n\
\t [--iso-publisher NAME]\n\
\t [--iso-volume NAME]\n\
\t [--jffs2-eraseblock SIZE]\n\
\t [--keyring-packages PACKAGE|\"PACKAGES\"]\n\
\t [-l|--language LANGUAGE]\n\
\t [-k|--linux-flavours FLAVOUR|\"FLAVOURS\"]\n\
@ -114,7 +115,7 @@ USAGE="${PROGRAM} [--apt apt|aptitude]\n\
Local_arguments ()
{
ARGUMENTS="$(getopt --longoptions apt:,apt-ftp-proxy:,apt-http-proxy:,apt-pdiffs:,apt-options:,aptitute-options:,apt-pipeline:,apt-recommends:,apt-secure:,bootstrap:,cache:,cache-indices:,cache-packages:,cache-stages:,debconf-frontend:,debconf-nowarnings:,debconf-priority:,genisoimage:,initramfs:,fdisk:,losetup:,mode:,root-command:,use-fakeroot:,tasksel:,includes:,templates:,architecture:,bootstrap-config:,bootstrap-flavour:,bootstrap-keyring:,distribution:,mirror-bootstrap:,mirror-chroot:,mirror-chroot-security:,mirror-binary:,mirror-binary-security:,sections:,chroot-filesystem:,union-filesystem:,exposed-root:,hooks:,interactive:,keyring-packages:,language:,linux-flavours:,linux-packages:,packages:,packages-lists:,tasks:,security:,symlinks:,sysvinit:,binary-filesystem:,binary-images:,binary-indices:,bootappend-install:,bootappend-live:,bootloader:,checksums:,chroot-build:,debian-installer:,debian-installer-daily:,encryption:,grub-splash:,hostname:,iso-application:,iso-preparer:,iso-publisher:,iso-volume:,memtest:,net-root-filesystem:,net-root-mountoptions:,net-root-path:,net-root-server:,net-cow-filesystem:,net-cow-mountoptions:,net-cow-path:,net-cow-server:,net-tarball:,syslinux-splash:,syslinux-timeout:,syslinux-menu:,username:,source:,source-images:,breakpoints,conffile:,debug,force,help,quiet,usage,verbose,version --name=${PROGRAM} --options a:f:d:m:l:k:p:b:e:s:c:huv --shell sh -- "${@}")"
ARGUMENTS="$(getopt --longoptions apt:,apt-ftp-proxy:,apt-http-proxy:,apt-pdiffs:,apt-options:,aptitute-options:,apt-pipeline:,apt-recommends:,apt-secure:,bootstrap:,cache:,cache-indices:,cache-packages:,cache-stages:,debconf-frontend:,debconf-nowarnings:,debconf-priority:,genisoimage:,initramfs:,fdisk:,losetup:,mode:,root-command:,use-fakeroot:,tasksel:,includes:,templates:,architecture:,bootstrap-config:,bootstrap-flavour:,bootstrap-keyring:,distribution:,mirror-bootstrap:,mirror-chroot:,mirror-chroot-security:,mirror-binary:,mirror-binary-security:,sections:,chroot-filesystem:,union-filesystem:,exposed-root:,hooks:,interactive:,keyring-packages:,language:,linux-flavours:,linux-packages:,packages:,packages-lists:,tasks:,security:,symlinks:,sysvinit:,binary-filesystem:,binary-images:,binary-indices:,bootappend-install:,bootappend-live:,bootloader:,checksums:,chroot-build:,debian-installer:,debian-installer-daily:,encryption:,grub-splash:,hostname:,iso-application:,iso-preparer:,iso-publisher:,iso-volume:,jffs2-eraseblock:,memtest:,net-root-filesystem:,net-root-mountoptions:,net-root-path:,net-root-server:,net-cow-filesystem:,net-cow-mountoptions:,net-cow-path:,net-cow-server:,net-tarball:,syslinux-splash:,syslinux-timeout:,syslinux-menu:,username:,source:,source-images:,breakpoints,conffile:,debug,force,help,quiet,usage,verbose,version --name=${PROGRAM} --options a:f:d:m:l:k:p:b:e:s:c:huv --shell sh -- "${@}")"
if [ "${?}" != "0" ]
then
@ -505,6 +506,11 @@ Local_arguments ()
shift 2
;;
--jffs2-eraseblock)
LH_JFFS2_ERASEBLOCK="${2}"
shift 2
;;
--memtest)
LH_MEMTEST="${2}"
shift 2
@ -1010,6 +1016,10 @@ LH_ISO_PUBLISHER="${LH_ISO_PUBLISHER}"
# (Default: ${LH_ISO_VOLUME})
LH_ISO_VOLUME="${LH_ISO_VOLUME}"
# \$LH_JFFS2_ERASEBLOCK: set jffs2 eraseblock size
# (Default: unset)
LH_JFFS2_ERASEBLOCK=""
# \$LH_MEMTEST: set memtest
# (Default: ${LH_MEMTEST})
LH_MEMTEST="${LH_MEMTEST}"