Skip to content

Commit f5f88e8

Browse files
committed
Qemu
1 parent 987bc4c commit f5f88e8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+981
-483
lines changed

README.md

+42-31
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,25 @@ Includes Linux concepts and utilities that work on Linux, not necessarily in the
1313
1. [man](man.md)
1414
1. [info](info.md)
1515
1. Base standards
16-
1. [POSIX](posix.md)
17-
1. [Linux](linux.md)
18-
1. [LSB](lsb.md)
19-
1. [FHS](fhs.md)
20-
1. [GNU](gnu.md)
21-
1. Kernel related
22-
1. [Kernel](kernel/)
16+
1. [POSIX](posix.md)
17+
1. [LSB](lsb.md)
18+
1. [FHS](fhs.md)
19+
1. [GNU](gnu.md)
20+
1. [Linux](linux.md)
21+
1. Alternatives
22+
1. [Hurd](hurd.md)
23+
1. [BSD](bsd.md)
24+
1. [Distros](distros.md)
25+
1. [Minimal distros](minimal-distros.md)
26+
1. [Kernel](kernel/)
2327
1. [System Call](system-call/)
2428
1. [sysctl](sysctl.md)
29+
1. [dmesg](demesg.md)
30+
1. [installkernel](installkernel.md)
2531
1. Initialization
2632
1. [Install OS](install-os.md): how to install a new OS
2733
1. [Boot](boot.md)
34+
1. [GRUB](grub.md)
2835
1. [Init](init.md): System V, Upstart
2936
1. System information
3037
1. [lsb_release](lsb_release.md)
@@ -45,6 +52,7 @@ Includes Linux concepts and utilities that work on Linux, not necessarily in the
4552
1. [e2fsck](e2fsck.md)
4653
1. [e2fsprogs](e2progs.md)
4754
1. [mke2fs](mke2fs.md)
55+
1. [fallocate](fallocate.md)
4856
1. [fdisk](fdisk.md)
4957
1. [FUSE](FUSE.md)
5058
1. [fuser](fuser.md)
@@ -58,7 +66,29 @@ Includes Linux concepts and utilities that work on Linux, not necessarily in the
5866
1. [proc filesystem](proc-filesystem.md)
5967
1. [dev filesystem](dev-filesystem.md)
6068
1. [mknod](mknod.md)
61-
1. [ramfs](ramfs.md)
69+
1. [sysfs](sysfs.md)
70+
1. [ramfs](ramfs.md)
71+
1. Files, directories
72+
1. [cp](cp.sh)
73+
1. [dd](dd.md)
74+
1. [du](du.md)
75+
1. [fdupes](fdupes.md)
76+
1. [find](find.md)
77+
1. links
78+
1. [ln](ln.md)
79+
1. [readlink](readlink.md)
80+
1. [realpath](realpath.md)
81+
1. [locate](locate.md)
82+
1. [ls](ls.md)
83+
1. [read](read.md)
84+
1. [stat](stat.md)
85+
1. [tree](tree.md)
86+
1. File managers
87+
1. [Krusader](krusader.md)
88+
1. [vifm](vifm.md)
89+
1. [CD DVD](cd-dvd.md)
90+
[isoinfo](isoinfo.md)
91+
[eject](eject.md)
6292
1. [Terminal](terminal.md): terminal emulators, ANSI escapes, control characters
6393
1. [Guake](guake.sh)
6494
1. Stream and file manipulation
@@ -97,24 +127,6 @@ Includes Linux concepts and utilities that work on Linux, not necessarily in the
97127
1. [cmp](cmp.md)
98128
1. [diff](diff.md)
99129
1. [wdiff](diff.md)
100-
1. Files, directories
101-
1. [cp](cp.sh)
102-
1. [dd](dd.md)
103-
1. [du](du.md)
104-
1. [fdupes](fdupes.md)
105-
1. [find](find.md)
106-
1. links
107-
1. [ln](ln.md)
108-
1. [readlink](readlink.md)
109-
1. [realpath](realpath.md)
110-
1. [locate](locate.md)
111-
1. [ls](ls.md)
112-
1. [read](read.md)
113-
1. [stat](stat.md)
114-
1. [tree](tree.md)
115-
1. File managers
116-
1. [Krusader](krusader.md)
117-
1. [vifm](vifm.md)
118130
1. Programming
119131
1. [ack](ack.sh)
120132
1. [ctags](ctags/)
@@ -168,7 +180,7 @@ Includes Linux concepts and utilities that work on Linux, not necessarily in the
168180
1. [tar](tar.md)
169181
1. [zip](zip.md)
170182
1. [ar](ar.md)
171-
1. User operations
183+
1. User accounts
172184
1. [id](id.md)
173185
1. [usermod](usermod.md)
174186
1. [Desktop](desktop/): X, XDG, GNOME, KDE and related utilities
@@ -192,10 +204,9 @@ Includes Linux concepts and utilities that work on Linux, not necessarily in the
192204
1. [Kramdown](kramdown/)
193205
1. [Pandoc](pandoc/)
194206
1. [RST](rst/)
195-
1. [Virtual machine](virtual-machine/)
207+
1. [Virtualization](virtualization.md)
196208
1. [Docker](docker/)
197209
1. [QEMU](qemu.md)
198-
1. [User mode Linux](user-mode-linux.md)
199210
1. [Vagrant](vagrang/)
200211
1. [Configuration automation](config-automation.md)
201212
1. [chef](chef/)
@@ -222,9 +233,9 @@ Includes Linux concepts and utilities that work on Linux, not necessarily in the
222233
1. Packages
223234
1. [util-linux](util-linux.md)
224235
1. Misc
236+
1. [BusyBox](busybox.md)
225237
1. [cron](cron.sh)
226238
1. [logrotate](logrotate.md)
227-
1. [BusyBox](busybox.md)
228239
1. [xargs](xargs.md)
229240
1. [Bibliography](bibliography.md)
230241

