Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Jan 2017 10:43:58 +0200
From:      Daniel Kalchev <daniel@digsys.bg>
To:        "O. Hartmann" <ohartmann@walstatt.org>
Cc:        freebsd-current <freebsd-current@freebsd.org>, freebsd-questions <freebsd-questions@freebsd.org>
Subject:   Re: ISO image: where is the CLANG compiler?
Message-ID:  <A73ED94A-89CE-41C5-98D2-F1611476797B@digsys.bg>
In-Reply-To: <20170118084502.617bfc94@freyja.zeit4.iv.bundesimmobilien.de>
References:  <20170118084502.617bfc94@freyja.zeit4.iv.bundesimmobilien.de>

next in thread | previous in thread | raw e-mail | index | archive | help
I never use the pre-built ISO images for tasks like this. Here is a =
script I use to build my own USB boot drive. The drive contains the full =
OS to boot and also a copy used to create a new system. I make these =
boot drives from time to time, to stay current. Please note the script =
is few years old (for 9-stable) and you might want to twiddle with boot =
partition size if they grew. You need to have done =
bouildworld/buildkernel on the host before using this script.

$ cat createuboot
#!/bin/sh
# target USB drive to write to
disk=3Dda1
# use the current date for labels
today=3D`date "+%Y%m%d"`
# wipe out partition data form drive
# do it twice to wipe more stuff (might not be needed anymore)
gpart destroy -F $disk  =20
gpart create -s GPT $disk
gpart destroy -F $disk       =20
# GPT label the drive
gpart create -s GPT $disk     =20
# bootstrap partition=20
gpart add -b 34 -s 128 -t freebsd-boot $disk  =20
# partition for the OS
gpart add -a 4k -t freebsd-ufs -l boot$today $disk=20
# write bootstrap code
gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 $disk

# format file system
newfs  /dev/gpt/boot$today

# mount file system
mount -o async /dev/gpt/boot$today /mnt

# install FreeBSD
cd /usr/src
make installworld DESTDIR=3D/mnt
make distribution DESTDIR=3D/mnt
make installkernel DESTDIR=3D/mnt
# Create new =E2=80=9Cclean=E2=80=9D copy of FreeBSD for later use
mkdir -p /mnt/root/FreeBSD
make installworld DESTDIR=3D/mnt/root/FreeBSD
make distribution DESTDIR=3D/mnt/root/FreeBSD
make installkernel DESTDIR=3D/mnt/root/FreeBSD

# copy scripts
cp -r ~/scripts /mnt/root

echo /dev/gpt/boot$today / ufs rw,noatime 0 1 > /mnt/etc/fstab
umount /mnt


You might add more customizations, such as dhclient and starting sshd in =
/etc/rc.conf of the boot drive.

Hope this helps=E2=80=A6

Daniel


> On 18.01.2017 =D0=B3., at 9:45, O. Hartmann <ohartmann@walstatt.org> =
wrote:
>=20
> I ran into a very nasty situation where I need to =
save/restore/reinstall a
> in-installworld-crashed recent current.
>=20
> While the /usr/obj and /usr/src as well as /etc folders are intact =
(residing on
> a Samsung 850 pro SSD with UFS and journaling), /boot/kernel vanished =
and
> most binaries in /bin and /sbin are of Null size.
>=20
> I treid to rescue the system by intending to use the most recent =
CURRENT ISO
> image found on the snapshot server for USB drives, booted this =
successfully and
> then mounted the failes filesystems into the proper place (/usr/obj
> and /usr/src onto USB devices /usr/obj and /usr/src respectively, the =
rest goes
> into /mnt).
>=20
> I tried then to perform a make installworld with DESTDIR=3D/mnt set. =
But I fail:
> the minimalistic USB image does not have any CLANG/LLVM stuff required =
for the
> rescue!
>=20
> Where the hell did this stuff go? Has it been ripped off due to the 1 =
GB
> ancient flash size?=20
>=20
> Help is needed. I've already posted to CURRENT a message, but I guess =
I always
> hit the wrong subject line. It seems that the key to my saviour is to =
have a
> flash drive with a recent CURRENT containing a cc compiler - otherwise =
/usr/obj
> is useless.
>=20
> Kind reards,
>=20
> Oliver
> _______________________________________________
> freebsd-current@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to =
"freebsd-current-unsubscribe@freebsd.org"




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?A73ED94A-89CE-41C5-98D2-F1611476797B>