diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2013-03-24 14:28:53 +0000 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2013-03-24 14:28:53 +0000 |
commit | 1be28d153669275cdceb86a183c52e19558c7b5d (patch) | |
tree | c211c059a326526581dfc7b7cf786c45cb44aa06 /protostar | |
parent | 95e6d1944459354f0cd589fdbe11fbf3a6680863 (diff) | |
download | live-1be28d153669275cdceb86a183c52e19558c7b5d.tar.gz |
Cleanup
Diffstat (limited to 'protostar')
-rwxr-xr-x | protostar | 46 |
1 files changed, 27 insertions, 19 deletions
@@ -2,6 +2,7 @@ set -e set -u +set -x TMP="${TMP:-/var/tmp}" @@ -27,8 +28,8 @@ rm -rf "${ROOT}"/* echo "Preparing base system (debootstrap)..." debootstrap \ --no-check-gpg \ - --exclude=syslogd,gawk,aptitude \ - --include=illumos-grub,illumos-kernel,mc,vim-nox,openssh-client,wget,bzip2,xz-utils,debootstrap,less \ + --exclude=syslogd,gawk,aptitude,aptitude-common \ + --include=illumos-grub,illumos-kernel,mc,vim-tiny,openssh-client,openssh-server,wget,bzip2,xz-utils,debootstrap,less \ "${DIST}" \ "${ROOT}" \ "${REPO}" @@ -45,6 +46,8 @@ rm -rf "${ROOT}"/usr/share/doc/* devfsadm -r "${ROOT}" +sed -i '/^PermitRootLogin/ s,no,yes,' /etc/ssh/sshd_config + cat <<BOOTENV > $ROOT/boot/solaris/bootenv.rc setprop ata-dma-enabled 1 setprop atapi-cd-dma-enabled 1 @@ -68,8 +71,6 @@ cat <<VFSTAB > $ROOT/etc/vfstab VFSTAB -echo 'export LD_NOVERSION=1' >> $ROOT/etc/profile - echo "dyson-${DIST}-live" > "${ROOT}/etc/nodename" touch "${ROOT}/etc/hostname.e1000g0" touch "${ROOT}/etc/dhcp.e1000g0" @@ -78,30 +79,23 @@ touch "${ROOT}/etc/dhcp.e1000g0" echo 'root:root' | chpasswd -R "$ROOT" # Script to find and mount usr.lzma: -sed "s/USR_IMG/$USR_IMG/" "find-usr" > "${ROOT}/lib/svc/method/find-usr" -chmod +x "${ROOT}/lib/svc/method/find-usr" -sed -i '/readvfstab "\/usr"/i /lib/svc/method/find-usr >/dev/msglog 2>&1' \ - "${ROOT}/lib/svc/method/fs-root" - -# WE DON"T NEED BOOTARCHIVE ON LIVECD. -# Thank you! -sed -i '/if \[ -f "${UPDATEFILE}" \]; then/ i exit $SMF_EXIT_OK' \ - "${ROOT}/lib/svc/method/fs-usr" +sed "s/##USR_IMG##/$USR_IMG/g" "fs-root" > "${ROOT}/lib/svc/method/fs-root" +chmod +x "${ROOT}/lib/svc/method/fs-root" + dummy_prog='#!/sbin/sh exit 0 ' +echo "$dummy_prog" > "${ROOT}/lib/svc/method/fs-usr" echo "$dummy_prog" > "${ROOT}/lib/svc/method/boot-archive" echo "$dummy_prog" > "${ROOT}/lib/svc/method/boot-archive-update" echo "Importing manifests..." -rm "${ROOT}/lib/svc/manifest/system/early-manifest-import.xml" - +rm -f "${ROOT}/etc/svc/repository.db" # bash or ksh, please: bash "${ROOT}/lib/svc/method/manifest-import" \ -f "${ROOT}/etc/svc/repository.db" \ -d "${ROOT}/lib/svc/manifest" - # Thank you! Bye-bye! echo "$dummy_prog" > "${ROOT}/lib/svc/method/manifest-import" @@ -112,12 +106,22 @@ mkdir -p "${BOOTARCH}/cdrom" ( cd "${ROOT}" +# Move some critical libs: march=`dpkg-architecture -qDEB_HOST_MULTIARCH` mkdir -p lib/$march for lib in \ + libdiskmgt \ + libexacct \ libfmevent \ + libidmap \ + libipmi \ liblzma \ + libpool \ + libproject \ + libsmbios \ libsunavl \ + libtecla \ + libtopo \ libxml2 \ libz \ libzonecfg \ @@ -126,6 +130,12 @@ for lib in \ mv -v -f usr/lib/$lib.so.* lib/$march/ done +# Move usr/sbin to sbin: +find usr/sbin -type l -delete +mv usr/sbin/* sbin/ +rm -rf usr/sbin +ln -sf ../../sbin usr/sbin + # List here files or directories which # should be *moved* to boot archive. # Caution: files from /usr require @@ -162,7 +172,6 @@ tar -c -f - \ usr/bin/sh \ usr/lib/fs \ usr/lib/devfsadm \ - usr/sbin \ | tar xf - -C "${BOOTARCH}" # We need only kernel itself for GRUB. @@ -176,7 +185,7 @@ echo "Making boot archive..." sync; sync size=$(du -s -m "${BOOTARCH}" | cut -f1) -((size+=10)) # +10 MB of free space +((size+=20)) # +20 MB of free space dd if=/dev/zero of="${ROOT}/boot/boot_archive" bs=1M count="$size" lofidev=$(lofiadm -a "${ROOT}/boot/boot_archive") rlofidev="${lofidev/lofi/rlofi}" @@ -190,7 +199,6 @@ rmdir "${BOOTARCH}" rmdir "${ROOT}/boot/boot_archive.mount" gzip -9 -f "${ROOT}/boot/boot_archive" - echo "Making usr archive..." # usr will be mounted from usr.lzma: genisoimage \ |