Minimal OpenSolaris200811 install

Using instructions from Edward Pilatowicz' blog I got small working OpenSolaris 2008.11 in the console version: without Xorg (and Gnome of course).
First of all the list of the core packages for normal work in the console is necessary. My computer has Realtek ethernet adapter and I also have added a SUNWrtls package. Here's example list (pkg.txt):

  • SUNWcsd
    SUNWcs
    SUNWzone
    SUNWcsl
    SUNWlibsasl
    SUNWlibms
    SUNWpr
    SUNWlxml
    SUNWzlib
    SUNWtls
    SUNWopenssl
    SUNWpool
    SUNWzfs
    SUNWsmapi
    SUNWtecla
    SUNWckr
    SUNWpicl
    SUNWmd
    SUNWinstall-libs
    SUNWwbsup
    SUNWgccruntime
    SUNWcar
    SUNWcakr
    SUNWusbs
    SUNWusb
    SUNWaudd
    SUNWkvm
    SUNWos86r
    SUNWrmodr
    SUNWpsdcr
    SUNWpsdir
    SUNWcnetr
    SUNWesu
    SUNWkey
    SUNWnfsckr
    SUNWnfsc
    SUNWgss
    SUNWgssc
    SUNWbip
    SUNWbash
    SUNWloc
    SUNWsshcu
    SUNWsshd
    SUNWssh
    SUNWtoo
    SUNWzfskr
    SUNWipf
    SUNWrtls
    SUNWipkg
    SUNWpython-pyopenssl
    SUNWpython-cherrypy
    SUNWadmr
    SUNWadmap
    SUNWadmlib-sysid
    SUNWPython
    SUNWbzip
    SUNWxwrtl
    SUNWTk
    SUNWTcl
    SUNWlexpt
    SUNWperl584core


As last versions of packages have dependences, for example SUNWcs is installing SUNWgccruntime, SUNWPython is installing packages SUNWTk and SUNWTcl. But finally I got installed system with size about 280 mb - it's a smaller than 3 Gb;)
I use the same commands as in Edward's blog (I'm running Solaris Express):

  • zpool create -f rpool c1t1d0s0
    zfs set compression=on rpool
    zfs create -p rpool/ROOT/indy/opt
    zfs set canmount=noauto rpool/ROOT/indy
    zfs set canmount=noauto rpool/ROOT/indy/opt
    zfs set mountpoint=legacy rpool/ROOT/indy
    zfs set mountpoint=legacy rpool/ROOT/indy/opt

    # we're going to do our install in /a
    PKG_IMAGE=/a; export PKG_IMAGE

    # mount our zpool on /a
    mkdir -p $PKG_IMAGE
    mount -F zfs rpool/ROOT/indy $PKG_IMAGE
    mkdir -p $PKG_IMAGE/opt
    mount -F zfs rpool/ROOT/indy/opt $PKG_IMAGE/opt

For Solaris Express you must install pkg (not required if you're booting from OpenSolars or MilaX LiveCD):


  • hg clone ssh://anon@hg.opensolaris.org/hg/pkg/gate
    cd gate/src
    make install

    # create the basic opensolaris install image..
    pkg image-create -F -a opensolaris.org=http://pkg.opensolaris.org $PKG_IMAGE
    pkg refresh



Note: I use here list of basic packages - pkg.txt (see above):

  • for pkg in `cat pkg.txt`; do pkg install $pkg; done

Next:

  • # seed the initial smf repository
    cp $PKG_IMAGE/lib/svc/seed/global.db $PKG_IMAGE/etc/svc/repository.db
    chmod 0600 $PKG_IMAGE/etc/svc/repository.db
    chown root:sys $PKG_IMAGE/etc/svc/repository.db

    # setup smf profiles
    ln -s ns_files.xml $PKG_IMAGE/var/svc/profile/name_service.xml
    ln -s generic_limited_net.xml $PKG_IMAGE/var/svc/profile/generic.xml
    ln -s inetd_generic.xml $PKG_IMAGE/var/svc/profile/inetd_services.xml
    ln -s platform_none.xml $PKG_IMAGE/var/svc/profile/platform.xml

    # mark the new system image as uninstalled
    sysidconfig -b $PKG_IMAGE -a /lib/svc/method/sshd
    touch $PKG_IMAGE/etc/.UNCONFIGURED

    # configure our new /etc/vfstab
    printf "rpool/ROOT/indy -/t//t/tzfs/t-/tno/t-/n" >> $PKG_IMAGE/etc/vfstab
    chmod a+r $PKG_IMAGE/etc/vfstab

    # turn off root as a role
    printf "/^root::::type=role;/ns/^root::::type=role;/root:::://nw" |/
    ed -s $PKG_IMAGE/etc/user_attr

    # delete the "jack" user
    printf "/^jack:/d/nw" | ed -s $PKG_IMAGE/etc/passwd
    chmod u+w $PKG_IMAGE/etc/shadow
    printf "/^jack:/d/nw" | ed -s $PKG_IMAGE/etc/shadow
    chmod u-w $PKG_IMAGE/etc/shadow

    # copy of my existing host sshd keys
    cp -p /etc/ssh/*key* $PKG_IMAGE/etc/ssh

    # configure /dev in the new image
    devfsadm -R $PKG_IMAGE
    ln -s ../devices/pseudo/sysmsg@0:msglog $PKG_IMAGE/dev/msglog

    # update the boot archive in the new image
    bootadm update-archive -R $PKG_IMAGE

    # update to the latest version of grub (this command generated
    # some errors which i ignored).
    $PKG_IMAGE/boot/solaris/bin/update_grub -R $PKG_IMAGE

    # create an informational grub menu in the install image that
    # points us to the real grub menu.
    cat <<-EOF > $PKG_IMAGE/boot/grub/menu.lst

    #########################################################################
    # #
    # For zfs root, menu.lst has moved to /rpool/boot/grub/menu.lst. #
    # #
    #########################################################################
    EOF

    # create the new real grub menu
    cat <<-EOF > /rpool/boot/grub/menu.lst2
    default 0
    timeout 10
    splashimage /boot/grub/splash.xpm.gz

    title Solaris 2008.11 console
    findroot (pool_rpool,0,a)
    bootfs rpool/ROOT/indy
    kernel/$ /platform/i86pc/kernel//$ISADIR/unix -k -B /$ZFS-BOOTFS,console=ttya
    module/$ /platform/i86pc//$ISADIR/boot_archive

    EOF

    # make the grub menu files readable by everyone.
    chmod a+r $PKG_IMAGE/boot/grub/menu.lst
    chmod a+r /rpool/boot/grub/menu.lst

    # setup /etc/bootsign so that grub can find this zpool
    mkdir -p /rpool/etc
    echo pool_rpool > /rpool/etc/bootsign

    umount $PKG_IMAGE/opt
    umount $PKG_IMAGE
    reboot

After reboot you get the console version of OpenSolaris with which you can do all that you want. Next you can install only those packages which are necessary for you. For example it's useful to owners of old notebooks. This installation can be made from an OpenSolaris LiveCD in text mode or with help of a MilaX LiveCD (where's ipkg is included).
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值