@@ -234,7 +245,7 @@ Includes Linux concepts and utilities that work on Linux, not necessarily in the
234245
1. [devpts](devpts.md)
235246
1. [eCryptfs](ecryptfs.md)
236247
1. [rootfs](rootfs.md)
237-
1. [sysfs](sysfs.md)
248+
1. [MAKEDEV](makedev.md)
238249
1. [Hardware](hardware.md)
239250
1. [lshw](lshw.md)
240251
1. [gcov](gcov.md)

bibliography.md

+16
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010

1111
- <http://www.tldp.org/>
1212

13+
- `git clone http://git.kernel.org/pub/scm/docs/man-pages/man-pages`
14+
15+
Contains lots of Linux man pages. TODO compare to glibc.
16+
1317
- <http://linux.die.net/>
1418

1519
Linux man pages: both form the Linux Documentation Project, and
@@ -25,3 +29,15 @@
2529
- Linux from scratch
2630

2731
Teaches how to build a minimal Linux distro
32+
33+
- <https://wiki.archlinux.org/>
34+
35+
Arch Linux wiki.
36+
37+
Amazingly good wiki, probably because Arch users are both hardcore and minimalistic.
38+
39+
## Funny
40+
41+
- <http://www.cavecanen.org/linux/humour/horrorstories.txt>
42+
43+
Real *NIX sysadmin horror stories of things gone terribly wrong.

blkid.md

+10
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,13 @@ Sample output:
1919
/dev/sdb7: UUID="3fabbe75-0c62-4705-a3ad-4e87c5dcc143" TYPE="ext4"
2020
/dev/sdb8: UUID="56886cc6-e247-488a-9acf-a07a99cfa3ca" TYPE="ext4"
2121
/dev/sdb9: UUID="bbc2c9bf-4846-44d1-81c0-eade6d2dcefb" TYPE="swap"
22+
23+
Can also be used to identify files that contain filesystems, e.g.:
24+
25+
blkid ubuntu-14.04.2-desktop-amd64.iso
26+
27+
outputs:
28+
29+
ubuntu-14.04.2-desktop-amd64.iso: LABEL="Ubuntu 14.04.2 LTS amd64" TYPE="iso9660"
30+
31+
If it cannot be identified, it prints nothing and returns `4`.

boot.md

