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

Fails to build #18

Open
scsijon opened this issue Nov 22, 2019 · 7 comments
Open

Fails to build #18

scsijon opened this issue Nov 22, 2019 · 7 comments

Comments

@scsijon
Copy link

scsijon commented Nov 22, 2019

Building is giving me this error from sccript lline 12>


  • mkdir isoimage
  • cd busybox-1.30.1
  • make distclean defconfig
    make[1]: *** No rule to make target '/file/projects/minimal/minimal-linux-script-master/busybox-1.30.1/Makefile.local'. Stop.
    make[1]: Nothing to be done for '/file/projects/minimal/minimal-linux-script-master/busybox-1.30.1/Makefile.custom'.
    make[1]: Nothing to be done for '/file/projects/minimal/minimal-linux-script-master/busybox-1.30.1/scripts/Kbuild.include'.
    make[1]: Nothing to be done for 'Makefile'.
    HOSTCC scripts/basic/fixdep
    HOSTCC scripts/basic/split-include
    scripts/basic/split-include.c: In function ‘main’:
    scripts/basic/split-include.c:134:6: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
    fgets(old_line, buffer_size, fp_target);
    ^
    HOSTCC scripts/basic/docproc
    GEN include/applets.h
    GEN include/usage.h
    GEN sysklogd/Kbuild
    GEN sysklogd/Config.in
    GEN klibc-utils/Kbuild
    GEN klibc-utils/Config.in
    GEN libpwdgrp/Kbuild
    GEN shell/Kbuild
    GEN shell/Config.in
    GEN libbb/Kbuild
    GEN libbb/Config.in
    GEN e2fsprogs/Kbuild
    GEN e2fsprogs/Config.in
    GEN util-linux/Kbuild
    GEN util-linux/Config.in
    GEN util-linux/volume_id/Kbuild
    GEN util-linux/volume_id/Config.in
    GEN init/Kbuild
    GEN init/Config.in
    GEN coreutils/Kbuild
    GEN coreutils/Config.in
    GEN coreutils/libcoreutils/Kbuild
    GEN mailutils/Kbuild
    GEN mailutils/Config.in
    GEN procps/Kbuild
    GEN procps/Config.in
    GEN selinux/Kbuild
    GEN selinux/Config.in
    GEN printutils/Kbuild
    GEN printutils/Config.in
    GEN debianutils/Kbuild
    GEN debianutils/Config.in
    GEN applets/Kbuild
    GEN archival/Kbuild
    GEN archival/Config.in
    GEN archival/libarchive/Kbuild
    GEN console-tools/Kbuild
    GEN console-tools/Config.in
    GEN loginutils/Kbuild
    GEN loginutils/Config.in
    GEN editors/Kbuild
    GEN editors/Config.in
    GEN modutils/Kbuild
    GEN modutils/Config.in
    GEN findutils/Kbuild
    GEN findutils/Config.in
    GEN runit/Kbuild
    GEN runit/Config.in
    GEN miscutils/Kbuild
    GEN miscutils/Config.in
    GEN networking/Kbuild
    GEN networking/Config.in
    GEN networking/udhcp/Kbuild
    GEN networking/udhcp/Config.in
    GEN networking/libiproute/Kbuild
    GEN scripts/Kbuild
    HOSTCC scripts/kconfig/conf.o
    scripts/kconfig/conf.c: In function ‘conf_askvalue’:
    scripts/kconfig/conf.c:145:3: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
    fgets(line, 128, stdin);
    ^
    scripts/kconfig/conf.c: In function ‘conf_choice’:
    scripts/kconfig/conf.c:393:4: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
    fgets(line, 128, stdin);
    ^
    HOSTCC scripts/kconfig/kxgettext.o
    HOSTCC scripts/kconfig/mconf.o
    scripts/kconfig/mconf.c: In function ‘exec_conf’:
    scripts/kconfig/mconf.c:503:18: error: ‘EINTR’ undeclared (first use in this function)
    if (errno == EINTR || errno == EAGAIN)
    ^
    scripts/kconfig/mconf.c:503:18: note: each undeclared identifier is reported only once for each function it appears in
    scripts/kconfig/mconf.c:503:36: error: ‘EAGAIN’ undeclared (first use in this function)
    if (errno == EINTR || errno == EAGAIN)
    ^
    scripts/kconfig/mconf.c: In function ‘show_textbox’:
    scripts/kconfig/mconf.c:851:2: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
    write(fd, text, strlen(text));
    ^
    scripts/kconfig/mconf.c: In function ‘exec_conf’:
    scripts/kconfig/mconf.c:485:2: warning: ignoring return value of ‘pipe’, declared with attribute warn_unused_result [-Wunused-result]
    pipe(pipefd);
    ^
    scripts/Makefile.host:120: recipe for target 'scripts/kconfig/mconf.o' failed
    make[2]: *** [scripts/kconfig/mconf.o] Error 1
    Makefile:443: recipe for target 'defconfig' failed
    make[1]: *** [defconfig] Error 2
    Makefile:423: recipe for target 'defconfig' failed
    make: *** [defconfig] Error 2


Any ideas? I was planning on a toybox instead of busybox version, but that won't pass this problem either.

thanks

@ivandavidov
Copy link
Owner

I guess your build dependencies are either to old or too new. Try this build in a virtual machine with clean Ubuntu, where you have satisfied the MLS build dependencies. If this error persists, then we can investigate further.

@scsijon
Copy link
Author

scsijon commented Nov 22, 2019

