PiDP-8/I Software

Check-in [d79a842547]
Log In

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:The "bosi shrink" process roached the SD card, and I can't be bothered to figure out why. It's a minor optimization, not worth spending the time on, given that you have to go out of your way to find something smaller than 8GB and end up paying about as much for it when you do find one. I'm therefore betting that almost no one is actually trying to use a 4GB card, the only thing smaller that could possibly work, since even with the shrink, the finished image wouldn't fit on a 2GB card.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: d79a8425472b37f3da17c4c4aa4b466ae0332b124d7fb8b48e28264c9671b1a0
User & Date: tangent 2021-02-15 03:17:17
Context
2021-02-15
03:31
Moved the 8GB image size requirement up after reflecting on the prior change. check-in: 9cac6262d6 user: tangent tags: trunk
03:17
The "bosi shrink" process roached the SD card, and I can't be bothered to figure out why. It's a minor optimization, not worth spending the time on, given that you have to go out of your way to find something smaller than 8GB and end up paying about as much for it when you do find one. I'm therefore betting that almost no one is actually trying to use a 4GB card, the only thing smaller that could possibly work, since even with the shrink, the finished image wouldn't fit on a 2GB card. check-in: d79a842547 user: tangent tags: trunk
02:42
Swapped commands in "sudo time" constructs in bosi so we use the calling shell's builtin version instead of /usr/bin/time, since at least on macOS, the builtin's output is clearer. Tweaked the prior commands to ensure that we don't count the time taken while sudo is blocking waiting for a psssword input against the time taken by the elevated command. check-in: 1ef732c32c user: tangent tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to doc/RELEASE-PROCESS.md.

147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
    simulator correct?  Does OS/8 run?  Are there any complaints from
    SIMH, such as about insufficient CPU power?

4.  Do the final inside-the-image steps:

        $ ./bosi prepare

5.  Move the SD card to a USB reader plugged into the Pi, boot the Pi
    from its prior SD card, and shrink the OS image:

        $ wget https://tangentsoft.com/bosi
        $ chmod +x bosi
        $ ./bosi shrink

6.  Move the USB reader to the Mac,¹ then say:

        $ bosi image [nls]

    For the ILS images, you can give "ils" as a parameter or leave it
    blank.

7.  The prior step rewrote the SD card with the image file it created.
    Boot it up and make sure it still works.  If you're happy with it,
    give this command *on the desktop PC*.

        $ bosi finish [nls]

    As above, the parameter can be "ils" or left off for the ILS images.

[os]: https://www.raspberrypi.org/software/operating-systems/








|
<
|
<
<
<
<
<



|
<

|

|







147
148
149
150
151
152
153
154

155





156
157
158
159

160
161
162
163
164
165
166
167
168
169
170
    simulator correct?  Does OS/8 run?  Are there any complaints from
    SIMH, such as about insufficient CPU power?

4.  Do the final inside-the-image steps:

        $ ./bosi prepare

5.  After the Pi shuts down, move the SD card to a USB reader plugged

    into the Mac¹ and say:






        $ bosi image [nls]

    Give "ils" as a parameter or leave it blank for the ILS image.


6.  The prior step rewrote the SD card with the image file it created.
    Boot it up and make sure it still works.  If you're happy with it,
    give this command *on the Mac*.

        $ bosi finish [nls]

    As above, the parameter can be "ils" or left off for the ILS images.

[os]: https://www.raspberrypi.org/software/operating-systems/

Changes to tools/bosi.

29
30
31
32
33
34
35
36
37
38
39
40
41
42
43


# Display the usage message
function usage() {
    cat <<USAGE
usage: $0 <verb> [tag]

    The available verbs are init, build, prepare, shrink, image, and finish.

    You may include a tag parameter with the 'image' and 'finish' verbs
    to override the default tag ('ils') used in image and zip file
    outputs.

    See RELEASE-PROCESS.md for more info.








|







29
30
31
32
33
34
35
36
37
38
39
40
41
42
43


# Display the usage message
function usage() {
    cat <<USAGE
usage: $0 <verb> [tag]

    The available verbs are init, build, prepare, image, and finish.

    You may include a tag parameter with the 'image' and 'finish' verbs
    to override the default tag ('ils') used in image and zip file
    outputs.

    See RELEASE-PROCESS.md for more info.

175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
    /usr/sbin/shutdown -h +1

    # Must be last, else later "sudo" will fail on the expired password
    echo 'pidp8i:edsonDeCastro1968' | sudo chpasswd &&
        sudo passwd -e pidp8i
}


# Shrink the filesystem on the OS SD card we're about to image to just a
# bit bigger than required to hold its present contents.
#
# The extra 100 megs in the arithmetic below accounts for the /boot
# partition, since the `resizepart` command takes a partition end value,
# not a size value.
#
# We don't calculate the actual end of the /boot partition and use that
# value because we want a bit of slack space to buy time for an end user
# who neglects to expand the card image into the free space available on
# their SD card after first boot.
function do_shrink() {
    test "$USER" = "root" || exec sudo $this shrink

    set -x

    umount /dev/sda2 || true    # might auto-mount, might not
    e2fsck -f /dev/sda2         # resize2fs demands it

    # Pack it down tight
    blocks=$(
        resize2fs -M /dev/sda2 2>&1 |
        grep 'blocks long' | 
        grep -wo '[0-9]\+'
    )
    if [ "$blocks" -gt 0 ]
    then
        # And now give it a bit of breathing room
        parted /dev/sda resizepart 2 $(($blocks * 4096 + 10**8))b
        resize2fs /dev/sda2
        poweroff
    else
        echo "Failed to extract new filesystem size from resize2fs!"
        echo
        exit 1
    fi
}


# This script images the OS SD card in a USB reader on a macOS box.
function do_image() {
    dev=UNKNOWN
    ps=UNKNOWN
    hb=no
    rp=UNKNOWN







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







175
176
177
178
179
180
181







































182
183
184
185
186
187
188
    /usr/sbin/shutdown -h +1

    # Must be last, else later "sudo" will fail on the expired password
    echo 'pidp8i:edsonDeCastro1968' | sudo chpasswd &&
        sudo passwd -e pidp8i
}









































# This script images the OS SD card in a USB reader on a macOS box.
function do_image() {
    dev=UNKNOWN
    ps=UNKNOWN
    hb=no
    rp=UNKNOWN
328
329
330
331
332
333
334
335
336
337
338
339

# Main routine
set -e
case "$verb" in
    in*) do_init ;;
    bu*) do_build ;;
    pr*) do_prepare ;;
    sh*) do_shrink ;;
    im*) do_image ;;
    fi*) do_finish ;;
    *)   usage ;;
esac







<




289
290
291
292
293
294
295

296
297
298
299

# Main routine
set -e
case "$verb" in
    in*) do_init ;;
    bu*) do_build ;;
    pr*) do_prepare ;;

    im*) do_image ;;
    fi*) do_finish ;;
    *)   usage ;;
esac