buninu-linux 0.2.1 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +547 -190
- package/build-uki.sh +4 -2
- package/fetch-alpine.sh +78 -43
- package/index.js +4 -1
- package/initramfs/bin/ip +630 -0
- package/initramfs/bin/mount +401 -0
- package/initramfs/bin/poweroff +10 -0
- package/initramfs/bin/ps +256 -0
- package/initramfs/bin/reboot +10 -0
- package/initramfs/bin/tar +169 -0
- package/initramfs/bin/top +129 -0
- package/initramfs/bin/umount +71 -0
- package/initramfs/buninu/apps/bunmsh/CHANGELOG.md +36 -0
- package/initramfs/buninu/apps/bunmsh/README.md +7 -0
- package/initramfs/buninu/apps/bunmsh/package.json +1 -1
- package/initramfs/buninu/apps/bunmsh/src/fancy-ls.js +29 -14
- package/initramfs/buninu/apps/bunmsh/src/line-edit.js +43 -0
- package/initramfs/buninu/apps/bunmsh/src/main.js +15 -1
- package/initramfs/buninu/apps/bunmsh/src/mouse.js +29 -4
- package/initramfs/buninu/apps/bunmsh/src/shell.js +9 -1
- package/initramfs/buninu/apps/bunmsh/test/shell1.test.js +70 -0
- package/initramfs/buninu/apps/jsmdcui/CHANGELOG.md +10 -0
- package/initramfs/buninu/apps/jsmdcui/README.md +2 -0
- package/initramfs/buninu/apps/jsmdcui/package.json +1 -1
- package/initramfs/buninu/apps/jsmdcui/runtime/help/commands.md +4 -1
- package/initramfs/buninu/apps/jsmdcui/runtime/help/help.md +2 -0
- package/initramfs/buninu/apps/jsmdcui/src/index.js +40 -13
- package/initramfs/buninu/package.json +1 -1
- package/initramfs/init.js +164 -11
- package/initramfs/lib/dlopen.js +121 -0
- package/initramfs/lib/document.js +6 -0
- package/initramfs/lib/modprobe.js +235 -0
- package/initramfs/lib/power.js +35 -0
- package/initramfs/usr/share/doc/buninu-linux/ip.md +155 -0
- package/initramfs/usr/share/doc/buninu-linux/mount.md +155 -0
- package/initramfs/usr/share/doc/buninu-linux/poweroff.md +15 -0
- package/initramfs/usr/share/doc/buninu-linux/ps.md +94 -0
- package/initramfs/usr/share/doc/buninu-linux/reboot.md +15 -0
- package/initramfs/usr/share/doc/buninu-linux/tar.md +73 -0
- package/initramfs/usr/share/doc/buninu-linux/top.md +23 -0
- package/initramfs/usr/share/doc/buninu-linux/umount.md +48 -0
- package/package.json +2 -2
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# mount — mount a filesystem
|
|
2
|
+
|
|
3
|
+
`/bin/mount` is a Bun script. It calls `mount(2)` through `/lib/dlopen.js`
|
|
4
|
+
and loads the kernel modules a filesystem or a disk needs through
|
|
5
|
+
`/lib/modprobe.js`, because on Buninu Linux there is no `/sbin/modprobe` for
|
|
6
|
+
the kernel to ask.
|
|
7
|
+
|
|
8
|
+
## Synopsis
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
mount # list mounted filesystems
|
|
12
|
+
mount [-fv] [-t TYPE] [-o OPTIONS] SOURCE TARGET
|
|
13
|
+
mount -L LABEL | -U UUID [-o OPTIONS] TARGET
|
|
14
|
+
mount --bind | --rbind | --move OLD NEW
|
|
15
|
+
mount -o remount[,ro|rw] TARGET
|
|
16
|
+
mount -h | --help # this page
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Options
|
|
20
|
+
|
|
21
|
+
| Option | Meaning |
|
|
22
|
+
|---|---|
|
|
23
|
+
| `-t TYPE` | Filesystem type. Omitted or `auto`: read the superblock of SOURCE and pick one. |
|
|
24
|
+
| `-o OPTIONS` | Comma-separated list, see below. May be repeated. |
|
|
25
|
+
| `-r`, `--read-only` | Same as `-o ro`. |
|
|
26
|
+
| `-w`, `--rw` | Same as `-o rw`. |
|
|
27
|
+
| `-L LABEL`, `-U UUID` | Find the block device by label or UUID (ext2/3/4, FAT, exFAT, NTFS serial). |
|
|
28
|
+
| `-B`, `--bind` | Bind-mount a directory or file somewhere else. |
|
|
29
|
+
| `-R`, `--rbind` | Bind, including everything mounted below OLD. |
|
|
30
|
+
| `-M`, `--move` | Move a mount to a new place. |
|
|
31
|
+
| `--make-shared`, `--make-private`, `--make-rshared`, `--make-rprivate` | Change mount propagation of TARGET. |
|
|
32
|
+
| `--mkdir` | Create TARGET first. |
|
|
33
|
+
| `-v` | Say what is being loaded and mounted. |
|
|
34
|
+
| `-f`, `--fake` | Show the `mount(2)` call and stop. |
|
|
35
|
+
|
|
36
|
+
`-f` and `-v` may be combined as `-fv` or `-vf`; this probes and reports the
|
|
37
|
+
filesystem without performing the mount.
|
|
38
|
+
|
|
39
|
+
### `-o` words
|
|
40
|
+
|
|
41
|
+
Flags: `ro` `rw` `nosuid` `suid` `nodev` `dev` `noexec` `exec` `sync` `async`
|
|
42
|
+
`dirsync` `noatime` `atime` `nodiratime` `relatime` `strictatime` `lazytime`
|
|
43
|
+
`nosymfollow` `remount` `bind` `rbind` `move` `shared` `private` `slave`
|
|
44
|
+
`unbindable` `defaults`.
|
|
45
|
+
|
|
46
|
+
Anything else (`size=64M`, `iocharset=utf8`, `uid=1000`, `force`, ...) goes
|
|
47
|
+
to the filesystem driver unchanged.
|
|
48
|
+
|
|
49
|
+
## Examples
|
|
50
|
+
|
|
51
|
+
### tmpfs
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
mount -t tmpfs tmpfs /mnt/scratch
|
|
55
|
+
mount -t tmpfs -o size=64M,mode=1777 tmpfs /tmp/big
|
|
56
|
+
mount -t tmpfs -o remount,size=256M tmpfs /tmp/big # grow it later
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### ext4 (a Linux disk or partition)
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
mount /dev/vda2 /mnt # type detected, ext4 + jbd2 loaded
|
|
63
|
+
mount -t ext4 -o ro,noatime /dev/vda2 /mnt
|
|
64
|
+
mount -L rootfs /mnt # by label
|
|
65
|
+
mount -U 3f2a...-... /mnt # by UUID
|
|
66
|
+
mount -o remount,rw /mnt # flip an ro mount to rw
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
`ext3` volumes mount with the ext4 driver; `ext2` uses its own module.
|
|
70
|
+
|
|
71
|
+
### A Windows disk (NTFS)
|
|
72
|
+
|
|
73
|
+
```sh
|
|
74
|
+
mount /dev/sda3 /mnt/windows # ntfs3, read-write
|
|
75
|
+
mount -t ntfs3 -o ro /dev/sda3 /mnt/windows # look, don't touch
|
|
76
|
+
mount -t ntfs3 -o force /dev/sda3 /mnt/windows # volume left dirty by Windows
|
|
77
|
+
mount -t ntfs3 -o windows_names,uid=1000,gid=1000 /dev/sda3 /mnt/windows
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Windows Fast Startup and hibernation leave the volume marked dirty; ntfs3
|
|
81
|
+
then refuses to mount read-write. Either boot Windows and shut it down
|
|
82
|
+
fully, mount `-o ro`, or pass `force`. `windows_names` rejects names Windows
|
|
83
|
+
could not open. The type name `ntfs` is accepted as an alias for `ntfs3`.
|
|
84
|
+
|
|
85
|
+
### The EFI system partition, USB sticks, SD cards (FAT / exFAT)
|
|
86
|
+
|
|
87
|
+
```sh
|
|
88
|
+
mount /dev/vda1 /mnt/efi # vfat, detected
|
|
89
|
+
mount -t vfat -o iocharset=utf8,umask=022 /dev/sdb1 /mnt/usb
|
|
90
|
+
mount -t exfat -o uid=1000,gid=1000 /dev/sdb1 /mnt/card
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
FAT and exFAT need NLS tables (`nls_utf8`, `nls_cp437`, `nls_iso8859-1`);
|
|
94
|
+
`mount` loads them before calling the kernel, and also whatever
|
|
95
|
+
`iocharset=`/`codepage=` names, if the module is shipped.
|
|
96
|
+
|
|
97
|
+
### Bind mounts and moves
|
|
98
|
+
|
|
99
|
+
```sh
|
|
100
|
+
mount --bind /tmp/home /buninu/home
|
|
101
|
+
mount --bind -o ro /usr/share/doc /mnt/doc # bind, then remount read-only
|
|
102
|
+
mount --rbind / /mnt/root # with all submounts
|
|
103
|
+
mount --move /mnt/usb /media/usb
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Pseudo filesystems
|
|
107
|
+
|
|
108
|
+
```sh
|
|
109
|
+
mkdir -p /dev/pts && mount -t devpts -o gid=5,mode=620,ptmxmode=666 devpts /dev/pts
|
|
110
|
+
mount -t proc proc /proc
|
|
111
|
+
mount -t sysfs sysfs /sys
|
|
112
|
+
mount -t devtmpfs devtmpfs /dev
|
|
113
|
+
mount -t cgroup2 none /sys/fs/cgroup
|
|
114
|
+
mount -t debugfs none /sys/kernel/debug
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
`/dev/pts` matters: since Linux 4.7 opening `/dev/ptmx` goes through
|
|
118
|
+
`/dev/pts/ptmx`, so without this mount every pty open fails with `ENODEV`.
|
|
119
|
+
`init.js` mounts it at boot.
|
|
120
|
+
|
|
121
|
+
### Listing
|
|
122
|
+
|
|
123
|
+
```sh
|
|
124
|
+
mount # SOURCE on TARGET type TYPE (OPTIONS), from /proc/self/mounts
|
|
125
|
+
cat /proc/self/mountinfo # the long form
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## How devices and drivers are found
|
|
129
|
+
|
|
130
|
+
- A missing `/dev/vd*`, `/dev/sd*` or `/dev/nvme*` node makes `mount` load
|
|
131
|
+
`virtio_blk`, `sd_mod` (+ `ahci`, `usb_storage`) or `nvme` and wait up to
|
|
132
|
+
3 s for devtmpfs to create it.
|
|
133
|
+
- The filesystem driver is loaded when `/proc/filesystems` does not list the
|
|
134
|
+
type; `modules.alias` turns `fs-ntfs` into `ntfs3`, `fs-ext3` into `ext4`.
|
|
135
|
+
- Which modules are in the image is decided by `fetch-alpine.sh` in the
|
|
136
|
+
build tree; `--real` adds `sd_mod`, `ahci`, `nvme` and `usb-storage`.
|
|
137
|
+
|
|
138
|
+
## Exit status
|
|
139
|
+
|
|
140
|
+
`0` mounted, `1` bad usage, `32` the mount itself failed. Messages follow
|
|
141
|
+
util-linux wording, and `dmesg` usually has the kernel's reason for `EINVAL`.
|
|
142
|
+
|
|
143
|
+
## See also
|
|
144
|
+
|
|
145
|
+
- `umount --help`, `ip --help`
|
|
146
|
+
- [mount(2)](https://man7.org/linux/man-pages/man2/mount.2.html),
|
|
147
|
+
[mount(8)](https://man7.org/linux/man-pages/man8/mount.8.html)
|
|
148
|
+
- [tmpfs](https://docs.kernel.org/filesystems/tmpfs.html),
|
|
149
|
+
[ext4](https://docs.kernel.org/admin-guide/ext4.html),
|
|
150
|
+
[ntfs3](https://docs.kernel.org/filesystems/ntfs3.html),
|
|
151
|
+
[vfat](https://docs.kernel.org/filesystems/vfat.html),
|
|
152
|
+
[devpts](https://docs.kernel.org/filesystems/devpts.html)
|
|
153
|
+
- Source: `initramfs/bin/mount`, `initramfs/lib/dlopen.js`,
|
|
154
|
+
`initramfs/lib/modprobe.js` in
|
|
155
|
+
[buninu-linux](https://github.com/jjtseng93/buninu-linux)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# poweroff — power off Buninu Linux
|
|
2
|
+
|
|
3
|
+
`poweroff` flushes pending filesystem writes with `sync(2)`, then requests
|
|
4
|
+
`LINUX_REBOOT_CMD_POWER_OFF` through Linux `reboot(2)`. It does not invoke a
|
|
5
|
+
service manager or another command.
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
poweroff
|
|
11
|
+
poweroff --help
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The caller needs the kernel's `CAP_SYS_BOOT` capability. Buninu's root shell
|
|
15
|
+
has it; otherwise the command reports `Operation not permitted` and exits.
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# ps — list processes
|
|
2
|
+
|
|
3
|
+
`/bin/ps` is a small Bun script that reads `/proc`. Its primary interface is
|
|
4
|
+
the full-command-line table consumed by bunmsh's `pspa` and coloured `pspac`
|
|
5
|
+
builtins.
|
|
6
|
+
|
|
7
|
+
The file is also an importable module. It exports `readProcessSnapshot()`,
|
|
8
|
+
`prepareProcessFormat()`, `formatProcessHeader()`, and
|
|
9
|
+
`formatProcessLine()`. `/bin/top` uses these exports, so process discovery and
|
|
10
|
+
single-row formatting have one implementation.
|
|
11
|
+
|
|
12
|
+
## Synopsis
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
ps
|
|
16
|
+
ps -e | -A [-o pid,args]
|
|
17
|
+
ps -eo pid,args
|
|
18
|
+
ps -ef | ps aux | ps ax
|
|
19
|
+
ps -h | --help # this page
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Options
|
|
23
|
+
|
|
24
|
+
| Option | Meaning |
|
|
25
|
+
|---|---|
|
|
26
|
+
| `-e`, `-A`, `--all` | List every process instead of the default same-UID/same-TTY selection. |
|
|
27
|
+
| `-o FIELDS` | Select and order comma- or space-separated output fields. See below. |
|
|
28
|
+
| `-ef` | Full Unix view: UID, PID/PPID, CPU, start, TTY, accumulated time, and command. |
|
|
29
|
+
| `-eF` | Extra-full Unix view, adding `SZ`, `RSS`, and current processor (`PSR`). |
|
|
30
|
+
| `aux`, `-aux` | BSD view with user, CPU/memory percentages, VSZ/RSS, TTY, state, start, time, and command. |
|
|
31
|
+
| `ax`, `-ax` | Compact BSD view with PID, TTY, state, time, and command. |
|
|
32
|
+
| `-h`, `--help` | Render this page. |
|
|
33
|
+
|
|
34
|
+
`-e` and `-o` may be combined as `-eo pid,args`, which is the form bunmsh
|
|
35
|
+
uses. Rows are sorted numerically by PID. A process with an empty cmdline is
|
|
36
|
+
shown using its `/proc/PID/comm` name in brackets, as for a kernel thread.
|
|
37
|
+
With no `-o` or extended view, the standard columns are `PID TTY TIME CMD`,
|
|
38
|
+
and `CMD` is the short process name. The default selection is the caller's
|
|
39
|
+
effective UID and terminal, excluding session leaders. `-e`/`-A` selects all;
|
|
40
|
+
`a`, `x`, `-a`, and `-x` apply their usual BSD or Unix selection rules.
|
|
41
|
+
|
|
42
|
+
Plain `ps` excludes processes carrying Linux's `PF_KTHREAD` flag. This matters
|
|
43
|
+
on boot consoles where the shell and kernel threads may all be UID 0 without a
|
|
44
|
+
controlling TTY. Explicit all-process forms such as `ps -e`, `ps -A`, and
|
|
45
|
+
`ps -eo ...` include kernel threads.
|
|
46
|
+
|
|
47
|
+
### `-o` fields
|
|
48
|
+
|
|
49
|
+
Supported names are:
|
|
50
|
+
|
|
51
|
+
```text
|
|
52
|
+
pid ppid uid user euser comm args cmd command tty tt stat state c
|
|
53
|
+
%cpu pcpu %mem pmem vsz rss sz time etime etimes
|
|
54
|
+
start stime lstart ni nice pri psr
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
They may be combined and reordered, for example:
|
|
58
|
+
|
|
59
|
+
```sh
|
|
60
|
+
ps -eo pid,ppid,user,comm
|
|
61
|
+
ps -eo pid,stat,%cpu,%mem,rss,args
|
|
62
|
+
ps -o pid,tty,time,comm
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
`comm` is the kernel's short process name; `args` is the complete command
|
|
66
|
+
line. The exact `pid,args` layout remains the interface consumed by bunmsh.
|
|
67
|
+
|
|
68
|
+
## Examples
|
|
69
|
+
|
|
70
|
+
```sh
|
|
71
|
+
ps
|
|
72
|
+
ps -eo pid,args
|
|
73
|
+
ps -ef # common LLM/tutorial spelling
|
|
74
|
+
ps aux
|
|
75
|
+
pspac # bunmsh: the same table with syntax colours
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Limits
|
|
79
|
+
|
|
80
|
+
Values come from `/proc/PID/stat`, `/proc/PID/status`, `/proc/uptime`, and
|
|
81
|
+
`/proc/meminfo`; user names come from `/etc/passwd`. CPU percentages are the
|
|
82
|
+
process's average since it started, and memory percentage is resident memory
|
|
83
|
+
over `MemTotal`. Forest display, custom column headings, and less common
|
|
84
|
+
procps fields remain outside this minimal command. `/proc` must be mounted.
|
|
85
|
+
|
|
86
|
+
## Exit status
|
|
87
|
+
|
|
88
|
+
`0` success, `1` bad usage or `/proc` could not be read.
|
|
89
|
+
|
|
90
|
+
## See also
|
|
91
|
+
|
|
92
|
+
- `ip --help`
|
|
93
|
+
- Source: `initramfs/bin/ps` in
|
|
94
|
+
[buninu-linux](https://github.com/jjtseng93/buninu-linux)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# reboot — restart Buninu Linux
|
|
2
|
+
|
|
3
|
+
`reboot` flushes pending filesystem writes with `sync(2)`, then requests
|
|
4
|
+
`LINUX_REBOOT_CMD_RESTART` through Linux `reboot(2)`. It shares its
|
|
5
|
+
implementation with `poweroff` and does not invoke a service manager.
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
reboot
|
|
11
|
+
reboot --help
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The caller needs the kernel's `CAP_SYS_BOOT` capability. Buninu's root shell
|
|
15
|
+
has it; otherwise the command reports `Operation not permitted` and exits.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# tar — create and extract archives
|
|
2
|
+
|
|
3
|
+
`/bin/tar` is a small Bun script over `Bun.Archive`. It handles uncompressed
|
|
4
|
+
tar archives plus gzip and zstd without invoking another program.
|
|
5
|
+
|
|
6
|
+
## Synopsis
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
tar -cf ARCHIVE FILE...
|
|
10
|
+
tar -czf ARCHIVE FILE...
|
|
11
|
+
tar --zstd -cf ARCHIVE FILE...
|
|
12
|
+
tar -xf ARCHIVE [-C DIR] [MEMBER...]
|
|
13
|
+
tar -tf ARCHIVE [MEMBER...]
|
|
14
|
+
tar -h | --help # this page
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Use `-` as ARCHIVE to read from standard input or write to standard output.
|
|
18
|
+
|
|
19
|
+
## Options
|
|
20
|
+
|
|
21
|
+
| Option | Meaning |
|
|
22
|
+
|---|---|
|
|
23
|
+
| `-c` | Create an archive. |
|
|
24
|
+
| `-x` | Extract an archive. |
|
|
25
|
+
| `-t` | List archive members. |
|
|
26
|
+
| `-f ARCHIVE`, `--file=ARCHIVE` | Archive file, or `-` for standard input/output. |
|
|
27
|
+
| `-C DIR`, `--directory=DIR` | Read input files from DIR, or extract into DIR. |
|
|
28
|
+
| `-z`, `--gzip` | Create gzip-compressed tar, or explicitly identify gzip input. |
|
|
29
|
+
| `--zstd` | Create or read a zstd-compressed tar. A `.zst` or `.tzst` input is also detected by name. |
|
|
30
|
+
| `-v` | Print names while creating/extracting; with `-t`, also show each regular file's size and modification time. |
|
|
31
|
+
|
|
32
|
+
Short options can be combined, for example `-xzvf` or `-czf`.
|
|
33
|
+
For the traditional first option word, the leading hyphen is optional, so
|
|
34
|
+
`tar tf`, `tar xf`, and `tar cf` are equivalent to `tar -tf`, `tar -xf`, and
|
|
35
|
+
`tar -cf`.
|
|
36
|
+
|
|
37
|
+
## Examples
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
tar -czf source.tar.gz src README.md
|
|
41
|
+
tar -xzf source.tar.gz -C /tmp/source
|
|
42
|
+
tar -tf source.tar.gz
|
|
43
|
+
tar --zstd -cf backup.tar.zst home
|
|
44
|
+
tar --zstd -xf backup.tar.zst -C /mnt/restore
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Current Bun.Archive limits
|
|
48
|
+
|
|
49
|
+
Creation stores regular files only. Symbolic links are rejected rather than
|
|
50
|
+
silently archived as the wrong type; modes, ownership, hard links, and empty
|
|
51
|
+
directories are not preserved. Bun 1.4.3 also requires file contents to be
|
|
52
|
+
materialized in memory before archive creation.
|
|
53
|
+
|
|
54
|
+
Extraction restores directories and symbolic links, but Bun 1.4.3 skips hard
|
|
55
|
+
links. Listing and verbose extraction use `Archive.files()`, so they report
|
|
56
|
+
regular files only. Verbose listing can show their size and modification time,
|
|
57
|
+
but not the unavailable mode or owner. Bun provides gzip and zstd codecs but no xz or bzip2 codec,
|
|
58
|
+
so this command does not accept `.tar.xz` or `.tar.bz2`.
|
|
59
|
+
|
|
60
|
+
Appending with `-r`/`rvf` is not supported. `Bun.Archive` has no append API;
|
|
61
|
+
rebuilding an existing archive through `Archive.files()` would silently lose
|
|
62
|
+
its directories, links, ownership, and modes, so this command refuses instead.
|
|
63
|
+
|
|
64
|
+
## Exit status
|
|
65
|
+
|
|
66
|
+
`0` success, `2` bad usage or an archive/file operation failed.
|
|
67
|
+
|
|
68
|
+
## See also
|
|
69
|
+
|
|
70
|
+
- [Bun.Archive](https://bun.com/docs/runtime/archive)
|
|
71
|
+
- [tar(1)](https://man7.org/linux/man-pages/man1/tar.1.html)
|
|
72
|
+
- Source: `initramfs/bin/tar` in
|
|
73
|
+
[buninu-linux](https://github.com/jjtseng93/buninu-linux)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# top
|
|
2
|
+
|
|
3
|
+
`top` periodically reads the process snapshot exported by `/bin/ps`. Process
|
|
4
|
+
discovery and row formatting are shared with `ps`; `top` only calculates CPU
|
|
5
|
+
changes between refreshes, sorts rows, and redraws the screen.
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
top
|
|
11
|
+
top -d 1
|
|
12
|
+
top -b -n 1
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
- `-d SECONDS` sets the refresh interval (default: 3).
|
|
16
|
+
- `-n COUNT` exits after that many snapshots.
|
|
17
|
+
- `-b` uses batch output without terminal control sequences.
|
|
18
|
+
- `-h`, `--help` displays this document.
|
|
19
|
+
|
|
20
|
+
While running interactively, press `q` to quit, `P` to sort by CPU, `M` to
|
|
21
|
+
sort by memory, or `N` to sort by PID. The first screen shows the lifetime CPU
|
|
22
|
+
average available from `ps`; later screens show usage during the refresh
|
|
23
|
+
interval.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# umount — unmount a filesystem
|
|
2
|
+
|
|
3
|
+
`/bin/umount` is a Bun script that calls `umount2(2)` through
|
|
4
|
+
`/lib/dlopen.js`.
|
|
5
|
+
|
|
6
|
+
## Synopsis
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
umount [-f] [-l] [-R] [-v] TARGET...
|
|
10
|
+
umount -h | --help
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
TARGET is a mount point. Naming the device (`umount /dev/vda1`) is not
|
|
14
|
+
supported; use `mount` with no arguments to see where it is mounted.
|
|
15
|
+
|
|
16
|
+
## Options
|
|
17
|
+
|
|
18
|
+
| Option | Meaning |
|
|
19
|
+
|---|---|
|
|
20
|
+
| `-l`, `--lazy` | Detach now, clean up when the last user goes away (`MNT_DETACH`). |
|
|
21
|
+
| `-f`, `--force` | Force, for unreachable network filesystems (`MNT_FORCE`). |
|
|
22
|
+
| `-R`, `--recursive` | Also unmount everything mounted below TARGET, deepest first. |
|
|
23
|
+
| `-v` | Report each successful unmount. |
|
|
24
|
+
|
|
25
|
+
## Examples
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
umount /mnt
|
|
29
|
+
umount -l /mnt/windows # something still has a file open
|
|
30
|
+
umount -R /mnt/root # a tree made with mount --rbind
|
|
31
|
+
umount /tmp/big /mnt/usb # several at once
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
"target is busy" means a process has its working directory or an open file
|
|
35
|
+
inside the mount. On the Bun REPL, `process.chdir("/")` is usually the fix;
|
|
36
|
+
`-l` is the escape hatch.
|
|
37
|
+
|
|
38
|
+
## Exit status
|
|
39
|
+
|
|
40
|
+
`0` all targets unmounted, `1` bad usage, `32` at least one failed.
|
|
41
|
+
|
|
42
|
+
## See also
|
|
43
|
+
|
|
44
|
+
- `mount --help`
|
|
45
|
+
- [umount(2)](https://man7.org/linux/man-pages/man2/umount.2.html),
|
|
46
|
+
[umount(8)](https://man7.org/linux/man-pages/man8/umount.8.html)
|
|
47
|
+
- Source: `initramfs/bin/umount` in
|
|
48
|
+
[buninu-linux](https://github.com/jjtseng93/buninu-linux)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "buninu-linux",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "A Linux distribution running Bun as PID 1 with the Buninu userspace.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -37,6 +37,6 @@
|
|
|
37
37
|
"fetch": "./index.js -f",
|
|
38
38
|
"pack": "./index.js -b",
|
|
39
39
|
"start": "./index.js -r",
|
|
40
|
-
"check": "
|
|
40
|
+
"check": "for f in ./index.js ./initramfs/init.js ./initramfs/lib/document.js ./initramfs/lib/dlopen.js ./initramfs/lib/modprobe.js ./initramfs/lib/power.js ./initramfs/bin/mount ./initramfs/bin/umount ./initramfs/bin/ip ./initramfs/bin/ps ./initramfs/bin/top ./initramfs/bin/poweroff ./initramfs/bin/reboot ./initramfs/bin/tar; do node --check \"$f\" || exit 1; done"
|
|
41
41
|
}
|
|
42
42
|
}
|