i'm in a Quirky Linux named Xenial Xerus (Ubuntu 16.04 LTS).
libc and libc6 both v2.23 at /lib/x86_64-gnu-linux and
/usr/include/x86_64-gnu-linux;
existing system linux headers and kernel are v4.4.44 if of interest;
?maybe to old?
will try an easyOS and see what happens,
will give feedback (or more questions :-)
thanks for the quick reply

@scsijon
Copy link
Author

scsijon commented Nov 23, 2019

Yup, doesn't like Ubuntu 16.04 LTS, doesn't like OpenEmbeded Linux versions either (they use gcc6.3.0 as standard for it's small sizes of builds), looks like I have to try a deb buster next and see what happens, but sorry I'm not impressed at this point, I thought I had found something good to base with. With no earlier releases to try with either, this may be a stopper point.

@scsijon
Copy link
Author

scsijon commented Nov 23, 2019

and debian buster can build with warnings,

0- a lot of warnings against busybox/miscutils/ and procps/

1- at steps after AR util-linux/volume_id/lib.a
LINK busybox_unstripped
Static linking against glibc, can't use --gc-sections

2- busybox binary setuid root to ensure all configured applets will work properly

haven't tried burning and booting yet, that will happen on the first workstation with dvd r/w priviledges.

@scsijon
Copy link
Author

scsijon commented Nov 23, 2019

And booting the iso gives errors >

ALSA device list:
no soundcards found
platform regulatory.0: Direct firmware load for regulatory.db failed with error-2
cfg80211: failed to load regulatory.db

Also>

ata3: and ata4: both say SATA link down (SStatus 0 Scontrol 300)

as I understand it, it means nothing is connected, but they are ssd's and ata3 was where it was built.

at least I get a responsivea # prompt to start with,

UPDATE: trying to shutdown / halt / etc gives a kernel panic.

i'll persevere and try toybox ilo busybox and a updated kernel next, but not sure if it's suitable for my idea as an interim chroot base towards musl/clang/llvm.

@scsijon
Copy link
Author

scsijon commented Nov 23, 2019

Problem with toybox relates to the init starting script failing and giving a kernel panic, I've asked Rob Landley and the Toybox team to have a look.

An alpha quality kernel-toybox-syslinux script called minimal-2.sh is listed below, some #'d lines have wrapped.


#!/bin/sh
#source minimal-linux at github.com/ivandavedov/minimal gpl3 with kernel, busybox, syslinux
#20191122 scsijon test alpha only, new kernel, toybox ilo busybox, syslinux, use .gz src on purpose
#20191122 scsijon some hashed out as downloaded already and rm not wanted first time, fix later

set -ex
KERNEL_VERSION=5.3.12
TOYBOX_VERSION=0.8.2
SYSLINUX_VERSION=6.03
#rm -rd isoimage
#rm -rd linux-${KERNEL_VERSION}
#rm -rd toybox-${TOYBOX_VERSION}
#rm -rd syslinux-${SYSLINUX_VERSION}
#wget -O kernel.tar.gz http://kernel.org/pub/linux/kernel/v5.x/linux-${KERNEL_VERSION}.tar.gz
#wget -O toybox.tar.gz https://landley.net/toybox/downloads/toybox-${TOYBOX_VERSION}.tar.gz
#wget -O syslinux.tar.gz http://kernel.org/pub/linux/utils/boot/syslinux/syslinux-${SYSLINUX_VERSION}.tar.gz
tar -xvf kernel.tar.gz
tar -xvf toybox.tar.gz
tar -xvf syslinux.tar.gz
mkdir isoimage
cd toybox-${TOYBOX_VERSION}
make distclean
LDFLAGS="--static" make defconfig toybox
mkdir ./_install
make toybox install PREFIX=./_install
cd _install
rm -f linuxrc
mkdir dev proc sys
echo '#!/bin/sh' > init
echo 'dmesg -n 1' >> init
echo 'mount -t devtmpfs none /dev' >> init
echo 'mount -t proc none /proc' >> init
echo 'mount -t sysfs none /sys' >> init
echo 'setsid cttyhack /bin/sh' >> init
chmod +x init
find . | cpio -R root:root -H newc -o | gzip > ../../isoimage/rootfs.gz
cd ../../linux-${KERNEL_VERSION}
make mrproper defconfig bzImage
cp arch/x86/boot/bzImage ../isoimage/kernel.gz
cd ../isoimage
cp ../syslinux-${SYSLINUX_VERSION}/bios/core/isolinux.bin .
cp ../syslinux-${SYSLINUX_VERSION}/bios/com32/elflink/ldlinux/ldlinux.c32 .
echo 'default kernel.gz initrd=rootfs.gz' > ./isolinux.cfg
xorriso
-as mkisofs
-o ../minimal_linux_live.iso
-b isolinux.bin
-c boot.cat
-no-emul-boot
-boot-load-size 4
-boot-info-table
./
cd ..
set +ex


don't foget the empty last line if you copy it.

@scsijon
Copy link
Author

scsijon commented Nov 23, 2019

Just an update at this point.

From the Toybox team came the word that the inbuilt init wasn't at release state at this point, it's still classed at pending, their sugestion is to add and use oneit (which is) instead, by adding a link >
ln -s /sbin/oneit /sbin/init
and >
setsid cttyhack /bin/sh becomes exec /sbin/oneit /bin/sh
;
and i've stuffed the script by building toybox twice, once as static then again dynamic, so i've sorted that out.

I did say it's a test alpha, however it's ok otherwise at this point.

I shall persevere, and update this thread as I go if you care to leave it open, as i like your system and if my output is of use to you, then have fun with it.

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

2 participants