From nobody Mon Sep 4 05:58:08 2023 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RfHxJ1cTMz4rWcW for ; Mon, 4 Sep 2023 05:58:12 +0000 (UTC) (envelope-from guru@unixarea.de) Received: from ms-10.1blu.de (ms-10.1blu.de [178.254.4.101]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4RfHxH2g1Qz3Gty for ; Mon, 4 Sep 2023 05:58:11 +0000 (UTC) (envelope-from guru@unixarea.de) Authentication-Results: mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of guru@unixarea.de designates 178.254.4.101 as permitted sender) smtp.mailfrom=guru@unixarea.de; dmarc=none Received: from [188.174.51.238] (helo=localhost.unixarea.de) by ms-10.1blu.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qd2bB-001mxm-6s for freebsd-current@freebsd.org; Mon, 04 Sep 2023 07:58:09 +0200 Received: from localhost.my.domain (localhost [127.0.0.1]) by localhost.unixarea.de (8.16.1/8.14.9) with ESMTPS id 3845w8V4008325 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO) for ; Mon, 4 Sep 2023 07:58:08 +0200 (CEST) (envelope-from guru@unixarea.de) Received: (from guru@localhost) by localhost.my.domain (8.16.1/8.14.9/Submit) id 3845w8Vt008324 for freebsd-current@freebsd.org; Mon, 4 Sep 2023 07:58:08 +0200 (CEST) (envelope-from guru@unixarea.de) X-Authentication-Warning: localhost.my.domain: guru set sender to guru@unixarea.de using -f Date: Mon, 4 Sep 2023 07:58:08 +0200 From: Matthias Apitz To: freebsd-current@freebsd.org Subject: Re: make-memstick.sh creates in 14.0-CURRENT run-away processes Message-ID: Reply-To: Matthias Apitz Mail-Followup-To: freebsd-current@freebsd.org References: List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Operating-System: FreeBSD 13.0-CURRENT r368166 (amd64) X-message-flag: Mails containing HTML will not be read! Please send only plain text. X-Con-Id: 51246 X-Con-U: 0-guru X-Originating-IP: 188.174.51.238 X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.46 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.66)[-0.655]; MID_RHS_NOT_FQDN(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:178.254.4.101]; MIME_GOOD(-0.10)[text/plain]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:42730, ipnet:178.254.0.0/19, country:DE]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org]; R_DKIM_NA(0.00)[]; ARC_NA(0.00)[]; DMARC_NA(0.00)[unixarea.de]; TO_DN_NONE(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; RCPT_COUNT_ONE(0.00)[1]; FROM_HAS_DN(0.00)[]; HAS_XOIP(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_LAST(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; TO_MATCH_ENVRCPT_ALL(0.00)[]; HAS_XAW(0.00)[]; HAS_REPLYTO(0.00)[guru@unixarea.de] X-Rspamd-Queue-Id: 4RfHxH2g1Qz3Gty El día Freitag, August 18, 2023 a las 06:17:42 +0200, Matthias Apitz escribió: > > I was used to use in 13.0-CURRENT the script "make-memstick.sh" to > create memstick immages to install the system on smaller devices where > the OS can't build from the sources, and it always worked fine for many > years. Now I'm ready to do so with my fresh compiled system (sources > from git August, 5: > > $ uname -a > FreeBSD jet 14.0-CURRENT FreeBSD 14.0-CURRENT amd64 1400094 #0 main-n264568-1d7ffb373c9d: Sat Aug 5 17:22:47 CEST 2023 guru@jet:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64 > > but the image is not produces and some processes create temp > files of 800++ GByte. Here are the details: > > root@jet:/usr/src/release/amd64 # ./make-memstick.sh /home/guru/140.root ~guru/memstick.img > Calculated size of `/home/guru/memstick.img.part': 23795073024 bytes, 263113 inodes > Extent size set to 32768 > /home/guru/memstick.img.part: 22692.8MB (46474752 sectors) block size 32768, fragment size 4096 > using 27 cylinder groups of 869.44MB, 27822 blks, 10240 inodes. > super-block backups (for fsck -b #) at: > 192, 1780800, 3561408, 5342016, 7122624, 8903232, 10683840, > 12464448, 14245056, 16025664, 17806272, 19586880, 21367488, 23148096, > 24928704, 26709312, 28489920, 30270528, 32051136, 33831744, 35612352, > 37392960, 39173568, 40954176, 42734784, 44515392, 46296000 > Populating `/home/guru/memstick.img.part' > Image `/home/guru/memstick.img.part' complete > Creating `/tmp/efiboot.iFachZ' > /tmp/efiboot.iFachZ: 65528 sectors in 65528 FAT32 clusters (512 bytes/cluster) > BytesPerSec=512 SecPerClust=1 ResSectors=32 FATs=2 Media=0xf0 SecPerTrack=63 Heads=255 HiddenSecs=0 HugeSectors=66584 FATsecs=512 RootCluster=2 FSInfo=1 Backup=2 > Populating `/tmp/efiboot.iFachZ' > Image `/tmp/efiboot.iFachZ' complete > > It says 'complete' but never ends growing the file /tmp/mkimg-oGNnFb: > > root@jet:/usr/home/guru # ls -ltrah /tmp | tail -6 > drwx------ 2 guru wheel 512B Aug 18 15:43 tmux-1001 > -rw------- 1 root wheel 33M Aug 18 17:18 efiboot.iFachZ > -rw------- 1 root wheel 0B Aug 18 17:18 mkimg-4eMWKW > drwxrwxrwt 21 root wheel 1.0K Aug 18 17:18 . > drwxr-xr-x 22 root wheel 1.0K Aug 18 17:43 .. > -rw------- 1 root wheel 850G Aug 18 17:53 mkimg-oGNnFb > > root@jet:/usr/home/guru # ls -ltrh mem* > -rw-r--r-- 1 root wheel 22G Aug 18 17:18 memstick.img.part > -rw-r--r-- 1 root wheel 0B Aug 18 17:18 memstick.img > > Only a hard reset and reboot helps. > (Sorry for the delay, I was out for vacation) The last part of the script ./make-memstick.sh which should produce the final image, but the processes mkimg never end, is: ... # Make an ESP in a file. espfilename=$(mktemp /tmp/efiboot.XXXXXX) make_esp_file ${espfilename} ${fat32min} ${BASEBITSDIR}/boot/loader.efi mkimg -s mbr \ -b ${BASEBITSDIR}/boot/mbr \ -p efi:=${espfilename} \ -p freebsd:-"mkimg -s bsd -b ${BASEBITSDIR}/boot/boot -p freebsd-ufs:=${2}.part" \ -a 2 \ -o ${2} ... I've split the two processes, connected my the pipe, and run them one after the other as: #!/bin/sh # set -x BASEBITSDIR=/home/guru/140.root img=/home/guru/zdata/memstick.img espfilename=/home/guru/zdata/efiboot.7S9yjL mkimg -s bsd -b ${BASEBITSDIR}/boot/boot \ -p freebsd-ufs:=${img}.part > ${img}.part.mkimg mkimg -s mbr \ -b ${BASEBITSDIR}/boot/mbr \ -p efi:=${espfilename} \ -p freebsd:=${img}.part.mkimg \ -a 2 \ -o ${img} # ls -l /home/guru/zdata # -rw-r--r-- 1 root wheel 23795073024 Sep 3 17:12 memstick.img.part # -rw------- 1 root wheel 34091008 Sep 3 17:12 efiboot.7S9yjL # -rw-r--r-- 1 root wheel 23795081216 Sep 3 18:25 memstick.img.part.mkimg # -rw-r--r-- 1 root wheel 23829172736 Sep 3 18:34 memstick.img The resulting file 'memstick.img' (copied with dd to an USB key) boots fine. Now I'm clueless about why the pipe between mkimg ... -p freebsd:-"mkimg -s bsd ..." ... does not work as it should. matthias -- Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045 Public GnuPG key: http://www.unixarea.de/key.pub