Solved mfsBSD pkg-static

Hi there!

I've got an issue while installing mfsBSD. When trying to sudo make iso -DPKGNG BASE=/mnt/cd/usr/freebsd-dist/ there was an error:
Code:
Installing pkgng ...pkg-static not found at: tools/pkg-static
make: exec(exit) failed (No such file or directory)
*** Error code 1

Stop.
That's all because there was no pkg-static in the tools folder. I even tried to put pkg-1.2.6.txz to packages - still nothing, because the condition of existing pkg-static comes first ;) I also tried both versions, from Git, and from http://mfsbsd.vx.sk/.

Cut from Makefile:
Code:
TOOLSDIR=tools
PKG_STATIC?=${TOOLSDIR}/pkg-static
.if defined(PKGNG)
	@echo -n "Installing pkgng ..."
.  if !exists(${PKG_STATIC})
	@echo "pkg-static not found at: ${PKG_STATIC}"
	@exit 1
.  endif
	@mkdir -p ${_DESTDIR}/usr/local/sbin
	@${INSTALL} -o root -g wheel -m 0755 ${PKG_STATIC} ${_DESTDIR}/usr/local/sbin/
	@${LN} -sf pkg-static ${_DESTDIR}/usr/local/sbin/pkg
	@echo " done"
.endif
Thanks!
 
Re: mfsBSD pkg-static

Hi,

Does it work if you copy your local /usr/local/sbin/pkg-static to ${MFSBSD_SRC_DIR}/tools (replace MFSBSD_SRC_DIR with the location of mfsbsd mfsBSD)?
 
Re: mfsBSD pkg-static

acheron said:
Hi,

Does it work if you copy your local /usr/local/sbin/pkg-static to ${MFSBSD_SRC_DIR}/tools (replace MFSBSD_SRC_DIR with the location of mfsBSD)?

Fantastic! Thanks. I thought there should be a lot of dependencies for a whole pkgng. But somewhere deep in my mind I had a feeling that I should change the location in the Makefile from source, to mine.

Thanks again, I'm going to solve other issues. :D
 
But pkg-static is not working. When I tried to install Samba with dependencies python2 and python27, an error code 70 appeared. If there were no python27.txz:
Code:
Installing python2-2_2...pkg: Missing dependency matching Origin: 'lang/python27' Version: '2.7.6_2'

Failed to install the following 1 package(s): /packages/python2-2_2.txz
*** Error code 70

Stop.
If there were no python2.txz:
Code:
Installing samba36-3.6.22...Installing tevent-0.9.18...pkg: Missing dependency matching Origin: 'lang/python2' Version: '2_2'

Failed to install the following 1 package(s): /packages/samba36-3.6.22.txz
*** Error code 70

Stop.

Thanks.
 
I have the same problem here and I can't figure out why. A quick and dirty hack is to patch the Makefile with this:
Code:
--- Makefile.orig       2014-03-08 18:34:43.763695659 +0100
+++ Makefile    2014-03-08 18:34:21.074696973 +0100
@@ -311,7 +311,7 @@
 .if defined(PKGNG)
        @if [ -d "${_DESTDIR}/packages" ]; then \
                cd ${_DESTDIR}/packages && for FILE in *; do \
-                       ${PKG} -c ${_DESTDIR} add /packages/$${FILE}; \
+                       ${PKG} -c ${_DESTDIR} add -f /packages/$${FILE}; \
                done; \
        fi
 .else
 
acheron said:
Same problem here and I can't figure why. A quick and dirty hack is to patch Makefile with this:
Code:
--- Makefile.orig       2014-03-08 18:34:43.763695659 +0100
+++ Makefile    2014-03-08 18:34:21.074696973 +0100
@@ -311,7 +311,7 @@
 .if defined(PKGNG)
        @if [ -d "${_DESTDIR}/packages" ]; then \
                cd ${_DESTDIR}/packages && for FILE in *; do \
-                       ${PKG} -c ${_DESTDIR} add /packages/$${FILE}; \
+                       ${PKG} -c ${_DESTDIR} add -f /packages/$${FILE}; \
                done; \
        fi
 .else
I also thought about use --force,but isn't that a bit too dirty, because, I'm not quite sure, but there was no pkg-database of all packages and dependencies installed in that image. Or is it?

Thanks.
 
In fact the portion of the Makefile that adds packages is not really smart and will fail if a package is to be installed but is already installed (because it depends on another package previously installed). This is the case for python2-2_2.txz. I'm not sure I was clear. As you can see in the Makefile, the --force flag is used with the old pkg_add tools, so my patch is not so ugly after all.

The pkg database is in mfsbsd/tmp/var/db/pkg/local.sqlite and you can list the installed package with the following command: pkg -c /home/miki/mfsbsd/tmp/mfs/ info.
 
Code:
Installing python2-2_2...pkg: package python2 is already installed, forced install
 done
Installing python27-2.7.6_2...python27-2.7.6_2 already installed

Failed to install the following 1 package(s): /packages/python27-2.7.6_2.txz
*** Error code 70

