Diff

Differences From Artifact [1e459fa032]:

To Artifact [7557bdba83]:


1
2
3
4
5
6
7

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


#! /usr/bin/env bash

set -e

# Not included:
#  1. Downloading huge.s from Slackware64 kernels (into boot/)
#  2. Downloading kernel modules package from Slackware64 (into root/)

#  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 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 ext4 \
  /dev/loop3p1

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

sudo mke2fs \
  -L 'DATA' \
  -N 0 \
  -O ^64bit \
  -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









>
|
|

>
>
>
>



|
>
>
>
>
>
>
|
|
|
<


>
|
>
>
|
>
|
>
>
>
>
>
|

|







<
|
<
<
<
<
<
<
<
<
<

|






|


|


|


|
>
>
1
2
3
4
5
6
7
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
64
65
66
67
68
69
70
71
72
73
#! /usr/bin/env bash

set -e

# Not included:
#  1. Downloading huge.s from Slackware64 kernels (into boot/)
#  2. Downloading kernel modules package from Slackware64 (into root/)
#  3. Running "depmod" within the chroot root/
#  4. Downloading a static Tclkit with TUAPI
#  5. Downloading a static AppFS

image_file="$(pwd)/appfs.img"
old_loop_dev="$(losetup --noheadings --output name --associated "${image_file}")" || old_loop_dev=''
extlinux_mbr_bin='/usr/lib/EXTLINUX/mbr.bin'

make init LDFLAGS=-static
cp init root/bin

rm -f boot/initrd
(
	cd root || exit 1
	find . ! -name '.' -print0 | sort --zero-terminated --dictionary-order | cpio -o -0 --owner 0:0 --dot -H newc
) | gzip -1c > boot/initrd

rm -f "${image_file}"
truncate --size 1024M "${image_file}"
sfdisk --no-tell-kernel --no-reread "${image_file}" <<<'label: dos
size=128M type=83 bootable

type=83'

if [ -d 'x-boot' ]; then
	sudo umount x-boot || :
fi
if [ -n "${old_loop_dev}" ]; then
	sudo losetup -d "${old_loop_dev}" || :
fi
sudo losetup --partscan --find "${image_file}"
loop_dev="$(losetup --noheadings --output name --associated "${image_file}")"
if [ -z "${loop_dev}" ]; then
	echo "No loop device found" >&2
	exit 1
fi
sudo chown "$(id -u):$(id -g)" "${loop_dev}" "${loop_dev}p1" "${loop_dev}p2"

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

  "${loop_dev}p1"










mke2fs \
  -L 'DATA' \
  -N 0 \
  -O ^64bit \
  -m 5 \
  -r 1 \
  -t ext4 \
  "${loop_dev}p2"

mkdir x-boot || :
sudo mount "${loop_dev}p1" x-boot
sudo extlinux --install $(pwd)/x-boot
sudo umount x-boot
dd if="${extlinux_mbr_bin}" of="${image_file}" conv=notrunc
rmdir x-boot

losetup -d "${loop_dev}"

exit 0