+10-134
Original file line numberDiff line numberDiff line change
@@ -39,145 +39,21 @@ The MBR points to a second stage bootloader in its disk which which will do the
3939

4040
The most popular second stage bootloader for Linux now is GRUB. LILO was a popular alternative in the past. Windows has its own bootloader.
4141

42-
## GRUB
43-
44-
Grand Unified Bootloader.
45-
46-
If you have a Linux dual boot, and you see a menu prompting you to choose the OS, there is a good chance that this is GRUB, since it is the most popular bootloader today.
47-
48-
It allows you basic graphical interaction even before starting any OS.
49-
50-
Everything is configurable, from the menu entries to the background image. This is why Ubuntu's GRUB is purple.
51-
52-
The main job for GRUB userspace utilities such as `grub-install` and `update-grub` is to look at the input configuration files, interpret them and write the output configuration information to the correct locations on the hard disk so that they can be found at boot time.
53-
54-
GRUB has knowledge about filesystems, and is able to read configuration files and the disk image from it.
55-
56-
### GRUB versions
57-
58-
GRUB has 2 versions
59-
60-
- 0.97, usually known just as GRUB, or Legacy GRUB.
61-
62-
- GRUB >= 2, which is backwards incompatible, and has more features.
63-
64-
GRUB 2 is still beta.
65-
66-
Some distros like Ubuntu have already adopted GRUB 2, while others are still using GRUB for stability concerns.
67-
68-
Determine your GRUB version with:
69-
70-
grub-install -v
71-
72-
Here we discuss GRUB 2.
73-
74-
### configuration
75-
76-
Input files:
77-
78-
- `/etc/grub.d`
79-
- `/etc/default/grub`
80-
81-
Generated files and data after `sudo update-grub`:
82-
83-
- `/boot/grub/grub.cfg`
84-
- MBR bootstrap code
85-
86-
#### /etc/default/grub
87-
88-
sudo vim /etc/default/grub
89-
90-
- `GRUB_DEFAULT`: default OS choice if cursor is not moved.
91-
92-
Starts from 0, the order is the same as shown at grub os choice menu.
93-
94-
- `GRUB_TIMEOUT` : time before auto OS choice in seconds
95-
96-
- `GRUB_CMDLINE_LINUX_DEFAULT`: space separated list of Kernel boot parameters.
97-
98-
Documented at:
99-
100-
man bootparam
101-
102-
Those parameters can also be edited from the boot menu for single session by selecting the partition and clicking `e`.
103-
104-
Most important to know:
105-
106-
- useless options on by default on Ubuntu 12.04 which you should really remove because they hide kernel state and potentially useful debug information:
107-
108-
- `quiet`: suppress kernel messages.
109-
- `splash`: shows nice and useless image while the kernel is booting. On by default on Ubuntu 12.04. Remove this useless option,
110-
111-
#### /etc/grub.d/
112-
113-
Contains executables.
114-
115-
Each one is called in alphabetical order, and its stdout is used by GRUB.
116-
117-
Create a menu entry:
118-
119-
#!/bin/sh -e
120-
echo "stdout"
121-
echo "stderr" >&2
122-
cat << EOF
123-
menuentry "menuentry title" {
124-
set root=(hd0,1)
125-
-- boot parameters --
126-
}
127-
EOF
128-
129-
You will see `stdout` when running `update-grub`. stderr is ignored.
130-
131-
`set root=(hd0,1)` specifies the partition, here `sda1`. `hd0` means first device,
132-
`1` means first partition. Yes, one if 0 based, and the other is 1 based.
133-
134-
`-- boot parameters --` depends on your OS.
135-
136-
Linux example:
137-
138-
linux /boot/vmlinuz
139-
initrd /boot/initrd.img
140-
141-
Windows example:
142-
143-
chainloader (hdX,Y)+1
144-
145-
It is common to add one OS menu entry per file so that it is easy to change their order (just change alphabetical order).
146-
147-
#### os_prober
148-
149-
Looks for several OS and adds them automatically to GRUB menu.
150-
151-
Recognizes Linux and Windows.
152-
153-
TODO how to use it
154-
155-
#### update-grub
156-
157-
Interpret input configuration files and update `/etc/default/grub` which will be used at boot time.
158-
159-
You must to this every time you change the input configuration files for the changes to take effect.
160-
161-
#### grub-install
162-
163-
Interpret input configuration files and update the MBR on the given disk:
164-
165-
sudo grub-install /dev/sda
42+
## boot directory
16643