Stop.
Ok, it's time to grab lots of bear, and start a hot relationships with mfsBSD, and foo2zjs for my lj 1020 :D
 
acheron said:
In fact the portion of Makefile that adds packages are not really smart and will fail if a package is to be installed but is already installed (because it dependents of another package previously installed). This is the case for python2-2_2.txz. I'm not sure I was clear...
That is obvious. But:
As you can see in the Makefile, the --force flag is used with the old pkg_add tools, so my patch is not so ugly after all.

The pkg database is in mfsbsd/tmp/var/db/pkg/local.sqlite and you can list the installed package with the following command:
pkg -c /home/miki/mfsbsd/tmp/mfs/ info

The --force flag in that place is not for old pkg_*, it is in the
Code:
.if defined(PKGNG)
region. Am I right?
 
Nope, it's for pkg_add: env PKG_PATH=/packages pkg_add -fi -C ${_DESTDIR} /packages/$${FILE} > /dev/null; \
 
acheron said:
Nope, it's for pkg_add:
Code:
env PKG_PATH=/packages pkg_add -fi -C ${_DESTDIR} /packages/$${FILE} > /dev/null; \
That is in the .else row, if you didn't plug the -DPKG or PKG=1, what I actually did. Anyway, it still wont install python27 as a new package, if python2 were installed with dependencies, even with the --force flag :(

I think about another way, maybe it's better to deploy a clear system as a virtual guest, and then somehow install packages, after that make clean.
 
Re: mfsBSD pkg-static

Can you try this patch:
Code:
@@ -311,8 +310,7 @@
 .if defined(PKGNG)
        @if [ -d "${_DESTDIR}/packages" ]; then \
                cd ${_DESTDIR}/packages && for FILE in *; do \
-                       PKG_NAME=$$(${PKG} -c ${_DESTDIR} info -qoF /packages/$${FILE}); \
-                       ${PKG} -c ${_DESTDIR} info -e $${PKG_NAME} || ${PKG} -c ${_DESTDIR} add /packages/$${FILE}; \
+                       ${PKG} -c ${_DESTDIR} add /packages/$${FILE}; \
                done; \
        fi
 .else
 
[SOLVED] Re: mfsBSD pkg-static

acheron said:
Can you try this patch:
Code:
@@ -311,8 +310,7 @@
 .if defined(PKGNG)
        @if [ -d "${_DESTDIR}/packages" ]; then \
                cd ${_DESTDIR}/packages && for FILE in *; do \
-                       PKG_NAME=$$(${PKG} -c ${_DESTDIR} info -qoF /packages/$${FILE}); \
-                       ${PKG} -c ${_DESTDIR} info -e $${PKG_NAME} || ${PKG} -c ${_DESTDIR} add /packages/$${FILE}; \
+                       ${PKG} -c ${_DESTDIR} add /packages/$${FILE}; \
                done; \
        fi
 .else

OMG. I'm so sorry, I just modifying Makefile, without deleting
Code:
${PKG} -c ${_DESTDIR} add /packages/$${FILE}; \
as no needed, after adding
Code:
PKG_NAME=$$(${PKG} -c ${_DESTDIR} info -qoF /packages/$${FILE}); \
${PKG} -c ${_DESTDIR} info -e $${PKG_NAME} || ${PKG} -c ${_DESTDIR} add /packages/$${FILE}; \
Now continued compressing usr/
I'm so sorry for misunderstanding you.
 
Re: mfsBSD pkg-static

acheron said:
So it works now?
Yes, thanks a lot!
Now reading about increasing NKPT, because
Code:
Creating and compressing mfsroot ...makefs: `/usr/home/kaldown/kursach/mfsBSD/mfsbsd/tmp/mfs' size of 85368832 is larger than the maxsize of 67108864.
*** Error code 1

Stop.
Code:
% less BUILD
....
WARNING: Your image should not exceed 45MB in total, otherwise kernel panic
             may occur on boot-time. To allow bigger images, you have to
             recompile your kernel with increased NKPT (e.g. NKPT=120)
Interesting that https://github.com/mmatuska/mfsbsd/issues/25
mmatuska commented 4 months ago Owner
This will be resolved in FreeBSD 10.0, there is dynamic NKPT.
Code:
 % uname -a
FreeBSD d610.kaldown.net 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Fri Jan 17 01:46:25 UTC 2014     root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC  i386
 
Re: mfsBSD pkg-static

Try to bump MFSROOT_MAXSIZE to 96m and see if your kernel still boot.
 
Re: mfsBSD pkg-static

acheron said:
Try to bump MFSROOT_MAXSIZE to 96m and see if your kernel still boot.
Code:
Compressing usr ... done
Creating and compressing mfsroot ... done
Creating ISO image ... done
-rw-r--r--  1 root  wheel  66906112 Mar 11 01:50 mfsbsd-10.0-RELEASE-i386.iso

Yes!
Thanks a lot, really appreciate that.
Where did you get such an info, I search whole internet and didn't get enough info about mfsBSD.
 
Re: mfsBSD pkg-static

I've found everything in the Makefile, I haven't used mfsBSD so far.
 
Back
Top