2023-05-06 10:11:35 +00:00
#!/usr/bin/env bash
set -e
source $( dirname $0 ) /env.sh
cd $LUNA_ROOT
2024-02-11 12:39:51 +00:00
if [ " $( id -u) " -ne "0" ]
then
export FAKEROOT_SAVE = " fakeroot -u -s $LUNA_ROOT /.fakeroot -- "
export FAKEROOT_RESTORE = " fakeroot -u -i $LUNA_ROOT /.fakeroot -- "
else
echo "Caution: you are running make-iso.sh as root. This should only be done inside a container, for example in CI."
export FAKEROOT_SAVE = ""
export FAKEROOT_RESTORE = ""
fi
${ FAKEROOT_SAVE } tools/install.sh
2023-05-06 10:11:35 +00:00
2023-08-08 13:43:20 +00:00
disk_space = $( du -s base | awk '{ print $1 }' )
min_blocks = $(( $disk_space / 4 )) # This is just the blocks needed for all the files in the file system: this excludes space for the inode table, block group descriptors, etc.
blocks = $(( $min_blocks + 1024 )) # This is the actual number of blocks we're using.
2024-02-11 12:39:51 +00:00
${ FAKEROOT_RESTORE } genext2fs -d base -B 4096 -b $blocks -L luna-rootfs -N 1024 build/ext2fs.bin
2023-06-22 17:39:43 +00:00
2023-07-10 11:05:06 +00:00
mkbootimg luna.json Luna.iso