looking for something like a union file system
I am using a dev tool that maintains a "split" source tree for currently worked on files and those in the repo (aegis which is slightly different then how svn or cvs does it) and my the default build system assumes it is all in one tree thus I want someway of merge the two dirs and have a copy on write via a special command for it (i.e. if I start to edit foo.c it automatically checks it out for me) any ideas? ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
convert bootable freebsd iso to bootable flash image
Just in case people have a similar need, or can point me to better code to do the same job: i needed to convert a bootable FreeBSD iso image into a bootable flash image, and have come up with the following code (derived from PicoBSD). The nice part is that this is all done without requiring root permissions -- the iso extraction is done with bsdtar, the file system is created using makefs, and the other patching is done with bsdlabel and dd. Now i need to find something similar to convert a bootable linux image and a bootable DOS image :) cheers luigi --- cut here #!/bin/sh # convert a FreeBSD iso to flash image # # based on picobsd tricks. # requires makefs, bsdlabel, bsdtar, sed and dd MAKEFS=makefs MKLABEL=bsdlabel BSDTAR=tar make_freebsd_image() { # tree imagefile local tree=$1 local imagefile=$2 local boot1=${tree}/boot/boot1 local boot2=${tree}/boot/boot2 echo "convert tree $tree image $img" ${MAKEFS} -t ffs -o bsize=4096 -o fsize=512 \ -f 50 ${imagefile} ${tree} ${MKLABEL} -w -f ${imagefile} auto # write a label # copy partition c: into a: with some sed magic ${MKLABEL} -f ${imagefile} | sed -e '/ c:/{p;s/c:/a:/;}' | \ ${MKLABEL} -R -f ${imagefile} /dev/stdin # dump the primary and secondary boot (primary is 512 bytes) dd if=${boot1} of=${imagefile} conv=notrunc 2>/dev/null # XXX secondary starts after the 0x114 = dec 276 bytes of the label # so we skip 276 from the source, and 276+512=788 from dst # the old style blocks used 512 and 1024 respectively dd if=${boot2} iseek=1 ibs=276 2> /dev/null | \ dd of=${imagefile} oseek=1 obs=788 conv=notrunc 2>/dev/null } tree=$1 image=$2 if [ -f $1 ] ; then echo "Extract files from ${image}" tmp="${image}.tree" mkdir -p $tmp (cd $tmp && ${BSDTAR} xf $tree) tree=$tmp fi make_freebsd_image $tree $image [ -d "$tmp" ] && (chmod -R +w $tmp && rm -rf $tmp) #-- end of fil ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Unprivileged user can't set sticky bit on a file; why?
On Thu, Nov 13, 2008 at 11:05:21PM -0800, Nate Eldredge wrote: > since root is able to do it. src/sys/ufs/ufs/ufs_vnops.c has the > following comment: > > /* > * Privileged processes may set the sticky bit on non-directories, > * as well as set the setgid bit on a file with a group that the > * process is not a member of. Both of these are allowed in > * jail(8). > */ > > but does not explain why unprivileged process should be forbidden to set > the sticky bit. I'm guessing a little, but this check has been there since the first revision of ufs_vnops.c in FreeBSD, see: http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/ufs/ufs/ufs_vnops.c?annotate=1.1 line 424. When this was imported, there was still a call to vnode_pager_uncache based on the sticky bit a few lines down. This may explain why the check was there at the time - it was to stop ordinary users giving hints to the pager system. David. ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Unprivileged user can't set sticky bit on a file; why?
On Fri, 14 Nov 2008, Volodymyr Kostyrko wrote: Nate Eldredge wrote: I came across this when trying to rsync some files which had the sticky bit set on the remote side. (It's the historical Unix archive from tuhs.org; the files in question are part of an unpacked V7 UNIX installation, for which the sticky bit of course had meaning. :-) ) It's annoying that this makes rsync fail; it messes up my mirroring script. You can ask rsync to change file attributes on the fly with the --chmod option. Just my 2c. Thanks for this hint. "--chmod=F-t" solves my problem. But I am still curious about this behavior. -- Nate Eldredge [EMAIL PROTECTED] ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Unprivileged user can't set sticky bit on a file; why?
Nate Eldredge wrote: I came across this when trying to rsync some files which had the sticky bit set on the remote side. (It's the historical Unix archive from tuhs.org; the files in question are part of an unpacked V7 UNIX installation, for which the sticky bit of course had meaning. :-) ) It's annoying that this makes rsync fail; it messes up my mirroring script. You can ask rsync to change file attributes on the fly with the --chmod option. Just my 2c. -- Sphinx of black quartz judge my vow. ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: assigning interrupts
John Baldwin wrote: On Thursday 13 November 2008 05:03:20 am Ronnel P. Maglasang wrote: Hi All, Is there a way to explicitly assign an interrupt of a device? I'm running on 6.3 and the two NICs share the same interrupt. Obviously this will affect the performance if the NICs are exposed to heavy network traffic. # vmstat -i interrupt total rate irq11: em0 vr0+ 1081099 77 Total 16958562 1222 Looking at the driver's code, I have the initial though that this is the place where I can modify. -- adapter->res_interrupt = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); -- I've tried changing RF_SHAREABLE to RF_ALLOCATED or other values but still could not get the desired result and worst the device fail to initialize. Is this possible in 6.3? You can not easily assign them, no. In many cases the interrupt pins from the devices may be hardwired to a single input pin on an interrupt controller. In that case there is nothing you can do. You can read more about the gory details here: http://people.freebsd.org/~jhb/papers/bsdcan/2007/ What was changed in 7.x in terms of assigning interrupts? I have another box running on 7.0 (2 NICs). I noticed there are no devices sharing interrupts. But if 6.x is installed on the same box (previous installation), the two NICs will share the same interrupt. I'm now looking at the drivers. I assume this is not NIC-firmware related. ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"