Giter Site home page Giter Site logo

tinyclub / linux-lab Goto Github PK

View Code? Open in Web Editor NEW
1.1K 60.0 177.0 148.93 MB

Docker/Qemu Based Linux Kernel Learning, Development and Testing Environment; New Linux ELF Video Course from this project author: https://www.cctalk.com/m/group/88089283

Home Page: http://tinylab.org/linux-lab

License: Other

Makefile 48.78% Shell 28.41% Python 7.06% C 12.79% Dockerfile 0.04% Assembly 2.91% Vim Script 0.02%
linux-kernel embedded-linux uboot busybox buildroot cross-compiler qemu lab docker

linux-lab's People

Contributors

61rd avatar bh1scw avatar eltociear avatar jiaxianhua avatar jiexunwang avatar jordonwu avatar kongjiadongyuan avatar lastritter avatar leojhonsong avatar lzufalcon avatar pingwuu avatar prcups avatar taotieren avatar tjy-zhu avatar unicornx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

linux-lab's Issues

Docker cannot run successfully.

failed to register layer: Error processing tar file(exit status 1): function not implemented
LOG: pulling git repo: linux-lab
LOG: Current Lab is linux-lab
xrandr: Failed to get size of gamma for output default
LOG: pulling repository: linux-lab

修改源码

请问如何修改git下载 "/labs/linux-lab/src/linux-stable/.git" 中的内核源码呢?
要先解压吗?

Default Configure Could Cause Container Escape Risk

Greetings!

This is security research team from Tsinghua University, in recent research work, we found that linux-lab(one of the best cloudlabs) could be escaped by default configure. We do think it may somehow affect the project itself and users who build their own labs based-on linux-lab. Also, we will propose our practical mitigation suggestion : )

We have sent serveral e-mails about the security issues, including the escaping video record. We would appreciate if you can check the information in the e-mails we sent.

Sincerely,

The OS and Docker version successfully running Linux Lab

This Issue is fired to collect the working os and docker versions list. gitee repository issue page also maintained such a list.

Linux, Windows and Mac OS X

Linux Lab Users, Please run tools/docker/env from 'next' branch in host system (running docker) and reply the output result to this issue.

for example:

$ cd cloud-lab/
$ git fetch --all
$ git checkout next
$ git pull
$ tools/docker/env
Product: VMware Virtual Platform
Board: 440BX Desktop Reference Platform
ARCH: x86_64
CPU: 4 x Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
RAM: 3934 MiB
System: Ubuntu 16.04.6 LTS, xenial
Linux: 4.4.0-177-generic
Docker: Docker version 18.09.4, build d14af54
Shell: /bin/bash 4.3.48(1)-release
  • Windows

For Windows Users, If the above command not work, please run cmd and get the first line of output.

Microsoft Windows [Version 10.0.xxx.yyy]

And currently, git for windows is required to run Git Bash, please use Git Bash to get the docker version info.

If you have successfully run Linux Lab with wsl2, welcomen to share too.

  • Mac OSX

If the above command not work, welcome to share your OSX version and Docker version manually.

macos 11.1 using 'cloud-lab' hang at 'e1000: eth0: e1000_watchdog: NIC Link is Up 1000 Mbps Full Duplex'

here is command:
sudo env PATH=/labs/linux-lab/build/i386/qemu-v2.12.0-pc/i386-softmmu/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin qemu-system-i386 -M pc -m 128M -net nic,model=e1000 -net tap -smp 4 -kernel /labs/linux-lab/build/i386/linux-v2.6.11.12-pc/arch/i386/boot/bzImage -no-reboot -hda /labs/linux-lab/boards/i386/pc/bsp/root/2019.02.2/rootfs.ext2 -nographic -append 'route=17

here is my env:


➜  cloud-lab git:(master) ✗ tools/docker/env
Product: Apple, MacBook Pro, MacBookPro14,3
ARCH: x86_64
CPU: 4 x Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
RAM: 16 GB
System: macOS, 11.5.2, 20G95
Kernel: Darwin 20.6.0
Docker: Docker version 20.10.8, build 3967b7d
Shell: /bin/zsh

here is all log:


ubuntu@linux-lab:/labs/linux-lab$ make boot
LOG: Generating ramdisk image with tools/root/dir2rd.sh ...
LOG: Generating harddisk image with tools/root/rd2hd.sh ...
LOG: Rootfs size: 7168 (kilo bytes)
mke2fs 1.45.5 (07-Jan-2020)
Creating filesystem with 1792 4k blocks and 1792 inodes

Allocating group tables: done
Writing inode tables: done
Writing superblocks and filesystem accounting information: done

/labs/linux-lab/boards/i386/pc/bsp/root/2019.02.2/rootfs.tmp /labs/linux-lab
/labs/linux-lab
sudo env PATH=/labs/linux-lab/build/i386/qemu-v2.12.0-pc/i386-softmmu/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin  qemu-system-i386  -M pc -m 128M -net nic,model=e1000 -net tap -device virtio-net-device,netdev=net0,mac= -netdev tap,id=net0 -smp 4 -kernel /labs/linux-lab/build/i386/linux-v2.6.11.12-pc/arch/i386/boot/bzImage -no-reboot  -hda /labs/linux-lab/boards/i386/pc/bsp/root/2019.02.2/rootfs.ext2 -nographic   -append 'route=172.26.56.66 iface=eth0 rw fsck.repair=yes rootwait root=/dev/hda noapic console=ttyS0'
WARNING: Image format was not specified for '/labs/linux-lab/boards/i386/pc/bsp/root/2019.02.2/rootfs.ext2' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.
qemu-system-i386: -device virtio-net-device,netdev=net0,mac=: No 'virtio-bus' bus found for device 'virtio-net-device'
make: *** [Makefile:3718: _boot] Error 1
ubuntu@linux-lab:/labs/linux-lab$ make boot
LOG: Generating ramdisk image with tools/root/dir2rd.sh ...
LOG: Generating harddisk image with tools/root/rd2hd.sh ...
LOG: Rootfs size: 7168 (kilo bytes)
mke2fs 1.45.5 (07-Jan-2020)
Creating filesystem with 1792 4k blocks and 1792 inodes

Allocating group tables: done
Writing inode tables: done
Writing superblocks and filesystem accounting information: done

/labs/linux-lab/boards/i386/pc/bsp/root/2019.02.2/rootfs.tmp /labs/linux-lab
/labs/linux-lab
sudo env PATH=/labs/linux-lab/build/i386/qemu-v2.12.0-pc/i386-softmmu/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin  qemu-system-i386  -M pc -m 128M -net nic,model=e1000 -net tap -smp 4 -kernel /labs/linux-lab/build/i386/linux-v2.6.11.12-pc/arch/i386/boot/bzImage -no-reboot  -hda /labs/linux-lab/boards/i386/pc/bsp/root/2019.02.2/rootfs.ext2 -nographic   -append 'route=172.26.56.66 iface=eth0 rw fsck.repair=yes rootwait root=/dev/hda noapic console=ttyS0'
WARNING: Image format was not specified for '/labs/linux-lab/boards/i386/pc/bsp/root/2019.02.2/rootfs.ext2' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.
SeaBIOS (version rel-1.11.1-0-g0551a4be2c-prebuilt.qemu-project.org)


iPXE (http://ipxe.org) 00:03.0 C980 PCI2.10 PnP PMM+07F914F0+07EF14F0 C980



Booting from ROM..Linux version 2.6.11.12 (ubuntu@linux-lab) (gcc version 4.4.7 (Ubuntu/1
BIOS-provided physical RAM map:
 BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
 BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
 BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 0000000007fdf000 (usable)
 BIOS-e820: 0000000007fdf000 - 0000000008000000 (reserved)
 BIOS-e820: 00000000fffc0000 - 0000000100000000 (reserved)
127MB LOWMEM available.
DMI 2.8 present.
ACPI: PM-Timer IO Port: 0x608
Allocating PCI resources starting at 08000000 (gap: 08000000:f7fc0000)
Built 1 zonelists
Kernel command line: route=172.26.56.66 iface=eth0 rw fsck.repair=yes rootwait root=/dev0
Unknown boot option `fsck.repair=yes': ignoring
Initializing CPU#0
PID hash table entries: 512 (order: 9, 8192 bytes)
Detected 2913.566 MHz processor.
Using pmtmr for high-res timesource
Console: colour VGA+ 80x25
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 126896k/130940k available (1555k kernel code, 3632k reserved, 511k data, 120k in)
Checking if this processor honours the WP bit even in supervisor mode... Ok.
Security Framework v1.0.0 initialized
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
CPU: L1 I cache: 32K, L1 D cache: 32K
CPU: L2 cache: 2048K
CPU: Intel QEMU Virtual CPU version 2.5+ stepping 03
Enabling fast FPU save and restore... done.
Enabling unmasked SIMD FPU exception support... done.
Checking 'hlt' instruction... OK.
ACPI: setting ELCR to 0200 (from 0c00)
NET: Registered protocol family 16
PCI: PCI BIOS revision 2.10 entry at 0xfd20f, last bus=0
PCI: Using configuration type 1
ACPI: Subsystem revision 20050211
ACPI: Interpreter enabled
ACPI: Using PIC for interrupt routing
ACPI: PCI Root Bridge [PCI0] (00:00)
PCI: Probing PCI hardware (bus 00)
ACPI: PCI Interrupt Link [LNKA] (IRQs 5 *10 11)
ACPI: PCI Interrupt Link [LNKB] (IRQs 5 *10 11)
ACPI: PCI Interrupt Link [LNKC] (IRQs 5 10 *11)
ACPI: PCI Interrupt Link [LNKD] (IRQs 5 10 *11)
ACPI: PCI Interrupt Link [LNKS] (IRQs *9)
Linux Plug and Play Support v0.97 (c) Adam Belay
pnp: PnP ACPI init
pnp: PnP ACPI: found 10 devices
PCI: Using ACPI for IRQ routing
** PCI interrupts are no longer routed automatically.  If this
** causes a device to stop working, it is probably because the
** driver failed to call pci_enable_device().  As a temporary
** workaround, the "pci=routeirq" argument restores the old
** behavior.  If this argument makes the device work again,
** please email the output of "lspci" to [email protected]
** so I can fix the driver.
Total HugeTLB memory allocated, 0
VFS: Disk quotas dquot_6.5.1
Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
Installing knfsd (copyright (C) 1996 [email protected]).
JFFS2 version 2.2. (C) 2001-2003 Red Hat, Inc.
Initializing Cryptographic API
PCI: PIIX3: Enabling Passive Release on 0000:00:01.0
Limiting direct PCI/PCI transfers.
Activating ISA DMA hang workarounds.
hpet_acpi_add: no address or irqs in _CRS
serio: i8042 AUX port at 0x60,0x64 irq 12
serio: i8042 KBD port at 0x60,0x64 irq 1
Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing disabled
ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
io scheduler noop registered
io scheduler anticipatory registered
RAMDISK driver initialized: 4 RAM disks of 16384K size 1024 blocksize
loop: loaded (max 8 devices)
Intel(R) PRO/1000 Network Driver - version 5.6.10.1-k2
Copyright (c) 1999-2004 Intel Corporation.
ACPI: PCI Interrupt Link [LNKC] enabled at IRQ 11
PCI: setting IRQ 11 as level-triggered
ACPI: PCI interrupt 0000:00:03.0[A] -> GSI 11 (level, high) -> IRQ 11
e1000: eth0: e1000_probe: Intel(R) PRO/1000 Network Connection
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
PIIX3: IDE controller at PCI slot 0000:00:01.1
PIIX3: chipset revision 0
PIIX3: not 100% native mode: will probe irqs later
    ide0: BM-DMA at 0xc040-0xc047, BIOS settings: hda:pio, hdb:pio
    ide1: BM-DMA at 0xc048-0xc04f, BIOS settings: hdc:pio, hdd:pio
hda: QEMU HARDDISK, ATA DISK drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
hdc: QEMU DVD-ROM, ATAPI CD/DVD-ROM drive
ide1 at 0x170-0x177,0x376 on irq 15
hda: max request size: 1024KiB
hda: 14336 sectors (7 MB) w/256KiB Cache, CHS=14/255/63
 hda: unknown partition table
input: AT Translated Set 2 keyboard on isa0060/serio0
NET: Registered protocol family 2
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP established hash table entries: 8192 (order: 4, 65536 bytes)
TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
NET: Registered protocol family 1
NET: Registered protocol family 17
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 120k freed
Warning: unable to open an initial console.
e1000: eth0: e1000_watchdog: NIC Link is Up 1000 Mbps Full Duplex

OCI runtime exec failed: exec failed

首次尝试登入进去后,不知道怎么退出,就执行了poweroff,然后终端还是没退出shell,所以强关了终端,之后第二次进去就报错了。。

$ ./tools/docker/run linux-lab
LOG: Open the running linux-lab
LOG: Available login methods:

     bash vnc ssh webssh webvnc

LOG: Switch to another method:

     tools/docker/login LOGIN_METHOD

LOG: Running 'tools/docker/bash'

OCI runtime exec failed: exec failed: container_linux.go:346: starting container process caused "chdir to cwd (\"//labs/linux-lab\") set in config.json failed: no such file or directory": unknown

*** Your GCC is older than 6.0 and is not supported

在cloud中执行
make uboot 失败,报错如上
但是查看gcc版本是8.3.0的,是什么原因有人碰到过吗?
env PATH=/labs/linux-lab/prebuilt/toolchains/arm/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabi/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin make O=/labs/linux-lab/output/arm/uboot-v2020.04-vexpress-a9 -C u-boot ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j8
make[1]: Entering directory /labs/linux-lab/u-boot' make[2]: Entering directory /labs/linux-lab/output/arm/uboot-v2020.04-vexpress-a9'
CHK include/config/uboot.release
CHK include/generated/timestamp_autogenerated.h
GEN ./Makefile
UPD include/generated/timestamp_autogenerated.h
*** Your GCC is older than 6.0 and is not supported
make[2]: *** [checkgcc6] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** wait: No child processes. Stop.
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory `/labs/linux-lab/u-boot'
make: *** [_uboot] Error 2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
##gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 8.3.0-16ubuntu314.04.2' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=gcc4-compatible --disable-libstdcxx-dual-abi --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 8.3.0 (Ubuntu 8.3.0-16ubuntu3
14.04.2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.