Re: Changing disk image boot options without root privileges

2017-04-18 Thread Michael van Elst
dyo...@pobox.com (David Young) writes: >On Sun, Apr 16, 2017 at 01:48:30PM +0300, Andreas Gustafsson wrote: >> I can fix that using vnconfig and installboot like this: >> >> vnconfig vnd0 NetBSD-7.99.1-amd64-live-wd0root.img >> installboot -e -o console=com0 /dev/vnd0a >> vnconfig -u vnd0

Re: Changing disk image boot options without root privileges

2017-04-17 Thread Thor Lancelot Simon
On Mon, Apr 17, 2017 at 10:31:32PM +0300, Andreas Gustafsson wrote: > David Young wrote: > > installboot can run on a disk image directly, unless there has > > been some regression. > > It works with a file system image, but not with a disk image where the > boot partition starts at a nonzero offs

Re: Changing disk image boot options without root privileges

2017-04-17 Thread Andreas Gustafsson
David Young wrote: > installboot can run on a disk image directly, unless there has > been some regression. It works with a file system image, but not with a disk image where the boot partition starts at a nonzero offset, which is the typical layout on i386 and amd64. -- Andreas Gustafsson, g...@

Re: Changing disk image boot options without root privileges

2017-04-17 Thread David Young
On Sun, Apr 16, 2017 at 01:48:30PM +0300, Andreas Gustafsson wrote: > I can fix that using vnconfig and installboot like this: > > vnconfig vnd0 NetBSD-7.99.1-amd64-live-wd0root.img > installboot -e -o console=com0 /dev/vnd0a > vnconfig -u vnd0 installboot can run on a disk image directly,

Re: Changing disk image boot options without root privileges

2017-04-17 Thread Izumi Tsutsui
> > Isn't there a way for installboot to find the offset itself? > > Perhaps it could be done by sharing the code in disklabel(8) for > finding the disklabel, and then looking up the offset in the > disklabel. installboot(8) for hp300 already checks disklabel(5) to search "boot" partition, but in

Re: Changing disk image boot options without root privileges

2017-04-17 Thread Andreas Gustafsson
Christos Zoulas wrote: > >> - add an "partition offset" option to installboot(8) like makefs(8)'s -O > > > >That's not very user friendly but I think it would work. If no one > >comes up with a way to do it using existing tools, I might add that. > > Yes, I think that should be easy enough. I ha

Re: Changing disk image boot options without root privileges

2017-04-17 Thread Christos Zoulas
In article <22771.22148.161738.374...@guava.gson.org>, Andreas Gustafsson wrote: >Izumi Tsutsui wrote: >> - prepare "serial console liveimage option" to build.sh by >> - using INSTALLBOOTOPTIONS (see distrib/common/bootimage/Makefile.bootimage) >> - special boot.cfg(5) to set consdev=com0 > >I'

Re: Changing disk image boot options without root privileges

2017-04-16 Thread Taylor R Campbell
> Date: Sun, 16 Apr 2017 13:48:30 +0300 > From: Andreas Gustafsson > > vnconfig vnd0 NetBSD-7.99.1-amd64-live-wd0root.img > installboot -e -o console=com0 /dev/vnd0a > vnconfig -u vnd0 > > but the problem is that it requires root privileges, which the > automated test infrastructure doesn'

Re: Changing disk image boot options without root privileges

2017-04-16 Thread Andreas Gustafsson
I played around with rump a bit and the following seems to work: #!/bin/sh img=./NetBSD-7.99.1-amd64-live-wd0root.img export RUMP_SERVER=unix:///tmp/installboot_rumpserv offset=$(disklabel $img | awk '/ a:/ { print $3 }') size=$(disklabel $img | awk '/ a:/ { print $2 }') rump_server -l

Re: Changing disk image boot options without root privileges

2017-04-16 Thread Izumi Tsutsui
> How is the image made bootable in an unprivileged build ? > The same can probably be used to change the boot option. installboot(8) against a single raw ffs partition, then MBR and swap etc. for the whole image are concatenated by cat(1): https://nxr.netbsd.org/xref/src/distrib/common/bootimage

Re: Changing disk image boot options without root privileges

2017-04-16 Thread Andreas Gustafsson
Izumi Tsutsui wrote: > - prepare "serial console liveimage option" to build.sh by > - using INSTALLBOOTOPTIONS (see distrib/common/bootimage/Makefile.bootimage) > - special boot.cfg(5) to set consdev=com0 I'd like to avoid building special images for testing, because that would mean the image be

Re: Changing disk image boot options without root privileges

2017-04-16 Thread Andreas Gustafsson
Manuel Bouyer wrote: > How is the image made bootable in an unprivileged build ? It first builds an image of the root partition, runs installboot on that, and then constructs the full disk image by concatenating the initial label area and the root partition using "cat". See src/distrib/common/boo

Re: Changing disk image boot options without root privileges

2017-04-16 Thread Manuel Bouyer
On Sun, Apr 16, 2017 at 01:48:30PM +0300, Andreas Gustafsson wrote: > Hi all, > > The build.sh script has a "live-image" target, but the resulting live > images are not being systematically tested. I would like to set up > automated tests for them, but I'm stuck on the issue below. > > The i386

Re: Changing disk image boot options without root privileges

2017-04-16 Thread Izumi Tsutsui
> vnconfig vnd0 NetBSD-7.99.1-amd64-live-wd0root.img > installboot -e -o console=com0 /dev/vnd0a > vnconfig -u vnd0 > > but the problem is that it requires root privileges, which the > automated test infrastructure doesn't (and shouldn't) have. > > Is there a way to accomplish this without

Changing disk image boot options without root privileges

2017-04-16 Thread Andreas Gustafsson
Hi all, The build.sh script has a "live-image" target, but the resulting live images are not being systematically tested. I would like to set up automated tests for them, but I'm stuck on the issue below. The i386 and amd64 live images are configured to use the PC VGA console, but for the automa