Browse Source

build: write nano like serial, refactor LABEL handling

pull/57/head
Franco Fichtner 3 years ago
parent
commit
b721d322ab
5 changed files with 28 additions and 49 deletions
  1. +0
    -1
      build/common.sh
  2. +4
    -9
      build/dvd.sh
  3. +18
    -29
      build/nano.sh
  4. +3
    -5
      build/serial.sh
  5. +3
    -5
      build/vga.sh

+ 0
- 1
build/common.sh View File

@ -191,7 +191,6 @@ fi
export CPUS=$(sysctl kern.smp.cpus | awk '{ print $2 }')
export CONFIG_XML="/usr/local/etc/config.xml"
export ABI_FILE="/usr/lib/crt1.o"
export LABEL=${PRODUCT_NAME}
export ENV_FILTER="env -i USER=${USER} LOGNAME=${LOGNAME} HOME=${HOME} \
SHELL=${SHELL} BLOCKSIZE=${BLOCKSIZE} MAIL=${MAIL} PATH=${PATH} \
TERM=${TERM} HOSTTYPE=${HOSTTYPE} VENDOR=${VENDOR} OSTYPE=${OSTYPE} \

+ 4
- 9
build/dvd.sh View File

@ -33,10 +33,8 @@ SELF=dvd
check_image ${SELF} ${@}
DVD="${IMAGESDIR}/${PRODUCT_RELEASE}-dvd-${PRODUCT_ARCH}.iso"
# rewrite the disk label, because we're install media
LABEL="${LABEL}_Install"
DVDIMAGE="${IMAGESDIR}/${PRODUCT_RELEASE}-dvd-${PRODUCT_ARCH}.iso"
DVDLABEL=$(echo "${PRODUCT_NAME}_Install" | tr '[:lower:]' '[:upper:]')
sh ./clean.sh ${SELF}
@ -48,9 +46,6 @@ setup_extras ${STAGEDIR}/work ${SELF}
setup_mtree ${STAGEDIR}/work
setup_entropy ${STAGEDIR}/work
# must be upper case:
LABEL=$(echo ${LABEL} | tr '[:lower:]' '[:upper:]')
UEFIBOOT=
if [ ${PRODUCT_ARCH} = "amd64" -a -n "${PRODUCT_UEFI}" ]; then
dd if=/dev/zero of=${STAGEDIR}/efiboot.img bs=4k count=200
@ -71,12 +66,12 @@ echo -n ">>> Building dvd image... "
cat > ${STAGEDIR}/work/etc/fstab << EOF
# Device Mountpoint FStype Options Dump Pass #
/dev/iso9660/${LABEL} / cd9660 ro 0 0
/dev/iso9660/${DVDLABEL} / cd9660 ro 0 0
tmpfs /tmp tmpfs rw,mode=01777 0 0
EOF
makefs -t cd9660 ${UEFIBOOT} \
-o 'bootimage=i386;'"${STAGEDIR}"'/work/boot/cdboot' -o no-emul-boot \
-o label=${LABEL} -o rockridge ${DVD} ${STAGEDIR}/work
-o label=${DVDLABEL} -o rockridge ${DVDIMAGE} ${STAGEDIR}/work
echo "done"

+ 18
- 29
build/nano.sh View File

