Makefile.bootimage revision 1.1
11.1Stsutsui# $NetBSD: Makefile.bootimage,v 1.1 2012/01/22 03:53:30 tsutsui Exp $ 21.1Stsutsui# 31.1Stsutsui# Copyright (c) 2009, 2010, 2011 Izumi Tsutsui. All rights reserved. 41.1Stsutsui# 51.1Stsutsui# Redistribution and use in source and binary forms, with or without 61.1Stsutsui# modification, are permitted provided that the following conditions 71.1Stsutsui# are met: 81.1Stsutsui# 1. Redistributions of source code must retain the above copyright 91.1Stsutsui# notice, this list of conditions and the following disclaimer. 101.1Stsutsui# 2. Redistributions in binary form must reproduce the above copyright 111.1Stsutsui# notice, this list of conditions and the following disclaimer in the 121.1Stsutsui# documentation and/or other materials provided with the distribution. 131.1Stsutsui# 141.1Stsutsui# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 151.1Stsutsui# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 161.1Stsutsui# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 171.1Stsutsui# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 181.1Stsutsui# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 191.1Stsutsui# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 201.1Stsutsui# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 211.1Stsutsui# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 221.1Stsutsui# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 231.1Stsutsui# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 241.1Stsutsui 251.1Stsutsui# 261.1Stsutsui# Makefile to create a bootable FS image for USB flash or emulators 271.1Stsutsui# 281.1Stsutsui 291.1Stsutsui# 301.1Stsutsui# Required variables: 311.1Stsutsui# RELEASEDIR 321.1Stsutsui# Should be defined in nbmake-${MACHINE} 331.1Stsutsui# IMGBASE 341.1Stsutsui# Basename of the image 351.1Stsutsui# 361.1Stsutsui# Optional variables: 371.1Stsutsui# BOOTDISK 381.1Stsutsui# device name of target bootable disk specified in /etc/fstab 391.1Stsutsui# (default: sd0) 401.1Stsutsui# USE_MBR 411.1Stsutsui# set yes if target disk image requires MBR partition 421.1Stsutsui# (defautl: no) 431.1Stsutsui# USE_SUNLABEL 441.1Stsutsui# set yes if target disk image requires Sun's label 451.1Stsutsui# (default: no) 461.1Stsutsui# INSTALLBOOT_AFTER_DISKLABEL (untested) 471.1Stsutsui# set yes if the target ${MACHINE} requires disklabel 481.1Stsutsui# to run installboot(8), like hp300 491.1Stsutsui# (default: empty) 501.1Stsutsui# IMAGEMB 511.1Stsutsui# target image size in MB 521.1Stsutsui# (default: 2048) 531.1Stsutsui# SWAPMB 541.1Stsutsui# swap size in target image in MB 551.1Stsutsui# (default: 128) 561.1Stsutsui# KERN_SET 571.1Stsutsui# kernel set name which should be extracted into image 581.1Stsutsui# (default: kern-GENERIC) 591.1Stsutsui# SETS 601.1Stsutsui# binary sets that should be extracted into image 611.1Stsutsui# (default: modules base etc comp games man misc tests text 621.1Stsutsui# xbase xcomp xetc xfont xserver) 631.1Stsutsui# SETS_DIR 641.1Stsutsui# directory path where binary sets are stored 651.1Stsutsui# (default: ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets) 661.1Stsutsui# IMGFILE_EXTRA 671.1Stsutsui# list of additional files to be copied into images, 681.1Stsutsui# containing one or more tuples of the form: 691.1Stsutsui# FILE TARGETPATH 701.1Stsutsui# for installation image etc. 711.1Stsutsui# (default: empty) 721.1Stsutsui# IMGDIR_EXTRA 731.1Stsutsui# list of additional directories to be copied into images, 741.1Stsutsui# containing one or more tuples of the form: 751.1Stsutsui# DIR TARGETPATH 761.1Stsutsui# for installation image etc. 771.1Stsutsui# (default: empty) 781.1Stsutsui# XXX: currently permittions in IMGDIR_EXTRA are not handled 791.1Stsutsui# IMGDIR_EXCLUDE 801.1Stsutsui# pax(1) options to exclude files which should not copied 811.1Stsutsui# into TARGETPATH in IMGDIR_EXTRA 821.1Stsutsui# (default: empty) 831.1Stsutsui# FSTAB_IN 841.1Stsutsui# template file of /etc/fstab 851.1Stsutsui# (default: ${DISTRIBDIR}/common/bootimage/fstab.in) 861.1Stsutsui# SPEC_IN 871.1Stsutsui# default files of spec file for makefs(8) 881.1Stsutsui# (default: ${DISTRIBDIR}/common/bootimage/spec.in) 891.1Stsutsui# SPEC_EXTRA 901.1Stsutsui# additional files of spec file for makefs(8) 911.1Stsutsui# (default: empty) 921.1Stsutsui# IMGMAKEFSOPTIONS 931.1Stsutsui# options passed to makefs(8) to create root file system 941.1Stsutsui# (default: -o bsize=16384,fsize=2048,density=8192) 951.1Stsutsui# PRIMARY_BOOT 961.1Stsutsui# primary boot loader that should be installed into 971.1Stsutsui# the target image via installboot(8) 981.1Stsutsui# (default: empty) 991.1Stsutsui# SECONDARY_BOOT 1001.1Stsutsui# secondary bootloader that should be put into the target image 1011.1Stsutsui# (default: empty) 1021.1Stsutsui# SECONDARY_BOOT_ARG 1031.1Stsutsui# extra arguments that should be passed to installboot(8) 1041.1Stsutsui# to specify the secondary bootloader 1051.1Stsutsui# (default: empty) 1061.1Stsutsui# DISKPROTO_IN 1071.1Stsutsui# template file of disklabel -R 1081.1Stsutsui# (default: ${DISTRIBDIR}/common/bootimage/diskproto.in 1091.1Stsutsui# or ${DISTRIBDIR}/common/bootimage/diskproto.mbr.in) 1101.1Stsutsui# OMIT_SWAPIMG 1111.1Stsutsui# no need to put swap partition into image (for USB stick) 1121.1Stsutsui# (default: no) 1131.1Stsutsui# 1141.1Stsutsui 1151.1Stsutsui.include <bsd.sys.mk> # for HOST_SH 1161.1Stsutsui.include <bsd.own.mk> # 1171.1Stsutsui.include <bsd.endian.mk> # for TARGET_ENDIANNESS 1181.1Stsutsui 1191.1Stsutsui.include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib" 1201.1Stsutsui 1211.1Stsutsui.if empty(IMGBASE) 1221.1Stsutsui.BEGIN: 1231.1Stsutsui @echo "Error: IMGBASE is not set" 1241.1Stsutsui @false 1251.1Stsutsui.endif 1261.1Stsutsui.if empty(RELEASEDIR) 1271.1Stsutsui.BEGIN: 1281.1Stsutsui @echo "Error: RELEASEDIR is not set" 1291.1Stsutsui @false 1301.1Stsutsui.endif 1311.1Stsutsui 1321.1Stsutsui# should be defined elsewhere? 1331.1StsutsuiCAT?= cat 1341.1StsutsuiCHMOD?= chmod 1351.1StsutsuiCP?= cp 1361.1StsutsuiDD?= dd 1371.1StsutsuiMKDIR?= mkdir -p 1381.1StsutsuiRM?= rm 1391.1Stsutsui 1401.1Stsutsui# 1411.1Stsutsui# common definitions for image 1421.1Stsutsui# 1431.1StsutsuiBOOTDISK?= sd0 1441.1StsutsuiUSE_MBR?= no 1451.1StsutsuiUSE_SUNLABEL?= no 1461.1StsutsuiINSTALLBOOT_AFTER_DISKLABEL?= no 1471.1Stsutsui 1481.1Stsutsui# 1491.1Stsutsui# size parameters for image 1501.1Stsutsui# 1511.1StsutsuiIMAGEMB?= 2048 # 2048MB 1521.1StsutsuiSWAPMB?= 128 # 128MB 1531.1Stsutsui 1541.1StsutsuiIMAGESECTORS!= expr ${IMAGEMB} \* 1024 \* 1024 / 512 1551.1StsutsuiSWAPSECTORS!= expr ${SWAPMB} \* 1024 \* 1024 / 512 1561.1Stsutsui 1571.1Stsutsui.if ${USE_MBR} == "no" 1581.1StsutsuiLABELSECTORS?= 0 1591.1Stsutsui.else 1601.1Stsutsui#LABELSECTORS?= 63 # historical 1611.1Stsutsui#LABELSECTORS?= 32 # 16KB aligned 1621.1StsutsuiLABELSECTORS?= 2048 # 1MB aligned for modern flash devices 1631.1Stsutsui.endif 1641.1Stsutsui 1651.1StsutsuiFSSECTORS!= expr ${IMAGESECTORS} - ${SWAPSECTORS} - ${LABELSECTORS} 1661.1StsutsuiFSSIZE!= expr ${FSSECTORS} \* 512 1671.1Stsutsui 1681.1Stsutsui# parameters for disklabel and MBR 1691.1StsutsuiHEADS= 64 1701.1StsutsuiSECTORS= 32 1711.1StsutsuiCYLINDERS!= expr ${IMAGESECTORS} / \( ${HEADS} \* ${SECTORS} \) 1721.1StsutsuiSECPERCYLINDERS!= expr ${HEADS} \* ${SECTORS} 1731.1StsutsuiMBRHEADS= 255 1741.1StsutsuiMBRSECTORS= 63 1751.1StsutsuiMBRCYLINDERS!= expr ${IMAGESECTORS} / \( ${MBRHEADS} \* ${MBRSECTORS} \) 1761.1StsutsuiMBRNETBSD= 169 1771.1Stsutsui 1781.1StsutsuiBSDPARTSECTORS!= expr ${IMAGESECTORS} - ${LABELSECTORS} 1791.1StsutsuiFSOFFSET= ${LABELSECTORS} 1801.1StsutsuiSWAPOFFSET!= expr ${LABELSECTORS} + ${FSSECTORS} 1811.1Stsutsui 1821.1Stsutsui# parameters for sunlabel 1831.1StsutsuiFSCYLINDERS!= expr ${FSSECTORS} / \( ${HEADS} \* ${SECTORS} \) 1841.1StsutsuiSWAPCYLINDERS!= expr ${SWAPSECTORS} / \( ${HEADS} \* ${SECTORS} \) 1851.1Stsutsui 1861.1Stsutsui 1871.1Stsutsui# 1881.1Stsutsui# definitions to create root fs 1891.1Stsutsui# 1901.1StsutsuiSETS_DEFAULT= modules base etc comp games man misc tests text 1911.1Stsutsui.if ${MKX11} != "no" 1921.1StsutsuiSETS_DEFAULT+= xbase xcomp xetc xfont xserver 1931.1Stsutsui.endif 1941.1Stsutsui 1951.1StsutsuiKERN_SET?= kern-GENERIC 1961.1StsutsuiSETS?= ${SETS_DEFAULT} 1971.1StsutsuiIMG_SETS= ${KERN_SET} ${SETS} 1981.1StsutsuiSETS_DIR?= ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets 1991.1Stsutsui 2001.1StsutsuiFSTAB_IN?= ${DISTRIBDIR}/common/bootimage/fstab.in 2011.1StsutsuiSPEC_IN?= ${DISTRIBDIR}/common/bootimage/spec.in 2021.1Stsutsui 2031.1StsutsuiIMGMAKEFSOPTIONS?= -o bsize=16384,fsize=2048,density=8192 2041.1Stsutsui 2051.1StsutsuiWORKDIR?= work 2061.1StsutsuiWORKSPEC?= work.spec 2071.1StsutsuiWORKFSTAB?= work.fstab 2081.1StsutsuiWORKRCCONF?= work.rc.conf 2091.1StsutsuiWORKFS?= work.rootfs 2101.1StsutsuiTARGETFS?= imgroot.fs 2111.1Stsutsui 2121.1StsutsuiCLEANFILES+= ${WORKSPEC} ${WORKFSTAB} ${WORKRCCONF} ${WORKFS} 2131.1StsutsuiCLEANFILES+= ${TARGETFS} 2141.1Stsutsui 2151.1Stsutsui# 2161.1Stsutsui# create root file system for the image 2171.1Stsutsui# 2181.1Stsutsui${TARGETFS}: prepare_md_post 2191.1Stsutsui @if [ ! -d ${RELEASEDIR}/${RELEASEMACHINEDIR} ]; then \ 2201.1Stsutsui echo "Missing ${RELEASEDIR}/${RELEASEMACHINEDIR}, aborting"; \ 2211.1Stsutsui false; \ 2221.1Stsutsui fi; 2231.1Stsutsui @${MKDIR} ${WORKDIR} 2241.1Stsutsui.for set in ${IMG_SETS} 2251.1Stsutsui @if [ ! -f ${SETS_DIR}/${set}.tgz ]; then \ 2261.1Stsutsui echo "Missing ${SETS_DIR}/${set}.tgz, aborting"; \ 2271.1Stsutsui false; \ 2281.1Stsutsui fi 2291.1Stsutsui @echo Extracting ${set}.tgz ... 2301.1Stsutsui @(cd ${WORKDIR}; ${TOOL_PAX} -rnz -f ${SETS_DIR}/${set}.tgz .) 2311.1Stsutsui.endfor 2321.1Stsutsui.if defined(SECONDARY_BOOT) 2331.1Stsutsui @echo Copying secondary boot... 2341.1Stsutsui ${CP} -f ${WORKDIR}/usr/mdec/${SECONDARY_BOOT} ${WORKDIR} 2351.1Stsutsui.endif 2361.1Stsutsui @echo Preparing /etc/fstab ... 2371.1Stsutsui ${TOOL_SED} "s/@@BOOTDISK@@/${BOOTDISK}/" < ${FSTAB_IN} > ${WORKFSTAB} 2381.1Stsutsui ${CP} ${WORKFSTAB} ${WORKDIR}/etc/fstab 2391.1Stsutsui @echo Setting rc_configured=YES in /etc/rc.conf ... 2401.1Stsutsui ${TOOL_SED} "s/rc_configured=NO/rc_configured=YES/" \ 2411.1Stsutsui < ${WORKDIR}/etc/rc.conf > ${WORKRCCONF} 2421.1Stsutsui ${CP} ${WORKRCCONF} ${WORKDIR}/etc/rc.conf 2431.1Stsutsui.if defined(IMGDIR_EXTRA) 2441.1Stsutsui @echo Copying extra dirs... 2451.1Stsutsui.for _SRCDIR _TARGET in ${IMGDIR_EXTRA} 2461.1Stsutsui @if [ ! -d ${_SRCDIR} ]; then \ 2471.1Stsutsui echo "${_SRCDIR} is not directory, aborting"; \ 2481.1Stsutsui false; \ 2491.1Stsutsui fi 2501.1Stsutsui ${MKDIR} ${WORKDIR}/${_TARGET} 2511.1Stsutsui (cd ${_SRCDIR} ; \ 2521.1Stsutsui ${TOOL_PAX} -rw -pe -v \ 2531.1Stsutsui ${IMGDIR_EXCLUDE} \ 2541.1Stsutsui . ${.OBJDIR}/${WORKDIR}/${_TARGET} ) 2551.1Stsutsui.endfor 2561.1Stsutsui.endif 2571.1Stsutsui.if defined(IMGFILE_EXTRA) 2581.1Stsutsui @echo Copying extra files... 2591.1Stsutsui.for _SRC _TARGET in ${IMGFILE_EXTRA} 2601.1Stsutsui @if [ ! -f ${_SRC} ]; then \ 2611.1Stsutsui echo "${_SRC} in IMGFILE_EXTRA not found, aborting"; \ 2621.1Stsutsui false; \ 2631.1Stsutsui fi 2641.1Stsutsui @if [ -f ${_SRC} ]; then \ 2651.1Stsutsui echo ${CP} ${_SRC} ${WORKDIR}/${_TARGET}; \ 2661.1Stsutsui ${CP} ${_SRC} ${WORKDIR}/${_TARGET}; \ 2671.1Stsutsui fi 2681.1Stsutsui.endfor 2691.1Stsutsui.endif 2701.1Stsutsui @echo Preparing spec files for makefs... 2711.1Stsutsui ${RM} -f ${WORKSPEC} 2721.1Stsutsui cat ${WORKDIR}/etc/mtree/* | \ 2731.1Stsutsui ${TOOL_SED} -e 's/ size=[0-9]*//' > ${WORKSPEC} 2741.1Stsutsui ${HOST_SH} ${WORKDIR}/dev/MAKEDEV -s all | \ 2751.1Stsutsui ${TOOL_SED} -e '/^\. type=dir/d' -e 's,^\.,./dev,' >> ${WORKSPEC} 2761.1Stsutsui cat ${SPEC_IN} >> ${WORKSPEC} 2771.1Stsutsui.if defined(SECONDARY_BOOT) 2781.1Stsutsui echo "./${SECONDARY_BOOT} type=file uname=root gname=wheel mode=0444" \ 2791.1Stsutsui >> ${WORKSPEC} 2801.1Stsutsui.endif 2811.1Stsutsui.if defined(SPEC_EXTRA) 2821.1Stsutsui cat ${SPEC_EXTRA} >> ${WORKSPEC} 2831.1Stsutsui.endif 2841.1Stsutsui @echo Createing rootfs... 2851.1Stsutsui # XXX /var/spool/ftp/hidden is unreadable 2861.1Stsutsui ${CHMOD} +r ${WORKDIR}/var/spool/ftp/hidden 2871.1Stsutsui ${TOOL_MAKEFS} -M ${FSSIZE} -m ${FSSIZE} \ 2881.1Stsutsui -B ${TARGET_ENDIANNESS} \ 2891.1Stsutsui -F ${WORKSPEC} -N ${WORKDIR}/etc \ 2901.1Stsutsui ${IMGMAKEFSOPTIONS} \ 2911.1Stsutsui ${WORKFS} ${WORKDIR} 2921.1Stsutsui.if !empty(PRIMARY_BOOT) && ${INSTALLBOOT_AFTER_DISKLABEL} == "no" 2931.1Stsutsui ${TOOL_INSTALLBOOT} -vm ${MACHINE} ${WORKFS} \ 2941.1Stsutsui ${WORKDIR}/usr/mdec/${PRIMARY_BOOT} ${SECONDARY_BOOT_ARG} 2951.1Stsutsui.endif 2961.1Stsutsui @echo done. 2971.1Stsutsui mv ${WORKFS} ${.TARGET} 2981.1Stsutsui 2991.1Stsutsui# 3001.1Stsutsui# definitions to create image 3011.1Stsutsui# 3021.1Stsutsui.if ${USE_MBR} != "no" 3031.1StsutsuiDISKPROTO_IN?= ${DISTRIBDIR}/common/bootimage/diskproto.mbr.in 3041.1Stsutsui.else 3051.1StsutsuiDISKPROTO_IN?= ${DISTRIBDIR}/common/bootimage/diskproto.in 3061.1Stsutsui.endif 3071.1Stsutsui 3081.1StsutsuiOMIT_SWAPIMG?= no 3091.1Stsutsui 3101.1StsutsuiWORKMBR?= work.mbr 3111.1StsutsuiWORKSWAP?= work.swap 3121.1StsutsuiWORKLABEL?= work.diskproto 3131.1StsutsuiWORKIMG?= work.img 3141.1Stsutsui 3151.1StsutsuiCLEANFILES+= ${WORKMBR} ${WORKSWAP} 3161.1StsutsuiCLEANFILES+= ${WORKLABEL}.tmp ${WORKLABEL} 3171.1StsutsuiCLEANFILES+= ${WORKIMG} ${IMGBASE}.img 3181.1Stsutsui 3191.1Stsutsui${WORKLABEL}: 3201.1Stsutsui ${TOOL_SED} \ 3211.1Stsutsui -e "s/@@SECTORS@@/${SECTORS}/" \ 3221.1Stsutsui -e "s/@@HEADS@@/${HEADS}/" \ 3231.1Stsutsui -e "s/@@SECPERCYLINDERS@@/${SECPERCYLINDERS}/" \ 3241.1Stsutsui -e "s/@@CYLINDERS@@/${CYLINDERS}/" \ 3251.1Stsutsui -e "s/@@IMAGESECTORS@@/${IMAGESECTORS}/" \ 3261.1Stsutsui -e "s/@@FSSECTORS@@/${FSSECTORS}/" \ 3271.1Stsutsui -e "s/@@FSOFFSET@@/${FSOFFSET}/" \ 3281.1Stsutsui -e "s/@@SWAPSECTORS@@/${SWAPSECTORS}/" \ 3291.1Stsutsui -e "s/@@SWAPOFFSET@@/${SWAPOFFSET}/" \ 3301.1Stsutsui -e "s/@@BSDPARTSECTORS@@/${BSDPARTSECTORS}/" \ 3311.1Stsutsui < ${DISKPROTO_IN} > ${WORKLABEL}.tmp 3321.1Stsutsui mv ${WORKLABEL}.tmp ${WORKLABEL} 3331.1Stsutsui 3341.1Stsutsui${IMGBASE}.img: ${TARGETFS} ${WORKLABEL} 3351.1Stsutsui.if ${LABELSECTORS} != "0" 3361.1Stsutsui @echo creating MBR labels... 3371.1Stsutsui ${DD} if=/dev/zero of=${WORKMBR} seek=$$((${IMAGESECTORS} - 1)) count=1 3381.1Stsutsui ${TOOL_FDISK} -f -u \ 3391.1Stsutsui -b ${MBRCYLINDERS}/${MBRHEADS}/${MBRSECTORS} \ 3401.1Stsutsui -0 -a -s ${MBRNETBSD}/${FSOFFSET}/${BSDPARTSECTORS} \ 3411.1Stsutsui -i -c ${WORKDIR}/usr/mdec/mbr \ 3421.1Stsutsui -F ${WORKMBR} 3431.1Stsutsui ${DD} if=${WORKMBR} count=${LABELSECTORS} | \ 3441.1Stsutsui ${CAT} - ${TARGETFS} > ${WORKIMG} 3451.1Stsutsui.else 3461.1Stsutsui ${CP} ${TARGETFS} ${WORKIMG} 3471.1Stsutsui.endif 3481.1Stsutsui.if ${OMIT_SWAPIMG} == "no" 3491.1Stsutsui ${DD} if=/dev/zero of=${WORKSWAP} seek=$$((${SWAPSECTORS} - 1)) count=1 3501.1Stsutsui ${CAT} ${WORKSWAP} >> ${WORKIMG} 3511.1Stsutsui.endif 3521.1Stsutsui.if ${USE_SUNLABEL} != "no" 3531.1Stsutsui @echo Creating sun disklabel... 3541.1Stsutsui printf 'V ncyl %d\nV nhead %d\nV nsect %d\na %d %d/0/0\nb %d %d/0/0\nW\n' \ 3551.1Stsutsui ${CYLINDERS} ${HEADS} ${SECTORS} \ 3561.1Stsutsui ${FSOFFSET} ${FSCYLINDERS} ${FSCYLINDERS} ${SWAPCYLINDERS} | \ 3571.1Stsutsui ${TOOL_SUNLABEL} -nq ${WORKIMG} 3581.1Stsutsui.endif 3591.1Stsutsui ${TOOL_DISKLABEL} -R -F ${WORKIMG} ${WORKLABEL} 3601.1Stsutsui.if !empty(PRIMARY_BOOT) && ${INSTALLBOOT_AFTER_DISKLABEL} != "no" 3611.1Stsutsui ${TOOL_INSTALLBOOT} -vm ${MACHINE} ${WORKIMG} \ 3621.1Stsutsui ${WORKDIR}/usr/mdec/${PRIMARY_BOOT} 3631.1Stsutsui.endif 3641.1Stsutsui mv ${WORKIMG} ${.TARGET} 3651.1Stsutsui 3661.1Stsutsui 3671.1StsutsuiCLEANFILES+= ${IMGBASE}.img.gz ${IMGBASE}.img.gz.tmp 3681.1Stsutsui 3691.1Stsutsui${IMGBASE}.img.gz: ${IMGBASE}.img 3701.1Stsutsui ${TOOL_GZIP} -9c ${IMGBASE}.img > ${.TARGET}.tmp 3711.1Stsutsui mv ${.TARGET}.tmp ${.TARGET} 3721.1Stsutsui 3731.1Stsutsuiclean: 3741.1Stsutsui @if [ -d ${WORKDIR}/var/spool/ftp/hidden ]; then \ 3751.1Stsutsui ${CHMOD} +r ${WORKDIR}/var/spool/ftp/hidden; \ 3761.1Stsutsui fi # XXX 3771.1Stsutsui ${RM} -fr ${WORKDIR} 3781.1Stsutsui 3791.1Stsutsuiprepare_md_post: .PHONY 3801.1Stsutsuiimage_md_post: .PHONY 3811.1Stsutsuiimage_md_pre: .PHONY 3821.1Stsutsui 3831.1Stsutsui.include <bsd.prog.mk> 384