Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Package to SE for install #18

Open
ghost opened this issue Jun 4, 2013 · 8 comments
Open

Add Package to SE for install #18

ghost opened this issue Jun 4, 2013 · 8 comments

Comments

@ghost
Copy link

ghost commented Jun 4, 2013

Im trying to figure out how to add a package to the generated SE iso so that when i boot
the package is actually installed on the host with the os with zfsinstall.... any clues?

I can build an SE iso with packages, yet they appear in the live booted system, not in the installed system.

@johnko
Copy link

johnko commented Jul 12, 2013

It appears packages are integrated only to the mfsroot.gz

You have several options, I'll outline what I think is the easiest, but please test this on a test machine as this is all from my memory. I take no responsibility for loss, damages, etc. Use at your own risk.

This is the easiest, because to upgrade, you just replace the *.tbz files with new ones.

  • copy the package *.tbz to the custom mfsbsd ISO
  • perform your zfsinstall, don't reboot
  • mount your custom mfsbsd ISO to /cdrom
  • pkg_add -fi -C ${MNT} /cdrom/*.tbz
    

EDIT mfsroot.gz not txz

@ghost
Copy link
Author

ghost commented Jul 12, 2013

On Fri, Jul 12, 2013 at 2:01 PM, John Ko [email protected] wrote:

It appears packages are integrated only to the mfsroot.txz

You have several options, I'll outline what I think is the easiest, but please
test this on a test machine
as this is all from my memory. I wave all
responsibility for loss or damages.

This is the easiest, because to upgrade, you just replace the *.tbz files
with new ones.

  • copy the package *.tbz to the custom mfsbsd ISO
  • perform your zfsinstall, don't reboot
  • mount your custom mfsbsd ISO to /cdrom
  • pkg_add -fi -C ${MNT} /cdrom/*.tbz

I was in fact looking for a way to prevent manual intervention such as
maybe a pkg install to the mfsrootfs prior to building the install
iso/usb, so when its extracted during the zfsinstall theyd be there
guess im going to have to crawl through the build scripts, and see if i
decipher a good place for it to be done, thanks for the input.


Reply to this email directly or view it on GitHubhttps://github.com//issues/18#issuecomment-20893070
.

@johnko
Copy link

johnko commented Jul 12, 2013

Packages do get installed to mfsroot.gz when you make iso but it only has the bits needed for mfsbsd. It will not be installed to your disk. UNLESS you did this

zfsinstall -d ada0 -t /cdrom/mfsroot.gz

I'm not even sure the above would work.

*-RELEASE.tar.xz has the files that actually get copied to your drives if you specified

zfsinstall -d ada0 -t /cdrom/9.1-RELEASE-amd64.tar.xz

I still think the easiest is my above suggestion, and if you want to script it, maybe append the commands to the bottom of your custom zfsinstall??

Otherwise every time a package is upgraded, you have to rebuild the 9.1-RELEASE-amd64.tar.xz

EDIT formatting

@johnko
Copy link

johnko commented Jul 13, 2013

WARNING: I HAVEN'T TESTED IT THOROUGHLY

Ok I caved and tried to implement it in my branch... https://github.com/johnko/mfsbsd/tree/getpkgs

Use my build.sh script:

WARNING: my script compiles a custom kernel from source to support a larger mfsroot

git clone https://github.com/johnko/mfsbsd.git
cd mfsbsd
git checkout getpkgs
./build.sh

It should grab the packages defined in the Makefile under PKGDEP and GETPKGS. ie:

PKGDEP=libiconv gettext pkgconf ca_root_nss curl xmlrpc-c-devel sqlite3 \
python27 pcre p5-Net-SMTP-SSL p5-Error p11-kit nspr nettle libwww \
libtorrent libslang2 libsigc++20 libidn libgpg-error gmp expat cvsps
GETPKGS=${PKGDEP} \
bash busybox cdrtools cmdwatch cpdup curl dmidecode dnsmasq dropbear \
e2fsprogs git gmake gnutls ipmitool ipsec-tools mcelog \
nettop nginx nss openssl pftop png portaudit rsync rtorrent \
smartmontools screen

After 5+ hours of world/kernel compiling ... You should then have an BIGNKPT-9.1-RELEASE-amd64.iso

I also modified the zfsinstall script to look for /cdrom/packages and install whatever is in there.

This is bleeding edge, I expect something to be broken...
Don't place anything incompatible with pkg_add in /cdrom/packages....

@ghost
Copy link
Author

ghost commented Jul 13, 2013

On Fri, Jul 12, 2013 at 11:08 PM, John Ko [email protected] wrote:

WARNING: I HAVEN'T TESTED IT THOROUGHLY

Ok I caved and tried to implement it in my branch...
https://github.com/johnko/mfsbsd/tree/getpkgs

Use my build.sh script:

WARNING: my script compiles a custom kernel from source to support a
larger mfsroot

git clone https://github.com/johnko/mfsbsd.git
git checkout getpkgs
./build.sh

It should grab the packages defined in the Makefile under PKGDEP and
GETPKGS. ie:

PKGDEP=libiconv gettext pkgconf ca_root_nss curl xmlrpc-c-devel sqlite3
python27 pcre p5-Net-SMTP-SSL p5-Error p11-kit nspr nettle libwww
libtorrent libslang2 libsigc++20 libidn libgpg-error gmp expat cvsps
GETPKGS=${PKGDEP}
bash busybox cdrtools cmdwatch cpdup curl dmidecode dnsmasq dropbear
e2fsprogs git gmake gnutls ipmitool ipsec-tools mcelog
nettop nginx nss openssl pftop png portaudit rsync rtorrent
smartmontools screen

After 5+ hours of world/kernel compiling ... You should then have an
BIGNKPT-9.1-RELEASE-amd64.iso

I also modified the zfsinstall script to look for /cdrom/packages and
install whatever is in there.

This is bleeding edge, I expect something to be broken... Don't place
anything incompatible with pkg_add in /cdrom/packages....

Sweet this is really nice, only thing i see is the difference between
pkg_install and the newer pkg tools which is what we use,
on a side note.... is there a way that i can "overlay" a set of web pages
into the installer, that are reachable on the booted iso,
and installed during the zfsinstall routine ?? i guess basically at a
minimum im trying to get the bootable iso to start nginx and php-fpm
so i can access a php based interface, then write an installer to interface
to zfsinstall and install the custom build on X machines.... as
like a golden image.


Reply to this email directly or view it on GitHubhttps://github.com//issues/18#issuecomment-20913753
.

@johnko
Copy link

johnko commented Jul 13, 2013

Yes.
As you can see nginx is in the list, I'm not sure what the php packages are, or it's dependencies, so you'll have to figure that out and add those.
You'll need to configure your custom clone of mfsbsd's conf/rc.conf with at least nginx_enable=yes and hope the /usr/local/etc/rc.d/nginx still runs at startup.
You'll also need to embed an nginx.conf with the correct settings and your www root dir (with php/html files)

@johnko
Copy link

johnko commented Jul 13, 2013

@outbackdingo ,

Another thing though, if you boot from mfsbsd with DHCP on (networking with automatic IP), you will have to find out what your IP is before you can get to it from a web browser... which means you will likely be at the console...??

or use conf/interfaces.conf to configure static IPs based on MAC address.

@ghost
Copy link
Author

ghost commented Jul 13, 2013

On Sat, Jul 13, 2013 at 3:00 PM, John Ko [email protected] wrote:

@outbackdingo https://github.com/outbackdingo ,

Another thing though, if you boot from mfsbsd with DHCP on (networking
with automatic IP), you will have to find out what your IP is before you
can get to it from a web browser... which means you will likely be at the
console...??

or use conf/interfaces.conf to configure static IPs based on MAC address.

we have an rc boot script that connects to a management system and reports
its ip netmask and mac so we know what it is within a few seconds of boot,
the interfaces.conf is easy, as every system is identical
Ill hash through getting nginx to load on boot and figure out the php
depends, guess i can add a base www dir and edit the script to cp -R it
into the installed image, ive been reading the scripts a bit more thoroughly
as with your guidance and efforts i now comprehend this a bit better.
Thanks


Reply to this email directly or view it on GitHubhttps://github.com//issues/18#issuecomment-20924703
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant