Skip to content

Commit 6aa22e0

Browse files
committed
sync
1 parent ebe5f09 commit 6aa22e0

12 files changed

+240
-315
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Includes Linux concepts and utilities that work on Linux, not necessarily in the
2626
1. [Android](android.md)
2727
1. [Distros](distros.md)
2828
1. [Minimal distros](minimal-distros.md)
29+
1. [Buildroot](buildroot.md)
2930
1. [Linux runs on](linux-runs-on.md)
3031
1. [Runs Linux](runs-linux.md)
3132
1. [Kernel](kernel/)

alternatives.md

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Strict real time:
1818
- <https://en.wikipedia.org/wiki/FreeRTOS>
1919
- <https://en.wikipedia.org/wiki/Micro-Controller_Operating_Systems> proprietary with source available
2020

21+
<https://en.wikipedia.org/wiki/Xenomai> provides real time capabilities on Linux userland.
22+
2123
Dedicated OSes / firmware:
2224

2325
- <https://en.wikipedia.org/wiki/Rockbox> , music players

buildroot.md

+129
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# Buildroot
2+
3+
Run two commands, get a Linux distro built from source.
4+
5+
1. Examples
6+
1. [Add a new package in tree](https://github.com/cirosantilli/buildroot/tree/in-tree-package-2016.05)
7+
1. [Package with a Kernel module in tree](https://github.com/cirosantilli/buildroot/tree/kernel-module-2016.05)
8+
1. [Out of tree package](https://github.com/cirosantilli/buildroot/tree/out-of-tree-2016.05)
9+
10+
## Introduction
11+
12+
Takes care of:
13+
14+
- cross compilation. In other words, compiles GCC for you. Several archs supported.
15+
- bootloading. Several bootloaders supported.
16+
- root filesystem generation.
17+
- tons of packages, e.g. X.org. Packages have a dependency system, but no versioning.
18+
19+
Lots of software supported.
20+
21+
## QEMU example
22+
23+
Tested on Ubuntu 16.04.
24+
25+
git clone git://git.buildroot.net/buildroot
26+
cd buildroot
27+
git checkout 2016.05
28+
make qemu_x86_64_defconfig
29+
# Can't use -jN, use `BR2_JLEVEL=2` instead.
30+
make BR2_JLEVEL=2
31+
# Wait.
32+
# cat board/qemu/x86_64/readme.txt
33+
qemu-system-x86_64 -M pc -kernel output/images/bzImage -drive file=output/images/rootfs.ext2,if=virtio,format=raw -append root=/dev/vda -net nic,model=virtio -net user
34+
35+
## ARM
36+
37+
The obvious x86 analog just works, beauty.
38+
39+
The only thing is that you have to move the x86 output away if you have one:
40+
41+
mv output output.x86~
42+
make qemu_arm_versatile_defconfig
43+
make
44+
qemu-system-arm -M versatilepb -kernel output/images/zImage -dtb output/images/versatile-pb.dtb -drive file=output/images/rootfs.ext2,if=scsi,format=raw -append "root=/dev/sda console=ttyAMA0,115200" -serial stdio -net nic,model=rtl8139 -net user
45+
46+
Then in QEMU:
47+
48+
cat /proc/cpuinfo
49+
50+
## Don't ask for password at login
51+
52+
<http://unix.stackexchange.com/questions/299408/how-to-login-automatically-without-typing-root-in-buildroot-x86-64-qemu>
53+
54+
## config
55+
56+
All options are stored in `.config` before build. The `.config` file fully specifies the entire system.
57+
58+
Make and environment variables *don't* in general override options:
59+
60+
# Does not work.
61+
#make defconfig BR2_SOME_OPT=y
62+
63+
Whenever you do `make`, `make oldconfig` gets run. `make oldconfig` removes any new options you've added to the file, unless they are specified under `package/Config.in`.
64+
65+
Some configs are not put on the `.config`, while others are commented out. TODO: commented out means dependencies and have been met, removed not?
66+
67+
### Important configurations
68+
69+
LINUX_KERNEL_VERSION="4.5.3"
70+
BR2_GCC_VERSION_4_9_X=y
71+
72+
## Add a file to the distro
73+
74+
mkdir a
75+
mkdir a/b
76+
date >a/b/c
77+
make BR2_ROOTFS_OVERLAY='a'
78+
79+
Outcome: the root of the generated filesystem now contains `/b/c`.
80+
81+
## Permanent storage filesystem
82+
83+
TODO
84+
85+
## Remove package
86+
87+
Currently impossible.
88+
89+
For simple cases, just remove the files from:
90+
91+
rm output/target/usr/bin/hello
92+
93+
## random: nonblocking pool is initialized
94+
95+
TODO how to stop printing that
96+
97+
## Projects that use Buildroot:
98+
99+
- <https://en.wikipedia.org/wiki/OpenWrt>
100+
101+
## Games
102+
103+
Placed under `/usr/bin` and `/usr/games`.
104+
105+
Grouped under `packages/Config.in`:
106+
107+
menu "Games"
108+
109+
Many / all are SDL based. It seems that SDL has an `fbdev` mode that dispenses X11.
110+
111+
### ltris
112+
113+
### lbreakout2
114+
115+
Fails with:
116+
117+
set_video_mode: cannot allocate screen: Couldn't set console screen info
118+
119+
### opentyrian
120+
121+
Hangs.
122+
123+
### sl
124+
125+
Classic steam locomotive `sl` typo corrector. Text only.
126+
127+
## X11
128+
129+
http://unix.stackexchange.com/questions/70931/install-x11-on-my-own-linux-system

ffmpeg.md

+12
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,18 @@ List codecs: <http://stackoverflow.com/questions/3377300/what-are-all-codecs-sup
88

99
ffmpeg -codecs
1010

11+
## stdin and stdout operations
12+
13+
ffmpeg can detect file types from both file names and contents. But if you want to be explicit, remember the `man ffmpeg` signature:
14+
15+
ffmpeg [global_options] {[input_file_options] -i input_file} ... {[output_file_options] output_file} ...
16+
17+
So the `-f` before `-i` is for the input format, and the `-f` after `-i` is the output.
18+
19+
Example: stream your desktop and play it:
20+
21+
ffmpeg -video_size 640x480 -framerate 25 -f x11grab -i :0.0+100,200 -f h264 - | ffplay -f h264 -
22+
1123
## Extract raw streams
1224

1325
### VP9

kernel/Makefile

-82
This file was deleted.

kernel/README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
1. [main.c](main.c)
55
1. [hello_world](hello_world.c)
66
1. [Introduction](introduction.md)
7-
1. [Makefile](makefile.md)
7+
1. [Build](build.md)
8+
1. [Use built kernel](use-built-kernel.md)
89
1. [Source tree](source-tree.md)
910
1. [Testing](testing.md)
1011
1. [Module](module.md)

kernel/makefile.md renamed to kernel/build.md

+1-28
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Makefile
1+
# Build
22

33
How to compile and install the kernel.
44

@@ -254,33 +254,6 @@ Can be configured with:
254254

255255
Make sure to point to the `../build` so that `.config` is seen
256256

257-
### isoimage
258-
259-
### ISO build
260-
261-
For x86 (why only x86), you can generate a bootable ISO with:
262-
263-
make isoimage FDINITRD=rootfs.cpio.gz
264-
265-
where `FINITRD` points to a previously constructed `initrd` that will be used to initialize the system.
266-
267-
This method is used by [Minimal Linux Live](https://github.com/ivandavidov/minimal), which producesa nice little `rootfs.cpio.gz`.
268-
269-
The output file generated is:
270-
271-
build/arch/x86/boot/image.iso
272-
273-
You can then feed the generated ISO directly to QEMU with either:
274-
275-
qemu-system-x86_64 -cdrom image.iso
276-
qemu-system-x86_64 -hda image.iso
277-
278-
or burn it to either an USB or CD with:
279-
280-
sudo dd if=image.iso of=/dev/sdX
281-
282-
Internally in 4.2, it is coded at `arch/x86/boot/Makefile`, and `syslinux`, `mkisofs` to make a ISO, and then `isohybrid` to make it bootable either from ISO or USB.
283-
284257
### Headers install
285258

286259
### headers_install

kernel/hello_world.c

-14
This file was deleted.

0 commit comments

Comments
 (0)