Skip to content

Commit aaaa135

Browse files
committed
Continued implementation of path walking code
Update license checks Added missing license SPDXes
1 parent 6ed13b2 commit aaaa135

File tree

14 files changed

+146
-198
lines changed

14 files changed

+146
-198
lines changed

.github/workflows/ci.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ jobs:
3131
- name: Formatting
3232
run: npm run format:check
3333

34+
- name: Check License
35+
run: npx lice src -a
36+
37+
- name: Check License non-GPL
38+
run: npx lice non-gpl/src -l LGPL-3.0-or-later
39+
3440
- name: Linting
3541
run: npm run lint
3642

package-lock.json

Lines changed: 37 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
"version": "2.0.0-devel-0",
44
"description": "Complete cross-host emulation of Linux in TypeScript",
55
"author": "James Prevett <jp@jamespre.dev> (https://jamespre.dev)",
6-
"bin": {
7-
"devel-license": "scripts/license.js"
8-
},
96
"repository": {
107
"type": "git",
118
"url": "git+https://github.com/james-pre/kerium.git"
@@ -18,7 +15,7 @@
1815
"bugs": {
1916
"url": "https://github.com/james-pre/kerium/issues"
2017
},
21-
"license": "GPL-3.0-or-later",
18+
"license": "GPL-3.0-or-later WITH EXCEPTIONS",
2219
"type": "module",
2320
"main": "dist/index.js",
2421
"types": "dist/index.d.ts",
@@ -33,6 +30,7 @@
3330
"scripts": {
3431
"format:check": "prettier --check .",
3532
"format": "prettier --write .",
33+
"check-license": "npx lice src -a && npx lice non-gpl/src -l LGPL-3.0-or-later",
3634
"lint": "tsc --noEmit && eslint src",
3735
"test": "tsx --test",
3836
"prepublishOnly": "npx tsc"
@@ -48,6 +46,7 @@
4846
},
4947
"dependencies": {
5048
"@endo/panic": "^1.0.1",
51-
"utilium": "^2.0.0"
49+
"memium": "^0.3.8",
50+
"utilium": "^2.5.0"
5251
}
5352
}

scripts/license.js

Lines changed: 0 additions & 145 deletions
This file was deleted.

scripts/linux-syscalls.worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ for (const file of files) {
5252
const tokens = inside[1]
5353
.split(',')
5454
.map(t => t.trim())
55-
.filter(Boolean);
55+
.filter(v => v);
5656

5757
const fn = tokens[0] || '';
5858
if (!fn) continue;

src/bad.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// SPDX-License-Identifier: GPL-3.0-or-later WITH EXCEPTIONS
12
import { emerg } from './log.js';
23
import { panic as __panic } from '@endo/panic';
34

src/capability.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// SPDX-License-Identifier: GPL-3.0-or-later WITH EXCEPTIONS
12
import { map_inode_gid, map_inode_uid, type MountIDMap } from './fs/idmapping.js';
23
import type { Inode } from './fs/inode.js';
34
import { crit } from './log.js';

src/fs/acl.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,11 @@ export interface ACLEntry {
4343
/**
4444
* @todo [share]
4545
*/
46-
export interface ACL {
47-
entries: ACLEntry[];
46+
export class ACL {
47+
/**
48+
* @todo Convert to sharable array
49+
*/
50+
entries: ACLEntry[] = [];
4851
}
4952

5053
export function is_posix_acl(inode: Readonly<Inode>): boolean {

src/fs/dentry.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,6 @@ export enum DentryFlags {
8282
*/
8383
export interface DentryOperations {
8484
delete?(dir: Readonly<Dentry>): Promise<void>;
85-
init?(dir: Dentry): Promise<void>;
85+
init?(dir: Dentry): void;
86+
hash?(dentry: Readonly<Dentry>, name: string): void;
8687
}

src/fs/inode.ts

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: GPL-3.0-or-later WITH EXCEPTIONS
22
// Copyright (c) 2025 James Prevett
33
import type { Lock } from '../lock.js';
4-
import type { ACL, ACLType } from './acl.js';
4+
import { ACL, ACLType } from './acl.js';
55
import type { Dentry } from './dentry.js';
66
import type { MountIDMap } from './idmapping.js';
77
import type { Superblock } from './super.js';
@@ -63,33 +63,33 @@ export const userModifiableFlags = 0x000380ff;
6363
/**
6464
* @todo [share]
6565
*/
66-
export interface Inode {
67-
readonly op: InodeOperations;
68-
sb: Superblock;
69-
_lock: Lock;
66+
export class Inode {
67+
readonly op!: InodeOperations;
68+
sb!: Superblock;
69+
_lock!: Lock;
7070

71-
mode: number;
72-
opflags: number;
73-
uid: number;
74-
gid: number;
75-
flags: number;
76-
ino: bigint;
77-
nlink: number;
78-
rdev: number;
79-
size: bigint;
80-
atime_sec: bigint;
81-
mtime_sec: bigint;
82-
ctime_sec: bigint;
83-
atime_nsec: number;
84-
mtime_nsec: number;
85-
ctime_nsec: number;
86-
generation: number;
87-
blocks: number;
71+
mode: number = 0;
72+
opflags: number = 0;
73+
uid: number = 0;
74+
gid: number = 0;
75+
flags: number = 0;
76+
ino: bigint = 0n;
77+
nlink: number = 0;
78+
rdev: number = 0;
79+
size: bigint = 0n;
80+
atime_sec: bigint = 0n;
81+
mtime_sec: bigint = 0n;
82+
ctime_sec: bigint = 0n;
83+
atime_nsec: number = 0;
84+
mtime_nsec: number = 0;
85+
ctime_nsec: number = 0;
86+
generation: number = 0;
87+
blocks: number = 0;
8888
/** @atomic */
89-
version: bigint;
89+
version: bigint = 0n;
9090

91-
acl: ACL;
92-
default_acl: ACL;
91+
acl: ACL = new ACL();
92+
default_acl: ACL = new ACL();
9393
}
9494

9595
export enum InodeOp {

0 commit comments

Comments
 (0)