typescript-virtual-container 1.6.1 → 1.6.2
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 +21 -21
- package/dist/.tsbuildinfo +1 -1
- package/dist/VirtualShell/index.d.ts +3 -0
- package/dist/VirtualShell/index.js +2 -0
- package/dist/commands/dpkg.js +1 -1
- package/dist/commands/expr.js +1 -1
- package/dist/commands/last.js +1 -1
- package/dist/commands/manuals-bundle.js +1 -1
- package/dist/commands/miscutils.js +3 -3
- package/dist/commands/mousepad.d.ts +2 -0
- package/dist/commands/mousepad.js +21 -0
- package/dist/commands/netcat.js +1 -1
- package/dist/commands/procUtils.js +1 -1
- package/dist/commands/registry.js +7 -0
- package/dist/commands/startxfce4.d.ts +2 -0
- package/dist/commands/startxfce4.js +13 -0
- package/dist/commands/sysinfo.js +3 -3
- package/dist/commands/textutils.js +2 -2
- package/dist/commands/top.js +1 -1
- package/dist/commands/uname.js +1 -1
- package/dist/commands/xfceDesktop.d.ts +2 -0
- package/dist/commands/xfceDesktop.js +13 -0
- package/dist/modules/VirtualNetworkManager.js +1 -0
- package/dist/modules/desktopManager.d.ts +104 -0
- package/dist/modules/desktopManager.js +927 -0
- package/dist/modules/linuxRootfs.js +125 -19
- package/package.json +1 -1
|
@@ -48,13 +48,13 @@ function bootstrapEtc(vfs, hostname, props) {
|
|
|
48
48
|
`NAME="Fortune GNU/Linux"`,
|
|
49
49
|
`PRETTY_NAME="${props.os}"`,
|
|
50
50
|
`ID=fortune`,
|
|
51
|
-
`ID_LIKE=
|
|
51
|
+
`ID_LIKE=fortune`,
|
|
52
52
|
`HOME_URL="https://github.com/itsrealfortune/typescript-virtual-container"`,
|
|
53
53
|
`VERSION_CODENAME=nyx`,
|
|
54
|
-
`VERSION_ID="
|
|
54
|
+
`VERSION_ID="1.0"`,
|
|
55
55
|
`FORTUNE_CODENAME=nyx`,
|
|
56
56
|
].join("\n")}\n`);
|
|
57
|
-
ensureFile(vfs, "/etc/
|
|
57
|
+
ensureFile(vfs, "/etc/fortune_version", "nyx/stable\n");
|
|
58
58
|
ensureFile(vfs, "/etc/hostname", `${hostname}\n`);
|
|
59
59
|
ensureFile(vfs, "/etc/shells", "/bin/sh\n/bin/bash\n/usr/bin/bash\n/bin/dash\n/usr/bin/dash\n");
|
|
60
60
|
ensureFile(vfs, "/etc/profile", `${[
|
|
@@ -65,12 +65,12 @@ function bootstrapEtc(vfs, hostname, props) {
|
|
|
65
65
|
" export PS1='\\[\\e[37;1m\\][\\[\\e[35;1m\\]\\u\\[\\e[37;1m\\]@\\[\\e[34;1m\\]\\h\\[\\e[0m\\] \\w]\\[\\e[0m\\]\\$ '",
|
|
66
66
|
"fi",
|
|
67
67
|
].join("\n")}\n`);
|
|
68
|
-
ensureFile(vfs, "/etc/issue", "Fortune GNU/Linux
|
|
69
|
-
ensureFile(vfs, "/etc/issue.net", "Fortune GNU/Linux
|
|
68
|
+
ensureFile(vfs, "/etc/issue", "Fortune GNU/Linux 1.0 Nyx \\n \\l\n");
|
|
69
|
+
ensureFile(vfs, "/etc/issue.net", "Fortune GNU/Linux 1.0 Nyx\n");
|
|
70
70
|
ensureFile(vfs, "/etc/motd", ["", `Welcome to ${props.os}`, `Kernel: ${props.kernel}`, ""].join("\n"));
|
|
71
71
|
ensureFile(vfs, "/etc/lsb-release", `${[
|
|
72
72
|
"DISTRIB_ID=Fortune",
|
|
73
|
-
"DISTRIB_RELEASE=
|
|
73
|
+
"DISTRIB_RELEASE=1.0",
|
|
74
74
|
"DISTRIB_CODENAME=nyx",
|
|
75
75
|
`DISTRIB_DESCRIPTION="${props.os}"`,
|
|
76
76
|
].join("\n")}\n`);
|
|
@@ -642,8 +642,8 @@ export function refreshProc(vfs, props, hostname, shellStartTime, sessions = [],
|
|
|
642
642
|
"dm_mod 155648 10 - Live 0x0000000000000000",
|
|
643
643
|
"crc32c_intel 24576 10 - Live 0x0000000000000000",
|
|
644
644
|
].join("\n")}\n`);
|
|
645
|
-
// /proc/cmdline —
|
|
646
|
-
write(vfs, "/proc/cmdline", `console=ttyS0 reboot=k panic=1 nomodule random.trust_cpu=1 ipv6.disable=1 swiotlb=noforce rdinit=/process_api init_on_free=1
|
|
645
|
+
// /proc/cmdline — boot args
|
|
646
|
+
write(vfs, "/proc/cmdline", `console=ttyS0 reboot=k panic=1 nomodule random.trust_cpu=1 ipv6.disable=1 swiotlb=noforce rdinit=/process_api init_on_free=1\n`);
|
|
647
647
|
// /proc/filesystems — matching real container
|
|
648
648
|
write(vfs, "/proc/filesystems", `${[
|
|
649
649
|
"nodev\tsysfs",
|
|
@@ -1512,8 +1512,7 @@ function bootstrapMisc(vfs, props) {
|
|
|
1512
1512
|
ensureDir(vfs, "/srv");
|
|
1513
1513
|
ensureDir(vfs, "/mnt");
|
|
1514
1514
|
ensureDir(vfs, "/media");
|
|
1515
|
-
// /boot —
|
|
1516
|
-
// but maintain the directory structure for tool compatibility
|
|
1515
|
+
// /boot — kernel images, initrd, and bootloader config
|
|
1517
1516
|
ensureDir(vfs, "/boot");
|
|
1518
1517
|
ensureDir(vfs, "/boot/grub");
|
|
1519
1518
|
ensureFile(vfs, "/boot/grub/grub.cfg", `${[
|
|
@@ -1521,26 +1520,133 @@ function bootstrapMisc(vfs, props) {
|
|
|
1521
1520
|
"set default=0",
|
|
1522
1521
|
"set timeout=0",
|
|
1523
1522
|
"",
|
|
1524
|
-
`menuentry "Fortune GNU/Linux" {`,
|
|
1523
|
+
`menuentry "Fortune GNU/Linux 1.0 Nyx" {`,
|
|
1525
1524
|
` linux /vmlinuz-${props.kernel} root=/dev/vda rw console=ttyS0`,
|
|
1526
1525
|
` initrd /initrd.img-${props.kernel}`,
|
|
1527
1526
|
`}`,
|
|
1528
1527
|
].join("\n")}\n`);
|
|
1529
1528
|
const kver = props.kernel;
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1529
|
+
// kernel image — padded to a realistic size so ls -l /boot/ looks credible
|
|
1530
|
+
const vmlinuzContent = `# Fortune GNU/Linux kernel ${kver}
|
|
1531
|
+
# Compressed Linux/x86_64 kernel image
|
|
1532
|
+
# Build: fortune@nyx-build, gcc (Fortune 13.3.0-nyx1)
|
|
1533
|
+
# SMP PREEMPT_DYNAMIC, virtio, kvm_guest
|
|
1534
|
+
`.padEnd(10240, "x");
|
|
1535
|
+
ensureFile(vfs, `/boot/vmlinuz-${kver}`, vmlinuzContent, 0o644);
|
|
1536
|
+
ensureFile(vfs, `/boot/initrd.img-${kver}`, `${[
|
|
1537
|
+
"#!/bin/sh",
|
|
1538
|
+
"# Fortune GNU/Linux initramfs",
|
|
1539
|
+
`# Kernel: ${kver}`,
|
|
1540
|
+
"mount -t proc none /proc",
|
|
1541
|
+
"mount -t sysfs none /sys",
|
|
1542
|
+
"mount -t devtmpfs none /dev",
|
|
1543
|
+
"echo 'Loading Fortune GNU/Linux 1.0 Nyx...'",
|
|
1544
|
+
"exec /sbin/init",
|
|
1545
|
+
].join("\n")}\n`, 0o644);
|
|
1546
|
+
ensureFile(vfs, `/boot/System.map-${kver}`, `${[
|
|
1547
|
+
"ffffffff81000000 T _stext",
|
|
1548
|
+
"ffffffff81000000 T _text",
|
|
1549
|
+
"ffffffff81000000 A startup_64",
|
|
1550
|
+
"ffffffff81000100 T secondary_startup_64",
|
|
1551
|
+
"ffffffff81000200 T __startup_64",
|
|
1552
|
+
"ffffffff81001000 T x86_64_start_kernel",
|
|
1553
|
+
"ffffffff81001100 T x86_64_start_reservations",
|
|
1554
|
+
"ffffffff81001200 T start_kernel",
|
|
1555
|
+
"ffffffff81002000 T init_task",
|
|
1556
|
+
"ffffffff81003000 T rest_init",
|
|
1557
|
+
"ffffffff81004000 T kernel_init",
|
|
1558
|
+
"ffffffff81005000 T kernel_init_freeable",
|
|
1559
|
+
"ffffffff81006000 T do_basic_setup",
|
|
1560
|
+
"ffffffffa0000000 T virtio_init",
|
|
1561
|
+
"ffffffffa0001000 T virtio_devices_init",
|
|
1562
|
+
"ffffffffa0010000 T virtio_blk_init",
|
|
1563
|
+
"ffffffffa0020000 T virtio_net_init",
|
|
1564
|
+
"ffffffffa00f0000 T fortitude_init",
|
|
1565
|
+
].join("\n")}\n`, 0o644);
|
|
1566
|
+
ensureFile(vfs, `/boot/config-${kver}`, `${[
|
|
1567
|
+
"#",
|
|
1568
|
+
"# Linux/x86_64 6.1.0-fortune Kernel Configuration",
|
|
1569
|
+
"# Fortune GNU/Linux 1.0 Nyx",
|
|
1570
|
+
"#",
|
|
1571
|
+
"CONFIG_64BIT=y",
|
|
1572
|
+
"CONFIG_X86_64=y",
|
|
1573
|
+
"CONFIG_SMP=y",
|
|
1574
|
+
"CONFIG_PREEMPT=y",
|
|
1575
|
+
"CONFIG_PREEMPT_DYNAMIC=y",
|
|
1576
|
+
"",
|
|
1577
|
+
"#",
|
|
1578
|
+
"# Virtualization",
|
|
1579
|
+
"#",
|
|
1580
|
+
"CONFIG_HYPERVISOR_GUEST=y",
|
|
1581
|
+
"CONFIG_KVM_GUEST=y",
|
|
1582
|
+
"CONFIG_PARAVIRT=y",
|
|
1583
|
+
"CONFIG_PARAVIRT_SPINLOCKS=y",
|
|
1584
|
+
"",
|
|
1585
|
+
"#",
|
|
1586
|
+
"# Virtio",
|
|
1587
|
+
"#",
|
|
1588
|
+
"CONFIG_VIRTIO=y",
|
|
1589
|
+
"CONFIG_VIRTIO_MENU=y",
|
|
1590
|
+
"CONFIG_VIRTIO_BLK=y",
|
|
1591
|
+
"CONFIG_VIRTIO_NET=y",
|
|
1592
|
+
"CONFIG_VIRTIO_CONSOLE=y",
|
|
1593
|
+
"CONFIG_VIRTIO_BALLOON=y",
|
|
1594
|
+
"CONFIG_VIRTIO_MMIO=y",
|
|
1595
|
+
"CONFIG_VIRTIO_INPUT=y",
|
|
1596
|
+
"",
|
|
1597
|
+
"#",
|
|
1598
|
+
"# Block devices",
|
|
1599
|
+
"#",
|
|
1600
|
+
"CONFIG_BLK_DEV=y",
|
|
1601
|
+
"CONFIG_EXT4_FS=y",
|
|
1602
|
+
"CONFIG_TMPFS=y",
|
|
1603
|
+
"CONFIG_TMPFS_XATTR=y",
|
|
1604
|
+
"",
|
|
1605
|
+
"#",
|
|
1606
|
+
"# Networking",
|
|
1607
|
+
"#",
|
|
1608
|
+
"CONFIG_NET=y",
|
|
1609
|
+
"CONFIG_INET=y",
|
|
1610
|
+
"CONFIG_IPV6=n",
|
|
1611
|
+
"CONFIG_BRIDGE=m",
|
|
1612
|
+
"CONFIG_NETFILTER=y",
|
|
1613
|
+
"CONFIG_NETFILTER_XTABLES=y",
|
|
1614
|
+
"",
|
|
1615
|
+
"#",
|
|
1616
|
+
"# Console",
|
|
1617
|
+
"#",
|
|
1618
|
+
"CONFIG_SERIAL_8250=y",
|
|
1619
|
+
"CONFIG_SERIAL_8250_CONSOLE=y",
|
|
1620
|
+
"CONFIG_VT=y",
|
|
1621
|
+
"CONFIG_VT_CONSOLE=y",
|
|
1622
|
+
"CONFIG_HW_CONSOLE=y",
|
|
1623
|
+
"",
|
|
1624
|
+
"#",
|
|
1625
|
+
"# Security",
|
|
1626
|
+
"#",
|
|
1627
|
+
"CONFIG_SECURITY=y",
|
|
1628
|
+
"CONFIG_SECURITY_NETWORK=y",
|
|
1629
|
+
"CONFIG_LSM=\"lockdown,yama,loadpin,safesetid,integrity\"",
|
|
1630
|
+
"",
|
|
1631
|
+
"#",
|
|
1632
|
+
"# Virtual file system",
|
|
1633
|
+
"#",
|
|
1634
|
+
"CONFIG_PROC_FS=y",
|
|
1635
|
+
"CONFIG_SYSFS=y",
|
|
1636
|
+
"CONFIG_DEVTMPFS=y",
|
|
1637
|
+
"CONFIG_DEVTMPFS_MOUNT=y",
|
|
1638
|
+
"CONFIG_CONFIGFS_FS=y",
|
|
1639
|
+
"CONFIG_DEBUG_FS=y",
|
|
1640
|
+
].join("\n")}\n`, 0o644);
|
|
1641
|
+
const prevKver = "1.0.0+itsrealfortune+0-amd64";
|
|
1534
1642
|
if (!vfs.exists("/vmlinuz"))
|
|
1535
1643
|
vfs.symlink(`/boot/vmlinuz-${kver}`, "/vmlinuz");
|
|
1536
1644
|
if (!vfs.exists("/vmlinuz.old"))
|
|
1537
|
-
vfs.symlink(`/boot/vmlinuz-${
|
|
1645
|
+
vfs.symlink(`/boot/vmlinuz-${prevKver}`, "/vmlinuz.old");
|
|
1538
1646
|
if (!vfs.exists("/initrd.img"))
|
|
1539
1647
|
vfs.symlink(`/boot/initrd.img-${kver}`, "/initrd.img");
|
|
1540
1648
|
if (!vfs.exists("/initrd.img.old"))
|
|
1541
|
-
vfs.symlink(`/boot/initrd.img-${
|
|
1542
|
-
// No /snap — not present in Firecracker container
|
|
1543
|
-
// /proc/cmdline confirms: no snapd boot args
|
|
1649
|
+
vfs.symlink(`/boot/initrd.img-${prevKver}`, "/initrd.img.old");
|
|
1544
1650
|
// /lost+found — ext4 recovery
|
|
1545
1651
|
ensureDir(vfs, "/lost+found", 0o700);
|
|
1546
1652
|
// /home — users managed by bootstrapRoot + syncEtcPasswd
|