167-
If for example you install a new Linux distro, and you want to restore your old distro's GRUB configuration, you must log into the old distro and do `grub-install`, therefore telling your system via the MBR to use the installation parameters given on the old distro.
44+
Usually located at `/boot/`.
16845

169-
### Sources
46+
It contains the following files:
17047

171-
- <http://www.dedoimedo.com/computers/grub-2.html>
48+
- `config-VERSION`: the kernel configuration options, generated at configuration before kernel compilation by `make menuconfig`
49+
- `abi-VERSION`: TODO what is? Looks like the kernel symbol table of exported symbols.
17250

173-
Great configuration tutorial.
51+
### vmlinuz
17452

175-
## boot directory
53+
Compiled kernel compressed with gzip, thus the `Z`
17654

177-
Usually located at `/boot/`.
55+
#### vmlinux
17856

179-
It contains the following files:
57+
#### bzimage
18058

181-
- `vmlinz-VERSION`: the kernel compiled code, also knows as kernel image.
182-
- `config-VERSION`: the kernel configuration options, generated at configuration before kernel compilation by `make menuconfig`
183-
- `abi-VERSION`: TODO what is? looks like the kernel symbol table of exported symbols.
59+
<http://unix.stackexchange.com/questions/5518/what-is-the-difference-between-the-following-kernel-makefile-terms-vmlinux-vml>

bsd.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# BSD
2+
3+
<https://en.wikipedia.org/wiki/Berkeley_Software_Distribution>
4+
5+
Derived from AT&T.
6+
7+
OS X is a fork.
8+
9+
Major differences from Linux:
10+
11+
- license: BSD license, which allowed Apple to fork
12+
- scope: the project also includes userspace utilities. Interesting as it ensures that they work together with the kernel.
13+
14+
Why it lost from Linux: <http://serverfault.com/questions/36359/why-is-linux-more-popular-than-bsd> An important factor was the AT&T legal case against BSD at the kernel explosion of the early 90's, which held it back at the critical moment. GPL also likely helped Linux by forcing enterprises to contribute and not only leech.
15+
16+
Main variants:
17+
18+
- FreeBSD
19+
- OpenBSD
20+
- NetBSD

busybox.md

+17-8
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,18 @@
22

33
Single executable that includes all POSIX command line utilities, including `sh`, and no libc dependency.
44

5+
The logo "The Swiss Army Knife of Embedded Linux" does it great justice: it is small and has many utilities, just like a swiss knife.
6+
57
Popular for minimal distributions, e.g. <https://github.com/ivandavidov/minimal>
68

7-
Source:
9+
Quickstart:
810

911
git clone git://git.busybox.net/busybox
12+
make defconfig
13+
make
14+
make install
1015

11-
Once compiled, this generates a single `busybox` 2Mb executable, possibly with not external dependencies, often built with uClibc. E.g., if we do:
12-
13-
ldd busybox
14-
15-
we get:
16-
17-
16+
This generates a single `busybox` 2Mb executable. It is common to configure it to embed libc so it will work in systems without it. TODO how
1817

1918
It is also possible to configure exactly which utilities will be present on the output.
2019

@@ -28,3 +27,13 @@ or with symlinks, which is the standard approach when deploying it:
2827
./echo a
2928

3029
`busybox` uses `argv[0]` to decide the executable in this case.
30+
31+
`make` install generates an `_install` directory with all utilities symlinked to `busybox`.
32+
33+
## init
34+
35+
BusyBox also implements a version `init`, which is capable of reading `/etc/inittab` to startup the system.
36+
37+
Even though Ubuntu 14.04 does not have it installed by default, its boot system adds it to the `/boot/initrd*` files. Poetically speaking, the initial boot environment has characteristics of an embedded system.
38+
39+
It is then the job of `init` to mount

0 commit comments

Comments
 (0)