Hi, I wanted to make a small image out of the proto directory built from illumos-gate, heavily inspired by pureboot (https://ptribble.blogspot.com/2015/09/illumos-pureboot.html). I made two (not working) scripts, the first one boots and give this output while doing so:
Loading unix... Loading /platform/i86pc/amd64/boot_archive... Loading /platform/i86pc/amd64/boot_archive.hash... Booting... No rootfs module provided, aborting Hit [Enter] to boot immediately, or any other key command prompt. Booting [/platform/i86pc/kernel/amd64/unix] warning: 'environment' is already loaded warning: 'console-font' is already loaded No rootfs module provided, aborting The second script uses bootadm to create the boot_archive, but it doesn't go past bootadm: Creating boot_archive for /var/tmp/purebuild.19661 svccfg: Pattern 'system/boot-archive' doesn't match any instances or services updating /var/tmp/purebuild.19661/platform/i86pc/amd64/boot_archive (UFS) gzip: stdout: No space left on device [A lot of gzip errors] gzip: stdout: No space left on device gzip: stdout: No space left on device GNU xorriso 1.5.6.pl02 : RockRidge filesystem manipulator, libburnia project. Drive current: -outdev 'stdio:/dev/fd/1' Media current: stdio file, sequential Media status : is blank Media summary: 0 sessions, 0 data blocks, 0 data, 4096g free xorriso : FAILURE : Cannot determine attributes of source file '/var/tmp/purebuild.19661/ ' : No such file or directory xorriso : aborting : -abort_on 'FAILURE' encountered 'FAILURE' First script: #!/bin/bash set -e # === CONFIGURATION === PROTO_DIR=/xor/illumos-gate/proto/root_i386 ISO_NAME=/var/tmp/illumos-loader.iso DESTDIR=/tmp/purebuild.$$ MRSIZE=1024M NBPI=4096 # === SETUP === mkdir -p "$DESTDIR" cd "$PROTO_DIR" tar cf - . | ( cd "$DESTDIR" && tar xf - ) # === INIT SETUP === cat > "$DESTDIR/etc/pureboot.rc" <<EOF #!/sbin/sh echo " *** illumos boot via loader ***" > /dev/console /bin/ksh93 >/dev/console 2>&1 </dev/console EOF chmod a+x "$DESTDIR/etc/pureboot.rc" mv "$DESTDIR/etc/inittab" "$DESTDIR/etc/inittab.bak" grep -v startd "$DESTDIR/etc/inittab.bak" > "$DESTDIR/etc/inittab" echo "smf::sysinit:/etc/pureboot.rc" >> "$DESTDIR/etc/inittab" # === KERNEL STATE FILES FROM RUNNING SYSTEM === for kfile in driver_classes minor_perm name_to_major driver_aliases; do cp "/etc/$kfile" "$DESTDIR/etc/" done # === CREATE BOOT ARCHIVE === BOOTBLOCK=$(mktemp /var/tmp/bootblock.XXXXXX) mkfile $MRSIZE $BOOTBLOCK chmod o-t $BOOTBLOCK LOFI=$(lofiadm -a $BOOTBLOCK) LOFINUM=$(basename $LOFI) echo "y" | newfs -o space -m 0 -i $NBPI /dev/rlofi/$LOFINUM MNT=/tmp/nb.$$ mkdir $MNT mount -Fufs -o nologging $LOFI $MNT cd "$DESTDIR" tar cf - . | pv | ( cd $MNT ; tar xvf - ) touch "$MNT/reconfigure" $DESTDIR/usr/sbin/devfsadm -r $MNT rm -f $MNT/dev/dsk/* $MNT/dev/rdsk/* rm -f $MNT/dev/removable-media/dsk/* $MNT/dev/removable-media/rdsk/* # === UMOUNT AND ARCHIVE === umount $MNT lofiadm -d $LOFI pv $BOOTBLOCK | gzip --fast > ${BOOTBLOCK}.gz cp ${BOOTBLOCK}.gz "$DESTDIR/platform/i86pc/boot_archive" rm ${BOOTBLOCK}.gz rmdir $MNT # === REMOVE EVERYTHING EXCEPT /boot and /platform === cd "$DESTDIR" find . -mindepth 1 -maxdepth 1 ! -name boot ! -name platform -exec rm -rf {} + # === CREATE ISO === xorriso -as mkisofs \ -o "$ISO_NAME" \ -b boot/cdboot \ -no-emul-boot -boot-load-size 4 -boot-info-table \ -R -J -V "illumos" "$DESTDIR" echo "[*] ISO built at: $ISO_NAME" ls -lh "$ISO_NAME" # === CLEANUP === rm -rf "$DESTDIR" Second script: #!/bin/bash set -e # === CONFIGURATION === PROTO_DIR=/xor/illumos-gate/proto/root_i386 ISO_NAME=/var/tmp/illumos-loader.iso DESTDIR=/var/tmp/purebuild.$$ NBPI=4096 # === SETUP === mkdir -p "$DESTDIR" cd "$PROTO_DIR" tar cf - . | ( cd "$DESTDIR" && tar xf - ) # === INIT SETUP === cat > "$DESTDIR/etc/pureboot.rc" <<EOF #!/sbin/sh echo " *** illumos boot ***" > /dev/console /bin/ksh93 >/dev/console 2>&1 </dev/console EOF chmod a+x "$DESTDIR/etc/pureboot.rc" mv "$DESTDIR/etc/inittab" "$DESTDIR/etc/inittab.bak" grep -v startd "$DESTDIR/etc/inittab.bak" > "$DESTDIR/etc/inittab" echo "smf::sysinit:/etc/pureboot.rc" >> "$DESTDIR/etc/inittab" # === KERNEL STATE FILES FROM RUNNING SYSTEM === for kfile in driver_classes minor_perm name_to_major driver_aliases; do cp "/etc/$kfile" "$DESTDIR/etc/" done # === CREATE BOOT ARCHIVE === $PROTO_DIR/usr/sbin/bootadm update-archive -R "$DESTDIR" # === REMOVE EVERYTHING EXCEPT /boot and /platform === cd "$DESTDIR" find . -mindepth 1 -maxdepth 1 ! -name boot ! -name platform -exec rm -rf {} + # === CREATE ISO === xorriso -as mkisofs \ -o "$ISO_NAME" \ -b boot/cdboot \ -no-emul-boot -boot-load-size 4 -boot-info-table \ -R -J -V "illumos" "$DESTDIR" echo "[*] ISO built at: $ISO_NAME" ls -lh "$ISO_NAME" # === CLEANUP === rm -rf "$DESTDIR" It's not really to serve any purpose, just for fun. Thanks in advance for any help. ------------------------------------------ illumos: illumos-discuss Permalink: https://illumos.topicbox.com/groups/discuss/Tb104b7199f0b0468-M20f76ef894620f7acb88542a Delivery options: https://illumos.topicbox.com/groups/discuss/subscription