This repository was archived by the owner on Aug 14, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +22
-9
lines changed
Expand file tree Collapse file tree 4 files changed +22
-9
lines changed Original file line number Diff line number Diff line change 11FROM debian:jessie
22
33RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
4- build-essential \
4+ dosfstools \
55 kpartx \
6- zip \
76 ruby \
8- ruby-dev \
9- dosfstools \
7+ zip \
108 --no-install-recommends && \
119 rm -rf /var/lib/apt/lists/*
1210
Original file line number Diff line number Diff line change 1- .PHONY : build
21default : build
32
43build :
@@ -8,7 +7,10 @@ rpi-raw-image: build
87 docker run --rm --privileged -v $(shell pwd) :/workspace image-builder-raw /workspace/builder/rpi/build.sh
98
109shell : build
11- docker run -ti --privileged -v $(shell pwd) :/workspace image-builder-raw bash
10+ docker run --rm -ti --privileged -v $(shell pwd) :/workspace image-builder-raw bash
11+
12+ testshell : build
13+ docker run --rm -ti --privileged -v $(shell pwd) /builder:/builder -v $(shell pwd) :/workspace image-builder-raw bash
1214
1315tag :
1416 git tag ${TAG}
Original file line number Diff line number Diff line change @@ -12,13 +12,18 @@ IMAGE_PATH="rpi-raw.img"
1212SD_CARD_SIZE=" 1500"
1313BOOT_PARTITION_SIZE=" 64"
1414
15+ # Create empty BOOT/ROOTFS image file
16+ # - SD_CARD_SIZE in MByte
17+ # - DD uses 256 Bytes
18+ # - sector block size is 512Bytes
19+ # - MBR size is 512 Bytes, so we start at sector 2048 (1MByte reserved space)
1520BOOTFS_START=2048
1621BOOTFS_SIZE=$( expr ${BOOT_PARTITION_SIZE} \* 2048)
1722ROOTFS_START=$( expr ${BOOTFS_SIZE} + ${BOOTFS_START} )
18- SD_MINUS_DD=$( expr ${SD_CARD_SIZE} - 256 ) # old config: 1280 - 256 = 1024 for rootfs
19- ROOTFS_SIZE=$( expr ${SD_MINUS_DD} \* 1000000 / 512 - ${ROOTFS_START} )
23+ SD_MINUS_DD=$( expr ${SD_CARD_SIZE} \* 1024 \* 1024 - 256)
24+ ROOTFS_SIZE=$( expr ${SD_MINUS_DD} / 512 - ${ROOTFS_START} )
2025
21- dd if=/dev/zero of=${IMAGE_PATH} bs=1MB count=${SD_CARD_SIZE}
26+ dd if=/dev/zero of=${IMAGE_PATH} bs=1MiB count=${SD_CARD_SIZE}
2227
2328DEVICE=$( losetup -f --show ${IMAGE_PATH} )
2429
Original file line number Diff line number Diff line change 2424 it "has a root-partition with a sda2 Linux filesystem" do
2525 expect ( stdout ) . to contain ( '^.*\.img2 .*Linux$' )
2626 end
27+
28+ it "partition sda1 starts at sector 2048" do
29+ expect ( stdout ) . to contain ( '^.*\.img1\ *2048 .*$' )
30+ end
31+
32+ it "partition sda1 has a size of 64M" do
33+ expect ( stdout ) . to contain ( '^.*\.img1.* 64M c.*$' )
34+ end
2735 end
2836end
You can’t perform that action at this time.
0 commit comments