Check-in [353218f0f3]
Overview
Comment:Switch to EXT4, Cache on its own partition/fs and added procps-ng to QEMU image
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 353218f0f39e639be557f02d171fe87c13dedfb1
User & Date: rkeene on 2020-06-28 18:22:53
Other Links: manifest | tags
Context
2020-06-28
20:05
Do not include root directory in the cache/data fs check-in: 2d622e681b user: rkeene tags: trunk
18:22
Switch to EXT4, Cache on its own partition/fs and added procps-ng to QEMU image check-in: 353218f0f3 user: rkeene tags: trunk
04:38
Minor QEMU init updates check-in: a1fd38efc8 user: rkeene tags: trunk
Changes

Modified build/qemu/assemble from [78cb3ad311] to [6ae3ce7f9b].

8
9
10
11
12
13
14
15

16
17

18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

33
34
35
36
37
38
39
40
41
42

43
44










45
46
47
48
49
50
51
52
8
9
10
11
12
13
14

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

33
34
35
36
37
38
39
40
41
42

43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63







-
+


+














-
+









-
+


+
+
+
+
+
+
+
+
+
+








#  3. Downloading a static Tclkit with TUAPI
#  4. Downloading a static AppFS

make init LDFLAGS=-static
cp init root/bin

rm -f appfs.img
truncate --size 512M appfs.img
truncate --size 1024M appfs.img
sfdisk --no-tell-kernel --no-reread ./appfs.img <<<'label: dos
size=16M type=83 bootable
size=239M type=83
type=83'

sudo umount x-boot || :
sudo losetup -d /dev/loop3 || :
sudo losetup --partscan /dev/loop3 $(pwd)/appfs.img
sudo chown "$(id -u):$(id -g)" /dev/loop3 /dev/loop3p1 /dev/loop3p2

sudo mke2fs \
  -L 'BOOT' \
  -N 0 \
  -O ^64bit \
  -d boot \
  -m 5 \
  -r 1 \
  -t ext2 \
  -t ext4 \
  /dev/loop3p1

sudo mke2fs \
  -L 'ROOT' \
  -N 0 \
  -O ^64bit \
  -d root \
  -m 5 \
  -r 1 \
  -t ext2 \
  -t ext4 \
  /dev/loop3p2

sudo mke2fs \
  -L 'DATA' \
  -N 0 \
  -O ^64bit \
  -d root \
  -m 5 \
  -r 1 \
  -t ext4 \
  /dev/loop3p3

mkdir x-boot || :
sudo mount /dev/loop3p1 x-boot
sudo extlinux --install $(pwd)/x-boot
sudo umount x-boot
dd if=/usr/lib/EXTLINUX/mbr.bin of=appfs.img conv=notrunc
rmdir x-boot

losetup -d /dev/loop3

Modified build/qemu/init.c from [c418f5267f] to [e11582ede8].

72
73
74
75
76
77
78

79
80
81


82
83
84
85
86
87
88
89
90
91
92
93
94
95
96

97
98
99
100
101
102
103
104
105
106
107
108

109
110
111
112
113
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118







+



+
+















+












+





	run("/bin/init-fuse", "init-fuse", NULL);

	mkdir("/etc", 0755);
	mkdir("/bin", 0755);
	mkdir("/lib", 0755);
	mkdir("/opt", 0755);
	mkdir("/opt/appfs", 0755);

	mkdir("/var", 0755);
	mkdir("/var/cache", 0755);
	mkdir("/var/cache/appfs", 0755);
	mount("/dev/vda3", "/var/cache/appfs", "ext4", 0, NULL);

	run("/bin/appfsd", "appfsd", "/var/cache/appfs", "/opt/appfs", NULL);

	symlink(".", "/usr");
	symlink("lib", "/lib64");

	symlink("/proc/self/mounts", "/etc/mtab");

	symlink("/opt/appfs/core.appfs.rkeene.org/bash/platform/latest/bin/bash", "/bin/bash");
	symlink("/opt/appfs/core.appfs.rkeene.org/coreutils/platform/latest/bin/env", "/bin/env");

	symlink("/bin/bash", "/bin/sh");

	setenv("PATH", "/bin:/opt/appfs/core.appfs.rkeene.org/coreutils/platform/latest/bin", 1);
	run("/bin/appfs-cache", "appfs-cache", "install", "-lib", "core.appfs.rkeene.org", "glibc", NULL);
	run("/bin/appfs-cache", "appfs-cache", "install", "core.appfs.rkeene.org", "coreutils", NULL);
	run("/bin/appfs-cache", "appfs-cache", "install", "core.appfs.rkeene.org", "procps-ng", NULL);
	setenv("PATH", "/bin", 1);

	run("/bin/sh", "sh", NULL);

	/*
	 * Remount root filesystem read-only
	 */
	umount("/dev");
	umount("/tmp");
	umount("/proc");
	umount("/sys");
	umount("/opt/appfs");
	umount("/var/cache/appfs");
	mount("/dev/vda2", "/", "ext4", MS_REMOUNT | MS_RDONLY, NULL);
	sync();

	return(0);
}