From 32d40e934eb68d8b0a54cb5af280d2bed1f6a8b3 Mon Sep 17 00:00:00 2001 From: semarie Date: Sun, 14 Feb 2021 17:14:42 +0000 Subject: [PATCH] distrib: restore rdsetroot -x usage (extract the disk.fs image) on stripped bsd.rd It passes options to keep rd_root_size and rd_root_image symbols while stripping. These symbols are the ones used by rdsetroot to insert or extract disk image into RAMDISK. ok danj@ deraadt@ --- distrib/alpha/miniroot/Makefile | 7 +++++-- distrib/amd64/ramdiskA/Makefile | 6 ++++-- distrib/amd64/ramdisk_cd/Makefile | 6 ++++-- distrib/i386/ramdisk/Makefile | 6 ++++-- distrib/i386/ramdisk_cd/Makefile | 6 ++++-- distrib/macppc/ramdisk/Makefile | 7 ++++--- distrib/sparc64/miniroot/Makefile | 6 ++++-- distrib/sparc64/ramdisk/Makefile | 6 ++++-- distrib/sparc64/ramdiskB/Makefile | 6 ++++-- 9 files changed, 37 insertions(+), 19 deletions(-) diff --git a/distrib/alpha/miniroot/Makefile b/distrib/alpha/miniroot/Makefile index a694b4ac4f0..762599e4e3a 100644 --- a/distrib/alpha/miniroot/Makefile +++ b/distrib/alpha/miniroot/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.21 2021/02/13 18:48:23 semarie Exp $ +# $OpenBSD: Makefile,v 1.22 2021/02/14 17:14:42 semarie Exp $ FS= miniroot${OSrev}.img FSSIZE= 5760 @@ -62,7 +62,10 @@ ${CDROM}: bsd.gz rm -f vnd bsd.gz: bsd.rd - objcopy -S -R .comment -R .SUNW_ctf -R .eh_frame -R .shstrtab bsd.rd bsd.strip + objcopy -S -R .comment -R .SUNW_ctf \ + -K rd_root_size -K rd_root_image \ + -R .eh_frame -R .shstrtab \ + bsd.rd bsd.strip gzip -9cn bsd.strip > bsd.gz bsd.rd: mr.fs bsd diff --git a/distrib/amd64/ramdiskA/Makefile b/distrib/amd64/ramdiskA/Makefile index c8e3da8bd60..9d37eb98bc9 100644 --- a/distrib/amd64/ramdiskA/Makefile +++ b/distrib/amd64/ramdiskA/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.14 2021/02/13 18:52:08 semarie Exp $ +# $OpenBSD: Makefile,v 1.15 2021/02/14 17:14:42 semarie Exp $ FS= floppy${OSrev}.img FSSIZE= 2880 @@ -33,7 +33,9 @@ MRDISKTYPE= rdroot MRMAKEFSARGS= -o disklabel=${MRDISKTYPE},minfree=0,density=4096 bsd.gz: bsd.rd - objcopy -S -R .comment -R .SUNW_ctf bsd.rd bsd.strip + objcopy -S -R .comment -R .SUNW_ctf \ + -K rd_root_size -K rd_root_image \ + bsd.rd bsd.strip gzip -9cn bsd.strip > bsd.gz bsd.rd: mr.fs bsd diff --git a/distrib/amd64/ramdisk_cd/Makefile b/distrib/amd64/ramdisk_cd/Makefile index 591a12b09b7..70ae847b3e6 100644 --- a/distrib/amd64/ramdisk_cd/Makefile +++ b/distrib/amd64/ramdisk_cd/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.29 2021/02/14 17:11:02 semarie Exp $ +# $OpenBSD: Makefile,v 1.30 2021/02/14 17:14:42 semarie Exp $ FS= miniroot${OSrev}.img FSSIZE= 9920 @@ -56,7 +56,9 @@ MRDISKTYPE= rdrootb MRMAKEFSARGS= -o disklabel=${MRDISKTYPE},minfree=0,density=4096 bsd.gz: bsd.rd - objcopy -S -R .comment -R .SUNW_ctf bsd.rd bsd.strip + objcopy -S -R .comment -R .SUNW_ctf \ + -K rd_root_size -K rd_root_image \ + bsd.rd bsd.strip gzip -9cn bsd.strip > bsd.gz bsd.rd: mr.fs bsd diff --git a/distrib/i386/ramdisk/Makefile b/distrib/i386/ramdisk/Makefile index 688f317fa7a..dd7e960771d 100644 --- a/distrib/i386/ramdisk/Makefile +++ b/distrib/i386/ramdisk/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.13 2021/02/13 18:52:08 semarie Exp $ +# $OpenBSD: Makefile,v 1.14 2021/02/14 17:14:42 semarie Exp $ FS= floppy${OSrev}.img FSSIZE= 2880 @@ -34,7 +34,9 @@ MRDISKTYPE= rdroot MRMAKEFSARGS= -o disklabel=${MRDISKTYPE},minfree=0,density=4096 bsd.gz: bsd.rd - objcopy -S -R .comment -R .SUNW_ctf bsd.rd bsd.strip + objcopy -S -R .comment -R .SUNW_ctf \ + -K rd_root_size -K rd_root_image \ + bsd.rd bsd.strip gzip -9cn bsd.strip > bsd.gz bsd.rd: mr.fs bsd diff --git a/distrib/i386/ramdisk_cd/Makefile b/distrib/i386/ramdisk_cd/Makefile index 900def94cad..871cfdae768 100644 --- a/distrib/i386/ramdisk_cd/Makefile +++ b/distrib/i386/ramdisk_cd/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.23 2021/02/14 17:11:02 semarie Exp $ +# $OpenBSD: Makefile,v 1.24 2021/02/14 17:14:42 semarie Exp $ FS= miniroot${OSrev}.img FSSIZE= 8064 @@ -53,7 +53,9 @@ MRDISKTYPE= rdrootb MRMAKEFSARGS= -o disklabel=${MRDISKTYPE},minfree=0,density=4096 bsd.gz: bsd.rd - objcopy -S -R .comment -R .SUNW_ctf bsd.rd bsd.strip + objcopy -S -R .comment -R .SUNW_ctf \ + -K rd_root_size -K rd_root_image \ + bsd.rd bsd.strip gzip -9cn bsd.strip > bsd.gz bsd.rd: mr.fs bsd diff --git a/distrib/macppc/ramdisk/Makefile b/distrib/macppc/ramdisk/Makefile index 820633da3b0..e77c777c007 100644 --- a/distrib/macppc/ramdisk/Makefile +++ b/distrib/macppc/ramdisk/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.49 2021/02/14 17:11:02 semarie Exp $ +# $OpenBSD: Makefile,v 1.50 2021/02/14 17:14:42 semarie Exp $ CDROM= cd${OSrev}.iso MTREE= ${UTILS}/mtree.conf @@ -35,9 +35,10 @@ bsd.gz: bsd.rd gzip -9cn bsd.rd > bsd.gz bsd.rd: mr.fs bsd - cp bsd bsd.rd + objcopy -S -R .comment -R .SUNW_ctf \ + -K rd_root_size -K rd_root_image \ + bsd bsd.rd rdsetroot bsd.rd mr.fs - strip -R .SUNW_ctf bsd.rd bsd: cd ${.CURDIR}/../../../sys/arch/${MACHINE}/compile/${RAMDISK} && \ diff --git a/distrib/sparc64/miniroot/Makefile b/distrib/sparc64/miniroot/Makefile index f38c2a1377c..d66d02dcbed 100644 --- a/distrib/sparc64/miniroot/Makefile +++ b/distrib/sparc64/miniroot/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.26 2021/02/14 17:11:02 semarie Exp $ +# $OpenBSD: Makefile,v 1.27 2021/02/14 17:14:42 semarie Exp $ FS= miniroot${OSrev}.img FSSIZE= 6400 @@ -59,7 +59,9 @@ ${CDROM}: bsd.rd ${FS} mksuncd f ${CDROM} ${FS} bsd.gz: bsd.rd - objcopy -S -R .comment -R .SUNW_ctf bsd.rd bsd.strip + objcopy -S -R .comment -R .SUNW_ctf \ + -K rd_root_size -K rd_root_image \ + bsd.rd bsd.strip gzip -9cn bsd.strip > bsd.gz bsd.rd: mr.fs bsd diff --git a/distrib/sparc64/ramdisk/Makefile b/distrib/sparc64/ramdisk/Makefile index b360b68ac7a..cdbff9a2868 100644 --- a/distrib/sparc64/ramdisk/Makefile +++ b/distrib/sparc64/ramdisk/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.52 2021/02/13 18:46:52 semarie Exp $ +# $OpenBSD: Makefile,v 1.53 2021/02/14 17:14:42 semarie Exp $ FS= floppy${OSrev}.img FSSIZE= 2880 @@ -32,7 +32,9 @@ ${FS}: bsd.gz rm -f vnd bsd.gz: bsd.rd - objcopy -S -R .SUNW_ctf bsd.rd bsd.strip + objcopy -S -R .comment -R .SUNW_ctf \ + -K rd_root_size -K rd_root_image \ + bsd.rd bsd.strip gzip -9cn bsd.strip > bsd.gz bsd.rd: mr.fs bsd diff --git a/distrib/sparc64/ramdiskB/Makefile b/distrib/sparc64/ramdiskB/Makefile index ec7f6c3f591..5499a067cde 100644 --- a/distrib/sparc64/ramdiskB/Makefile +++ b/distrib/sparc64/ramdiskB/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.48 2021/02/13 18:46:52 semarie Exp $ +# $OpenBSD: Makefile,v 1.49 2021/02/14 17:14:42 semarie Exp $ FS= floppyB${OSrev}.img FSSIZE= 2880 @@ -32,7 +32,9 @@ ${FS}: bsd.gz rm -f vnd bsd.gz: bsd.rd - objcopy -S -R .SUNW_ctf bsd.rd bsd.strip + objcopy -S -R .SUNW_ctf -R .comment \ + -K rd_root_size -K rd_root_image \ + bsd.rd bsd.strip gzip -9cn bsd.strip > bsd.gz bsd.rd: mr.fs bsd -- 2.20.1