michaeljclark / busybear-linux

busybear-linux is a tiny RISC-V Linux root filesystem image that targets the VirtIO board in riscv-qemu.
93 stars 33 forks source link

.Trying to build busybear in Linux Mint. #7

Open tromedo opened 5 years ago

tromedo commented 5 years ago

Hey Guys,

I am trying to build busybear on Linux Mint and am getting the following error. For context, I am trying to cross compile Linux for RISC-V using QEMU. Attaching the last couple of lines of output below. Noob to linux toolchains and stuff so any help would be great.

Terminal Output:

CHK include/generated/compile.h AR built-in.a LD vmlinux.o MODPOST vmlinux.o KSYM .tmp_kallsyms1.o KSYM .tmp_kallsyms2.o LD vmlinux SYSMAP System.map make[1]: Leaving directory '/media/sriram/Data/RISCV/busybear-linux/build/linux-5.0-rc2' ./scripts/build.sh: line 84: ../../src/riscv-pk/configure: No such file or directory Makefile:10: recipe for target 'busybear.bin' failed make: *** [busybear.bin] Error 127

rgdaddio commented 5 years ago

Same error: ./scripts/build.sh: line 84: ../../src/riscv-pk/configure: No such file or directory. This file is missing and is causing build failure.

tromedo commented 5 years ago

How to get that file? I mean I just cloned this source and built it. Does it mean the package is incomplete?

rgdaddio commented 5 years ago

@tromedo it looks like there was a directory change from using "deps" to using "src". And deps was removed, that was where configure used to be.

Perhaps the commiter forgot to push the file to the new src directory. I tried to go back in time with github but no success. Hopefully the owner will get the notification.

michaeljclark commented 5 years ago

I'm looking into this right now...

michaeljclark commented 5 years ago

Hiya,

I just did a fresh clone of the repo and it appears fine:

$ time make
./scripts/build.sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 7408k  100 7408k    0     0  2195k      0  0:00:03  0:00:03 --:--:-- 2195k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1585k  100 1585k    0     0  1298k      0  0:00:01  0:00:01 --:--:-- 1297k
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   178  100   178    0     0    424      0 --:--:-- --:--:-- --:--:--   424
100  156M    0  156M    0     0  5391k      0 --:--:--  0:00:29 --:--:-- 5940k
make[1]: Entering directory '/home/mclark/src/mjc/t/busybear-linux/build/busybox-1.30.0'

[output snip]

make[1]: Leaving directory '/home/mclark/src/mjc/t/busybear-linux/build/riscv-pk'
100+0 records in
100+0 records out
104857600 bytes (105 MB, 100 MiB) copied, 0.0473277 s, 2.2 GB/s
mke2fs 1.44.1 (24-Mar-2018)
Discarding device blocks: done                            
Creating filesystem with 102400 1k blocks and 25688 inodes
Filesystem UUID: b77dd5e4-9b19-4ef5-bb56-bc0b890b6c82
Superblock backups stored on blocks: 
    8193, 24577, 40961, 57345, 73729

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done 

+++ successfully created busybear.bin
-rw-r--r-- 1 mclark mclark 104857600 Mar  4 12:40 busybear.bin

real    1m25.290s
user    12m29.659s
sys 0m47.368s
$  ./scripts/start-qemu.sh 
bbl loader
[    0.000000] OF: fdt: Ignoring memory range 0x80000000 - 0x80200000
[    0.000000] No DTB passed to the kernel
[    0.000000] Linux version 5.0.0-rc2 (mclark@munty) (gcc version 8.2.0 (GCC)) #1 SMP Mon Mar 4 12:39:42 NZDT 2019
[    0.000000] initrd not found or empty - disabling initrd
[    0.000000] Zone ranges:
[    0.000000]   DMA32    [mem 0x0000000080200000-0x0000000087ffffff]
[    0.000000]   Normal   [mem 0x0000000088000000-0x0000087fffffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000080200000-0x0000000087ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000080200000-0x0000000087ffffff]
[    0.000000] software IO TLB: mapped [mem 0x83e3d000-0x87e3d000] (64MB)
[    0.000000] elf_hwcap is 0x112d
[    0.000000] percpu: Embedded 16 pages/cpu @(____ptrval____) s25112 r8192 d32232 u65536
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 31815
[    0.000000] Kernel command line: root=/dev/vda ro console=ttyS0
[    0.000000] Dentry cache hash table entries: 16384 (order: 5, 131072 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 4, 65536 bytes)
[    0.000000] Sorting __ex_table...
[    0.000000] Memory: 55664K/129024K available (3283K kernel code, 227K rwdata, 932K rodata, 148K init, 764K bss, 73360K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU event tracing is enabled.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS: 0, nr_irqs: 0, preallocated irqs: 0
[    0.000000] plic: mapped 10 interrupts to 1 (out of 2) handlers.
[    0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x24e6a1710, max_idle_ns: 440795202120 ns
[    0.000074] sched_clock: 64 bits at 10MHz, resolution 100ns, wraps every 4398046511100ns
[    0.001690] Console: colour dummy device 80x25
[    0.002500] Calibrating delay loop (skipped), value calculated using timer frequency.. 20.00 BogoMIPS (lpj=40000)
[    0.002587] pid_max: default: 32768 minimum: 301
[    0.003216] Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
[    0.003251] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes)
[    0.018898] rcu: Hierarchical SRCU implementation.
[    0.021893] smp: Bringing up secondary CPUs ...
[    0.021957] smp: Brought up 1 node, 1 CPU
[    0.039760] devtmpfs: initialized
[    0.042811] random: get_random_u32 called from bucket_table_alloc+0x76/0x178 with crng_init=0
[    0.044078] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.044232] futex hash table entries: 256 (order: 2, 16384 bytes)
[    0.045635] NET: Registered protocol family 16
[    0.058114] vgaarb: loaded
[    0.062329] clocksource: Switched to clocksource riscv_clocksource
[    0.075922] NET: Registered protocol family 2
[    0.078980] tcp_listen_portaddr_hash hash table entries: 256 (order: 0, 4096 bytes)
[    0.079052] TCP established hash table entries: 1024 (order: 1, 8192 bytes)
[    0.079162] TCP bind hash table entries: 1024 (order: 2, 16384 bytes)
[    0.079235] TCP: Hash tables configured (established 1024 bind 1024)
[    0.080212] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    0.080350] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    0.081046] NET: Registered protocol family 1
[    0.086097] workingset: timestamp_bits=62 max_order=14 bucket_order=0
[    0.097547] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
[    0.097616] io scheduler mq-deadline registered
[    0.097675] io scheduler kyber registered
[    0.175036] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    0.178750] printk: console [ttyS0] disabled
[    0.179212] 10000000.uart: ttyS0 at MMIO 0x10000000 (irq = 10, base_baud = 230400) is a 16550A
[    0.189989] printk: console [ttyS0] enabled
[    0.198597] loop: module loaded
[    0.202638] virtio_blk virtio0: [vda] 204800 512-byte logical blocks (105 MB/100 MiB)
[    0.216834] NET: Registered protocol family 10
[    0.220836] Segment Routing with IPv6
[    0.221137] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    0.222718] NET: Registered protocol family 17
[    0.239260] EXT4-fs (vda): mounted filesystem with ordered data mode. Opts: (null)
[    0.239532] VFS: Mounted root (ext4 filesystem) readonly on device 254:0.
[    0.251190] Freeing unused kernel memory: 148K
[    0.251302] This architecture does not have kernel memory protection.
[    0.251518] Run /sbin/init as init process
[    0.395338] EXT4-fs (vda): re-mounted. Opts: (null)
[    0.599316] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
Initializing mdev...
[    1.222524] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[    1.638078] random: dropbear: uninitialized urandom read (32 bytes read)

busybear login: 

Can you let me know what is commit? This is what I see:

$ git show
commit 24fc2e81c57f7fa024cc2b911e470fd2104e38d9 (HEAD -> master, origin/master, origin/HEAD)
Author: Michael Clark <michaeljclark@mac.com>
Date:   Wed Jan 23 08:48:53 2019 +1300

    Move riscv-pk from deps to src

diff --git a/.gitmodules b/.gitmodules
index 14a80743a754..58c3c7d5ac6e 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1,3 @@
 [submodule "riscv-pk"]
-       path = deps/riscv-pk
+       path = src/riscv-pk
        url = ../riscv-pk.git
diff --git a/deps/riscv-pk b/deps/riscv-pk
deleted file mode 160000
index ca7ef23f1fb5..000000000000
--- a/deps/riscv-pk
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit ca7ef23f1fb5df26f55ca8b27c3570256398a11a
diff --git a/scripts/build.sh b/scripts/build.sh
index eee9e0614518..d5638c5e22b4 100755
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -80,7 +80,7 @@ test -x build/linux-${LINUX_KERNEL_VERSION}/vmlinux || (
 test -d build/riscv-pk || mkdir build/riscv-pk
 test -x build/riscv-pk/bbl || (
     cd build/riscv-pk
-    ../../deps/riscv-pk/configure \
+    ../../src/riscv-pk/configure \
         --host=${CROSS_COMPILE%-} \
         --with-payload=../linux-${LINUX_KERNEL_VERSION}/vmlinux
     make -j$(nproc)
diff --git a/src/riscv-pk b/src/riscv-pk
new file mode 160000
index 000000000000..a92db3287603
--- /dev/null
+++ b/src/riscv-pk
@@ -0,0 +1 @@
+Subproject commit a92db32876039a59bf7cd71324128e8958a763f3
rgdaddio commented 5 years ago

Thanks. Ok I will try it again. The change from "deps" to "src" seemed like it was missing configure but maybe something went wrong with git clone. Both @tromedo and I saw the same thing.

rgdaddio commented 5 years ago

Hi, Yes this failed for me in the same way:

AR built-in.a LD vmlinux.o MODPOST vmlinux.o KSYM .tmp_kallsyms1.o KSYM .tmp_kallsyms2.o LD vmlinux SYSMAP System.map make[1]: Leaving directory '/home/rich/bbear/busybear-linux/build/linux-5.0-rc2' ./scripts/build.sh: line 84: ../../src/riscv-pk/configure: No such file or directory Makefile:10: recipe for target 'busybear.bin' failed make: *** [busybear.bin] Error 127

Is there a pointer or softlink to that file in the repository? pwd busybear-linux/src/riscv-pk

//empty busybear-linux/src/riscv-pk$ ls -al total 8 drwxr-xr-x 2 rich rich 4096 Mar 3 21:22 . drwxr-xr-x 3 rich rich 4096 Mar 3 21:22 ..

In repository: https://github.com/michaeljclark/busybear-linux/tree/master/src I see this with no file: riscv-pk @ a92db32

Is that expected?

Thanks & BR,

Rich

tromedo commented 5 years ago

Hi,

I just cloned the riscv-pk separately and copied into the directory and now it works. But I think this is a temp fix.

tromedo commented 5 years ago

Let me try a new clone and try.

rgdaddio commented 5 years ago

Yes the separate clone of riscv-pk and copy over worked for me as well. I think this link is broken riscv-pk @ a92db32 in the micheljclark repository.

michaeljclark commented 5 years ago

I think we need to:

Unfortunately, it's much less of a worry than an undocumented or missing configure script for a repo with rather unusual dependencies. That would be really really annoying. One could loose days sifting around through different operating system combinations of autoconf and automake trying to get things to build.

It's a bug in the README file in this repo. Sorry about that.

rgdaddio commented 5 years ago

No problem. Thanks for the update. BR, Rich D

mlibca commented 5 years ago

the current version fails in the build of linux5.0 ... any old version that works ? thanks!