hubertf's NetBSD Blog
Send interesting links to hubert at feyrer dot de!
 
[20090103] Creating a bootable disk image (for shark/arm and i386)
I've added a SD-Card to IDE adapter to my shark some time ago, and wanted to create an image for the SD-Card. Using Mac OS as development platform prevented the use of NetBSD's vnd(4), plus I wanted to do this without root privileges. NetBSD's makefs(8) seemed like a nice tool, but how to add bootblocks, partition tables, etc.? A script posted by Izumi Tsutsui got me on track, and after looking a bit at some hexdumps of various file system images, boot blocks, and BSD disk labels, I managed to adjust Izumi's script enough to give me bootable disk images for booth shar/arm and i386. The script can be found in the port-arm archive.

Lessons that I've learned by this (and that I'd like to share):

  • a MS-DOS MBR is 512 bytes (boring)
  • a BSD disklabel is some 300-400 bytes, apparently not really fixed in size. The interesting part: if you create a BSD disk label on a image, the first 512 bytes are left alone. Good to put a MBR in!
  • when you have a FFS file system image (e.g. created with mkfile), the actual file system data only starts at byte 8192 - that's plenty of space to put a BSD disk label in there. Oh, and a MBR, too, if needed! :-)
A followup by Izumi explains these things in more details.

[Tags: , , , , , ]


[20080820] NetBSD 5.0 preview: User visible changes in NetBSD-current
I've found a bit of spare time upgrade a NetBSD 4.0 system to NetBSD-current (4.99.69), and during the usual update procedure (boot new kernel; build.sh install=/; etcupdate) I found a number of user-visible changes over NetBSD 4.0 that I'd like to spotlight here:
  1. audit-packages and download-vulnerability-list are now part of the NetBSD base system, there's no longer a need to install them via pkgsrc. I haven't found any hooks to run them automatically every night, but that can be done easily via cron(8). The commands in question are:
         # download-vulnerability-list
         # audit-packages 

  2. Per-user-tmp: Currently, /tmp is shared by all users. In order to avoid name clashes (example: I use /tmp/foo for temporar data as both root and "normal" user), the /tmp directory can be made to be unique for each user now, much the same way as this is done e.g. on Mac Os X. To do so, set
    	per_user_tmp=yes 
    in /etc/rc.conf and reboot. In effect, /tmp is unique for each user then. The implementation is done via magic symlinks:
            # cd /tmp
            # pwd
            /private/tmp/0
            # ls -l /tmp
            lrwxr-xr-x  1 root  wheel  18 Jul 13 22:41 /tmp -> /private/tmp/@ruid 

  3. httpd: NetBSD now ships with a web server in base. Seriously, I have no idea why this is, but it can be enabled by removing the comment signs of the 'httpd' service in /etc/inetd.conf, and by populating /var/www. After that access by both IPv4 and IPv6 is possible.

  4. dhcpcd: NetBSD has shipped with ISC's DHCP client so far, which uses quite a bit or memory. As a supplement, Roy Marples' dhcpcd has been added to the base system. In order to use it for interface xx0, put
         ifconfig_xx0="dhcp" 
    into your /etc/rc.conf file (replacing the old "dhclient=yes" setting).

    On a test system, both dhclient and dhcpcd had ps(1) display a VSZ (virtual size in Kbyte) of ~770, but while dhclient had a RSS (real memory / resident set size, in Kbyte) of 1068, dhcpcd only had a RSS of 548, i.e. the new DHCP client daemon uses about half as much RAM as the ISC dhclient.

  5. /boot.cfg: Last, NetBSD's second stage bootloader can now load a configuration file on the i386 and amd64 platforms. Assuming the bootloader was updated after the upgrade ("cp /usr/mdec/boot /boot"), the config file /boot.cfg is used to print the boot menu and offer appripriate actions:
         # cat /boot.cfg
         menu=Boot normally:boot netbsd
         menu=Boot single user:boot netbsd -s
         menu=Disable ACPI:boot netbsd -2
         menu=Disable ACPI and SMP:boot netbsd -12
         menu=Drop to boot prompt:prompt
         default=1
         timeout=5 
So much for a first adventure into NetBSD-current. Feel free to point out more goodies in NetBSD-current that will be new in NetBSD 5.0 over NetBSD 4.0.

[Tags: , , , , , ]


Tags: , 2bsd, 34c3, 3com, 501c3, 64bit, acl, acls, acm, acorn, acpi, acpitz, adobe, adsense, advocacy, Advocacy, advogato, aes, afs, aiglx, aio, airport, alereon, alex, alix, alpha, altq, am64t, amazon, amd64, anatomy, ansible, apache, apm, apple, arkeia, arla, arm, art, Article, Articles, ascii, asiabsdcon, aslr, asterisk, asus, atf, ath, atheros, atmel, audio, audiocodes, autoconf, avocent, avr32, aws, axigen, azure, backup, balloon, banners, basename, bash, bc, beaglebone, benchmark, bigip, bind, blackmouse, bldgblog, blog, blogs, blosxom, bluetooth, board, bonjour, books, boot, boot-z, bootprops, bozohttpd, bs2000, bsd, bsdca, bsdcan, bsdcertification, bsdcg, bsdforen, bsdfreak, bsdmac, bsdmagazine, bsdnexus, bsdnow, bsdstats, bsdtalk, bsdtracker, bug, build.sh, busybox, buttons, bzip, c-jump, c99, cafepress, calendar, callweaver, camera, can, candy, capabilities, card, carp, cars, cauldron, ccc, ccd, cd, cddl, cdrom, cdrtools, cebit, centrino, cephes, cert, certification, cfs, cgd, cgf, checkpointing, china, christos, cisco, cloud, clt, cobalt, coccinelle, codian, colossus, common-criteria, community, compat, compiz, compsci, concept04, config, console, contest, copyright, core, cortina, coverity, cpu, cradlepoint, cray, crosscompile, crunchgen, cryptography, csh, cu, cuneiform, curses, curtain, cuwin, cvs, cvs-digest, cvsup, cygwin, daemon, daemonforums, daimer, danger, darwin, data, date, dd, debian, debugging, dell, desktop, devd, devfs, devotionalia, df, dfd_keeper, dhcp, dhcpcd, dhcpd, dhs, diezeit, digest, digests, dilbert, dirhash, disklabel, distcc, dmesg, Docs, Documentation, donations, draco, dracopkg, dragonflybsd, dreamcast, dri, driver, drivers, drm, dsl, dst, dtrace, dvb, ec2, eclipse, eeepc, eeepca, ehci, ehsm, eifel, elf, em64t, embedded, Embedded, emips, emulate, encoding, envsys, eol, espresso, etcupdate, etherip, euca2ools, eucalyptus, eurobsdcon, eurosys, Events, exascale, ext3, f5, facebook, falken, fan, faq, fatbinary, features, fefe, ffs, filesystem, fileysstem, firefox, firewire, fireworks, flag, flash, flashsucks, flickr, flyer, fmslabs, force10, fortunes, fosdem, fpga, freebsd, freedarwin, freescale, freex, freshbsd, friendlyAam, friendlyarm, fritzbox, froscamp, fsck, fss, fstat, ftp, ftpd, fujitsu, fun, fundraising, funds, funny, fuse, fusion, g4u, g5, galaxy, games, gcc, gdb, gentoo, geode, getty, gimstix, git, gnome, google, google-soc, googlecomputeengine, gpio, gpl, gprs, gracetech, gre, groff, groupwise, growfs, grub, gumstix, guug, gzip, hackathon, hackbench, hal, hanoi, happabsd, Hardware, hardware, haze, hdaudio, heat, heimdal, hf6to4, hfblog, hfs, history, hosting, hotplug, hp, hp700, hpcarm, hpcsh, hpux, html, httpd, hubertf, hurd, i18n, i386, i386pkg, ia64, ian, ibm, ids, ieee, ifwatchd, igd, iij, image, images, imx233, imx7, information, init, initrd, install, intel, interix, internet2, interview, interviews, io, ioccc, iostat, ipbt, ipfilter, ipmi, ipplug, ipsec, ipv6, irbsd, irc, irix, iscsi, isdn, iso, isp, itojun, jail, jails, japanese, java, javascript, jetson, jibbed, jihbed, jobs, jokes, journaling, kame, kauth, kde, kerberos, kergis, kernel, keyboardcolemak, kirkwood, kitt, kmod, kolab, kvm, kylin, l10n, landisk, laptop, laptops, law, ld.so, ldap, lehmanns, lenovo, lfs, libc, license, licensing, linkedin, links, linksys, linux, linuxtag, live-cd, lkm, localtime, locate.updatedb, logfile, logging, logo, logos, lom, lte, lvm, m68k, macmini, macppc, macromedia, magicmouse, mahesha, mail, makefs, malo, mame, manpages, marvell, matlab, maus, max3232, mbr95, mbuf, mca, mdns, mediant, mediapack, meetbsd, mercedesbenz, mercurial, mesh, meshcube, mfs, mhonarc, microkernel, microsoft, midi, mini2440, miniroot, minix, mips, mirbsd, missile, mit, mixer, mobile-ip, modula3, modules, money, mouse, mp3, mpls, mprotect, mtftp, mult, multics, multilib, multimedia, music, mysql, named, nas, nasa, nat, ncode, ncq, ndis, nec, nemo, neo1973, netbook, netboot, netbsd, netbsd.se, nethack, nethence, netksb, netstat, netwalker, networking, neutrino, nforce, nfs, nis, npf, npwr, nroff, nslu2, nspluginwrapper, ntfs-3f, ntp, nullfs, numa, nvi, nvidia, nycbsdcon, office, ofppc, ohloh, olimex, olinuxino, olpc, onetbsd, openat, openbgpd, openblocks, openbsd, opencrypto, opendarwin, opengrok, openmoko, openoffice, openpam, openrisk, opensolaris, openssl, or1k, oracle, oreilly, oscon, osf1, osjb, paas, packages, pad, pae, pam, pan, panasonic, parallels, pascal, patch, patents, pax, paypal, pc532, pc98, pcc, pci, pdf, pegasos, penguin, performance, pexpect, pf, pfsync, pgx32, php, pie, pike, pinderkent, pkg_install, pkg_select, pkgin, pkglint, pkgmanager, pkgsrc, pkgsrc.se, pkgsrcCon, pkgsrccon, Platforms, plathome, pleiades, pocketsan, podcast, pofacs, politics, polls, polybsd, portability, posix, postinstall, power3, powernow, powerpc, powerpf, pppoe, precedence, preemption, prep, presentations, prezi, products, Products, proplib, protectdrive, proxy, ps, ps3, psp, psrset, pthread, ptp, ptyfs, Publications, puffs, puredarwin, pxe, qemu, qnx, qos, qt, quality-management, quine, quote, quotes, r-project, ra5370, radio, radiotap, raid, raidframe, rants, raptor, raq, raspberrypi, rc.d, readahead, realtime, record, refuse, reiserfs, Release, releases, Releases, releng, reports, resize, restore, ricoh, rijndael, rip, riscos, rng, roadmap, robopkg, robot, robots, roff, rootserver, rotfl, rox, rs323, rs6k, rss, ruby, rump, rzip, sa, safenet, san, sata, savin, sbsd, scampi, scheduler, scheduling, schmonz, sco, screen, script, sdf, sdtemp, secmodel, security, Security, sed, segvguard, seil, sendmail, serial, serveraptor, sfu, sge, sgi, sgimips, sh, sha2, shark, sharp, shisa, shutdown, sidekick, size, slackware, slashdot, slides, slit, smbus, smp, sockstat, soekris, softdep, softlayer, software, solaris, sony, sound, source, source-changes, spanish, sparc, sparc64, spider, spreadshirt, spz, squid, ssh, sshfs, ssp, statistics, stereostream, stickers, storage, stty, studybsd, subfile, sudbury, sudo, summit, sun, sun2, sun3, sunfire, sunpci, support, sus, suse, sushi, susv3, svn, swcrypto, symlinks, sysbench, sysctl, sysinst, sysjail, syslog, syspkg, systat, systrace, sysupdate, t-shirt, tabs, talks, tanenbaum, tape, tcp, tcp/ip, tcpdrop, tcpmux, tcsh, teamasa, tegra, teredo, termcap, terminfo, testdrive, testing, tetris, tex, TeXlive, thecus, theopengroup, thin-client, thinkgeek, thorpej, threads, time, time_t, timecounters, tip, tk1, tme, tmp, tmpfs, tnf, toaster, todo, toolchain, top, torvalds, toshiba, touchpanel, training, translation, tso, tty, ttyrec, tulip, tun, tuning, uboot, ucom, udf, ufs, ukfs, ums, unetbootin, unicos, unix, updating, upnp, uptime, usb, usenix, useradd, userconf, userfriendly, usermode, usl, utc, utf8, uucp, uvc, uvm, valgrind, vax, vcfe, vcr, veriexec, vesa, video, videos, virtex, virtualization, vm, vmware, vnd, vobb, voip, voltalinux, vpn, vpnc, vulab, w-zero3, wallpaper, wapbl, wargames, wasabi, webcam, webfwlog, wedges, wgt624v3, wiki, willcom, wimax, window, windows, winmodem, wireless, wizd, wlan, wordle, wpa, wscons, wstablet, X, x.org, x11, x2apic, xbox, xcast, Xen, xen, xfree, xfs, xgalaxy, xilinx, xkcd, xlockmore, xmms, xmp, xorg, xscale, youos, youtube, zaurus, zdump, zfs, zlib

'nuff. Grab the RSS-feed, index, or go back to my regular NetBSD page

Disclaimer: All opinion expressed here is purely my own. No responsibility is taken for anything.

Access count: 35847295
Copyright (c) Hubert Feyrer