This commit is contained in:
Zsolt Ero
2023-12-21 12:50:36 +01:00
parent aaf9d2c74e
commit 1bae6bf2e1
7 changed files with 10 additions and 8 deletions

View File

@@ -15,7 +15,7 @@ server {
# we need to handle missing tiles as valid request returning empty string
location @empty {
default_type application/x-protobuf;
default_type application/vnd.mapbox-vector-tile;
return 200 '';
}
}

View File

@@ -1,67 +0,0 @@
#!/usr/bin/env bash
# reference:
# https://www.kernel.org/doc/Documentation/filesystems/ext4.txt
# https://wiki.archlinux.org/title/ext4
#
# -m reserved-blocks-percentage
# -F Force mke2fs to create a filesystem, even if the specified device is not a partition on a block special device
#
# -O feature
# from /etc/mke2fs.conf
# defaults: has_journal,extent,huge_file,flex_bg,metadata_csum,64bit,dir_nlink,extra_isize
# disabling journalling, since it's a read-only fs, as well as other unused features
# extent is actually needed for tail packing small files
#
# -E extended-options
# lazy_itable_init - inode table is fully initialized at the time of file system creation
# nodiscard - Do not attempt to discard blocks at mkfs time.
#
# inode_size = 128 (minimum)
# inode_ratio = 16384 (default but experimenting)
sudo umount mnt || true
rm -rf mnt
rm -f image.ext4
# make a sparse file
# make sure it's bigger then the current OSM output
fallocate -l 200G image.ext4
mke2fs -t ext4 -v \
-m 0 \
-F \
-O ^has_journal,^huge_file,^metadata_csum,^64bit,^extra_isize \
-E lazy_itable_init=0,nodiscard \
-I 128 \
-i 16384 \
image.ext4
mkdir mnt
sudo mount -v \
-t ext4 \
-o nobarrier,noatime \
image.ext4 mnt
sudo chown ofm:ofm -R mnt
../../tile_gen/venv/bin/python ../../tile_gen/extract.py output.mbtiles mnt/extract \
> "extract_out.log" 2> "extract_err.log"
sudo umount mnt
e2fsck -vf image.ext4 && \
resize2fs -M image.ext4 && \
e2fsck -vf image.ext4
# default to read-only mode
tune2fs -E mount_opts=ro image.ext4

View File

@@ -51,7 +51,7 @@ grep fixed extract_out.log > dedupl_fixed.log || true
rsync -avH \
--max-alloc=4294967296 \
--exclude dedupl \
mnt_rw/extract/ mnt_rw2/extract/ \
mnt_rw/extract/ mnt_rw2/ \
> rsync_out.log 2> rsync_err.log

View File

@@ -25,5 +25,6 @@ java -Xmx1g \
> planetiler_out 2> planetiler_err
rm -r data
echo planetiler.jar DONE
#$TILE_GEN_BIN/extract_btrfs.sh
$TILE_GEN_BIN/extract_btrfs.sh

View File

@@ -27,5 +27,6 @@ java -Xmx30g \
> planetiler_out 2> planetiler_err
rm -r data
echo planetiler.jar DONE
#$TILE_GEN_BIN/extract_btrfs.sh
$TILE_GEN_BIN/extract_btrfs.sh