@ -41,39 +41,28 @@ if [ -n "${1}" ]; then
fi
NANOIMG="${IMAGESDIR}/${PRODUCT_RELEASE}-nano-${PRODUCT_ARCH}.img"
NANOBASE="${STAGEDIR}/nanobase"
NANOSIZE=$(echo ${NANOSIZE} | tr '[:upper:]' '[:lower:]')
NANOLABEL="${PRODUCT_NAME}_Nano"
sh ./clean.sh ${SELF}
setup_stage ${STAGEDIR} mnt
setup_stage ${STAGEDIR}
setup_base ${STAGEDIR}
setup_kernel ${STAGEDIR}
setup_packages ${STAGEDIR}
setup_extras ${STAGEDIR} ${SELF}
setup_entropy ${STAGEDIR}
truncate -s ${NANOSIZE} ${NANOBASE}
MD=$(mdconfig -f ${NANOBASE})
newfs /dev/${MD}
tunefs -L ${LABEL} /dev/${MD}
mount /dev/${MD} ${STAGEDIR}/mnt
setup_base ${STAGEDIR}/mnt
# need these again later
cp -r ${STAGEDIR}/mnt/boot ${STAGEDIR}
setup_kernel ${STAGEDIR}/mnt
setup_packages ${STAGEDIR}/mnt
setup_extras ${STAGEDIR}/mnt ${SELF}
setup_entropy ${STAGEDIR}/mnt
cat > ${STAGEDIR}/mnt/etc/fstab << EOF
/dev/ufs/${LABEL} / ufs rw,async,noatime 1 1
cat > ${STAGEDIR}/etc/fstab << EOF
# Device Mountpoint FStype Options Dump Pass#
/dev/ufs/${NANOLABEL} / ufs rw 1 1
EOF
umount ${STAGEDIR}/mnt
mdconfig -d -u ${MD}
echo -n ">>> Building nano image... "
mkimg -s bsd -o ${NANOIMG} \
-b ${STAGEDIR}/boot/boot \
-p freebsd-ufs:=${NANOBASE}
makefs -t ffs -s ${NANOSIZE} -B little \
-o label=${NANOLABEL} ${NANOIMG} ${STAGEDIR}
echo "done"
DEV=$(mdconfig -a -t vnode -f "${NANOIMG}" -x 63 -y 255)
gpart create -s BSD "${DEV}"
gpart bootcode -b "${STAGEDIR}"/boot/boot "${DEV}"
gpart add -t freebsd-ufs "${DEV}"
mdconfig -d -u "${DEV}"

+ 3
- 5
build/serial.sh View File

@ -35,9 +35,7 @@ SELF=serial
check_image ${SELF} ${@}
SERIALIMG="${IMAGESDIR}/${PRODUCT_RELEASE}-serial-${PRODUCT_ARCH}.img"
# rewrite the disk label, because we're install media
LABEL="${LABEL}_Install"
SERIALLABEL="${PRODUCT_NAME}_Install"
sh ./clean.sh ${SELF}
@ -51,11 +49,11 @@ setup_entropy ${STAGEDIR}
cat > ${STAGEDIR}/etc/fstab << EOF
# Device Mountpoint FStype Options Dump Pass#
/dev/ufs/${LABEL} / ufs ro,noatime 1 1
/dev/ufs/${SERIALLABEL} / ufs ro,noatime 1 1
tmpfs /tmp tmpfs rw,mode=01777 0 0
EOF
makefs -t ffs -B little -o label=${LABEL} ${SERIALIMG} ${STAGEDIR}
makefs -t ffs -B little -o label=${SERIALLABEL} ${SERIALIMG} ${STAGEDIR}
DEV=$(mdconfig -a -t vnode -f "${SERIALIMG}")
gpart create -s BSD "${DEV}"

+ 3
- 5
build/vga.sh View File

@ -34,9 +34,7 @@ SELF=vga
check_image ${SELF} ${@}
VGAIMG="${IMAGESDIR}/${PRODUCT_RELEASE}-vga-${PRODUCT_ARCH}.img"
# rewrite the disk label, because we're install media
LABEL="${LABEL}_Install"
VGALABEL="${PRODUCT_NAME}_Install"
sh ./clean.sh ${SELF}
@ -50,11 +48,11 @@ setup_entropy ${STAGEDIR}/work
cat > ${STAGEDIR}/work/etc/fstab << EOF
# Device Mountpoint FStype Options Dump Pass#
/dev/ufs/${LABEL} / ufs ro,noatime 1 1
/dev/ufs/${VGALABEL} / ufs ro,noatime 1 1
tmpfs /tmp tmpfs rw,mode=01777 0 0
EOF
makefs -B little -o label=${LABEL} ${STAGEDIR}/root.part ${STAGEDIR}/work
makefs -B little -o label=${VGALABEL} ${STAGEDIR}/root.part ${STAGEDIR}/work
UEFIBOOT=
GPTDUMMY=

Loading…
Cancel
Save