From owner-freebsd-bugs@freebsd.org Mon Apr 1 22:25:41 2019 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34A8B15708E8 for ; Mon, 1 Apr 2019 22:25:41 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id C08308C758 for ; Mon, 1 Apr 2019 22:25:40 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 7BA7B15708E4; Mon, 1 Apr 2019 22:25:40 +0000 (UTC) Delivered-To: bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57BDB15708E1 for ; Mon, 1 Apr 2019 22:25:40 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C7B588C755 for ; Mon, 1 Apr 2019 22:25:39 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id 2223F1BBAE for ; Mon, 1 Apr 2019 22:25:39 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id x31MPcJ9030438 for ; Mon, 1 Apr 2019 22:25:38 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id x31MPcxf030437 for bugs@FreeBSD.org; Mon, 1 Apr 2019 22:25:38 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 236949] Attempt to provide a boot profile manager Date: Mon, 01 Apr 2019 22:25:38 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: misc X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: phascolarctos@protonmail.ch X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Apr 2019 22:25:41 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D236949 Bug ID: 236949 Summary: Attempt to provide a boot profile manager Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: misc Assignee: bugs@FreeBSD.org Reporter: phascolarctos@protonmail.ch Created attachment 203310 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D203310&action= =3Dedit boot profile manager rc script At the moment, as far as I know, it is not possible in FreeBSD to have different profiles to select services at startup. For example, I can not de= cide at boot time to start netif on my laptop if and only if I have access to a connection: my choices are to always start it at boot or to always start it= by hand after boot. My rc script aims to give users choice at boot time. The service is called "boot_profile_manager" and is of course activated by setting boot_profile_manager=3D"YES" into rc.conf (but do not use rc.conf.d= : see later). The script should be the first service started on the system: I tried to de= fine this condition by setting "BEFORE: systcl". At boot time it will print a numbered list of profiles given by the variable $boot_profile_manager_profi= les that must be defined in rc.conf -- e.g, if boot_profile_manager=3D"default no_network testing", the menu will be: 1. default 2. no_network 3. testing To each profile must correpond a directory into /usr/local/etc/boot_profile_manager. Thus in the example we will have the directories /usr/local/etc/boot_profile_manager/default, /usr/local/etc/boot_profile_manager/no_network and /usr/local/etc/boot_profile_manager/testing. When user selects a profile, /etc/rc.conf.d becomes a symlink to the direct= ory of the selected profile. Thus if user selects profile 2 of our example, then /etc/rc.conf.d will be a symlink to /usr/local/etc/boot_profile_manager/no_network. (To be able to make the symlink, / is temporarly mounted rw and then restor= ed read-only.) A timeout is set by default to 5 seconds in case user does not select any profile and can be set to any value through "boot_profile_manager_timeout" variable: after the timeout, profile 1 is selected by default. That way users can put in /etc/rc.conf any configuration common to all prof= iles (e.g. hostname) and use directories into /usr/local/etc/boot_profile_manage= r as choices for /etc/rc.conf.d. I have tested successfully my script in a virtual machine running 13.0-CURR= ENT r345444 through bhyve and in my own system running 12.0-STABLE r345758. I think it would be nice to include this service into base system, but feel free to ask me to make a port of it if it would be preferable. Of course, I will be glad to make any modification required to meet standar= ds, improve quality etc. and I will write a manpage once the final version will= be ready. --=20 You are receiving this mail because: You are the assignee for the bug.=