Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,23 @@ dhcpcd-9 defaults the run directory to `/var/run/dhcpcd` instead of

To create a statically-linked .deb package for Drivenets (baseos, interfacehandler, containers):

1. **Configure and build:**
1. **Configure and build from the repository root:**
```bash
./configure --libexecdir="/usr/lib/dhcpcd" --enable-static CFLAGS="-Os -g"
./configure --libexecdir="/usr/lib/dhcpcd" --enable-static --without-udev CFLAGS="-Os -g"
make
```

2. **Install to package directory:**
2. **Install to package directory from the repository root:**
```bash
make install DESTDIR=/path/to/dhcpcd_<VERSION>-dn_amd64
VERSION=10.0.6-dn_81498e4e
PKGDIR="$PWD/src/dhcpcd_${VERSION}-dn_amd64"
make install DESTDIR="$PKGDIR"
```
Replace `<VERSION>` with the actual version (e.g., `10.0.6`).
Replace `VERSION` with the actual package version. `DESTDIR` should be an
absolute path: the top-level install enters both `src/` and `hooks/`, and a
relative `DESTDIR` would be interpreted separately from each subdirectory.
Running `make install` from `src/` skips `hooks/` entirely and omits
`/usr/lib/dhcpcd/dhcpcd-run-hooks`.

3. **Add Debian control files:**

Expand Down
19 changes: 16 additions & 3 deletions src/if-options.c
Original file line number Diff line number Diff line change
Expand Up @@ -1974,9 +1974,22 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
case O_VENDCLASS:
ARG_REQUIRED;
fp = strwhite(arg);
if (fp)
*fp++ = '\0';
u = (uint32_t)strtou(arg, NULL, 0, 0, UINT32_MAX, &e);
bp = NULL;
/* Command line options are parsed globally and then replayed
* per-interface using the same argv, so do not split optarg
* in-place. Later passes still need the data after the EN. */
if (fp) {
dl = (size_t)(fp - arg);
bp = malloc(dl + 1);
if (!bp) {
logerr(__func__);
return -1;
}
memcpy(bp, arg, dl);
bp[dl] = '\0';
}
u = (uint32_t)strtou(bp ? bp : arg, NULL, 0, 0, UINT32_MAX, &e);
free(bp);
if (e) {
logerrx("invalid code: %s", arg);
return -1;
Expand Down