From 63aa66101bbe871b0f3925389b1914cf01e92426 Mon Sep 17 00:00:00 2001 From: Hal Emmerich Date: Sun, 6 Oct 2019 13:13:33 -0500 Subject: [PATCH] Revert "Merge branch 'master' into crypto" This reverts commit 8c8cf1c9217de525a06ea53b0ba8c5a0a916768a, reversing changes made to 4bbd91699f4709e3a8e545a5264c53124c28e530. --- resources/BuildResources/config | 6 ++++-- scripts/buildFilesystem.sh | 27 +++++++++++++++++++-------- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/resources/BuildResources/config b/resources/BuildResources/config index fff0424..223c4a9 100644 --- a/resources/BuildResources/config +++ b/resources/BuildResources/config @@ -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 diff --git a/scripts/buildFilesystem.sh b/scripts/buildFilesystem.sh index ff195aa..7e942b7 100755 --- a/scripts/buildFilesystem.sh +++ b/scripts/buildFilesystem.sh @@ -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