Oh, look, line 29 in the Makefile:How do I get the Makefile to recognise the build environment?
BUILD_OS?= $(shell uname)
So, the Makefile as it stands should be able to handle being built on FreeBSD with any changes/additions?Maybe read the documentation?
mfslinux/BUILD.md at master · mmatuska/mfslinux
Minimalist in-memory diskless Linux distribution based on OpenWrt - mmatuska/mfslinuxgithub.com
Oh, look, line 29 in the Makefile:
Code:BUILD_OS?= $(shell uname)
/bin/ash: Can't create 'bin/ash'
./bin/cat: Can't create 'bin/cat'
./bin/chgrp: Can't create 'bin/chgrp'
./bin/chmod: Can't create 'bin/chmod'
./bin/chown: Can't create 'bin/chown'
./bin/cp: Can't create 'bin/cp'
./bin/date: Can't create 'bin/date'
./bin/dd: Can't create 'bin/dd'
./bin/df: Can't create 'bin/df'
FreeBSD
- git (devel/git), mkisofs (sysutils/cdrtools), opkg-cl (archivers/opkg)
- linux64 module loaded for opkg chroot
Creating an image
Simply run make on Linux or gmake on FreeBSD
linux(4), specifically linux64.ko (doesn't have a separate man page).What is the linux64 module
how do I load it for opkg root?
kldload linux64
?If I runerrors are probably output of tar or cpio archive extraction
why it fails i don't know, probably permissions or readonly fs
tar tf tar-archive
I can see the files listed, but can't managed to extract them. Even tried gtar but that made no difference.star: Operation not supported. Cannot create symbolic link './usr/sbin/ntpd' to '../../bin/busybox'.
star: Operation not supported. Cannot create symbolic link './var' to 'tmp'.
star: Operation not supported. Cannot create symbolic link './www/cgi-bin/cgi-backup' to '../../usr/libexec/cgi-io'.
star: Operation not supported. Cannot create symbolic link './www/cgi-bin/cgi-download' to '../../usr/libexec/cgi-io'.
star: Operation not supported. Cannot create symbolic link './www/cgi-bin/cgi-exec' to '../../usr/libexec/cgi-io'.
star: Operation not supported. Cannot create symbolic link './www/cgi-bin/cgi-upload' to '../../usr/libexec/cgi-io'.
star: Operation not supported. Cannot create symbolic link './www/luci-static/bootstrap-dark' to 'bootstrap'.
star: Operation not supported. Cannot create symbolic link './www/luci-static/bootstrap-light' to 'bootstrap'.
star: 1047 blocks + 0 bytes (total of 10721280 bytes = 10470.00k).
star: The following problems occurred during archive processing:
star: Cannot: stat 0, open 192, read/write 0, chdir 0, iconv 0.
star: Size changed 0.
star: Missing links 0, Name too long 0, File too big 0, Not dumped 0.
star: Skipped for security reason: path name 0, link name 14.
star: See option -secure-links on why some links have been skipped.
star: Processed all possible files, despite earlier errors.
It's good to know that someone has it working.it extracts without any problem on a 13.1-R box
i just downloaded the Makefile and
gmake download_rootfs_tar extract_rootfs_tar
and it works
it creates the tree under $cwd/work
Since you said you have it working, could you tell me if you needed to do anything special to achieve that.it extracts without any problem on a 13.1-R box
i just downloaded the Makefile and
gmake download_rootfs_tar extract_rootfs_tar
and it works
it creates the tree under $cwd/work
Any idea about what is missing from the environment? I notice that linux64 is not loaded. Is it required?Script started on Thu Nov 10 01:36:21 2022
Command: gmake
Removing packages
env: --chroot: No such file or directory
gmake: *** [Makefile:152: /mnt/projects/mfslinux/workdir/mfslinux/work/.remove_packages_done] Error 127
Command exit status: 2
Script done on Thu Nov 10 01:36:21 2022
i did not test it properly, just the fetch / extract part of itSince you said you have it working, could you tell me if you needed to do anything special to achieve that.
I have now overcome the earlier problem by installing a pristine 13.1-R system and have created a jail in which to build mfslinux in an isolated environment. The only pkgs I've installed are devel/git and devel/gmake and have achieved favourable results, but the build fails with this error:-
Any idea about what is missing from the environment? I notice that linux64 is not loaded. Is it required?
Yes I got that bit to work. No idea why the extract didn't work before but it does now under 13.1-R.i did not test it properly, just the fetch / extract part of it
in fact i only downloaded the Makefile from github, had a look at the targets and made
gmake download_rootfs_tar extract_rootfs_tar
it displayed some errors that the working directory is not a git repository but it still fetched / extracted the tar.gs file
https://github.com/mmatuska/mfslinux/blob/master/BUILD.md .I notice that linux64 is not loaded. Is it required?
Requirements
FreeBSD
linux64 module loaded for opkg chroot
Just tried to extract the same archive under Debian and it works without a problem.
It looks like I can'thttps://github.com/mmatuska/mfslinux/blob/master/BUILD.md .
If the build gives problems on FreeBSD try on your Debian system:
kldload linux64
in a jail. Does that sound right?Yes, that's right. Load it on the host system.It looks like I can'tkldload linux64
in a jail. Does that sound right?
The mfslinux BUILD.md clearly states:have created a jail in which to build mfslinux in an isolated environment. The only pkgs I've installed are devel/git and devel/gmake
Requirements
FreeBSD
- git (devel/git), mkisofs (sysutils/cdrtools), opkg-cl (archivers/opkg)
- linux64 module loaded for opkg chroot
Yes, that's right. Load it on the host system.
Furthermore
The mfslinux BUILD.md clearly states:
Also, it's not necessary to build in a isolated environment (jail), a temporary directory will do.
Downloading: base/libreadline8_8.1-1_x86_64.ipk
Downloading: base/zlib_1.2.11-4_x86_64.ipk
fetch: http://downloads.openwrt.org/releases/21.02.2/packages/x86_64//base/zlib_1.2.11-4_x86_64.ipk: Not Found
gmake: *** [Makefile:162: download_packages] Error 1
Command exit status: 2
Script done on Thu Nov 10 10:27:33 2022
The extra " / " can be ignored.This looks like an extra '/' has been substituted somewhere in the Makefile...
mfslinux build instructions
Configuration
Read hints in the default configuration files in the config/default directory. You may copy these files to the config directory and make modifications to suit your needs.
Apparently not, otherwise the mfslinux project author would have taken it into count.I added the missing file and continued to build, but there were over a dozen such changes to be made. I was wondering if there was some way to generate a list of the packages from the generic name rather than the specific version.
Investigate the NICs controller chip and which driver it needs, check OpenWrt kmod packages if there is a package available . I recognize for example kmod-igb_5.4.179-1_x86_64.ipk for Intel gigabit ethernet adapters (igb(4)).what I'm specifically lacking is a driver for my NIC.
How would I add that?
Apparently not, otherwise the mfslinux project author would have taken it into count.
sed s/_.*$// /tmp/mfslinux/workdir/mfslinux/config/default/openwrt_packages_add >required-packages
fetch https://downloads.openwrt.org/releases/21.02.2/packages/x86_64/base/Packages
fetch https://downloads.openwrt.org/releases/21.02.2/packages/x86_64/packages/Packages