Merge pull request #214373 from ncfavier/make-image-structured-attrs
make-squashfs,make-iso9660-image: use `__structuredAttrs`
This commit is contained in:
commit
3ac4b371b3
|
@ -47,16 +47,16 @@ assert usbBootable -> isohybridMbrImage != "";
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = isoName;
|
name = isoName;
|
||||||
builder = ./make-iso9660-image.sh;
|
__structuredAttrs = true;
|
||||||
|
|
||||||
|
buildCommandPath = ./make-iso9660-image.sh;
|
||||||
nativeBuildInputs = [ xorriso syslinux zstd libossp_uuid ];
|
nativeBuildInputs = [ xorriso syslinux zstd libossp_uuid ];
|
||||||
|
|
||||||
inherit isoName bootable bootImage compressImage volumeID efiBootImage efiBootable isohybridMbrImage usbBootable;
|
inherit isoName bootable bootImage compressImage volumeID efiBootImage efiBootable isohybridMbrImage usbBootable;
|
||||||
|
|
||||||
# !!! should use XML.
|
|
||||||
sources = map (x: x.source) contents;
|
sources = map (x: x.source) contents;
|
||||||
targets = map (x: x.target) contents;
|
targets = map (x: x.target) contents;
|
||||||
|
|
||||||
# !!! should use XML.
|
|
||||||
objects = map (x: x.object) storeContents;
|
objects = map (x: x.object) storeContents;
|
||||||
symlinks = map (x: x.symlink) storeContents;
|
symlinks = map (x: x.symlink) storeContents;
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,3 @@
|
||||||
source $stdenv/setup
|
|
||||||
|
|
||||||
sources_=($sources)
|
|
||||||
targets_=($targets)
|
|
||||||
|
|
||||||
objects=($objects)
|
|
||||||
symlinks=($symlinks)
|
|
||||||
|
|
||||||
|
|
||||||
# Remove the initial slash from a path, since genisofs likes it that way.
|
# Remove the initial slash from a path, since genisofs likes it that way.
|
||||||
stripSlash() {
|
stripSlash() {
|
||||||
res="$1"
|
res="$1"
|
||||||
|
@ -35,13 +26,13 @@ if test -n "$bootable"; then
|
||||||
# The -boot-info-table option modifies the $bootImage file, so
|
# The -boot-info-table option modifies the $bootImage file, so
|
||||||
# find it in `contents' and make a copy of it (since the original
|
# find it in `contents' and make a copy of it (since the original
|
||||||
# is read-only in the Nix store...).
|
# is read-only in the Nix store...).
|
||||||
for ((i = 0; i < ${#targets_[@]}; i++)); do
|
for ((i = 0; i < ${#targets[@]}; i++)); do
|
||||||
stripSlash "${targets_[$i]}"
|
stripSlash "${targets[$i]}"
|
||||||
if test "$res" = "$bootImage"; then
|
if test "$res" = "$bootImage"; then
|
||||||
echo "copying the boot image ${sources_[$i]}"
|
echo "copying the boot image ${sources[$i]}"
|
||||||
cp "${sources_[$i]}" boot.img
|
cp "${sources[$i]}" boot.img
|
||||||
chmod u+w boot.img
|
chmod u+w boot.img
|
||||||
sources_[$i]=boot.img
|
sources[$i]=boot.img
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -66,9 +57,9 @@ touch pathlist
|
||||||
|
|
||||||
|
|
||||||
# Add the individual files.
|
# Add the individual files.
|
||||||
for ((i = 0; i < ${#targets_[@]}; i++)); do
|
for ((i = 0; i < ${#targets[@]}; i++)); do
|
||||||
stripSlash "${targets_[$i]}"
|
stripSlash "${targets[$i]}"
|
||||||
addPath "$res" "${sources_[$i]}"
|
addPath "$res" "${sources[$i]}"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "squashfs.img";
|
name = "squashfs.img";
|
||||||
|
__structuredAttrs = true;
|
||||||
|
|
||||||
nativeBuildInputs = [ squashfsTools ];
|
nativeBuildInputs = [ squashfsTools ];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue