Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Feature: unpack plain tgz and pkg files also from subdirs named after the running kernel's version. #27

Merged
merged 2 commits into from

2 participants

@KillerDiller

Helps keep tgz and pkg files separate for different kernel versions and simplifies switching between kernel versions.

Stefan Paletta added some commits
Stefan Paletta Feature: unpack plain tgz and pkg files also from subdirs named after…
… the running kernel's version. Helps keep tgz and pkg files separate for different kernel versions and simplyfies switching between kernel versions.
e329c48
Stefan Paletta Documentation for osrelease subdirectories in /flash and /flash/pkg. 72f7b26
@jryberg jryberg merged commit ab50eea into openbsd:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 14, 2013
  1. Feature: unpack plain tgz and pkg files also from subdirs named after…

    Stefan Paletta authored
    … the running kernel's version. Helps keep tgz and pkg files separate for different kernel versions and simplyfies switching between kernel versions.
This page is out of date. Refresh to see the latest.
Showing with 19 additions and 13 deletions.
  1. +15 −11 README.md
  2. +3 −1 initial-conf/rc.initial
  3. +1 −1  initial-conf/rc.pkg
View
26 README.md
@@ -117,21 +117,25 @@ upgrade.
# Customisation
-The system support customisation in three different ways.
+The system supports customisation in three different ways.
-1. Any file that you add to the root of the flash-card (/flash) that has the
-tgz-extension is automatically extracted to the ramdisk during boot. This is
-useful for small extensions or configuration that you can distribute in a
-single tgz-package. Files can also be added to the /flash/conf directory, they
-are then automatically copied (not extracted) to the ramdisk during boot.
+1. Any *.tgz file that you add to the root of the flash-card (/flash) or
+the release-dependent subdirectory (e.g. /flash/5.3 for a 5.3 kernel) is
+automatically extracted to the ramdisk during boot. This is useful for small
+extensions or configuration that you can distribute in a single tgz-package.
+Files can also be added to the /flash/conf directory, they are then
+automatically copied (not extracted) to the respective location in the
+ramdisk during boot, e.g. /flash/conf/etc/myname will end up as /etc/myname
+when the system has booted.
2. There is also an option in rc.conf to create a second ramdisk in
/usr/local. By default this is not done at all to save memory on the device.
-If activated this will also extract any files located in /flash/pkg/ ending
-with the tgz-extension to /usr/local. This provides an excellent way to add
-packages directly from the OpenBSD ftp-server without needing to expand the
-original ramdisk. The rc-script will even remove some unnecessary files from
-the packages such as man-pages and files needed only for compiling.
+If activated this will also extract any *.tgz files located in /flash/pkg and
+the release-dependent subdirectory (e.g. /flash/pkg/5.3 for a 5.3 kernel)
+to /usr/local. This provides an excellent way to add packages directly from the
+OpenBSD ftp-server without needing to expand the original ramdisk. The
+rc-script will even remove some unnecessary files from the packages such as
+man-pages and files needed only for compiling.
3. Recompile a kernel that suits your needs and that includes or excludes the
binaries and libs that you need for your application. Change the list to
View
4 initial-conf/rc.initial
@@ -104,10 +104,12 @@ if [ X"${initial_config}" = X"YES" ] ; then
echo "Running createconfig"; createconfig
fi
+osrelease=`sysctl -n kern.osrelease`
+
# Mount /flash rw for now so we can write later if needed;
# will remount with fstab settings at the end.
if mount -o rw,sync,noatime /flash >/dev/null 2>&1 ; then
- for x in /flash/*.tgz ; do
+ for x in /flash/${osrelease:-unknown}/*.tgz /flash/*.tgz ; do
if [ -r $x ]; then
echo -n "Unpacking tarball ${x} from flash... "
if ! tar zxpf $x ; then
View
2  initial-conf/rc.pkg
@@ -10,7 +10,7 @@ if [ X"${usrlocal_size}" != X"NO" ]; then
echo "Unpacking packages..."
cd /usr/local
- for pkg in /flash/pkg/*.tgz ; do
+ for pkg in /flash/pkg/${osrelease:-unknown}/*.tgz /flash/pkg/*.tgz ; do
if [ -r $pkg ]; then
echo -n "Unpacking package ${pkg} from flash... "
cpio -idz -H tar -f \
Something went wrong with that request. Please try again.