From 5ce6e90c70378c63044b526f6a8196645971576a Mon Sep 17 00:00:00 2001 From: "Peter H. Froehlich" Date: Wed, 14 Apr 2021 19:30:59 +0200 Subject: Add swap partition, SPDX identifiers. --- README.md | 4 ++-- crc32.h | 2 ++ fstypes.c | 4 ++++ fstypes.h | 2 ++ guid.c | 2 ++ guid.h | 2 ++ mkgpt.c | 2 ++ part.h | 2 ++ test-mkgpt.sh | 7 ++++--- 9 files changed, 22 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 09837d1..601d2ed 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,8 @@ contents of provided partition images. Just say `make` followed by `make install` and most likely you'll be happy. If you want a compact, statically linked executable make sure you have the -`musl-gcc` wrapper installed and say `make static` followed by `make install` -instead. +`musl-gcc` wrapper installed and say `make musl-static` (or just `make static` +if you have a full musl toolchain) followed by `make install` instead. ## How to use diff --git a/crc32.h b/crc32.h index 2158681..6ed3f00 100644 --- a/crc32.h +++ b/crc32.h @@ -1,5 +1,7 @@ #pragma once +/* SPDX-License-Identifier: MIT */ + #ifndef CRC32_H #define CRC32_H diff --git a/fstypes.c b/fstypes.c index 383f8c5..2e697cf 100644 --- a/fstypes.c +++ b/fstypes.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: MIT */ + /* Copyright (C) 2014 by John Cronin * * Permission is hereby granted, free of charge, to any person obtaining a copy @@ -62,4 +64,6 @@ init_fstypes() fsnames[0x29] = "fat32+"; string_to_guid(&fstypes[0x83], "0FC63DAF-8483-4772-8E79-3D69D8477DE4"); fsnames[0x83] = "linux"; + string_to_guid(&fstypes[0x82], "0657FD6D-A4AB-43C4-84E5-0933C84B4F4F"); + fsnames[0x82] = "swap"; } diff --git a/fstypes.h b/fstypes.h index 4c63e64..ed75224 100644 --- a/fstypes.h +++ b/fstypes.h @@ -1,5 +1,7 @@ #pragma once +/* SPDX-License-Identifier: MIT */ + /* Copyright (C) 2014 by John Cronin * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/guid.c b/guid.c index 12247fc..ed9e6d2 100644 --- a/guid.c +++ b/guid.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: MIT */ + /* Copyright (C) 2014 by John Cronin * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/guid.h b/guid.h index c9e0509..07cd9ee 100644 --- a/guid.h +++ b/guid.h @@ -1,5 +1,7 @@ #pragma once +/* SPDX-License-Identifier: MIT */ + /* Copyright (C) 2014 by John Cronin * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/mkgpt.c b/mkgpt.c index 29ac72b..d57196c 100644 --- a/mkgpt.c +++ b/mkgpt.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: MIT */ + /* Copyright (C) 2014 by John Cronin * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/part.h b/part.h index 80504c8..7890ca8 100644 --- a/part.h +++ b/part.h @@ -1,5 +1,7 @@ #pragma once +/* SPDX-License-Identifier: MIT */ + /* Copyright (C) 2014 by John Cronin * * Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/test-mkgpt.sh b/test-mkgpt.sh index 43bee6e..4cf75e3 100755 --- a/test-mkgpt.sh +++ b/test-mkgpt.sh @@ -10,15 +10,16 @@ if [ ! -x ./mkgpt ]; then fi mkdir -pv ${tmpdir} -for name in a.img b.img c.img; do +for name in a.img b.img c.img d.img; do truncate --size=16M ${tmpdir}/${name} done # TODO something goes wrong with --sector-size 1024 or 4096 -./mkgpt -o ${tmpdir}/bla.img \ +./mkgpt -o ${tmpdir}/bla.img -s 131072 \ --part ${tmpdir}/a.img --type system \ --part ${tmpdir}/b.img --type fat32 \ - --part ${tmpdir}/c.img --type linux + --part ${tmpdir}/c.img --type linux \ + --part ${tmpdir}/d.img --type swap fdisk -l ${tmpdir}/bla.img -- cgit 1.4.1-2-gfad0