📄 gen
字号:
#!/bin/sh# @(#)buildroot 1.1 (ULTRIX) 3/2/89# Usage: example: sh buildroot ra0 /library/Ultrix## Description: build the Generic ROOT file system in a dumpimage#------------------------------------------------------------------## 002 - Nov, 1987 - Tom Tresvik. # Change the interface so that it can be called by the build # script 'buildultrix'. The ROOT image is produced on the # output pack in .../usr/sys/dist/kitimages/ROOT## 001 - June, 1986 - Lea Fottfredsen & Tung-Ning Cherng# Added in the network remote support.## 000 - March, 31, 1986 - Tung-Ning Cherng# Revised for V2.0.## Based on V1.2 'buildroot' - by Greg Tarsa and Bob Fontaine #PATH=.:/etc:/bin:/usr/bin:/usr/ucbexport PATHumask 022# We must have 2 command line argscase $# in2) ;;*) echo "Usage: example: sh buildroot ra1 /library/Ultrix" exit 1 ;;esac GENROOT=$1 # for example, ra0MASTERROOT=$2 # for example, /library/UltrixDEST=${MASTERROOT}/usr/sys/dist/kitimagesUPGRADE=upgrade2#UPGRADE=upgrade64## Define the lists of files to be installed in the ROOT image.#ROOT_FILES=" vmunix ultrixboot vmb.exe pcs750.bin"ETC_FILES=" etc/newfs etc/mkfs etc/halt etc/mount etc/mknod etc/fsck etc/umount etc/ufs_mount etc/chpt etc/radisk etc/passwd etc/disktab etc/ifconfig etc/protocols etc/rshd etc/services"BIN_FILES=" bin/sh bin/sh5 bin/ls bin/mv bin/sync bin/cat bin/mkdir bin/stty bin/echo bin/rm bin/cp bin/expr bin/awk bin/make bin/test bin/ed bin/true bin/false bin/ln bin/tee bin/date bin/chmod bin/sed bin/pwd bin/passwd bin/mt bin/hostname bin/ps bin/df bin/init bin/restore bin/dump"INSTALL_FILES=" usr/sys/dist/install.2 usr/sys/dist/install.3 usr/sys/dist/ask_filesys usr/sys/dist/ask_part usr/sys/dist/delet_part usr/sys/dist/size_part usr/sys/dist/finder usr/ucb/compress usr/ucb/rsh usr/ucb/rcp usr/ucb/grep usr/ucb/whoami usr/bin/egrep usr/bin/sleep etc/eli etc/sizer etc/setld etc/doconfig etc/fverify etc/fitset etc/ready bin/tar bin/dd"## test the environment, can we access the device and write to the# destination directory#[ -f /dev/${GENROOT} ] ||{ echo "/dev/${GENROOT}a does not exist" exit 1}[ -d $DEST ] || mkdir $DEST( > ${DEST}/foo ) ||{ echo "Cannot write ${MASTERROOT}/usr/sys/dist/kitimages" exit 1}rm -f ${DEST}/foo## The environment looks ok so let's proceed##echo -n "ARE YOU SURE YOU WANT TO DESTROY /dev/${GENROOT}? y/n"#read xx#case $xx in#y|Y)#;;#*)#exit 1#;;#esac umount /dev/${GENROOT} > /dev/null 2>&1echo "Making and checking the Generic ROOT filesystem on ${GENROOT}" mkfs /dev/r${GENROOT} 16384 16384 1 8192 1024 ||{ echo "Cannot make the Generic ROOT file system" exit 1 }[ -d /ROOT_mnt ] || mkdir /ROOT_mntecho "Mounting "${GENROOT}" on /ROOT_mnt."mount /dev/${GENROOT} /ROOT_mnt ||{ echo "Cannot mount the Generic ROOT file system" rmdir /ROOT_mnt exit 1 }cd /ROOT_mntrm -rf lost+found## Install files to the Generic ROOT file system#echo "Starting the build of the Generic ROOT."# make top level directoriesfor K in bin etc tmp usr dev install.tmp mnt { mkdir $K}chmod 777 tmpfor prog in $ROOT_FILESdo cp ${MASTERROOT}/$prog .done# Special filescp ${MASTERROOT}/usr/sys/dist/.rootprofile .profilecp ${MASTERROOT}/.profile real.profilecp ${MASTERROOT}/usr/sys/dist/log tmpcp ${MASTERROOT}/usr/sys/dist/upgrade/${UPGRADE} upgradefor prog in $INSTALL_FILESdo cp ${MASTERROOT}/$prog install.tmpdonefor prog in $ETC_FILESdo cp ${MASTERROOT}/$prog etcdonefor prog in $BIN_FILESdo cp ${MASTERROOT}/$prog bindoneln bin/test bin/[ # put the square bracket into the directoryln bin/stty bin/STTY(cd etc ; ln ../bin/init init)# build necessary special filescp ${MASTERROOT}/dev/MAKEDEV dev cd dev./MAKEDEV DECstationcd .. echo "Root build is complete."cd ${DEST}echo "Unmounting and checking ${GENROOT}."umount /dev/${GENROOT}rmdir /ROOT_mntfsck /dev/r${GENROOT}rm -f ROOTecho "Dumping /dev/r${GENROOT} to ROOT."dump 0f ROOT /dev/r${GENROOT}echo "Buildroot done."
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -