Re: Modifying installXX.iso via script

2019-11-17 Thread chohag
Thomas Bohl writes:
> Am 17.11.2019 um 19:51 schrieb cho...@jtan.com:
> > Thomas Bohl writes:
> >>
> >> Now I want to go the extra step and automate the modification of the
> >> installXX.iso.
> > 
> > I have put an insane amount of work into exactly this, also with
> > an eye to portably directing the process to other operating systems
> > and hosting environments.
>
> Thank you for your quick response. It works now. Even better that the 
> tools in base are enough.
>
> > 
> > I'd be very interested to hear more about what your working on but
>
> Nothing special. Only private stuff. I want to move from to-do lists to 
> scripts. I believe the buzzword is "infrastructure as code" :-)

That is indeed one of the many. Personally I call it "my job" and am doing
my level best to replace myself with a very small shell script. Currently
down to ~3000 lines.

Matthew



Re: Modifying installXX.iso via script

2019-11-17 Thread Thomas Bohl

Thanks. For completeness what I did for now:
# vnconfig vnd0 install66.iso
# mount -t cd9660 /dev/vnd0c cd/
# cp -r cd cd2

# cp bsd-mod.rd cd2/6.6/amd64/bsd.rd
# cp site66.tgz cd2/6.6/amd64/
# mkhybrid -a -R -T -L -l -d -D -N -o install66a.iso -vv -A "Unofficial 
OpenBSD 6.6 amd64 autoinstall CD" -P "Copyright (c) 2019 Theo de Raadt, 
The OpenBSD project" -p "Thomas Bohl " -V "Unofficial 
OpenBSD/amd64 6.6 CD" -b 6.6/amd64/cdbr -c 6.6/amd64/boot.catalog cd2






Re: Modifying installXX.iso via script

2019-11-17 Thread Thomas Bohl

Am 17.11.2019 um 19:51 schrieb cho...@jtan.com:

Thomas Bohl writes:


Now I want to go the extra step and automate the modification of the
installXX.iso.


I have put an insane amount of work into exactly this, also with
an eye to portably directing the process to other operating systems
and hosting environments.


Thank you for your quick response. It works now. Even better that the 
tools in base are enough.




I'd be very interested to hear more about what your working on but


Nothing special. Only private stuff. I want to move from to-do lists to 
scripts. I believe the buzzword is "infrastructure as code" :-)




meanwhile I think the command you're looking for is some variant
on this:

