Skip to content

Commit

Permalink
Merge pull request #120 from SolidHal/crypto
Browse files Browse the repository at this point in the history
Fixup crypto merge
  • Loading branch information
SolidHal authored Oct 6, 2019
2 parents afaf80f + 990c13d commit c7f93b9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
6 changes: 4 additions & 2 deletions resources/BuildResources/config
Original file line number Diff line number Diff line change
Expand Up @@ -1467,10 +1467,12 @@ CONFIG_ZRAM=y
# CONFIG_ZRAM_MEMORY_TRACKING is not set
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_LOOP_MIN_COUNT=8
# CONFIG_BLK_DEV_CRYPTOLOOP is not set
CONFIG_BLK_DEV_CRYPTOLOOP=y
# CONFIG_BLK_DEV_DRBD is not set
# CONFIG_BLK_DEV_NBD is not set
# CONFIG_BLK_DEV_RAM is not set
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_BLK_DEV_RAM_SIZE=4096
# CONFIG_CDROM_PKTCDVD is not set
# CONFIG_ATA_OVER_ETH is not set
# CONFIG_BLK_DEV_RBD is not set
Expand Down
27 changes: 19 additions & 8 deletions scripts/buildFilesystem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,34 @@ cleanup() {

trap cleanup INT TERM EXIT


#layout the partitons and write filesystem information
create_image() {
# it's a sparse file - that's how we fit a 16GB image inside a 3GB one
dd if=/dev/zero of=$1 bs=$3 count=$4 conv=sparse
parted --script $1 mklabel gpt
cgpt create $1
cgpt add -i 1 -t kernel -b 8192 -s 65536 -l Kernel -S 1 -T 5 -P 10 $1
start=$((8192 + 65536))
kernel_start=8192
kernel_size=65536
boot_size=409600 # 200 MB
cgpt add -i 1 -t kernel -b $kernel_start -s $kernel_size -l Kernel -S 1 -T 5 -P 10 $1
#create the initramfs partiton, aka /boot
boot_start=$(($kernel_start + $kernel_size))
cgpt add -i 2 -t data -b $boot_start -s $boot_size -l Boot $1
#Now the main filesystem
root_start=$(($boot_start + $boot_size))
end=`cgpt show $1 | grep 'Sec GPT table' | awk '{print $1}'`
size=$(($end - $start))
cgpt add -i 2 -t data -b $start -s $size -l Root $1
root_size=$(($end - $root_start))
cgpt add -i 3 -t data -b $root_start -s $root_size -l Root $1
# $size is in 512 byte blocks while ext4 uses a block size of 1024 bytes
losetup -P $2 $1
mkfs.ext4 -F -b 1024 -m 0 ${2}p2 $(($size / 2))
mkfs.ext4 -F -b 1024 -m 0 ${2}p2 $(($boot_size / 2))
mkfs.ext4 -F -b 1024 -m 0 ${2}p3 $(($root_size / 2))

# mount the / partition
mount -o noatime ${2}p2 $5
mount -o noatime ${2}p3 $5

# mount the /boot partiton
mkdir -p $5/boot
mount -o noatime ${2}p2 $5/boot
}

# use buster if no suite is specified
Expand Down

0 comments on commit c7f93b9

Please sign in to comment.