HTTPS clone URL
Subversion checkout URL
ADO ALLMAN APPLE ARM32_BROKEN_RELOCS ATT AVALON BERGAMINI BKTR_SF BOSTIC BSD CAGNEY CDC CDK CHRISTOS CITRUS CODA COLUMBIA CROOKS CRSG CSRG_contrib CSRG CVSHOME CYGNUS DARRENR DBJ DHCPCD DICKEY DMG DROCHNER EKERMIT ELRICshvfork ERYK_VERSHEN ERYK ESR EZK FILE FLEX FREDETTE FREEBSD_SMBFS FREEBSD FSF FlorianStoehr FreeBSD GCC_2_4_5 GENERIC GITHUB_JMMV GNU_EFI GNU_bc_1_03 GNU_dc_1_03 GNU GOOGLE_CODE GREENWOODSOFTWARE GWR GWR_2_3_8 HEIMDAL HM HPCMIPS HUBERTF IMAKEICIDE_II INTEL IPSEC_TOOLS IS_FPLSP_LIBM ISC ISDN4BSD JEREMY JHD_ECS JRT JSEWARD Jochen_Pohl John_M_Vinopal KAME KIENTZLE KJC KOCIELS KRISTAPS KTH_KRB LAURIKARI LBL LEFEBVRE LEMIS LIBEVENT LINUX LLVM LUA Leo MACKERRAS MALINEN MILLERT MN MOJ MOUSE MR Masaru Matthias Motorola NAWK NETBSD_I386 NETBSD NETPGP NONGNU NTFS NUDELMAN NUDLEMAN NVI NetBSD OPENBSD OPENLDAP OPENPAM OPENPGPSDK OPENSSH OPENSSL OpenBSD PAO PATHSCALE PIERMONT_NELSON PKGSRC PROVOS PROVOS00 Pfaller REDHAT RIPE SENDMAIL_INC SGI SQLITE SUN3 SYN_cache_branch SYNOPSYS Sun TAYLOR TCPDUMP TELTRONICS THORPEJ TMUX TNF TOOLS TROUSERS TZDATA UCB_JHAUSER UCSF UDEL UMD VENEMA VERN_PAXSON VJS WASABI WFJ_920714 WJF_920714 XZ Xen ZLIB abandoned_netbsd_4 ad_audiomp ad_audiomp2 ad_pmax_wscons adler agc_netpgp_standalone agc_pkgs agc_symver alice alpha_nwscons amiga_release atheros_hal before_newconf bjh21_hydra bjh21_wd33c93 bostic_nvi bouyer_ide bouyer_quota2 bouyer_scsipi bouyer_xen2 bouyer_xenamd64 bouyer_xeni386 bozohttpd briggs bsd4_4utah ccranor_mvme68k cgd chap_midi cherry_xenmp chris_arm_intr_rework christos_time_t chs_ubc chs_ubc2 cjs_build_against_obj_dir cmu_sup comdex_fall_1999 csrc_net2 csrg_net2 cube_autoconf curses_v3 darrenr dhcpcd digital draga dynamic_messages eef eeh_devprop eeh_paddr_t eeh elad_kernelauth expat ezk freebsd fsf fvdl_fs64 fvdl_softdep gdamore_uart gehenna_devsw gmcgarry_ctxsw gmcgarry_ucred gmp gwr_gdb gwr_3x3 gzip haad_dm hpcarm_cleanup ifpoll intel ipsec_tools_0_7_branch ipsec_tools_0_8_branch is_m68ktest is_newarp is itohy_usb1 ivory_soap ivory_soap2 jdc jmcneill_audiomp3 jmcneill_pm jmcneill_usbmp jmcneill jruoho_x86intr jwise jym_xensuspend kame keiichi_mipv6 kenh_if_detach kent_audio1 kent_audio2 khorben_n900 kohl kqueue ktrace_lwp leo lonhyn lukem_nsswitch2 madwifi magnum maja marc_pcmcia matt_armv6 matt_dainty matt_mips64 matt_nb4_arm matt_nb5_mips64 matt_nb5_pq3 matt_nb6_plus matt_timespec mesa_drm minoura_x68k_bus_h minoura_xpg4dl minoura mjacob mjf_devfs mjf_devfs2 mjf_ufs_trans mortalinstall mouse mpc mpfr mrg_and_rtr mrg_ohci_jmcneill_usbmp mrg_rcmd mrg_vm_object_collapse mrg_vm_swap mrg_vm_swap2 mrg mw_amiga_machdep_merge mycroft nathanw_sa netbsd_cryptosrc_intl netbsd_cryptosrc_us netbsd netbsd_0_9 netbsd_1_0 netbsd_1_1 netbsd_1_2 netbsd_1_3 netbsd_1_4 netbsd_1_5 netbsd_1_6 netbsd_2 netbsd_2_0 netbsd_2_1 netbsd_3 netbsd_3_0 netbsd_3_1 netbsd_4 netbsd_4_0 netbsd_5 netbsd_5_0 netbsd_5_1 netbsd_5_2 netbsd_6 netbsd_6_0 netbsd_6_1 netbsd_7 netbsd_7_0 newgrp_standalone newlock newlock2 nick_csl_alignment nick_hppapmap nick_net80211_sync nick_nhusb nisimura_pmax_wscons nsswitch nvm openbsd pefo perry perseant_lfsv2 peter_altq peter_eriksson phil_pc532 pkgsrc pkgviews pmax_base ppcoea_renovation ragge rcs reinoud_bufcleanup riastradh_drm2 rmind_smpnet rmind_uvmplock ross_ncr_fb1_123_merge roy rpaulo_netinet_merge_pcb rtr_xorg_branch schmorpforge scottr_mac68k_wscons scw_mvme68k_bus_space scw_mvme167 simonb_timecounters simonb_wapbl sjg sommerfeld_i386_mp_1 sommerfeld_i386mp_1 sun sun3_1_0_base sunpro thomas thorpej_atomic thorpej_bus_dma thorpej_devvp thorpej_mips_cache thorpej_scsipi thorpej_setroot thorpej_signal thorpej_syslogd_hack_branch thorpej_vnode_attr tls_earlyentropy tls_maxphys trunk uebayasi_xip vixie vmlocking vmlocking2 vtag wcurses wrstuden_devbsize wrstuden_fixsa wrstuden_revivesa ws_code yamt_idlelwp yamt_km_doc yamt_km yamt_kmem yamt_lazymbuf yamt_nfs_mp yamt_pagecache yamt_pdpolicy yamt_pf42 yamt_readahead yamt_splraiseipl yamt_uio_vmspace yamt_vop yamt_x86pmap zlib
Nothing to show
Nothing to show
Fetching latest commit...
Cannot retrieve the latest commit at this time.
|Failed to load latest commit information.|
$NetBSD: README,v 1.4 2009/01/03 08:25:35 lukem Exp $ makefs - build a file system image from a directory tree NOTES: * This tool uses modified local copies of source found in other parts of the tree. This is intentional. * makefs is a work in progress, and subject to change. user overview: -------------- makefs creates a file system image from a given directory tree. the following file system types can be built: ffs BSD fast file system cd9660 ISO 9660 file system Support for the following file systems maybe be added in the future ext2fs Linux EXT2 file system fat MS-DOS `FAT' file system (FAT12, FAT16, FAT32) Various file system independent parameters and contraints can be specified, such as: - minimum file system size (in KB) - maximum file system size (in KB) - free inodes - free blocks (in KB) - mtree(8) specification file containing permissions and ownership to use in image, overridding the settings in the directory tree - file containing list of files to specifically exclude or include - fnmatch(3) pattern of filenames to exclude or include - endianness of target file system File system specific parameters can be given as well, with a command line option such as "-o fsspeccific-options,comma-separated". For example, ffs would allow tuning of: - block & fragment size - cylinder groups - number of blocks per inode - minimum free space Other file systems might have controls on how to "munge" file names to fit within the constraints of the target file system. Exit codes: 0 all ok 1 fatal error 2 some files couldn't be added during image creation (bad perms, missing file, etc). image will continue to be made Implementation overview: ------------------------ The implementation must allow for easy addition of extra file systems with minimal changes to the file system independent sections. The main program will: - parse the options, including calling fs-specific routines to validate fs-specific options - walk the tree, building up a data structure which represents the tree to stuff into the image. The structure will probably be a similar tree to what mtree(8) uses internally; a linked list of entries per directory with a child pointer to children of directories. ".." won't be stored in the list; the fs-specific tree walker should add this if required by the fs. this builder have the smarts to handle hard links correctly. - (optionally) Change the permissions in the tree according to the mtree(8) specfile - Call an fs-specific routine to build the image based on the data structures. Each fs-specific module should have the following external interfaces: prepare_options optional file system specific defaults that need to be setup before parsing fs-specific options. parse_options parse the string for fs-specific options, feeding errors back to the user as appropriate cleanup_options optional file system specific data that need to be cleaned up when done with this filesystem. make_fs take the data structures representing the directory tree and fs parameters, validate that the parameters are valid (e.g, the requested image will be large enough), create the image, and populate the image prepare_options and cleanup_options are optional and can be NULL. NOTE: All file system specific options are referenced via the fs_specific pointer from the fsinfo_t strucutre. It is up to the filesystem to allocate and free any data needed for this via the prepare and cleanup callbacks. Each fs-specific module will need to add it's routines to the dispatch array in makefs.c and add prototypes for these to makefs.h All other implementation details should not need to change any of the generic code. ffs implementation ------------------ In the ffs case, we can leverage off sbin/newfs/mkfs.c to actually build the image. When building and populating the image, the implementation can be greatly simplified if some assumptions are made: - the total required size (in blocks and inodes) is determined as part of the validation phase - a "file" (including a directory) has a known size, so support for growing a file is not necessary Two underlying primitives are provided: make_inode create an inode, returning the inode number write_file write file (from memory if DIR, file descriptor if FILE or SYMLINK), referencing given inode. it is smart enough to know if a short symlink can be stuffed into the inode, etc. When creating a directory, the directory entries in the previously built tree data structure is scanned and built in memory so it can be written entirely as a single write_file() operation.