mkiso() {


Thanks. For completeness what I did for now:
# vnconfig vnd0 install66.iso
# mount -t cd9660 /dev/vnd0c cd/
# cp -r cd cd2
# mkhybrid -a -R -T -L -l -d -D -N -o install66a.iso -vv -A "Unofficial 
OpenBSD 6.6 amd64 autoinstall CD" -P "Copyright (c) 2019 Theo de Raadt, 
The OpenBSD project" -p "Thomas Bohl " -V "Unofficial 
OpenBSD/amd64 6.6 CD" -b 6.6/amd64/cdbr -c 6.6/amd64/boot.catalog cd2




Re: Modifying installXX.iso via script

2019-11-17 Thread chohag
Thomas Bohl writes:
>
> Now I want to go the extra step and automate the modification of the 
> installXX.iso.

I have put an insane amount of work into exactly this, also with
an eye to portably directing the process to other operating systems
and hosting environments.

I'd be very interested to hear more about what your working on but
meanwhile I think the command you're looking for is some variant
on this:

mkiso() {
  # Create new iso
  # From src/distrib/amd64/cdfs/Makefile
  if on_openbsd; then
OSREV=$os_version # For easier copy pasta
mkhybrid -a -R -T -L -l -d -D -N -o "$iso_fn" -v -v\
  -A "OpenBSD ${OSREV} amd64 autoinstall CD"   \
  -P "Copyright (c) `date +%Y` Theo de Raadt, The OpenBSD project" \
  -p "Theo de Raadt " \
  -V "OpenBSD/amd64   ${OSREV} boot-only CD"   \
  -b ${OSREV}/amd64/cdbr -c ${OSREV}/amd64/boot.catalog\
  "$s_where"/cd
# -a  all-files
# -R  Rock Ridge
# -T  TRANS.TBL
# -L  Allow .-file
# -l  allow 32char
# -d  Omit trailing period
# -D  not use deep directory relocation, ... Use with caution.
# -N  Omit os_version numbers ... Use with caution.
# -o "$iso_fn"
# -v -v verbose
# -b  boot_image
# -c  boot_catalog

  else
die_unsupported build/target combination
  fi
}

mkhybrid and xorriso are basically the same tool in ways I can't
quite remember right not but could probably be persuaded to. An
invocation of one can be systematically converted into an invocation
of the other.

Enjoy.

Matthew



Modifying installXX.iso via script

2019-11-17 Thread Thomas Bohl

Hello list,

I created an autoinstall bsd.rd (containing auto_install.conf and 
disklabel.conf) and a siteXX.tgz.


For example with the tool isomaster I can manually edit the 
install66.iso and add bsd.rd and site66.tgz to the directory 6.6/amd64. 
This modified ISO can be booted from real and virtual hardware. The 
unattended installation works and is really cool!


Now I want to go the extra step and automate the modification of the 
installXX.iso.


I tried the tool xorriso:
$ ls -l 6.6/amd64/
total 28544
-rwxr-xr-x  1 null  null  10299545 Nov 17 18:00 bsd.rd
-rw-r--r--  1 null  null   4680444 Nov 17 05:03 site66.tgz
$ xorriso -indev install66.iso -outdev install66a.iso -boot_image "any" 
"keep" -add 6.6/amd64/

[1]

This leads to this message when trying to boot:
CD-ROM: E0
Can't find /cdboot

I then moved cdboot from 6.6/amd64 to the root of the CD:
$ xorriso -indev install66.iso -outdev install66a.iso -boot_image "any" 
"keep" -move 6.6/amd64/cdboot cdboot -add 6.6/amd64/


This leads to this message when trying to boot:
CD-ROM: E0
Loading /CDBOOT
probing: pc0 mem[639KB 2046M a20=on]
disk: hd0+ cd0
>> OpenBSD/amd64 CDBOOT 3.44
boot>
cannot open cd0a:/etc/random.seed: No such file or directory
booting cd0a:/6.6/amd64/bsd.rd: open cd0a:/6.6/amd64/bsd.rd: No such 
file or dir

ectory
 failed(2). will try /6.6/amd64/bsd.rd
boot>

When I move bsd.rd to the root of the CD too, I can at least start the 
installation by typing

boot> bsd.rd

But it would be nice if that wouldn't be necessary.

When looking at the ISO files with isomatser, the only difference I can 
find is that

on the modified ISO the publisher information is in all caps.
I'm obviously doing something wrong. Any ideas or alternatives?


[1]
In case the full output is necessary:

$ xorriso -indev install66.iso -outdev install66a.iso -boot_image "any" 
"keep" -add 6.6/amd64/

xorriso 1.4.8 : RockRidge filesystem manipulator, libburnia project.

xorriso : NOTE : Loading ISO image tree from LBA 0
xorriso : UPDATE : 24 nodes read in 1 seconds
xorriso : NOTE : Detected El-Torito boot information which currently is 
set to be discarded

Drive current: -indev 'install66.iso'
Media current: stdio file, overwriteable
Media status : is written , is appendable
Boot record  : El Torito
Media summary: 1 session, 226537 data blocks,  442m data, 62.8g free
Volume id    : 'OpenBSD/amd64   6.6 Install CD'
Drive current: -outdev 'install66a.iso'
Media current: stdio file, overwriteable
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 62.8g free
Added to ISO image: directory '/6.6/amd64'='/home/null/OpenBSD66/6.6/amd64'
xorriso : UPDATE : 2 files added in 1 seconds
xorriso : NOTE : Keeping boot image unchanged
xorriso : UPDATE : Writing:   2000s    0.9%   fifo  43%  buf 50%
xorriso : UPDATE : Writing:  23513s   10.3%   fifo  84%  buf 50%   
32.1xD
xorriso : UPDATE : Writing:  45822s   20.0%   fifo  98%  buf 50%   
33.3xD
xorriso : UPDATE : Writing:  68243s   29.8%   fifo  99%  buf 50%   
33.5xD
xorriso : UPDATE : Writing:  93008s   40.6%   fifo 100%  buf 50%   
33.3xD
xorriso : UPDATE : Writing: 114511s   50.0%   fifo  99%  buf 50%   
32.1xD
xorriso : UPDATE : Writing: 133184s   58.2%   fifo  99%  buf 50%   
27.9xD
xorriso : UPDATE : Writing: 154835s   67.6%   fifo 100%  buf 50%   
32.3xD
xorriso : UPDATE : Writing: 176528s   77.1%   fifo  99%  buf 50%   
32.4xD
xorriso : UPDATE : Writing: 197248s   86.1%   fifo  99%  buf 50%   
30.9xD
xorriso : UPDATE : Writing: 218688s   95.5%   fifo 100%  buf 50%   
32.0xD

ISO image produced: 228822 sectors
Written to medium : 228992 sectors at LBA 32
Writing to 'install66a.iso' completed successfully.